arxatec-ui 0.1.44 → 0.1.45
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/annotation_editor_extensions-OCgySol8.js +804 -0
- package/dist/annotation_editor_extensions-OCgySol8.js.map +1 -0
- package/dist/components/file_view/index.d.ts +1 -1
- package/dist/components/file_view/template_viewer/components/annotation_color_picker/index.d.ts +10 -0
- package/dist/components/file_view/template_viewer/components/annotation_docked_toolbar/annotation_box_font_toolbars.d.ts +2 -0
- package/dist/components/file_view/template_viewer/components/annotation_docked_toolbar/annotation_format_toolbars.d.ts +1 -0
- package/dist/components/file_view/template_viewer/components/annotation_konva_layer/index.d.ts +19 -0
- package/dist/components/file_view/template_viewer/components/annotation_overlay/index.d.ts +2 -0
- package/dist/components/file_view/template_viewer/components/annotation_shape_toolbar/index.d.ts +10 -0
- package/dist/components/file_view/template_viewer/components/annotation_toolbar/index.d.ts +5 -0
- package/dist/components/file_view/template_viewer/components/annotations_side_panel/index.d.ts +2 -2
- package/dist/components/file_view/template_viewer/components/pdf_template_page_row/index.d.ts +13 -4
- package/dist/components/file_view/template_viewer/components/pdf_template_viewer/index.d.ts +11 -3
- package/dist/components/file_view/template_viewer/constants/index.d.ts +41 -7
- package/dist/components/file_view/template_viewer/context/active_annotation_editor_context.d.ts +13 -5
- package/dist/components/file_view/template_viewer/context/active_annotation_editor_provider.d.ts +1 -1
- package/dist/components/file_view/template_viewer/utilities/content/index.d.ts +1 -0
- package/dist/components/file_view/template_viewer/utilities/file/index.d.ts +1 -0
- package/dist/components/file_view/template_viewer/utilities/geometry/annotation_geometry.d.ts +18 -0
- package/dist/components/file_view/template_viewer/utilities/geometry/annotation_konva_coords.d.ts +29 -0
- package/dist/components/file_view/template_viewer/utilities/geometry/index.d.ts +2 -0
- package/dist/components/file_view/template_viewer/utilities/index.d.ts +5 -0
- package/dist/components/file_view/template_viewer/utilities/schema/index.d.ts +1 -0
- package/dist/components/file_view/template_viewer/utilities/schema/template_annotation_schema.d.ts +11 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/index.d.ts +5 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/shape_annotation_utils.d.ts +3 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/shape_color_palette.d.ts +47 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/shape_defaults.d.ts +20 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/shape_labels.d.ts +7 -0
- package/dist/components/file_view/template_viewer/utilities/shapes/template_insert_tool.d.ts +2 -0
- package/dist/components/file_view/types/annotations.d.ts +69 -2
- package/dist/file-view.js +2994 -1375
- package/dist/file-view.js.map +1 -1
- package/dist/index.js +3038 -7492
- package/dist/index.js.map +1 -1
- package/dist/styles.css +199 -0
- package/package.json +16 -10
- package/dist/annotation_editor_extensions-Bjm_qaoM.js +0 -1286
- package/dist/annotation_editor_extensions-Bjm_qaoM.js.map +0 -1
- /package/dist/components/file_view/template_viewer/{merge_plain_into_annotation_html.d.ts → utilities/content/merge_plain_into_annotation_html.d.ts} +0 -0
- /package/dist/components/file_view/template_viewer/{template_file_kind.d.ts → utilities/file/template_file_kind.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation_editor_extensions-OCgySol8.js","names":[],"sources":["../src/hooks/use_media_query/index.ts","../src/components/dialog/index.tsx","../src/components/scroll_area/index.tsx","../src/components/label/index.tsx","../src/components/select/index.tsx","../src/components/badge/index.tsx","../src/components/popover/index.tsx","../src/components/drawer/index.tsx","../src/components/slider/index.tsx","../src/components/status_message/index.tsx","../src/components/tabs/index.tsx","../src/components/text_area/index.tsx","../src/components/rich_text_editor/toolbars/mobile_toolbar_group/index.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/context.tsx","../src/components/rich_text_editor/toolbars/toolbar_provider/toolbar_provider.tsx","../src/components/rich_text_editor/toolbars/color_and_highlight/index.tsx","../src/components/rich_text_editor/toolbars/font_size/constants.ts","../src/components/rich_text_editor/toolbars/italic/index.tsx","../src/components/rich_text_editor/toolbars/underline/index.tsx","../src/components/rich_text_editor/lib/annotation_editor_extensions.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\n\r\nexport function useMediaQuery(query: string): boolean {\r\n const [matches, setMatches] = useState(false);\r\n\r\n useEffect(() => {\r\n const media = window.matchMedia(query);\r\n if (media.matches !== matches) {\r\n setMatches(media.matches);\r\n }\r\n const listener = () => setMatches(media.matches);\r\n window.addEventListener(\"resize\", listener);\r\n return () => window.removeEventListener(\"resize\", listener);\r\n }, [matches, query]);\r\n\r\n return matches;\r\n}\r\n","import * as React from \"react\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n onContextMenu,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border p-4 shadow-lg duration-200 sm:max-w-lg\",\n className\n )}\n onContextMenu={(e) => {\n e.stopPropagation();\n onContextMenu?.(e);\n }}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\n \"text-base font-normal text-primary leading-none\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import * as React from \"react\";\nimport * as ScrollAreaPrimitive from \"@radix-ui/react-scroll-area\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction ScrollArea({\n className,\n children,\n viewportRef,\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {\n viewportRef?: React.Ref<HTMLDivElement>;\n}) {\n const sentinelRef = React.useRef<HTMLDivElement>(null);\n\n // Sync viewportRef via DOM traversal instead of passing it directly to\n // Radix's Viewport ref. Radix composes external refs with an internal\n // callback ref that calls setState — in React 19 this triggers an infinite\n // cleanup/re-apply cycle (setState(null) → re-render → setState(node) → …).\n React.useLayoutEffect(() => {\n if (!viewportRef || !sentinelRef.current) return;\n\n const viewport = sentinelRef.current.closest<HTMLDivElement>(\n '[data-slot=\"scroll-area-viewport\"]'\n );\n\n if (typeof viewportRef === \"function\") {\n viewportRef(viewport);\n return () => {\n viewportRef(null);\n };\n }\n\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = viewport;\n return () => {\n (\n viewportRef as React.MutableRefObject<HTMLDivElement | null>\n ).current = null;\n };\n }, [viewportRef]);\n\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={cn(\"relative\", className)}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className=\"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1\"\n >\n <div ref={sentinelRef} aria-hidden style={{ display: \"none\" }} />\n {children}\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n );\n}\n\nfunction ScrollBar({\n className,\n orientation = \"vertical\",\n ...props\n}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {\n return (\n <ScrollAreaPrimitive.ScrollAreaScrollbar\n data-slot=\"scroll-area-scrollbar\"\n orientation={orientation}\n className={cn(\n \"flex touch-none p-px transition-colors select-none\",\n orientation === \"vertical\" &&\n \"h-full w-2.5 border-l border-l-transparent\",\n orientation === \"horizontal\" &&\n \"h-2.5 flex-col border-t border-t-transparent\",\n className\n )}\n {...props}\n >\n <ScrollAreaPrimitive.ScrollAreaThumb\n data-slot=\"scroll-area-thumb\"\n className=\"bg-border relative flex-1 rounded-sm\"\n />\n </ScrollAreaPrimitive.ScrollAreaScrollbar>\n );\n}\n\nexport { ScrollArea, ScrollBar };\n","import * as React from \"react\";\nimport * as LabelPrimitive from \"@radix-ui/react-label\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Label({\n className,\n ...props\n}: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n \"flex items-center gap-2 text-sm leading-none font-normal select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from \"react\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from \"lucide-react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Select({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = \"default\",\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: \"sm\" | \"default\";\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-card px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"size-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = \"popper\",\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md\",\n position === \"popper\" &&\n \"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1\",\n className\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n \"p-1\",\n position === \"popper\" &&\n \"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1\"\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn(\"text-muted-foreground px-2 py-1.5 text-xs\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span className=\"absolute right-2 flex size-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn(\"bg-border pointer-events-none -mx-1 my-1 h-px\", className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn(\n \"flex cursor-default items-center justify-center py-1\",\n className\n )}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\n\nimport { cn } from \"@/utilities/index\";\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default:\n \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n);\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\";\n\n return (\n <Comp\n data-slot=\"badge\"\n className={cn(badgeVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nexport { Badge, badgeVariants };\n","import * as React from \"react\";\nimport * as PopoverPrimitive from \"@radix-ui/react-popover\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Popover({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Root>) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />;\n}\n\nfunction PopoverTrigger({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {\n return <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} />;\n}\n\nfunction PopoverContent({\n className,\n align = \"center\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>) {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n \"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nfunction PopoverAnchor({\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {\n return <PopoverPrimitive.Anchor data-slot=\"popover-anchor\" {...props} />;\n}\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };\n","import * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Drawer({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />;\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />;\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />;\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />;\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content bg-background fixed z-50 flex h-auto flex-col\",\n \"data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b\",\n \"data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t\",\n \"data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm\",\n \"data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n );\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-foreground font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n};\n","import * as React from \"react\"\nimport * as SliderPrimitive from \"@radix-ui/react-slider\"\n\nimport { cn } from \"@/utilities/index\"\n\nfunction Slider({\n className,\n defaultValue,\n value,\n min = 0,\n max = 100,\n ...props\n}: React.ComponentProps<typeof SliderPrimitive.Root>) {\n const _values = React.useMemo(\n () =>\n Array.isArray(value)\n ? value\n : Array.isArray(defaultValue)\n ? defaultValue\n : [min, max],\n [value, defaultValue, min, max]\n )\n\n return (\n <SliderPrimitive.Root\n data-slot=\"slider\"\n defaultValue={defaultValue}\n value={value}\n min={min}\n max={max}\n className={cn(\n \"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col\",\n className\n )}\n {...props}\n >\n <SliderPrimitive.Track\n data-slot=\"slider-track\"\n className={cn(\n \"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5\"\n )}\n >\n <SliderPrimitive.Range\n data-slot=\"slider-range\"\n className={cn(\n \"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full\"\n )}\n />\n </SliderPrimitive.Track>\n {Array.from({ length: _values.length }, (_, index) => (\n <SliderPrimitive.Thumb\n data-slot=\"slider-thumb\"\n key={index}\n className=\"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50\"\n />\n ))}\n </SliderPrimitive.Root>\n )\n}\n\nexport { Slider }\n","import { cn } from \"@/utilities\";\n\ninterface Props {\n title: string;\n description: string;\n color?: \"rose\" | \"white\";\n icon?: React.ElementType;\n size?: \"sm\" | \"md\";\n classNameCard?: string;\n classNameIconCard?: string;\n classNameTitle?: string;\n classNameDescription?: string;\n}\nconst colorVariants = {\n rose: {\n border: \"border-status-card-border-error\",\n background: \"bg-status-card-background-error\",\n backgroundCardIcon: \"bg-status-card-background-icon-error\",\n textPrimary: \"text-status-card-foreground-error\",\n textSecondary: \"text-status-card-foreground-error opacity-60\",\n },\n white: {\n border: \"border-status-card-border-empty\",\n background: \"bg-status-card-background-empty\",\n backgroundCardIcon: \"bg-status-card-background-icon-empty\",\n textPrimary: \"text-status-card-foreground-empty\",\n textSecondary: \"text-status-card-foreground-emtpy opacity-60\",\n },\n};\n\nexport const StatusMessage: React.FC<Props> = ({\n title,\n description,\n color = \"rose\",\n icon: Icon,\n size = \"md\",\n classNameCard,\n classNameDescription,\n classNameIconCard,\n classNameTitle,\n}) => {\n return (\n <div\n className={cn(\n \" rounded-md flex items-center flex-wrap border\",\n size === \"sm\" ? \"p-4 gap-2\" : \"p-6 gap-4\",\n classNameCard,\n colorVariants[color].background,\n colorVariants[color].border\n )}\n >\n {Icon && (\n <div\n className={cn(\n \"rounded-md flex items-center justify-center \",\n size === \"sm\" ? \"size-8\" : \"size-12\",\n classNameIconCard,\n colorVariants[color].backgroundCardIcon\n )}\n >\n <Icon\n className={cn(\n colorVariants[color].textPrimary,\n size === \"sm\" ? \"size-4\" : \"size-6\"\n )}\n />\n </div>\n )}\n\n <div className={cn(\"flex flex-col\")}>\n <h2\n className={cn(\n \"font-normal\",\n size === \"sm\" ? \"text-sm\" : \"text-base\",\n colorVariants[color].textPrimary,\n classNameTitle\n )}\n >\n {title}\n </h2>\n <p\n className={cn(\n size === \"sm\" ? \"text-sm\" : \"text-sm max-w-md\",\n colorVariants[color].textSecondary,\n classNameDescription\n )}\n >\n {description}\n </p>\n </div>\n </div>\n );\n};\n","import * as React from \"react\";\nimport * as TabsPrimitive from \"@radix-ui/react-tabs\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Tabs({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Root>) {\n return (\n <TabsPrimitive.Root\n data-slot=\"tabs\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n );\n}\n\nfunction TabsList({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.List>) {\n return (\n <TabsPrimitive.List\n data-slot=\"tabs-list\"\n className={cn(\n \"bg-muted text-muted-foreground inline-flex h-8 w-fit items-center justify-center rounded-md p-[3px]\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsTrigger({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Trigger>) {\n return (\n <TabsPrimitive.Trigger\n data-slot=\"tabs-trigger\"\n className={cn(\n \"data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TabsContent({\n className,\n ...props\n}: React.ComponentProps<typeof TabsPrimitive.Content>) {\n return (\n <TabsPrimitive.Content\n data-slot=\"tabs-content\"\n className={cn(\"flex-1 outline-none\", className)}\n {...props}\n />\n );\n}\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent };\n","import * as React from \"react\";\n\nimport { cn } from \"@/utilities/index\";\n\nfunction Textarea({ className, ...props }: React.ComponentProps<\"textarea\">) {\n return (\n <textarea\n data-slot=\"textarea\"\n className={cn(\n \"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-card px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm\",\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Textarea };\n","import { cn } from \"@/utilities\";\r\nimport { ChevronDown } from \"lucide-react\";\r\nimport React, { useState } from \"react\";\r\nimport {\r\n Drawer,\r\n DrawerContent,\r\n DrawerHeader,\r\n DrawerTitle,\r\n DrawerTrigger,\r\n} from \"@/components/drawer\";\r\nimport { Button } from \"@/components/button\";\r\n\r\ninterface MobileToolbarGroupProps {\r\n label: string;\r\n children: React.ReactNode;\r\n className?: string;\r\n}\r\n\r\nexport const MobileToolbarGroup = ({\r\n label,\r\n children,\r\n className,\r\n}: MobileToolbarGroupProps) => {\r\n const [isOpen, setIsOpen] = useState(false);\r\n\r\n const closeDrawer = () => setIsOpen(false);\r\n\r\n return (\r\n <Drawer open={isOpen} onOpenChange={setIsOpen}>\r\n <DrawerTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"sm\"\r\n className={cn(\"h-8 w-max gap-1 px-3 font-normal\", className)}\r\n >\r\n {label}\r\n <ChevronDown className=\"h-4 w-4\" />\r\n </Button>\r\n </DrawerTrigger>\r\n <DrawerContent>\r\n <DrawerHeader>\r\n <DrawerTitle className=\"text-start\">{label}</DrawerTitle>\r\n </DrawerHeader>\r\n <div className=\"flex flex-col p-4\">\r\n {React.Children.map(children, (child) =>\r\n React.isValidElement(child)\r\n ? React.cloneElement(child, { closeDrawer } as {\r\n closeDrawer: () => void;\r\n })\r\n : child\r\n )}\r\n </div>\r\n </DrawerContent>\r\n </Drawer>\r\n );\r\n};\r\n\r\nexport const MobileToolbarItem = ({\r\n children,\r\n active,\r\n onClick,\r\n closeDrawer,\r\n ...props\r\n}: React.ButtonHTMLAttributes<HTMLButtonElement> & {\r\n active?: boolean;\r\n closeDrawer?: () => void;\r\n}) => (\r\n <button\r\n className={cn(\r\n \"flex w-full items-center rounded-md px-4 py-2 text-sm transition-colors hover:bg-accent\",\r\n active && \"bg-accent\"\r\n )}\r\n onClick={(e) => {\r\n onClick?.(e);\r\n setTimeout(() => {\r\n closeDrawer?.();\r\n }, 100);\r\n }}\r\n {...props}\r\n >\r\n {children}\r\n </button>\r\n);\r\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\n\nexport interface ToolbarContextProps {\n editor: Editor;\n}\n\nexport const ToolbarContext = React.createContext<ToolbarContextProps | null>(\n null,\n);\n\nexport const useToolbar = () => {\n const context = React.useContext(ToolbarContext);\n\n if (!context) {\n throw new Error(\"useToolbar must be used within a ToolbarProvider\");\n }\n\n return context;\n};\n","import type { Editor } from \"@tiptap/react\";\nimport React from \"react\";\nimport { ToolbarContext } from \"./context\";\n\ninterface ToolbarProviderProps {\n editor: Editor;\n children: React.ReactNode;\n}\n\nexport const ToolbarProvider = ({ editor, children }: ToolbarProviderProps) => {\n const [, forceUpdate] = React.useReducer((x) => x + 1, 0);\n\n React.useEffect(() => {\n if (!editor) return;\n const handleTransaction = () => forceUpdate();\n editor.on(\"transaction\", handleTransaction);\n return () => {\n editor.off(\"transaction\", handleTransaction);\n };\n }, [editor]);\n\n return (\n <ToolbarContext.Provider value={{ editor }}>\n {children}\n </ToolbarContext.Provider>\n );\n};\n","import { ScrollArea } from \"@/components/scroll_area\";\nimport { Separator } from \"@/components/separator\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\";\nimport { Button } from \"@/components/button\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\nimport { CheckIcon, ChevronDownIcon } from \"lucide-react\";\nimport { useMediaQuery } from \"@/hooks\";\nimport { MobileToolbarGroup, MobileToolbarItem } from \"../mobile_toolbar_group\";\n\nconst TEXT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-text-default)\" },\n { name: \"Gris\", color: \"var(--editor-text-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-text-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-text-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-text-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-text-green)\" },\n { name: \"Azul\", color: \"var(--editor-text-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-text-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-text-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-text-red)\" },\n];\n\nconst HIGHLIGHT_COLORS = [\n { name: \"Predeterminado\", color: \"var(--editor-highlight-default)\" },\n { name: \"Gris\", color: \"var(--editor-highlight-gray)\" },\n { name: \"Marrón\", color: \"var(--editor-highlight-brown)\" },\n { name: \"Naranja\", color: \"var(--editor-highlight-orange)\" },\n { name: \"Amarillo\", color: \"var(--editor-highlight-yellow)\" },\n { name: \"Verde\", color: \"var(--editor-highlight-green)\" },\n { name: \"Azul\", color: \"var(--editor-highlight-blue)\" },\n { name: \"Púrpura\", color: \"var(--editor-highlight-purple)\" },\n { name: \"Rosa\", color: \"var(--editor-highlight-pink)\" },\n { name: \"Rojo\", color: \"var(--editor-highlight-red)\" },\n];\n\ninterface ColorHighlightButtonProps {\n name: string;\n color: string;\n isActive: boolean;\n onClick: () => void;\n isHighlight?: boolean;\n}\n\nconst ColorHighlightButton = ({\n name,\n color,\n isActive,\n onClick,\n isHighlight,\n}: ColorHighlightButtonProps) => (\n <button\n onClick={onClick}\n className=\"flex w-full items-center justify-between rounded-sm px-2 py-1 text-sm hover:bg-muted cursor-pointer\"\n type=\"button\"\n >\n <div className=\"flex items-center space-x-2 \">\n <div\n className=\"rounded-sm border size-5 font-medium\"\n style={isHighlight ? { backgroundColor: color } : { color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n {isActive && <CheckIcon className=\"h-4 w-4\" />}\n </button>\n);\n\nexport const ColorHighlightToolbar = () => {\n const { editor } = useToolbar();\n const isMobile = useMediaQuery(\"(max-width: 640px)\");\n\n const currentColor = editor?.getAttributes(\"textStyle\").color;\n const currentHighlight = editor?.getAttributes(\"highlight\").color;\n\n const handleSetColor = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setColor(color === currentColor ? \"\" : color)\n .run();\n };\n\n const handleSetHighlight = (color: string) => {\n editor\n ?.chain()\n .focus()\n .setHighlight(color === currentHighlight ? { color: \"\" } : { color })\n .run();\n };\n\n const isDisabled =\n !editor?.can().chain().setHighlight().run() ||\n !editor?.can().chain().setColor(\"\").run();\n\n if (isMobile) {\n return (\n <div className=\"flex gap-1\">\n <MobileToolbarGroup label=\"Color\">\n {TEXT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetColor(color)}\n active={currentColor === color}\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"rounded-sm border px-2\" style={{ color }}>\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n\n <MobileToolbarGroup label=\"Resaltado\">\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <MobileToolbarItem\n key={name}\n onClick={() => handleSetHighlight(color)}\n active={currentHighlight === color}\n >\n <div className=\"flex items-center gap-2\">\n <div\n className=\"rounded-sm border px-2\"\n style={{ backgroundColor: color }}\n >\n A\n </div>\n <span>{name}</span>\n </div>\n </MobileToolbarItem>\n ))}\n </MobileToolbarGroup>\n </div>\n );\n }\n\n return (\n <Popover>\n <div className=\"relative h-full\">\n <Tooltip>\n <TooltipTrigger asChild>\n <PopoverTrigger disabled={isDisabled} asChild>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n style={{\n color: currentColor,\n }}\n className={cn(\"h-8 w-14 p-0 font-normal\")}\n >\n <span className=\"text-md\">A</span>\n <ChevronDownIcon className=\"ml-2 h-4 w-4\" />\n </Button>\n </PopoverTrigger>\n </TooltipTrigger>\n <TooltipContent>Color de Texto y Resaltado</TooltipContent>\n </Tooltip>\n\n <PopoverContent\n align=\"start\"\n className=\"w-56 p-0! dark:bg-gray-2\"\n onWheel={(e) => e.stopPropagation()}\n onTouchMove={(e) => e.stopPropagation()}\n >\n <ScrollArea className=\"h-80 pb-2\">\n <div className=\"mb-1 mt-2 px-2 text-xs text-muted-foreground uppercase\">\n Color\n </div>\n <div className=\"px-2\">\n {TEXT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentColor === color}\n onClick={() => handleSetColor(color)}\n />\n ))}\n </div>\n\n <Separator className=\"my-3\" />\n\n <div className=\"mb-1 w-full px-2 text-xs text-muted-foreground uppercase\">\n Fondo (Resaltado)\n </div>\n <div className=\"px-2\">\n {HIGHLIGHT_COLORS.map(({ name, color }) => (\n <ColorHighlightButton\n key={name}\n name={name}\n color={color}\n isActive={currentHighlight === color}\n onClick={() => handleSetHighlight(color)}\n isHighlight\n />\n ))}\n </div>\n </ScrollArea>\n </PopoverContent>\n </div>\n </Popover>\n );\n};\n","export const FONT_SIZE_PRESETS = [\n \"10px\",\n \"11px\",\n \"12px\",\n \"14px\",\n \"16px\",\n \"18px\",\n \"20px\",\n \"22px\",\n \"24px\",\n \"28px\",\n \"32px\",\n \"36px\",\n \"40px\",\n \"48px\",\n \"56px\",\n \"64px\",\n \"72px\",\n] as const;\n","import React from \"react\";\nimport { ItalicIcon } from \"lucide-react\";\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\nimport { Button } from \"@/components/button\";\nimport { cn } from \"@/utilities\";\nimport { useToolbar } from \"../toolbar_provider\";\n\nconst ItalicToolbar = React.forwardRef<\n HTMLButtonElement,\n React.ButtonHTMLAttributes<HTMLButtonElement>\n>(({ className, onClick, children, ...props }, ref) => {\n const { editor } = useToolbar();\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className={cn(\n \"size-7\",\n editor?.isActive(\"italic\") && \"bg-accent\",\n className\n )}\n onClick={(e) => {\n editor?.chain().focus().toggleItalic().run();\n onClick?.(e);\n }}\n disabled={!editor?.can().toggleItalic()}\n ref={ref}\n {...props}\n >\n {children ?? <ItalicIcon className=\"h-4 w-4\" />}\n </Button>\n </TooltipTrigger>\n <TooltipContent>\n <span>Cursiva</span>\n </TooltipContent>\n </Tooltip>\n );\n});\n\nItalicToolbar.displayName = \"ItalicToolbar\";\n\nexport { ItalicToolbar };\n","import React from \"react\";\r\nimport { UnderlineIcon } from \"lucide-react\";\r\nimport { Tooltip, TooltipContent, TooltipTrigger } from \"@/components/tooltip\";\r\nimport { Button } from \"@/components/button\";\r\nimport { cn } from \"@/utilities/index\";\r\nimport { useToolbar } from \"../toolbar_provider\";\r\n\r\nconst UnderlineToolbar = React.forwardRef<\r\n HTMLButtonElement,\r\n React.ButtonHTMLAttributes<HTMLButtonElement>\r\n>(({ className, onClick, children, ...props }, ref) => {\r\n const { editor } = useToolbar();\r\n return (\r\n <Tooltip>\r\n <TooltipTrigger asChild>\r\n <Button\r\n variant=\"ghost\"\r\n size=\"icon\"\r\n className={cn(\r\n \"size-7\",\r\n editor?.isActive(\"underline\") && \"bg-accent\",\r\n className\r\n )}\r\n onClick={(e) => {\r\n editor?.chain().focus().toggleUnderline().run();\r\n onClick?.(e);\r\n }}\r\n disabled={!editor?.can().toggleUnderline()}\r\n ref={ref}\r\n {...props}\r\n >\r\n {children ?? <UnderlineIcon className=\"h-4 w-4\" />}\r\n </Button>\r\n </TooltipTrigger>\r\n <TooltipContent>\r\n <span>Subrayado</span>\r\n </TooltipContent>\r\n </Tooltip>\r\n );\r\n});\r\n\r\nUnderlineToolbar.displayName = \"UnderlineToolbar\";\r\n\r\nexport { UnderlineToolbar };\r\n","import type { Extension } from \"@tiptap/react\";\nimport StarterKit from \"@tiptap/starter-kit\";\nimport { TextStyle, FontFamily, FontSize } from \"@tiptap/extension-text-style\";\nimport { Color } from \"@tiptap/extension-color\";\nimport Highlight from \"@tiptap/extension-highlight\";\nimport Placeholder from \"@tiptap/extension-placeholder\";\nimport Underline from \"@tiptap/extension-underline\";\n\nexport function createAnnotationEditorExtensions(\n placeholder = \"Escribe aquí…\",\n): Extension[] {\n return [\n StarterKit.configure({\n heading: false,\n blockquote: false,\n horizontalRule: false,\n codeBlock: false,\n code: false,\n strike: false,\n link: false,\n underline: false,\n }),\n Placeholder.configure({\n placeholder,\n emptyNodeClass: \"is-editor-empty\",\n includeChildren: false,\n }),\n TextStyle,\n FontFamily,\n FontSize,\n Underline,\n Color,\n Highlight.configure({\n multicolor: true,\n }),\n ] as Extension[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,SAAgB,EAAc,GAAwB;CACpD,IAAM,CAAC,GAAS,KAAc,EAAS,GAAM;AAY7C,QAVA,QAAgB;EACd,IAAM,IAAQ,OAAO,WAAW,EAAM;AACtC,EAAI,EAAM,YAAY,KACpB,EAAW,EAAM,QAAQ;EAE3B,IAAM,UAAiB,EAAW,EAAM,QAAQ;AAEhD,SADA,OAAO,iBAAiB,UAAU,EAAS,QAC9B,OAAO,oBAAoB,UAAU,EAAS;IAC1D,CAAC,GAAS,EAAM,CAAC,EAEb;;;;ACTT,SAAS,GAAO,EACd,GAAG,KACiD;AACpD,QAAO,kBAAC,EAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;EAAS,CAAA;;AAG/D,SAAS,GAAc,EACrB,GAAG,KACoD;AACvD,QAAO,kBAAC,EAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;EAAS,CAAA;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KAAK,CAAC,iBAAiB;GACrC;GACL,GAAI;aAEH,KAAY,kBAAC,IAAD,EAAe,WAAU,WAAY,CAAA;GAC3C,CAAA;EACM,CAAA,EACjB,kBAAC,GAAD,EAAA,UACE,kBAAC,QAAD,EAAA,UAAM,aAAgB,CAAA,EACP,CAAA,CACT,EAAA,CAAA;EAEZ;AAEF,EAAiB,cAAc;;;ACjC/B,SAAgB,GACd,IAAc,iBACD;AACb,QAAO;EACL,GAAW,UAAU;GACnB,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,WAAW;GACX,MAAM;GACN,QAAQ;GACR,MAAM;GACN,WAAW;GACZ,CAAC;EACF,GAAY,UAAU;GACpB;GACA,gBAAgB;GAChB,iBAAiB;GAClB,CAAC;EACF;EACA;EACA;EACA;EACA;EACA,GAAU,UAAU,EAClB,YAAY,IACb,CAAC;EACH"}
|
|
@@ -38,7 +38,7 @@ export { useContainerSize } from './image_viewer/hooks/use_container_size';
|
|
|
38
38
|
export { useVideoPlayer } from './video_player/hooks';
|
|
39
39
|
export type { UseVideoPlayerReturn } from './video_player/hooks/use_video_player';
|
|
40
40
|
export { getSourceLanguageFromFile } from './source_viewer/language';
|
|
41
|
-
export { resolveTemplateFileKind, DOCX_MIME, normalizeMimeBase } from './template_viewer/
|
|
41
|
+
export { resolveTemplateFileKind, DOCX_MIME, normalizeMimeBase } from './template_viewer/utilities';
|
|
42
42
|
export { FileViewLoadingState as PdfViewerLoadingState, FileViewErrorState as PdfViewerErrorState, } from './shared';
|
|
43
43
|
export { LoadingState as ImageViewerLoadingState, ErrorState as ImageViewerErrorState, Toolbar as ImageViewerToolbar, } from './image_viewer/components';
|
|
44
44
|
export { LoadingState as VideoPlayerLoadingState, ErrorState as VideoPlayerErrorState, } from './video_player/components';
|
package/dist/components/file_view/template_viewer/components/annotation_color_picker/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ShapeColorValue } from '../../utilities';
|
|
2
|
+
interface Props {
|
|
3
|
+
label: string;
|
|
4
|
+
tooltip: string;
|
|
5
|
+
value: string | null | undefined;
|
|
6
|
+
onChange: (color: ShapeColorValue) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const AnnotationColorPicker: React.FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AnnotationBoldToolbar(): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/file_view/template_viewer/components/annotation_konva_layer/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TemplateAnnotation } from '../../../types/annotations';
|
|
2
|
+
import { ShapeDrawTool } from '../../utilities';
|
|
3
|
+
interface Props {
|
|
4
|
+
pageNumber: number;
|
|
5
|
+
stageWidth: number;
|
|
6
|
+
stageHeight: number;
|
|
7
|
+
annotations: TemplateAnnotation[];
|
|
8
|
+
annotationAssetUrls: Record<string, string>;
|
|
9
|
+
selectedId: string | null;
|
|
10
|
+
shapeDrawTool: ShapeDrawTool | null;
|
|
11
|
+
createShapeLabel: (kind: ShapeDrawTool) => string;
|
|
12
|
+
onSelect: (id: string) => void;
|
|
13
|
+
onClearSelection: () => void;
|
|
14
|
+
onChange: (next: TemplateAnnotation) => void;
|
|
15
|
+
onShapeDrawToolChange: (tool: ShapeDrawTool | null) => void;
|
|
16
|
+
hidden?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const AnnotationKonvaLayer: React.FC<Props>;
|
|
19
|
+
export {};
|
|
@@ -8,6 +8,8 @@ interface Props {
|
|
|
8
8
|
onChange: (next: FileAnnotation) => void;
|
|
9
9
|
getPageRect: () => DOMRect | null;
|
|
10
10
|
moveableLayoutKey: string;
|
|
11
|
+
hidden?: boolean;
|
|
12
|
+
allowPagePointerEvents?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare const AnnotationOverlay: React.FC<Props>;
|
|
13
15
|
export {};
|
package/dist/components/file_view/template_viewer/components/annotation_shape_toolbar/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemplateAnnotation } from '../../../types/annotations';
|
|
2
|
+
import { KonvaShapeAnnotation } from '../../utilities';
|
|
3
|
+
interface Props {
|
|
4
|
+
annotation: KonvaShapeAnnotation;
|
|
5
|
+
onUpdate: (next: TemplateAnnotation) => void;
|
|
6
|
+
onDelete: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const AnnotationShapeToolbar: React.FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ShapeDrawTool } from '../../utilities';
|
|
2
3
|
interface Props {
|
|
4
|
+
shapeDrawTool: ShapeDrawTool | null;
|
|
5
|
+
onShapeDrawToolChange: (tool: ShapeDrawTool | null) => void;
|
|
3
6
|
onInsertText: () => void;
|
|
7
|
+
onInsertImage: () => void;
|
|
4
8
|
onSaveAsPdf: () => void;
|
|
5
9
|
isExporting: boolean;
|
|
10
|
+
isUploadingImage?: boolean;
|
|
6
11
|
hasAnnotations: boolean;
|
|
7
12
|
formatToolbar?: ReactNode;
|
|
8
13
|
hasSelection?: boolean;
|
package/dist/components/file_view/template_viewer/components/annotations_side_panel/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FileAnnotation } from '../../../types/annotations';
|
|
1
|
+
import { FileAnnotation, TemplateAnnotation } from '../../../types/annotations';
|
|
2
2
|
interface Props {
|
|
3
|
-
annotations:
|
|
3
|
+
annotations: TemplateAnnotation[];
|
|
4
4
|
selectedId: string | null;
|
|
5
5
|
onFocusAnnotation: (id: string) => void;
|
|
6
6
|
onUpdateAnnotation: (next: FileAnnotation) => void;
|
package/dist/components/file_view/template_viewer/components/pdf_template_page_row/index.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { FileAnnotation } from '../../../types/annotations';
|
|
1
|
+
import { FileAnnotation, TemplateAnnotation } from '../../../types/annotations';
|
|
2
|
+
import { ShapeDrawTool } from '../../utilities';
|
|
2
3
|
interface Props {
|
|
3
4
|
pageNumber: number;
|
|
4
5
|
scale: number;
|
|
5
|
-
|
|
6
|
+
pageWidthAtScale1?: number;
|
|
7
|
+
pageHeightAtScale1?: number;
|
|
8
|
+
annotations: TemplateAnnotation[];
|
|
9
|
+
annotationAssetUrls: Record<string, string>;
|
|
6
10
|
selectedId: string | null;
|
|
11
|
+
shapeDrawTool: ShapeDrawTool | null;
|
|
12
|
+
createShapeLabel: (kind: ShapeDrawTool) => string;
|
|
7
13
|
onSelect: (id: string) => void;
|
|
8
|
-
|
|
14
|
+
onClearSelection: () => void;
|
|
15
|
+
onChangeText: (next: FileAnnotation) => void;
|
|
16
|
+
onChangeShape: (next: TemplateAnnotation) => void;
|
|
17
|
+
onShapeDrawToolChange: (tool: ShapeDrawTool | null) => void;
|
|
9
18
|
onPageViewportAtScaleOne?: (width: number, height: number) => void;
|
|
10
19
|
}
|
|
11
|
-
export declare function PdfTemplatePageRow({ pageNumber, scale, annotations, selectedId, onSelect,
|
|
20
|
+
export declare function PdfTemplatePageRow({ pageNumber, scale, pageWidthAtScale1, pageHeightAtScale1, annotations, annotationAssetUrls, selectedId, shapeDrawTool, createShapeLabel, onSelect, onClearSelection, onChangeText, onChangeShape, onShapeDrawToolChange, onPageViewportAtScaleOne, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
21
|
export {};
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
|
-
import { FileAnnotation } from '../../../types/annotations';
|
|
2
|
+
import { FileAnnotation, TemplateAnnotation } from '../../../types/annotations';
|
|
3
|
+
import { ShapeDrawTool } from '../../utilities';
|
|
3
4
|
interface Props {
|
|
4
5
|
documentKey: string;
|
|
5
6
|
url: string;
|
|
6
7
|
pageNumber: number;
|
|
7
8
|
scale: number;
|
|
8
|
-
|
|
9
|
+
pageWidthAtScale1?: number;
|
|
10
|
+
pageHeightAtScale1?: number;
|
|
11
|
+
annotations: TemplateAnnotation[];
|
|
12
|
+
annotationAssetUrls: Record<string, string>;
|
|
9
13
|
selectedId: string | null;
|
|
14
|
+
shapeDrawTool: ShapeDrawTool | null;
|
|
15
|
+
createShapeLabel: (kind: ShapeDrawTool) => string;
|
|
10
16
|
onSelect: (id: string) => void;
|
|
11
17
|
onClearSelection: () => void;
|
|
12
|
-
|
|
18
|
+
onChangeTextAnnotation: (next: FileAnnotation) => void;
|
|
19
|
+
onChangeShapeAnnotation: (next: TemplateAnnotation) => void;
|
|
20
|
+
onShapeDrawToolChange: (tool: ShapeDrawTool | null) => void;
|
|
13
21
|
onDocumentPagesLoaded?: (numPages: number) => void;
|
|
14
22
|
scrollContainerRef?: RefObject<HTMLDivElement | null>;
|
|
15
23
|
onPageViewportAtScaleOne?: (width: number, height: number) => void;
|
|
@@ -1,14 +1,48 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TextAnnotation } from '../../types/annotations';
|
|
2
2
|
export declare const ANNOTATION_DEBOUNCE_MS = 800;
|
|
3
3
|
export declare const ANNOTATION_MIN_WIDTH = 0.06;
|
|
4
|
-
export declare const ANNOTATION_MIN_HEIGHT = 0.
|
|
4
|
+
export declare const ANNOTATION_MIN_HEIGHT = 0.02;
|
|
5
|
+
export declare const ANNOTATION_DEFAULT_FONT_FAMILY = "Arial, Helvetica, sans-serif";
|
|
6
|
+
export declare const ANNOTATION_FONT_FAMILY_OPTIONS: readonly [{
|
|
7
|
+
readonly name: "Arial";
|
|
8
|
+
readonly value: "Arial, Helvetica, sans-serif";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "Times New Roman";
|
|
11
|
+
readonly value: "Times New Roman, Times, serif";
|
|
12
|
+
}, {
|
|
13
|
+
readonly name: "Courier New";
|
|
14
|
+
readonly value: "Courier New, Courier, monospace";
|
|
15
|
+
}, {
|
|
16
|
+
readonly name: "Georgia";
|
|
17
|
+
readonly value: "Georgia, serif";
|
|
18
|
+
}, {
|
|
19
|
+
readonly name: "Verdana";
|
|
20
|
+
readonly value: "Verdana, Geneva, sans-serif";
|
|
21
|
+
}];
|
|
22
|
+
export declare function resolveAnnotationFontOption(stored: string): {
|
|
23
|
+
readonly name: "Arial";
|
|
24
|
+
readonly value: "Arial, Helvetica, sans-serif";
|
|
25
|
+
} | {
|
|
26
|
+
readonly name: "Times New Roman";
|
|
27
|
+
readonly value: "Times New Roman, Times, serif";
|
|
28
|
+
} | {
|
|
29
|
+
readonly name: "Courier New";
|
|
30
|
+
readonly value: "Courier New, Courier, monospace";
|
|
31
|
+
} | {
|
|
32
|
+
readonly name: "Georgia";
|
|
33
|
+
readonly value: "Georgia, serif";
|
|
34
|
+
} | {
|
|
35
|
+
readonly name: "Verdana";
|
|
36
|
+
readonly value: "Verdana, Geneva, sans-serif";
|
|
37
|
+
};
|
|
38
|
+
export declare function normalizeAnnotationFontFamily(stored: string): string;
|
|
5
39
|
export declare const DEFAULT_ANNOTATION: {
|
|
6
|
-
readonly width: 0.
|
|
7
|
-
readonly height: 0.
|
|
40
|
+
readonly width: 0.08;
|
|
41
|
+
readonly height: 0.024;
|
|
8
42
|
readonly font_family: "Arial, Helvetica, sans-serif";
|
|
9
43
|
readonly font_size: 16;
|
|
10
44
|
readonly content_html: "<p>nuevo texto</p>";
|
|
11
45
|
};
|
|
12
|
-
export declare function normalizeFileAnnotation(a:
|
|
13
|
-
export declare function
|
|
14
|
-
export declare function shouldAutoFitAnnotationBox(a:
|
|
46
|
+
export declare function normalizeFileAnnotation(a: TextAnnotation): TextAnnotation;
|
|
47
|
+
export declare function isDefaultNewTextHtml(html: string): boolean;
|
|
48
|
+
export declare function shouldAutoFitAnnotationBox(a: TextAnnotation): boolean;
|
package/dist/components/file_view/template_viewer/context/active_annotation_editor_context.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Editor } from '@tiptap/core';
|
|
2
|
+
import { FileAnnotation, FileAnnotationsSchema } from '../../types/annotations';
|
|
3
|
+
export type ActiveAnnotationEditorEntry = {
|
|
4
|
+
id: string;
|
|
5
|
+
editor: Editor;
|
|
6
|
+
font_size: number;
|
|
7
|
+
font_family: string;
|
|
8
|
+
patchAnnotation: (patch: Partial<FileAnnotation>) => void;
|
|
9
|
+
};
|
|
2
10
|
export type ActiveAnnotationEditorContextValue = {
|
|
3
|
-
active:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
active: ActiveAnnotationEditorEntry | null;
|
|
12
|
+
registerEditor: (id: string, editor: Editor | null, meta?: Omit<ActiveAnnotationEditorEntry, "id" | "editor"> | null) => void;
|
|
13
|
+
getActiveEditorHtml: () => string | null;
|
|
14
|
+
registerActiveEditorHtmlSource: (fn: (() => string) | null) => void;
|
|
15
|
+
prepareSchemaForPersist: (schema: FileAnnotationsSchema, selectedId: string | null) => FileAnnotationsSchema;
|
|
8
16
|
};
|
|
9
17
|
export declare const ActiveAnnotationEditorContext: import('react').Context<ActiveAnnotationEditorContextValue | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './merge_plain_into_annotation_html';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './template_file_kind';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const ANNOTATION_PADDING_PX = 6;
|
|
2
|
+
export declare const ANNOTATION_BORDER_PX = 1;
|
|
3
|
+
export declare const ANNOTATION_WIDTH_BUFFER_PX = 4;
|
|
4
|
+
export declare const ANNOTATION_LINE_HEIGHT = 1;
|
|
5
|
+
export declare function annotationPaddingScreen(pdfScale: number): number;
|
|
6
|
+
export declare function estimateAnnotationTextBoxNorm(params: {
|
|
7
|
+
text: string;
|
|
8
|
+
fontSizePx: number;
|
|
9
|
+
fontFamily: string;
|
|
10
|
+
pageWidthPx: number;
|
|
11
|
+
pageHeightPx: number;
|
|
12
|
+
pdfScale?: number;
|
|
13
|
+
minWidth?: number;
|
|
14
|
+
minHeight?: number;
|
|
15
|
+
}): {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
};
|
package/dist/components/file_view/template_viewer/utilities/geometry/annotation_konva_coords.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare function normPointToStage(nx: number, ny: number, stageW: number, stageH: number): {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
};
|
|
5
|
+
export declare function stagePointToNorm(sx: number, sy: number, stageW: number, stageH: number): {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
export declare function normSizeToStage(nw: number, nh: number, stageW: number, stageH: number): {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function stageSizeToNorm(sw: number, sh: number, stageW: number, stageH: number): {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function strokeNormToStage(strokeWidth: number, stageW: number): number;
|
|
18
|
+
export declare function bboxFromStageDrag(x0: number, y0: number, x1: number, y1: number, stageW: number, stageH: number): {
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function lineFromStageDrag(x0: number, y0: number, x1: number, y1: number, stageW: number, stageH: number): {
|
|
25
|
+
x1: number;
|
|
26
|
+
y1: number;
|
|
27
|
+
x2: number;
|
|
28
|
+
y2: number;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './template_annotation_schema';
|
package/dist/components/file_view/template_viewer/utilities/schema/template_annotation_schema.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EllipseAnnotation, FileAnnotationsSchema, ImageAnnotation, LineAnnotation, RectAnnotation, TemplateAnnotation, TextAnnotation } from '../../../types/annotations';
|
|
2
|
+
export declare function normalizeTextAnnotation(a: TextAnnotation): TextAnnotation;
|
|
3
|
+
export declare function normalizeLineAnnotation(a: LineAnnotation): LineAnnotation;
|
|
4
|
+
export declare function normalizeRectAnnotation(a: RectAnnotation): RectAnnotation;
|
|
5
|
+
export declare function normalizeEllipseAnnotation(a: EllipseAnnotation): EllipseAnnotation;
|
|
6
|
+
export declare function normalizeImageAnnotation(a: ImageAnnotation): ImageAnnotation;
|
|
7
|
+
export declare function normalizeTemplateAnnotation(a: TemplateAnnotation): TemplateAnnotation;
|
|
8
|
+
export declare function migrateTemplateAnnotationFromStorage(raw: unknown): TemplateAnnotation | null;
|
|
9
|
+
export declare function migrateAnnotationsFromStorage(raw: unknown): TemplateAnnotation[];
|
|
10
|
+
export declare function normalizeAnnotationsSchema(s: FileAnnotationsSchema): FileAnnotationsSchema;
|
|
11
|
+
export declare function parseAndNormalizeAnnotationsSchema(raw: unknown): FileAnnotationsSchema | null;
|
package/dist/components/file_view/template_viewer/utilities/shapes/shape_annotation_utils.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EllipseAnnotation, LineAnnotation, RectAnnotation, TemplateAnnotation } from '../../../types/annotations';
|
|
2
|
+
export type KonvaShapeAnnotation = LineAnnotation | RectAnnotation | EllipseAnnotation;
|
|
3
|
+
export declare function isShapeToolbarAnnotation(ann: TemplateAnnotation | undefined): ann is KonvaShapeAnnotation;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const SHAPE_COLOR_PALETTE: readonly [{
|
|
2
|
+
readonly name: "Transparente";
|
|
3
|
+
readonly value: "transparent";
|
|
4
|
+
}, {
|
|
5
|
+
readonly name: "Blanco";
|
|
6
|
+
readonly value: "#FFFFFF";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "Negro";
|
|
9
|
+
readonly value: "#000000";
|
|
10
|
+
}, {
|
|
11
|
+
readonly name: "Rojo";
|
|
12
|
+
readonly value: "#F44336";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "Rosa";
|
|
15
|
+
readonly value: "#E91E63";
|
|
16
|
+
}, {
|
|
17
|
+
readonly name: "Púrpura";
|
|
18
|
+
readonly value: "#9C27B0";
|
|
19
|
+
}, {
|
|
20
|
+
readonly name: "Azul";
|
|
21
|
+
readonly value: "#2196F3";
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "Cian";
|
|
24
|
+
readonly value: "#00BCD4";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "Verde";
|
|
27
|
+
readonly value: "#4CAF50";
|
|
28
|
+
}, {
|
|
29
|
+
readonly name: "Amarillo";
|
|
30
|
+
readonly value: "#FFEB3B";
|
|
31
|
+
}, {
|
|
32
|
+
readonly name: "Naranja";
|
|
33
|
+
readonly value: "#FF5722";
|
|
34
|
+
}, {
|
|
35
|
+
readonly name: "Marrón";
|
|
36
|
+
readonly value: "#795548";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "Gris claro";
|
|
39
|
+
readonly value: "#E0E0E0";
|
|
40
|
+
}, {
|
|
41
|
+
readonly name: "Gris";
|
|
42
|
+
readonly value: "#9E9E9E";
|
|
43
|
+
}, {
|
|
44
|
+
readonly name: "Gris oscuro";
|
|
45
|
+
readonly value: "#424242";
|
|
46
|
+
}];
|
|
47
|
+
export type ShapeColorValue = (typeof SHAPE_COLOR_PALETTE)[number]["value"];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const DEFAULT_SHAPE_STROKE = "#111827";
|
|
2
|
+
export declare const SHAPE_STROKE_TRANSPARENT = "transparent";
|
|
3
|
+
export declare function isTransparentShapeStroke(stroke?: string | null): boolean;
|
|
4
|
+
export declare function normalizeShapeStroke(stroke?: string): string;
|
|
5
|
+
export declare const DEFAULT_LINE_STROKE_WIDTH = 0.003;
|
|
6
|
+
export declare const DEFAULT_SHAPE_STROKE_WIDTH = 0.002;
|
|
7
|
+
export declare const STROKE_WIDTH_PRESETS: readonly [{
|
|
8
|
+
readonly label: "1 pt";
|
|
9
|
+
readonly value: 0.0016;
|
|
10
|
+
}, {
|
|
11
|
+
readonly label: "2 pt";
|
|
12
|
+
readonly value: 0.003;
|
|
13
|
+
}, {
|
|
14
|
+
readonly label: "5 pt";
|
|
15
|
+
readonly value: 0.008;
|
|
16
|
+
}, {
|
|
17
|
+
readonly label: "10 pt";
|
|
18
|
+
readonly value: 0.016;
|
|
19
|
+
}];
|
|
20
|
+
export declare function nearestStrokePresetValue(norm: number): number;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ShapeDrawTool } from './template_insert_tool';
|
|
2
|
+
import { TemplateAnnotation } from '../../../types/annotations';
|
|
3
|
+
export declare function shapeKindFromAnnotation(ann: TemplateAnnotation): ShapeDrawTool | null;
|
|
4
|
+
export declare function parseShapeLabelNumber(label: string, kind: ShapeDrawTool): number | null;
|
|
5
|
+
export declare function buildShapeLabel(kind: ShapeDrawTool, n: number): string;
|
|
6
|
+
export declare function displayLabelForAnnotation(ann: TemplateAnnotation, allAnnotations?: TemplateAnnotation[]): string;
|
|
7
|
+
export declare function syncShapeLabelCounters(annotations: TemplateAnnotation[]): Record<ShapeDrawTool, number>;
|