arxatec-ui 0.1.65 → 0.1.66

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/components/animated_icons/hooks/use_animated_icon/index.js +2 -2
  2. package/dist/components/animated_icons/hooks/use_animated_icon/index.js.map +1 -1
  3. package/dist/components/file_view/components/docx_preview_viewer/components/file_docx_preview_viewer_content/index.js +2 -5
  4. package/dist/components/file_view/components/docx_preview_viewer/components/file_docx_preview_viewer_content/index.js.map +1 -1
  5. package/dist/components/file_view/components/file_url_preview_sheet/index.js +8 -11
  6. package/dist/components/file_view/components/file_url_preview_sheet/index.js.map +1 -1
  7. package/dist/components/file_view/components/file_view_sheet/components/file_view_sheet_panel_content/index.js +53 -53
  8. package/dist/components/file_view/components/file_view_sheet/components/file_view_sheet_panel_content/index.js.map +1 -1
  9. package/dist/components/file_view/components/image_viewer/components/file_image_viewer_content/index.js +6 -6
  10. package/dist/components/file_view/components/image_viewer/components/loading_state/index.d.ts +1 -5
  11. package/dist/components/file_view/components/loading_state/index.d.ts +5 -1
  12. package/dist/components/file_view/components/loading_state/index.js +10 -4
  13. package/dist/components/file_view/components/loading_state/index.js.map +1 -1
  14. package/dist/components/file_view/components/office_viewer/components/file_office_viewer_content/index.d.ts +1 -1
  15. package/dist/components/file_view/components/office_viewer/components/file_office_viewer_content/index.js +65 -44
  16. package/dist/components/file_view/components/office_viewer/components/file_office_viewer_content/index.js.map +1 -1
  17. package/dist/components/file_view/components/office_viewer/constants/index.d.ts +6 -0
  18. package/dist/components/file_view/components/office_viewer/constants/index.js +5 -0
  19. package/dist/components/file_view/components/office_viewer/constants/index.js.map +1 -0
  20. package/dist/components/file_view/components/office_viewer/hooks/index.d.ts +1 -0
  21. package/dist/components/file_view/components/office_viewer/hooks/use_office_embed_overlay/index.d.ts +2 -0
  22. package/dist/components/file_view/components/office_viewer/hooks/use_office_embed_overlay/index.js +32 -0
  23. package/dist/components/file_view/components/office_viewer/hooks/use_office_embed_overlay/index.js.map +1 -0
  24. package/dist/components/file_view/components/pdf_viewer/components/content/index.js.map +1 -1
  25. package/dist/components/file_view/components/source_viewer/index.js +2 -5
  26. package/dist/components/file_view/components/source_viewer/index.js.map +1 -1
  27. package/dist/components/file_view/components/summary_viewer/index.js +2 -5
  28. package/dist/components/file_view/components/summary_viewer/index.js.map +1 -1
  29. package/dist/components/file_view/components/template_viewer/components/pdf_template_viewer/components/pdf_template_viewer_content/index.js.map +1 -1
  30. package/dist/components/file_view/components/transcription_viewer/index.js +2 -5
  31. package/dist/components/file_view/components/transcription_viewer/index.js.map +1 -1
  32. package/dist/components/file_view/components/unknown_viewer/index.js +2 -5
  33. package/dist/components/file_view/components/unknown_viewer/index.js.map +1 -1
  34. package/dist/components/file_view/components/video_player/components/loading_state/index.d.ts +1 -1
  35. package/dist/components/file_view/components/xlsx_preview_viewer/components/file_xlsx_preview_viewer_content/index.js +1 -1
  36. package/dist/components/file_view/components/xlsx_preview_viewer/components/loading_state/index.d.ts +1 -2
  37. package/dist/components/file_view/utilities/setup_pdf_worker/index.d.ts +1 -0
  38. package/dist/file-view.js +42 -44
  39. package/dist/styles.css +36 -0
  40. package/package.json +1 -1
  41. package/dist/components/file_view/components/image_viewer/components/loading_state/index.js +0 -9
  42. package/dist/components/file_view/components/image_viewer/components/loading_state/index.js.map +0 -1
  43. package/dist/components/file_view/components/video_player/components/loading_state/index.js +0 -11
  44. package/dist/components/file_view/components/video_player/components/loading_state/index.js.map +0 -1
  45. package/dist/components/file_view/components/xlsx_preview_viewer/components/loading_state/index.js +0 -11
  46. package/dist/components/file_view/components/xlsx_preview_viewer/components/loading_state/index.js.map +0 -1
@@ -5,10 +5,10 @@ var n = () => {
5
5
  return {
6
6
  iconRef: n,
7
7
  onMouseEnter: e(() => {
8
- n.current?.startAnimation();
8
+ n.current?.startAnimation?.();
9
9
  }, []),
10
10
  onMouseLeave: e(() => {
11
- n.current?.stopAnimation();
11
+ n.current?.stopAnimation?.();
12
12
  }, [])
13
13
  };
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/animated_icons/hooks/use_animated_icon/index.ts"],"sourcesContent":["import { useRef, useCallback } from \"react\";\n\nexport interface AnimatedIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\nexport const useAnimatedIcon = () => {\n const iconRef = useRef<AnimatedIconHandle>(null);\n\n const handleMouseEnter = useCallback(() => {\n iconRef.current?.startAnimation();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n iconRef.current?.stopAnimation();\n }, []);\n\n return {\n iconRef,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n};\n"],"mappings":";;AAOA,IAAa,UAAwB;CACnC,IAAM,IAAU,EAA2B,KAAK;AAUhD,QAAO;EACL;EACA,cAVuB,QAAkB;AACzC,KAAQ,SAAS,gBAAgB;KAChC,EAAE,CAAC;EASJ,cAPuB,QAAkB;AACzC,KAAQ,SAAS,eAAe;KAC/B,EAAE,CAAC;EAML"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/animated_icons/hooks/use_animated_icon/index.ts"],"sourcesContent":["import { useRef, useCallback } from \"react\";\n\nexport interface AnimatedIconHandle {\n startAnimation: () => void;\n stopAnimation: () => void;\n}\n\nexport const useAnimatedIcon = () => {\n const iconRef = useRef<AnimatedIconHandle>(null);\n\n const handleMouseEnter = useCallback(() => {\n iconRef.current?.startAnimation?.();\n }, []);\n\n const handleMouseLeave = useCallback(() => {\n iconRef.current?.stopAnimation?.();\n }, []);\n\n return {\n iconRef,\n onMouseEnter: handleMouseEnter,\n onMouseLeave: handleMouseLeave,\n };\n};\n"],"mappings":";;AAOA,IAAa,UAAwB;CACnC,IAAM,IAAU,EAA2B,KAAK;AAUhD,QAAO;EACL;EACA,cAVuB,QAAkB;AACzC,KAAQ,SAAS,kBAAkB;KAClC,EAAE,CAAC;EASJ,cAPuB,QAAkB;AACzC,KAAQ,SAAS,iBAAiB;KACjC,EAAE,CAAC;EAML"}
@@ -1,5 +1,5 @@
1
1
  import { StatusMessage as e } from "../../../../../status_message/index.js";
2
- import { Skeleton as t } from "../../../../../skeleton/index.js";
2
+ import { FileViewLoadingState as t } from "../../../loading_state/index.js";
3
3
  import { Toolbar as n } from "../toolbar/index.js";
4
4
  import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
5
5
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
@@ -39,10 +39,7 @@ var f = ({ file: f }) => {
39
39
  children: [/* @__PURE__ */ c("div", {
40
40
  className: "w-full h-full overflow-auto",
41
41
  children: [
42
- m && /* @__PURE__ */ s("div", {
43
- className: "absolute inset-0 z-10 flex min-h-0 p-4",
44
- children: /* @__PURE__ */ s(t, { className: "h-full w-full min-h-full" })
45
- }),
42
+ m && /* @__PURE__ */ s(t, { className: "absolute inset-0 z-10 bg-background" }),
46
43
  g && /* @__PURE__ */ s("div", {
47
44
  className: "absolute inset-0 z-10 flex min-h-0 bg-background p-4",
48
45
  children: /* @__PURE__ */ s(e, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/docx_preview_viewer/components/file_docx_preview_viewer_content/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { renderAsync } from \"docx-preview\";\nimport { FileX } from \"lucide-react\";\nimport { toast } from \"sonner\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { Toolbar } from \"../toolbar\";\nimport type { FileDocxPreviewViewerProps } from \"../../types\";\n\nconst FileDocxPreviewViewerContent = ({\n file,\n}: FileDocxPreviewViewerProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [scale, setScale] = useState(1);\n\n const handleZoomIn = useCallback(\n () => setScale((prev) => Math.min(prev + 0.2, 3.0)),\n [],\n );\n\n const handleZoomOut = useCallback(\n () => setScale((prev) => Math.max(prev - 0.2, 0.5)),\n [],\n );\n\n const handleDownload = useCallback(() => {\n try {\n const blobUrl = window.URL.createObjectURL(file);\n const link = document.createElement(\"a\");\n link.href = blobUrl;\n link.download = file.name || \"documento.docx\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(blobUrl);\n } catch (downloadError) {\n console.error(downloadError);\n toast.error(\"Error al descargar el documento\");\n }\n }, [file]);\n\n useEffect(() => {\n if (!containerRef.current) return;\n const el = containerRef.current;\n let cancelled = false;\n el.innerHTML = \"\";\n\n file\n .arrayBuffer()\n .then((buffer) =>\n renderAsync(buffer, el, undefined, {\n className: \"docx-preview-container\",\n inWrapper: true,\n ignoreWidth: false,\n ignoreHeight: false,\n ignoreFonts: false,\n breakPages: true,\n useBase64URL: true,\n }),\n )\n .then(() => {\n if (!cancelled) setLoading(false);\n })\n .catch((err) => {\n if (!cancelled) {\n setLoading(false);\n setError(\n err instanceof Error\n ? err.message\n : \"Error al renderizar el documento\",\n );\n }\n });\n\n return () => {\n cancelled = true;\n };\n }, [file]);\n\n return (\n <div className=\"relative w-full h-full bg-accent\">\n <div className=\"w-full h-full overflow-auto\">\n {loading && (\n <div className=\"absolute inset-0 z-10 flex min-h-0 p-4\">\n <Skeleton className=\"h-full w-full min-h-full\" />\n </div>\n )}\n {error && (\n <div className=\"absolute inset-0 z-10 flex min-h-0 bg-background p-4\">\n <StatusMessage\n title=\"Error al renderizar el documento\"\n description={error}\n icon={FileX}\n classNameCard=\"h-full w-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"rose\"\n />\n </div>\n )}\n <div\n ref={containerRef}\n className=\"w-full min-h-full p-4 transition-transform duration-200\"\n style={{\n transform: `scale(${scale})`,\n transformOrigin: \"top center\",\n }}\n />\n </div>\n {!error && (\n <Toolbar\n scale={scale}\n onZoomIn={handleZoomIn}\n onZoomOut={handleZoomOut}\n onDownload={handleDownload}\n disabled={loading}\n />\n )}\n </div>\n );\n};\n\nexport { FileDocxPreviewViewerContent };\n"],"mappings":";;;;;;;;;AASA,IAAM,KAAgC,EACpC,cACgC;CAChC,IAAM,IAAe,EAAuB,KAAK,EAC3C,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAO,KAAY,EAAS,EAAE,EAE/B,IAAe,QACb,GAAU,MAAS,KAAK,IAAI,IAAO,IAAK,EAAI,CAAC,EACnD,EAAE,CACH,EAEK,IAAgB,QACd,GAAU,MAAS,KAAK,IAAI,IAAO,IAAK,GAAI,CAAC,EACnD,EAAE,CACH,EAEK,IAAiB,QAAkB;AACvC,MAAI;GACF,IAAM,IAAU,OAAO,IAAI,gBAAgB,EAAK,EAC1C,IAAO,SAAS,cAAc,IAAI;AAMxC,GALA,EAAK,OAAO,GACZ,EAAK,WAAW,EAAK,QAAQ,kBAC7B,SAAS,KAAK,YAAY,EAAK,EAC/B,EAAK,OAAO,EACZ,SAAS,KAAK,YAAY,EAAK,EAC/B,OAAO,IAAI,gBAAgB,EAAQ;WAC5B,GAAe;AAEtB,GADA,QAAQ,MAAM,EAAc,EAC5B,EAAM,MAAM,kCAAkC;;IAE/C,CAAC,EAAK,CAAC;AAwCV,QAtCA,QAAgB;AACd,MAAI,CAAC,EAAa,QAAS;EAC3B,IAAM,IAAK,EAAa,SACpB,IAAY;AA8BhB,SA7BA,EAAG,YAAY,IAEf,EACG,aAAa,CACb,MAAM,MACL,EAAY,GAAQ,GAAI,KAAA,GAAW;GACjC,WAAW;GACX,WAAW;GACX,aAAa;GACb,cAAc;GACd,aAAa;GACb,YAAY;GACZ,cAAc;GACf,CAAC,CACH,CACA,WAAW;AACV,GAAK,KAAW,EAAW,GAAM;IACjC,CACD,OAAO,MAAQ;AACd,GAAK,MACH,EAAW,GAAM,EACjB,EACE,aAAe,QACX,EAAI,UACJ,mCACL;IAEH,QAES;AACX,OAAY;;IAEb,CAAC,EAAK,CAAC,EAGR,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KACC,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD,EAAU,WAAU,4BAA6B,CAAA;KAC7C,CAAA;IAEP,KACC,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MACE,OAAM;MACN,aAAa;MACb,MAAM;MACN,eAAc;MACd,mBAAkB;MAClB,sBAAqB;MACrB,gBAAe;MACf,OAAM;MACN,CAAA;KACE,CAAA;IAER,kBAAC,OAAD;KACE,KAAK;KACL,WAAU;KACV,OAAO;MACL,WAAW,SAAS,EAAM;MAC1B,iBAAiB;MAClB;KACD,CAAA;IACE;MACL,CAAC,KACA,kBAAC,GAAD;GACS;GACP,UAAU;GACV,WAAW;GACX,YAAY;GACZ,UAAU;GACV,CAAA,CAEA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/docx_preview_viewer/components/file_docx_preview_viewer_content/index.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { renderAsync } from \"docx-preview\";\nimport { FileX } from \"lucide-react\";\nimport { toast } from \"sonner\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { FileViewLoadingState } from \"../../../loading_state\";\nimport { Toolbar } from \"../toolbar\";\nimport type { FileDocxPreviewViewerProps } from \"../../types\";\n\nconst FileDocxPreviewViewerContent = ({\n file,\n}: FileDocxPreviewViewerProps) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<string | null>(null);\n const [scale, setScale] = useState(1);\n\n const handleZoomIn = useCallback(\n () => setScale((prev) => Math.min(prev + 0.2, 3.0)),\n [],\n );\n\n const handleZoomOut = useCallback(\n () => setScale((prev) => Math.max(prev - 0.2, 0.5)),\n [],\n );\n\n const handleDownload = useCallback(() => {\n try {\n const blobUrl = window.URL.createObjectURL(file);\n const link = document.createElement(\"a\");\n link.href = blobUrl;\n link.download = file.name || \"documento.docx\";\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n window.URL.revokeObjectURL(blobUrl);\n } catch (downloadError) {\n console.error(downloadError);\n toast.error(\"Error al descargar el documento\");\n }\n }, [file]);\n\n useEffect(() => {\n if (!containerRef.current) return;\n const el = containerRef.current;\n let cancelled = false;\n el.innerHTML = \"\";\n\n file\n .arrayBuffer()\n .then((buffer) =>\n renderAsync(buffer, el, undefined, {\n className: \"docx-preview-container\",\n inWrapper: true,\n ignoreWidth: false,\n ignoreHeight: false,\n ignoreFonts: false,\n breakPages: true,\n useBase64URL: true,\n }),\n )\n .then(() => {\n if (!cancelled) setLoading(false);\n })\n .catch((err) => {\n if (!cancelled) {\n setLoading(false);\n setError(\n err instanceof Error\n ? err.message\n : \"Error al renderizar el documento\",\n );\n }\n });\n\n return () => {\n cancelled = true;\n };\n }, [file]);\n\n return (\n <div className=\"relative w-full h-full bg-accent\">\n <div className=\"w-full h-full overflow-auto\">\n {loading && (\n <FileViewLoadingState className=\"absolute inset-0 z-10 bg-background\" />\n )}\n {error && (\n <div className=\"absolute inset-0 z-10 flex min-h-0 bg-background p-4\">\n <StatusMessage\n title=\"Error al renderizar el documento\"\n description={error}\n icon={FileX}\n classNameCard=\"h-full w-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"rose\"\n />\n </div>\n )}\n <div\n ref={containerRef}\n className=\"w-full min-h-full p-4 transition-transform duration-200\"\n style={{\n transform: `scale(${scale})`,\n transformOrigin: \"top center\",\n }}\n />\n </div>\n {!error && (\n <Toolbar\n scale={scale}\n onZoomIn={handleZoomIn}\n onZoomOut={handleZoomOut}\n onDownload={handleDownload}\n disabled={loading}\n />\n )}\n </div>\n );\n};\n\nexport { FileDocxPreviewViewerContent };\n"],"mappings":";;;;;;;;;AASA,IAAM,KAAgC,EACpC,cACgC;CAChC,IAAM,IAAe,EAAuB,KAAK,EAC3C,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAwB,KAAK,EACjD,CAAC,GAAO,KAAY,EAAS,EAAE,EAE/B,IAAe,QACb,GAAU,MAAS,KAAK,IAAI,IAAO,IAAK,EAAI,CAAC,EACnD,EAAE,CACH,EAEK,IAAgB,QACd,GAAU,MAAS,KAAK,IAAI,IAAO,IAAK,GAAI,CAAC,EACnD,EAAE,CACH,EAEK,IAAiB,QAAkB;AACvC,MAAI;GACF,IAAM,IAAU,OAAO,IAAI,gBAAgB,EAAK,EAC1C,IAAO,SAAS,cAAc,IAAI;AAMxC,GALA,EAAK,OAAO,GACZ,EAAK,WAAW,EAAK,QAAQ,kBAC7B,SAAS,KAAK,YAAY,EAAK,EAC/B,EAAK,OAAO,EACZ,SAAS,KAAK,YAAY,EAAK,EAC/B,OAAO,IAAI,gBAAgB,EAAQ;WAC5B,GAAe;AAEtB,GADA,QAAQ,MAAM,EAAc,EAC5B,EAAM,MAAM,kCAAkC;;IAE/C,CAAC,EAAK,CAAC;AAwCV,QAtCA,QAAgB;AACd,MAAI,CAAC,EAAa,QAAS;EAC3B,IAAM,IAAK,EAAa,SACpB,IAAY;AA8BhB,SA7BA,EAAG,YAAY,IAEf,EACG,aAAa,CACb,MAAM,MACL,EAAY,GAAQ,GAAI,KAAA,GAAW;GACjC,WAAW;GACX,WAAW;GACX,aAAa;GACb,cAAc;GACd,aAAa;GACb,YAAY;GACZ,cAAc;GACf,CAAC,CACH,CACA,WAAW;AACV,GAAK,KAAW,EAAW,GAAM;IACjC,CACD,OAAO,MAAQ;AACd,GAAK,MACH,EAAW,GAAM,EACjB,EACE,aAAe,QACX,EAAI,UACJ,mCACL;IAEH,QAES;AACX,OAAY;;IAEb,CAAC,EAAK,CAAC,EAGR,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf;IACG,KACC,kBAAC,GAAD,EAAsB,WAAU,uCAAwC,CAAA;IAEzE,KACC,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MACE,OAAM;MACN,aAAa;MACb,MAAM;MACN,eAAc;MACd,mBAAkB;MAClB,sBAAqB;MACrB,gBAAe;MACf,OAAM;MACN,CAAA;KACE,CAAA;IAER,kBAAC,OAAD;KACE,KAAK;KACL,WAAU;KACV,OAAO;MACL,WAAW,SAAS,EAAM;MAC1B,iBAAiB;MAClB;KACD,CAAA;IACE;MACL,CAAC,KACA,kBAAC,GAAD;GACS;GACP,UAAU;GACV,WAAW;GACX,YAAY;GACZ,UAAU;GACV,CAAA,CAEA"}
@@ -1,6 +1,6 @@
1
1
  import { StatusMessage as e } from "../../../status_message/index.js";
2
- import { Skeleton as t } from "../../../skeleton/index.js";
3
- import { Sheet as n, SheetContent as r, SheetDescription as i, SheetHeader as a, SheetTitle as o } from "../../../sheet/index.js";
2
+ import { Sheet as t, SheetContent as n, SheetDescription as r, SheetHeader as i, SheetTitle as a } from "../../../sheet/index.js";
3
+ import { FileViewLoadingState as o } from "../loading_state/index.js";
4
4
  import { getFileNameFromUrl as s } from "../../utilities/get_extension_from_url.js";
5
5
  import { FileUrlPreviewRender as c } from "../file_url_preview_render/index.js";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -8,27 +8,24 @@ import { FileX as d } from "lucide-react";
8
8
  //#region src/components/file_view/components/file_url_preview_sheet/index.tsx
9
9
  var f = ({ open: f, onOpenChange: p, url: m, fileName: h, isPending: g = !1, isError: _ = !1 }) => {
10
10
  let v = h ?? (m ? s(m) : "Vista previa");
11
- return /* @__PURE__ */ l(n, {
11
+ return /* @__PURE__ */ l(t, {
12
12
  open: f,
13
13
  onOpenChange: p,
14
- children: /* @__PURE__ */ u(r, {
14
+ children: /* @__PURE__ */ u(n, {
15
15
  className: "sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden",
16
- children: [/* @__PURE__ */ u(a, {
16
+ children: [/* @__PURE__ */ u(i, {
17
17
  className: "px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10",
18
- children: [/* @__PURE__ */ l(o, {
18
+ children: [/* @__PURE__ */ l(a, {
19
19
  className: "line-clamp-1 flex-1 mr-4",
20
20
  children: v
21
- }), /* @__PURE__ */ l(i, {
21
+ }), /* @__PURE__ */ l(r, {
22
22
  className: "sr-only",
23
23
  children: "Vista previa del archivo."
24
24
  })]
25
25
  }), /* @__PURE__ */ u("div", {
26
26
  className: "flex-1 relative min-h-0 bg-background overflow-hidden",
27
27
  children: [
28
- g && /* @__PURE__ */ l("div", {
29
- className: "p-4",
30
- children: /* @__PURE__ */ l(t, { className: "h-48 w-full rounded-md" })
31
- }),
28
+ g && /* @__PURE__ */ l(o, {}),
32
29
  _ && /* @__PURE__ */ l("div", {
33
30
  className: "p-4",
34
31
  children: /* @__PURE__ */ l(e, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/file_url_preview_sheet/index.tsx"],"sourcesContent":["import { FileX } from \"lucide-react\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/sheet\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { FileUrlPreviewRender } from \"../file_url_preview_render\";\nimport { getFileNameFromUrl } from \"../../utilities/get_extension_from_url\";\n\nexport interface FileUrlPreviewSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n url: string | null;\n fileName?: string;\n isPending?: boolean;\n isError?: boolean;\n}\n\nexport const FileUrlPreviewSheet = ({\n open,\n onOpenChange,\n url,\n fileName,\n isPending = false,\n isError = false,\n}: FileUrlPreviewSheetProps) => {\n const displayName =\n fileName ?? (url ? getFileNameFromUrl(url) : \"Vista previa\");\n\n return (\n <Sheet open={open} onOpenChange={onOpenChange}>\n <SheetContent className=\"sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden\">\n <SheetHeader className=\"px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10\">\n <SheetTitle className=\"line-clamp-1 flex-1 mr-4\">\n {displayName}\n </SheetTitle>\n <SheetDescription className=\"sr-only\">\n Vista previa del archivo.\n </SheetDescription>\n </SheetHeader>\n\n <div className=\"flex-1 relative min-h-0 bg-background overflow-hidden\">\n {isPending && (\n <div className=\"p-4\">\n <Skeleton className=\"h-48 w-full rounded-md\" />\n </div>\n )}\n\n {isError && (\n <div className=\"p-4\">\n <StatusMessage\n title=\"Error al cargar el documento\"\n description=\"Vuelve a intentarlo en unos minutos. Si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n )}\n\n {!isPending && !isError && url && (\n <FileUrlPreviewRender url={url} fileName={displayName} />\n )}\n </div>\n </SheetContent>\n </Sheet>\n );\n};\n"],"mappings":";;;;;;;;AAsBA,IAAa,KAAuB,EAClC,SACA,iBACA,QACA,aACA,eAAY,IACZ,aAAU,SACoB;CAC9B,IAAM,IACJ,MAAa,IAAM,EAAmB,EAAI,GAAG;AAE/C,QACE,kBAAC,GAAD;EAAa;EAAoB;YAC/B,kBAAC,GAAD;GAAc,WAAU;aAAxB,CACE,kBAAC,GAAD;IAAa,WAAU;cAAvB,CACE,kBAAC,GAAD;KAAY,WAAU;eACnB;KACU,CAAA,EACb,kBAAC,GAAD;KAAkB,WAAU;eAAU;KAEnB,CAAA,CACP;OAEd,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD,EAAU,WAAU,0BAA2B,CAAA;MAC3C,CAAA;KAGP,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OACE,OAAM;OACN,aAAY;OACZ,MAAM;OACN,CAAA;MACE,CAAA;KAGP,CAAC,KAAa,CAAC,KAAW,KACzB,kBAAC,GAAD;MAA2B;MAAK,UAAU;MAAe,CAAA;KAEvD;MACO;;EACT,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/file_url_preview_sheet/index.tsx"],"sourcesContent":["import { FileX } from \"lucide-react\";\nimport {\n Sheet,\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle,\n} from \"@/components/sheet\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { FileUrlPreviewRender } from \"../file_url_preview_render\";\nimport { FileViewLoadingState } from \"../loading_state\";\nimport { getFileNameFromUrl } from \"../../utilities/get_extension_from_url\";\n\nexport interface FileUrlPreviewSheetProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n url: string | null;\n fileName?: string;\n isPending?: boolean;\n isError?: boolean;\n}\n\nexport const FileUrlPreviewSheet = ({\n open,\n onOpenChange,\n url,\n fileName,\n isPending = false,\n isError = false,\n}: FileUrlPreviewSheetProps) => {\n const displayName =\n fileName ?? (url ? getFileNameFromUrl(url) : \"Vista previa\");\n\n return (\n <Sheet open={open} onOpenChange={onOpenChange}>\n <SheetContent className=\"sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden\">\n <SheetHeader className=\"px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10\">\n <SheetTitle className=\"line-clamp-1 flex-1 mr-4\">\n {displayName}\n </SheetTitle>\n <SheetDescription className=\"sr-only\">\n Vista previa del archivo.\n </SheetDescription>\n </SheetHeader>\n\n <div className=\"flex-1 relative min-h-0 bg-background overflow-hidden\">\n {isPending && (\n <FileViewLoadingState />\n )}\n\n {isError && (\n <div className=\"p-4\">\n <StatusMessage\n title=\"Error al cargar el documento\"\n description=\"Vuelve a intentarlo en unos minutos. Si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n )}\n\n {!isPending && !isError && url && (\n <FileUrlPreviewRender url={url} fileName={displayName} />\n )}\n </div>\n </SheetContent>\n </Sheet>\n );\n};\n"],"mappings":";;;;;;;;AAsBA,IAAa,KAAuB,EAClC,SACA,iBACA,QACA,aACA,eAAY,IACZ,aAAU,SACoB;CAC9B,IAAM,IACJ,MAAa,IAAM,EAAmB,EAAI,GAAG;AAE/C,QACE,kBAAC,GAAD;EAAa;EAAoB;YAC/B,kBAAC,GAAD;GAAc,WAAU;aAAxB,CACE,kBAAC,GAAD;IAAa,WAAU;cAAvB,CACE,kBAAC,GAAD;KAAY,WAAU;eACnB;KACU,CAAA,EACb,kBAAC,GAAD;KAAkB,WAAU;eAAU;KAEnB,CAAA,CACP;OAEd,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,KACC,kBAAC,GAAD,EAAwB,CAAA;KAGzB,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OACE,OAAM;OACN,aAAY;OACZ,MAAM;OACN,CAAA;MACE,CAAA;KAGP,CAAC,KAAa,CAAC,KAAW,KACzB,kBAAC,GAAD;MAA2B;MAAK,UAAU;MAAe,CAAA;KAEvD;MACO;;EACT,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { cn as e } from "../../../../../../utilities/class/index.js";
2
2
  import { StatusMessage as t } from "../../../../../status_message/index.js";
3
- import { Skeleton as n } from "../../../../../skeleton/index.js";
4
- import { SheetContent as r, SheetDescription as i, SheetHeader as a, SheetTitle as o } from "../../../../../sheet/index.js";
5
- import { Tabs as s, TabsList as c, TabsTrigger as l } from "../../../../../tabs/index.js";
3
+ import { SheetContent as n, SheetDescription as r, SheetHeader as i, SheetTitle as a } from "../../../../../sheet/index.js";
4
+ import { Tabs as o, TabsList as s, TabsTrigger as c } from "../../../../../tabs/index.js";
5
+ import { FileViewLoadingState as l } from "../../../loading_state/index.js";
6
6
  import { FILE_VIEW_SHEET_TAB as u } from "../../../../types/file_view_sheet.js";
7
7
  import { renderPanelContent as d } from "../../utilities/index.js";
8
8
  import { useState as f } from "react";
@@ -11,23 +11,19 @@ import { FileX as g } from "lucide-react";
11
11
  //#region src/components/file_view/components/file_view_sheet/components/file_view_sheet_panel_content/index.tsx
12
12
  var _ = ({ title: _, isPending: v = !1, isError: y = !1, tabs: b = [], defaultTab: x = u.ORIGINAL, showTabs: S = !1, renderOriginal: C, renderTranscription: w, renderSummary: T, renderTemplate: E, renderEdit: D, renderVersions: O }) => {
13
13
  let [k, A] = f(x), j = !v && !y, M = !S, N = S && b.length > 0, P = (t, n = "hidden", r = !1) => e("absolute inset-0 min-w-0 transition-opacity duration-150", n === "auto" ? "overflow-auto" : "overflow-hidden", N && !r && "pt-16", k === t ? "opacity-100 z-10" : "opacity-0 pointer-events-none z-0");
14
- return /* @__PURE__ */ h(r, {
14
+ return /* @__PURE__ */ h(n, {
15
15
  className: "sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden",
16
16
  children: [
17
- /* @__PURE__ */ h(a, {
17
+ /* @__PURE__ */ h(i, {
18
18
  className: "px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10",
19
- children: [/* @__PURE__ */ m(o, {
19
+ children: [/* @__PURE__ */ m(a, {
20
20
  className: "line-clamp-1 flex-1 mr-4",
21
21
  children: _
22
- }), /* @__PURE__ */ m(i, {
22
+ }), /* @__PURE__ */ m(r, {
23
23
  className: "sr-only",
24
24
  children: "Aquí podrás ver la vista previa del archivo seleccionado."
25
25
  })]
26
26
  }),
27
- v && /* @__PURE__ */ m("div", {
28
- className: "p-4",
29
- children: /* @__PURE__ */ m(n, { className: "flex-1 h-48 w-full rounded-md" })
30
- }),
31
27
  y && /* @__PURE__ */ m("div", {
32
28
  className: "p-4",
33
29
  children: /* @__PURE__ */ m(t, {
@@ -38,50 +34,54 @@ var _ = ({ title: _, isPending: v = !1, isError: y = !1, tabs: b = [], defaultTa
38
34
  }),
39
35
  /* @__PURE__ */ h("div", {
40
36
  className: "flex-1 relative min-h-0 bg-background",
41
- children: [N && /* @__PURE__ */ m("div", {
42
- className: "pointer-events-none absolute inset-x-0 top-5 z-30 flex justify-center px-4",
43
- children: /* @__PURE__ */ m(s, {
44
- value: k,
45
- className: "pointer-events-auto max-w-full",
46
- children: /* @__PURE__ */ m(c, {
47
- className: "border-border bg-card/95 h-auto max-w-full flex-wrap border shadow-lg backdrop-blur-sm",
48
- children: b.map((t) => /* @__PURE__ */ h(l, {
49
- className: e("font-normal", k === t.id && "bg-background"),
50
- value: t.id,
51
- onClick: () => A(t.id),
52
- children: [t.icon, t.label]
53
- }, t.id))
37
+ children: [
38
+ v && /* @__PURE__ */ m(l, { className: "absolute inset-0" }),
39
+ N && /* @__PURE__ */ m("div", {
40
+ className: "pointer-events-none absolute inset-x-0 top-5 z-30 flex justify-center px-4",
41
+ children: /* @__PURE__ */ m(o, {
42
+ value: k,
43
+ className: "pointer-events-auto max-w-full",
44
+ children: /* @__PURE__ */ m(s, {
45
+ className: "border-border bg-card/95 h-auto max-w-full flex-wrap border shadow-lg backdrop-blur-sm",
46
+ children: b.map((t) => /* @__PURE__ */ h(c, {
47
+ className: e("font-normal", k === t.id && "bg-background"),
48
+ value: t.id,
49
+ onClick: () => A(t.id),
50
+ children: [t.icon, t.label]
51
+ }, t.id))
52
+ })
54
53
  })
55
- })
56
- }), j && (M ? /* @__PURE__ */ m("div", {
57
- className: "absolute inset-0 overflow-hidden min-w-0 z-10",
58
- children: C
59
- }) : /* @__PURE__ */ h(p, { children: [
60
- /* @__PURE__ */ m("div", {
61
- className: P(u.ORIGINAL, "hidden", !0),
62
- children: C
63
54
  }),
64
- w ? /* @__PURE__ */ m("div", {
65
- className: P(u.TRANSCRIPTION),
66
- children: d(w, k === u.TRANSCRIPTION)
67
- }) : null,
68
- T ? /* @__PURE__ */ m("div", {
69
- className: P(u.SUMMARY, "auto"),
70
- children: d(T, k === u.SUMMARY)
71
- }) : null,
72
- E ? /* @__PURE__ */ m("div", {
73
- className: P(u.TEMPLATE, "hidden", !0),
74
- children: d(E, k === u.TEMPLATE)
75
- }) : null,
76
- D ? /* @__PURE__ */ m("div", {
77
- className: P(u.EDIT, "auto"),
78
- children: d(D, k === u.EDIT)
79
- }) : null,
80
- O ? /* @__PURE__ */ m("div", {
81
- className: P(u.VERSIONS, "auto"),
82
- children: d(O, k === u.VERSIONS)
83
- }) : null
84
- ] }))]
55
+ j && (M ? /* @__PURE__ */ m("div", {
56
+ className: "absolute inset-0 overflow-hidden min-w-0 z-10",
57
+ children: C
58
+ }) : /* @__PURE__ */ h(p, { children: [
59
+ /* @__PURE__ */ m("div", {
60
+ className: P(u.ORIGINAL, "hidden", !0),
61
+ children: C
62
+ }),
63
+ w ? /* @__PURE__ */ m("div", {
64
+ className: P(u.TRANSCRIPTION),
65
+ children: d(w, k === u.TRANSCRIPTION)
66
+ }) : null,
67
+ T ? /* @__PURE__ */ m("div", {
68
+ className: P(u.SUMMARY, "auto"),
69
+ children: d(T, k === u.SUMMARY)
70
+ }) : null,
71
+ E ? /* @__PURE__ */ m("div", {
72
+ className: P(u.TEMPLATE, "hidden", !0),
73
+ children: d(E, k === u.TEMPLATE)
74
+ }) : null,
75
+ D ? /* @__PURE__ */ m("div", {
76
+ className: P(u.EDIT, "auto"),
77
+ children: d(D, k === u.EDIT)
78
+ }) : null,
79
+ O ? /* @__PURE__ */ m("div", {
80
+ className: P(u.VERSIONS, "auto"),
81
+ children: d(O, k === u.VERSIONS)
82
+ }) : null
83
+ ] }))
84
+ ]
85
85
  })
86
86
  ]
87
87
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/file_view_sheet/components/file_view_sheet_panel_content/index.tsx"],"sourcesContent":["import { renderPanelContent } from \"../../utilities\";\nimport { useState } from \"react\";\nimport { FileX } from \"lucide-react\";\nimport { cn } from \"@/utilities/class\";\nimport {\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle\n} from \"@/components/sheet\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { Tabs, TabsList, TabsTrigger } from \"@/components/tabs\";\nimport {\n FILE_VIEW_SHEET_TAB,\n type FileViewSheetTab\n } from \"../../../../types/file_view_sheet\";\nimport type { FileViewSheetPanelProps } from \"../../types\";\n\nconst FileViewSheetPanelContent = ({\n title,\n isPending = false,\n isError = false,\n tabs = [],\n defaultTab = FILE_VIEW_SHEET_TAB.ORIGINAL,\n showTabs = false,\n renderOriginal,\n renderTranscription,\n renderSummary,\n renderTemplate,\n renderEdit,\n renderVersions,\n}: FileViewSheetPanelProps) => {\n const [activeTab, setActiveTab] = useState<FileViewSheetTab>(defaultTab);\n const showViewer = !isPending && !isError;\n const simpleViewer = !showTabs;\n const floatingTabs = showTabs && tabs.length > 0;\n\n const panelClass = (\n tab: FileViewSheetTab,\n overflow: \"hidden\" | \"auto\" = \"hidden\",\n tabsOverlay = false,\n ) =>\n cn(\n \"absolute inset-0 min-w-0 transition-opacity duration-150\",\n overflow === \"auto\" ? \"overflow-auto\" : \"overflow-hidden\",\n floatingTabs && !tabsOverlay && \"pt-16\",\n activeTab === tab\n ? \"opacity-100 z-10\"\n : \"opacity-0 pointer-events-none z-0\",\n );\n\n return (\n <SheetContent className=\"sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden\">\n <SheetHeader className=\"px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10\">\n <SheetTitle className=\"line-clamp-1 flex-1 mr-4\">{title}</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Aquí podrás ver la vista previa del archivo seleccionado.\n </SheetDescription>\n </SheetHeader>\n\n {isPending && (\n <div className=\"p-4\">\n <Skeleton className=\"flex-1 h-48 w-full rounded-md\" />\n </div>\n )}\n\n {isError && (\n <div className=\"p-4\">\n <StatusMessage\n title=\"Sucedio un error inesperado\"\n description=\"Vuelve a intentarlo dentro de unos minutos, si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n )}\n\n <div className=\"flex-1 relative min-h-0 bg-background\">\n {floatingTabs && (\n <div className=\"pointer-events-none absolute inset-x-0 top-5 z-30 flex justify-center px-4\">\n <Tabs value={activeTab} className=\"pointer-events-auto max-w-full\">\n <TabsList className=\"border-border bg-card/95 h-auto max-w-full flex-wrap border shadow-lg backdrop-blur-sm\">\n {tabs.map((tab) => (\n <TabsTrigger\n key={tab.id}\n className={cn(\"font-normal\", activeTab === tab.id && \"bg-background\")}\n value={tab.id}\n onClick={() => setActiveTab(tab.id)}\n >\n {tab.icon}\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n )}\n\n {showViewer &&\n (simpleViewer ? (\n <div className=\"absolute inset-0 overflow-hidden min-w-0 z-10\">\n {renderOriginal}\n </div>\n ) : (\n <>\n <div\n className={panelClass(\n FILE_VIEW_SHEET_TAB.ORIGINAL,\n \"hidden\",\n true,\n )}\n >\n {renderOriginal}\n </div>\n {renderTranscription ? (\n <div className={panelClass(FILE_VIEW_SHEET_TAB.TRANSCRIPTION)}>\n {renderPanelContent(\n renderTranscription,\n activeTab === FILE_VIEW_SHEET_TAB.TRANSCRIPTION,\n )}\n </div>\n ) : null}\n {renderSummary ? (\n <div\n className={panelClass(FILE_VIEW_SHEET_TAB.SUMMARY, \"auto\")}\n >\n {renderPanelContent(\n renderSummary,\n activeTab === FILE_VIEW_SHEET_TAB.SUMMARY,\n )}\n </div>\n ) : null}\n {renderTemplate ? (\n <div\n className={panelClass(\n FILE_VIEW_SHEET_TAB.TEMPLATE,\n \"hidden\",\n true,\n )}\n >\n {renderPanelContent(\n renderTemplate,\n activeTab === FILE_VIEW_SHEET_TAB.TEMPLATE,\n )}\n </div>\n ) : null}\n {renderEdit ? (\n <div className={panelClass(FILE_VIEW_SHEET_TAB.EDIT, \"auto\")}>\n {renderPanelContent(\n renderEdit,\n activeTab === FILE_VIEW_SHEET_TAB.EDIT,\n )}\n </div>\n ) : null}\n {renderVersions ? (\n <div\n className={panelClass(FILE_VIEW_SHEET_TAB.VERSIONS, \"auto\")}\n >\n {renderPanelContent(\n renderVersions,\n activeTab === FILE_VIEW_SHEET_TAB.VERSIONS,\n )}\n </div>\n ) : null}\n </>\n ))}\n </div>\n </SheetContent>\n );\n};\n\nexport { FileViewSheetPanelContent };\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,KAA6B,EACjC,UACA,eAAY,IACZ,aAAU,IACV,UAAO,EAAE,EACT,gBAAa,EAAoB,UACjC,cAAW,IACX,mBACA,wBACA,kBACA,mBACA,eACA,wBAC6B;CAC7B,IAAM,CAAC,GAAW,KAAgB,EAA2B,EAAW,EAClE,IAAa,CAAC,KAAa,CAAC,GAC5B,IAAe,CAAC,GAChB,IAAe,KAAY,EAAK,SAAS,GAEzC,KACJ,GACA,IAA8B,UAC9B,IAAc,OAEd,EACE,4DACA,MAAa,SAAS,kBAAkB,mBACxC,KAAgB,CAAC,KAAe,SAChC,MAAc,IACV,qBACA,oCACL;AAEH,QACE,kBAAC,GAAD;EAAc,WAAU;YAAxB;GACE,kBAAC,GAAD;IAAa,WAAU;cAAvB,CACE,kBAAC,GAAD;KAAY,WAAU;eAA4B;KAAmB,CAAA,EACrE,kBAAC,GAAD;KAAkB,WAAU;eAAU;KAEnB,CAAA,CACP;;GAEb,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD,EAAU,WAAU,iCAAkC,CAAA;IAClD,CAAA;GAGP,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACE,OAAM;KACN,aAAY;KACZ,MAAM;KACN,CAAA;IACE,CAAA;GAGR,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KACC,kBAAC,OAAD;KAAK,WAAU;eACb,kBAAC,GAAD;MAAM,OAAO;MAAW,WAAU;gBAChC,kBAAC,GAAD;OAAU,WAAU;iBACjB,EAAK,KAAK,MACT,kBAAC,GAAD;QAEE,WAAW,EAAG,eAAe,MAAc,EAAI,MAAM,gBAAgB;QACrE,OAAO,EAAI;QACX,eAAe,EAAa,EAAI,GAAG;kBAJrC,CAMG,EAAI,MACJ,EAAI,MACO;UAPP,EAAI,GAOG,CACd;OACO,CAAA;MACN,CAAA;KACH,CAAA,EAGP,MACE,IACC,kBAAC,OAAD;KAAK,WAAU;eACZ;KACG,CAAA,GAEN,kBAAA,GAAA,EAAA,UAAA;KACE,kBAAC,OAAD;MACE,WAAW,EACT,EAAoB,UACpB,UACA,GACD;gBAEA;MACG,CAAA;KACL,IACC,kBAAC,OAAD;MAAK,WAAW,EAAW,EAAoB,cAAc;gBAC1D,EACC,GACA,MAAc,EAAoB,cACnC;MACG,CAAA,GACJ;KACH,IACC,kBAAC,OAAD;MACE,WAAW,EAAW,EAAoB,SAAS,OAAO;gBAEzD,EACC,GACA,MAAc,EAAoB,QACnC;MACG,CAAA,GACJ;KACH,IACC,kBAAC,OAAD;MACE,WAAW,EACT,EAAoB,UACpB,UACA,GACD;gBAEA,EACC,GACA,MAAc,EAAoB,SACnC;MACG,CAAA,GACJ;KACH,IACC,kBAAC,OAAD;MAAK,WAAW,EAAW,EAAoB,MAAM,OAAO;gBACzD,EACC,GACA,MAAc,EAAoB,KACnC;MACG,CAAA,GACJ;KACH,IACC,kBAAC,OAAD;MACE,WAAW,EAAW,EAAoB,UAAU,OAAO;gBAE1D,EACC,GACA,MAAc,EAAoB,SACnC;MACG,CAAA,GACJ;KACH,EAAA,CAAA,EAEH;;GACO"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/file_view_sheet/components/file_view_sheet_panel_content/index.tsx"],"sourcesContent":["import { renderPanelContent } from \"../../utilities\";\nimport { useState } from \"react\";\nimport { FileX } from \"lucide-react\";\nimport { cn } from \"@/utilities/class\";\nimport {\n SheetContent,\n SheetDescription,\n SheetHeader,\n SheetTitle\n} from \"@/components/sheet\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { Tabs, TabsList, TabsTrigger } from \"@/components/tabs\";\nimport {\n FILE_VIEW_SHEET_TAB,\n type FileViewSheetTab\n } from \"../../../../types/file_view_sheet\";\nimport type { FileViewSheetPanelProps } from \"../../types\";\nimport { FileViewLoadingState } from \"../../../loading_state\";\n\nconst FileViewSheetPanelContent = ({\n title,\n isPending = false,\n isError = false,\n tabs = [],\n defaultTab = FILE_VIEW_SHEET_TAB.ORIGINAL,\n showTabs = false,\n renderOriginal,\n renderTranscription,\n renderSummary,\n renderTemplate,\n renderEdit,\n renderVersions,\n}: FileViewSheetPanelProps) => {\n const [activeTab, setActiveTab] = useState<FileViewSheetTab>(defaultTab);\n const showViewer = !isPending && !isError;\n const simpleViewer = !showTabs;\n const floatingTabs = showTabs && tabs.length > 0;\n\n const panelClass = (\n tab: FileViewSheetTab,\n overflow: \"hidden\" | \"auto\" = \"hidden\",\n tabsOverlay = false,\n ) =>\n cn(\n \"absolute inset-0 min-w-0 transition-opacity duration-150\",\n overflow === \"auto\" ? \"overflow-auto\" : \"overflow-hidden\",\n floatingTabs && !tabsOverlay && \"pt-16\",\n activeTab === tab\n ? \"opacity-100 z-10\"\n : \"opacity-0 pointer-events-none z-0\",\n );\n\n return (\n <SheetContent className=\"sm:max-w-[95vw] w-full p-0 flex flex-col gap-0 overflow-hidden\">\n <SheetHeader className=\"px-6 flex flex-row items-center justify-between space-y-0 border-b bg-background relative z-10\">\n <SheetTitle className=\"line-clamp-1 flex-1 mr-4\">{title}</SheetTitle>\n <SheetDescription className=\"sr-only\">\n Aquí podrás ver la vista previa del archivo seleccionado.\n </SheetDescription>\n </SheetHeader>\n\n {isError && (\n <div className=\"p-4\">\n <StatusMessage\n title=\"Sucedio un error inesperado\"\n description=\"Vuelve a intentarlo dentro de unos minutos, si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n )}\n\n <div className=\"flex-1 relative min-h-0 bg-background\">\n {isPending && (\n <FileViewLoadingState className=\"absolute inset-0\" />\n )}\n\n {floatingTabs && (\n <div className=\"pointer-events-none absolute inset-x-0 top-5 z-30 flex justify-center px-4\">\n <Tabs value={activeTab} className=\"pointer-events-auto max-w-full\">\n <TabsList className=\"border-border bg-card/95 h-auto max-w-full flex-wrap border shadow-lg backdrop-blur-sm\">\n {tabs.map((tab) => (\n <TabsTrigger\n key={tab.id}\n className={cn(\"font-normal\", activeTab === tab.id && \"bg-background\")}\n value={tab.id}\n onClick={() => setActiveTab(tab.id)}\n >\n {tab.icon}\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n </div>\n )}\n\n {showViewer &&\n (simpleViewer ? (\n <div className=\"absolute inset-0 overflow-hidden min-w-0 z-10\">\n {renderOriginal}\n </div>\n ) : (\n <>\n <div\n className={panelClass(\n FILE_VIEW_SHEET_TAB.ORIGINAL,\n \"hidden\",\n true,\n )}\n >\n {renderOriginal}\n </div>\n {renderTranscription ? (\n <div className={panelClass(FILE_VIEW_SHEET_TAB.TRANSCRIPTION)}>\n {renderPanelContent(\n renderTranscription,\n activeTab === FILE_VIEW_SHEET_TAB.TRANSCRIPTION,\n )}\n </div>\n ) : null}\n {renderSummary ? (\n <div\n className={panelClass(FILE_VIEW_SHEET_TAB.SUMMARY, \"auto\")}\n >\n {renderPanelContent(\n renderSummary,\n activeTab === FILE_VIEW_SHEET_TAB.SUMMARY,\n )}\n </div>\n ) : null}\n {renderTemplate ? (\n <div\n className={panelClass(\n FILE_VIEW_SHEET_TAB.TEMPLATE,\n \"hidden\",\n true,\n )}\n >\n {renderPanelContent(\n renderTemplate,\n activeTab === FILE_VIEW_SHEET_TAB.TEMPLATE,\n )}\n </div>\n ) : null}\n {renderEdit ? (\n <div className={panelClass(FILE_VIEW_SHEET_TAB.EDIT, \"auto\")}>\n {renderPanelContent(\n renderEdit,\n activeTab === FILE_VIEW_SHEET_TAB.EDIT,\n )}\n </div>\n ) : null}\n {renderVersions ? (\n <div\n className={panelClass(FILE_VIEW_SHEET_TAB.VERSIONS, \"auto\")}\n >\n {renderPanelContent(\n renderVersions,\n activeTab === FILE_VIEW_SHEET_TAB.VERSIONS,\n )}\n </div>\n ) : null}\n </>\n ))}\n </div>\n </SheetContent>\n );\n};\n\nexport { FileViewSheetPanelContent };\n"],"mappings":";;;;;;;;;;;AAmBA,IAAM,KAA6B,EACjC,UACA,eAAY,IACZ,aAAU,IACV,UAAO,EAAE,EACT,gBAAa,EAAoB,UACjC,cAAW,IACX,mBACA,wBACA,kBACA,mBACA,eACA,wBAC6B;CAC7B,IAAM,CAAC,GAAW,KAAgB,EAA2B,EAAW,EAClE,IAAa,CAAC,KAAa,CAAC,GAC5B,IAAe,CAAC,GAChB,IAAe,KAAY,EAAK,SAAS,GAEzC,KACJ,GACA,IAA8B,UAC9B,IAAc,OAEd,EACE,4DACA,MAAa,SAAS,kBAAkB,mBACxC,KAAgB,CAAC,KAAe,SAChC,MAAc,IACV,qBACA,oCACL;AAEH,QACE,kBAAC,GAAD;EAAc,WAAU;YAAxB;GACE,kBAAC,GAAD;IAAa,WAAU;cAAvB,CACE,kBAAC,GAAD;KAAY,WAAU;eAA4B;KAAmB,CAAA,EACrE,kBAAC,GAAD;KAAkB,WAAU;eAAU;KAEnB,CAAA,CACP;;GAEb,KACC,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACE,OAAM;KACN,aAAY;KACZ,MAAM;KACN,CAAA;IACE,CAAA;GAGR,kBAAC,OAAD;IAAK,WAAU;cAAf;KACG,KACC,kBAAC,GAAD,EAAsB,WAAU,oBAAqB,CAAA;KAGtD,KACC,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,GAAD;OAAM,OAAO;OAAW,WAAU;iBAChC,kBAAC,GAAD;QAAU,WAAU;kBACjB,EAAK,KAAK,MACT,kBAAC,GAAD;SAEE,WAAW,EAAG,eAAe,MAAc,EAAI,MAAM,gBAAgB;SACrE,OAAO,EAAI;SACX,eAAe,EAAa,EAAI,GAAG;mBAJrC,CAMG,EAAI,MACJ,EAAI,MACO;WAPP,EAAI,GAOG,CACd;QACO,CAAA;OACN,CAAA;MACH,CAAA;KAGP,MACE,IACC,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA,GAEN,kBAAA,GAAA,EAAA,UAAA;MACE,kBAAC,OAAD;OACE,WAAW,EACT,EAAoB,UACpB,UACA,GACD;iBAEA;OACG,CAAA;MACL,IACC,kBAAC,OAAD;OAAK,WAAW,EAAW,EAAoB,cAAc;iBAC1D,EACC,GACA,MAAc,EAAoB,cACnC;OACG,CAAA,GACJ;MACH,IACC,kBAAC,OAAD;OACE,WAAW,EAAW,EAAoB,SAAS,OAAO;iBAEzD,EACC,GACA,MAAc,EAAoB,QACnC;OACG,CAAA,GACJ;MACH,IACC,kBAAC,OAAD;OACE,WAAW,EACT,EAAoB,UACpB,UACA,GACD;iBAEA,EACC,GACA,MAAc,EAAoB,SACnC;OACG,CAAA,GACJ;MACH,IACC,kBAAC,OAAD;OAAK,WAAW,EAAW,EAAoB,MAAM,OAAO;iBACzD,EACC,GACA,MAAc,EAAoB,KACnC;OACG,CAAA,GACJ;MACH,IACC,kBAAC,OAAD;OACE,WAAW,EAAW,EAAoB,UAAU,OAAO;iBAE1D,EACC,GACA,MAAc,EAAoB,SACnC;OACG,CAAA,GACJ;MACH,EAAA,CAAA;KAEH;;GACO"}
@@ -1,6 +1,6 @@
1
- import { Toolbar as e } from "../toolbar/index.js";
2
- import { ErrorState as t } from "../error_state/index.js";
3
- import { LoadingState as n } from "../loading_state/index.js";
1
+ import { FileViewLoadingState as e } from "../../../loading_state/index.js";
2
+ import { Toolbar as t } from "../toolbar/index.js";
3
+ import { ErrorState as n } from "../error_state/index.js";
4
4
  import { useFileImageViewer as r } from "../../hooks/use_file_image_viewer/index.js";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
6
  //#region src/components/file_view/components/image_viewer/components/file_image_viewer_content/index.tsx
@@ -17,9 +17,9 @@ var o = (o) => {
17
17
  onMouseLeave: E,
18
18
  onWheel: D,
19
19
  style: { cursor: g ? "grabbing" : "grab" },
20
- children: c ? /* @__PURE__ */ i(n, {}) : l ? /* @__PURE__ */ i(t, {}) : s ? /* @__PURE__ */ a("div", {
20
+ children: c ? /* @__PURE__ */ i(e, {}) : l ? /* @__PURE__ */ i(n, {}) : s ? /* @__PURE__ */ a("div", {
21
21
  className: "relative w-full h-full flex-col flex items-center justify-center",
22
- children: [u && /* @__PURE__ */ i(n, { className: "absolute top-0 left-0 w-full h-full" }), /* @__PURE__ */ i("img", {
22
+ children: [u && /* @__PURE__ */ i(e, { className: "absolute top-0 left-0 w-full h-full" }), /* @__PURE__ */ i("img", {
23
23
  ref: f,
24
24
  src: s,
25
25
  alt: "Vista previa",
@@ -39,7 +39,7 @@ var o = (o) => {
39
39
  draggable: !1
40
40
  })]
41
41
  }) : null
42
- }), /* @__PURE__ */ i(e, {
42
+ }), /* @__PURE__ */ i(t, {
43
43
  handleZoomOut: v,
44
44
  handleZoomIn: _,
45
45
  scale: p,
@@ -1,5 +1 @@
1
- interface Props {
2
- className?: string;
3
- }
4
- export declare const LoadingState: ({ className }: Props) => import("react/jsx-runtime").JSX.Element;
5
- export {};
1
+ export { FileViewLoadingState as LoadingState } from '../../../loading_state';
@@ -1 +1,5 @@
1
- export declare const FileViewLoadingState: () => import("react/jsx-runtime").JSX.Element;
1
+ interface FileViewLoadingStateProps {
2
+ className?: string;
3
+ }
4
+ export declare const FileViewLoadingState: ({ className, }: FileViewLoadingStateProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -1,8 +1,14 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { Loader2 as t } from "lucide-react";
1
+ import { cn as e } from "../../../../utilities/class/index.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ import { Loader2 as n } from "lucide-react";
3
4
  //#region src/components/file_view/components/loading_state/index.tsx
4
- var n = () => /* @__PURE__ */ e(t, { className: "size-8 animate-spin text-foreground" });
5
+ var r = ({ className: r }) => /* @__PURE__ */ t("div", {
6
+ className: e("flex h-full min-h-[240px] w-full items-center justify-center", r),
7
+ role: "status",
8
+ "aria-label": "Cargando archivo",
9
+ children: /* @__PURE__ */ t(n, { className: "size-8 animate-spin text-muted-foreground" })
10
+ });
5
11
  //#endregion
6
- export { n as FileViewLoadingState };
12
+ export { r as FileViewLoadingState };
7
13
 
8
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/loading_state/index.tsx"],"sourcesContent":["import { Loader2 } from \"lucide-react\";\n\nexport const FileViewLoadingState = () => (\n <Loader2 className=\"size-8 animate-spin text-foreground\" />\n);\n"],"mappings":";;;AAEA,IAAa,UACX,kBAAC,GAAD,EAAS,WAAU,uCAAwC,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/loading_state/index.tsx"],"sourcesContent":["import { Loader2 } from \"lucide-react\";\nimport { cn } from \"@/utilities/class\";\n\ninterface FileViewLoadingStateProps {\n className?: string;\n}\n\nexport const FileViewLoadingState = ({\n className,\n}: FileViewLoadingStateProps) => (\n <div\n className={cn(\n \"flex h-full min-h-[240px] w-full items-center justify-center\",\n className,\n )}\n role=\"status\"\n aria-label=\"Cargando archivo\"\n >\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n </div>\n);\n"],"mappings":";;;;AAOA,IAAa,KAAwB,EACnC,mBAEA,kBAAC,OAAD;CACE,WAAW,EACT,gEACA,EACD;CACD,MAAK;CACL,cAAW;WAEX,kBAAC,GAAD,EAAS,WAAU,6CAA8C,CAAA;CAC7D,CAAA"}
@@ -1,3 +1,3 @@
1
1
  import { FileOfficeViewerProps } from '../../types';
2
- declare const FileOfficeViewerContent: ({ url, fileName, mimeType, onDownload }: Omit<FileOfficeViewerProps, "isPending" | "isError">) => import("react/jsx-runtime").JSX.Element;
2
+ declare const FileOfficeViewerContent: ({ url, fileName, mimeType, onDownload, }: Omit<FileOfficeViewerProps, "isPending" | "isError">) => import("react/jsx-runtime").JSX.Element;
3
3
  export { FileOfficeViewerContent };
@@ -1,49 +1,70 @@
1
- import { resolveOfficeFileExtension as e } from "../../../../utilities/resolve_file_view_kind.js";
2
- import { FileOfficeViewerToolbar as t } from "../toolbar/index.js";
3
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
1
+ import { FileViewLoadingState as e } from "../../../loading_state/index.js";
2
+ import { resolveOfficeFileExtension as t } from "../../../../utilities/resolve_file_view_kind.js";
3
+ import { useOfficeEmbedOverlay as n } from "../../hooks/use_office_embed_overlay/index.js";
4
+ import { FileOfficeViewerToolbar as r } from "../toolbar/index.js";
5
+ import { useRef as i } from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
4
7
  import "@cyntler/react-doc-viewer/dist/index.css";
5
- import i, { DocViewerRenderers as a } from "@cyntler/react-doc-viewer";
8
+ import s, { DocViewerRenderers as c } from "@cyntler/react-doc-viewer";
6
9
  //#region src/components/file_view/components/office_viewer/components/file_office_viewer_content/index.tsx
7
- var o = ({ url: o, fileName: s, mimeType: c, onDownload: l }) => /* @__PURE__ */ r("div", {
8
- className: "relative flex flex-col h-full w-full bg-background",
9
- children: [/* @__PURE__ */ n("div", {
10
- className: "flex-1 overflow-hidden h-full",
11
- children: /* @__PURE__ */ n(i, {
12
- documents: [{
13
- uri: o,
14
- fileType: e(s, c)
15
- }],
16
- prefetchMethod: "GET",
17
- language: "es",
18
- pluginRenderers: a,
19
- config: {
20
- loadingRenderer: {
21
- overrideComponent: () => /* @__PURE__ */ n("h5", { children: "Loading..." }),
22
- showLoadingTimeout: 1e3
23
- },
24
- header: {
25
- disableHeader: !0,
26
- disableFileName: !0,
27
- retainURLParams: !0
28
- }
29
- },
30
- theme: {
31
- primary: "#fff",
32
- secondary: "#ffffff",
33
- tertiary: "#fff",
34
- textPrimary: "#ffffff",
35
- textSecondary: "#fff",
36
- textTertiary: "#fff",
37
- disableThemeScrollbar: !1
38
- },
39
- style: {
40
- width: "100%",
41
- height: "100%"
42
- }
43
- })
44
- }), /* @__PURE__ */ n(t, { onDownload: l })]
45
- });
10
+ var l = ({ url: l, fileName: u, mimeType: d, onDownload: f }) => {
11
+ let p = i(null), m = n(p, l);
12
+ return /* @__PURE__ */ o("div", {
13
+ ref: p,
14
+ className: "relative flex min-h-0 h-full w-full flex-col bg-background",
15
+ children: [
16
+ /* @__PURE__ */ a("div", {
17
+ className: "h-full flex-1 overflow-hidden",
18
+ children: /* @__PURE__ */ a(s, {
19
+ documents: [{
20
+ uri: l,
21
+ fileType: t(u, d)
22
+ }],
23
+ prefetchMethod: "GET",
24
+ language: "es",
25
+ pluginRenderers: c,
26
+ config: {
27
+ loadingRenderer: {
28
+ overrideComponent: () => /* @__PURE__ */ a("div", {
29
+ className: "flex h-full w-full items-center justify-center",
30
+ children: /* @__PURE__ */ a(e, {})
31
+ }),
32
+ showLoadingTimeout: !1
33
+ },
34
+ header: {
35
+ disableHeader: !0,
36
+ disableFileName: !0,
37
+ retainURLParams: !0
38
+ }
39
+ },
40
+ theme: {
41
+ primary: "#fff",
42
+ secondary: "#ffffff",
43
+ tertiary: "#fff",
44
+ textPrimary: "#ffffff",
45
+ textSecondary: "#fff",
46
+ textTertiary: "#fff",
47
+ disableThemeScrollbar: !1
48
+ },
49
+ style: {
50
+ width: "100%",
51
+ height: "100%"
52
+ }
53
+ })
54
+ }),
55
+ /* @__PURE__ */ a(r, { onDownload: f }),
56
+ m ? /* @__PURE__ */ a("div", {
57
+ className: "absolute inset-0 z-40 flex items-center justify-center bg-background",
58
+ role: "status",
59
+ "aria-live": "polite",
60
+ "aria-busy": "true",
61
+ "aria-label": "Cargando documento",
62
+ children: /* @__PURE__ */ a(e, {})
63
+ }) : null
64
+ ]
65
+ });
66
+ };
46
67
  //#endregion
47
- export { o as FileOfficeViewerContent };
68
+ export { l as FileOfficeViewerContent };
48
69
 
49
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/office_viewer/components/file_office_viewer_content/index.tsx"],"sourcesContent":["import \"@cyntler/react-doc-viewer/dist/index.css\";\nimport DocViewer, { DocViewerRenderers } from \"@cyntler/react-doc-viewer\";\nimport { FileOfficeViewerToolbar } from \"../toolbar\";\nimport { resolveOfficeFileExtension } from \"../../../../utilities/resolve_file_view_kind\";\nimport type { FileOfficeViewerProps } from \"../../types\";\n\nconst FileOfficeViewerContent = ({ url, fileName, mimeType, onDownload }: Omit<FileOfficeViewerProps, \"isPending\" | \"isError\">) => {\n const fileType = resolveOfficeFileExtension(fileName, mimeType);\n const docs = [{ uri: url, fileType }];\n\n return (\n <div className=\"relative flex flex-col h-full w-full bg-background\">\n <div className=\"flex-1 overflow-hidden h-full\">\n <DocViewer\n documents={docs}\n prefetchMethod=\"GET\"\n language=\"es\"\n pluginRenderers={DocViewerRenderers}\n config={{\n loadingRenderer: {\n overrideComponent: () => <h5>Loading...</h5>,\n showLoadingTimeout: 1000,\n },\n header: {\n disableHeader: true,\n disableFileName: true,\n retainURLParams: true,\n },\n }}\n theme={{\n primary: \"#fff\",\n secondary: \"#ffffff\",\n tertiary: \"#fff\",\n textPrimary: \"#ffffff\",\n textSecondary: \"#fff\",\n textTertiary: \"#fff\",\n disableThemeScrollbar: false,\n }}\n style={{ width: \"100%\", height: \"100%\" }}\n />\n </div>\n <FileOfficeViewerToolbar onDownload={onDownload} />\n </div>\n );\n};\n\nexport { FileOfficeViewerContent };\n"],"mappings":";;;;;;AAMA,IAAM,KAA2B,EAAE,QAAK,aAAU,aAAU,oBAKxD,kBAAC,OAAD;CAAK,WAAU;WAAf,CACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,WANK,CAAC;IAAE,KAAK;IAAK,UADT,EAA2B,GAAU,EAAS;IAC3B,CAAC;GAO7B,gBAAe;GACf,UAAS;GACT,iBAAiB;GACjB,QAAQ;IACN,iBAAiB;KACf,yBAAyB,kBAAC,MAAD,EAAA,UAAI,cAAe,CAAA;KAC5C,oBAAoB;KACrB;IACD,QAAQ;KACN,eAAe;KACf,iBAAiB;KACjB,iBAAiB;KAClB;IACF;GACD,OAAO;IACL,SAAS;IACT,WAAW;IACX,UAAU;IACV,aAAa;IACb,eAAe;IACf,cAAc;IACd,uBAAuB;IACxB;GACD,OAAO;IAAE,OAAO;IAAQ,QAAQ;IAAQ;GACxC,CAAA;EACE,CAAA,EACN,kBAAC,GAAD,EAAqC,eAAc,CAAA,CAC/C"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/office_viewer/components/file_office_viewer_content/index.tsx"],"sourcesContent":["import \"@cyntler/react-doc-viewer/dist/index.css\";\nimport DocViewer, { DocViewerRenderers } from \"@cyntler/react-doc-viewer\";\nimport { useRef } from \"react\";\nimport { resolveOfficeFileExtension } from \"../../../../utilities/resolve_file_view_kind\";\nimport { FileViewLoadingState } from \"../../../loading_state\";\nimport { useOfficeEmbedOverlay } from \"../../hooks\";\nimport type { FileOfficeViewerProps } from \"../../types\";\nimport { FileOfficeViewerToolbar } from \"../toolbar\";\n\nconst FileOfficeViewerContent = ({\n url,\n fileName,\n mimeType,\n onDownload,\n}: Omit<FileOfficeViewerProps, \"isPending\" | \"isError\">) => {\n const rootRef = useRef<HTMLDivElement>(null);\n const isEmbedPending = useOfficeEmbedOverlay(rootRef, url);\n const fileType = resolveOfficeFileExtension(fileName, mimeType);\n const docs = [{ uri: url, fileType }];\n\n return (\n <div\n ref={rootRef}\n className=\"relative flex min-h-0 h-full w-full flex-col bg-background\"\n >\n <div className=\"h-full flex-1 overflow-hidden\">\n <DocViewer\n documents={docs}\n prefetchMethod=\"GET\"\n language=\"es\"\n pluginRenderers={DocViewerRenderers}\n config={{\n loadingRenderer: {\n overrideComponent: () => (\n <div className=\"flex h-full w-full items-center justify-center\">\n <FileViewLoadingState />\n </div>\n ),\n showLoadingTimeout: false,\n },\n header: {\n disableHeader: true,\n disableFileName: true,\n retainURLParams: true,\n },\n }}\n theme={{\n primary: \"#fff\",\n secondary: \"#ffffff\",\n tertiary: \"#fff\",\n textPrimary: \"#ffffff\",\n textSecondary: \"#fff\",\n textTertiary: \"#fff\",\n disableThemeScrollbar: false,\n }}\n style={{ width: \"100%\", height: \"100%\" }}\n />\n </div>\n <FileOfficeViewerToolbar onDownload={onDownload} />\n {isEmbedPending ? (\n <div\n className=\"absolute inset-0 z-40 flex items-center justify-center bg-background\"\n role=\"status\"\n aria-live=\"polite\"\n aria-busy=\"true\"\n aria-label=\"Cargando documento\"\n >\n <FileViewLoadingState />\n </div>\n ) : null}\n </div>\n );\n};\n\nexport { FileOfficeViewerContent };\n"],"mappings":";;;;;;;;;AASA,IAAM,KAA2B,EAC/B,QACA,aACA,aACA,oBAC0D;CAC1D,IAAM,IAAU,EAAuB,KAAK,EACtC,IAAiB,EAAsB,GAAS,EAAI;AAI1D,QACE,kBAAC,OAAD;EACE,KAAK;EACL,WAAU;YAFZ;GAIE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,GAAD;KACE,WATK,CAAC;MAAE,KAAK;MAAK,UADT,EAA2B,GAAU,EAAS;MAC3B,CAAC;KAU7B,gBAAe;KACf,UAAS;KACT,iBAAiB;KACjB,QAAQ;MACN,iBAAiB;OACf,yBACE,kBAAC,OAAD;QAAK,WAAU;kBACb,kBAAC,GAAD,EAAwB,CAAA;QACpB,CAAA;OAER,oBAAoB;OACrB;MACD,QAAQ;OACN,eAAe;OACf,iBAAiB;OACjB,iBAAiB;OAClB;MACF;KACD,OAAO;MACL,SAAS;MACT,WAAW;MACX,UAAU;MACV,aAAa;MACb,eAAe;MACf,cAAc;MACd,uBAAuB;MACxB;KACD,OAAO;MAAE,OAAO;MAAQ,QAAQ;MAAQ;KACxC,CAAA;IACE,CAAA;GACN,kBAAC,GAAD,EAAqC,eAAc,CAAA;GAClD,IACC,kBAAC,OAAD;IACE,WAAU;IACV,MAAK;IACL,aAAU;IACV,aAAU;IACV,cAAW;cAEX,kBAAC,GAAD,EAAwB,CAAA;IACpB,CAAA,GACJ;GACA"}
@@ -0,0 +1,6 @@
1
+ export declare const OFFICE_EMBED_IFRAME_ID = "msdoc-iframe";
2
+ export declare const OFFICE_EMBED_IFRAME_SELECTOR = "#msdoc-iframe";
3
+ /** Office Online still paints its spinner after the iframe `load` event. */
4
+ export declare const OFFICE_EMBED_SETTLE_MS = 2000;
5
+ /** Last resort so the overlay never traps the preview. */
6
+ export declare const OFFICE_EMBED_FALLBACK_MS = 12000;
@@ -0,0 +1,5 @@
1
+ var e = "#msdoc-iframe", t = 2e3, n = 12e3;
2
+ //#endregion
3
+ export { n as OFFICE_EMBED_FALLBACK_MS, e as OFFICE_EMBED_IFRAME_SELECTOR, t as OFFICE_EMBED_SETTLE_MS };
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/components/file_view/components/office_viewer/constants/index.ts"],"sourcesContent":["export const OFFICE_EMBED_IFRAME_ID = \"msdoc-iframe\";\nexport const OFFICE_EMBED_IFRAME_SELECTOR = `#${OFFICE_EMBED_IFRAME_ID}`;\n\n/** Office Online still paints its spinner after the iframe `load` event. */\nexport const OFFICE_EMBED_SETTLE_MS = 2000;\n\n/** Last resort so the overlay never traps the preview. */\nexport const OFFICE_EMBED_FALLBACK_MS = 12_000;\n"],"mappings":"AACA,IAAa,IAA+B,iBAG/B,IAAyB,KAGzB,IAA2B"}
@@ -0,0 +1 @@
1
+ export { useOfficeEmbedOverlay } from './use_office_embed_overlay';
@@ -0,0 +1,2 @@
1
+ import { RefObject } from 'react';
2
+ export declare const useOfficeEmbedOverlay: (rootRef: RefObject<HTMLElement | null>, embedKey: string) => boolean;
@@ -0,0 +1,32 @@
1
+ import { OFFICE_EMBED_FALLBACK_MS as e, OFFICE_EMBED_IFRAME_SELECTOR as t, OFFICE_EMBED_SETTLE_MS as n } from "../../constants/index.js";
2
+ import { useEffect as r, useState as i } from "react";
3
+ //#region src/components/file_view/components/office_viewer/hooks/use_office_embed_overlay/index.ts
4
+ var a = (a, o) => {
5
+ let [s, c] = i(null);
6
+ return r(() => {
7
+ let r = a.current;
8
+ if (!r) return;
9
+ let i = null, s, l, u = !1, d = () => {
10
+ u || (u = !0, c(o));
11
+ }, f = () => {
12
+ window.clearTimeout(s), s = window.setTimeout(d, n);
13
+ }, p = (e) => {
14
+ i !== e && (i?.removeEventListener("load", f), i = e, i.addEventListener("load", f));
15
+ }, m = r.querySelector(t);
16
+ m && p(m);
17
+ let h = new MutationObserver(() => {
18
+ let e = r.querySelector(t);
19
+ e && p(e);
20
+ });
21
+ return h.observe(r, {
22
+ childList: !0,
23
+ subtree: !0
24
+ }), l = window.setTimeout(d, e), () => {
25
+ h.disconnect(), i?.removeEventListener("load", f), window.clearTimeout(s), window.clearTimeout(l);
26
+ };
27
+ }, [o, a]), s !== o;
28
+ };
29
+ //#endregion
30
+ export { a as useOfficeEmbedOverlay };
31
+
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/office_viewer/hooks/use_office_embed_overlay/index.ts"],"sourcesContent":["import { type RefObject, useEffect, useState } from \"react\";\nimport {\n OFFICE_EMBED_FALLBACK_MS,\n OFFICE_EMBED_IFRAME_SELECTOR,\n OFFICE_EMBED_SETTLE_MS,\n} from \"../../constants\";\n\nexport const useOfficeEmbedOverlay = (\n rootRef: RefObject<HTMLElement | null>,\n embedKey: string,\n) => {\n const [readyKey, setReadyKey] = useState<string | null>(null);\n\n useEffect(() => {\n const root = rootRef.current;\n if (!root) {\n return;\n }\n\n let iframe: HTMLIFrameElement | null = null;\n let settleTimer: number | undefined;\n let fallbackTimer: number | undefined;\n let revealed = false;\n\n const reveal = () => {\n if (revealed) {\n return;\n }\n\n revealed = true;\n setReadyKey(embedKey);\n };\n\n const scheduleReveal = () => {\n window.clearTimeout(settleTimer);\n settleTimer = window.setTimeout(reveal, OFFICE_EMBED_SETTLE_MS);\n };\n\n const bind = (node: HTMLIFrameElement) => {\n if (iframe === node) {\n return;\n }\n\n iframe?.removeEventListener(\"load\", scheduleReveal);\n iframe = node;\n iframe.addEventListener(\"load\", scheduleReveal);\n };\n\n const existing = root.querySelector<HTMLIFrameElement>(OFFICE_EMBED_IFRAME_SELECTOR);\n if (existing) {\n bind(existing);\n }\n\n const observer = new MutationObserver(() => {\n const node = root.querySelector<HTMLIFrameElement>(OFFICE_EMBED_IFRAME_SELECTOR);\n if (node) {\n bind(node);\n }\n });\n\n observer.observe(root, { childList: true, subtree: true });\n fallbackTimer = window.setTimeout(reveal, OFFICE_EMBED_FALLBACK_MS);\n\n return () => {\n observer.disconnect();\n iframe?.removeEventListener(\"load\", scheduleReveal);\n window.clearTimeout(settleTimer);\n window.clearTimeout(fallbackTimer);\n };\n }, [embedKey, rootRef]);\n\n return readyKey !== embedKey;\n};\n"],"mappings":";;;AAOA,IAAa,KACX,GACA,MACG;CACH,IAAM,CAAC,GAAU,KAAe,EAAwB,KAAK;AA4D7D,QA1DA,QAAgB;EACd,IAAM,IAAO,EAAQ;AACrB,MAAI,CAAC,EACH;EAGF,IAAI,IAAmC,MACnC,GACA,GACA,IAAW,IAET,UAAe;AACf,SAIJ,IAAW,IACX,EAAY,EAAS;KAGjB,UAAuB;AAE3B,GADA,OAAO,aAAa,EAAY,EAChC,IAAc,OAAO,WAAW,GAAQ,EAAuB;KAG3D,KAAQ,MAA4B;AACpC,SAAW,MAIf,GAAQ,oBAAoB,QAAQ,EAAe,EACnD,IAAS,GACT,EAAO,iBAAiB,QAAQ,EAAe;KAG3C,IAAW,EAAK,cAAiC,EAA6B;AACpF,EAAI,KACF,EAAK,EAAS;EAGhB,IAAM,IAAW,IAAI,uBAAuB;GAC1C,IAAM,IAAO,EAAK,cAAiC,EAA6B;AAChF,GAAI,KACF,EAAK,EAAK;IAEZ;AAKF,SAHA,EAAS,QAAQ,GAAM;GAAE,WAAW;GAAM,SAAS;GAAM,CAAC,EAC1D,IAAgB,OAAO,WAAW,GAAQ,EAAyB,QAEtD;AAIX,GAHA,EAAS,YAAY,EACrB,GAAQ,oBAAoB,QAAQ,EAAe,EACnD,OAAO,aAAa,EAAY,EAChC,OAAO,aAAa,EAAc;;IAEnC,CAAC,GAAU,EAAQ,CAAC,EAEhB,MAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/pdf_viewer/components/content/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LoadingState } from \"../\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport { DEFAULT_PAGE_DIMENSIONS } from \"./constants\";\nimport type { ContentHandle, PageDimensions } from \"./types\";\n\ninterface Props {\n url: string;\n scale: number;\n numPages: number;\n onLoadSuccess: (data: { numPages: number }) => void;\n onLoadError: (error: Error) => void;\n onVisiblePageChange: (page: number) => void;\n}\n\nexport const Content = forwardRef<ContentHandle, Props>(\n (\n { url, scale, numPages, onLoadSuccess, onLoadError, onVisiblePageChange },\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const pageElementsRef = useRef(new Map<number, HTMLDivElement>());\n const visibleHeightsRef = useRef(new Map<number, number>());\n const spyObserverRef = useRef<IntersectionObserver | null>(null);\n const mountObserverRef = useRef<IntersectionObserver | null>(null);\n const onVisiblePageChangeRef = useRef(onVisiblePageChange);\n onVisiblePageChangeRef.current = onVisiblePageChange;\n\n const [renderedPages, setRenderedPages] = useState<Set<number>>(\n () => new Set([1, 2]),\n );\n const [pageDimensions, setPageDimensions] =\n useState<PageDimensions | null>(null);\n\n const options = useMemo(\n () => ({\n cMapUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/cmaps/`,\n cMapPacked: true,\n standardFontDataUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/standard_fonts/`,\n }),\n [],\n );\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const spyObserver = new IntersectionObserver(\n (entries) => {\n const visibleHeights = visibleHeightsRef.current;\n for (const entry of entries) {\n const page = Number((entry.target as HTMLElement).dataset.page);\n visibleHeights.set(\n page,\n entry.isIntersecting ? entry.intersectionRect.height : 0,\n );\n }\n let bestPage = 0;\n let bestHeight = 0;\n visibleHeights.forEach((height, page) => {\n if (\n height > bestHeight ||\n (height === bestHeight && height > 0 && page < bestPage)\n ) {\n bestHeight = height;\n bestPage = page;\n }\n });\n if (bestPage > 0) onVisiblePageChangeRef.current(bestPage);\n },\n { root: container, threshold: [0, 0.25, 0.5, 0.75, 1] },\n );\n\n const mountObserver = new IntersectionObserver(\n (entries) => {\n setRenderedPages((prev) => {\n const next = new Set(prev);\n for (const entry of entries) {\n const page = Number((entry.target as HTMLElement).dataset.page);\n if (entry.isIntersecting) next.add(page);\n else next.delete(page);\n }\n return next;\n });\n },\n { root: container, rootMargin: \"150% 0px\" },\n );\n\n spyObserverRef.current = spyObserver;\n mountObserverRef.current = mountObserver;\n pageElementsRef.current.forEach((element) => {\n spyObserver.observe(element);\n mountObserver.observe(element);\n });\n\n return () => {\n spyObserver.disconnect();\n mountObserver.disconnect();\n spyObserverRef.current = null;\n mountObserverRef.current = null;\n };\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToPage: (page: number) => {\n const container = containerRef.current;\n const element = pageElementsRef.current.get(page);\n if (!container || !element) return;\n const top =\n element.getBoundingClientRect().top -\n container.getBoundingClientRect().top +\n container.scrollTop -\n 24;\n container.scrollTo({ top, behavior: \"smooth\" });\n },\n }),\n [],\n );\n\n const registerPageElement =\n (page: number) => (element: HTMLDivElement | null) => {\n const pageElements = pageElementsRef.current;\n const previous = pageElements.get(page);\n if (previous) {\n spyObserverRef.current?.unobserve(previous);\n mountObserverRef.current?.unobserve(previous);\n }\n if (element) {\n pageElements.set(page, element);\n spyObserverRef.current?.observe(element);\n mountObserverRef.current?.observe(element);\n } else {\n pageElements.delete(page);\n visibleHeightsRef.current.delete(page);\n }\n };\n\n const { width, height } = pageDimensions ?? DEFAULT_PAGE_DIMENSIONS;\n const placeholderStyle = {\n width: width * scale,\n height: height * scale,\n };\n\n return (\n <div\n ref={containerRef}\n className=\"flex-1 overflow-auto p-6 muted h-full w-full bg-accent\"\n >\n <Document\n file={url}\n onLoadSuccess={onLoadSuccess}\n onLoadError={onLoadError}\n loading={<LoadingState />}\n options={options}\n className=\"flex w-max min-w-full flex-col items-center gap-4\"\n >\n {Array.from({ length: numPages }, (_, index) => {\n const page = index + 1;\n return (\n <div\n key={page}\n ref={registerPageElement(page)}\n data-page={page}\n className=\"bg-background shadow-sm\"\n >\n {renderedPages.has(page) ? (\n <Page\n pageNumber={page}\n scale={scale}\n renderTextLayer={true}\n renderAnnotationLayer={true}\n loading={<div style={placeholderStyle} />}\n onLoadSuccess={(loadedPage) =>\n setPageDimensions(\n (prev) =>\n prev ?? {\n width: loadedPage.originalWidth,\n height: loadedPage.originalHeight,\n },\n )\n }\n />\n ) : (\n <div style={placeholderStyle} />\n )}\n </div>\n );\n })}\n </Document>\n </div>\n );\n },\n);\n\nContent.displayName = \"Content\";\n\nexport type { ContentHandle } from \"./types\";\n"],"mappings":";;;;;;AAsBA,IAAa,IAAU,GAEnB,EAAE,QAAK,UAAO,aAAU,kBAAe,gBAAa,0BACpD,MACG;CACH,IAAM,IAAe,EAAuB,KAAK,EAC3C,IAAkB,kBAAO,IAAI,KAA6B,CAAC,EAC3D,IAAoB,kBAAO,IAAI,KAAqB,CAAC,EACrD,IAAiB,EAAoC,KAAK,EAC1D,IAAmB,EAAoC,KAAK,EAC5D,IAAyB,EAAO,EAAoB;AAC1D,GAAuB,UAAU;CAEjC,IAAM,CAAC,GAAe,KAAoB,QAClC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CACtB,EACK,CAAC,GAAgB,KACrB,EAAgC,KAAK,EAEjC,IAAU,SACP;EACL,SAAS,gCAAgC,EAAM,QAAQ;EACvD,YAAY;EACZ,qBAAqB,gCAAgC,EAAM,QAAQ;EACpE,GACD,EAAE,CACH;AA8DD,CA5DA,QAAgB;EACd,IAAM,IAAY,EAAa;AAC/B,MAAI,CAAC,EAAW;EAEhB,IAAM,IAAc,IAAI,sBACrB,MAAY;GACX,IAAM,IAAiB,EAAkB;AACzC,QAAK,IAAM,KAAS,GAAS;IAC3B,IAAM,IAAO,OAAQ,EAAM,OAAuB,QAAQ,KAAK;AAC/D,MAAe,IACb,GACA,EAAM,iBAAiB,EAAM,iBAAiB,SAAS,EACxD;;GAEH,IAAI,IAAW,GACX,IAAa;AAUjB,GATA,EAAe,SAAS,GAAQ,MAAS;AACvC,KACE,IAAS,KACR,MAAW,KAAc,IAAS,KAAK,IAAO,OAE/C,IAAa,GACb,IAAW;KAEb,EACE,IAAW,KAAG,EAAuB,QAAQ,EAAS;KAE5D;GAAE,MAAM;GAAW,WAAW;IAAC;IAAG;IAAM;IAAK;IAAM;IAAE;GAAE,CACxD,EAEK,IAAgB,IAAI,sBACvB,MAAY;AACX,MAAkB,MAAS;IACzB,IAAM,IAAO,IAAI,IAAI,EAAK;AAC1B,SAAK,IAAM,KAAS,GAAS;KAC3B,IAAM,IAAO,OAAQ,EAAM,OAAuB,QAAQ,KAAK;AAC/D,KAAI,EAAM,iBAAgB,EAAK,IAAI,EAAK,GACnC,EAAK,OAAO,EAAK;;AAExB,WAAO;KACP;KAEJ;GAAE,MAAM;GAAW,YAAY;GAAY,CAC5C;AASD,SAPA,EAAe,UAAU,GACzB,EAAiB,UAAU,GAC3B,EAAgB,QAAQ,SAAS,MAAY;AAE3C,GADA,EAAY,QAAQ,EAAQ,EAC5B,EAAc,QAAQ,EAAQ;IAC9B,QAEW;AAIX,GAHA,EAAY,YAAY,EACxB,EAAc,YAAY,EAC1B,EAAe,UAAU,MACzB,EAAiB,UAAU;;IAE5B,EAAE,CAAC,EAEN,EACE,UACO,EACL,eAAe,MAAiB;EAC9B,IAAM,IAAY,EAAa,SACzB,IAAU,EAAgB,QAAQ,IAAI,EAAK;AACjD,MAAI,CAAC,KAAa,CAAC,EAAS;EAC5B,IAAM,IACJ,EAAQ,uBAAuB,CAAC,MAChC,EAAU,uBAAuB,CAAC,MAClC,EAAU,YACV;AACF,IAAU,SAAS;GAAE;GAAK,UAAU;GAAU,CAAC;IAElD,GACD,EAAE,CACH;CAED,IAAM,KACH,OAAkB,MAAmC;EACpD,IAAM,IAAe,EAAgB,SAC/B,IAAW,EAAa,IAAI,EAAK;AAKvC,EAJI,MACF,EAAe,SAAS,UAAU,EAAS,EAC3C,EAAiB,SAAS,UAAU,EAAS,GAE3C,KACF,EAAa,IAAI,GAAM,EAAQ,EAC/B,EAAe,SAAS,QAAQ,EAAQ,EACxC,EAAiB,SAAS,QAAQ,EAAQ,KAE1C,EAAa,OAAO,EAAK,EACzB,EAAkB,QAAQ,OAAO,EAAK;IAItC,EAAE,UAAO,cAAW,KAAkB,GACtC,IAAmB;EACvB,OAAO,IAAQ;EACf,QAAQ,IAAS;EAClB;AAED,QACE,kBAAC,OAAD;EACE,KAAK;EACL,WAAU;YAEV,kBAAC,GAAD;GACE,MAAM;GACS;GACF;GACb,SAAS,kBAAC,GAAD,EAAgB,CAAA;GAChB;GACT,WAAU;aAET,MAAM,KAAK,EAAE,QAAQ,GAAU,GAAG,GAAG,MAAU;IAC9C,IAAM,IAAO,IAAQ;AACrB,WACE,kBAAC,OAAD;KAEE,KAAK,EAAoB,EAAK;KAC9B,aAAW;KACX,WAAU;eAET,EAAc,IAAI,EAAK,GACtB,kBAAC,GAAD;MACE,YAAY;MACL;MACP,iBAAiB;MACjB,uBAAuB;MACvB,SAAS,kBAAC,OAAD,EAAK,OAAO,GAAoB,CAAA;MACzC,gBAAgB,MACd,GACG,MACC,KAAQ;OACN,OAAO,EAAW;OAClB,QAAQ,EAAW;OACpB,CACJ;MAEH,CAAA,GAEF,kBAAC,OAAD,EAAK,OAAO,GAAoB,CAAA;KAE9B,EAzBC,EAyBD;KAER;GACO,CAAA;EACP,CAAA;EAGX;AAED,EAAQ,cAAc"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/pdf_viewer/components/content/index.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { LoadingState } from \"../\";\nimport { Document, Page, pdfjs } from \"react-pdf\";\nimport \"../../../../utilities/setup_pdf_worker\";\nimport { DEFAULT_PAGE_DIMENSIONS } from \"./constants\";\nimport type { ContentHandle, PageDimensions } from \"./types\";\n\ninterface Props {\n url: string;\n scale: number;\n numPages: number;\n onLoadSuccess: (data: { numPages: number }) => void;\n onLoadError: (error: Error) => void;\n onVisiblePageChange: (page: number) => void;\n}\n\nexport const Content = forwardRef<ContentHandle, Props>(\n (\n { url, scale, numPages, onLoadSuccess, onLoadError, onVisiblePageChange },\n ref,\n ) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const pageElementsRef = useRef(new Map<number, HTMLDivElement>());\n const visibleHeightsRef = useRef(new Map<number, number>());\n const spyObserverRef = useRef<IntersectionObserver | null>(null);\n const mountObserverRef = useRef<IntersectionObserver | null>(null);\n const onVisiblePageChangeRef = useRef(onVisiblePageChange);\n onVisiblePageChangeRef.current = onVisiblePageChange;\n\n const [renderedPages, setRenderedPages] = useState<Set<number>>(\n () => new Set([1, 2]),\n );\n const [pageDimensions, setPageDimensions] =\n useState<PageDimensions | null>(null);\n\n const options = useMemo(\n () => ({\n cMapUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/cmaps/`,\n cMapPacked: true,\n standardFontDataUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/standard_fonts/`,\n }),\n [],\n );\n\n useEffect(() => {\n const container = containerRef.current;\n if (!container) return;\n\n const spyObserver = new IntersectionObserver(\n (entries) => {\n const visibleHeights = visibleHeightsRef.current;\n for (const entry of entries) {\n const page = Number((entry.target as HTMLElement).dataset.page);\n visibleHeights.set(\n page,\n entry.isIntersecting ? entry.intersectionRect.height : 0,\n );\n }\n let bestPage = 0;\n let bestHeight = 0;\n visibleHeights.forEach((height, page) => {\n if (\n height > bestHeight ||\n (height === bestHeight && height > 0 && page < bestPage)\n ) {\n bestHeight = height;\n bestPage = page;\n }\n });\n if (bestPage > 0) onVisiblePageChangeRef.current(bestPage);\n },\n { root: container, threshold: [0, 0.25, 0.5, 0.75, 1] },\n );\n\n const mountObserver = new IntersectionObserver(\n (entries) => {\n setRenderedPages((prev) => {\n const next = new Set(prev);\n for (const entry of entries) {\n const page = Number((entry.target as HTMLElement).dataset.page);\n if (entry.isIntersecting) next.add(page);\n else next.delete(page);\n }\n return next;\n });\n },\n { root: container, rootMargin: \"150% 0px\" },\n );\n\n spyObserverRef.current = spyObserver;\n mountObserverRef.current = mountObserver;\n pageElementsRef.current.forEach((element) => {\n spyObserver.observe(element);\n mountObserver.observe(element);\n });\n\n return () => {\n spyObserver.disconnect();\n mountObserver.disconnect();\n spyObserverRef.current = null;\n mountObserverRef.current = null;\n };\n }, []);\n\n useImperativeHandle(\n ref,\n () => ({\n scrollToPage: (page: number) => {\n const container = containerRef.current;\n const element = pageElementsRef.current.get(page);\n if (!container || !element) return;\n const top =\n element.getBoundingClientRect().top -\n container.getBoundingClientRect().top +\n container.scrollTop -\n 24;\n container.scrollTo({ top, behavior: \"smooth\" });\n },\n }),\n [],\n );\n\n const registerPageElement =\n (page: number) => (element: HTMLDivElement | null) => {\n const pageElements = pageElementsRef.current;\n const previous = pageElements.get(page);\n if (previous) {\n spyObserverRef.current?.unobserve(previous);\n mountObserverRef.current?.unobserve(previous);\n }\n if (element) {\n pageElements.set(page, element);\n spyObserverRef.current?.observe(element);\n mountObserverRef.current?.observe(element);\n } else {\n pageElements.delete(page);\n visibleHeightsRef.current.delete(page);\n }\n };\n\n const { width, height } = pageDimensions ?? DEFAULT_PAGE_DIMENSIONS;\n const placeholderStyle = {\n width: width * scale,\n height: height * scale,\n };\n\n return (\n <div\n ref={containerRef}\n className=\"flex-1 overflow-auto p-6 muted h-full w-full bg-accent\"\n >\n <Document\n file={url}\n onLoadSuccess={onLoadSuccess}\n onLoadError={onLoadError}\n loading={<LoadingState />}\n options={options}\n className=\"flex w-max min-w-full flex-col items-center gap-4\"\n >\n {Array.from({ length: numPages }, (_, index) => {\n const page = index + 1;\n return (\n <div\n key={page}\n ref={registerPageElement(page)}\n data-page={page}\n className=\"bg-background shadow-sm\"\n >\n {renderedPages.has(page) ? (\n <Page\n pageNumber={page}\n scale={scale}\n renderTextLayer={true}\n renderAnnotationLayer={true}\n loading={<div style={placeholderStyle} />}\n onLoadSuccess={(loadedPage) =>\n setPageDimensions(\n (prev) =>\n prev ?? {\n width: loadedPage.originalWidth,\n height: loadedPage.originalHeight,\n },\n )\n }\n />\n ) : (\n <div style={placeholderStyle} />\n )}\n </div>\n );\n })}\n </Document>\n </div>\n );\n },\n);\n\nContent.displayName = \"Content\";\n\nexport type { ContentHandle } from \"./types\";\n"],"mappings":";;;;;;AAuBA,IAAa,IAAU,GAEnB,EAAE,QAAK,UAAO,aAAU,kBAAe,gBAAa,0BACpD,MACG;CACH,IAAM,IAAe,EAAuB,KAAK,EAC3C,IAAkB,kBAAO,IAAI,KAA6B,CAAC,EAC3D,IAAoB,kBAAO,IAAI,KAAqB,CAAC,EACrD,IAAiB,EAAoC,KAAK,EAC1D,IAAmB,EAAoC,KAAK,EAC5D,IAAyB,EAAO,EAAoB;AAC1D,GAAuB,UAAU;CAEjC,IAAM,CAAC,GAAe,KAAoB,QAClC,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,CACtB,EACK,CAAC,GAAgB,KACrB,EAAgC,KAAK,EAEjC,IAAU,SACP;EACL,SAAS,gCAAgC,EAAM,QAAQ;EACvD,YAAY;EACZ,qBAAqB,gCAAgC,EAAM,QAAQ;EACpE,GACD,EAAE,CACH;AA8DD,CA5DA,QAAgB;EACd,IAAM,IAAY,EAAa;AAC/B,MAAI,CAAC,EAAW;EAEhB,IAAM,IAAc,IAAI,sBACrB,MAAY;GACX,IAAM,IAAiB,EAAkB;AACzC,QAAK,IAAM,KAAS,GAAS;IAC3B,IAAM,IAAO,OAAQ,EAAM,OAAuB,QAAQ,KAAK;AAC/D,MAAe,IACb,GACA,EAAM,iBAAiB,EAAM,iBAAiB,SAAS,EACxD;;GAEH,IAAI,IAAW,GACX,IAAa;AAUjB,GATA,EAAe,SAAS,GAAQ,MAAS;AACvC,KACE,IAAS,KACR,MAAW,KAAc,IAAS,KAAK,IAAO,OAE/C,IAAa,GACb,IAAW;KAEb,EACE,IAAW,KAAG,EAAuB,QAAQ,EAAS;KAE5D;GAAE,MAAM;GAAW,WAAW;IAAC;IAAG;IAAM;IAAK;IAAM;IAAE;GAAE,CACxD,EAEK,IAAgB,IAAI,sBACvB,MAAY;AACX,MAAkB,MAAS;IACzB,IAAM,IAAO,IAAI,IAAI,EAAK;AAC1B,SAAK,IAAM,KAAS,GAAS;KAC3B,IAAM,IAAO,OAAQ,EAAM,OAAuB,QAAQ,KAAK;AAC/D,KAAI,EAAM,iBAAgB,EAAK,IAAI,EAAK,GACnC,EAAK,OAAO,EAAK;;AAExB,WAAO;KACP;KAEJ;GAAE,MAAM;GAAW,YAAY;GAAY,CAC5C;AASD,SAPA,EAAe,UAAU,GACzB,EAAiB,UAAU,GAC3B,EAAgB,QAAQ,SAAS,MAAY;AAE3C,GADA,EAAY,QAAQ,EAAQ,EAC5B,EAAc,QAAQ,EAAQ;IAC9B,QAEW;AAIX,GAHA,EAAY,YAAY,EACxB,EAAc,YAAY,EAC1B,EAAe,UAAU,MACzB,EAAiB,UAAU;;IAE5B,EAAE,CAAC,EAEN,EACE,UACO,EACL,eAAe,MAAiB;EAC9B,IAAM,IAAY,EAAa,SACzB,IAAU,EAAgB,QAAQ,IAAI,EAAK;AACjD,MAAI,CAAC,KAAa,CAAC,EAAS;EAC5B,IAAM,IACJ,EAAQ,uBAAuB,CAAC,MAChC,EAAU,uBAAuB,CAAC,MAClC,EAAU,YACV;AACF,IAAU,SAAS;GAAE;GAAK,UAAU;GAAU,CAAC;IAElD,GACD,EAAE,CACH;CAED,IAAM,KACH,OAAkB,MAAmC;EACpD,IAAM,IAAe,EAAgB,SAC/B,IAAW,EAAa,IAAI,EAAK;AAKvC,EAJI,MACF,EAAe,SAAS,UAAU,EAAS,EAC3C,EAAiB,SAAS,UAAU,EAAS,GAE3C,KACF,EAAa,IAAI,GAAM,EAAQ,EAC/B,EAAe,SAAS,QAAQ,EAAQ,EACxC,EAAiB,SAAS,QAAQ,EAAQ,KAE1C,EAAa,OAAO,EAAK,EACzB,EAAkB,QAAQ,OAAO,EAAK;IAItC,EAAE,UAAO,cAAW,KAAkB,GACtC,IAAmB;EACvB,OAAO,IAAQ;EACf,QAAQ,IAAS;EAClB;AAED,QACE,kBAAC,OAAD;EACE,KAAK;EACL,WAAU;YAEV,kBAAC,GAAD;GACE,MAAM;GACS;GACF;GACb,SAAS,kBAAC,GAAD,EAAgB,CAAA;GAChB;GACT,WAAU;aAET,MAAM,KAAK,EAAE,QAAQ,GAAU,GAAG,GAAG,MAAU;IAC9C,IAAM,IAAO,IAAQ;AACrB,WACE,kBAAC,OAAD;KAEE,KAAK,EAAoB,EAAK;KAC9B,aAAW;KACX,WAAU;eAET,EAAc,IAAI,EAAK,GACtB,kBAAC,GAAD;MACE,YAAY;MACL;MACP,iBAAiB;MACjB,uBAAuB;MACvB,SAAS,kBAAC,OAAD,EAAK,OAAO,GAAoB,CAAA;MACzC,gBAAgB,MACd,GACG,MACC,KAAQ;OACN,OAAO,EAAW;OAClB,QAAQ,EAAW;OACpB,CACJ;MAEH,CAAA,GAEF,kBAAC,OAAD,EAAK,OAAO,GAAoB,CAAA;KAE9B,EAzBC,EAyBD;KAER;GACO,CAAA;EACP,CAAA;EAGX;AAED,EAAQ,cAAc"}
@@ -1,5 +1,5 @@
1
1
  import { StatusMessage as e } from "../../../status_message/index.js";
2
- import { Skeleton as t } from "../../../skeleton/index.js";
2
+ import { FileViewLoadingState as t } from "../loading_state/index.js";
3
3
  import { getSourceLanguageFromFile as n } from "../../utilities/get_source_language_from_file.js";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
5
  import { FileCode as i } from "lucide-react";
@@ -8,10 +8,7 @@ import { oneDark as o } from "react-syntax-highlighter/dist/esm/styles/prism";
8
8
  //#region src/components/file_view/components/source_viewer/index.tsx
9
9
  var s = ({ content: s, mimeType: c, fileName: l, isPending: u = !1, isError: d = !1 }) => {
10
10
  let f = n(c, l);
11
- return u ? /* @__PURE__ */ r("div", {
12
- className: "p-6 w-full h-full overflow-auto",
13
- children: /* @__PURE__ */ r(t, { className: "w-full h-96 rounded-md" })
14
- }) : d || s == null ? /* @__PURE__ */ r("div", {
11
+ return u ? /* @__PURE__ */ r(t, {}) : d || s == null ? /* @__PURE__ */ r("div", {
15
12
  className: "p-6 h-full",
16
13
  children: /* @__PURE__ */ r(e, {
17
14
  title: "No se pudo cargar el código",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/source_viewer/index.tsx"],"sourcesContent":["import { FileCode } from \"lucide-react\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { oneDark } from \"react-syntax-highlighter/dist/esm/styles/prism\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { getSourceLanguageFromFile } from \"../../utilities/get_source_language_from_file\";\n\nexport interface FileSourceViewerProps {\n content?: string | null;\n mimeType: string;\n fileName: string;\n isPending?: boolean;\n isError?: boolean;\n}\n\nexport const FileSourceViewer = ({\n content,\n mimeType,\n fileName,\n isPending = false,\n isError = false,\n}: FileSourceViewerProps) => {\n const language = getSourceLanguageFromFile(mimeType, fileName);\n\n if (isPending) {\n return (\n <div className=\"p-6 w-full h-full overflow-auto\">\n <Skeleton className=\"w-full h-96 rounded-md\" />\n </div>\n );\n }\n\n if (isError || content == null) {\n return (\n <div className=\"p-6 h-full\">\n <StatusMessage\n title=\"No se pudo cargar el código\"\n description=\"Comprueba que el archivo sea accesible. Si usas URLs externas (p. ej. S3), puede ser necesario un endpoint en el backend que devuelva el contenido como texto.\"\n icon={FileCode}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"h-full overflow-auto bg-[#282c34] rounded-md\">\n <SyntaxHighlighter\n language={language}\n style={oneDark}\n showLineNumbers\n wrapLongLines\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: 1.6,\n minHeight: \"100%\",\n }}\n codeTagProps={{\n style: { fontFamily: \"ui-monospace, monospace\" },\n }}\n >\n {content}\n </SyntaxHighlighter>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAa,KAAoB,EAC/B,YACA,aACA,aACA,eAAY,IACZ,aAAU,SACiB;CAC3B,IAAM,IAAW,EAA0B,GAAU,EAAS;AA2B9D,QAzBI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAU,WAAU,0BAA2B,CAAA;EAC3C,CAAA,GAIN,KAAW,KAAW,OAEtB,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACY;GACV,OAAO;GACP,iBAAA;GACA,eAAA;GACA,aAAa;IACX,QAAQ;IACR,SAAS;IACT,UAAU;IACV,YAAY;IACZ,WAAW;IACZ;GACD,cAAc,EACZ,OAAO,EAAE,YAAY,2BAA2B,EACjD;aAEA;GACiB,CAAA;EAChB,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/source_viewer/index.tsx"],"sourcesContent":["import { FileCode } from \"lucide-react\";\nimport { Prism as SyntaxHighlighter } from \"react-syntax-highlighter\";\nimport { oneDark } from \"react-syntax-highlighter/dist/esm/styles/prism\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { getSourceLanguageFromFile } from \"../../utilities/get_source_language_from_file\";\nimport { FileViewLoadingState } from \"../loading_state\";\n\nexport interface FileSourceViewerProps {\n content?: string | null;\n mimeType: string;\n fileName: string;\n isPending?: boolean;\n isError?: boolean;\n}\n\nexport const FileSourceViewer = ({\n content,\n mimeType,\n fileName,\n isPending = false,\n isError = false,\n}: FileSourceViewerProps) => {\n const language = getSourceLanguageFromFile(mimeType, fileName);\n\n if (isPending) {\n return <FileViewLoadingState />;\n }\n\n if (isError || content == null) {\n return (\n <div className=\"p-6 h-full\">\n <StatusMessage\n title=\"No se pudo cargar el código\"\n description=\"Comprueba que el archivo sea accesible. Si usas URLs externas (p. ej. S3), puede ser necesario un endpoint en el backend que devuelva el contenido como texto.\"\n icon={FileCode}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"h-full overflow-auto bg-[#282c34] rounded-md\">\n <SyntaxHighlighter\n language={language}\n style={oneDark}\n showLineNumbers\n wrapLongLines\n customStyle={{\n margin: 0,\n padding: \"1rem\",\n fontSize: \"0.875rem\",\n lineHeight: 1.6,\n minHeight: \"100%\",\n }}\n codeTagProps={{\n style: { fontFamily: \"ui-monospace, monospace\" },\n }}\n >\n {content}\n </SyntaxHighlighter>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAeA,IAAa,KAAoB,EAC/B,YACA,aACA,aACA,eAAY,IACZ,aAAU,SACiB;CAC3B,IAAM,IAAW,EAA0B,GAAU,EAAS;AAuB9D,QArBI,IACK,kBAAC,GAAD,EAAwB,CAAA,GAG7B,KAAW,KAAW,OAEtB,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA,GAKR,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACY;GACV,OAAO;GACP,iBAAA;GACA,eAAA;GACA,aAAa;IACX,QAAQ;IACR,SAAS;IACT,UAAU;IACV,YAAY;IACZ,WAAW;IACZ;GACD,cAAc,EACZ,OAAO,EAAE,YAAY,2BAA2B,EACjD;aAEA;GACiB,CAAA;EAChB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "../../../button/index.js";
2
2
  import { StatusMessage as t } from "../../../status_message/index.js";
3
- import { Skeleton as n } from "../../../skeleton/index.js";
3
+ import { FileViewLoadingState as n } from "../loading_state/index.js";
4
4
  import { summaryMarkdownToHtml as r } from "../../utilities/summary_markdown.js";
5
5
  import { useMemo as i } from "react";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -8,10 +8,7 @@ import { Copy as s, FileText as c, Loader2 as l } from "lucide-react";
8
8
  //#region src/components/file_view/components/summary_viewer/index.tsx
9
9
  var u = ({ content: u, isLoading: d = !1, isProcessing: f = !1, isFetching: p = !1, isError: m = !1, isUnsupported: h = !1, onCopy: g, onRetry: _ }) => {
10
10
  let v = i(() => r(u), [u]);
11
- return d ? /* @__PURE__ */ a("div", {
12
- className: "p-4 max-w-2xl mx-auto",
13
- children: /* @__PURE__ */ a(n, { className: "w-full h-96" })
14
- }) : h ? /* @__PURE__ */ a("div", {
11
+ return d ? /* @__PURE__ */ a(n, {}) : h ? /* @__PURE__ */ a("div", {
15
12
  className: "p-4 h-full",
16
13
  children: /* @__PURE__ */ a(t, {
17
14
  title: "Resumen no disponible",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/summary_viewer/index.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Copy, FileText, Loader2 } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { summaryMarkdownToHtml } from \"../../utilities/summary_markdown\";\n\nexport interface FileSummaryViewerProps {\n content?: string | null;\n isLoading?: boolean;\n isProcessing?: boolean;\n isFetching?: boolean;\n isError?: boolean;\n isUnsupported?: boolean;\n onCopy?: () => void;\n onRetry?: () => void;\n}\n\nexport const FileSummaryViewer = ({\n content,\n isLoading = false,\n isProcessing = false,\n isFetching = false,\n isError = false,\n isUnsupported = false,\n onCopy,\n onRetry,\n}: FileSummaryViewerProps) => {\n const html = useMemo(() => summaryMarkdownToHtml(content), [content]);\n\n if (isLoading) {\n return (\n <div className=\"p-4 max-w-2xl mx-auto\">\n <Skeleton className=\"w-full h-96\" />\n </div>\n );\n }\n\n if (isUnsupported) {\n return (\n <div className=\"p-4 h-full\">\n <StatusMessage\n title=\"Resumen no disponible\"\n description=\"Este tipo de archivo no admite generar un resumen automático.\"\n icon={FileText}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n if (isProcessing) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-3\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground text-center\">\n Generando resumen\n {isFetching ? \"...\" : \". Esto puede tardar un momento...\"}\n </p>\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-4\">\n <StatusMessage\n title=\"No se pudo generar el resumen\"\n description=\"Vuelve a intentarlo. Si el error persiste, verifica que el archivo tenga contenido legible.\"\n icon={FileText}\n classNameCard=\"w-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n {onRetry ? (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n Reintentar\n </Button>\n ) : null}\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full bg-background overflow-hidden\">\n <div className=\"flex justify-between items-center px-6 py-4 border-b bg-muted/30\">\n <span className=\"text-sm font-medium text-muted-foreground uppercase tracking-tight\">\n RESUMEN\n </span>\n {onCopy ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onCopy}\n className=\"h-8 gap-2\"\n >\n <Copy className=\"size-3.5\" />\n Copiar\n </Button>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-auto p-8\">\n <div\n className=\"prose prose-sm dark:prose-invert text-foreground leading-relaxed max-w-2xl mx-auto\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAkBA,IAAa,KAAqB,EAChC,YACA,eAAY,IACZ,kBAAe,IACf,gBAAa,IACb,aAAU,IACV,mBAAgB,IAChB,WACA,iBAC4B;CAC5B,IAAM,IAAO,QAAc,EAAsB,EAAQ,EAAE,CAAC,EAAQ,CAAC;AA6DrE,QA3DI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAU,WAAU,eAAgB,CAAA;EAChC,CAAA,GAIN,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA,GAIN,IAEA,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAS,WAAU,6CAA8C,CAAA,EACjE,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAyD,qBAEtD,IAAa,QAAQ,oCACpB;KACA;MAIN,IAEA,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA,EACD,IACC,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAK,SAAS;aAAS;GAE7C,CAAA,GACP,KACA;MAKR,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cAAqE;IAE9E,CAAA,EACN,IACC,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,SAAS;IACT,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAM,WAAU,YAAa,CAAA,EAAA,SAEtB;QACP,KACA;MACN,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,OAAD;IACE,WAAU;IACV,yBAAyB,EAAE,QAAQ,GAAM;IACzC,CAAA;GACE,CAAA,CACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/summary_viewer/index.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Copy, FileText, Loader2 } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { summaryMarkdownToHtml } from \"../../utilities/summary_markdown\";\nimport { FileViewLoadingState } from \"../loading_state\";\n\nexport interface FileSummaryViewerProps {\n content?: string | null;\n isLoading?: boolean;\n isProcessing?: boolean;\n isFetching?: boolean;\n isError?: boolean;\n isUnsupported?: boolean;\n onCopy?: () => void;\n onRetry?: () => void;\n}\n\nexport const FileSummaryViewer = ({\n content,\n isLoading = false,\n isProcessing = false,\n isFetching = false,\n isError = false,\n isUnsupported = false,\n onCopy,\n onRetry,\n}: FileSummaryViewerProps) => {\n const html = useMemo(() => summaryMarkdownToHtml(content), [content]);\n\n if (isLoading) {\n return <FileViewLoadingState />;\n }\n\n if (isUnsupported) {\n return (\n <div className=\"p-4 h-full\">\n <StatusMessage\n title=\"Resumen no disponible\"\n description=\"Este tipo de archivo no admite generar un resumen automático.\"\n icon={FileText}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n if (isProcessing) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-3\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground text-center\">\n Generando resumen\n {isFetching ? \"...\" : \". Esto puede tardar un momento...\"}\n </p>\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-4\">\n <StatusMessage\n title=\"No se pudo generar el resumen\"\n description=\"Vuelve a intentarlo. Si el error persiste, verifica que el archivo tenga contenido legible.\"\n icon={FileText}\n classNameCard=\"w-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n {onRetry ? (\n <Button variant=\"outline\" size=\"sm\" onClick={onRetry}>\n Reintentar\n </Button>\n ) : null}\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col h-full bg-background overflow-hidden\">\n <div className=\"flex justify-between items-center px-6 py-4 border-b bg-muted/30\">\n <span className=\"text-sm font-medium text-muted-foreground uppercase tracking-tight\">\n RESUMEN\n </span>\n {onCopy ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onCopy}\n className=\"h-8 gap-2\"\n >\n <Copy className=\"size-3.5\" />\n Copiar\n </Button>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-auto p-8\">\n <div\n className=\"prose prose-sm dark:prose-invert text-foreground leading-relaxed max-w-2xl mx-auto\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAkBA,IAAa,KAAqB,EAChC,YACA,eAAY,IACZ,kBAAe,IACf,gBAAa,IACb,aAAU,IACV,mBAAgB,IAChB,WACA,iBAC4B;CAC5B,IAAM,IAAO,QAAc,EAAsB,EAAQ,EAAE,CAAC,EAAQ,CAAC;AAyDrE,QAvDI,IACK,kBAAC,GAAD,EAAwB,CAAA,GAG7B,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA,GAIN,IAEA,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAS,WAAU,6CAA8C,CAAA,EACjE,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAyD,qBAEtD,IAAa,QAAQ,oCACpB;KACA;MAIN,IAEA,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA,EACD,IACC,kBAAC,GAAD;GAAQ,SAAQ;GAAU,MAAK;GAAK,SAAS;aAAS;GAE7C,CAAA,GACP,KACA;MAKR,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,QAAD;IAAM,WAAU;cAAqE;IAE9E,CAAA,EACN,IACC,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,SAAS;IACT,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAM,WAAU,YAAa,CAAA,EAAA,SAEtB;QACP,KACA;MACN,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,OAAD;IACE,WAAU;IACV,yBAAyB,EAAE,QAAQ,GAAM;IACzC,CAAA;GACE,CAAA,CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../src/components/file_view/components/template_viewer/components/pdf_template_viewer/components/pdf_template_viewer_content/index.tsx"],"sourcesContent":["import type { Props } from \"../../types\";\nimport { useMemo, useState, useCallback } from \"react\";\nimport { Document, pdfjs } from \"react-pdf\";\nimport { PdfTemplatePageRow } from \"../../../pdf_template_page_row\";\nimport { LoadingState, ErrorState } from \"../../../../../pdf_viewer/components\";\n\nconst PdfTemplateViewerContent = ({\n url,\n pageNumber,\n scale,\n pageWidthAtScale1,\n pageHeightAtScale1,\n annotations,\n annotationAssetUrls,\n selectedId,\n shapeDrawTool,\n createShapeLabel,\n onSelect,\n onClearSelection,\n onChangeTextAnnotation,\n onChangeShapeAnnotation,\n onShapeDrawToolChange,\n onDocumentPagesLoaded,\n scrollContainerRef,\n onPageViewportAtScaleOne,\n}: Props) => {\n const [numPages, setNumPages] = useState(0);\n const [error, setError] = useState<string | null>(null);\n\n const options = useMemo(\n () => ({\n cMapUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/cmaps/`,\n cMapPacked: true,\n standardFontDataUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/standard_fonts/`,\n }),\n [],\n );\n\n const onLoadSuccess = useCallback(\n ({ numPages: n }: { numPages: number }) => {\n setNumPages(n);\n setError(null);\n onDocumentPagesLoaded?.(n);\n },\n [onDocumentPagesLoaded],\n );\n\n const onLoadError = useCallback((err: Error) => {\n console.error(err);\n setError(\"Error al cargar el documento PDF\");\n }, []);\n\n const displayPage =\n numPages > 0 ? Math.min(Math.max(1, pageNumber), numPages) : 1;\n\n if (error) return <ErrorState />;\n\n return (\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-accent\">\n <div\n ref={scrollContainerRef}\n className=\"flex min-h-0 w-full flex-1 justify-center overflow-auto overscroll-contain p-6 pb-24\"\n onPointerDownCapture={(e) => {\n const el = e.target as HTMLElement | null;\n if (!el?.closest) return;\n if (el.closest(\"[data-annotation-box]\")) return;\n if (el.closest(\".konvajs-content\")) return;\n if (\n el.closest(\n \".moveable-control-box, .moveable-line, .moveable-control, .moveable-area, .moveable-padding\",\n )\n ) {\n return;\n }\n onClearSelection();\n }}\n >\n <Document\n file={url}\n onLoadSuccess={onLoadSuccess}\n onLoadError={onLoadError}\n loading={<LoadingState />}\n options={options}\n >\n {numPages > 0 && (\n <PdfTemplatePageRow\n pageNumber={displayPage}\n scale={scale}\n pageWidthAtScale1={pageWidthAtScale1}\n pageHeightAtScale1={pageHeightAtScale1}\n annotations={annotations}\n annotationAssetUrls={annotationAssetUrls}\n selectedId={selectedId}\n shapeDrawTool={shapeDrawTool}\n createShapeLabel={createShapeLabel}\n onSelect={onSelect}\n onClearSelection={onClearSelection}\n onChangeText={onChangeTextAnnotation}\n onChangeShape={onChangeShapeAnnotation}\n onShapeDrawToolChange={onShapeDrawToolChange}\n onPageViewportAtScaleOne={onPageViewportAtScaleOne}\n />\n )}\n </Document>\n </div>\n </div>\n );\n};\n\nexport { PdfTemplateViewerContent };\n"],"mappings":";;;;;;;AAMA,IAAM,KAA4B,EAChC,QACA,eACA,UACA,sBACA,uBACA,gBACA,wBACA,eACA,kBACA,qBACA,aACA,qBACA,2BACA,4BACA,0BACA,0BACA,uBACA,kCACW;CACX,IAAM,CAAC,GAAU,KAAe,EAAS,EAAE,EACrC,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAU,SACP;EACL,SAAS,gCAAgC,EAAM,QAAQ;EACvD,YAAY;EACZ,qBAAqB,gCAAgC,EAAM,QAAQ;EACpE,GACD,EAAE,CACH,EAEK,IAAgB,GACnB,EAAE,UAAU,QAA8B;AAGzC,EAFA,EAAY,EAAE,EACd,EAAS,KAAK,EACd,IAAwB,EAAE;IAE5B,CAAC,EAAsB,CACxB,EAEK,IAAc,GAAa,MAAe;AAE9C,EADA,QAAQ,MAAM,EAAI,EAClB,EAAS,mCAAmC;IAC3C,EAAE,CAAC;AAON,QAFI,IAAc,kBAAC,GAAD,EAAc,CAAA,GAG9B,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;GACV,uBAAuB,MAAM;IAC3B,IAAM,IAAK,EAAE;AACR,OAAI,YACL,EAAG,QAAQ,wBAAwB,IACnC,EAAG,QAAQ,mBAAmB,IAEhC,EAAG,QACD,8FACD,IAIH,GAAkB;;aAGpB,kBAAC,GAAD;IACE,MAAM;IACS;IACF;IACb,SAAS,kBAAC,GAAD,EAAgB,CAAA;IAChB;cAER,IAAW,KACV,kBAAC,GAAD;KACE,YAjCV,IAAW,IAAI,KAAK,IAAI,KAAK,IAAI,GAAG,EAAW,EAAE,EAAS,GAAG;KAkC5C;KACY;KACC;KACP;KACQ;KACT;KACG;KACG;KACR;KACQ;KAClB,cAAc;KACd,eAAe;KACQ;KACG;KAC1B,CAAA;IAEK,CAAA;GACP,CAAA;EACF,CAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../../../src/components/file_view/components/template_viewer/components/pdf_template_viewer/components/pdf_template_viewer_content/index.tsx"],"sourcesContent":["import type { Props } from \"../../types\";\nimport { useMemo, useState, useCallback } from \"react\";\nimport { Document, pdfjs } from \"react-pdf\";\nimport \"../../../../../../utilities/setup_pdf_worker\";\nimport { PdfTemplatePageRow } from \"../../../pdf_template_page_row\";\nimport { LoadingState, ErrorState } from \"../../../../../pdf_viewer/components\";\n\nconst PdfTemplateViewerContent = ({\n url,\n pageNumber,\n scale,\n pageWidthAtScale1,\n pageHeightAtScale1,\n annotations,\n annotationAssetUrls,\n selectedId,\n shapeDrawTool,\n createShapeLabel,\n onSelect,\n onClearSelection,\n onChangeTextAnnotation,\n onChangeShapeAnnotation,\n onShapeDrawToolChange,\n onDocumentPagesLoaded,\n scrollContainerRef,\n onPageViewportAtScaleOne,\n}: Props) => {\n const [numPages, setNumPages] = useState(0);\n const [error, setError] = useState<string | null>(null);\n\n const options = useMemo(\n () => ({\n cMapUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/cmaps/`,\n cMapPacked: true,\n standardFontDataUrl: `https://unpkg.com/pdfjs-dist@${pdfjs.version}/standard_fonts/`,\n }),\n [],\n );\n\n const onLoadSuccess = useCallback(\n ({ numPages: n }: { numPages: number }) => {\n setNumPages(n);\n setError(null);\n onDocumentPagesLoaded?.(n);\n },\n [onDocumentPagesLoaded],\n );\n\n const onLoadError = useCallback((err: Error) => {\n console.error(err);\n setError(\"Error al cargar el documento PDF\");\n }, []);\n\n const displayPage =\n numPages > 0 ? Math.min(Math.max(1, pageNumber), numPages) : 1;\n\n if (error) return <ErrorState />;\n\n return (\n <div className=\"flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-accent\">\n <div\n ref={scrollContainerRef}\n className=\"flex min-h-0 w-full flex-1 justify-center overflow-auto overscroll-contain p-6 pb-24\"\n onPointerDownCapture={(e) => {\n const el = e.target as HTMLElement | null;\n if (!el?.closest) return;\n if (el.closest(\"[data-annotation-box]\")) return;\n if (el.closest(\".konvajs-content\")) return;\n if (\n el.closest(\n \".moveable-control-box, .moveable-line, .moveable-control, .moveable-area, .moveable-padding\",\n )\n ) {\n return;\n }\n onClearSelection();\n }}\n >\n <Document\n file={url}\n onLoadSuccess={onLoadSuccess}\n onLoadError={onLoadError}\n loading={<LoadingState />}\n options={options}\n >\n {numPages > 0 && (\n <PdfTemplatePageRow\n pageNumber={displayPage}\n scale={scale}\n pageWidthAtScale1={pageWidthAtScale1}\n pageHeightAtScale1={pageHeightAtScale1}\n annotations={annotations}\n annotationAssetUrls={annotationAssetUrls}\n selectedId={selectedId}\n shapeDrawTool={shapeDrawTool}\n createShapeLabel={createShapeLabel}\n onSelect={onSelect}\n onClearSelection={onClearSelection}\n onChangeText={onChangeTextAnnotation}\n onChangeShape={onChangeShapeAnnotation}\n onShapeDrawToolChange={onShapeDrawToolChange}\n onPageViewportAtScaleOne={onPageViewportAtScaleOne}\n />\n )}\n </Document>\n </div>\n </div>\n );\n};\n\nexport { PdfTemplateViewerContent };\n"],"mappings":";;;;;;;AAOA,IAAM,KAA4B,EAChC,QACA,eACA,UACA,sBACA,uBACA,gBACA,wBACA,eACA,kBACA,qBACA,aACA,qBACA,2BACA,4BACA,0BACA,0BACA,uBACA,kCACW;CACX,IAAM,CAAC,GAAU,KAAe,EAAS,EAAE,EACrC,CAAC,GAAO,KAAY,EAAwB,KAAK,EAEjD,IAAU,SACP;EACL,SAAS,gCAAgC,EAAM,QAAQ;EACvD,YAAY;EACZ,qBAAqB,gCAAgC,EAAM,QAAQ;EACpE,GACD,EAAE,CACH,EAEK,IAAgB,GACnB,EAAE,UAAU,QAA8B;AAGzC,EAFA,EAAY,EAAE,EACd,EAAS,KAAK,EACd,IAAwB,EAAE;IAE5B,CAAC,EAAsB,CACxB,EAEK,IAAc,GAAa,MAAe;AAE9C,EADA,QAAQ,MAAM,EAAI,EAClB,EAAS,mCAAmC;IAC3C,EAAE,CAAC;AAON,QAFI,IAAc,kBAAC,GAAD,EAAc,CAAA,GAG9B,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,OAAD;GACE,KAAK;GACL,WAAU;GACV,uBAAuB,MAAM;IAC3B,IAAM,IAAK,EAAE;AACR,OAAI,YACL,EAAG,QAAQ,wBAAwB,IACnC,EAAG,QAAQ,mBAAmB,IAEhC,EAAG,QACD,8FACD,IAIH,GAAkB;;aAGpB,kBAAC,GAAD;IACE,MAAM;IACS;IACF;IACb,SAAS,kBAAC,GAAD,EAAgB,CAAA;IAChB;cAER,IAAW,KACV,kBAAC,GAAD;KACE,YAjCV,IAAW,IAAI,KAAK,IAAI,KAAK,IAAI,GAAG,EAAW,EAAE,EAAS,GAAG;KAkC5C;KACY;KACC;KACP;KACQ;KACT;KACG;KACG;KACR;KACQ;KAClB,cAAc;KACd,eAAe;KACQ;KACG;KAC1B,CAAA;IAEK,CAAA;GACP,CAAA;EACF,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Button as e } from "../../../button/index.js";
2
2
  import { StatusMessage as t } from "../../../status_message/index.js";
3
- import { Skeleton as n } from "../../../skeleton/index.js";
3
+ import { FileViewLoadingState as n } from "../loading_state/index.js";
4
4
  import { splitTranscriptionPages as r } from "../../utilities/transcription_pages.js";
5
5
  import { useMemo as i } from "react";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
@@ -8,10 +8,7 @@ import { Copy as s, FileText as c, Loader2 as l } from "lucide-react";
8
8
  //#region src/components/file_view/components/transcription_viewer/index.tsx
9
9
  var u = ({ content: u, isLoading: d = !1, isProcessing: f = !1, isFetching: p = !1, isError: m = !1, onCopy: h }) => {
10
10
  let g = i(() => r(u ?? ""), [u]);
11
- if (d) return /* @__PURE__ */ a("div", {
12
- className: "p-4 max-w-2xl mx-auto",
13
- children: /* @__PURE__ */ a(n, { className: "w-full h-96" })
14
- });
11
+ if (d) return /* @__PURE__ */ a(n, {});
15
12
  if (f) return /* @__PURE__ */ o("div", {
16
13
  className: "p-4 h-full flex flex-col items-center justify-center gap-3",
17
14
  children: [/* @__PURE__ */ a(l, { className: "size-8 animate-spin text-muted-foreground" }), /* @__PURE__ */ o("p", {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/transcription_viewer/index.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Copy, FileText, Loader2 } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { splitTranscriptionPages } from \"../../utilities/transcription_pages\";\n\nexport interface FileTranscriptionViewerProps {\n content?: string | null;\n isLoading?: boolean;\n isProcessing?: boolean;\n isFetching?: boolean;\n isError?: boolean;\n onCopy?: () => void;\n}\n\nexport const FileTranscriptionViewer = ({\n content,\n isLoading = false,\n isProcessing = false,\n isFetching = false,\n isError = false,\n onCopy,\n}: FileTranscriptionViewerProps) => {\n const pages = useMemo(\n () => splitTranscriptionPages(content ?? \"\"),\n [content],\n );\n\n if (isLoading) {\n return (\n <div className=\"p-4 max-w-2xl mx-auto\">\n <Skeleton className=\"w-full h-96\" />\n </div>\n );\n }\n\n if (isProcessing) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-3\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground text-center\">\n Procesando transcripción\n {isFetching ? \"...\" : \". Actualizando automáticamente...\"}\n </p>\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"p-4 h-full\">\n <StatusMessage\n title=\"Transcripción no disponible\"\n description=\"Este archivo aún no tiene una transcripción o sucedió un error al cargarla.\"\n icon={FileText}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n // Los documentos sin paginación real (audio, Word, imágenes) llegan como una\n // sola página: en ese caso no se muestra la numeración.\n const isPaginated = pages.length > 1;\n\n return (\n <div className=\"flex flex-col h-full bg-background overflow-hidden\">\n <div className=\"flex justify-between items-center px-6 py-4 border-b bg-muted/30\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-sm font-medium text-muted-foreground uppercase tracking-tight\">\n TRANSCRIPCIÓN\n </span>\n {isPaginated ? (\n <span className=\"text-sm text-muted-foreground\">\n {pages.length} páginas\n </span>\n ) : null}\n </div>\n {onCopy ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onCopy}\n className=\"h-8 gap-2\"\n >\n <Copy className=\"size-3.5\" />\n Copiar\n </Button>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-auto p-8\">\n <div className=\"mx-auto flex max-w-2xl flex-col gap-6\">\n {pages.map((page, index) => (\n <article\n key={index}\n className=\"overflow-hidden rounded-lg border bg-card shadow-sm\"\n >\n {isPaginated ? (\n <header className=\"flex items-center justify-between border-b bg-muted/20 px-6 py-2\">\n <span className=\"text-sm text-muted-foreground\">\n Página {index + 1} de {pages.length}\n </span>\n </header>\n ) : null}\n {page.trim().length > 0 ? (\n <pre className=\"whitespace-pre-wrap break-words px-6 py-5 font-sans text-sm leading-relaxed text-foreground\">\n {page}\n </pre>\n ) : (\n <p className=\"px-6 py-5 text-sm text-muted-foreground italic\">\n Esta página no contiene texto.\n </p>\n )}\n </article>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAgBA,IAAa,KAA2B,EACtC,YACA,eAAY,IACZ,kBAAe,IACf,gBAAa,IACb,aAAU,IACV,gBACkC;CAClC,IAAM,IAAQ,QACN,EAAwB,KAAW,GAAG,EAC5C,CAAC,EAAQ,CACV;AAED,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAU,WAAU,eAAgB,CAAA;EAChC,CAAA;AAIV,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAS,WAAU,6CAA8C,CAAA,EACjE,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAyD,4BAEtD,IAAa,QAAQ,oCACpB;KACA;;AAIV,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA;CAMV,IAAM,IAAc,EAAM,SAAS;AAEnC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAqE;KAE9E,CAAA,EACN,IACC,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACG,EAAM,QAAO,WACT;SACL,KACA;OACL,IACC,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,SAAS;IACT,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAM,WAAU,YAAa,CAAA,EAAA,SAEtB;QACP,KACA;MACN,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAM,KAAK,GAAM,MAChB,kBAAC,WAAD;KAEE,WAAU;eAFZ,CAIG,IACC,kBAAC,UAAD;MAAQ,WAAU;gBAChB,kBAAC,QAAD;OAAM,WAAU;iBAAhB;QAAgD;QACtC,IAAQ;QAAE;QAAK,EAAM;QACxB;;MACA,CAAA,GACP,MACH,EAAK,MAAM,CAAC,SAAS,IACpB,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA,GAEN,kBAAC,KAAD;MAAG,WAAU;gBAAiD;MAE1D,CAAA,CAEE;OAnBH,EAmBG,CACV;IACE,CAAA;GACF,CAAA,CACF"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/transcription_viewer/index.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Copy, FileText, Loader2 } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { splitTranscriptionPages } from \"../../utilities/transcription_pages\";\nimport { FileViewLoadingState } from \"../loading_state\";\n\nexport interface FileTranscriptionViewerProps {\n content?: string | null;\n isLoading?: boolean;\n isProcessing?: boolean;\n isFetching?: boolean;\n isError?: boolean;\n onCopy?: () => void;\n}\n\nexport const FileTranscriptionViewer = ({\n content,\n isLoading = false,\n isProcessing = false,\n isFetching = false,\n isError = false,\n onCopy,\n}: FileTranscriptionViewerProps) => {\n const pages = useMemo(\n () => splitTranscriptionPages(content ?? \"\"),\n [content],\n );\n\n if (isLoading) {\n return <FileViewLoadingState />;\n }\n\n if (isProcessing) {\n return (\n <div className=\"p-4 h-full flex flex-col items-center justify-center gap-3\">\n <Loader2 className=\"size-8 animate-spin text-muted-foreground\" />\n <p className=\"text-sm text-muted-foreground text-center\">\n Procesando transcripción\n {isFetching ? \"...\" : \". Actualizando automáticamente...\"}\n </p>\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"p-4 h-full\">\n <StatusMessage\n title=\"Transcripción no disponible\"\n description=\"Este archivo aún no tiene una transcripción o sucedió un error al cargarla.\"\n icon={FileText}\n classNameCard=\"w-full h-full flex-col items-center justify-center\"\n classNameIconCard=\"mx-auto\"\n classNameDescription=\"text-center w-full max-w-sm\"\n classNameTitle=\"text-center w-full\"\n color=\"white\"\n />\n </div>\n );\n }\n\n // Los documentos sin paginación real (audio, Word, imágenes) llegan como una\n // sola página: en ese caso no se muestra la numeración.\n const isPaginated = pages.length > 1;\n\n return (\n <div className=\"flex flex-col h-full bg-background overflow-hidden\">\n <div className=\"flex justify-between items-center px-6 py-4 border-b bg-muted/30\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"text-sm font-medium text-muted-foreground uppercase tracking-tight\">\n TRANSCRIPCIÓN\n </span>\n {isPaginated ? (\n <span className=\"text-sm text-muted-foreground\">\n {pages.length} páginas\n </span>\n ) : null}\n </div>\n {onCopy ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onCopy}\n className=\"h-8 gap-2\"\n >\n <Copy className=\"size-3.5\" />\n Copiar\n </Button>\n ) : null}\n </div>\n <div className=\"flex-1 overflow-auto p-8\">\n <div className=\"mx-auto flex max-w-2xl flex-col gap-6\">\n {pages.map((page, index) => (\n <article\n key={index}\n className=\"overflow-hidden rounded-lg border bg-card shadow-sm\"\n >\n {isPaginated ? (\n <header className=\"flex items-center justify-between border-b bg-muted/20 px-6 py-2\">\n <span className=\"text-sm text-muted-foreground\">\n Página {index + 1} de {pages.length}\n </span>\n </header>\n ) : null}\n {page.trim().length > 0 ? (\n <pre className=\"whitespace-pre-wrap break-words px-6 py-5 font-sans text-sm leading-relaxed text-foreground\">\n {page}\n </pre>\n ) : (\n <p className=\"px-6 py-5 text-sm text-muted-foreground italic\">\n Esta página no contiene texto.\n </p>\n )}\n </article>\n ))}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAgBA,IAAa,KAA2B,EACtC,YACA,eAAY,IACZ,kBAAe,IACf,gBAAa,IACb,aAAU,IACV,gBACkC;CAClC,IAAM,IAAQ,QACN,EAAwB,KAAW,GAAG,EAC5C,CAAC,EAAQ,CACV;AAED,KAAI,EACF,QAAO,kBAAC,GAAD,EAAwB,CAAA;AAGjC,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD,EAAS,WAAU,6CAA8C,CAAA,EACjE,kBAAC,KAAD;GAAG,WAAU;aAAb,CAAyD,4BAEtD,IAAa,QAAQ,oCACpB;KACA;;AAIV,KAAI,EACF,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GACE,OAAM;GACN,aAAY;GACZ,MAAM;GACN,eAAc;GACd,mBAAkB;GAClB,sBAAqB;GACrB,gBAAe;GACf,OAAM;GACN,CAAA;EACE,CAAA;CAMV,IAAM,IAAc,EAAM,SAAS;AAEnC,QACE,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eAAqE;KAE9E,CAAA,EACN,IACC,kBAAC,QAAD;KAAM,WAAU;eAAhB,CACG,EAAM,QAAO,WACT;SACL,KACA;OACL,IACC,kBAAC,GAAD;IACE,SAAQ;IACR,MAAK;IACL,SAAS;IACT,WAAU;cAJZ,CAME,kBAAC,GAAD,EAAM,WAAU,YAAa,CAAA,EAAA,SAEtB;QACP,KACA;MACN,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,OAAD;IAAK,WAAU;cACZ,EAAM,KAAK,GAAM,MAChB,kBAAC,WAAD;KAEE,WAAU;eAFZ,CAIG,IACC,kBAAC,UAAD;MAAQ,WAAU;gBAChB,kBAAC,QAAD;OAAM,WAAU;iBAAhB;QAAgD;QACtC,IAAQ;QAAE;QAAK,EAAM;QACxB;;MACA,CAAA,GACP,MACH,EAAK,MAAM,CAAC,SAAS,IACpB,kBAAC,OAAD;MAAK,WAAU;gBACZ;MACG,CAAA,GAEN,kBAAC,KAAD;MAAG,WAAU;gBAAiD;MAE1D,CAAA,CAEE;OAnBH,EAmBG,CACV;IACE,CAAA;GACF,CAAA,CACF"}
@@ -1,13 +1,10 @@
1
1
  import { Button as e } from "../../../button/index.js";
2
2
  import { StatusMessage as t } from "../../../status_message/index.js";
3
- import { Skeleton as n } from "../../../skeleton/index.js";
3
+ import { FileViewLoadingState as n } from "../loading_state/index.js";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { Download as a, FileX as o } from "lucide-react";
6
6
  //#region src/components/file_view/components/unknown_viewer/index.tsx
7
- var s = ({ fileName: s, isPending: c = !1, isError: l = !1, onDownload: u }) => c ? /* @__PURE__ */ r("div", {
8
- className: "p-6 w-full h-full",
9
- children: /* @__PURE__ */ r(n, { className: "w-full h-full rounded-md" })
10
- }) : l ? /* @__PURE__ */ r("div", {
7
+ var s = ({ fileName: s, isPending: c = !1, isError: l = !1, onDownload: u }) => c ? /* @__PURE__ */ r(n, {}) : l ? /* @__PURE__ */ r("div", {
11
8
  className: "p-6",
12
9
  children: /* @__PURE__ */ r(t, {
13
10
  title: "Sucedio un error inesperado",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/unknown_viewer/index.tsx"],"sourcesContent":["import { Download, FileX } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { Skeleton } from \"@/components/skeleton\";\nimport { StatusMessage } from \"@/components/status_message\";\n\nexport interface FileUnknownViewerProps {\n fileName: string;\n isPending?: boolean;\n isError?: boolean;\n onDownload?: () => void;\n}\n\nexport const FileUnknownViewer = ({\n fileName,\n isPending = false,\n isError = false,\n onDownload,\n}: FileUnknownViewerProps) => {\n if (isPending) {\n return (\n <div className=\"p-6 w-full h-full\">\n <Skeleton className=\"w-full h-full rounded-md\" />\n </div>\n );\n }\n\n if (isError) {\n return (\n <div className=\"p-6\">\n <StatusMessage\n title=\"Sucedio un error inesperado\"\n description=\"Vuelve a intentarlo dentro de unos minutos, si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 mx-auto max-w-md text-center\">\n <div className=\"p-4 rounded-md bg-status-card-background-icon-empty text-foreground\">\n <FileX className=\"size-6\" />\n </div>\n <div className=\"mt-6\">\n <h2 className=\"text-base font-normal text-foreground text-center\">\n Vista previa no disponible para este tipo de archivo\n </h2>\n <p className=\"text-sm text-secondary-foreground mt-2\">\n No se puede previsualizar el archivo &quot;{fileName}&quot;. Por\n favor, descargue el archivo para verlo en su dispositivo.\n </p>\n </div>\n {onDownload ? (\n <Button className=\"mt-6\" size=\"sm\" onClick={onDownload}>\n <Download className=\"size-4\" />\n <p>Descargar archivo</p>\n </Button>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;AAYA,IAAa,KAAqB,EAChC,aACA,eAAY,IACZ,aAAU,IACV,oBAEI,IAEA,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD,EAAU,WAAU,4BAA6B,CAAA;CAC7C,CAAA,GAIN,IAEA,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;EACZ,MAAM;EACN,CAAA;CACE,CAAA,GAKR,kBAAC,OAAD;CAAK,WAAU;WAAf;EACE,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;GACxB,CAAA;EACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,MAAD;IAAI,WAAU;cAAoD;IAE7D,CAAA,EACL,kBAAC,KAAD;IAAG,WAAU;cAAb;KAAsD;KACR;KAAS;KAEnD;MACA;;EACL,IACC,kBAAC,GAAD;GAAQ,WAAU;GAAO,MAAK;GAAK,SAAS;aAA5C,CACE,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA,EAC/B,kBAAC,KAAD,EAAA,UAAG,qBAAqB,CAAA,CACjB;OACP;EACA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../src/components/file_view/components/unknown_viewer/index.tsx"],"sourcesContent":["import { Download, FileX } from \"lucide-react\";\nimport { Button } from \"@/components/button\";\nimport { StatusMessage } from \"@/components/status_message\";\nimport { FileViewLoadingState } from \"../loading_state\";\n\nexport interface FileUnknownViewerProps {\n fileName: string;\n isPending?: boolean;\n isError?: boolean;\n onDownload?: () => void;\n}\n\nexport const FileUnknownViewer = ({\n fileName,\n isPending = false,\n isError = false,\n onDownload,\n}: FileUnknownViewerProps) => {\n if (isPending) {\n return <FileViewLoadingState />;\n }\n\n if (isError) {\n return (\n <div className=\"p-6\">\n <StatusMessage\n title=\"Sucedio un error inesperado\"\n description=\"Vuelve a intentarlo dentro de unos minutos, si el error persiste, contacta con soporte.\"\n icon={FileX}\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col items-center justify-center h-full p-4 mx-auto max-w-md text-center\">\n <div className=\"p-4 rounded-md bg-status-card-background-icon-empty text-foreground\">\n <FileX className=\"size-6\" />\n </div>\n <div className=\"mt-6\">\n <h2 className=\"text-base font-normal text-foreground text-center\">\n Vista previa no disponible para este tipo de archivo\n </h2>\n <p className=\"text-sm text-secondary-foreground mt-2\">\n No se puede previsualizar el archivo &quot;{fileName}&quot;. Por\n favor, descargue el archivo para verlo en su dispositivo.\n </p>\n </div>\n {onDownload ? (\n <Button className=\"mt-6\" size=\"sm\" onClick={onDownload}>\n <Download className=\"size-4\" />\n <p>Descargar archivo</p>\n </Button>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;AAYA,IAAa,KAAqB,EAChC,aACA,eAAY,IACZ,aAAU,IACV,oBAEI,IACK,kBAAC,GAAD,EAAwB,CAAA,GAG7B,IAEA,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD;EACE,OAAM;EACN,aAAY;EACZ,MAAM;EACN,CAAA;CACE,CAAA,GAKR,kBAAC,OAAD;CAAK,WAAU;WAAf;EACE,kBAAC,OAAD;GAAK,WAAU;aACb,kBAAC,GAAD,EAAO,WAAU,UAAW,CAAA;GACxB,CAAA;EACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,MAAD;IAAI,WAAU;cAAoD;IAE7D,CAAA,EACL,kBAAC,KAAD;IAAG,WAAU;cAAb;KAAsD;KACR;KAAS;KAEnD;MACA;;EACL,IACC,kBAAC,GAAD;GAAQ,WAAU;GAAO,MAAK;GAAK,SAAS;aAA5C,CACE,kBAAC,GAAD,EAAU,WAAU,UAAW,CAAA,EAC/B,kBAAC,KAAD,EAAA,UAAG,qBAAqB,CAAA,CACjB;OACP;EACA"}
@@ -1 +1 @@
1
- export declare const LoadingState: () => import("react/jsx-runtime").JSX.Element;
1
+ export { FileViewLoadingState as LoadingState } from '../../../loading_state';
@@ -2,7 +2,7 @@ import { cn as e } from "../../../../../../utilities/class/index.js";
2
2
  import { ScrollArea as t, ScrollBar as n } from "../../../../../scroll_area/index.js";
3
3
  import { StatusMessage as r } from "../../../../../status_message/index.js";
4
4
  import { Tabs as i, TabsList as a, TabsTrigger as o } from "../../../../../tabs/index.js";
5
- import { LoadingState as s } from "../loading_state/index.js";
5
+ import { FileViewLoadingState as s } from "../../../loading_state/index.js";
6
6
  import { useEffect as c, useState as l } from "react";
7
7
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
8
  import { FileX as f, TableProperties as p } from "lucide-react";
@@ -1,2 +1 @@
1
- declare const LoadingState: () => import("react/jsx-runtime").JSX.Element;
2
- export { LoadingState };
1
+ export { FileViewLoadingState as LoadingState } from '../../../loading_state';
@@ -0,0 +1 @@
1
+ export declare function setupPdfWorker(): void;
package/dist/file-view.js CHANGED
@@ -6,47 +6,45 @@ import { ErrorBoundary as i } from "./components/file_view/components/pdf_viewer
6
6
  import { FilePdfViewer as a } from "./components/file_view/components/pdf_viewer/index.js";
7
7
  import { Toolbar as o } from "./components/file_view/components/image_viewer/components/toolbar/index.js";
8
8
  import { ErrorState as s } from "./components/file_view/components/image_viewer/components/error_state/index.js";
9
- import { LoadingState as c } from "./components/file_view/components/image_viewer/components/loading_state/index.js";
10
- import { useHeicConversion as l } from "./components/file_view/components/image_viewer/hooks/use_heic_conversion/index.js";
11
- import { useImageLoadingState as u } from "./components/file_view/components/image_viewer/hooks/use_image_loading_state/index.js";
12
- import { useImageTransforms as d } from "./components/file_view/components/image_viewer/hooks/use_image_transforms/index.js";
13
- import { useImageDrag as f } from "./components/file_view/components/image_viewer/hooks/use_image_drag/index.js";
14
- import { useContainerSize as p } from "./components/file_view/components/image_viewer/hooks/use_container_size/index.js";
15
- import { useFileImageViewer as m } from "./components/file_view/components/image_viewer/hooks/use_file_image_viewer/index.js";
16
- import { FileImageViewer as h } from "./components/file_view/components/image_viewer/index.js";
17
- import { LoadingState as g } from "./components/file_view/components/video_player/components/loading_state/index.js";
18
- import { ErrorState as _ } from "./components/file_view/components/video_player/components/error_state/index.js";
19
- import { useVideoPlayer as v } from "./components/file_view/components/video_player/hooks/use_video_player/index.js";
20
- import { FileVideoPlayer as y } from "./components/file_view/components/video_player/index.js";
21
- import { FileAudioPlayer as b } from "./components/file_view/components/audio_player/index.js";
22
- import { getSourceLanguageFromFile as x } from "./components/file_view/utilities/get_source_language_from_file.js";
23
- import { FileSourceViewer as S } from "./components/file_view/components/source_viewer/index.js";
24
- import { FileEditViewer as C } from "./components/file_view/components/edit_viewer/index.js";
25
- import { FILE_VIEW_SHEET_TAB as w } from "./components/file_view/types/file_view_sheet.js";
26
- import { FileViewSheet as T } from "./components/file_view/components/file_view_sheet/index.js";
27
- import { FileViewUnsavedChangesDialog as E } from "./components/file_view/components/file_view_sheet/unsaved_changes_dialog.js";
28
- import { TEMPLATE_ANNOTATION_TYPES as D, isEllipseAnnotation as O, isImageAnnotation as k, isLineAnnotation as A, isRectAnnotation as j, isTextAnnotation as ee } from "./components/file_view/types/annotations.js";
29
- import { DOCX_MIME as M, normalizeMimeBase as N, resolveTemplateFileKind as P } from "./components/file_view/components/template_viewer/utilities/file/template_file_kind.js";
30
- import { FileTemplateViewerContent as F } from "./components/file_view/components/template_viewer/components/file_template_viewer_content/index.js";
31
- import { FileTemplateViewer as I } from "./components/file_view/components/template_viewer/index.js";
32
- import { FILE_VIEW_KIND as L, OFFICE_MIME_TYPES as R, resolveFileViewKind as z, resolveOfficeFileExtension as B } from "./components/file_view/utilities/resolve_file_view_kind.js";
33
- import { FileMimeRouter as V } from "./components/file_view/components/mime_router/index.js";
34
- import { TRANSCRIPTION_PAGE_BREAK as H, splitTranscriptionPages as U, toPlainTranscription as W } from "./components/file_view/utilities/transcription_pages.js";
35
- import { FileTranscriptionViewer as G } from "./components/file_view/components/transcription_viewer/index.js";
36
- import { summaryMarkdownToHtml as K } from "./components/file_view/utilities/summary_markdown.js";
37
- import { FileSummaryViewer as q } from "./components/file_view/components/summary_viewer/index.js";
38
- import { FileUnknownViewer as J } from "./components/file_view/components/unknown_viewer/index.js";
39
- import { FileOfficeViewerToolbar as Y } from "./components/file_view/components/office_viewer/components/toolbar/index.js";
40
- import { FileOfficeViewer as X } from "./components/file_view/components/office_viewer/index.js";
41
- import { FileDocumentExportDialog as Z } from "./components/file_view/components/document_viewer/export_dialog/index.js";
42
- import { FilePreviewAssistantProvider as Q } from "./components/file_view/context/provider.js";
43
- import { useFilePreviewAssistantContext as $ } from "./components/file_view/context/hooks.js";
44
- import { FileBlobOfficeUnavailable as te } from "./components/file_view/components/blob_office_unavailable/index.js";
45
- import { FileDocxPreviewViewer as ne } from "./components/file_view/components/docx_preview_viewer/index.js";
46
- import { FileSourceFileViewer as re } from "./components/file_view/components/file_source_file_viewer/index.js";
47
- import { FileXlsxPreviewViewer as ie } from "./components/file_view/components/xlsx_preview_viewer/index.js";
48
- import { FileSimplePreviewRender as ae } from "./components/file_view/components/file_simple_preview_render/index.js";
49
- import { FileSimplePreviewSheet as oe } from "./components/file_view/components/file_simple_preview_sheet/index.js";
50
- import { FileUrlPreviewRender as se } from "./components/file_view/components/file_url_preview_render/index.js";
51
- import { FileUrlPreviewSheet as ce } from "./components/file_view/components/file_url_preview_sheet/index.js";
52
- export { M as DOCX_MIME, L as FILE_VIEW_KIND, w as FILE_VIEW_SHEET_TAB, b as FileAudioPlayer, te as FileBlobOfficeUnavailable, Z as FileDocumentExportDialog, ne as FileDocxPreviewViewer, C as FileEditViewer, h as FileImageViewer, V as FileMimeRouter, X as FileOfficeViewer, Y as FileOfficeViewerToolbar, a as FilePdfViewer, Q as FilePreviewAssistantProvider, ae as FileSimplePreviewRender, oe as FileSimplePreviewSheet, re as FileSourceFileViewer, S as FileSourceViewer, q as FileSummaryViewer, I as FileTemplateViewer, I as TemplateViewer, F as FileTemplateViewerContent, G as FileTranscriptionViewer, J as FileUnknownViewer, se as FileUrlPreviewRender, ce as FileUrlPreviewSheet, y as FileVideoPlayer, t as FileViewErrorState, e as FileViewLoadingState, T as FileViewSheet, E as FileViewUnsavedChangesDialog, ie as FileXlsxPreviewViewer, s as ImageViewerErrorState, c as ImageViewerLoadingState, o as ImageViewerToolbar, R as OFFICE_MIME_TYPES, e as PdfContentLoadingState, r as PdfViewerContent, i as PdfViewerErrorBoundary, t as PdfViewerErrorState, e as PdfViewerLoadingState, n as PdfViewerToolbar, D as TEMPLATE_ANNOTATION_TYPES, H as TRANSCRIPTION_PAGE_BREAK, _ as VideoPlayerErrorState, g as VideoPlayerLoadingState, x as getSourceLanguageFromFile, O as isEllipseAnnotation, k as isImageAnnotation, A as isLineAnnotation, j as isRectAnnotation, ee as isTextAnnotation, N as normalizeMimeBase, z as resolveFileViewKind, B as resolveOfficeFileExtension, P as resolveTemplateFileKind, U as splitTranscriptionPages, K as summaryMarkdownToHtml, W as toPlainTranscription, p as useContainerSize, m as useFileImageViewer, $ as useFilePreviewAssistantContext, l as useHeicConversion, f as useImageDrag, u as useImageLoadingState, d as useImageTransforms, v as useVideoPlayer };
9
+ import { useHeicConversion as c } from "./components/file_view/components/image_viewer/hooks/use_heic_conversion/index.js";
10
+ import { useImageLoadingState as l } from "./components/file_view/components/image_viewer/hooks/use_image_loading_state/index.js";
11
+ import { useImageTransforms as u } from "./components/file_view/components/image_viewer/hooks/use_image_transforms/index.js";
12
+ import { useImageDrag as d } from "./components/file_view/components/image_viewer/hooks/use_image_drag/index.js";
13
+ import { useContainerSize as f } from "./components/file_view/components/image_viewer/hooks/use_container_size/index.js";
14
+ import { useFileImageViewer as p } from "./components/file_view/components/image_viewer/hooks/use_file_image_viewer/index.js";
15
+ import { FileImageViewer as m } from "./components/file_view/components/image_viewer/index.js";
16
+ import { ErrorState as h } from "./components/file_view/components/video_player/components/error_state/index.js";
17
+ import { useVideoPlayer as g } from "./components/file_view/components/video_player/hooks/use_video_player/index.js";
18
+ import { FileVideoPlayer as _ } from "./components/file_view/components/video_player/index.js";
19
+ import { FileAudioPlayer as v } from "./components/file_view/components/audio_player/index.js";
20
+ import { getSourceLanguageFromFile as y } from "./components/file_view/utilities/get_source_language_from_file.js";
21
+ import { FileSourceViewer as b } from "./components/file_view/components/source_viewer/index.js";
22
+ import { FileEditViewer as x } from "./components/file_view/components/edit_viewer/index.js";
23
+ import { FILE_VIEW_SHEET_TAB as S } from "./components/file_view/types/file_view_sheet.js";
24
+ import { FileViewSheet as C } from "./components/file_view/components/file_view_sheet/index.js";
25
+ import { FileViewUnsavedChangesDialog as w } from "./components/file_view/components/file_view_sheet/unsaved_changes_dialog.js";
26
+ import { TEMPLATE_ANNOTATION_TYPES as T, isEllipseAnnotation as E, isImageAnnotation as D, isLineAnnotation as O, isRectAnnotation as k, isTextAnnotation as A } from "./components/file_view/types/annotations.js";
27
+ import { DOCX_MIME as j, normalizeMimeBase as ee, resolveTemplateFileKind as M } from "./components/file_view/components/template_viewer/utilities/file/template_file_kind.js";
28
+ import { FileTemplateViewerContent as N } from "./components/file_view/components/template_viewer/components/file_template_viewer_content/index.js";
29
+ import { FileTemplateViewer as P } from "./components/file_view/components/template_viewer/index.js";
30
+ import { FILE_VIEW_KIND as F, OFFICE_MIME_TYPES as I, resolveFileViewKind as L, resolveOfficeFileExtension as R } from "./components/file_view/utilities/resolve_file_view_kind.js";
31
+ import { FileMimeRouter as z } from "./components/file_view/components/mime_router/index.js";
32
+ import { TRANSCRIPTION_PAGE_BREAK as B, splitTranscriptionPages as V, toPlainTranscription as H } from "./components/file_view/utilities/transcription_pages.js";
33
+ import { FileTranscriptionViewer as U } from "./components/file_view/components/transcription_viewer/index.js";
34
+ import { summaryMarkdownToHtml as W } from "./components/file_view/utilities/summary_markdown.js";
35
+ import { FileSummaryViewer as G } from "./components/file_view/components/summary_viewer/index.js";
36
+ import { FileUnknownViewer as K } from "./components/file_view/components/unknown_viewer/index.js";
37
+ import { FileOfficeViewerToolbar as q } from "./components/file_view/components/office_viewer/components/toolbar/index.js";
38
+ import { FileOfficeViewer as J } from "./components/file_view/components/office_viewer/index.js";
39
+ import { FileDocumentExportDialog as Y } from "./components/file_view/components/document_viewer/export_dialog/index.js";
40
+ import { FilePreviewAssistantProvider as X } from "./components/file_view/context/provider.js";
41
+ import { useFilePreviewAssistantContext as Z } from "./components/file_view/context/hooks.js";
42
+ import { FileBlobOfficeUnavailable as Q } from "./components/file_view/components/blob_office_unavailable/index.js";
43
+ import { FileDocxPreviewViewer as $ } from "./components/file_view/components/docx_preview_viewer/index.js";
44
+ import { FileSourceFileViewer as te } from "./components/file_view/components/file_source_file_viewer/index.js";
45
+ import { FileXlsxPreviewViewer as ne } from "./components/file_view/components/xlsx_preview_viewer/index.js";
46
+ import { FileSimplePreviewRender as re } from "./components/file_view/components/file_simple_preview_render/index.js";
47
+ import { FileSimplePreviewSheet as ie } from "./components/file_view/components/file_simple_preview_sheet/index.js";
48
+ import { FileUrlPreviewRender as ae } from "./components/file_view/components/file_url_preview_render/index.js";
49
+ import { FileUrlPreviewSheet as oe } from "./components/file_view/components/file_url_preview_sheet/index.js";
50
+ export { j as DOCX_MIME, F as FILE_VIEW_KIND, S as FILE_VIEW_SHEET_TAB, v as FileAudioPlayer, Q as FileBlobOfficeUnavailable, Y as FileDocumentExportDialog, $ as FileDocxPreviewViewer, x as FileEditViewer, m as FileImageViewer, z as FileMimeRouter, J as FileOfficeViewer, q as FileOfficeViewerToolbar, a as FilePdfViewer, X as FilePreviewAssistantProvider, re as FileSimplePreviewRender, ie as FileSimplePreviewSheet, te as FileSourceFileViewer, b as FileSourceViewer, G as FileSummaryViewer, P as FileTemplateViewer, P as TemplateViewer, N as FileTemplateViewerContent, U as FileTranscriptionViewer, K as FileUnknownViewer, ae as FileUrlPreviewRender, oe as FileUrlPreviewSheet, _ as FileVideoPlayer, t as FileViewErrorState, e as FileViewLoadingState, C as FileViewSheet, w as FileViewUnsavedChangesDialog, ne as FileXlsxPreviewViewer, s as ImageViewerErrorState, e as ImageViewerLoadingState, o as ImageViewerToolbar, I as OFFICE_MIME_TYPES, e as PdfContentLoadingState, r as PdfViewerContent, i as PdfViewerErrorBoundary, t as PdfViewerErrorState, e as PdfViewerLoadingState, n as PdfViewerToolbar, T as TEMPLATE_ANNOTATION_TYPES, B as TRANSCRIPTION_PAGE_BREAK, h as VideoPlayerErrorState, e as VideoPlayerLoadingState, y as getSourceLanguageFromFile, E as isEllipseAnnotation, D as isImageAnnotation, O as isLineAnnotation, k as isRectAnnotation, A as isTextAnnotation, ee as normalizeMimeBase, L as resolveFileViewKind, R as resolveOfficeFileExtension, M as resolveTemplateFileKind, V as splitTranscriptionPages, W as summaryMarkdownToHtml, H as toPlainTranscription, f as useContainerSize, p as useFileImageViewer, Z as useFilePreviewAssistantContext, c as useHeicConversion, d as useImageDrag, l as useImageLoadingState, u as useImageTransforms, g as useVideoPlayer };
package/dist/styles.css CHANGED
@@ -1038,6 +1038,42 @@
1038
1038
  background-color: transparent !important;
1039
1039
  }
1040
1040
 
1041
+ /* Office Online paints a brand strip inside a cross-origin iframe
1042
+ (Word blue, Excel green, PowerPoint orange) on the top and sides.
1043
+ Parent CSS cannot style that paint; clip the iframe instead.
1044
+ Bottom stays aligned so the page toolbar remains usable. */
1045
+ #msdoc-renderer {
1046
+ --office-embed-chrome: 10px;
1047
+ position: relative !important;
1048
+ height: 100% !important;
1049
+ overflow: hidden !important;
1050
+ border: none !important;
1051
+ outline: none !important;
1052
+ }
1053
+
1054
+ #proxy-renderer {
1055
+ height: 100% !important;
1056
+ overflow: hidden !important;
1057
+ border: none !important;
1058
+ outline: none !important;
1059
+ }
1060
+
1061
+ #msdoc-iframe {
1062
+ display: block;
1063
+ width: calc(100% + (var(--office-embed-chrome) * 2)) !important;
1064
+ height: calc(100% + var(--office-embed-chrome)) !important;
1065
+ margin: calc(var(--office-embed-chrome) * -1) 0 0
1066
+ calc(var(--office-embed-chrome) * -1) !important;
1067
+ border: none !important;
1068
+ outline: none !important;
1069
+ }
1070
+
1071
+ #proxy-renderer iframe,
1072
+ #react-doc-viewer {
1073
+ border: none !important;
1074
+ outline: none !important;
1075
+ }
1076
+
1041
1077
  /* react-colorful (color picker) overrides */
1042
1078
  .arx-color-picker .react-colorful__pointer {
1043
1079
  width: 14px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arxatec-ui",
3
- "version": "0.1.65",
3
+ "version": "0.1.66",
4
4
  "description": "React component library for building Arxatec product UIs—built on established ecosystem libraries for a consistent, efficient workflow. More at https://arxatec.net.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,9 +0,0 @@
1
- import { cn as e } from "../../../../../../utilities/class/index.js";
2
- import { Skeleton as t } from "../../../../../skeleton/index.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- //#region src/components/file_view/components/image_viewer/components/loading_state/index.tsx
5
- var r = ({ className: r }) => /* @__PURE__ */ n(t, { className: e("w-full h-full", r) });
6
- //#endregion
7
- export { r as LoadingState };
8
-
9
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/image_viewer/components/loading_state/index.tsx"],"sourcesContent":["import { Skeleton } from \"@/components/skeleton\";\nimport { cn } from \"@/utilities/class\";\n\ninterface Props {\n className?: string;\n}\nexport const LoadingState = ({ className }: Props) => {\n return <Skeleton className={cn(\"w-full h-full\", className)} />;\n};\n"],"mappings":";;;;AAMA,IAAa,KAAgB,EAAE,mBACtB,kBAAC,GAAD,EAAU,WAAW,EAAG,iBAAiB,EAAU,EAAI,CAAA"}
@@ -1,11 +0,0 @@
1
- import { Skeleton as e } from "../../../../../skeleton/index.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- //#region src/components/file_view/components/video_player/components/loading_state/index.tsx
4
- var n = () => /* @__PURE__ */ t("div", {
5
- className: "p-4 h-full w-full",
6
- children: /* @__PURE__ */ t(e, { className: "w-full h-full" })
7
- });
8
- //#endregion
9
- export { n as LoadingState };
10
-
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/video_player/components/loading_state/index.tsx"],"sourcesContent":["import { Skeleton } from \"@/components/skeleton\";\n\nexport const LoadingState = () => {\n return (\n <div className=\"p-4 h-full w-full\">\n <Skeleton className=\"w-full h-full\" />\n </div>\n );\n};\n"],"mappings":";;;AAEA,IAAa,UAET,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD,EAAU,WAAU,iBAAkB,CAAA;CAClC,CAAA"}
@@ -1,11 +0,0 @@
1
- import { Skeleton as e } from "../../../../../skeleton/index.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- //#region src/components/file_view/components/xlsx_preview_viewer/components/loading_state/index.tsx
4
- var n = () => /* @__PURE__ */ t("div", {
5
- className: "p-4 h-full w-full",
6
- children: /* @__PURE__ */ t(e, { className: "w-full h-full" })
7
- });
8
- //#endregion
9
- export { n as LoadingState };
10
-
11
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../../../../../src/components/file_view/components/xlsx_preview_viewer/components/loading_state/index.tsx"],"sourcesContent":["import { Skeleton } from \"@/components/skeleton\";\n\nconst LoadingState = () => (\n <div className=\"p-4 h-full w-full\">\n <Skeleton className=\"w-full h-full\" />\n </div>\n);\n\nexport { LoadingState };\n"],"mappings":";;;AAEA,IAAM,UACJ,kBAAC,OAAD;CAAK,WAAU;WACb,kBAAC,GAAD,EAAU,WAAU,iBAAkB,CAAA;CAClC,CAAA"}