@osdk/react-components 0.28.0 → 0.29.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/build/browser/pdf-viewer/PdfViewer.js +6 -2
- package/build/browser/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/browser/pdf-viewer/types.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-D565X4TE.cjs → chunk-3E5LLOPP.cjs} +3 -3
- package/build/cjs/chunk-3E5LLOPP.cjs.map +1 -0
- package/build/cjs/chunk-54NO7SXL.cjs +11 -0
- package/build/cjs/{chunk-U4NJ4WIE.cjs.map → chunk-54NO7SXL.cjs.map} +1 -1
- package/build/cjs/{chunk-Z6RGIOQU.cjs → chunk-CDUWYFG4.cjs} +4 -4
- package/build/cjs/{chunk-Z6RGIOQU.cjs.map → chunk-CDUWYFG4.cjs.map} +1 -1
- package/build/cjs/{chunk-HLWTO3SQ.cjs → chunk-DVBKL7PU.cjs} +7 -7
- package/build/cjs/{chunk-HLWTO3SQ.cjs.map → chunk-DVBKL7PU.cjs.map} +1 -1
- package/build/cjs/{chunk-FWZS3WQ4.cjs → chunk-EZ56QDIG.cjs} +7 -3
- package/build/cjs/chunk-EZ56QDIG.cjs.map +1 -0
- package/build/cjs/chunk-IBRBXU2L.cjs +11 -0
- package/build/cjs/{chunk-Q2AQ5TDJ.cjs.map → chunk-IBRBXU2L.cjs.map} +1 -1
- package/build/cjs/{chunk-SWTUJIGW.cjs → chunk-K57WAAJ5.cjs} +4 -4
- package/build/cjs/{chunk-SWTUJIGW.cjs.map → chunk-K57WAAJ5.cjs.map} +1 -1
- package/build/cjs/chunk-LHQT74FJ.cjs +11 -0
- package/build/cjs/{chunk-MIC4N6XX.cjs.map → chunk-LHQT74FJ.cjs.map} +1 -1
- package/build/cjs/{chunk-KBZCABK4.cjs → chunk-TQHAIZUS.cjs} +4 -4
- package/build/cjs/{chunk-KBZCABK4.cjs.map → chunk-TQHAIZUS.cjs.map} +1 -1
- package/build/cjs/{chunk-OJ4Q6LJ6.cjs → chunk-V3KT6B2W.cjs} +4 -4
- package/build/cjs/{chunk-OJ4Q6LJ6.cjs.map → chunk-V3KT6B2W.cjs.map} +1 -1
- package/build/cjs/{chunk-7JOXWTUY.cjs → chunk-VFLRVA47.cjs} +24 -24
- package/build/cjs/{chunk-7JOXWTUY.cjs.map → chunk-VFLRVA47.cjs.map} +1 -1
- package/build/cjs/{chunk-C2V2GXW4.cjs → chunk-VV5QJPGW.cjs} +4 -4
- package/build/cjs/{chunk-C2V2GXW4.cjs.map → chunk-VV5QJPGW.cjs.map} +1 -1
- package/build/cjs/{chunk-GYFDR655.cjs → chunk-WZSTQLHR.cjs} +4 -4
- package/build/cjs/{chunk-GYFDR655.cjs.map → chunk-WZSTQLHR.cjs.map} +1 -1
- package/build/cjs/chunk-Z3PQLRB2.cjs +11 -0
- package/build/cjs/{chunk-S4PGPP6D.cjs.map → chunk-Z3PQLRB2.cjs.map} +1 -1
- package/build/cjs/chunk-ZJMZKUK4.cjs +11 -0
- package/build/cjs/{chunk-NNRUPDXI.cjs.map → chunk-ZJMZKUK4.cjs.map} +1 -1
- package/build/cjs/public/experimental/action-form.cjs +4 -4
- package/build/cjs/public/experimental/cbac-picker.cjs +11 -11
- package/build/cjs/public/experimental/document-viewer.cjs +5 -5
- package/build/cjs/public/experimental/document-viewer.d.cts +1 -1
- package/build/cjs/public/experimental/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/excel-viewer.cjs +3 -3
- package/build/cjs/public/experimental/filter-list.cjs +15 -15
- package/build/cjs/public/experimental/image-viewer.cjs +3 -3
- package/build/cjs/public/experimental/markdown-renderer.cjs +3 -3
- package/build/cjs/public/experimental/object-table.cjs +8 -8
- package/build/cjs/public/experimental/pdf-viewer.cjs +25 -25
- package/build/cjs/public/experimental/pdf-viewer.d.cts +2 -2
- package/build/cjs/public/experimental/tiff-renderer.cjs +3 -3
- package/build/cjs/public/experimental/video-viewer.cjs +3 -3
- package/build/cjs/public/experimental/xml-viewer.cjs +3 -3
- package/build/cjs/public/experimental.cjs +76 -76
- package/build/cjs/public/experimental.d.cts +1 -1
- package/build/cjs/{types-Cg_LdKf-.d.cts → types-cSnAM4mt.d.cts} +5 -0
- package/build/esm/pdf-viewer/PdfViewer.js +6 -2
- package/build/esm/pdf-viewer/PdfViewer.js.map +1 -1
- package/build/esm/pdf-viewer/types.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/pdf-viewer/PdfViewer.d.ts.map +1 -1
- package/build/types/pdf-viewer/types.d.ts +5 -0
- package/build/types/pdf-viewer/types.d.ts.map +1 -1
- package/docs/Prerequisites.md +10 -21
- package/docs/StylingOverview.md +10 -7
- package/package.json +7 -7
- package/build/cjs/chunk-D565X4TE.cjs.map +0 -1
- package/build/cjs/chunk-FWZS3WQ4.cjs.map +0 -1
- package/build/cjs/chunk-MIC4N6XX.cjs +0 -11
- package/build/cjs/chunk-NNRUPDXI.cjs +0 -11
- package/build/cjs/chunk-Q2AQ5TDJ.cjs +0 -11
- package/build/cjs/chunk-S4PGPP6D.cjs +0 -11
- package/build/cjs/chunk-U4NJ4WIE.cjs +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.29.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ee3bce8: Add `downloadFileName` prop to set the PDF download name.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- ee3bce8: Fix PDF viewer toolbar download saving an invalid filename.
|
|
12
|
+
- e553390: Fix inaccurate docs: drop stale `@beta` install pins (now older than `latest`) so all setup pages agree on untagged installs, soften the "every `--osdk-*` token maps to a `--bp-*` token" claim (some hold raw values), simplify the Layers section to user-facing setup, and remove `@osdk/cbac-components` install/style references now that CBAC components are merged into `@osdk/react-components`.
|
|
13
|
+
- Updated dependencies [06adca1]
|
|
14
|
+
- Updated dependencies [79f8a6e]
|
|
15
|
+
- @osdk/client@2.32.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3
|
|
16
|
+
- @osdk/api@2.32.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3
|
|
17
|
+
- @osdk/react@2.32.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3
|
|
18
|
+
|
|
3
19
|
## 0.28.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
import { Error as ErrorIcon, Spin } from "@blueprintjs/icons";
|
|
18
18
|
import classnames from "classnames";
|
|
19
19
|
import "pdfjs-dist/web/pdf_viewer.css";
|
|
20
|
-
import React, { forwardRef, useImperativeHandle } from "react";
|
|
20
|
+
import React, { forwardRef, useCallback, useImperativeHandle } from "react";
|
|
21
21
|
import { PdfAnnotationOverlay } from "./components/PdfAnnotationOverlay.js";
|
|
22
22
|
import { PdfViewerOutlineSidebar } from "./components/PdfViewerOutlineSidebar.js";
|
|
23
23
|
import { PdfViewerSearchBar } from "./components/PdfViewerSearchBar.js";
|
|
@@ -45,6 +45,7 @@ export const BasePdfViewer = /*#__PURE__*/forwardRef(function ({
|
|
|
45
45
|
initialAutoSize = false,
|
|
46
46
|
initialSidebarOpen = false,
|
|
47
47
|
enableDownload = false,
|
|
48
|
+
downloadFileName,
|
|
48
49
|
sidebarMode: sidebarModeProp = "thumbnails",
|
|
49
50
|
outlineIcons,
|
|
50
51
|
className
|
|
@@ -85,6 +86,9 @@ export const BasePdfViewer = /*#__PURE__*/forwardRef(function ({
|
|
|
85
86
|
onFormChange
|
|
86
87
|
});
|
|
87
88
|
const annotationsByPage = usePdfAnnotationsByPage(annotations);
|
|
89
|
+
const handleDownload = useCallback(() => {
|
|
90
|
+
viewer.download(downloadFileName);
|
|
91
|
+
}, [viewer, downloadFileName]);
|
|
88
92
|
const rootClassName = classnames(styles.pdfViewer, className);
|
|
89
93
|
if (viewer.loading) {
|
|
90
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -125,7 +129,7 @@ export const BasePdfViewer = /*#__PURE__*/forwardRef(function ({
|
|
|
125
129
|
onAutoSizeToggle: viewer.toggleAutoSize,
|
|
126
130
|
onSearchOpen: viewer.search.openSearch,
|
|
127
131
|
onSidebarToggle: viewer.toggleSidebar,
|
|
128
|
-
onDownload:
|
|
132
|
+
onDownload: handleDownload,
|
|
129
133
|
enableDownload: enableDownload,
|
|
130
134
|
onRotateLeft: viewer.rotateLeft,
|
|
131
135
|
onRotateRight: viewer.rotateRight,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PdfViewer.js","names":["Error","ErrorIcon","Spin","classnames","React","forwardRef","useImperativeHandle","PdfAnnotationOverlay","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","EMPTY_ANNOTATION_ARRAY","usePdfAnnotationsByPage","usePdfFormFields","usePdfHighlightMode","usePdfViewerState","styles","BasePdfViewer","src","annotations","onAnnotationClick","onDownload","enableHighlight","onTextHighlight","onHighlightDelete","formData","onFormSubmit","onFormChange","initialPage","initialScale","initialAutoSize","initialSidebarOpen","enableDownload","sidebarMode","sidebarModeProp","outlineIcons","className","ref","viewer","highlightModeActive","toggleHighlightMode","deleteHighlight","pdfViewerRef","document","enabled","scrollToPage","hasFormFields","submitFormData","eventBusRef","annotationsByPage","rootClassName","pdfViewer","loading","createElement","loadingContainer","spinnerIcon","error","errorContainer","errorIcon","message","currentPage","numPages","scale","autoSize","sidebarOpen","onPageChange","onZoomIn","zoomIn","onZoomOut","zoomOut","onAutoSizeToggle","toggleAutoSize","onSearchOpen","search","openSearch","onSidebarToggle","toggleSidebar","download","onRotateLeft","rotateLeft","onRotateRight","rotateRight","onHighlightToggle","enableFormSave","onFormSave","isSearchOpen","query","totalMatches","currentMatchIndex","onQueryChange","setQuery","onNext","nextMatch","onPrev","prevMatch","onClose","closeSearch","contentArea","onPageClick","onSidebarModeChange","setSidebarMode","outlineItems","onItemClick","scrollContainerWrapper","containerRef","scrollContainer","viewerRef","portalTargets","map","target","pageAnnotations","pageNumber","length","key"],"sources":["PdfViewer.tsx"],"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 { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { PdfAnnotationOverlay } from \"./components/PdfAnnotationOverlay.js\";\nimport { PdfViewerOutlineSidebar } from \"./components/PdfViewerOutlineSidebar.js\";\nimport { PdfViewerSearchBar } from \"./components/PdfViewerSearchBar.js\";\nimport { PdfViewerSidebar } from \"./components/PdfViewerSidebar.js\";\nimport { PdfViewerToolbar } from \"./components/PdfViewerToolbar.js\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"./constants.js\";\nimport { usePdfAnnotationsByPage } from \"./hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"./hooks/usePdfFormFields.js\";\nimport { usePdfHighlightMode } from \"./hooks/usePdfHighlightMode.js\";\nimport { usePdfViewerState } from \"./hooks/usePdfViewerState.js\";\nimport styles from \"./PdfViewer.module.css\";\nimport type { PdfViewerHandle, PdfViewerProps } from \"./types.js\";\n\nexport const BasePdfViewer: React.ForwardRefExoticComponent<\n PdfViewerProps & React.RefAttributes<PdfViewerHandle>\n> = forwardRef<PdfViewerHandle, PdfViewerProps>(\n function BasePdfViewer({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n onDownload,\n enableHighlight = false,\n onTextHighlight,\n onHighlightDelete,\n formData,\n onFormSubmit,\n onFormChange,\n initialPage = 1,\n initialScale = 1.0,\n initialAutoSize = false,\n initialSidebarOpen = false,\n enableDownload = false,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n outlineIcons,\n className,\n }, ref) {\n const viewer = usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialAutoSize,\n initialSidebarOpen,\n sidebarMode: sidebarModeProp,\n onDownload,\n });\n\n const { highlightModeActive, toggleHighlightMode, deleteHighlight } =\n usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: enableHighlight,\n onTextHighlight,\n onHighlightDelete,\n });\n\n useImperativeHandle(ref, () => ({\n scrollToPage: viewer.scrollToPage,\n deleteHighlight,\n }), [viewer.scrollToPage, deleteHighlight]);\n\n const { hasFormFields, submitFormData } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormSubmit,\n onFormChange,\n });\n\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n\n const rootClassName = classnames(styles.pdfViewer, className);\n\n if (viewer.loading) {\n return (\n <div className={rootClassName}>\n <div className={styles.loadingContainer}>\n <Spin className={styles.spinnerIcon} />\n Loading…\n </div>\n </div>\n );\n }\n\n if (viewer.error != null) {\n return (\n <div className={rootClassName}>\n <div className={styles.errorContainer}>\n <ErrorIcon className={styles.errorIcon} />\n Failed to load PDF: {viewer.error.message}\n </div>\n </div>\n );\n }\n\n if (viewer.document == null) {\n return (\n <div className={rootClassName}>\n <div className={styles.loadingContainer}>No document</div>\n </div>\n );\n }\n\n return (\n <div className={rootClassName}>\n <PdfViewerToolbar\n currentPage={viewer.currentPage}\n numPages={viewer.numPages}\n scale={viewer.scale}\n autoSize={viewer.autoSize}\n sidebarOpen={viewer.sidebarOpen}\n onPageChange={viewer.scrollToPage}\n onZoomIn={viewer.zoomIn}\n onZoomOut={viewer.zoomOut}\n onAutoSizeToggle={viewer.toggleAutoSize}\n onSearchOpen={viewer.search.openSearch}\n onSidebarToggle={viewer.toggleSidebar}\n onDownload={viewer.download}\n enableDownload={enableDownload}\n onRotateLeft={viewer.rotateLeft}\n onRotateRight={viewer.rotateRight}\n enableHighlight={enableHighlight}\n highlightModeActive={highlightModeActive}\n onHighlightToggle={toggleHighlightMode}\n enableFormSave={onFormSubmit != null && hasFormFields}\n onFormSave={submitFormData}\n />\n {viewer.search.isSearchOpen && (\n <PdfViewerSearchBar\n query={viewer.search.query}\n totalMatches={viewer.search.totalMatches}\n currentMatchIndex={viewer.search.currentMatchIndex}\n onQueryChange={viewer.search.setQuery}\n onNext={viewer.search.nextMatch}\n onPrev={viewer.search.prevMatch}\n onClose={viewer.search.closeSearch}\n />\n )}\n <div className={styles.contentArea}>\n {viewer.sidebarOpen && viewer.sidebarMode === \"thumbnails\" && (\n <PdfViewerSidebar\n document={viewer.document}\n numPages={viewer.numPages}\n currentPage={viewer.currentPage}\n onPageClick={viewer.scrollToPage}\n sidebarMode={viewer.sidebarMode}\n onSidebarModeChange={viewer.setSidebarMode}\n />\n )}\n {viewer.sidebarOpen && viewer.sidebarMode === \"outline\" && (\n <PdfViewerOutlineSidebar\n outlineItems={viewer.outlineItems}\n currentPage={viewer.currentPage}\n onItemClick={viewer.scrollToPage}\n sidebarMode={viewer.sidebarMode}\n onSidebarModeChange={viewer.setSidebarMode}\n outlineIcons={outlineIcons}\n />\n )}\n <div className={styles.scrollContainerWrapper}>\n <div ref={viewer.containerRef} className={styles.scrollContainer}>\n <div ref={viewer.viewerRef} className=\"pdfViewer\" />\n {viewer.portalTargets.map((target) => {\n const pageAnnotations = annotationsByPage[target.pageNumber]\n ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return (\n <PdfAnnotationOverlay\n key={target.pageNumber}\n target={target}\n annotations={pageAnnotations}\n onAnnotationClick={onAnnotationClick}\n />\n );\n })}\n </div>\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,IAAIC,SAAS,EAAEC,IAAI,QAAQ,oBAAoB;AAC7D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAO,+BAA+B;AACtC,OAAOC,KAAK,IAAIC,UAAU,EAAEC,mBAAmB,QAAQ,OAAO;AAC9D,SAASC,oBAAoB,QAAQ,sCAAsC;AAC3E,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,SAASC,kBAAkB,QAAQ,oCAAoC;AACvE,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,gBAAgB,QAAQ,kCAAkC;AACnE,SAASC,sBAAsB,QAAQ,gBAAgB;AACvD,SAASC,uBAAuB,QAAQ,oCAAoC;AAC5E,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,OAAOC,MAAM,MAAM,wBAAwB;AAG3C,OAAO,MAAMC,aAEZ,gBAAGb,UAAU,CACZ,UAAuB;EACrBc,GAAG;EACHC,WAAW,GAAGR,sBAAsB;EACpCS,iBAAiB;EACjBC,UAAU;EACVC,eAAe,GAAG,KAAK;EACvBC,eAAe;EACfC,iBAAiB;EACjBC,QAAQ;EACRC,YAAY;EACZC,YAAY;EACZC,WAAW,GAAG,CAAC;EACfC,YAAY,GAAG,GAAG;EAClBC,eAAe,GAAG,KAAK;EACvBC,kBAAkB,GAAG,KAAK;EAC1BC,cAAc,GAAG,KAAK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con","Spin","classnames","React","forwardRef","useCallback","useImperativeHandle","PdfAnnotationOverlay","PdfViewerOutlineSidebar","PdfViewerSearchBar","PdfViewerSidebar","PdfViewerToolbar","EMPTY_ANNOTATION_ARRAY","usePdfAnnotationsByPage","usePdfFormFields","usePdfHighlightMode","usePdfViewerState","styles","BasePdfViewer","src","annotations","onAnnotationClick","onDownload","enableHighlight","onTextHighlight","onHighlightDelete","formData","onFormSubmit","onFormChange","initialPage","initialScale","initialAutoSize","initialSidebarOpen","enableDownload","downloadFileName","sidebarMode","sidebarModeProp","outlineIcons","className","ref","viewer","highlightModeActive","toggleHighlightMode","deleteHighlight","pdfViewerRef","document","enabled","scrollToPage","hasFormFields","submitFormData","eventBusRef","annotationsByPage","handleDownload","download","rootClassName","pdfViewer","loading","createElement","loadingContainer","spinnerIcon","error","errorContainer","errorIcon","message","currentPage","numPages","scale","autoSize","sidebarOpen","onPageChange","onZoomIn","zoomIn","onZoomOut","zoomOut","onAutoSizeToggle","toggleAutoSize","onSearchOpen","search","openSearch","onSidebarToggle","toggleSidebar","onRotateLeft","rotateLeft","onRotateRight","rotateRight","onHighlightToggle","enableFormSave","onFormSave","isSearchOpen","query","totalMatches","currentMatchIndex","onQueryChange","setQuery","onNext","nextMatch","onPrev","prevMatch","onClose","closeSearch","contentArea","onPageClick","onSidebarModeChange","setSidebarMode","outlineItems","onItemClick","scrollContainerWrapper","containerRef","scrollContainer","viewerRef","portalTargets","map","target","pageAnnotations","pageNumber","length","key"],"sources":["PdfViewer.tsx"],"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 { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { forwardRef, useCallback, useImperativeHandle } from \"react\";\nimport { PdfAnnotationOverlay } from \"./components/PdfAnnotationOverlay.js\";\nimport { PdfViewerOutlineSidebar } from \"./components/PdfViewerOutlineSidebar.js\";\nimport { PdfViewerSearchBar } from \"./components/PdfViewerSearchBar.js\";\nimport { PdfViewerSidebar } from \"./components/PdfViewerSidebar.js\";\nimport { PdfViewerToolbar } from \"./components/PdfViewerToolbar.js\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"./constants.js\";\nimport { usePdfAnnotationsByPage } from \"./hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"./hooks/usePdfFormFields.js\";\nimport { usePdfHighlightMode } from \"./hooks/usePdfHighlightMode.js\";\nimport { usePdfViewerState } from \"./hooks/usePdfViewerState.js\";\nimport styles from \"./PdfViewer.module.css\";\nimport type { PdfViewerHandle, PdfViewerProps } from \"./types.js\";\n\nexport const BasePdfViewer: React.ForwardRefExoticComponent<\n PdfViewerProps & React.RefAttributes<PdfViewerHandle>\n> = forwardRef<PdfViewerHandle, PdfViewerProps>(\n function BasePdfViewer({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n onDownload,\n enableHighlight = false,\n onTextHighlight,\n onHighlightDelete,\n formData,\n onFormSubmit,\n onFormChange,\n initialPage = 1,\n initialScale = 1.0,\n initialAutoSize = false,\n initialSidebarOpen = false,\n enableDownload = false,\n downloadFileName,\n sidebarMode: sidebarModeProp = \"thumbnails\",\n outlineIcons,\n className,\n }, ref) {\n const viewer = usePdfViewerState({\n src,\n initialPage,\n initialScale,\n initialAutoSize,\n initialSidebarOpen,\n sidebarMode: sidebarModeProp,\n onDownload,\n });\n\n const { highlightModeActive, toggleHighlightMode, deleteHighlight } =\n usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: enableHighlight,\n onTextHighlight,\n onHighlightDelete,\n });\n\n useImperativeHandle(ref, () => ({\n scrollToPage: viewer.scrollToPage,\n deleteHighlight,\n }), [viewer.scrollToPage, deleteHighlight]);\n\n const { hasFormFields, submitFormData } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormSubmit,\n onFormChange,\n });\n\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n\n const handleDownload = useCallback(() => {\n viewer.download(downloadFileName);\n }, [viewer, downloadFileName]);\n\n const rootClassName = classnames(styles.pdfViewer, className);\n\n if (viewer.loading) {\n return (\n <div className={rootClassName}>\n <div className={styles.loadingContainer}>\n <Spin className={styles.spinnerIcon} />\n Loading…\n </div>\n </div>\n );\n }\n\n if (viewer.error != null) {\n return (\n <div className={rootClassName}>\n <div className={styles.errorContainer}>\n <ErrorIcon className={styles.errorIcon} />\n Failed to load PDF: {viewer.error.message}\n </div>\n </div>\n );\n }\n\n if (viewer.document == null) {\n return (\n <div className={rootClassName}>\n <div className={styles.loadingContainer}>No document</div>\n </div>\n );\n }\n\n return (\n <div className={rootClassName}>\n <PdfViewerToolbar\n currentPage={viewer.currentPage}\n numPages={viewer.numPages}\n scale={viewer.scale}\n autoSize={viewer.autoSize}\n sidebarOpen={viewer.sidebarOpen}\n onPageChange={viewer.scrollToPage}\n onZoomIn={viewer.zoomIn}\n onZoomOut={viewer.zoomOut}\n onAutoSizeToggle={viewer.toggleAutoSize}\n onSearchOpen={viewer.search.openSearch}\n onSidebarToggle={viewer.toggleSidebar}\n onDownload={handleDownload}\n enableDownload={enableDownload}\n onRotateLeft={viewer.rotateLeft}\n onRotateRight={viewer.rotateRight}\n enableHighlight={enableHighlight}\n highlightModeActive={highlightModeActive}\n onHighlightToggle={toggleHighlightMode}\n enableFormSave={onFormSubmit != null && hasFormFields}\n onFormSave={submitFormData}\n />\n {viewer.search.isSearchOpen && (\n <PdfViewerSearchBar\n query={viewer.search.query}\n totalMatches={viewer.search.totalMatches}\n currentMatchIndex={viewer.search.currentMatchIndex}\n onQueryChange={viewer.search.setQuery}\n onNext={viewer.search.nextMatch}\n onPrev={viewer.search.prevMatch}\n onClose={viewer.search.closeSearch}\n />\n )}\n <div className={styles.contentArea}>\n {viewer.sidebarOpen && viewer.sidebarMode === \"thumbnails\" && (\n <PdfViewerSidebar\n document={viewer.document}\n numPages={viewer.numPages}\n currentPage={viewer.currentPage}\n onPageClick={viewer.scrollToPage}\n sidebarMode={viewer.sidebarMode}\n onSidebarModeChange={viewer.setSidebarMode}\n />\n )}\n {viewer.sidebarOpen && viewer.sidebarMode === \"outline\" && (\n <PdfViewerOutlineSidebar\n outlineItems={viewer.outlineItems}\n currentPage={viewer.currentPage}\n onItemClick={viewer.scrollToPage}\n sidebarMode={viewer.sidebarMode}\n onSidebarModeChange={viewer.setSidebarMode}\n outlineIcons={outlineIcons}\n />\n )}\n <div className={styles.scrollContainerWrapper}>\n <div ref={viewer.containerRef} className={styles.scrollContainer}>\n <div ref={viewer.viewerRef} className=\"pdfViewer\" />\n {viewer.portalTargets.map((target) => {\n const pageAnnotations = annotationsByPage[target.pageNumber]\n ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return (\n <PdfAnnotationOverlay\n key={target.pageNumber}\n target={target}\n annotations={pageAnnotations}\n onAnnotationClick={onAnnotationClick}\n />\n );\n })}\n </div>\n </div>\n </div>\n </div>\n );\n },\n);\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,IAAIC,SAAS,EAAEC,IAAI,QAAQ,oBAAoB;AAC7D,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAO,+BAA+B;AACtC,OAAOC,KAAK,IAAIC,UAAU,EAAEC,WAAW,EAAEC,mBAAmB,QAAQ,O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Y;IAChCmE,mBAAmB,EAAE9D,MAAM,CAAC+D,cAAe;IAC3ClE,YAAY,EAAEA;EAAa,CAC5B,CACF,eACDlC,KAAA,CAAAsD,aAAA;IAAKnB,SAAS,EAAErB,MAAM,CAACyF;EAAuB,gBAC5CvG,KAAA,CAAAsD,aAAA;IAAKlB,GAAG,EAAEC,MAAM,CAACmE,YAAa;IAACrE,SAAS,EAAErB,MAAM,CAAC2F;EAAgB,gBAC/DzG,KAAA,CAAAsD,aAAA;IAAKlB,GAAG,EAAEC,MAAM,CAACqE,SAAU;IAACvE,SAAS,EAAC;EAAW,CAAE,CAAC,EACnDE,MAAM,CAACsE,aAAa,CAACC,GAAG,CAAEC,MAAM,IAAK;IACpC,MAAMC,eAAe,GAAG9D,iBAAiB,CAAC6D,MAAM,CAACE,UAAU,CAAC,IACvDtG,sBAAsB;IAC3B,IAAIqG,eAAe,CAACE,MAAM,KAAK,CAAC,EAAE;MAChC,OAAO,IAAI;IACb;IACA,oBACEhH,KAAA,CAAAsD,aAAA,CAAClD,oBAAoB;MACnB6G,GAAG,EAAEJ,MAAM,CAACE,UAAW;MACvBF,MAAM,EAAEA,MAAO;MACf5F,WAAW,EAAE6F,eAAgB;MAC7B5F,iBAAiB,EAAEA;IAAkB,CACtC,CAAC;EAEN,CAAC,CACE,CACF,CACF,CACF,CAAC;AAEV,CACF,CAAC","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 transform: 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 /**\n * Whether auto-size (fit to width) is initially enabled.\n * When enabled, the PDF scales to fit the container width and\n * re-fits automatically on resize. Manual zoom disables auto-size.\n * Takes precedence over {@link initialScale} when enabled.\n * @default false\n */\n initialAutoSize?: boolean;\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 /**\n * Whether auto-size (fit to width) is initially enabled.\n * When enabled, the PDF scales to fit the container width and\n * re-fits automatically on resize. Manual zoom disables auto-size.\n * Takes precedence over {@link initialScale} when enabled.\n * @default false\n */\n initialAutoSize?: boolean;\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 transform: 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 /**\n * Whether auto-size (fit to width) is initially enabled.\n * When enabled, the PDF scales to fit the container width and\n * re-fits automatically on resize. Manual zoom disables auto-size.\n * Takes precedence over {@link initialScale} when enabled.\n * @default false\n */\n initialAutoSize?: boolean;\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 /**\n * Whether auto-size (fit to width) is initially enabled.\n * When enabled, the PDF scales to fit the container width and\n * re-fits automatically on resize. Manual zoom disables auto-size.\n * Takes precedence over {@link initialScale} when enabled.\n * @default false\n */\n initialAutoSize?: boolean;\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 * Filename used when the user downloads the PDF via the toolbar button.\n * If omitted, the name is derived from the `src` URL, falling back to \"document.pdf\".\n */\n downloadFileName?: string;\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":[]}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.
|
|
17
|
+
const PACKAGE_USER_AGENT = `osdk-react-components/${"0.29.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3"}`;
|
|
18
18
|
export function componentUserAgent(componentName) {
|
|
19
19
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
20
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,
|
|
1
|
+
{"version":3,"file":"UserAgent.js","names":["PACKAGE_USER_AGENT","componentUserAgent","componentName"],"sources":["UserAgent.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\nconst PACKAGE_USER_AGENT =\n `osdk-react-components/${process.env.PACKAGE_VERSION}`;\n\nexport function componentUserAgent(componentName: string): string {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMA,kBAAkB,GACtB,iFAAsD;AAExD,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
|
|
@@ -10,7 +10,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
10
10
|
// src/util/withOsdkMetrics.ts
|
|
11
11
|
|
|
12
12
|
// src/util/UserAgent.ts
|
|
13
|
-
var PACKAGE_USER_AGENT = `osdk-react-components/${"0.
|
|
13
|
+
var PACKAGE_USER_AGENT = `osdk-react-components/${"0.29.0-main-e5533908222aa2ef650553f0a110d4d61ccebac3"}`;
|
|
14
14
|
function componentUserAgent(componentName) {
|
|
15
15
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
16
16
|
}
|
|
@@ -26,5 +26,5 @@ function withOsdkMetrics(Component, name) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
exports.withOsdkMetrics = withOsdkMetrics;
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
30
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-3E5LLOPP.cjs.map
|
|
30
|
+
//# sourceMappingURL=chunk-3E5LLOPP.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/util/UserAgent.ts","../../src/util/withOsdkMetrics.ts"],"names":["useRegisterUserAgent","React"],"mappings":";;;;;;;;;;;;AAgBA,IAAM,kBAAA,GAAqB,yBAAyB,sDAA2B,CAAA,CAAA;AACxE,SAAS,mBAAmB,aAAA,EAAe;AAChD,EAAA,OAAO,CAAA,EAAG,kBAAkB,CAAA,CAAA,EAAI,aAAa,CAAA,CAAA;AAC/C;;;ACKO,SAAS,eAAA,CAAgB,WAAW,IAAA,EAAM;AAC/C,EAAA,MAAM,UAAU,CAAA,KAAA,KAAS;AACvB,IAAAA,0BAAA,CAAqB,kBAAA,CAAmB,IAAI,CAAC,CAAA;AAC7C,IAAA,uBAAoBC,sBAAA,CAAM,aAAA,CAAc,SAAA,EAAW,KAAK,CAAA;AAAA,EAC1D,CAAA;AACA,EAAA,OAAA,CAAQ,WAAA,GAAc,mBAAmB,IAAI,CAAA,CAAA,CAAA;AAC7C,EAAA,OAAO,OAAA;AACT","file":"chunk-3E5LLOPP.cjs","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\nconst PACKAGE_USER_AGENT = `osdk-react-components/${process.env.PACKAGE_VERSION}`;\nexport function componentUserAgent(componentName) {\n return `${PACKAGE_USER_AGENT}/${componentName}`;\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 { useRegisterUserAgent } from \"@osdk/react\";\nimport React from \"react\";\nimport { componentUserAgent } from \"./UserAgent.js\";\n\n// `any` is required: FunctionComponent defaults to FunctionComponent<{}> which\n// rejects components with required props. A generic P parameter doesn't help\n// because TS can't infer both P and C simultaneously from a single argument.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function withOsdkMetrics(Component, name) {\n const Wrapped = props => {\n useRegisterUserAgent(componentUserAgent(name));\n return /*#__PURE__*/React.createElement(Component, props);\n };\n Wrapped.displayName = `withOsdkMetrics(${name})`;\n return Wrapped;\n}"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkOUJQJQ7N_cjs = require('./chunk-OUJQJQ7N.cjs');
|
|
4
|
+
var chunk3E5LLOPP_cjs = require('./chunk-3E5LLOPP.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/experimental/xml-viewer.ts
|
|
7
|
+
var XmlViewer2 = chunk3E5LLOPP_cjs.withOsdkMetrics(chunkOUJQJQ7N_cjs.XmlViewer, "XmlViewer");
|
|
8
|
+
|
|
9
|
+
exports.XmlViewer = XmlViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-54NO7SXL.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-54NO7SXL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/xml-viewer.ts"],"names":["XmlViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/xml-viewer.ts"],"names":["XmlViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-54NO7SXL.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// BaseXmlViewer\nexport { BaseXmlViewer } from \"../../xml-viewer/BaseXmlViewer.js\";\n// XmlViewer (Media wrapper)\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nimport { XmlViewer as _XmlViewer } from \"../../xml-viewer/XmlViewer.js\";\nexport const XmlViewer = withOsdkMetrics(_XmlViewer, \"XmlViewer\");"]}
|
|
@@ -6,7 +6,7 @@ var chunkE5OKIBYJ_cjs = require('./chunk-E5OKIBYJ.cjs');
|
|
|
6
6
|
var chunkNE7GRF7G_cjs = require('./chunk-NE7GRF7G.cjs');
|
|
7
7
|
var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
|
|
8
8
|
var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunk3E5LLOPP_cjs = require('./chunk-3E5LLOPP.cjs');
|
|
10
10
|
var button = require('@base-ui/react/button');
|
|
11
11
|
var classnames3 = require('classnames');
|
|
12
12
|
var React15 = require('react');
|
|
@@ -5576,7 +5576,7 @@ function summarizeFilterValue(definition, state) {
|
|
|
5576
5576
|
}
|
|
5577
5577
|
|
|
5578
5578
|
// src/public/experimental/filter-list.ts
|
|
5579
|
-
var FilterList2 =
|
|
5579
|
+
var FilterList2 = chunk3E5LLOPP_cjs.withOsdkMetrics(FilterList, "FilterList");
|
|
5580
5580
|
|
|
5581
5581
|
exports.BaseFilterList = BaseFilterList;
|
|
5582
5582
|
exports.FilterInput = FilterInput;
|
|
@@ -5591,5 +5591,5 @@ exports.narrowObjectSet = narrowObjectSet;
|
|
|
5591
5591
|
exports.serializeFilterStates = serializeFilterStates;
|
|
5592
5592
|
exports.summarizeFilterValue = summarizeFilterValue;
|
|
5593
5593
|
exports.useFilterListState = useFilterListState;
|
|
5594
|
-
//# sourceMappingURL=chunk-
|
|
5595
|
-
//# sourceMappingURL=chunk-
|
|
5594
|
+
//# sourceMappingURL=chunk-CDUWYFG4.cjs.map
|
|
5595
|
+
//# sourceMappingURL=chunk-CDUWYFG4.cjs.map
|