@tfw.in/structura-lib 0.2.0
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/PRODUCTION_ARCHITECTURE.md +511 -0
- package/README.md +379 -0
- package/SAVE_FUNCTIONALITY_COMPLETE.md +448 -0
- package/dist/cjs/EditableContent.js +150 -0
- package/dist/cjs/HtmlViewer.js +587 -0
- package/dist/cjs/PdfComponents.js +16 -0
- package/dist/cjs/PdfDocumentViewer.js +281 -0
- package/dist/cjs/Structura.js +806 -0
- package/dist/cjs/Table.js +164 -0
- package/dist/cjs/TableCell.js +115 -0
- package/dist/cjs/accuracyMetrics.js +39 -0
- package/dist/cjs/helpers/preprocessData.js +143 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/lib/polyfills.js +15 -0
- package/dist/cjs/lib/utils.js +10 -0
- package/dist/cjs/node_modules/react-icons/fa/index.esm.js +14 -0
- package/dist/cjs/node_modules/react-icons/lib/esm/iconBase.js +69 -0
- package/dist/cjs/node_modules/react-icons/lib/esm/iconContext.js +15 -0
- package/dist/cjs/polyfills.js +19 -0
- package/dist/cjs/route.js +102 -0
- package/dist/cjs/styles.css +7 -0
- package/dist/cjs/styles.css.map +1 -0
- package/dist/cjs/ui/badge.js +34 -0
- package/dist/cjs/ui/button.js +71 -0
- package/dist/cjs/ui/card.js +86 -0
- package/dist/cjs/ui/progress.js +45 -0
- package/dist/cjs/ui/scroll-area.js +62 -0
- package/dist/cjs/ui/tabs.js +60 -0
- package/dist/cjs/worker.js +36 -0
- package/dist/esm/EditableContent.js +161 -0
- package/dist/esm/HtmlViewer.js +640 -0
- package/dist/esm/PdfComponents.js +21 -0
- package/dist/esm/PdfDocumentViewer.js +294 -0
- package/dist/esm/Structura.js +951 -0
- package/dist/esm/Table.js +182 -0
- package/dist/esm/TableCell.js +122 -0
- package/dist/esm/_virtual/_rollupPluginBabelHelpers.js +305 -0
- package/dist/esm/accuracyMetrics.js +41 -0
- package/dist/esm/helpers/preprocessData.js +152 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/lib/polyfills.js +13 -0
- package/dist/esm/lib/utils.js +8 -0
- package/dist/esm/node_modules/react-icons/fa/index.esm.js +11 -0
- package/dist/esm/node_modules/react-icons/lib/esm/iconBase.js +66 -0
- package/dist/esm/node_modules/react-icons/lib/esm/iconContext.js +12 -0
- package/dist/esm/polyfills.js +17 -0
- package/dist/esm/route.js +154 -0
- package/dist/esm/styles.css +7 -0
- package/dist/esm/styles.css.map +1 -0
- package/dist/esm/types/EditableContent.d.ts +9 -0
- package/dist/esm/types/HtmlViewer.d.ts +10 -0
- package/dist/esm/types/PdfComponents.d.ts +35 -0
- package/dist/esm/types/PdfDocumentViewer.d.ts +22 -0
- package/dist/esm/types/Structura.d.ts +11 -0
- package/dist/esm/types/Table.d.ts +12 -0
- package/dist/esm/types/TableCell.d.ts +13 -0
- package/dist/esm/types/accuracy.d.ts +23 -0
- package/dist/esm/types/accuracyMetrics.d.ts +5 -0
- package/dist/esm/types/helpers/flattenJSON.d.ts +1 -0
- package/dist/esm/types/helpers/hardMerging.d.ts +2 -0
- package/dist/esm/types/helpers/index.d.ts +6 -0
- package/dist/esm/types/helpers/jsonToHtml.d.ts +40 -0
- package/dist/esm/types/helpers/preprocessData.d.ts +3 -0
- package/dist/esm/types/helpers/removeMetadata.d.ts +1 -0
- package/dist/esm/types/helpers/tableProcessor.d.ts +1 -0
- package/dist/esm/types/index.d.ts +3 -0
- package/dist/esm/types/lib/polyfills.d.ts +1 -0
- package/dist/esm/types/lib/utils.d.ts +2 -0
- package/dist/esm/types/polyfills.d.ts +1 -0
- package/dist/esm/types/route.d.ts +45 -0
- package/dist/esm/types/test-app/src/App.d.ts +4 -0
- package/dist/esm/types/test-app/src/main.d.ts +1 -0
- package/dist/esm/types/test-app/vite.config.d.ts +2 -0
- package/dist/esm/types/types.d.ts +23 -0
- package/dist/esm/types/ui/alert.d.ts +8 -0
- package/dist/esm/types/ui/badge.d.ts +9 -0
- package/dist/esm/types/ui/button.d.ts +11 -0
- package/dist/esm/types/ui/card.d.ts +8 -0
- package/dist/esm/types/ui/progress.d.ts +6 -0
- package/dist/esm/types/ui/scroll-area.d.ts +5 -0
- package/dist/esm/types/ui/skeleton.d.ts +2 -0
- package/dist/esm/types/ui/tabs.d.ts +7 -0
- package/dist/esm/types/worker.d.ts +1 -0
- package/dist/esm/ui/badge.js +31 -0
- package/dist/esm/ui/button.js +50 -0
- package/dist/esm/ui/card.js +67 -0
- package/dist/esm/ui/progress.js +26 -0
- package/dist/esm/ui/scroll-area.js +45 -0
- package/dist/esm/ui/tabs.js +39 -0
- package/dist/esm/worker.js +50 -0
- package/dist/index.d.ts +38 -0
- package/package.json +85 -0
- package/server/README.md +203 -0
- package/server/db.js +142 -0
- package/server/server.js +165 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface PdfHighlighterpropss {
|
|
2
|
+
initialPdfPath?: string | null;
|
|
3
|
+
initialJsonData?: any | null;
|
|
4
|
+
props: {
|
|
5
|
+
APIKey: string;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
onSave?: (editedData: any) => void | Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export default function Structura({ initialPdfPath, initialJsonData, props }: PdfHighlighterpropss): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface TableProps {
|
|
2
|
+
node: any;
|
|
3
|
+
selectedBboxId: string | null;
|
|
4
|
+
onJsonClick: (nodeData: any) => void;
|
|
5
|
+
onContentChange?: (nodeId: string, newContent: string) => void;
|
|
6
|
+
mergedTables?: any[];
|
|
7
|
+
hasLlmHtml?: boolean;
|
|
8
|
+
showJsonIcons?: boolean;
|
|
9
|
+
onNodeClick?: (nodeId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export default function Table({ node, selectedBboxId, onJsonClick, onContentChange, mergedTables, hasLlmHtml, showJsonIcons, onNodeClick, }: TableProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface TableCellProps {
|
|
2
|
+
id: string;
|
|
3
|
+
content: string;
|
|
4
|
+
onJsonClick: () => void;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isHeader?: boolean;
|
|
7
|
+
onContentChange?: (nodeId: string, newContent: string) => void;
|
|
8
|
+
showJsonIcons?: boolean;
|
|
9
|
+
onNodeClick?: () => void;
|
|
10
|
+
isDubious?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export default function TableCell({ id, content, onJsonClick, isSelected, isHeader, onContentChange, showJsonIcons, onNodeClick, isDubious, }: TableCellProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface EditChange {
|
|
2
|
+
id: string;
|
|
3
|
+
blockType: string;
|
|
4
|
+
originalContent: string;
|
|
5
|
+
newContent: string;
|
|
6
|
+
timestamp: number;
|
|
7
|
+
charactersDifferent: number;
|
|
8
|
+
wordsDifferent: number;
|
|
9
|
+
}
|
|
10
|
+
export interface AccuracyMetrics {
|
|
11
|
+
totalChanges: number;
|
|
12
|
+
totalCharactersEdited: number;
|
|
13
|
+
totalWordsEdited: number;
|
|
14
|
+
accuracyScore: number;
|
|
15
|
+
changeHistory: EditChange[];
|
|
16
|
+
blockTypeStats: {
|
|
17
|
+
[key: string]: {
|
|
18
|
+
changes: number;
|
|
19
|
+
charactersEdited: number;
|
|
20
|
+
wordsEdited: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function flattenLegalDoc(doc: any): any[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert Marker JSON block output to HTML by resolving content-ref tags.
|
|
3
|
+
* This is the TypeScript equivalent of core/output.py's json_to_html function.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* - For Gemini-corrected JSONs: The GeminiCorrected block has clean HTML, no refs to resolve
|
|
7
|
+
* - For original JSONs: Resolves <content-ref src='...'> tags recursively
|
|
8
|
+
*/
|
|
9
|
+
interface Block {
|
|
10
|
+
id: string;
|
|
11
|
+
html?: string;
|
|
12
|
+
children?: Block[];
|
|
13
|
+
block_type?: string;
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve content-ref tags in HTML by replacing them with actual child content
|
|
18
|
+
*/
|
|
19
|
+
export declare function jsonToHtml(block: Block): string;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a block has Gemini corrections
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasGeminiCorrections(block: Block): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get the corrected HTML from a Gemini-corrected block, or fall back to rendering original
|
|
26
|
+
*/
|
|
27
|
+
export declare function getBlockHtml(block: Block): string;
|
|
28
|
+
/**
|
|
29
|
+
* Render an entire page to HTML
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderPageToHtml(page: Block): string;
|
|
32
|
+
/**
|
|
33
|
+
* Render the entire document to HTML (all pages)
|
|
34
|
+
*/
|
|
35
|
+
export declare function renderDocumentToHtml(document: Block): string;
|
|
36
|
+
/**
|
|
37
|
+
* Extract plain text from HTML (strips all tags)
|
|
38
|
+
*/
|
|
39
|
+
export declare function htmlToPlainText(html: string): string;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function removeMetadata(doc: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function processTableStructure(node: any): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
interface RequestConfig {
|
|
2
|
+
baseUrl?: string;
|
|
3
|
+
apiKey: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function POST(request: FormData, config: RequestConfig): Promise<{
|
|
6
|
+
error: string;
|
|
7
|
+
status: number;
|
|
8
|
+
details?: undefined;
|
|
9
|
+
data?: undefined;
|
|
10
|
+
message?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
error: string;
|
|
13
|
+
details: string;
|
|
14
|
+
status: number;
|
|
15
|
+
data?: undefined;
|
|
16
|
+
message?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
data: any;
|
|
19
|
+
status: number;
|
|
20
|
+
error?: undefined;
|
|
21
|
+
details?: undefined;
|
|
22
|
+
message?: undefined;
|
|
23
|
+
} | {
|
|
24
|
+
error: string;
|
|
25
|
+
details: string;
|
|
26
|
+
message: string;
|
|
27
|
+
status: number;
|
|
28
|
+
data?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
error: string;
|
|
31
|
+
message: string;
|
|
32
|
+
status: number;
|
|
33
|
+
details?: undefined;
|
|
34
|
+
data?: undefined;
|
|
35
|
+
}>;
|
|
36
|
+
export declare function GET(taskId: string, config: RequestConfig): Promise<{
|
|
37
|
+
error: string;
|
|
38
|
+
status: number;
|
|
39
|
+
data?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
data: any;
|
|
42
|
+
status: number;
|
|
43
|
+
error?: undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Block, BlockSchema, DocumentOutput, BlockOutput } from "@tfw.in/structura-sdk";
|
|
2
|
+
export interface PdfHighlighterProps {
|
|
3
|
+
initialPdfPath?: string | null;
|
|
4
|
+
prop?: {
|
|
5
|
+
apiKey: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export interface TableProps {
|
|
9
|
+
data: any;
|
|
10
|
+
onCellClick?: (cellId: string) => void;
|
|
11
|
+
selectedCellId?: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface TableCellProps {
|
|
14
|
+
cell: any;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
isSelected?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface EditableContentProps {
|
|
19
|
+
content: string;
|
|
20
|
+
onChange: (newContent: string) => void;
|
|
21
|
+
isEditing?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export type { Block, BlockSchema, DocumentOutput, BlockOutput };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type VariantProps } from "class-variance-authority";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/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 };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
6
|
+
declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
3
|
+
interface ProgressProps extends React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root> {
|
|
4
|
+
}
|
|
5
|
+
declare const Progress: React.ForwardRefExoticComponent<ProgressProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Progress };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
|
3
|
+
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<ScrollAreaPrimitive.ScrollAreaScrollbarProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { cn } from '../lib/utils.js';
|
|
5
|
+
|
|
6
|
+
var _excluded = ["className", "variant"];
|
|
7
|
+
var badgeVariants = cva("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
|
|
11
|
+
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
12
|
+
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
13
|
+
outline: "text-foreground"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
defaultVariants: {
|
|
17
|
+
variant: "default"
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
function Badge(_ref) {
|
|
21
|
+
var className = _ref.className,
|
|
22
|
+
variant = _ref.variant,
|
|
23
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
24
|
+
return jsx("div", _objectSpread2({
|
|
25
|
+
className: cn(badgeVariants({
|
|
26
|
+
variant: variant
|
|
27
|
+
}), className)
|
|
28
|
+
}, props));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { Badge, badgeVariants };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Slot } from '@radix-ui/react-slot';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { cn } from '../lib/utils.js';
|
|
7
|
+
|
|
8
|
+
var _excluded = ["className", "variant", "size", "asChild"];
|
|
9
|
+
var buttonVariants = cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", {
|
|
10
|
+
variants: {
|
|
11
|
+
variant: {
|
|
12
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
13
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
14
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
16
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
default: "h-10 px-4 py-2",
|
|
21
|
+
sm: "h-9 rounded-md px-3",
|
|
22
|
+
lg: "h-11 rounded-md px-8",
|
|
23
|
+
icon: "h-10 w-10"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: {
|
|
27
|
+
variant: "default",
|
|
28
|
+
size: "default"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var Button = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
32
|
+
var className = _ref.className,
|
|
33
|
+
variant = _ref.variant,
|
|
34
|
+
size = _ref.size,
|
|
35
|
+
_ref$asChild = _ref.asChild,
|
|
36
|
+
asChild = _ref$asChild === void 0 ? false : _ref$asChild,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var Comp = asChild ? Slot : "button";
|
|
39
|
+
return jsx(Comp, _objectSpread2({
|
|
40
|
+
className: cn(buttonVariants({
|
|
41
|
+
variant: variant,
|
|
42
|
+
size: size,
|
|
43
|
+
className: className
|
|
44
|
+
})),
|
|
45
|
+
ref: ref
|
|
46
|
+
}, props));
|
|
47
|
+
});
|
|
48
|
+
Button.displayName = "Button";
|
|
49
|
+
|
|
50
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../lib/utils.js';
|
|
5
|
+
|
|
6
|
+
var _excluded = ["className"],
|
|
7
|
+
_excluded2 = ["className"],
|
|
8
|
+
_excluded3 = ["className"],
|
|
9
|
+
_excluded4 = ["className"],
|
|
10
|
+
_excluded5 = ["className"],
|
|
11
|
+
_excluded6 = ["className"];
|
|
12
|
+
var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
13
|
+
var className = _ref.className,
|
|
14
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
return jsx("div", _objectSpread2({
|
|
16
|
+
ref: ref,
|
|
17
|
+
className: cn("rounded-lg border bg-card text-card-foreground shadow-sm", className)
|
|
18
|
+
}, props));
|
|
19
|
+
});
|
|
20
|
+
Card.displayName = "Card";
|
|
21
|
+
var CardHeader = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
22
|
+
var className = _ref2.className,
|
|
23
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
24
|
+
return jsx("div", _objectSpread2({
|
|
25
|
+
ref: ref,
|
|
26
|
+
className: cn("flex flex-col space-y-1.5 p-6", className)
|
|
27
|
+
}, props));
|
|
28
|
+
});
|
|
29
|
+
CardHeader.displayName = "CardHeader";
|
|
30
|
+
var CardTitle = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
31
|
+
var className = _ref3.className,
|
|
32
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
33
|
+
return jsx("h3", _objectSpread2({
|
|
34
|
+
ref: ref,
|
|
35
|
+
className: cn("text-2xl font-semibold leading-none tracking-tight", className)
|
|
36
|
+
}, props));
|
|
37
|
+
});
|
|
38
|
+
CardTitle.displayName = "CardTitle";
|
|
39
|
+
var CardDescription = /*#__PURE__*/React.forwardRef(function (_ref4, ref) {
|
|
40
|
+
var className = _ref4.className,
|
|
41
|
+
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
42
|
+
return jsx("p", _objectSpread2({
|
|
43
|
+
ref: ref,
|
|
44
|
+
className: cn("text-sm text-muted-foreground", className)
|
|
45
|
+
}, props));
|
|
46
|
+
});
|
|
47
|
+
CardDescription.displayName = "CardDescription";
|
|
48
|
+
var CardContent = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
49
|
+
var className = _ref5.className,
|
|
50
|
+
props = _objectWithoutProperties(_ref5, _excluded5);
|
|
51
|
+
return jsx("div", _objectSpread2({
|
|
52
|
+
ref: ref,
|
|
53
|
+
className: cn("p-6 pt-0", className)
|
|
54
|
+
}, props));
|
|
55
|
+
});
|
|
56
|
+
CardContent.displayName = "CardContent";
|
|
57
|
+
var CardFooter = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
58
|
+
var className = _ref6.className,
|
|
59
|
+
props = _objectWithoutProperties(_ref6, _excluded6);
|
|
60
|
+
return jsx("div", _objectSpread2({
|
|
61
|
+
ref: ref,
|
|
62
|
+
className: cn("flex items-center p-6 pt-0", className)
|
|
63
|
+
}, props));
|
|
64
|
+
});
|
|
65
|
+
CardFooter.displayName = "CardFooter";
|
|
66
|
+
|
|
67
|
+
export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ProgressPrimitive from '@radix-ui/react-progress';
|
|
5
|
+
import { cn } from '../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["className", "value"];
|
|
8
|
+
var Progress = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9
|
+
var className = _ref.className,
|
|
10
|
+
value = _ref.value,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
return jsx(ProgressPrimitive.Root, _objectSpread2(_objectSpread2({
|
|
13
|
+
ref: ref,
|
|
14
|
+
className: cn("relative h-4 w-full overflow-hidden rounded-full bg-secondary", className)
|
|
15
|
+
}, props), {}, {
|
|
16
|
+
children: jsx(ProgressPrimitive.Indicator, {
|
|
17
|
+
className: "h-full w-full flex-1 bg-primary transition-all",
|
|
18
|
+
style: {
|
|
19
|
+
transform: "translateX(-".concat(100 - (value || 0), "%)")
|
|
20
|
+
}
|
|
21
|
+
})
|
|
22
|
+
}));
|
|
23
|
+
});
|
|
24
|
+
Progress.displayName = ProgressPrimitive.Root.displayName;
|
|
25
|
+
|
|
26
|
+
export { Progress };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
5
|
+
import { cn } from '../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["className", "children"],
|
|
8
|
+
_excluded2 = ["className", "orientation"];
|
|
9
|
+
var ScrollArea = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
10
|
+
var className = _ref.className,
|
|
11
|
+
children = _ref.children,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return jsxs(ScrollAreaPrimitive.Root, _objectSpread2(_objectSpread2({
|
|
14
|
+
ref: ref,
|
|
15
|
+
className: cn("relative overflow-auto", className)
|
|
16
|
+
}, props), {}, {
|
|
17
|
+
children: [jsx(ScrollAreaPrimitive.Viewport, {
|
|
18
|
+
className: "h-full w-full rounded-[inherit]",
|
|
19
|
+
children: children
|
|
20
|
+
}), jsx(ScrollBar, {
|
|
21
|
+
orientation: "vertical"
|
|
22
|
+
}), jsx(ScrollBar, {
|
|
23
|
+
orientation: "horizontal"
|
|
24
|
+
}), jsx(ScrollAreaPrimitive.Corner, {})]
|
|
25
|
+
}));
|
|
26
|
+
});
|
|
27
|
+
ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
|
|
28
|
+
var ScrollBar = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
29
|
+
var className = _ref2.className,
|
|
30
|
+
_ref2$orientation = _ref2.orientation,
|
|
31
|
+
orientation = _ref2$orientation === void 0 ? "vertical" : _ref2$orientation,
|
|
32
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
33
|
+
return jsx(ScrollAreaPrimitive.ScrollAreaScrollbar, _objectSpread2(_objectSpread2({
|
|
34
|
+
ref: ref,
|
|
35
|
+
orientation: orientation,
|
|
36
|
+
className: cn("flex touch-none select-none transition-colors", orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]", orientation === "horizontal" && "h-2.5 border-t border-t-transparent p-[1px]", className)
|
|
37
|
+
}, props), {}, {
|
|
38
|
+
children: jsx(ScrollAreaPrimitive.ScrollAreaThumb, {
|
|
39
|
+
className: cn("relative rounded-full bg-border", orientation === "vertical" ? "flex-1" : "h-full")
|
|
40
|
+
})
|
|
41
|
+
}));
|
|
42
|
+
});
|
|
43
|
+
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
44
|
+
|
|
45
|
+
export { ScrollArea, ScrollBar };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
5
|
+
import { cn } from '../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
var _excluded = ["className"],
|
|
8
|
+
_excluded2 = ["className"],
|
|
9
|
+
_excluded3 = ["className"];
|
|
10
|
+
var Tabs = TabsPrimitive.Root;
|
|
11
|
+
var TabsList = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
12
|
+
var className = _ref.className,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
return jsx(TabsPrimitive.List, _objectSpread2({
|
|
15
|
+
ref: ref,
|
|
16
|
+
className: cn("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", className)
|
|
17
|
+
}, props));
|
|
18
|
+
});
|
|
19
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
20
|
+
var TabsTrigger = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
21
|
+
var className = _ref2.className,
|
|
22
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
23
|
+
return jsx(TabsPrimitive.Trigger, _objectSpread2({
|
|
24
|
+
ref: ref,
|
|
25
|
+
className: cn("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm", className)
|
|
26
|
+
}, props));
|
|
27
|
+
});
|
|
28
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
29
|
+
var TabsContent = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
30
|
+
var className = _ref3.className,
|
|
31
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
32
|
+
return jsx(TabsPrimitive.Content, _objectSpread2({
|
|
33
|
+
ref: ref,
|
|
34
|
+
className: cn("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", className)
|
|
35
|
+
}, props));
|
|
36
|
+
});
|
|
37
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
38
|
+
|
|
39
|
+
export { Tabs, TabsContent, TabsList, TabsTrigger };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { asyncToGenerator as _asyncToGenerator, regenerator as _regenerator } from './_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { pdfjs } from 'react-pdf';
|
|
3
|
+
|
|
4
|
+
// Initialize worker automatically
|
|
5
|
+
if (typeof window !== 'undefined') {
|
|
6
|
+
try {
|
|
7
|
+
// Try to load from CDN first
|
|
8
|
+
var workerSrc = "https://unpkg.com/pdfjs-dist@".concat(pdfjs.version, "/build/pdf.worker.min.mjs");
|
|
9
|
+
// Create a function to test if the worker URL is accessible
|
|
10
|
+
var testWorkerUrl = /*#__PURE__*/function () {
|
|
11
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(url) {
|
|
12
|
+
var response, _t;
|
|
13
|
+
return _regenerator().w(function (_context) {
|
|
14
|
+
while (1) switch (_context.n) {
|
|
15
|
+
case 0:
|
|
16
|
+
_context.p = 0;
|
|
17
|
+
_context.n = 1;
|
|
18
|
+
return fetch(url, {
|
|
19
|
+
method: 'HEAD'
|
|
20
|
+
});
|
|
21
|
+
case 1:
|
|
22
|
+
response = _context.v;
|
|
23
|
+
return _context.a(2, response.ok);
|
|
24
|
+
case 2:
|
|
25
|
+
_context.p = 2;
|
|
26
|
+
_t = _context.v;
|
|
27
|
+
return _context.a(2, false);
|
|
28
|
+
}
|
|
29
|
+
}, _callee, null, [[0, 2]]);
|
|
30
|
+
}));
|
|
31
|
+
return function testWorkerUrl(_x) {
|
|
32
|
+
return _ref.apply(this, arguments);
|
|
33
|
+
};
|
|
34
|
+
}();
|
|
35
|
+
// Test and set worker source
|
|
36
|
+
testWorkerUrl(workerSrc).then(function (isAccessible) {
|
|
37
|
+
if (isAccessible) {
|
|
38
|
+
pdfjs.GlobalWorkerOptions.workerSrc = workerSrc;
|
|
39
|
+
} else {
|
|
40
|
+
// Fallback to relative path that clients can configure
|
|
41
|
+
pdfjs.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs';
|
|
42
|
+
}
|
|
43
|
+
}).catch(function () {
|
|
44
|
+
// If testing fails, default to relative path
|
|
45
|
+
pdfjs.GlobalWorkerOptions.workerSrc = '/pdf.worker.min.mjs';
|
|
46
|
+
});
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Failed to initialize PDF worker:', error);
|
|
49
|
+
}
|
|
50
|
+
}
|