@chrisflippen/blueprint-document-assembly 3.1.1 → 3.3.1

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.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ComponentType, CSSProperties, ReactNode, RefObject } from 'react';
2
+ import react__default, { ComponentType, CSSProperties, ReactNode, ErrorInfo, RefObject, Component } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface LogEntry {
@@ -18,9 +18,10 @@ interface Step {
18
18
  id: string;
19
19
  number: number;
20
20
  title: string;
21
- status: 'pending' | 'active' | 'processing' | 'completed';
21
+ status: 'pending' | 'active' | 'processing' | 'completed' | 'error';
22
22
  substeps?: SubStep[];
23
23
  documentSection?: string;
24
+ errorMessage?: string;
24
25
  logs: LogEntry[];
25
26
  icon?: ComponentType<{
26
27
  className?: string;
@@ -74,6 +75,7 @@ interface ClassNameSlots {
74
75
  }
75
76
  interface ThemeConfig {
76
77
  primary?: string;
78
+ accent?: string;
77
79
  secondary?: string;
78
80
  success?: string;
79
81
  processing?: string;
@@ -114,11 +116,9 @@ interface LayoutConfig {
114
116
  direction?: 'horizontal' | 'vertical';
115
117
  }
116
118
  interface ResolvedThemeColors {
117
- bg: string;
119
+ color: string;
120
+ mutedBg: string;
118
121
  border: string;
119
- text: string;
120
- icon: string;
121
- accent: string;
122
122
  }
123
123
  interface ResolvedTheme {
124
124
  primary: ResolvedThemeColors;
@@ -127,16 +127,17 @@ interface ResolvedTheme {
127
127
  processing: ResolvedThemeColors;
128
128
  warning: ResolvedThemeColors;
129
129
  stepStatus: Record<Step['status'], {
130
- cardBg: string;
130
+ color: string;
131
+ mutedBg: string;
131
132
  border: string;
132
- iconBg: string;
133
- textColor: string;
133
+ iconGradient: string;
134
134
  }>;
135
135
  gradients: {
136
136
  progress: string;
137
137
  title: string;
138
138
  completion: string;
139
139
  };
140
+ cssVars: Record<string, string>;
140
141
  }
141
142
  interface AnimationPreset {
142
143
  name: string;
@@ -199,6 +200,12 @@ interface UseDocumentAssemblyOptions {
199
200
  onPause?: () => void;
200
201
  onResume?: () => void;
201
202
  onReset?: () => void;
203
+ externalMode?: boolean;
204
+ onError?: (error: {
205
+ stepIndex: number;
206
+ stepId: string;
207
+ message: string;
208
+ }) => void;
202
209
  }
203
210
  interface UseDocumentAssemblyReturn {
204
211
  steps: Step[];
@@ -220,6 +227,15 @@ interface UseDocumentAssemblyReturn {
220
227
  reset: () => void;
221
228
  goToStep: (stepIndex: number) => void;
222
229
  setShowWholeDocument: (show: boolean) => void;
230
+ updateStep: (stepIndex: number, update: Partial<Pick<Step, 'status' | 'errorMessage'>>) => void;
231
+ addLog: (stepIndex: number, substepId: string | null, level: LogEntry['level'], message: string) => void;
232
+ updateMetrics: (metrics: Partial<DocumentMetrics> | ((prev: DocumentMetrics) => DocumentMetrics)) => void;
233
+ completeStep: (stepIndex: number) => void;
234
+ completeSubstep: (stepIndex: number, substepId: string) => void;
235
+ setStepError: (stepIndex: number, message: string) => void;
236
+ retryStep: (stepIndex: number) => void;
237
+ getSnapshot: () => AssemblySnapshot;
238
+ restoreSnapshot: (snapshot: AssemblySnapshot) => void;
223
239
  }
224
240
  interface BlueprintDocumentAssemblyRef {
225
241
  start: () => void;
@@ -227,6 +243,23 @@ interface BlueprintDocumentAssemblyRef {
227
243
  resume: () => void;
228
244
  reset: () => void;
229
245
  goToStep: (stepIndex: number) => void;
246
+ updateStep: (stepIndex: number, update: Partial<Pick<Step, 'status' | 'errorMessage'>>) => void;
247
+ addLog: (stepIndex: number, substepId: string | null, level: LogEntry['level'], message: string) => void;
248
+ updateMetrics: (metrics: Partial<DocumentMetrics> | ((prev: DocumentMetrics) => DocumentMetrics)) => void;
249
+ completeStep: (stepIndex: number) => void;
250
+ completeSubstep: (stepIndex: number, substepId: string) => void;
251
+ setStepError: (stepIndex: number, message: string) => void;
252
+ retryStep: (stepIndex: number) => void;
253
+ getDocumentContentRef: () => HTMLDivElement | null;
254
+ getDocumentHTML: () => string | null;
255
+ }
256
+ interface AssemblySnapshot {
257
+ steps: Step[];
258
+ completedSections: string[];
259
+ completedSubsteps: string[];
260
+ metrics: DocumentMetrics;
261
+ currentStep: number;
262
+ timestamp: number;
230
263
  }
231
264
  interface StepItemProps$1 {
232
265
  step: Step;
@@ -291,6 +324,25 @@ interface WholeDocumentContentProps$1 {
291
324
  classNames?: ClassNameSlots;
292
325
  renderSection?: (section: DocumentSection) => ReactNode;
293
326
  }
327
+ interface VisibilityConfig {
328
+ header?: boolean;
329
+ leftPanel?: boolean;
330
+ rightPanel?: boolean;
331
+ metricsFooter?: boolean;
332
+ progressBar?: boolean;
333
+ }
334
+ interface RenderSlots {
335
+ header?: (props: {
336
+ labels: Required<LabelConfig>;
337
+ currentStep: number;
338
+ totalSteps: number;
339
+ progress: number;
340
+ }) => ReactNode;
341
+ footer?: (props: {
342
+ metrics: DocumentMetrics;
343
+ labels: Required<LabelConfig>;
344
+ }) => ReactNode;
345
+ }
294
346
  interface BlueprintDocumentAssemblyProps {
295
347
  /**
296
348
  * Array of steps to process in the document assembly
@@ -415,6 +467,43 @@ interface BlueprintDocumentAssemblyProps {
415
467
  * Callback when assembly is reset
416
468
  */
417
469
  onReset?: () => void;
470
+ /**
471
+ * External mode — disables the internal timer loop. Host drives state via ref methods.
472
+ * @default false
473
+ */
474
+ externalMode?: boolean;
475
+ /**
476
+ * Callback when a step encounters an error (external mode)
477
+ */
478
+ onError?: (error: {
479
+ stepIndex: number;
480
+ stepId: string;
481
+ message: string;
482
+ }) => void;
483
+ /**
484
+ * Portal target for the whole document view modal.
485
+ * - true = portal to document.body
486
+ * - string = CSS selector
487
+ * - HTMLElement = direct reference
488
+ * - undefined/false = no portal (current behavior)
489
+ */
490
+ portalTarget?: HTMLElement | string | boolean;
491
+ /**
492
+ * Control visibility of individual UI sections
493
+ */
494
+ visibility?: VisibilityConfig;
495
+ /**
496
+ * Custom render functions for header and footer slots
497
+ */
498
+ renderSlots?: RenderSlots;
499
+ /**
500
+ * Custom fallback UI for the error boundary
501
+ */
502
+ errorFallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
503
+ /**
504
+ * Callback when a render error is caught by the error boundary
505
+ */
506
+ onRenderError?: (error: Error, errorInfo: ErrorInfo) => void;
418
507
  }
419
508
 
420
509
  declare const BlueprintDocumentAssembly: react.ForwardRefExoticComponent<BlueprintDocumentAssemblyProps & react.RefAttributes<BlueprintDocumentAssemblyRef>>;
@@ -497,19 +586,43 @@ interface WholeDocumentViewProps {
497
586
  sparkleCount?: number;
498
587
  celebrationEnabled?: boolean;
499
588
  children?: React.ReactNode;
589
+ portalTarget?: HTMLElement | null;
590
+ contentRef?: RefObject<HTMLDivElement | null>;
500
591
  }
501
- declare function WholeDocumentView({ show, onClose, documentIds, metrics, classNames, labels, celebrationTitle, sparkleCount, celebrationEnabled, }: WholeDocumentViewProps): react_jsx_runtime.JSX.Element;
592
+ declare function WholeDocumentView({ show, onClose, documentIds, metrics, classNames, labels, celebrationTitle, sparkleCount, celebrationEnabled, portalTarget, contentRef: externalContentRef, }: WholeDocumentViewProps): react_jsx_runtime.JSX.Element;
502
593
 
503
594
  interface WholeDocumentContentProps {
504
595
  documentIds: DocumentIds;
505
596
  sections?: DocumentSection[];
506
597
  classNames?: ClassNameSlots;
507
598
  renderSection?: (section: DocumentSection) => React.ReactNode;
599
+ contentRef?: RefObject<HTMLDivElement | null>;
600
+ }
601
+ declare function WholeDocumentContent({ documentIds, sections, classNames, renderSection, contentRef, }: WholeDocumentContentProps): react_jsx_runtime.JSX.Element;
602
+
603
+ interface ErrorBoundaryProps {
604
+ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
605
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
606
+ children: ReactNode;
607
+ }
608
+ interface ErrorBoundaryState {
609
+ hasError: boolean;
610
+ error: Error | null;
611
+ }
612
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
613
+ constructor(props: ErrorBoundaryProps);
614
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
615
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
616
+ reset: () => void;
617
+ render(): ReactNode;
508
618
  }
509
- declare function WholeDocumentContent({ documentIds, sections, classNames, renderSection, }: WholeDocumentContentProps): react_jsx_runtime.JSX.Element;
510
619
 
511
620
  declare function resolveTheme(config?: ThemeConfig): ResolvedTheme;
512
- declare function getThemeSafelist(config?: ThemeConfig): string[];
621
+ /**
622
+ * @deprecated No longer needed — CSS variables replace the Tailwind safelist.
623
+ * Will be removed in v4.0.0.
624
+ */
625
+ declare function getThemeSafelist(_config?: ThemeConfig): string[];
513
626
  interface ThemeProviderProps {
514
627
  theme?: ThemeConfig;
515
628
  children: ReactNode;
@@ -518,6 +631,14 @@ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_j
518
631
  declare function useTheme(): ResolvedTheme;
519
632
  declare function useThemeOptional(): ResolvedTheme | null;
520
633
 
634
+ declare const TAILWIND_COLOR_MAP: Record<string, string>;
635
+ /** Resolve a color value: if it's a Tailwind name, return the hex; otherwise pass through */
636
+ declare function resolveColorValue(input: string): string;
637
+ /** Generate a CSS color-mix() expression for tinting/opacity effects */
638
+ declare function colorMix(color: string, percent: number, mixWith?: string): string;
639
+ /** Build the full --bda-* CSS variable map from a resolved theme config */
640
+ declare function buildCssVars(theme: Required<ThemeConfig>): Record<string, string>;
641
+
521
642
  interface AnimationContextValue {
522
643
  preset: AnimationPreset;
523
644
  reducedMotion: boolean;
@@ -615,4 +736,6 @@ declare function resetStepCounter(): void;
615
736
  */
616
737
  declare function resolveContent(content: string, documentIds: DocumentIds): string;
617
738
 
618
- export { type AnimationPreset, AnimationProvider, type AnimationTimings, BlueprintDocumentAssembly, type BlueprintDocumentAssemblyProps, type BlueprintDocumentAssemblyRef, CINEMATIC_PRESET, type ClassNameSlots, DEFAULT_LABELS, DEFAULT_STEPS, DEFAULT_STEP_LOGS, DEFAULT_SUBSTEP_LOGS, DEFAULT_THEME, type DocumentIds, DocumentLine, type DocumentLineProps$1 as DocumentLineProps, type DocumentMetrics, DocumentPreview, type DocumentPreviewProps$1 as DocumentPreviewProps, type DocumentSection, type DocumentSubsection, LEGAL_DOCUMENT_SECTIONS, LEGAL_WHOLE_DOCUMENT_SECTIONS, type LabelConfig, type LayoutConfig, LogContainer, type LogContainerProps$1 as LogContainerProps, type LogEntry, LogLine, type LogLineProps$1 as LogLineProps, MINIMAL_PRESET, type ResolvedTheme, type ResolvedThemeColors, SMOOTH_PRESET, SNAPPY_PRESET, SQUIGGLE_DOCUMENT_SECTIONS, SQUIGGLE_STEPS, SQUIGGLE_STEP_LOGS, SQUIGGLE_SUBSTEP_LOGS, SQUIGGLE_WHOLE_DOCUMENT_SECTIONS, STEP_ICON_MAP, type Step, StepItem, type StepItemProps$1 as StepItemProps, type SubStep, SubStepItem, type SubStepItemProps$1 as SubStepItemProps, type ThemeConfig, ThemeProvider, type UseDocumentAssemblyOptions, type UseDocumentAssemblyReturn, WholeDocumentContent, type WholeDocumentContentProps$1 as WholeDocumentContentProps, WholeDocumentView, type WholeDocumentViewProps$1 as WholeDocumentViewProps, createDocumentSection, createStep, createSubStep, getThemeSafelist, resetStepCounter, resolveContent, resolveTheme, useAnimation, useAnimationOptional, useDocumentAssembly, useReducedMotion, useResponsiveLayout, useTheme, useThemeOptional };
739
+ declare function injectStyle(id: string, css: string): void;
740
+
741
+ export { type AnimationPreset, AnimationProvider, type AnimationTimings, type AssemblySnapshot, BlueprintDocumentAssembly, type BlueprintDocumentAssemblyProps, type BlueprintDocumentAssemblyRef, CINEMATIC_PRESET, type ClassNameSlots, DEFAULT_LABELS, DEFAULT_STEPS, DEFAULT_STEP_LOGS, DEFAULT_SUBSTEP_LOGS, DEFAULT_THEME, type DocumentIds, DocumentLine, type DocumentLineProps$1 as DocumentLineProps, type DocumentMetrics, DocumentPreview, type DocumentPreviewProps$1 as DocumentPreviewProps, type DocumentSection, type DocumentSubsection, ErrorBoundary, LEGAL_DOCUMENT_SECTIONS, LEGAL_WHOLE_DOCUMENT_SECTIONS, type LabelConfig, type LayoutConfig, LogContainer, type LogContainerProps$1 as LogContainerProps, type LogEntry, LogLine, type LogLineProps$1 as LogLineProps, MINIMAL_PRESET, type RenderSlots, type ResolvedTheme, type ResolvedThemeColors, SMOOTH_PRESET, SNAPPY_PRESET, SQUIGGLE_DOCUMENT_SECTIONS, SQUIGGLE_STEPS, SQUIGGLE_STEP_LOGS, SQUIGGLE_SUBSTEP_LOGS, SQUIGGLE_WHOLE_DOCUMENT_SECTIONS, STEP_ICON_MAP, type Step, StepItem, type StepItemProps$1 as StepItemProps, type SubStep, SubStepItem, type SubStepItemProps$1 as SubStepItemProps, TAILWIND_COLOR_MAP, type ThemeConfig, ThemeProvider, type UseDocumentAssemblyOptions, type UseDocumentAssemblyReturn, type VisibilityConfig, WholeDocumentContent, type WholeDocumentContentProps$1 as WholeDocumentContentProps, WholeDocumentView, type WholeDocumentViewProps$1 as WholeDocumentViewProps, buildCssVars, colorMix, createDocumentSection, createStep, createSubStep, getThemeSafelist, injectStyle, resetStepCounter, resolveColorValue, resolveContent, resolveTheme, useAnimation, useAnimationOptional, useDocumentAssembly, useReducedMotion, useResponsiveLayout, useTheme, useThemeOptional };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import react__default, { ComponentType, CSSProperties, ReactNode, RefObject } from 'react';
2
+ import react__default, { ComponentType, CSSProperties, ReactNode, ErrorInfo, RefObject, Component } from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
 
5
5
  interface LogEntry {
@@ -18,9 +18,10 @@ interface Step {
18
18
  id: string;
19
19
  number: number;
20
20
  title: string;
21
- status: 'pending' | 'active' | 'processing' | 'completed';
21
+ status: 'pending' | 'active' | 'processing' | 'completed' | 'error';
22
22
  substeps?: SubStep[];
23
23
  documentSection?: string;
24
+ errorMessage?: string;
24
25
  logs: LogEntry[];
25
26
  icon?: ComponentType<{
26
27
  className?: string;
@@ -74,6 +75,7 @@ interface ClassNameSlots {
74
75
  }
75
76
  interface ThemeConfig {
76
77
  primary?: string;
78
+ accent?: string;
77
79
  secondary?: string;
78
80
  success?: string;
79
81
  processing?: string;
@@ -114,11 +116,9 @@ interface LayoutConfig {
114
116
  direction?: 'horizontal' | 'vertical';
115
117
  }
116
118
  interface ResolvedThemeColors {
117
- bg: string;
119
+ color: string;
120
+ mutedBg: string;
118
121
  border: string;
119
- text: string;
120
- icon: string;
121
- accent: string;
122
122
  }
123
123
  interface ResolvedTheme {
124
124
  primary: ResolvedThemeColors;
@@ -127,16 +127,17 @@ interface ResolvedTheme {
127
127
  processing: ResolvedThemeColors;
128
128
  warning: ResolvedThemeColors;
129
129
  stepStatus: Record<Step['status'], {
130
- cardBg: string;
130
+ color: string;
131
+ mutedBg: string;
131
132
  border: string;
132
- iconBg: string;
133
- textColor: string;
133
+ iconGradient: string;
134
134
  }>;
135
135
  gradients: {
136
136
  progress: string;
137
137
  title: string;
138
138
  completion: string;
139
139
  };
140
+ cssVars: Record<string, string>;
140
141
  }
141
142
  interface AnimationPreset {
142
143
  name: string;
@@ -199,6 +200,12 @@ interface UseDocumentAssemblyOptions {
199
200
  onPause?: () => void;
200
201
  onResume?: () => void;
201
202
  onReset?: () => void;
203
+ externalMode?: boolean;
204
+ onError?: (error: {
205
+ stepIndex: number;
206
+ stepId: string;
207
+ message: string;
208
+ }) => void;
202
209
  }
203
210
  interface UseDocumentAssemblyReturn {
204
211
  steps: Step[];
@@ -220,6 +227,15 @@ interface UseDocumentAssemblyReturn {
220
227
  reset: () => void;
221
228
  goToStep: (stepIndex: number) => void;
222
229
  setShowWholeDocument: (show: boolean) => void;
230
+ updateStep: (stepIndex: number, update: Partial<Pick<Step, 'status' | 'errorMessage'>>) => void;
231
+ addLog: (stepIndex: number, substepId: string | null, level: LogEntry['level'], message: string) => void;
232
+ updateMetrics: (metrics: Partial<DocumentMetrics> | ((prev: DocumentMetrics) => DocumentMetrics)) => void;
233
+ completeStep: (stepIndex: number) => void;
234
+ completeSubstep: (stepIndex: number, substepId: string) => void;
235
+ setStepError: (stepIndex: number, message: string) => void;
236
+ retryStep: (stepIndex: number) => void;
237
+ getSnapshot: () => AssemblySnapshot;
238
+ restoreSnapshot: (snapshot: AssemblySnapshot) => void;
223
239
  }
224
240
  interface BlueprintDocumentAssemblyRef {
225
241
  start: () => void;
@@ -227,6 +243,23 @@ interface BlueprintDocumentAssemblyRef {
227
243
  resume: () => void;
228
244
  reset: () => void;
229
245
  goToStep: (stepIndex: number) => void;
246
+ updateStep: (stepIndex: number, update: Partial<Pick<Step, 'status' | 'errorMessage'>>) => void;
247
+ addLog: (stepIndex: number, substepId: string | null, level: LogEntry['level'], message: string) => void;
248
+ updateMetrics: (metrics: Partial<DocumentMetrics> | ((prev: DocumentMetrics) => DocumentMetrics)) => void;
249
+ completeStep: (stepIndex: number) => void;
250
+ completeSubstep: (stepIndex: number, substepId: string) => void;
251
+ setStepError: (stepIndex: number, message: string) => void;
252
+ retryStep: (stepIndex: number) => void;
253
+ getDocumentContentRef: () => HTMLDivElement | null;
254
+ getDocumentHTML: () => string | null;
255
+ }
256
+ interface AssemblySnapshot {
257
+ steps: Step[];
258
+ completedSections: string[];
259
+ completedSubsteps: string[];
260
+ metrics: DocumentMetrics;
261
+ currentStep: number;
262
+ timestamp: number;
230
263
  }
231
264
  interface StepItemProps$1 {
232
265
  step: Step;
@@ -291,6 +324,25 @@ interface WholeDocumentContentProps$1 {
291
324
  classNames?: ClassNameSlots;
292
325
  renderSection?: (section: DocumentSection) => ReactNode;
293
326
  }
327
+ interface VisibilityConfig {
328
+ header?: boolean;
329
+ leftPanel?: boolean;
330
+ rightPanel?: boolean;
331
+ metricsFooter?: boolean;
332
+ progressBar?: boolean;
333
+ }
334
+ interface RenderSlots {
335
+ header?: (props: {
336
+ labels: Required<LabelConfig>;
337
+ currentStep: number;
338
+ totalSteps: number;
339
+ progress: number;
340
+ }) => ReactNode;
341
+ footer?: (props: {
342
+ metrics: DocumentMetrics;
343
+ labels: Required<LabelConfig>;
344
+ }) => ReactNode;
345
+ }
294
346
  interface BlueprintDocumentAssemblyProps {
295
347
  /**
296
348
  * Array of steps to process in the document assembly
@@ -415,6 +467,43 @@ interface BlueprintDocumentAssemblyProps {
415
467
  * Callback when assembly is reset
416
468
  */
417
469
  onReset?: () => void;
470
+ /**
471
+ * External mode — disables the internal timer loop. Host drives state via ref methods.
472
+ * @default false
473
+ */
474
+ externalMode?: boolean;
475
+ /**
476
+ * Callback when a step encounters an error (external mode)
477
+ */
478
+ onError?: (error: {
479
+ stepIndex: number;
480
+ stepId: string;
481
+ message: string;
482
+ }) => void;
483
+ /**
484
+ * Portal target for the whole document view modal.
485
+ * - true = portal to document.body
486
+ * - string = CSS selector
487
+ * - HTMLElement = direct reference
488
+ * - undefined/false = no portal (current behavior)
489
+ */
490
+ portalTarget?: HTMLElement | string | boolean;
491
+ /**
492
+ * Control visibility of individual UI sections
493
+ */
494
+ visibility?: VisibilityConfig;
495
+ /**
496
+ * Custom render functions for header and footer slots
497
+ */
498
+ renderSlots?: RenderSlots;
499
+ /**
500
+ * Custom fallback UI for the error boundary
501
+ */
502
+ errorFallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
503
+ /**
504
+ * Callback when a render error is caught by the error boundary
505
+ */
506
+ onRenderError?: (error: Error, errorInfo: ErrorInfo) => void;
418
507
  }
419
508
 
420
509
  declare const BlueprintDocumentAssembly: react.ForwardRefExoticComponent<BlueprintDocumentAssemblyProps & react.RefAttributes<BlueprintDocumentAssemblyRef>>;
@@ -497,19 +586,43 @@ interface WholeDocumentViewProps {
497
586
  sparkleCount?: number;
498
587
  celebrationEnabled?: boolean;
499
588
  children?: React.ReactNode;
589
+ portalTarget?: HTMLElement | null;
590
+ contentRef?: RefObject<HTMLDivElement | null>;
500
591
  }
501
- declare function WholeDocumentView({ show, onClose, documentIds, metrics, classNames, labels, celebrationTitle, sparkleCount, celebrationEnabled, }: WholeDocumentViewProps): react_jsx_runtime.JSX.Element;
592
+ declare function WholeDocumentView({ show, onClose, documentIds, metrics, classNames, labels, celebrationTitle, sparkleCount, celebrationEnabled, portalTarget, contentRef: externalContentRef, }: WholeDocumentViewProps): react_jsx_runtime.JSX.Element;
502
593
 
503
594
  interface WholeDocumentContentProps {
504
595
  documentIds: DocumentIds;
505
596
  sections?: DocumentSection[];
506
597
  classNames?: ClassNameSlots;
507
598
  renderSection?: (section: DocumentSection) => React.ReactNode;
599
+ contentRef?: RefObject<HTMLDivElement | null>;
600
+ }
601
+ declare function WholeDocumentContent({ documentIds, sections, classNames, renderSection, contentRef, }: WholeDocumentContentProps): react_jsx_runtime.JSX.Element;
602
+
603
+ interface ErrorBoundaryProps {
604
+ fallback?: ReactNode | ((error: Error, reset: () => void) => ReactNode);
605
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
606
+ children: ReactNode;
607
+ }
608
+ interface ErrorBoundaryState {
609
+ hasError: boolean;
610
+ error: Error | null;
611
+ }
612
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
613
+ constructor(props: ErrorBoundaryProps);
614
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
615
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
616
+ reset: () => void;
617
+ render(): ReactNode;
508
618
  }
509
- declare function WholeDocumentContent({ documentIds, sections, classNames, renderSection, }: WholeDocumentContentProps): react_jsx_runtime.JSX.Element;
510
619
 
511
620
  declare function resolveTheme(config?: ThemeConfig): ResolvedTheme;
512
- declare function getThemeSafelist(config?: ThemeConfig): string[];
621
+ /**
622
+ * @deprecated No longer needed — CSS variables replace the Tailwind safelist.
623
+ * Will be removed in v4.0.0.
624
+ */
625
+ declare function getThemeSafelist(_config?: ThemeConfig): string[];
513
626
  interface ThemeProviderProps {
514
627
  theme?: ThemeConfig;
515
628
  children: ReactNode;
@@ -518,6 +631,14 @@ declare function ThemeProvider({ theme, children }: ThemeProviderProps): react_j
518
631
  declare function useTheme(): ResolvedTheme;
519
632
  declare function useThemeOptional(): ResolvedTheme | null;
520
633
 
634
+ declare const TAILWIND_COLOR_MAP: Record<string, string>;
635
+ /** Resolve a color value: if it's a Tailwind name, return the hex; otherwise pass through */
636
+ declare function resolveColorValue(input: string): string;
637
+ /** Generate a CSS color-mix() expression for tinting/opacity effects */
638
+ declare function colorMix(color: string, percent: number, mixWith?: string): string;
639
+ /** Build the full --bda-* CSS variable map from a resolved theme config */
640
+ declare function buildCssVars(theme: Required<ThemeConfig>): Record<string, string>;
641
+
521
642
  interface AnimationContextValue {
522
643
  preset: AnimationPreset;
523
644
  reducedMotion: boolean;
@@ -615,4 +736,6 @@ declare function resetStepCounter(): void;
615
736
  */
616
737
  declare function resolveContent(content: string, documentIds: DocumentIds): string;
617
738
 
618
- export { type AnimationPreset, AnimationProvider, type AnimationTimings, BlueprintDocumentAssembly, type BlueprintDocumentAssemblyProps, type BlueprintDocumentAssemblyRef, CINEMATIC_PRESET, type ClassNameSlots, DEFAULT_LABELS, DEFAULT_STEPS, DEFAULT_STEP_LOGS, DEFAULT_SUBSTEP_LOGS, DEFAULT_THEME, type DocumentIds, DocumentLine, type DocumentLineProps$1 as DocumentLineProps, type DocumentMetrics, DocumentPreview, type DocumentPreviewProps$1 as DocumentPreviewProps, type DocumentSection, type DocumentSubsection, LEGAL_DOCUMENT_SECTIONS, LEGAL_WHOLE_DOCUMENT_SECTIONS, type LabelConfig, type LayoutConfig, LogContainer, type LogContainerProps$1 as LogContainerProps, type LogEntry, LogLine, type LogLineProps$1 as LogLineProps, MINIMAL_PRESET, type ResolvedTheme, type ResolvedThemeColors, SMOOTH_PRESET, SNAPPY_PRESET, SQUIGGLE_DOCUMENT_SECTIONS, SQUIGGLE_STEPS, SQUIGGLE_STEP_LOGS, SQUIGGLE_SUBSTEP_LOGS, SQUIGGLE_WHOLE_DOCUMENT_SECTIONS, STEP_ICON_MAP, type Step, StepItem, type StepItemProps$1 as StepItemProps, type SubStep, SubStepItem, type SubStepItemProps$1 as SubStepItemProps, type ThemeConfig, ThemeProvider, type UseDocumentAssemblyOptions, type UseDocumentAssemblyReturn, WholeDocumentContent, type WholeDocumentContentProps$1 as WholeDocumentContentProps, WholeDocumentView, type WholeDocumentViewProps$1 as WholeDocumentViewProps, createDocumentSection, createStep, createSubStep, getThemeSafelist, resetStepCounter, resolveContent, resolveTheme, useAnimation, useAnimationOptional, useDocumentAssembly, useReducedMotion, useResponsiveLayout, useTheme, useThemeOptional };
739
+ declare function injectStyle(id: string, css: string): void;
740
+
741
+ export { type AnimationPreset, AnimationProvider, type AnimationTimings, type AssemblySnapshot, BlueprintDocumentAssembly, type BlueprintDocumentAssemblyProps, type BlueprintDocumentAssemblyRef, CINEMATIC_PRESET, type ClassNameSlots, DEFAULT_LABELS, DEFAULT_STEPS, DEFAULT_STEP_LOGS, DEFAULT_SUBSTEP_LOGS, DEFAULT_THEME, type DocumentIds, DocumentLine, type DocumentLineProps$1 as DocumentLineProps, type DocumentMetrics, DocumentPreview, type DocumentPreviewProps$1 as DocumentPreviewProps, type DocumentSection, type DocumentSubsection, ErrorBoundary, LEGAL_DOCUMENT_SECTIONS, LEGAL_WHOLE_DOCUMENT_SECTIONS, type LabelConfig, type LayoutConfig, LogContainer, type LogContainerProps$1 as LogContainerProps, type LogEntry, LogLine, type LogLineProps$1 as LogLineProps, MINIMAL_PRESET, type RenderSlots, type ResolvedTheme, type ResolvedThemeColors, SMOOTH_PRESET, SNAPPY_PRESET, SQUIGGLE_DOCUMENT_SECTIONS, SQUIGGLE_STEPS, SQUIGGLE_STEP_LOGS, SQUIGGLE_SUBSTEP_LOGS, SQUIGGLE_WHOLE_DOCUMENT_SECTIONS, STEP_ICON_MAP, type Step, StepItem, type StepItemProps$1 as StepItemProps, type SubStep, SubStepItem, type SubStepItemProps$1 as SubStepItemProps, TAILWIND_COLOR_MAP, type ThemeConfig, ThemeProvider, type UseDocumentAssemblyOptions, type UseDocumentAssemblyReturn, type VisibilityConfig, WholeDocumentContent, type WholeDocumentContentProps$1 as WholeDocumentContentProps, WholeDocumentView, type WholeDocumentViewProps$1 as WholeDocumentViewProps, buildCssVars, colorMix, createDocumentSection, createStep, createSubStep, getThemeSafelist, injectStyle, resetStepCounter, resolveColorValue, resolveContent, resolveTheme, useAnimation, useAnimationOptional, useDocumentAssembly, useReducedMotion, useResponsiveLayout, useTheme, useThemeOptional };