@osdk/react-components 0.2.0-beta.25 → 0.2.0-beta.26

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 (107) hide show
  1. package/AGENTS.md +1 -0
  2. package/CHANGELOG.md +21 -0
  3. package/build/browser/action-form/ActionForm.js +15 -11
  4. package/build/browser/action-form/ActionForm.js.map +1 -1
  5. package/build/browser/action-form/FormFieldApi.js.map +1 -1
  6. package/build/browser/action-form/fields/CustomField.js +30 -0
  7. package/build/browser/action-form/fields/CustomField.js.map +1 -0
  8. package/build/browser/action-form/fields/FormFieldRenderer.js +13 -21
  9. package/build/browser/action-form/fields/FormFieldRenderer.js.map +1 -1
  10. package/build/browser/action-form/fields/RadioButtonsField.js +1 -1
  11. package/build/browser/action-form/fields/RadioButtonsField.js.map +1 -1
  12. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  13. package/build/browser/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  14. package/build/browser/base-components/dialog/Dialog.js +4 -2
  15. package/build/browser/base-components/dialog/Dialog.js.map +1 -1
  16. package/build/browser/object-table/ObjectTableApi.js.map +1 -1
  17. package/build/browser/object-table/hooks/useFunctionColumnsData.js +57 -192
  18. package/build/browser/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  19. package/build/browser/pdf-viewer/PdfViewer.js +10 -5
  20. package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
  21. package/build/browser/pdf-viewer/PdfViewerContext.js +108 -0
  22. package/build/browser/pdf-viewer/PdfViewerContext.js.map +1 -0
  23. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js +26 -11
  24. package/build/browser/pdf-viewer/hooks/usePdfFormFields.js.map +1 -1
  25. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js +29 -1
  26. package/build/browser/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -1
  27. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  28. package/build/browser/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  29. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  30. package/build/browser/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  31. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  32. package/build/browser/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  33. package/build/browser/pdf-viewer/types.js.map +1 -1
  34. package/build/browser/public/experimental.js +2 -0
  35. package/build/browser/public/experimental.js.map +1 -1
  36. package/build/cjs/{chunk-GT6IV6LV.cjs → chunk-MRRRZN44.cjs} +6 -4
  37. package/build/cjs/chunk-MRRRZN44.cjs.map +1 -0
  38. package/build/cjs/public/experimental.cjs +1384 -1343
  39. package/build/cjs/public/experimental.cjs.map +1 -1
  40. package/build/cjs/public/experimental.d.cts +115 -8
  41. package/build/cjs/public/primitives.cjs +5 -5
  42. package/build/cjs/public/primitives.d.cts +3 -2
  43. package/build/esm/action-form/ActionForm.js +15 -11
  44. package/build/esm/action-form/ActionForm.js.map +1 -1
  45. package/build/esm/action-form/FormFieldApi.js.map +1 -1
  46. package/build/esm/action-form/fields/CustomField.js +30 -0
  47. package/build/esm/action-form/fields/CustomField.js.map +1 -0
  48. package/build/esm/action-form/fields/FormFieldRenderer.js +13 -21
  49. package/build/esm/action-form/fields/FormFieldRenderer.js.map +1 -1
  50. package/build/esm/action-form/fields/RadioButtonsField.js +1 -1
  51. package/build/esm/action-form/fields/RadioButtonsField.js.map +1 -1
  52. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js +97 -10
  53. package/build/esm/action-form/utils/getDefaultFieldDefinitions.js.map +1 -1
  54. package/build/esm/base-components/dialog/Dialog.js +4 -2
  55. package/build/esm/base-components/dialog/Dialog.js.map +1 -1
  56. package/build/esm/object-table/ObjectTableApi.js.map +1 -1
  57. package/build/esm/object-table/hooks/useFunctionColumnsData.js +57 -192
  58. package/build/esm/object-table/hooks/useFunctionColumnsData.js.map +1 -1
  59. package/build/esm/pdf-viewer/PdfViewer.js +10 -5
  60. package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
  61. package/build/esm/pdf-viewer/PdfViewerContext.js +108 -0
  62. package/build/esm/pdf-viewer/PdfViewerContext.js.map +1 -0
  63. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js +26 -11
  64. package/build/esm/pdf-viewer/hooks/usePdfFormFields.js.map +1 -1
  65. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js +29 -1
  66. package/build/esm/pdf-viewer/hooks/usePdfHighlightMode.js.map +1 -1
  67. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js +3 -3
  68. package/build/esm/pdf-viewer/hooks/usePdfViewerCore.js.map +1 -1
  69. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js +3 -3
  70. package/build/esm/pdf-viewer/hooks/usePdfViewerSearch.js.map +1 -1
  71. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js +3 -3
  72. package/build/esm/pdf-viewer/hooks/usePdfViewerState.js.map +1 -1
  73. package/build/esm/pdf-viewer/types.js.map +1 -1
  74. package/build/esm/public/experimental.js +2 -0
  75. package/build/esm/public/experimental.js.map +1 -1
  76. package/build/types/action-form/FormFieldApi.d.ts +3 -3
  77. package/build/types/action-form/FormFieldApi.d.ts.map +1 -1
  78. package/build/types/action-form/fields/CustomField.d.ts +9 -0
  79. package/build/types/action-form/fields/CustomField.d.ts.map +1 -0
  80. package/build/types/action-form/fields/FormFieldRenderer.d.ts.map +1 -1
  81. package/build/types/action-form/fields/RadioButtonsField.d.ts +2 -2
  82. package/build/types/action-form/fields/RadioButtonsField.d.ts.map +1 -1
  83. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts +7 -4
  84. package/build/types/action-form/utils/getDefaultFieldDefinitions.d.ts.map +1 -1
  85. package/build/types/base-components/dialog/Dialog.d.ts +3 -2
  86. package/build/types/base-components/dialog/Dialog.d.ts.map +1 -1
  87. package/build/types/object-table/ObjectTableApi.d.ts +4 -3
  88. package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
  89. package/build/types/object-table/hooks/useFunctionColumnsData.d.ts.map +1 -1
  90. package/build/types/pdf-viewer/PdfViewer.d.ts +2 -2
  91. package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
  92. package/build/types/pdf-viewer/PdfViewerContext.d.ts +64 -0
  93. package/build/types/pdf-viewer/PdfViewerContext.d.ts.map +1 -0
  94. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts +1 -0
  95. package/build/types/pdf-viewer/hooks/usePdfHighlightMode.d.ts.map +1 -1
  96. package/build/types/pdf-viewer/types.d.ts +47 -0
  97. package/build/types/pdf-viewer/types.d.ts.map +1 -1
  98. package/build/types/public/experimental.d.ts +2 -0
  99. package/build/types/public/experimental.d.ts.map +1 -1
  100. package/package.json +6 -6
  101. package/build/browser/action-form/utils/getDefaultFieldComponent.js +0 -56
  102. package/build/browser/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  103. package/build/cjs/chunk-GT6IV6LV.cjs.map +0 -1
  104. package/build/esm/action-form/utils/getDefaultFieldComponent.js +0 -56
  105. package/build/esm/action-form/utils/getDefaultFieldComponent.js.map +0 -1
  106. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts +0 -6
  107. package/build/types/action-form/utils/getDefaultFieldComponent.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"usePdfViewerState.js","names":["useCallback","useEffect","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","usePdfOutline","usePdfViewerCore","usePdfViewerSearch","usePdfViewerState","src","initialPage","initialScale","initialSidebarOpen","sidebarMode","sidebarModeProp","onDownload","core","rotation","setRotation","sidebarOpen","setSidebarOpen","setSidebarMode","search","eventBusRef","findControllerRef","document","outlineItems","pdfViewer","pdfViewerRef","current","pagesRotation","handleKeyDown","e","ctrlKey","metaKey","key","preventDefault","openSearch","window","addEventListener","removeEventListener","zoomIn","setScale","Math","min","scale","zoomOut","max","rotateLeft","prev","rotateRight","toggleSidebar","download","filename","getData","then","data","blob","Blob","buffer","type","url","URL","createObjectURL","resolvedFilename","resolveDownloadFilename","a","globalThis","createElement","href","click","revokeObjectURL","success","catch","err","error","Error","split","pop"],"sources":["usePdfViewerState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"../constants.js\";\nimport type { PdfDownloadResult, SidebarMode } from \"../types.js\";\nimport { usePdfOutline } from \"./usePdfOutline.js\";\nimport type {\n UsePdfViewerCoreOptions,\n UsePdfViewerCoreResult,\n} from \"./usePdfViewerCore.js\";\nimport { usePdfViewerCore } from \"./usePdfViewerCore.js\";\nimport type { UsePdfViewerSearchResult } from \"./usePdfViewerSearch.js\";\nimport { usePdfViewerSearch } from \"./usePdfViewerSearch.js\";\n\nexport interface UsePdfViewerStateOptions extends UsePdfViewerCoreOptions {\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Which sidebar panel to show (default \"thumbnails\") */\n sidebarMode?: SidebarMode;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n}\n\nexport interface UsePdfViewerStateResult extends UsePdfViewerCoreResult {\n /** Zoom in by one step */\n zoomIn: () => void;\n /** Zoom out by one step */\n zoomOut: () => void;\n\n /** Current rotation in degrees (0, 90, 180, 270) */\n rotation: number;\n /** Rotate 90 degrees counter-clockwise */\n rotateLeft: () => void;\n /** Rotate 90 degrees clockwise */\n rotateRight: () => void;\n\n /** Whether the sidebar panel is open */\n sidebarOpen: boolean;\n /** Which sidebar panel is active */\n sidebarMode: SidebarMode;\n /** Change the active sidebar panel */\n setSidebarMode: (mode: SidebarMode) => void;\n /** Toggle sidebar open/closed */\n toggleSidebar: () => void;\n\n /** Search state and actions */\n search: UsePdfViewerSearchResult;\n\n /** Document outline items (from bookmarks or text extraction) */\n outlineItems: ReturnType<typeof usePdfOutline>;\n\n /** Download the PDF as a file */\n download: (filename?: string) => void;\n}\n\nexport function usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialSidebarOpen = false,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n onDownload,\n}: UsePdfViewerStateOptions): UsePdfViewerStateResult {\n const core = usePdfViewerCore({ src, initialPage, initialScale });\n\n const [rotation, setRotation] = useState(0);\n const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);\n const [sidebarMode, setSidebarMode] = useState<SidebarMode>(sidebarModeProp);\n\n const search = usePdfViewerSearch(\n core.eventBusRef,\n core.findControllerRef,\n core.document,\n );\n\n const outlineItems = usePdfOutline(core.document);\n\n // Sync sidebarMode prop changes to state\n useEffect(function syncSidebarMode() {\n setSidebarMode(sidebarModeProp);\n }, [sidebarModeProp]);\n\n // Sync rotation → PDFViewer\n useEffect(function syncRotationToViewer() {\n const pdfViewer = core.pdfViewerRef.current;\n if (pdfViewer != null) {\n pdfViewer.pagesRotation = rotation;\n }\n }, [core.pdfViewerRef, rotation]);\n\n // Ctrl+F keyboard shortcut\n useEffect(function registerSearchShortcut() {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.ctrlKey || e.metaKey) && e.key === \"f\") {\n e.preventDefault();\n search.openSearch();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [search.openSearch]);\n\n const zoomIn = useCallback(() => {\n core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));\n }, [core.scale, core.setScale]);\n\n const zoomOut = useCallback(() => {\n core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));\n }, [core.scale, core.setScale]);\n\n const rotateLeft = useCallback(() => {\n setRotation((prev) => (prev - 90 + 360) % 360);\n }, []);\n\n const rotateRight = useCallback(() => {\n setRotation((prev) => (prev + 90) % 360);\n }, []);\n\n const toggleSidebar = useCallback(() => {\n setSidebarOpen((prev) => !prev);\n }, []);\n\n const download = useCallback((filename?: string) => {\n if (core.document == null) {\n return;\n }\n void core.document.getData().then((data) => {\n const blob = new Blob([data.buffer as ArrayBuffer], {\n type: \"application/pdf\",\n });\n const url = URL.createObjectURL(blob);\n const resolvedFilename = resolveDownloadFilename(src, filename);\n const a = globalThis.document.createElement(\"a\");\n a.href = url;\n a.download = resolvedFilename;\n a.click();\n URL.revokeObjectURL(url);\n onDownload?.({ success: true, filename: resolvedFilename });\n }).catch((err: unknown) => {\n onDownload?.({\n success: false,\n error: err instanceof Error\n ? err\n : new Error(\"Failed to download PDF\"),\n });\n });\n }, [core.document, src, onDownload]);\n\n return {\n ...core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n };\n}\n\n/** Derive a download filename from an explicit name, the src URL, or a fallback. */\nfunction resolveDownloadFilename(\n src: string | ArrayBuffer,\n filename: string | undefined,\n): string {\n if (filename != null) {\n return filename;\n }\n if (typeof src === \"string\") {\n return src.split(\"/\").pop()?.split(\"?\")[0] || \"document.pdf\";\n }\n return \"document.pdf\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,iBAAiB;AAElE,SAASC,aAAa,QAAQ,oBAAoB;AAKlD,S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;IACR+B,UAAU;IACVE,WAAW;IACX/B,WAAW;IACXN,WAAW;IACXQ,cAAc;IACd8B,aAAa;IACb7B,MAAM;IACNI,YAAY;IACZ0B;EACF,CAAC;AACH;;AAEA;AACA,SAASa,uBAAuBA,CAC9BxD,GAAyB,EACzB4C,QAA4B,EACpB;EACR,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAOA,QAAQ;EACjB;EACA,IAAI,OAAO5C,GAAG,KAAK,QAAQ,EAAE;IAC3B,OAAOA,GAAG,CAACoE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,EAAED,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc;EAC9D;EACA,OAAO,cAAc;AACvB","ignoreList":[]}
1
+ {"version":3,"file":"usePdfViewerState.js","names":["useCallback","useEffect","useMemo","useState","MAX_SCALE","MIN_SCALE","SCALE_STEP","usePdfOutline","usePdfViewerCore","usePdfViewerSearch","usePdfViewerState","src","initialPage","initialScale","initialSidebarOpen","sidebarMode","sidebarModeProp","onDownload","core","rotation","setRotation","sidebarOpen","setSidebarOpen","setSidebarMode","search","eventBusRef","findControllerRef","document","outlineItems","pdfViewer","pdfViewerRef","current","pagesRotation","handleKeyDown","e","ctrlKey","metaKey","key","preventDefault","openSearch","window","addEventListener","removeEventListener","zoomIn","setScale","Math","min","scale","zoomOut","max","rotateLeft","prev","rotateRight","toggleSidebar","download","filename","getData","then","data","blob","Blob","buffer","type","url","URL","createObjectURL","resolvedFilename","resolveDownloadFilename","a","globalThis","createElement","href","click","revokeObjectURL","success","catch","err","error","Error","split","pop"],"sources":["usePdfViewerState.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useCallback, useEffect, useMemo, useState } from \"react\";\nimport { MAX_SCALE, MIN_SCALE, SCALE_STEP } from \"../constants.js\";\nimport type { PdfDownloadResult, SidebarMode } from \"../types.js\";\nimport { usePdfOutline } from \"./usePdfOutline.js\";\nimport type {\n UsePdfViewerCoreOptions,\n UsePdfViewerCoreResult,\n} from \"./usePdfViewerCore.js\";\nimport { usePdfViewerCore } from \"./usePdfViewerCore.js\";\nimport type { UsePdfViewerSearchResult } from \"./usePdfViewerSearch.js\";\nimport { usePdfViewerSearch } from \"./usePdfViewerSearch.js\";\n\nexport interface UsePdfViewerStateOptions extends UsePdfViewerCoreOptions {\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Which sidebar panel to show (default \"thumbnails\") */\n sidebarMode?: SidebarMode;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n}\n\nexport interface UsePdfViewerStateResult extends UsePdfViewerCoreResult {\n /** Zoom in by one step */\n zoomIn: () => void;\n /** Zoom out by one step */\n zoomOut: () => void;\n\n /** Current rotation in degrees (0, 90, 180, 270) */\n rotation: number;\n /** Rotate 90 degrees counter-clockwise */\n rotateLeft: () => void;\n /** Rotate 90 degrees clockwise */\n rotateRight: () => void;\n\n /** Whether the sidebar panel is open */\n sidebarOpen: boolean;\n /** Which sidebar panel is active */\n sidebarMode: SidebarMode;\n /** Change the active sidebar panel */\n setSidebarMode: (mode: SidebarMode) => void;\n /** Toggle sidebar open/closed */\n toggleSidebar: () => void;\n\n /** Search state and actions */\n search: UsePdfViewerSearchResult;\n\n /** Document outline items (from bookmarks or text extraction) */\n outlineItems: ReturnType<typeof usePdfOutline>;\n\n /** Download the PDF as a file */\n download: (filename?: string) => void;\n}\n\nexport function usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialSidebarOpen = false,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n onDownload,\n}: UsePdfViewerStateOptions): UsePdfViewerStateResult {\n const core = usePdfViewerCore({ src, initialPage, initialScale });\n\n const [rotation, setRotation] = useState(0);\n const [sidebarOpen, setSidebarOpen] = useState(initialSidebarOpen);\n const [sidebarMode, setSidebarMode] = useState<SidebarMode>(sidebarModeProp);\n\n const search = usePdfViewerSearch(\n core.eventBusRef,\n core.findControllerRef,\n core.document,\n );\n\n const outlineItems = usePdfOutline(core.document);\n\n // Sync sidebarMode prop changes to state\n useEffect(function syncSidebarMode() {\n setSidebarMode(sidebarModeProp);\n }, [sidebarModeProp]);\n\n // Sync rotation → PDFViewer\n useEffect(function syncRotationToViewer() {\n const pdfViewer = core.pdfViewerRef.current;\n if (pdfViewer != null) {\n pdfViewer.pagesRotation = rotation;\n }\n }, [core.pdfViewerRef, rotation]);\n\n // Ctrl+F keyboard shortcut\n useEffect(function registerSearchShortcut() {\n const handleKeyDown = (e: KeyboardEvent) => {\n if ((e.ctrlKey || e.metaKey) && e.key === \"f\") {\n e.preventDefault();\n search.openSearch();\n }\n };\n window.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n window.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [search.openSearch]);\n\n const zoomIn = useCallback(() => {\n core.setScale(Math.min(core.scale + SCALE_STEP, MAX_SCALE));\n }, [core.scale, core.setScale]);\n\n const zoomOut = useCallback(() => {\n core.setScale(Math.max(core.scale - SCALE_STEP, MIN_SCALE));\n }, [core.scale, core.setScale]);\n\n const rotateLeft = useCallback(() => {\n setRotation((prev) => (prev - 90 + 360) % 360);\n }, []);\n\n const rotateRight = useCallback(() => {\n setRotation((prev) => (prev + 90) % 360);\n }, []);\n\n const toggleSidebar = useCallback(() => {\n setSidebarOpen((prev) => !prev);\n }, []);\n\n const download = useCallback((filename?: string) => {\n if (core.document == null) {\n return;\n }\n void core.document.getData().then((data) => {\n const blob = new Blob([data.buffer as ArrayBuffer], {\n type: \"application/pdf\",\n });\n const url = URL.createObjectURL(blob);\n const resolvedFilename = resolveDownloadFilename(src, filename);\n const a = globalThis.document.createElement(\"a\");\n a.href = url;\n a.download = resolvedFilename;\n a.click();\n URL.revokeObjectURL(url);\n onDownload?.({ success: true, filename: resolvedFilename });\n }).catch((err: unknown) => {\n onDownload?.({\n success: false,\n error: err instanceof Error\n ? err\n : new Error(\"Failed to download PDF\"),\n });\n });\n }, [core.document, src, onDownload]);\n\n return useMemo((): UsePdfViewerStateResult => ({\n ...core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n }), [\n core,\n zoomIn,\n zoomOut,\n rotation,\n rotateLeft,\n rotateRight,\n sidebarOpen,\n sidebarMode,\n setSidebarMode,\n toggleSidebar,\n search,\n outlineItems,\n download,\n ]);\n}\n\n/** Derive a download filename from an explicit name, the src URL, or a fallback. */\nfunction resolveDownloadFilename(\n src: string | ArrayBuffer,\n filename: string | undefined,\n): string {\n if (filename != null) {\n return filename;\n }\n if (typeof src === \"string\") {\n return src.split(\"/\").pop()?.split(\"?\")[0] || \"document.pdf\";\n }\n return \"document.pdf\";\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACjE,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,QAAQ,iBAAiB;AAElE,SAASC,aAAa,QAAQ,oBAAoB;AAKlD,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SAASC,kBAAkB,QAAQ,yBAAyB;AA2C5D,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,GAAG;EACHC,WAAW;EACXC,YAAY;EACZC,kBAAkB,GAAG,KAAK;EAC1BC,WAAW,EAAEC,eAAe,GA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AO,EACP7B,QAAQ,EACR+B,UAAU,EACVE,WAAW,EACX/B,WAAW,EACXN,WAAW,EACXQ,cAAc,EACd8B,aAAa,EACb7B,MAAM,EACNI,YAAY,EACZ0B,QAAQ,CACT,CAAC;AACJ;;AAEA;AACA,SAASa,uBAAuBA,CAC9BxD,GAAyB,EACzB4C,QAA4B,EACpB;EACR,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,OAAOA,QAAQ;EACjB;EACA,IAAI,OAAO5C,GAAG,KAAK,QAAQ,EAAE;IAC3B,OAAOA,GAAG,CAACoE,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC,EAAED,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,cAAc;EAC9D;EACA,OAAO,cAAc;AACvB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type React from \"react\";\n\n/** Which sidebar panel to display when the sidebar is open. */\nexport type SidebarMode = \"thumbnails\" | \"outline\";\n\n/** A single item in the PDF document outline (table of contents). */\nexport interface OutlineItem {\n title: string;\n depth: number;\n pageNumber: number;\n bold: boolean;\n italic: boolean;\n}\n\n/** The visual style of an annotation rendered on the PDF. */\nexport type AnnotationType =\n | \"highlight\"\n | \"underline\"\n | \"comment\"\n | \"pin\"\n | \"custom\";\n\n/** A rectangle in PDF coordinate space (origin: bottom-left of page). */\nexport interface PdfRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** Props passed to a custom annotation renderer. */\nexport interface PdfAnnotationRenderProps {\n annotation: PdfAnnotation;\n scale: number;\n pageHeight: number;\n}\n\n/** Common fields shared by all annotation types. */\ninterface PdfAnnotationBase {\n /** Unique identifier for this annotation */\n id: string;\n /** Page number (1-indexed) */\n page: number;\n /** Coordinates in PDF points (origin: bottom-left of page) */\n rect: PdfRect;\n /** Additional rects for multi-line text highlights. When present, all rects are rendered. */\n rects?: PdfRect[];\n /** Optional label or tooltip text */\n label?: string;\n /** Optional color override (CSS color string) */\n color?: string;\n}\n\n/** A built-in annotation type (highlight, underline, comment, pin). */\ninterface PdfStandardAnnotation extends PdfAnnotationBase {\n /** The type of annotation to render */\n type: \"highlight\" | \"underline\" | \"comment\" | \"pin\";\n}\n\n/** A custom annotation with a user-provided renderer. */\nexport interface PdfCustomAnnotation extends PdfAnnotationBase {\n /** Must be \"custom\" for custom-rendered annotations */\n type: \"custom\";\n /** Render function for the custom annotation content (required for custom type) */\n render: (props: PdfAnnotationRenderProps) => React.ReactNode;\n}\n\n/** A single annotation positioned on a specific page of the PDF. */\nexport type PdfAnnotation = PdfStandardAnnotation | PdfCustomAnnotation;\n\n/** Result passed to the {@link PdfViewerProps.onDownload} callback. */\nexport type PdfDownloadResult =\n | { success: true; filename: string }\n | { success: false; error: Error };\n\n/** Possible values for a PDF form field. */\nexport type PdfFormFieldValue = string | boolean | string[];\n\n/** Data emitted when the user creates a text highlight via the highlight editor. */\nexport interface PdfTextHighlightEvent {\n /** Page number (1-indexed) */\n page: number;\n /** Bounding rects in PDF coordinate space (bottom-left origin) */\n rects: PdfRect[];\n /** The selected text content */\n selectedText: string;\n /** Highlight color as CSS color string */\n color: string;\n}\n\n/** Props for the {@link PdfViewer} component. */\nexport interface PdfViewerProps {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF */\n annotations?: PdfAnnotation[];\n /**\n * Callback fired when an annotation is clicked.\n *\n * @param annotation - The annotation that was clicked\n * @returns void\n */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /**\n * Callback fired when a download completes or fails.\n *\n * @param result - The download result indicating success with the filename, or failure with an error\n * @returns void\n */\n onDownload?: (result: PdfDownloadResult) => void;\n /**\n * Whether the highlight toggle button is shown in the toolbar.\n * @default false\n */\n enableHighlight?: boolean;\n /**\n * Callback fired when the user creates a text highlight.\n * Only fires when highlight mode is active.\n *\n * @param event - The highlight event with page, rects, text, and color\n * @returns void\n */\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n /**\n * Callback fired when the user deletes a highlight via the PDF.js editor UI.\n *\n * @param event - The highlight event that was deleted\n * @returns void\n */\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /**\n * Whether the download button is shown in the toolbar.\n * @default false\n */\n enableDownload?: boolean;\n /**\n * Which sidebar panel to show: thumbnails or document outline.\n * @default \"thumbnails\"\n */\n sidebarMode?: SidebarMode;\n /**\n * Custom icon components for each outline depth level (0-indexed).\n * Key 0 = top-level items, 1 = first nesting level, etc.\n * If omitted, no icons are rendered.\n */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n /**\n * Initial form field values keyed by field name. Applied when the document loads.\n * Use this to pre-populate form fields when resuming a previously edited PDF.\n */\n formData?: Record<string, PdfFormFieldValue>;\n /**\n * Callback fired when the user clicks the save button in the toolbar.\n * Receives all current form field values keyed by field name.\n *\n * @param data - All form field values keyed by field name\n * @returns void\n */\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n /**\n * Callback fired when any form field value changes.\n *\n * @param fieldName - The name of the field that changed\n * @param value - The new value\n * @returns void\n */\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n /** Additional CSS class name for the root element */\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["types.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type React from \"react\";\n\n/** Which sidebar panel to display when the sidebar is open. */\nexport type SidebarMode = \"thumbnails\" | \"outline\";\n\n/** A single item in the PDF document outline (table of contents). */\nexport interface OutlineItem {\n title: string;\n depth: number;\n pageNumber: number;\n bold: boolean;\n italic: boolean;\n}\n\n/** The visual style of an annotation rendered on the PDF. */\nexport type AnnotationType =\n | \"highlight\"\n | \"underline\"\n | \"comment\"\n | \"pin\"\n | \"custom\";\n\n/** A rectangle in PDF coordinate space (origin: bottom-left of page). */\nexport interface PdfRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\n/** Props passed to a custom annotation renderer. */\nexport interface PdfAnnotationRenderProps {\n annotation: PdfAnnotation;\n scale: number;\n pageHeight: number;\n}\n\n/** Common fields shared by all annotation types. */\ninterface PdfAnnotationBase {\n /** Unique identifier for this annotation */\n id: string;\n /** Page number (1-indexed) */\n page: number;\n /** Coordinates in PDF points (origin: bottom-left of page) */\n rect: PdfRect;\n /** Additional rects for multi-line text highlights. When present, all rects are rendered. */\n rects?: PdfRect[];\n /** Optional label or tooltip text */\n label?: string;\n /** Optional color override (CSS color string) */\n color?: string;\n}\n\n/** A built-in annotation type (highlight, underline, comment, pin). */\ninterface PdfStandardAnnotation extends PdfAnnotationBase {\n /** The type of annotation to render */\n type: \"highlight\" | \"underline\" | \"comment\" | \"pin\";\n}\n\n/** A custom annotation with a user-provided renderer. */\nexport interface PdfCustomAnnotation extends PdfAnnotationBase {\n /** Must be \"custom\" for custom-rendered annotations */\n type: \"custom\";\n /** Render function for the custom annotation content (required for custom type) */\n render: (props: PdfAnnotationRenderProps) => React.ReactNode;\n}\n\n/** A single annotation positioned on a specific page of the PDF. */\nexport type PdfAnnotation = PdfStandardAnnotation | PdfCustomAnnotation;\n\n/** Result passed to the {@link PdfViewerProps.onDownload} callback. */\nexport type PdfDownloadResult =\n | { success: true; filename: string }\n | { success: false; error: Error };\n\n/** Possible values for a PDF form field. */\nexport type PdfFormFieldValue = string | boolean | string[];\n\n/** Data emitted when the user creates a text highlight via the highlight editor. */\nexport interface PdfTextHighlightEvent {\n /** Internal PDF.js editor ID. Use with `deleteHighlight` to programmatically remove. */\n editorId: string;\n /** Page number (1-indexed) */\n page: number;\n /** Bounding rects in PDF coordinate space (bottom-left origin) */\n rects: PdfRect[];\n /** The selected text content */\n selectedText: string;\n /** Highlight color as CSS color string */\n color: string;\n}\n\n/** Imperative handle for programmatic control of a {@link PdfViewer} or {@link BasePdfViewer}. */\nexport interface PdfViewerHandle {\n /** Scroll the viewer to the given page number (1-indexed). */\n scrollToPage: (page: number) => void;\n /** Programmatically delete a highlight by its `editorId` (from {@link PdfTextHighlightEvent}). */\n deleteHighlight: (editorId: string) => void;\n}\n\n/**\n * Options for {@link usePdfViewerInstance}.\n * Equivalent to {@link PdfViewerProps} minus the `className` rendering concern.\n */\nexport interface PdfViewerInstanceOptions {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF */\n annotations?: PdfAnnotation[];\n /** Callback fired when an annotation is clicked */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /** Callback fired when a download completes or fails */\n onDownload?: (result: PdfDownloadResult) => void;\n /** Whether the highlight toggle button is shown in the toolbar */\n highlightEnabled?: boolean;\n /** Callback fired when the user creates a text highlight */\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n /** Callback fired when the user deletes a highlight */\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n /** Initial form field values keyed by field name */\n formData?: Record<string, PdfFormFieldValue>;\n /** Callback fired when the user clicks the save button */\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n /** Callback fired when any form field value changes */\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /** Whether the download button is shown in the toolbar */\n enableDownload?: boolean;\n /** Which sidebar panel to show: thumbnails or document outline */\n sidebarMode?: SidebarMode;\n /** Custom icon components for each outline depth level (0-indexed) */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n}\n\n/** Props for the {@link PdfViewer} component. */\nexport interface PdfViewerProps {\n /** PDF source — URL string or ArrayBuffer */\n src: string | ArrayBuffer;\n /** Annotations to overlay on the PDF */\n annotations?: PdfAnnotation[];\n /**\n * Callback fired when an annotation is clicked.\n *\n * @param annotation - The annotation that was clicked\n * @returns void\n */\n onAnnotationClick?: (annotation: PdfAnnotation) => void;\n /**\n * Callback fired when a download completes or fails.\n *\n * @param result - The download result indicating success with the filename, or failure with an error\n * @returns void\n */\n onDownload?: (result: PdfDownloadResult) => void;\n /**\n * Whether the highlight toggle button is shown in the toolbar.\n * @default false\n */\n enableHighlight?: boolean;\n /**\n * Callback fired when the user creates a text highlight.\n * Only fires when highlight mode is active.\n *\n * @param event - The highlight event with page, rects, text, and color\n * @returns void\n */\n onTextHighlight?: (event: PdfTextHighlightEvent) => void;\n /**\n * Callback fired when the user deletes a highlight via the PDF.js editor UI.\n *\n * @param event - The highlight event that was deleted\n * @returns void\n */\n onHighlightDelete?: (event: PdfTextHighlightEvent) => void;\n /** Initial page number (1-indexed, default 1) */\n initialPage?: number;\n /** Initial zoom scale (default 1.0) */\n initialScale?: number;\n /** Whether the sidebar is initially open (default false) */\n initialSidebarOpen?: boolean;\n /**\n * Whether the download button is shown in the toolbar.\n * @default false\n */\n enableDownload?: boolean;\n /**\n * Which sidebar panel to show: thumbnails or document outline.\n * @default \"thumbnails\"\n */\n sidebarMode?: SidebarMode;\n /**\n * Custom icon components for each outline depth level (0-indexed).\n * Key 0 = top-level items, 1 = first nesting level, etc.\n * If omitted, no icons are rendered.\n */\n outlineIcons?: Partial<Record<number, React.ComponentType>>;\n /**\n * Initial form field values keyed by field name. Applied when the document loads.\n * Use this to pre-populate form fields when resuming a previously edited PDF.\n */\n formData?: Record<string, PdfFormFieldValue>;\n /**\n * Callback fired when the user clicks the save button in the toolbar.\n * Receives all current form field values keyed by field name.\n *\n * @param data - All form field values keyed by field name\n * @returns void\n */\n onFormSubmit?: (data: Record<string, PdfFormFieldValue>) => void;\n /**\n * Callback fired when any form field value changes.\n *\n * @param fieldName - The name of the field that changed\n * @param value - The new value\n * @returns void\n */\n onFormChange?: (fieldName: string, value: PdfFormFieldValue) => void;\n /** Additional CSS class name for the root element */\n className?: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -45,6 +45,8 @@ export { usePdfOutline } from "../pdf-viewer/hooks/usePdfOutline.js";
45
45
  export { usePdfViewer } from "../pdf-viewer/hooks/usePdfViewer.js";
46
46
  export { usePdfViewerSearch } from "../pdf-viewer/hooks/usePdfViewerSearch.js";
47
47
  export { usePdfViewerSync } from "../pdf-viewer/hooks/usePdfViewerSync.js";
48
+ // PdfViewer context
49
+ export { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from "../pdf-viewer/PdfViewerContext.js";
48
50
  // PdfViewer hooks — composition
49
51
  export { usePdfViewerCore } from "../pdf-viewer/hooks/usePdfViewerCore.js";
50
52
  export { usePdfViewerState } from "../pdf-viewer/hooks/usePdfViewerState.js";
@@ -1 +1 @@
1
- {"version":3,"file":"experimental.js","names":["BaseFilterList","FilterList","deserializeFilterStates","serializeFilterStates","ObjectTable","BaseTable","ColumnConfigDialog","BasePdfViewer","PdfViewerAnnotationLayer","PdfViewerContent","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","usePdfAnnotationPortals","usePdfAnnotationsByPage","usePdfDocument","usePdfFormFields","usePdfHighlightMode","usePdfOutline","usePdfViewer","usePdfViewerSearch","usePdfViewerSync","usePdfViewerCore","usePdfViewerState","PdfViewer","ActionForm","BaseForm"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaseFilterList } from \"../filter-list/base/BaseFilterList.js\";\nexport type {\n BaseFilterListProps,\n RenderFilterInput,\n} from \"../filter-list/base/BaseFilterListApi.js\";\nexport { FilterList } from \"../filter-list/FilterList.js\";\n\nexport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"../filter-list/FilterListApi.js\";\nexport type {\n FilterComponentType,\n FilterListItemProps,\n FilterState,\n PropertyFilterDefinition,\n} from \"../filter-list/FilterListItemApi.js\";\nexport {\n deserializeFilterStates,\n serializeFilterStates,\n} from \"../filter-list/utils/filterStateSerialization.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n FunctionColumnLocator,\n ObjectTableProps,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n\n// PdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nexport type {\n AnnotationType,\n PdfAnnotation,\n PdfAnnotationRenderProps,\n PdfCustomAnnotation,\n PdfDownloadResult,\n PdfFormFieldValue,\n PdfRect,\n PdfTextHighlightEvent,\n PdfViewerProps,\n SidebarMode,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer building blocks\nexport {\n PdfViewerAnnotationLayer,\n type PdfViewerAnnotationLayerProps,\n} from \"../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport {\n PdfViewerContent,\n type PdfViewerContentProps,\n} from \"../pdf-viewer/components/PdfViewerContent.js\";\nexport {\n PdfViewerOutlineSidebar,\n type PdfViewerOutlineSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport {\n PdfViewerSearchBar,\n type PdfViewerSearchBarProps,\n} from \"../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport {\n PdfViewerSidebar,\n type PdfViewerSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerSidebar.js\";\nexport {\n PdfViewerToolbar,\n type PdfViewerToolbarProps,\n} from \"../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport {\n type AnnotationPortalTarget,\n usePdfAnnotationPortals,\n} from \"../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../pdf-viewer/hooks/usePdfDocument.js\";\nexport {\n usePdfFormFields,\n type UsePdfFormFieldsOptions,\n type UsePdfFormFieldsResult,\n} from \"../pdf-viewer/hooks/usePdfFormFields.js\";\nexport {\n usePdfHighlightMode,\n type UsePdfHighlightModeOptions,\n type UsePdfHighlightModeResult,\n} from \"../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../pdf-viewer/hooks/usePdfOutline.js\";\nexport {\n usePdfViewer,\n type UsePdfViewerResult,\n} from \"../pdf-viewer/hooks/usePdfViewer.js\";\nexport {\n usePdfViewerSearch,\n type UsePdfViewerSearchResult,\n} from \"../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../pdf-viewer/hooks/usePdfViewerSync.js\";\nexport { type OutlineItem } from \"../pdf-viewer/types.js\";\n\n// PdfViewer hooks — composition\nexport {\n usePdfViewerCore,\n type UsePdfViewerCoreOptions,\n type UsePdfViewerCoreResult,\n} from \"../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport {\n usePdfViewerState,\n type UsePdfViewerStateOptions,\n type UsePdfViewerStateResult,\n} from \"../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nexport {\n PdfViewer,\n type PdfViewerMediaProps,\n} from \"../pdf-viewer/PdfRenderer.js\";\n\nexport { ActionForm } from \"../action-form/ActionForm.js\";\nexport type {\n ActionFormProps,\n BaseFormProps,\n FormError,\n FormState,\n} from \"../action-form/ActionFormApi.js\";\nexport { BaseForm } from \"../action-form/BaseForm.js\";\nexport type {\n ActionParameters,\n BaseFormFieldProps,\n CustomFieldProps,\n DatetimePickerFieldProps,\n DropdownFieldProps,\n FieldComponent,\n FieldValueType,\n FilePickerProps,\n FormFieldDefinition,\n FormFieldPropsByType,\n NumberInputFieldProps,\n ObjectSetFieldProps,\n Option,\n RadioButtonsFieldProps,\n RendererFieldDefinition,\n TextAreaFieldProps,\n TextInputFieldProps,\n} from \"../action-form/FormFieldApi.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,uCAAuC;AAKtE,SAASC,UAAU,QAAQ,8BAA8B;AAYzD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,kDAAkD;;AAEzD;AACA,SAASC,WAAW,QAAQ,gCAAgC;;AAY5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC;AAM1E;AACA,SAASC,aAAa,QAAQ,4BAA4B;AAc1D;AACA,SACEC,wBAAwB,QAEnB,sDAAsD;AAC7D,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,uBAAuB,QAElB,qDAAqD;AAC5D,SACEC,kBAAkB,QAEb,gDAAgD;AACvD,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SAEEC,uBAAuB,QAClB,gDAAgD;AACvD,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,mBAAmB,QAGd,4CAA4C;AACnD,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SACEC,YAAY,QAEP,qCAAqC;AAC5C,SACEC,kBAAkB,QAEb,2CAA2C;AAClD,SAASC,gBAAgB,QAAQ,yCAAyC;AAG1E;AACA,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,iBAAiB,QAGZ,0CAA0C;;AAEjD;AACA,SACEC,SAAS,QAEJ,8BAA8B;AAErC,SAASC,UAAU,QAAQ,8BAA8B;AAOzD,SAASC,QAAQ,QAAQ,4BAA4B","ignoreList":[]}
1
+ {"version":3,"file":"experimental.js","names":["BaseFilterList","FilterList","deserializeFilterStates","serializeFilterStates","ObjectTable","BaseTable","ColumnConfigDialog","BasePdfViewer","PdfViewerAnnotationLayer","PdfViewerContent","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","usePdfAnnotationPortals","usePdfAnnotationsByPage","usePdfDocument","usePdfFormFields","usePdfHighlightMode","usePdfOutline","usePdfViewer","usePdfViewerSearch","usePdfViewerSync","PdfViewerProvider","usePdfViewerContext","usePdfViewerInstance","usePdfViewerCore","usePdfViewerState","PdfViewer","ActionForm","BaseForm"],"sources":["experimental.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { BaseFilterList } from \"../filter-list/base/BaseFilterList.js\";\nexport type {\n BaseFilterListProps,\n RenderFilterInput,\n} from \"../filter-list/base/BaseFilterListApi.js\";\nexport { FilterList } from \"../filter-list/FilterList.js\";\n\nexport type {\n FilterDefinitionUnion,\n FilterListProps,\n} from \"../filter-list/FilterListApi.js\";\nexport type {\n FilterComponentType,\n FilterListItemProps,\n FilterState,\n PropertyFilterDefinition,\n} from \"../filter-list/FilterListItemApi.js\";\nexport {\n deserializeFilterStates,\n serializeFilterStates,\n} from \"../filter-list/utils/filterStateSerialization.js\";\n\n// ObjectTable that loads and displays data for a given objectSet\nexport { ObjectTable } from \"../object-table/ObjectTable.js\";\nexport type {\n ColumnDefinition,\n ColumnDefinitionLocator,\n CustomColumnLocator,\n FunctionColumnLocator,\n ObjectTableProps,\n PropertyColumnLocator,\n RdpColumnLocator,\n} from \"../object-table/ObjectTableApi.js\";\nexport type { CellEditInfo } from \"../object-table/utils/types.js\";\n\n// BaseTable that does not handle data fetching\nexport type { BaseTableProps } from \"../object-table/Table.js\";\nexport { BaseTable } from \"../object-table/Table.js\";\n\nexport { ColumnConfigDialog } from \"../object-table/ColumnConfigDialog.js\";\nexport type {\n ColumnConfigDialogProps,\n ColumnConfigOptions,\n} from \"../object-table/ColumnConfigDialog.js\";\n\n// PdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nexport type {\n AnnotationType,\n PdfAnnotation,\n PdfAnnotationRenderProps,\n PdfCustomAnnotation,\n PdfDownloadResult,\n PdfFormFieldValue,\n PdfRect,\n PdfTextHighlightEvent,\n PdfViewerProps,\n SidebarMode,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer building blocks\nexport {\n PdfViewerAnnotationLayer,\n type PdfViewerAnnotationLayerProps,\n} from \"../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport {\n PdfViewerContent,\n type PdfViewerContentProps,\n} from \"../pdf-viewer/components/PdfViewerContent.js\";\nexport {\n PdfViewerOutlineSidebar,\n type PdfViewerOutlineSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport {\n PdfViewerSearchBar,\n type PdfViewerSearchBarProps,\n} from \"../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport {\n PdfViewerSidebar,\n type PdfViewerSidebarProps,\n} from \"../pdf-viewer/components/PdfViewerSidebar.js\";\nexport {\n PdfViewerToolbar,\n type PdfViewerToolbarProps,\n} from \"../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport {\n type AnnotationPortalTarget,\n usePdfAnnotationPortals,\n} from \"../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../pdf-viewer/hooks/usePdfDocument.js\";\nexport {\n usePdfFormFields,\n type UsePdfFormFieldsOptions,\n type UsePdfFormFieldsResult,\n} from \"../pdf-viewer/hooks/usePdfFormFields.js\";\nexport {\n usePdfHighlightMode,\n type UsePdfHighlightModeOptions,\n type UsePdfHighlightModeResult,\n} from \"../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../pdf-viewer/hooks/usePdfOutline.js\";\nexport {\n usePdfViewer,\n type UsePdfViewerResult,\n} from \"../pdf-viewer/hooks/usePdfViewer.js\";\nexport {\n usePdfViewerSearch,\n type UsePdfViewerSearchResult,\n} from \"../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../pdf-viewer/hooks/usePdfViewerSync.js\";\nexport { type OutlineItem } from \"../pdf-viewer/types.js\";\n\n// PdfViewer context\nexport {\n type PdfViewerContextValue,\n PdfViewerProvider,\n usePdfViewerContext,\n usePdfViewerInstance,\n} from \"../pdf-viewer/PdfViewerContext.js\";\nexport type {\n PdfViewerHandle,\n PdfViewerInstanceOptions,\n} from \"../pdf-viewer/types.js\";\n\n// PdfViewer hooks — composition\nexport {\n usePdfViewerCore,\n type UsePdfViewerCoreOptions,\n type UsePdfViewerCoreResult,\n} from \"../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport {\n usePdfViewerState,\n type UsePdfViewerStateOptions,\n type UsePdfViewerStateResult,\n} from \"../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nexport {\n PdfViewer,\n type PdfViewerMediaProps,\n} from \"../pdf-viewer/PdfRenderer.js\";\n\nexport { ActionForm } from \"../action-form/ActionForm.js\";\nexport type {\n ActionFormProps,\n BaseFormProps,\n FormError,\n FormState,\n} from \"../action-form/ActionFormApi.js\";\nexport { BaseForm } from \"../action-form/BaseForm.js\";\nexport type {\n ActionParameters,\n BaseFormFieldProps,\n CustomFieldProps,\n DatetimePickerFieldProps,\n DropdownFieldProps,\n FieldComponent,\n FieldValueType,\n FilePickerProps,\n FormFieldDefinition,\n FormFieldPropsByType,\n NumberInputFieldProps,\n ObjectSetFieldProps,\n Option,\n RadioButtonsFieldProps,\n RendererFieldDefinition,\n TextAreaFieldProps,\n TextInputFieldProps,\n} from \"../action-form/FormFieldApi.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,cAAc,QAAQ,uCAAuC;AAKtE,SAASC,UAAU,QAAQ,8BAA8B;AAYzD,SACEC,uBAAuB,EACvBC,qBAAqB,QAChB,kDAAkD;;AAEzD;AACA,SAASC,WAAW,QAAQ,gCAAgC;;AAY5D;;AAEA,SAASC,SAAS,QAAQ,0BAA0B;AAEpD,SAASC,kBAAkB,QAAQ,uCAAuC;AAM1E;AACA,SAASC,aAAa,QAAQ,4BAA4B;AAc1D;AACA,SACEC,wBAAwB,QAEnB,sDAAsD;AAC7D,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,uBAAuB,QAElB,qDAAqD;AAC5D,SACEC,kBAAkB,QAEb,gDAAgD;AACvD,SACEC,gBAAgB,QAEX,8CAA8C;AACrD,SACEC,gBAAgB,QAEX,8CAA8C;;AAErD;AACA,SAEEC,uBAAuB,QAClB,gDAAgD;AACvD,SAASC,uBAAuB,QAAQ,gDAAgD;AACxF,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,mBAAmB,QAGd,4CAA4C;AACnD,SAASC,aAAa,QAAQ,sCAAsC;AACpE,SACEC,YAAY,QAEP,qCAAqC;AAC5C,SACEC,kBAAkB,QAEb,2CAA2C;AAClD,SAASC,gBAAgB,QAAQ,yCAAyC;AAG1E;AACA,SAEEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,mCAAmC;AAM1C;AACA,SACEC,gBAAgB,QAGX,yCAAyC;AAChD,SACEC,iBAAiB,QAGZ,0CAA0C;;AAEjD;AACA,SACEC,SAAS,QAEJ,8BAA8B;AAErC,SAASC,UAAU,QAAQ,8BAA8B;AAOzD,SAASC,QAAQ,QAAQ,4BAA4B","ignoreList":[]}
@@ -130,11 +130,13 @@ function Dialog({
130
130
  title,
131
131
  children,
132
132
  footer,
133
- className
133
+ className,
134
+ disablePointerDismissal
134
135
  }) {
135
136
  return /* @__PURE__ */ React__default.default.createElement(dialog.Dialog.Root, {
136
137
  open: isOpen,
137
- onOpenChange
138
+ onOpenChange,
139
+ disablePointerDismissal
138
140
  }, /* @__PURE__ */ React__default.default.createElement(dialog.Dialog.Portal, null, /* @__PURE__ */ React__default.default.createElement(dialog.Dialog.Backdrop, {
139
141
  className: Dialog_default.backdrop
140
142
  }), /* @__PURE__ */ React__default.default.createElement(dialog.Dialog.Popup, {
@@ -159,5 +161,5 @@ exports.ActionButton = ActionButton;
159
161
  exports.Dialog = Dialog;
160
162
  exports.Tooltip = Tooltip;
161
163
  exports.TooltipArrow = TooltipArrow;
162
- //# sourceMappingURL=chunk-GT6IV6LV.cjs.map
163
- //# sourceMappingURL=chunk-GT6IV6LV.cjs.map
164
+ //# sourceMappingURL=chunk-MRRRZN44.cjs.map
165
+ //# sourceMappingURL=chunk-MRRRZN44.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/base-components/tooltip/Tooltip.module.css","../../src/base-components/tooltip/Tooltip.tsx","../../src/base-components/action-button/ActionButton.module.css","../../src/base-components/action-button/ActionButton.tsx","../../src/base-components/dialog/Dialog.module.css","../../src/base-components/dialog/Dialog.tsx"],"names":["React","BaseUITooltip","classnames","_extends","Button","classNames","BaseUIDialog","Cross"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAA,eAAA,GAAA,EAAA;;;ACAA,SAAS,QAAW,GAAA;AAAE,EAAO,OAAA,QAAA,GAAW,OAAO,MAAS,GAAA,MAAA,CAAO,OAAO,IAAK,EAAA,GAAI,SAAU,CAAG,EAAA;AAAE,IAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,SAAA,CAAU,QAAQ,CAAK,EAAA,EAAA;AAAE,MAAI,IAAA,CAAA,GAAI,UAAU,CAAC,CAAA;AAAG,MAAA,KAAA,IAAS,CAAK,IAAA,CAAA,EAAI,CAAA,IAAI,cAAe,CAAA,IAAA,CAAK,CAAG,EAAA,CAAC,CAAM,KAAA,CAAA,CAAE,CAAC,CAAA,GAAI,EAAE,CAAC,CAAA,CAAA;AAAA;AAAM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AmBN,sBAAAA,CAAM,aAAc,CAAAM,aAAA,CAAa,QAAU,EAAA;AAAA,IACrH,WAAW,cAAO,CAAA;AAAA,GACnB,CAAgB,kBAAAN,sBAAM,CAAA,aAAA,CAAcM,cAAa,KAAO,EAAA;AAAA,IACvD,SAAWJ,EAAAA,2BAAAA,CAAW,cAAO,CAAA,KAAA,EAAO,SAAS;AAAA,GAC/B,kBAAAF,sBAAM,CAAA,aAAA,CAAc,KAAO,EAAA;AAAA,IACzC,WAAW,cAAO,CAAA;AAAA,GACJ,kBAAAA,sBAAM,CAAA,aAAA,CAAcM,cAAa,KAAO,EAAA;AAAA,IACtD,WAAW,cAAO,CAAA;AAAA,KACjB,KAAK,CAAA,kBAAgBN,sBAAM,CAAA,aAAA,CAAcM,cAAa,KAAO,EAAA;AAAA,IAC9D,WAAW,cAAO,CAAA,WAAA;AAAA,IAClB,YAAc,EAAA;AAAA,GACA,kBAAAN,sBAAM,CAAA,aAAA,CAAcO,WAAO,EAAA;AAAA,IACzC,WAAW,cAAO,CAAA;AAAA,GACnB,CAAC,CAAC,mBAAgBP,sBAAAA,CAAM,cAAc,KAAO,EAAA;AAAA,IAC5C,WAAW,cAAO,CAAA;AAAA,GACpB,EAAG,QAAQ,CAAG,EAAA,MAAA,IAAU,wBAAqBA,sBAAAA,CAAM,cAAc,KAAO,EAAA;AAAA,IACtE,WAAW,cAAO,CAAA;AAAA,GACjB,EAAA,MAAM,CAAC,CAAC,CAAC,CAAA;AACd","file":"chunk-MRRRZN44.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.osdkTooltipTrigger {\n border: none;\n background: inherit;\n}\n\n.osdkTooltipPositioner {\n z-index: var(--osdk-tooltip-z-index);\n}\n\n.osdkTooltipPopup {\n padding: var(--osdk-tooltip-padding);\n background-color: var(--osdk-tooltip-bg);\n border-radius: var(--osdk-surface-border-radius);\n box-shadow: var(--osdk-tooltip-shadow);\n max-width: var(--osdk-tooltip-max-width);\n font-size: var(--osdk-tooltip-font-size);\n}\n\n/* \n * Hardcoded values are copied from base ui example \n * https://base-ui.com/react/components/tooltip \n *\n * */\n.osdkTooltipArrow {\n display: flex;\n\n &[data-side=\"top\"] {\n bottom: -8px;\n rotate: 180deg;\n }\n\n &[data-side=\"bottom\"] {\n top: -8px;\n rotate: 0deg;\n }\n\n &[data-side=\"left\"] {\n right: -13px;\n rotate: 90deg;\n }\n\n &[data-side=\"right\"] {\n left: -13px;\n rotate: -90deg;\n }\n}\n\n.tooltipArrowFill {\n fill: var(--osdk-tooltip-bg);\n}\n\n.tooltipArrowOuterStroke {\n fill: var(--osdk-tooltip-border-color);\n}\n","function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Tooltip as BaseUITooltip } from \"@base-ui/react/tooltip\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Tooltip.module.css\";\nfunction TooltipRoot({\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Root, rest, children);\n}\nfunction TooltipProvider({\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Provider, rest, children);\n}\nfunction TooltipTrigger({\n className,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Trigger, _extends({\n className: classnames(styles.osdkTooltipTrigger, className)\n }, rest), children);\n}\nfunction TooltipPositioner({\n className,\n children,\n sideOffset = 4,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Positioner, _extends({\n className: classnames(styles.osdkTooltipPositioner, className),\n sideOffset: sideOffset\n }, rest), children);\n}\nfunction TooltipPopup({\n className,\n children,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Popup, _extends({\n className: classnames(styles.osdkTooltipPopup, className)\n }, rest), children);\n}\nexport function TooltipArrow() {\n return /*#__PURE__*/React.createElement(BaseUITooltip.Arrow, {\n className: styles.osdkTooltipArrow\n }, /*#__PURE__*/React.createElement(ArrowSvg, null));\n}\nfunction ArrowSvg(props) {\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n width: \"20\",\n height: \"10\",\n viewBox: \"0 0 20 10\",\n fill: \"none\"\n }, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\",\n className: styles.tooltipArrowFill\n }), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\",\n className: styles.tooltipArrowOuterStroke\n }));\n}\nexport const Tooltip = {\n Root: TooltipRoot,\n Provider: TooltipProvider,\n Trigger: TooltipTrigger,\n Portal: BaseUITooltip.Portal,\n Positioner: TooltipPositioner,\n Popup: TooltipPopup,\n Arrow: TooltipArrow\n};","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.button {\n padding: calc(var(--osdk-surface-spacing) * 2)\n calc(var(--osdk-surface-spacing) * 4);\n border-radius: var(--osdk-surface-border-radius);\n font-size: var(--osdk-typography-size-body-medium);\n cursor: pointer;\n\n &:focus-visible {\n outline: var(--osdk-focus-outline);\n outline-offset: var(--osdk-focus-visible-outline-offset);\n }\n}\n\n.secondaryButton {\n background-color: var(--osdk-button-secondary-bg);\n border: var(--osdk-surface-border);\n color: var(--osdk-button-secondary-color);\n\n &:hover:not(:disabled) {\n background-color: var(--osdk-button-secondary-bg-hover);\n }\n\n &:active:not(:disabled) {\n background-color: var(--osdk-button-secondary-bg-active);\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n}\n\n.primaryButton {\n background-color: var(--osdk-button-primary-bg);\n border: none;\n color: var(--osdk-button-primary-color);\n\n &:hover:not(:disabled) {\n background-color: var(--osdk-button-primary-bg-hover);\n }\n\n &:active:not(:disabled) {\n background-color: var(--osdk-button-primary-bg-active);\n }\n\n &:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n}\n","function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Button } from \"@base-ui/react/button\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./ActionButton.module.css\";\nexport function ActionButton({\n variant = \"secondary\",\n className,\n ...rest\n}) {\n return /*#__PURE__*/React.createElement(Button, _extends({\n className: classNames(styles.button, variant === \"primary\" ? styles.primaryButton : styles.secondaryButton, className)\n }, rest));\n}","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n.backdrop {\n position: fixed;\n inset: 0;\n background-color: var(--osdk-dialog-backdrop-bg);\n z-index: var(--osdk-surface-z-index-1);\n}\n\n.popup {\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n min-width: var(--osdk-dialog-min-width);\n max-width: var(--osdk-dialog-max-width);\n min-height: var(--osdk-dialog-min-height);\n max-height: var(--osdk-dialog-max-height);\n background-color: var(--osdk-dialog-bg);\n border-radius: var(--osdk-surface-border-radius);\n box-shadow: var(--osdk-dialog-shadow);\n z-index: var(--osdk-surface-z-index-2);\n display: flex;\n flex-direction: column;\n}\n\n.header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: var(--osdk-dialog-header-padding);\n border-bottom: var(--osdk-surface-border);\n}\n\n.title {\n font-size: var(--osdk-dialog-title-font-size);\n font-weight: var(--osdk-dialog-title-font-weight);\n}\n\n.body {\n display: flex;\n padding: var(--osdk-dialog-body-padding);\n overflow-y: auto;\n flex: 1;\n}\n\n.footer {\n display: flex;\n justify-content: flex-end;\n gap: calc(var(--osdk-surface-spacing) * 2);\n padding: var(--osdk-dialog-footer-padding);\n border-top: var(--osdk-surface-border);\n}\n\n.closeButton {\n background: none;\n border: none;\n padding: calc(var(--osdk-surface-spacing) * 0.5);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: var(--osdk-surface-border-radius);\n\n &:hover {\n background-color: var(--osdk-surface-background-color-default-hover);\n }\n\n &:focus-visible {\n outline: var(--osdk-focus-outline);\n outline-offset: var(--osdk-focus-visible-outline-offset);\n }\n}\n\n.closeIcon {\n width: var(--osdk-iconography-size-small);\n height: var(--osdk-iconography-size-small);\n color: var(--osdk-typography-color-muted);\n}\n","/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dialog as BaseUIDialog } from \"@base-ui/react/dialog\";\nimport { Cross } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Dialog.module.css\";\nexport function Dialog({\n isOpen,\n onOpenChange,\n title,\n children,\n footer,\n className,\n disablePointerDismissal\n}) {\n return /*#__PURE__*/React.createElement(BaseUIDialog.Root, {\n open: isOpen,\n onOpenChange: onOpenChange,\n disablePointerDismissal: disablePointerDismissal\n }, /*#__PURE__*/React.createElement(BaseUIDialog.Portal, null, /*#__PURE__*/React.createElement(BaseUIDialog.Backdrop, {\n className: styles.backdrop\n }), /*#__PURE__*/React.createElement(BaseUIDialog.Popup, {\n className: classnames(styles.popup, className)\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.header\n }, /*#__PURE__*/React.createElement(BaseUIDialog.Title, {\n className: styles.title\n }, title), /*#__PURE__*/React.createElement(BaseUIDialog.Close, {\n className: styles.closeButton,\n \"aria-label\": \"Close dialog\"\n }, /*#__PURE__*/React.createElement(Cross, {\n className: styles.closeIcon\n }))), /*#__PURE__*/React.createElement(\"div\", {\n className: styles.body\n }, children), footer != null && /*#__PURE__*/React.createElement(\"div\", {\n className: styles.footer\n }, footer))));\n}"]}