@signiphi/pdf-compose 0.1.0-beta.4 → 0.1.0-beta.6

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.
Files changed (97) hide show
  1. package/dist/components/DocumentGenerator.d.ts +3 -0
  2. package/dist/components/DocumentGenerator.d.ts.map +1 -0
  3. package/dist/components/EditorPanel.d.ts +15 -0
  4. package/dist/components/EditorPanel.d.ts.map +1 -0
  5. package/dist/components/EditorToolbar.d.ts +11 -0
  6. package/dist/components/EditorToolbar.d.ts.map +1 -0
  7. package/dist/components/ErrorBoundary.d.ts +18 -0
  8. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  9. package/dist/components/FieldEditPopover.d.ts +12 -0
  10. package/dist/components/FieldEditPopover.d.ts.map +1 -0
  11. package/dist/components/FieldInsertPopover.d.ts +12 -0
  12. package/dist/components/FieldInsertPopover.d.ts.map +1 -0
  13. package/dist/components/FieldNodeView.d.ts +3 -0
  14. package/dist/components/FieldNodeView.d.ts.map +1 -0
  15. package/dist/components/FieldOverlay.d.ts +9 -0
  16. package/dist/components/FieldOverlay.d.ts.map +1 -0
  17. package/dist/components/GeneratePanel.d.ts +15 -0
  18. package/dist/components/GeneratePanel.d.ts.map +1 -0
  19. package/dist/components/PreviewPanel.d.ts +12 -0
  20. package/dist/components/PreviewPanel.d.ts.map +1 -0
  21. package/dist/components/VariableEditPopover.d.ts +12 -0
  22. package/dist/components/VariableEditPopover.d.ts.map +1 -0
  23. package/dist/components/VariableInsertPopover.d.ts +13 -0
  24. package/dist/components/VariableInsertPopover.d.ts.map +1 -0
  25. package/dist/components/VariableNodeView.d.ts +3 -0
  26. package/dist/components/VariableNodeView.d.ts.map +1 -0
  27. package/dist/components/WatermarkNodeView.d.ts +3 -0
  28. package/dist/components/WatermarkNodeView.d.ts.map +1 -0
  29. package/dist/contexts/ThemeContext.d.ts +19 -0
  30. package/dist/contexts/ThemeContext.d.ts.map +1 -0
  31. package/dist/extensions/columns-node.d.ts +4 -0
  32. package/dist/extensions/columns-node.d.ts.map +1 -0
  33. package/dist/extensions/field-node.d.ts +31 -0
  34. package/dist/extensions/field-node.d.ts.map +1 -0
  35. package/dist/extensions/panel-node.d.ts +3 -0
  36. package/dist/extensions/panel-node.d.ts.map +1 -0
  37. package/dist/extensions/repeat-node.d.ts +3 -0
  38. package/dist/extensions/repeat-node.d.ts.map +1 -0
  39. package/dist/extensions/subtotals-node.d.ts +3 -0
  40. package/dist/extensions/subtotals-node.d.ts.map +1 -0
  41. package/dist/extensions/variable-node.d.ts +18 -0
  42. package/dist/extensions/variable-node.d.ts.map +1 -0
  43. package/dist/extensions/watermark-node.d.ts +3 -0
  44. package/dist/extensions/watermark-node.d.ts.map +1 -0
  45. package/dist/hooks/useDocumentGenerator.d.ts +46 -0
  46. package/dist/hooks/useDocumentGenerator.d.ts.map +1 -0
  47. package/dist/index.d.ts +18 -0
  48. package/dist/index.d.ts.map +1 -0
  49. package/dist/index.js +18 -9
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +18 -9
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/lib/ui/button.d.ts +12 -0
  54. package/dist/lib/ui/button.d.ts.map +1 -0
  55. package/dist/lib/ui/index.d.ts +10 -0
  56. package/dist/lib/ui/index.d.ts.map +1 -0
  57. package/dist/lib/ui/input.d.ts +6 -0
  58. package/dist/lib/ui/input.d.ts.map +1 -0
  59. package/dist/lib/ui/label.d.ts +8 -0
  60. package/dist/lib/ui/label.d.ts.map +1 -0
  61. package/dist/lib/ui/popover.d.ts +8 -0
  62. package/dist/lib/ui/popover.d.ts.map +1 -0
  63. package/dist/lib/ui/select.d.ts +14 -0
  64. package/dist/lib/ui/select.d.ts.map +1 -0
  65. package/dist/lib/ui/toggle-group.d.ts +13 -0
  66. package/dist/lib/ui/toggle-group.d.ts.map +1 -0
  67. package/dist/lib/ui/tooltip.d.ts +8 -0
  68. package/dist/lib/ui/tooltip.d.ts.map +1 -0
  69. package/dist/lib/utils.d.ts +3 -0
  70. package/dist/lib/utils.d.ts.map +1 -0
  71. package/dist/types/index.d.ts +204 -0
  72. package/dist/types/index.d.ts.map +1 -0
  73. package/dist/utils/error-helpers.d.ts +27 -0
  74. package/dist/utils/error-helpers.d.ts.map +1 -0
  75. package/dist/utils/field-helpers.d.ts +31 -0
  76. package/dist/utils/field-helpers.d.ts.map +1 -0
  77. package/dist/utils/markdown-parser.d.ts +6 -0
  78. package/dist/utils/markdown-parser.d.ts.map +1 -0
  79. package/dist/utils/markdown-validator.d.ts +13 -0
  80. package/dist/utils/markdown-validator.d.ts.map +1 -0
  81. package/dist/utils/markdown-writer.d.ts +6 -0
  82. package/dist/utils/markdown-writer.d.ts.map +1 -0
  83. package/dist/utils/pdf-generator.d.ts +27 -0
  84. package/dist/utils/pdf-generator.d.ts.map +1 -0
  85. package/dist/utils/pdf-metadata.d.ts +58 -0
  86. package/dist/utils/pdf-metadata.d.ts.map +1 -0
  87. package/dist/utils/pdf-preview.d.ts +7 -0
  88. package/dist/utils/pdf-preview.d.ts.map +1 -0
  89. package/dist/utils/template-pipeline.d.ts +21 -0
  90. package/dist/utils/template-pipeline.d.ts.map +1 -0
  91. package/dist/utils/theme-helpers.d.ts +21 -0
  92. package/dist/utils/theme-helpers.d.ts.map +1 -0
  93. package/dist/utils/variable-helpers.d.ts +46 -0
  94. package/dist/utils/variable-helpers.d.ts.map +1 -0
  95. package/dist/utils/xml-template-parser.d.ts +9 -0
  96. package/dist/utils/xml-template-parser.d.ts.map +1 -0
  97. package/package.json +2 -2
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ asChild?: boolean;
9
+ }
10
+ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
11
+ export { Button, buttonVariants };
12
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,cAAc;;;8EA2BnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,cAAc,CAAC;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,MAAM,uFAWX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ export { Button, buttonVariants } from './button';
2
+ export type { ButtonProps } from './button';
3
+ export { Input } from './input';
4
+ export type { InputProps } from './input';
5
+ export { Label } from './label';
6
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './popover';
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './tooltip';
8
+ export { ToggleGroup } from './toggle-group';
9
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, } from './select';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAClD,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,GAChB,MAAM,UAAU,CAAC"}
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
3
+ }
4
+ declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
5
+ export { Input };
6
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,UACf,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAExD,QAAA,MAAM,KAAK,qFAcV,CAAC;AAGF,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import * as LabelPrimitive from '@radix-ui/react-label';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ declare const Label: React.ForwardRefExoticComponent<Omit<LabelPrimitive.LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & VariantProps<(props?: import("class-variance-authority/types").ClassProp | undefined) => string> & {
5
+ children?: React.ReactNode;
6
+ } & React.RefAttributes<HTMLLabelElement>>;
7
+ export { Label };
8
+ //# sourceMappingURL=label.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/label.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,cAAc,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAOlE,QAAA,MAAM,KAAK;eAII,KAAK,CAAC,SAAS;0CAQ5B,CAAC;AAGH,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import * as PopoverPrimitive from '@radix-ui/react-popover';
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
8
+ //# sourceMappingURL=popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAG5D,QAAA,MAAM,OAAO,yCAAwB,CAAC;AACtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAChD,QAAA,MAAM,aAAa,4GAA0B,CAAC;AAE9C,QAAA,MAAM,cAAc,gKAoBlB,CAAC;AAGH,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import * as SelectPrimitive from '@radix-ui/react-select';
3
+ declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
+ declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
+ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
12
+ declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
+ export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
14
+ //# sourceMappingURL=select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAI1D,QAAA,MAAM,MAAM,uCAAuB,CAAC;AACpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAC1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAGH,QAAA,MAAM,aAAa,8JAuCjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAsBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,sBAAsB,GACvB,CAAC"}
@@ -0,0 +1,13 @@
1
+ interface ToggleGroupProps<T extends string> {
2
+ value: T;
3
+ onChange: (value: T) => void;
4
+ options: {
5
+ value: T;
6
+ label: string;
7
+ }[];
8
+ size?: 'sm' | 'md';
9
+ className?: string;
10
+ }
11
+ export declare function ToggleGroup<T extends string>({ value, onChange, options, size, className, }: ToggleGroupProps<T>): import("react/jsx-runtime").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=toggle-group.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/toggle-group.tsx"],"names":[],"mappings":"AAEA,UAAU,gBAAgB,CAAC,CAAC,SAAS,MAAM;IACzC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,OAAO,EAAE;QAAE,KAAK,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAAE,EAC5C,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAW,EACX,SAAS,GACV,EAAE,gBAAgB,CAAC,CAAC,CAAC,2CAoBrB"}
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
3
+ declare const TooltipProvider: ({ children, ...props }: TooltipPrimitive.TooltipProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
5
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
6
+ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
8
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/lib/ui/tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAG3D,QAAA,MAAM,eAAe,GAAI,wBAAwB,gBAAgB,CAAC,oBAAoB,4CAIrF,CAAA;AAED,QAAA,MAAM,OAAO,yCAAwB,CAAA;AAErC,QAAA,MAAM,cAAc,gHAA2B,CAAA;AAE/C,QAAA,MAAM,cAAc,gKAmBlB,CAAA;AAGF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type ClassValue } from 'clsx';
2
+ export declare function cn(...inputs: ClassValue[]): string;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
@@ -0,0 +1,204 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ /**
3
+ * Acknowledgement for form fields — matching @signiphi/document-prepare
4
+ */
5
+ export interface Acknowledgement {
6
+ id: string;
7
+ title: string;
8
+ description: string;
9
+ }
10
+ /**
11
+ * Form field types — same values as @signiphi/document-prepare for compatibility
12
+ */
13
+ export declare enum FormFieldType {
14
+ TEXT = "text",
15
+ SIGNATURE = "signature",
16
+ INITIALS = "initials",
17
+ DATE = "date",
18
+ CHECKBOX = "checkbox",
19
+ RADIO = "radio",
20
+ DROPDOWN = "dropdown",
21
+ TEXT_LABEL = "text_label"
22
+ }
23
+ /**
24
+ * Position and dimensions of a form field on a PDF page
25
+ */
26
+ export interface FormFieldPosition {
27
+ x: number;
28
+ y: number;
29
+ width: number;
30
+ height: number;
31
+ page: number;
32
+ }
33
+ /**
34
+ * Field as it exists in the editor — no position (computed during PDF generation)
35
+ */
36
+ export interface DocumentGeneratorField {
37
+ fieldId: string;
38
+ type: FormFieldType;
39
+ name: string;
40
+ label: string;
41
+ required: boolean;
42
+ options?: string[];
43
+ placeholder?: string;
44
+ fontSize?: number;
45
+ defaultValue?: string;
46
+ multiline?: boolean;
47
+ maxLength?: number;
48
+ acknowledgements?: Acknowledgement[];
49
+ }
50
+ /**
51
+ * Full document model for save/load
52
+ */
53
+ export interface GeneratedDocument {
54
+ title: string;
55
+ markdown: string;
56
+ editorContent: JSONContent;
57
+ fields: DocumentGeneratorField[];
58
+ createdAt: string;
59
+ updatedAt: string;
60
+ }
61
+ /**
62
+ * Field with computed position for PDF embedding.
63
+ * Compatible with @signiphi/document-prepare's FormField interface.
64
+ */
65
+ export interface FormFieldForExport {
66
+ id: string;
67
+ fieldId: string;
68
+ type: FormFieldType;
69
+ name: string;
70
+ label: string;
71
+ position: FormFieldPosition;
72
+ required: boolean;
73
+ options?: string[];
74
+ placeholder?: string;
75
+ fontSize?: number;
76
+ defaultValue?: string;
77
+ multiline?: boolean;
78
+ maxLength?: number;
79
+ acknowledgements?: Acknowledgement[];
80
+ }
81
+ /**
82
+ * Export result — same shape as document-prepare's PreparedDocument
83
+ */
84
+ export interface DocumentGeneratorExportResult {
85
+ pdfBlob: Blob;
86
+ fields: FormFieldForExport[];
87
+ markdown: string;
88
+ }
89
+ /**
90
+ * Predefined variable available for insertion (e.g. from API print data)
91
+ */
92
+ export interface PredefinedVariable {
93
+ varName: string;
94
+ varLabel?: string;
95
+ }
96
+ /**
97
+ * Template variable as it exists in the editor
98
+ */
99
+ export interface DocumentGeneratorVariable {
100
+ varName: string;
101
+ varLabel: string;
102
+ varDefault: string;
103
+ }
104
+ /**
105
+ * Variable values mapping: varName → user-supplied value
106
+ */
107
+ export type VariableValues = Record<string, string>;
108
+ /**
109
+ * Reusable template produced by Phase 1 (parseXmlTemplate).
110
+ * Contains everything needed to generate a data-bound PDF in Phase 2.
111
+ */
112
+ export interface DocumentTemplate {
113
+ markdown: string;
114
+ variables: DocumentGeneratorVariable[];
115
+ reportName: string;
116
+ }
117
+ /**
118
+ * PDF page information with rendered image
119
+ */
120
+ export interface PdfPage {
121
+ pageNumber: number;
122
+ width: number;
123
+ height: number;
124
+ imageUrl: string;
125
+ }
126
+ /**
127
+ * Theme mode options
128
+ */
129
+ export type ThemeMode = 'light' | 'dark' | 'auto';
130
+ /**
131
+ * Advanced theme configuration
132
+ */
133
+ export interface ThemeConfig {
134
+ primary?: string;
135
+ primaryForeground?: string;
136
+ background?: string;
137
+ foreground?: string;
138
+ secondary?: string;
139
+ secondaryForeground?: string;
140
+ muted?: string;
141
+ mutedForeground?: string;
142
+ accent?: string;
143
+ accentForeground?: string;
144
+ border?: string;
145
+ input?: string;
146
+ ring?: string;
147
+ card?: string;
148
+ cardForeground?: string;
149
+ }
150
+ /**
151
+ * DocumentGenerator component props
152
+ */
153
+ export interface DocumentGeneratorProps {
154
+ /** Initial markdown content with field tokens */
155
+ initialMarkdown?: string;
156
+ /** Initial TipTap JSON content (takes precedence over initialMarkdown) */
157
+ initialContent?: JSONContent;
158
+ /** Called whenever the content changes (debounced) */
159
+ onChange?: (data: {
160
+ markdown: string;
161
+ content: JSONContent;
162
+ fields: DocumentGeneratorField[];
163
+ variables: DocumentGeneratorVariable[];
164
+ }) => void;
165
+ /** Called when user triggers export */
166
+ onExport?: (result: DocumentGeneratorExportResult) => void;
167
+ /** Whether the component is in read-only mode */
168
+ readOnly?: boolean;
169
+ /** Custom class name */
170
+ className?: string;
171
+ /** Theme color (hex) */
172
+ themeColor?: string;
173
+ /** Theme mode */
174
+ themeMode?: ThemeMode;
175
+ /** Advanced theme configuration */
176
+ themeConfig?: ThemeConfig;
177
+ /** Whether to show the preview panel. Default: true */
178
+ showPreview?: boolean;
179
+ /** Placeholder text for the editor */
180
+ placeholder?: string;
181
+ /** Custom export button text. Default: 'Export Document' */
182
+ exportButtonText?: string;
183
+ /** Whether to show the toolbar. Default: true */
184
+ showToolbar?: boolean;
185
+ /** Whether to show the Generate tab. Default: true */
186
+ showGenerateTab?: boolean;
187
+ /** Called when user generates PDF(s) from the Generate tab */
188
+ onGeneratePdf?: (blob: Blob, fileName: string) => void;
189
+ /** Pre-filled bulk data for the Generate tab (array of variable-value objects) */
190
+ initialBulkData?: Record<string, string>[];
191
+ /** Default active tab. Default: 'editor' */
192
+ defaultTab?: 'editor' | 'generate';
193
+ /** Initial variable values to pre-fill in the Generate tab */
194
+ initialVariableValues?: Record<string, string>;
195
+ /** Predefined variable names available for insertion (e.g. from API print data) */
196
+ predefinedVariables?: PredefinedVariable[];
197
+ /** Custom filename for exported PDF (without extension). Default: 'document' */
198
+ exportFileName?: string;
199
+ /** Template mode: hides .md import, disables bulk mode, and locks variables provided via initialVariableValues. */
200
+ templateMode?: boolean;
201
+ /** Called when user clicks "Save Template". When set, replaces the Export dropdown with a single save button. */
202
+ onSaveTemplate?: (markdown: string) => void | Promise<void>;
203
+ }
204
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;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AAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,gFAAgF;IAChF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mHAAmH;IACnH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iHAAiH;IACjH,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Extract a human-readable message from an unknown caught error.
3
+ * Always returns a string — never throws.
4
+ */
5
+ export declare function getErrorMessage(error: unknown): string;
6
+ /**
7
+ * Format a contextual error: prefix + extracted message.
8
+ * Example: formatError('Preview generation failed', err)
9
+ * => "Preview generation failed: The PDF document is corrupted"
10
+ */
11
+ export declare function formatError(context: string, error: unknown): string;
12
+ export type JsonParseResult = {
13
+ valid: true;
14
+ data: unknown;
15
+ } | {
16
+ valid: false;
17
+ message: string;
18
+ line: number;
19
+ col: number;
20
+ };
21
+ /**
22
+ * Parse JSON with precise error messages including line/col and a context snippet.
23
+ * Uses native JSON.parse with cross-browser position extraction
24
+ * (inspired by json-parse-better-errors).
25
+ */
26
+ export declare function parseJsonWithDetails(input: string): JsonParseResult;
27
+ //# sourceMappingURL=error-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/error-helpers.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQtD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAGnE;AAED,MAAM,MAAM,eAAe,GACvB;IAAE,KAAK,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAC9B;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AA6EjE;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,CA8BnE"}
@@ -0,0 +1,31 @@
1
+ import { FormFieldType, type DocumentGeneratorField } from '../types';
2
+ import type { FieldNodeAttributes } from '../extensions/field-node';
3
+ import type { JSONContent } from '@tiptap/core';
4
+ /**
5
+ * Default field dimensions in PDF points for each field type
6
+ */
7
+ /**
8
+ * Default field dimensions matching document-prepare (PdfViewerWithFields.tsx:423-441)
9
+ */
10
+ export declare const DEFAULT_FIELD_DIMENSIONS: Record<FormFieldType, {
11
+ width: number;
12
+ height: number;
13
+ }>;
14
+ /**
15
+ * Generate a unique field name from type and timestamp (matches document-prepare pattern)
16
+ */
17
+ export declare function generateFieldName(type: FormFieldType): string;
18
+ /**
19
+ * Create default field node attributes for a given type.
20
+ * Smart defaults per type match document-prepare's PdfViewerWithFields.tsx:474-495
21
+ */
22
+ export declare function createFieldAttrs(type: FormFieldType, overrides?: Partial<FieldNodeAttributes>): FieldNodeAttributes;
23
+ /**
24
+ * Extract all DocumentGeneratorField instances from TipTap JSON content
25
+ */
26
+ export declare function extractFieldsFromContent(content: JSONContent): DocumentGeneratorField[];
27
+ /**
28
+ * Get all existing field names from content
29
+ */
30
+ export declare function getExistingFieldNames(content: JSONContent): string[];
31
+ //# sourceMappingURL=field-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/field-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAwB,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,aAAa,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAS7F,CAAC;AAEF;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAE7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,aAAa,EACnB,SAAS,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACvC,mBAAmB,CAqCrB;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,WAAW,GAAG,sBAAsB,EAAE,CAiCvF;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,EAAE,CAEpE"}
@@ -0,0 +1,6 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ /**
3
+ * Parse a markdown string (with field tokens) into TipTap JSONContent.
4
+ */
5
+ export declare function markdownToTiptap(markdown: string): JSONContent;
6
+ //# sourceMappingURL=markdown-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-parser.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAmmBhD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAI9D"}
@@ -0,0 +1,13 @@
1
+ import type { DocumentGeneratorField, DocumentGeneratorVariable } from '../types';
2
+ export interface MarkdownValidationResult {
3
+ valid: boolean;
4
+ errors: string[];
5
+ warnings: string[];
6
+ variables: DocumentGeneratorVariable[];
7
+ fields: DocumentGeneratorField[];
8
+ }
9
+ /**
10
+ * Validate markdown content for well-formed field and variable tokens.
11
+ */
12
+ export declare function validateMarkdown(markdown: string): MarkdownValidationResult;
13
+ //# sourceMappingURL=markdown-validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-validator.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAKlF,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,yBAAyB,EAAE,CAAC;IACvC,MAAM,EAAE,sBAAsB,EAAE,CAAC;CAClC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,wBAAwB,CAwI3E"}
@@ -0,0 +1,6 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ /**
3
+ * Convert TipTap JSON content to markdown string with field tokens.
4
+ */
5
+ export declare function tiptapToMarkdown(doc: JSONContent): string;
6
+ //# sourceMappingURL=markdown-writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdown-writer.d.ts","sourceRoot":"","sources":["../../src/utils/markdown-writer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAiQhD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,CAMzD"}
@@ -0,0 +1,27 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ import { type FormFieldPosition, type DocumentGeneratorField } from '../types';
3
+ export interface PdfGenerationResult {
4
+ pdfBytes: Uint8Array;
5
+ fieldPositions: Map<string, FormFieldPosition>;
6
+ /** Non-fatal warnings about fields that failed to create */
7
+ fieldWarnings?: string[];
8
+ }
9
+ export interface PdfGenerationOptions {
10
+ /** Draw visual placeholder boxes for fields in the PDF (default: false) */
11
+ drawFieldPlaceholders?: boolean;
12
+ /** Add interactive PDF form fields at field positions (default: false) */
13
+ embedFormFields?: boolean;
14
+ /** Fields data for form field creation (required when embedFormFields is true) */
15
+ fields?: DocumentGeneratorField[];
16
+ }
17
+ /**
18
+ * Generate a PDF from TipTap JSON content.
19
+ *
20
+ * For preview: call with defaults (no placeholders, no form fields) — field positions
21
+ * are still tracked so React overlays can render on top of the PDF image.
22
+ *
23
+ * For export: call with { embedFormFields: true } to bake interactive form fields
24
+ * into the PDF for downstream consumption (e.g. pdf-signer).
25
+ */
26
+ export declare function generatePdfFromContent(content: JSONContent, options?: PdfGenerationOptions): Promise<PdfGenerationResult>;
27
+ //# sourceMappingURL=pdf-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-generator.d.ts","sourceRoot":"","sources":["../../src/utils/pdf-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA4jD9F,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,UAAU,CAAC;IACrB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC/C,4DAA4D;IAC5D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,oBAAoB;IACnC,2EAA2E;IAC3E,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,0EAA0E;IAC1E,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kFAAkF;IAClF,MAAM,CAAC,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,WAAW,EACpB,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAsE9B"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * PDF Metadata Utilities
3
+ * Functions for storing and retrieving Signiphi metadata in PDF documents.
4
+ * Matches the format used by @signiphi/document-prepare and read by @signiphi/pdf-signer.
5
+ */
6
+ import type { PDFDocument, PDFName as PDFNameType, PDFString as PDFStringType } from 'pdf-lib';
7
+ import type { Acknowledgement } from '../types';
8
+ /**
9
+ * Initialize PDF classes from the pdf-lib module.
10
+ * Must be called before using setSigniphiMetadata.
11
+ */
12
+ export declare function initPdfMetadata(pdfLibModule: {
13
+ PDFName: typeof PDFNameType;
14
+ PDFString: typeof PDFStringType;
15
+ }): void;
16
+ /**
17
+ * Metadata for a single form field
18
+ */
19
+ export interface FieldMetadata {
20
+ fieldId?: string;
21
+ label?: string;
22
+ placeholder?: string;
23
+ acknowledgements?: Acknowledgement[];
24
+ required?: boolean;
25
+ options?: string[];
26
+ }
27
+ /**
28
+ * Complete metadata structure stored in PDF — compatible with document-prepare & pdf-signer
29
+ */
30
+ export interface SigniphiMetadata {
31
+ version: string;
32
+ fields: Record<string, FieldMetadata>;
33
+ fieldIdIndex?: Record<string, string>;
34
+ }
35
+ /**
36
+ * Stores Signiphi metadata in the PDF's document information dictionary.
37
+ */
38
+ export declare function setSigniphiMetadata(pdfDoc: PDFDocument, metadata: SigniphiMetadata): void;
39
+ /**
40
+ * Input field shape for building metadata (subset of DocumentGeneratorField)
41
+ */
42
+ interface MetadataFieldInput {
43
+ fieldId: string;
44
+ name: string;
45
+ label?: string;
46
+ placeholder?: string;
47
+ acknowledgements?: Acknowledgement[];
48
+ required?: boolean;
49
+ options?: string[];
50
+ }
51
+ /**
52
+ * Builds a metadata object from form fields.
53
+ * @param fields - Array of fields to extract metadata from
54
+ * @param actualFieldNames - Mapping of base field name → actual PDF field name (with suffixes)
55
+ */
56
+ export declare function buildMetadataObject(fields: MetadataFieldInput[], actualFieldNames?: Map<string, string>): SigniphiMetadata;
57
+ export {};
58
+ //# sourceMappingURL=pdf-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"p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EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,kBAAkB,EAAE,EAC5B,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACrC,gBAAgB,CA+BlB"}
@@ -0,0 +1,7 @@
1
+ import type { PdfPage } from '../types';
2
+ /**
3
+ * Convert PDF bytes to page images using pdfjs-dist for the preview panel.
4
+ * Dynamically imports pdfjs-dist to avoid SSR issues.
5
+ */
6
+ export declare function pdfToImages(pdfBytes: Uint8Array, scale?: number): Promise<PdfPage[]>;
7
+ //# sourceMappingURL=pdf-preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf-preview.d.ts","sourceRoot":"","sources":["../../src/utils/pdf-preview.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxC;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,UAAU,EACpB,KAAK,GAAE,MAAU,GAChB,OAAO,CAAC,OAAO,EAAE,CAAC,CAyEpB"}
@@ -0,0 +1,21 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ export interface HeadlessPdfResult {
3
+ pdfBytes: Uint8Array;
4
+ }
5
+ /**
6
+ * Generate a PDF from TipTap JSON content with variable values applied.
7
+ *
8
+ * Pipeline: expand repeats -> suppress zeros -> replace variables -> render PDF.
9
+ * Pure function — no React, no DOM, no editor instance required.
10
+ */
11
+ export declare function generatePdfFromTiptap(content: JSONContent, values: Record<string, string>): Promise<HeadlessPdfResult>;
12
+ /**
13
+ * Generate a PDF from extended markdown with variable values applied.
14
+ *
15
+ * This is the Phase 2 headless entry point:
16
+ * markdown template + data values -> PDF bytes
17
+ *
18
+ * Pure function — no React, no DOM, no editor instance required.
19
+ */
20
+ export declare function generatePdfFromMarkdown(markdown: string, values: Record<string, string>): Promise<HeadlessPdfResult>;
21
+ //# sourceMappingURL=template-pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-pipeline.d.ts","sourceRoot":"","sources":["../../src/utils/template-pipeline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,UAAU,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAa5B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CAG5B"}
@@ -0,0 +1,21 @@
1
+ export declare function parseThemeColor(color: string): string;
2
+ export declare function getContrastColor(backgroundColor: string): string;
3
+ export declare function applyThemeColor(element: HTMLElement, color: string, config?: {
4
+ primaryForeground?: string;
5
+ background?: string;
6
+ foreground?: string;
7
+ secondary?: string;
8
+ secondaryForeground?: string;
9
+ muted?: string;
10
+ mutedForeground?: string;
11
+ accent?: string;
12
+ accentForeground?: string;
13
+ border?: string;
14
+ input?: string;
15
+ ring?: string;
16
+ card?: string;
17
+ cardForeground?: string;
18
+ }): void;
19
+ export declare function detectSystemTheme(): 'light' | 'dark';
20
+ export declare function getEffectiveThemeMode(themeMode?: 'light' | 'dark' | 'auto'): 'light' | 'dark';
21
+ //# sourceMappingURL=theme-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/theme-helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAerD;AAED,wBAAgB,gBAAgB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAoBhE;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE;IACP,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,GACA,IAAI,CAeN;AAED,wBAAgB,iBAAiB,IAAI,OAAO,GAAG,MAAM,CASpD;AAED,wBAAgB,qBAAqB,CAAC,SAAS,GAAE,OAAO,GAAG,MAAM,GAAG,MAAe,GAAG,OAAO,GAAG,MAAM,CAKrG"}