@osdk/react-components 0.32.1-main-bcf70073f7ac0340cfa0bcf4c6d1e74cbcc0842f → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -9
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-MO3JD3FZ.cjs → chunk-364UCCB2.cjs} +3 -3
- package/build/cjs/chunk-364UCCB2.cjs.map +1 -0
- package/build/cjs/chunk-3MDT2TJK.cjs +11 -0
- package/build/cjs/{chunk-V4G2T7D7.cjs.map → chunk-3MDT2TJK.cjs.map} +1 -1
- package/build/cjs/{chunk-UT56JOO3.cjs → chunk-4AGEVOFW.cjs} +4 -4
- package/build/cjs/{chunk-UT56JOO3.cjs.map → chunk-4AGEVOFW.cjs.map} +1 -1
- package/build/cjs/{chunk-3PDRT2AF.cjs → chunk-56CFJTXV.cjs} +4 -4
- package/build/cjs/{chunk-3PDRT2AF.cjs.map → chunk-56CFJTXV.cjs.map} +1 -1
- package/build/cjs/chunk-AEFCONAY.cjs +11 -0
- package/build/cjs/{chunk-JGBGTZMA.cjs.map → chunk-AEFCONAY.cjs.map} +1 -1
- package/build/cjs/chunk-D6RQIMMX.cjs +11 -0
- package/build/cjs/{chunk-ITFUYYV5.cjs.map → chunk-D6RQIMMX.cjs.map} +1 -1
- package/build/cjs/{chunk-RERGFSCU.cjs → chunk-LYAAHEAS.cjs} +4 -4
- package/build/cjs/{chunk-RERGFSCU.cjs.map → chunk-LYAAHEAS.cjs.map} +1 -1
- package/build/cjs/{chunk-4UU44UOC.cjs → chunk-N5NOB4G4.cjs} +4 -4
- package/build/cjs/{chunk-4UU44UOC.cjs.map → chunk-N5NOB4G4.cjs.map} +1 -1
- package/build/cjs/chunk-N7TOWLUY.cjs +11 -0
- package/build/cjs/{chunk-ANLZG2OO.cjs.map → chunk-N7TOWLUY.cjs.map} +1 -1
- package/build/cjs/{chunk-Q4FFFLT3.cjs → chunk-OTAWBR27.cjs} +4 -4
- package/build/cjs/{chunk-Q4FFFLT3.cjs.map → chunk-OTAWBR27.cjs.map} +1 -1
- package/build/cjs/{chunk-CWC7N6LS.cjs → chunk-PFGIO77A.cjs} +4 -4
- package/build/cjs/{chunk-CWC7N6LS.cjs.map → chunk-PFGIO77A.cjs.map} +1 -1
- package/build/cjs/{chunk-T3UIIY6X.cjs → chunk-QWFT3G4W.cjs} +4 -4
- package/build/cjs/{chunk-T3UIIY6X.cjs.map → chunk-QWFT3G4W.cjs.map} +1 -1
- package/build/cjs/chunk-SUEZQS7M.cjs +11 -0
- package/build/cjs/{chunk-6M23LAWM.cjs.map → chunk-SUEZQS7M.cjs.map} +1 -1
- package/build/cjs/{chunk-PFP7NWQS.cjs → chunk-XCZD54BD.cjs} +4 -4
- package/build/cjs/{chunk-PFP7NWQS.cjs.map → chunk-XCZD54BD.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 +4 -4
- 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 +7 -7
- 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 +58 -58
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/package.json +7 -7
- package/build/cjs/chunk-6M23LAWM.cjs +0 -11
- package/build/cjs/chunk-ANLZG2OO.cjs +0 -11
- package/build/cjs/chunk-ITFUYYV5.cjs +0 -11
- package/build/cjs/chunk-JGBGTZMA.cjs +0 -11
- package/build/cjs/chunk-MO3JD3FZ.cjs.map +0 -1
- package/build/cjs/chunk-V4G2T7D7.cjs +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.33.0
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### Minor Changes
|
|
6
6
|
|
|
7
7
|
- bcf7007: Style number input stepper buttons with button appearance instead of input styling
|
|
8
|
-
- Updated dependencies [70839ec]
|
|
9
|
-
- Updated dependencies [3e915ee]
|
|
10
|
-
- Updated dependencies [742fe69]
|
|
11
|
-
- Updated dependencies [ac0303b]
|
|
12
|
-
- @osdk/react@2.40.0-main-bcf70073f7ac0340cfa0bcf4c6d1e74cbcc0842f
|
|
13
|
-
- @osdk/client@2.40.0-main-bcf70073f7ac0340cfa0bcf4c6d1e74cbcc0842f
|
|
14
|
-
- @osdk/api@2.40.0-main-bcf70073f7ac0340cfa0bcf4c6d1e74cbcc0842f
|
|
15
8
|
|
|
16
9
|
## 0.32.0
|
|
17
10
|
|
|
@@ -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.33.0"}`;
|
|
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,mCAAsD;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.33.0"}`;
|
|
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-364UCCB2.cjs.map
|
|
30
|
+
//# sourceMappingURL=chunk-364UCCB2.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,QAA2B,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-364UCCB2.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 chunkVOROB7KJ_cjs = require('./chunk-VOROB7KJ.cjs');
|
|
4
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/experimental/image-viewer.ts
|
|
7
|
+
var ImageViewer2 = chunk364UCCB2_cjs.withOsdkMetrics(chunkVOROB7KJ_cjs.ImageViewer, "ImageViewer");
|
|
8
|
+
|
|
9
|
+
exports.ImageViewer = ImageViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-3MDT2TJK.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-3MDT2TJK.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/image-viewer.ts"],"names":["ImageViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/image-viewer.ts"],"names":["ImageViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-3MDT2TJK.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// BaseImageViewer\nexport { BaseImageViewer } from \"../../images/image-viewer/BaseImageViewer.js\";\n// ImageViewer (Media wrapper)\nimport { ImageViewer as _ImageViewer } from \"../../images/image-viewer/ImageViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const ImageViewer = withOsdkMetrics(_ImageViewer, \"ImageViewer\");"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkDA22W6ZO_cjs = require('./chunk-DA22W6ZO.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
5
5
|
var icons = require('@blueprintjs/icons');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
require('pdfjs-dist/web/pdf_viewer.css');
|
|
@@ -179,12 +179,12 @@ function usePdfViewerInstance(options) {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
// src/public/experimental/pdf-viewer.ts
|
|
182
|
-
var PdfViewer2 =
|
|
182
|
+
var PdfViewer2 = chunk364UCCB2_cjs.withOsdkMetrics(chunkDA22W6ZO_cjs.PdfViewer, "PdfViewer");
|
|
183
183
|
|
|
184
184
|
exports.PdfViewer = PdfViewer2;
|
|
185
185
|
exports.PdfViewerContent = PdfViewerContent;
|
|
186
186
|
exports.PdfViewerProvider = PdfViewerProvider;
|
|
187
187
|
exports.usePdfViewerContext = usePdfViewerContext;
|
|
188
188
|
exports.usePdfViewerInstance = usePdfViewerInstance;
|
|
189
|
-
//# sourceMappingURL=chunk-
|
|
190
|
-
//# sourceMappingURL=chunk-
|
|
189
|
+
//# sourceMappingURL=chunk-4AGEVOFW.cjs.map
|
|
190
|
+
//# sourceMappingURL=chunk-4AGEVOFW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pdf-viewer/components/PdfViewerContent.tsx","../../src/pdf-viewer/PdfViewerContext.tsx","../../src/public/experimental/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","PdfViewer_default","React","Spin","ErrorIcon","PdfAnnotationOverlay","useContext","usePdfViewerState","usePdfHighlightMode","useMemo","PdfViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;AA0BO,SAAS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AA,IAAoB,KAAA;AACrD,EAAA,MAAM,cAAA,GAAiB,QAAQ,cAAA,IAAkB,KAAA;AACjD,EAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,YAAA,IAAgB,IAAA,IAAQ,aAAA;AACvD,EAAA,MAAM;AAAA,IACJ,iBAAA;AAAA,IACA;AAAA,GACF,GAAI,OAAA;AACJ,EAAA,OAAOa,cAAQ,OAAO;AAAA,IACpB,GAAG,MAAA;AAAA,IACH,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,CAAA,EAAI,CAAC,MAAA,EAAQ,gBAAA,EAAkB,qBAAqB,mBAAA,EAAqB,aAAA,EAAe,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,iBAAA,EAAmB,cAAA,EAAgB,cAAA,EAAgB,YAAY,CAAC,CAAA;AAC1M;;;AC9DO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-UT56JOO3.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\nimport { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"../constants.js\";\nimport { usePdfAnnotationsByPage } from \"../hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"../hooks/usePdfFormFields.js\";\nimport { usePdfViewerCore } from \"../hooks/usePdfViewerCore.js\";\nimport styles from \"../PdfViewer.module.css\";\nimport { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n initialPage = 1,\n initialScale = 1.0,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n initialPage,\n initialScale\n });\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormChange\n });\n\n // Use refs for callbacks to avoid firing on initial mount\n const onPageChangeRef = useRef(onPageChangeProp);\n onPageChangeRef.current = onPageChangeProp;\n const onScaleChangeRef = useRef(onScaleChangeProp);\n onScaleChangeRef.current = onScaleChangeProp;\n const isInitialMountRef = useRef(true);\n useEffect(function notifyPageChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onPageChangeRef.current?.(viewer.currentPage);\n }, [viewer.currentPage]);\n useEffect(function notifyScaleChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onScaleChangeRef.current?.(viewer.scale);\n }, [viewer.scale]);\n useEffect(function clearInitialMount() {\n isInitialMountRef.current = false;\n }, []);\n const rootClassName = classnames(styles.pdfViewer, className);\n if (viewer.loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Loading\\u2026\"));\n }\n if (viewer.error != null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.errorContainer\n }, /*#__PURE__*/React.createElement(ErrorIcon, {\n className: styles.errorIcon\n }), \"Failed to load PDF: \", viewer.error.message));\n }\n if (viewer.document == null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, \"No document\"));\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.scrollContainerWrapper\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.containerRef,\n className: styles.scrollContainer\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.viewerRef,\n className: \"pdfViewer\"\n }), viewer.portalTargets.map(target => {\n const pageAnnotations = annotationsByPage[target.pageNumber] ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(PdfAnnotationOverlay, {\n key: target.pageNumber,\n target: target,\n annotations: pageAnnotations,\n onAnnotationClick: onAnnotationClick\n });\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 React, { createContext, useContext, useMemo } from \"react\";\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\";\n\n/** The shape of the value provided by {@link PdfViewerProvider}. */\n\nconst PdfViewerContext = /*#__PURE__*/createContext(null);\n/** Provides {@link PdfViewerContextValue} to descendant components. */\nexport function PdfViewerProvider({\n value,\n children\n}) {\n return /*#__PURE__*/React.createElement(PdfViewerContext.Provider, {\n value: value\n }, children);\n}\n\n/**\n * Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.\n * Throws if called outside a provider.\n */\nexport function usePdfViewerContext() {\n const ctx = useContext(PdfViewerContext);\n if (ctx == null) {\n throw new Error(\"usePdfViewerContext must be used within a PdfViewerProvider\");\n }\n return ctx;\n}\n\n/**\n * Consumer-facing setup hook analogous to react-hook-form's `useForm()`.\n * Accepts viewer options and returns a {@link PdfViewerContextValue} suitable\n * for passing to {@link PdfViewerProvider}.\n */\nexport function usePdfViewerInstance(options) {\n const viewer = usePdfViewerState({\n src: options.src,\n initialPage: options.initialPage,\n initialScale: options.initialScale,\n initialAutoSize: options.initialAutoSize,\n initialSidebarOpen: options.initialSidebarOpen,\n sidebarMode: options.sidebarMode,\n onDownload: options.onDownload\n });\n const {\n highlightModeActive,\n toggleHighlightMode\n } = usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: options.highlightEnabled ?? false,\n onTextHighlight: options.onTextHighlight,\n onHighlightDelete: options.onHighlightDelete\n });\n const {\n hasFormFields,\n submitFormData\n } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData: options.formData,\n onFormSubmit: options.onFormSubmit,\n onFormChange: options.onFormChange\n });\n const annotations = options.annotations ?? EMPTY_ANNOTATION_ARRAY;\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n const highlightEnabled = options.highlightEnabled ?? false;\n const enableDownload = options.enableDownload ?? false;\n const enableFormSave = options.onFormSubmit != null && hasFormFields;\n const {\n onAnnotationClick,\n outlineIcons\n } = options;\n return useMemo(() => ({\n ...viewer,\n highlightEnabled,\n highlightModeActive,\n toggleHighlightMode,\n hasFormFields,\n submitFormData,\n annotations,\n annotationsByPage,\n onAnnotationClick,\n enableDownload,\n enableFormSave,\n outlineIcons\n }), [viewer, highlightEnabled, highlightModeActive, toggleHighlightMode, hasFormFields, submitFormData, annotations, annotationsByPage, onAnnotationClick, enableDownload, enableFormSave, outlineIcons]);\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// PdfViewer\nexport { BasePdfViewer } from \"../../pdf-viewer/PdfViewer.js\";\n// PdfViewer building blocks\nexport { PdfViewerAnnotationLayer } from \"../../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport { PdfViewerContent } from \"../../pdf-viewer/components/PdfViewerContent.js\";\nexport { PdfViewerOutlineSidebar } from \"../../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport { PdfViewerSearchBar } from \"../../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport { PdfViewerSidebar } from \"../../pdf-viewer/components/PdfViewerSidebar.js\";\nexport { PdfViewerToolbar } from \"../../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport { usePdfAnnotationPortals } from \"../../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../../pdf-viewer/hooks/usePdfDocument.js\";\nexport { usePdfFormFields } from \"../../pdf-viewer/hooks/usePdfFormFields.js\";\nexport { usePdfHighlightMode } from \"../../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../../pdf-viewer/hooks/usePdfOutline.js\";\nexport { usePdfViewer } from \"../../pdf-viewer/hooks/usePdfViewer.js\";\nexport { usePdfViewerSearch } from \"../../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../../pdf-viewer/hooks/usePdfViewerSync.js\";\n// PdfViewer context\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../../pdf-viewer/PdfViewerContext.js\";\n// PdfViewer hooks — composition\nexport { usePdfViewerCore } from \"../../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport { usePdfViewerState } from \"../../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nimport { PdfViewer as _PdfViewer } from \"../../pdf-viewer/PdfRenderer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const PdfViewer = withOsdkMetrics(_PdfViewer, \"PdfViewer\");"]}
|
|
1
|
+
{"version":3,"sources":["../../src/pdf-viewer/components/PdfViewerContent.tsx","../../src/pdf-viewer/PdfViewerContext.tsx","../../src/public/experimental/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","PdfViewer_default","React","Spin","ErrorIcon","PdfAnnotationOverlay","useContext","usePdfViewerState","usePdfHighlightMode","useMemo","PdfViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;AA0BO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,GAAA;AAAA,EACA,WAAA,GAAcA,wCAAA;AAAA,EACd,iBAAA;AAAA,EACA,WAAA,GAAc,CAAA;AAAA,EACd,YAAA,GAAe,CAAA;AAAA,EACf,YAAA,EAAc,gBAAA;AAAA,EACd,aAAA,EAAe,iBAAA;AAAA,EACf,QAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,EAAG;AACD,EAAA,MAAM,SAASC,kCAAA,C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A;AAAA,IACA,mBAAA;AAAA,IACA,mBAAA;AAAA,IACA,aAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,iBAAA;AAAA,IACA,cAAA;AAAA,IACA,cAAA;AAAA,IACA;AAAA,GACF,CAAA,EAAI,CAAC,MAAA,EAAQ,gBAAA,EAAkB,qBAAqB,mBAAA,EAAqB,aAAA,EAAe,cAAA,EAAgB,WAAA,EAAa,iBAAA,EAAmB,iBAAA,EAAmB,cAAA,EAAgB,cAAA,EAAgB,YAAY,CAAC,CAAA;AAC1M;;;AC9DO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-4AGEVOFW.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\nimport { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport \"pdfjs-dist/web/pdf_viewer.css\";\nimport React, { useEffect, useRef } from \"react\";\nimport { EMPTY_ANNOTATION_ARRAY } from \"../constants.js\";\nimport { usePdfAnnotationsByPage } from \"../hooks/usePdfAnnotationsByPage.js\";\nimport { usePdfFormFields } from \"../hooks/usePdfFormFields.js\";\nimport { usePdfViewerCore } from \"../hooks/usePdfViewerCore.js\";\nimport styles from \"../PdfViewer.module.css\";\nimport { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n initialPage = 1,\n initialScale = 1.0,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n initialPage,\n initialScale\n });\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData,\n onFormChange\n });\n\n // Use refs for callbacks to avoid firing on initial mount\n const onPageChangeRef = useRef(onPageChangeProp);\n onPageChangeRef.current = onPageChangeProp;\n const onScaleChangeRef = useRef(onScaleChangeProp);\n onScaleChangeRef.current = onScaleChangeProp;\n const isInitialMountRef = useRef(true);\n useEffect(function notifyPageChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onPageChangeRef.current?.(viewer.currentPage);\n }, [viewer.currentPage]);\n useEffect(function notifyScaleChange() {\n if (isInitialMountRef.current) {\n return;\n }\n onScaleChangeRef.current?.(viewer.scale);\n }, [viewer.scale]);\n useEffect(function clearInitialMount() {\n isInitialMountRef.current = false;\n }, []);\n const rootClassName = classnames(styles.pdfViewer, className);\n if (viewer.loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Loading\\u2026\"));\n }\n if (viewer.error != null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.errorContainer\n }, /*#__PURE__*/React.createElement(ErrorIcon, {\n className: styles.errorIcon\n }), \"Failed to load PDF: \", viewer.error.message));\n }\n if (viewer.document == null) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, \"No document\"));\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.scrollContainerWrapper\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.containerRef,\n className: styles.scrollContainer\n }, /*#__PURE__*/React.createElement(\"div\", {\n ref: viewer.viewerRef,\n className: \"pdfViewer\"\n }), viewer.portalTargets.map(target => {\n const pageAnnotations = annotationsByPage[target.pageNumber] ?? EMPTY_ANNOTATION_ARRAY;\n if (pageAnnotations.length === 0) {\n return null;\n }\n return /*#__PURE__*/React.createElement(PdfAnnotationOverlay, {\n key: target.pageNumber,\n target: target,\n annotations: pageAnnotations,\n onAnnotationClick: onAnnotationClick\n });\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 React, { createContext, useContext, useMemo } from \"react\";\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\";\n\n/** The shape of the value provided by {@link PdfViewerProvider}. */\n\nconst PdfViewerContext = /*#__PURE__*/createContext(null);\n/** Provides {@link PdfViewerContextValue} to descendant components. */\nexport function PdfViewerProvider({\n value,\n children\n}) {\n return /*#__PURE__*/React.createElement(PdfViewerContext.Provider, {\n value: value\n }, children);\n}\n\n/**\n * Returns the nearest {@link PdfViewerContextValue} from a {@link PdfViewerProvider}.\n * Throws if called outside a provider.\n */\nexport function usePdfViewerContext() {\n const ctx = useContext(PdfViewerContext);\n if (ctx == null) {\n throw new Error(\"usePdfViewerContext must be used within a PdfViewerProvider\");\n }\n return ctx;\n}\n\n/**\n * Consumer-facing setup hook analogous to react-hook-form's `useForm()`.\n * Accepts viewer options and returns a {@link PdfViewerContextValue} suitable\n * for passing to {@link PdfViewerProvider}.\n */\nexport function usePdfViewerInstance(options) {\n const viewer = usePdfViewerState({\n src: options.src,\n initialPage: options.initialPage,\n initialScale: options.initialScale,\n initialAutoSize: options.initialAutoSize,\n initialSidebarOpen: options.initialSidebarOpen,\n sidebarMode: options.sidebarMode,\n onDownload: options.onDownload\n });\n const {\n highlightModeActive,\n toggleHighlightMode\n } = usePdfHighlightMode({\n pdfViewerRef: viewer.pdfViewerRef,\n document: viewer.document,\n enabled: options.highlightEnabled ?? false,\n onTextHighlight: options.onTextHighlight,\n onHighlightDelete: options.onHighlightDelete\n });\n const {\n hasFormFields,\n submitFormData\n } = usePdfFormFields({\n pdfViewerRef: viewer.pdfViewerRef,\n eventBusRef: viewer.eventBusRef,\n document: viewer.document,\n formData: options.formData,\n onFormSubmit: options.onFormSubmit,\n onFormChange: options.onFormChange\n });\n const annotations = options.annotations ?? EMPTY_ANNOTATION_ARRAY;\n const annotationsByPage = usePdfAnnotationsByPage(annotations);\n const highlightEnabled = options.highlightEnabled ?? false;\n const enableDownload = options.enableDownload ?? false;\n const enableFormSave = options.onFormSubmit != null && hasFormFields;\n const {\n onAnnotationClick,\n outlineIcons\n } = options;\n return useMemo(() => ({\n ...viewer,\n highlightEnabled,\n highlightModeActive,\n toggleHighlightMode,\n hasFormFields,\n submitFormData,\n annotations,\n annotationsByPage,\n onAnnotationClick,\n enableDownload,\n enableFormSave,\n outlineIcons\n }), [viewer, highlightEnabled, highlightModeActive, toggleHighlightMode, hasFormFields, submitFormData, annotations, annotationsByPage, onAnnotationClick, enableDownload, enableFormSave, outlineIcons]);\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// PdfViewer\nexport { BasePdfViewer } from \"../../pdf-viewer/PdfViewer.js\";\n// PdfViewer building blocks\nexport { PdfViewerAnnotationLayer } from \"../../pdf-viewer/components/PdfViewerAnnotationLayer.js\";\nexport { PdfViewerContent } from \"../../pdf-viewer/components/PdfViewerContent.js\";\nexport { PdfViewerOutlineSidebar } from \"../../pdf-viewer/components/PdfViewerOutlineSidebar.js\";\nexport { PdfViewerSearchBar } from \"../../pdf-viewer/components/PdfViewerSearchBar.js\";\nexport { PdfViewerSidebar } from \"../../pdf-viewer/components/PdfViewerSidebar.js\";\nexport { PdfViewerToolbar } from \"../../pdf-viewer/components/PdfViewerToolbar.js\";\n\n// PdfViewer hooks — primitive\nexport { usePdfAnnotationPortals } from \"../../pdf-viewer/hooks/usePdfAnnotationPortals.js\";\nexport { usePdfAnnotationsByPage } from \"../../pdf-viewer/hooks/usePdfAnnotationsByPage.js\";\nexport { usePdfDocument } from \"../../pdf-viewer/hooks/usePdfDocument.js\";\nexport { usePdfFormFields } from \"../../pdf-viewer/hooks/usePdfFormFields.js\";\nexport { usePdfHighlightMode } from \"../../pdf-viewer/hooks/usePdfHighlightMode.js\";\nexport { usePdfOutline } from \"../../pdf-viewer/hooks/usePdfOutline.js\";\nexport { usePdfViewer } from \"../../pdf-viewer/hooks/usePdfViewer.js\";\nexport { usePdfViewerSearch } from \"../../pdf-viewer/hooks/usePdfViewerSearch.js\";\nexport { usePdfViewerSync } from \"../../pdf-viewer/hooks/usePdfViewerSync.js\";\n// PdfViewer context\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../../pdf-viewer/PdfViewerContext.js\";\n// PdfViewer hooks — composition\nexport { usePdfViewerCore } from \"../../pdf-viewer/hooks/usePdfViewerCore.js\";\nexport { usePdfViewerState } from \"../../pdf-viewer/hooks/usePdfViewerState.js\";\n\n// PdfViewer (Media wrapper)\nimport { PdfViewer as _PdfViewer } from \"../../pdf-viewer/PdfRenderer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const PdfViewer = withOsdkMetrics(_PdfViewer, \"PdfViewer\");"]}
|
|
@@ -9,7 +9,7 @@ var chunkKHMOMROL_cjs = require('./chunk-KHMOMROL.cjs');
|
|
|
9
9
|
var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
|
|
10
10
|
var chunkPKJFOG2Z_cjs = require('./chunk-PKJFOG2Z.cjs');
|
|
11
11
|
var chunk3SJODG6U_cjs = require('./chunk-3SJODG6U.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
13
13
|
var icons = require('@blueprintjs/icons');
|
|
14
14
|
var classnames = require('classnames');
|
|
15
15
|
var React2 = require('react');
|
|
@@ -310,9 +310,9 @@ function DocumentViewer({
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// src/public/experimental/document-viewer.ts
|
|
313
|
-
var DocumentViewer2 =
|
|
313
|
+
var DocumentViewer2 = chunk364UCCB2_cjs.withOsdkMetrics(DocumentViewer, "DocumentViewer");
|
|
314
314
|
|
|
315
315
|
exports.DocumentViewer = DocumentViewer2;
|
|
316
316
|
exports.ViewerType = ViewerType;
|
|
317
|
-
//# sourceMappingURL=chunk-
|
|
318
|
-
//# sourceMappingURL=chunk-
|
|
317
|
+
//# sourceMappingURL=chunk-56CFJTXV.cjs.map
|
|
318
|
+
//# sourceMappingURL=chunk-56CFJTXV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/document-viewer/DocumentViewer.module.css","../../src/document-viewer/DocumentViewerApi.ts","../../src/document-viewer/hooks/useTiffToPdf.ts","../../src/document-viewer/TiffDocumentViewer.tsx","../../src/document-viewer/DocumentViewer.tsx","../../src/public/experimental/document-viewer.ts"],"names":["ViewerType","useOsdkClient","useState","useRef","useEffect","UTIF","__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait","React","Spin","BasePdfViewer","TiffViewerMedia","_extends","useMemo","classnames","PdfViewer","ImageViewer","VideoViewer","MarkdownViewerMedia","ExcelViewer","EmailViewer","XmlViewer","DocumentIcon","assertUnreachable","DocumentViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,sBAAA,GAAA,EAAA;;;ACgBO,IAAI,UAAA,6BAAoCA,WAAAA,EAAY;AACzD,EAAAA,WAAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AACpB,EAAAA,WAAAA,CAAW,MAAM,CAAA,GAAI,MAAA;AACrB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,UAAU,CAAA,GAAI,UAAA;AACzB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AACpB,EAAAA,WAAAA,CAAW,aAAa,CAAA,GAAI,aAAA;AAC5B,EAAA,OAAOA,WAAAA;AACT,CAAA,EAAE,EAAE;ACJJ,IAAM,eAAA,GAAkB;AAAA,EACtB,YAAY,UAAA,CAAW,IAAA;AAAA,EACvB,OAAA,EAAS,MAAA;AAAA,EACT,OAAA,EAAS,KAAA;AAAA,EACT,KAAA,EAAO;AACT,CAAA;AASO,SAAS,YAAA,CAAa,OAAO,OAAA,EAAS;AAC3C,EAAA,MAAM,SAASC,mBAAA,EAAc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js","sourcesContent":[".container {\n display: flex;\n width: 100%;\n height: 100%;\n background-color: var(--osdk-document-viewer-bg);\n border: var(--osdk-document-viewer-border);\n border-radius: var(--osdk-surface-border-radius);\n overflow: hidden;\n}\n\n.unsupportedContainer {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--osdk-surface-spacing);\n width: 100%;\n height: 100%;\n font-family: var(--osdk-typography-family-default);\n font-size: var(--osdk-typography-size-body-medium);\n color: var(--osdk-typography-color-muted);\n}\n\n.unsupportedIcon {\n flex-shrink: 0;\n}\n\n.loadingContainer {\n composes: loadingContainer from \"../shared/LoadingError.module.css\";\n width: 100%;\n}\n\n.spinnerIcon {\n composes: spinnerIcon from \"../shared/LoadingError.module.css\";\n}\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\nexport let ViewerType = /*#__PURE__*/function (ViewerType) {\n ViewerType[\"Pdf\"] = \"pdf\";\n ViewerType[\"Tiff\"] = \"tiff\";\n ViewerType[\"Image\"] = \"image\";\n ViewerType[\"Video\"] = \"video\";\n ViewerType[\"Markdown\"] = \"markdown\";\n ViewerType[\"Excel\"] = \"excel\";\n ViewerType[\"Email\"] = \"email\";\n ViewerType[\"Xml\"] = \"xml\";\n ViewerType[\"Unsupported\"] = \"unsupported\";\n return ViewerType;\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\n/* cspell:words ifds */\n\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait } from \"@osdk/api/unstable\";\nimport { useOsdkClient } from \"@osdk/react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport * as UTIF from \"utif\";\nimport { ViewerType } from \"../DocumentViewerApi.js\";\nconst DISABLED_RESULT = {\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: undefined\n};\n\n/**\n * Detects multi-page TIFFs and converts them to PDF via the MIO transform API.\n * Single-page TIFFs are left for the TiffRenderer to handle.\n *\n * @param media - The OSDK Media object (must be a TIFF)\n * @param enabled - Whether to attempt multi-page detection and conversion\n */\nexport function useTiffToPdf(media, enabled) {\n const client = useOsdkClient();\n const [result, setResult] = useState(DISABLED_RESULT);\n const mediaRef = useRef(media);\n mediaRef.current = media;\n useEffect(() => {\n if (!enabled) {\n setResult(DISABLED_RESULT);\n return;\n }\n let cancelled = false;\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: true,\n error: undefined\n });\n async function detectAndTransform() {\n const currentMedia = mediaRef.current;\n\n // Step 1: Fetch TIFF bytes and count pages\n const response = await currentMedia.fetchContents();\n const buffer = await response.arrayBuffer();\n if (cancelled) return;\n const ifds = UTIF.decode(buffer);\n const pageCount = ifds.length;\n if (pageCount <= 1) {\n // Single-page TIFF — use TiffRenderer\n if (!cancelled) {\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: undefined\n });\n }\n return;\n }\n\n // Step 2: Multi-page TIFF — convert to PDF via MIO transform\n const mediaReference = currentMedia.getMediaReference();\n const pdfResponse = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait).transformAndWait({\n mediaReference,\n transformation: {\n $imageToDocument: {\n $operation: {\n $createPdf: {}\n }\n }\n }\n });\n if (cancelled) return;\n const pdfBuffer = await pdfResponse.arrayBuffer();\n if (!cancelled) {\n setResult({\n viewerType: ViewerType.Pdf,\n pdfData: pdfBuffer,\n loading: false,\n error: undefined\n });\n }\n }\n detectAndTransform().catch(err => {\n if (!cancelled) {\n // eslint-disable-next-line no-console\n console.warn(\"TIFF to PDF conversion failed, falling back to TIFF renderer:\", err);\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: err instanceof Error ? err : new Error(String(err))\n });\n }\n });\n return () => {\n cancelled = true;\n };\n }, [media, enabled, client]);\n return result;\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 { Spin } from \"@blueprintjs/icons\";\nimport React from \"react\";\nimport { TiffViewerMedia } from \"../images/tiff-renderer/TiffViewerMedia.js\";\nimport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nimport styles from \"./DocumentViewer.module.css\";\nimport { ViewerType } from \"./DocumentViewerApi.js\";\nimport { useTiffToPdf } from \"./hooks/useTiffToPdf.js\";\nexport function TiffDocumentViewer({\n media,\n className,\n enableTiffToPdf,\n tiffRendererProps,\n pdfViewerProps\n}) {\n const {\n viewerType,\n pdfData,\n loading\n } = useTiffToPdf(media, enableTiffToPdf);\n if (loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Converting document\\u2026\"));\n }\n if (viewerType === ViewerType.Pdf && pdfData != null) {\n return /*#__PURE__*/React.createElement(BasePdfViewer, _extends({\n src: pdfData,\n className: className\n }, pdfViewerProps));\n }\n return /*#__PURE__*/React.createElement(TiffViewerMedia, _extends({\n media: media,\n className: className\n }, tiffRendererProps));\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\n/* cspell:words openxmlformats officedocument wordprocessingml spreadsheetml */\n\nimport { Document as DocumentIcon } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React, { useMemo } from \"react\";\nimport { EmailViewer } from \"../email-viewer/EmailViewer.js\";\nimport { ExcelViewer } from \"../excel-viewer/ExcelViewer.js\";\nimport { ImageViewer } from \"../images/image-viewer/ImageViewer.js\";\nimport { TiffViewerMedia } from \"../images/tiff-renderer/TiffViewerMedia.js\";\nimport { MarkdownViewerMedia } from \"../markdown-renderer/MarkdownViewerMedia.js\";\nimport { PdfViewer } from \"../pdf-viewer/PdfRenderer.js\";\nimport { assertUnreachable } from \"../shared/assertUnreachable.js\";\nimport { VideoViewer } from \"../video-viewer/VideoViewer.js\";\nimport { XmlViewer } from \"../xml-viewer/XmlViewer.js\";\nimport styles from \"./DocumentViewer.module.css\";\nimport { ViewerType } from \"./DocumentViewerApi.js\";\nimport { TiffDocumentViewer } from \"./TiffDocumentViewer.js\";\nconst IMAGE_MIME_TYPES = new Set([\"image/png\", \"image/jpeg\", \"image/gif\", \"image/svg+xml\", \"image/webp\", \"image/bmp\"]);\nconst MARKDOWN_MIME_TYPES = new Set([\"text/markdown\", \"text/x-markdown\"]);\nconst XML_MIME_TYPES = new Set([\"application/xml\", \"text/xml\"]);\nfunction isTiffFile(mimeType, fileName) {\n if (mimeType === \"image/tiff\") {\n return true;\n }\n const lowered = fileName?.toLowerCase();\n return lowered?.endsWith(\".tif\") === true || lowered?.endsWith(\".tiff\") === true;\n}\nfunction getViewerType(mimeType, fileName) {\n if (mimeType === \"application/pdf\") {\n return ViewerType.Pdf;\n }\n if (isTiffFile(mimeType, fileName)) {\n return ViewerType.Tiff;\n }\n if (IMAGE_MIME_TYPES.has(mimeType)) {\n return ViewerType.Image;\n }\n if (mimeType.startsWith(\"video/\")) {\n return ViewerType.Video;\n }\n if (MARKDOWN_MIME_TYPES.has(mimeType)) {\n return ViewerType.Markdown;\n }\n if (mimeType === \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\") {\n return ViewerType.Excel;\n }\n if (mimeType === \"message/rfc822\") {\n return ViewerType.Email;\n }\n if (XML_MIME_TYPES.has(mimeType)) {\n return ViewerType.Xml;\n }\n return ViewerType.Unsupported;\n}\nexport function DocumentViewer({\n media,\n className,\n mimeTypeOverride,\n pdfViewerProps,\n imageViewerProps,\n videoViewerProps,\n tiffRendererProps,\n markdownRendererProps,\n excelViewerProps,\n emailViewerProps,\n xmlViewerProps,\n fileName,\n enableTiffToPdf = false\n}) {\n const mimeType = mimeTypeOverride ?? media.getMediaReference().mimeType;\n const viewerType = useMemo(() => getViewerType(mimeType, fileName), [mimeType, fileName]);\n const rootClassName = classnames(styles.container, className);\n switch (viewerType) {\n case ViewerType.Pdf:\n return /*#__PURE__*/React.createElement(PdfViewer, _extends({\n media: media,\n className: rootClassName\n }, pdfViewerProps));\n case ViewerType.Tiff:\n if (enableTiffToPdf) {\n return /*#__PURE__*/React.createElement(TiffDocumentViewer, {\n media: media,\n className: rootClassName,\n enableTiffToPdf: enableTiffToPdf,\n tiffRendererProps: tiffRendererProps,\n pdfViewerProps: pdfViewerProps\n });\n }\n return /*#__PURE__*/React.createElement(TiffViewerMedia, _extends({\n media: media,\n className: rootClassName\n }, tiffRendererProps));\n case ViewerType.Image:\n return /*#__PURE__*/React.createElement(ImageViewer, _extends({\n media: media,\n className: rootClassName\n }, imageViewerProps));\n case ViewerType.Video:\n return /*#__PURE__*/React.createElement(VideoViewer, _extends({\n media: media,\n className: rootClassName\n }, videoViewerProps));\n case ViewerType.Markdown:\n return /*#__PURE__*/React.createElement(MarkdownViewerMedia, _extends({\n media: media,\n className: rootClassName\n }, markdownRendererProps));\n case ViewerType.Excel:\n return /*#__PURE__*/React.createElement(ExcelViewer, _extends({\n media: media,\n className: rootClassName\n }, excelViewerProps));\n case ViewerType.Email:\n return /*#__PURE__*/React.createElement(EmailViewer, _extends({\n media: media,\n className: rootClassName\n }, emailViewerProps));\n case ViewerType.Xml:\n return /*#__PURE__*/React.createElement(XmlViewer, _extends({\n media: media,\n className: rootClassName\n }, xmlViewerProps));\n case ViewerType.Unsupported:\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.unsupportedContainer\n }, /*#__PURE__*/React.createElement(DocumentIcon, {\n className: styles.unsupportedIcon\n }), \"Unsupported file type: \", mimeType));\n default:\n assertUnreachable(viewerType);\n }\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\n// DocumentViewer\nimport { DocumentViewer as _DocumentViewer } from \"../../document-viewer/DocumentViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const DocumentViewer = withOsdkMetrics(_DocumentViewer, \"DocumentViewer\");\nexport { ViewerType } from \"../../document-viewer/DocumentViewerApi.js\";"]}
|
|
1
|
+
{"version":3,"sources":["../../src/document-viewer/DocumentViewer.module.css","../../src/document-viewer/DocumentViewerApi.ts","../../src/document-viewer/hooks/useTiffToPdf.ts","../../src/document-viewer/TiffDocumentViewer.tsx","../../src/document-viewer/DocumentViewer.tsx","../../src/public/experimental/document-viewer.ts"],"names":["ViewerType","useOsdkClient","useState","useRef","useEffect","UTIF","__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait","React","Spin","BasePdfViewer","TiffViewerMedia","_extends","useMemo","classnames","PdfViewer","ImageViewer","VideoViewer","MarkdownViewerMedia","ExcelViewer","EmailViewer","XmlViewer","DocumentIcon","assertUnreachable","DocumentViewer","withOsdkMetrics"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA,sBAAA,GAAA,EAAA;;;ACgBO,IAAI,UAAA,6BAAoCA,WAAAA,EAAY;AACzD,EAAAA,WAAAA,CAAW,KAAK,CAAA,GAAI,KAAA;AACpB,EAAAA,WAAAA,CAAW,MAAM,CAAA,GAAI,MAAA;AACrB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAAA,CAAW,UAAU,CAAA,GAAI,UAAA;AACzB,EAAAA,WAAAA,CAAW,OAAO,CAAA,GAAI,OAAA;AACtB,EAAAA,WAAA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AAA,QAC7C,SAAA,EAAW;AAAA,OACb,kBAAgBA,uBAAAA,CAAM,aAAA,CAAc,KAAA,EAAO;AAAA,QACzC,WAAW,sBAAA,CAAO;AAAA,OACpB,kBAAgBA,uBAAAA,CAAM,aAAA,CAAcc,cAAA,EAAc;AAAA,QAChD,WAAW,sBAAA,CAAO;AAAA,OACnB,CAAA,EAAG,yBAAA,EAA2B,QAAQ,CAAC,CAAA;AAAA,IAC1C;AACE,MAAAC,mCAAA,CAAkB,UAAU,CAAA;AAAA;AAElC;;;ACnIO,IAAMC,eAAAA,GAAiBC,iCAAA,CAAgB,cAAA,EAAiB,gBAAgB","file":"chunk-56CFJTXV.cjs","sourcesContent":[".container {\n display: flex;\n width: 100%;\n height: 100%;\n background-color: var(--osdk-document-viewer-bg);\n border: var(--osdk-document-viewer-border);\n border-radius: var(--osdk-surface-border-radius);\n overflow: hidden;\n}\n\n.unsupportedContainer {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: var(--osdk-surface-spacing);\n width: 100%;\n height: 100%;\n font-family: var(--osdk-typography-family-default);\n font-size: var(--osdk-typography-size-body-medium);\n color: var(--osdk-typography-color-muted);\n}\n\n.unsupportedIcon {\n flex-shrink: 0;\n}\n\n.loadingContainer {\n composes: loadingContainer from \"../shared/LoadingError.module.css\";\n width: 100%;\n}\n\n.spinnerIcon {\n composes: spinnerIcon from \"../shared/LoadingError.module.css\";\n}\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\nexport let ViewerType = /*#__PURE__*/function (ViewerType) {\n ViewerType[\"Pdf\"] = \"pdf\";\n ViewerType[\"Tiff\"] = \"tiff\";\n ViewerType[\"Image\"] = \"image\";\n ViewerType[\"Video\"] = \"video\";\n ViewerType[\"Markdown\"] = \"markdown\";\n ViewerType[\"Excel\"] = \"excel\";\n ViewerType[\"Email\"] = \"email\";\n ViewerType[\"Xml\"] = \"xml\";\n ViewerType[\"Unsupported\"] = \"unsupported\";\n return ViewerType;\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\n/* cspell:words ifds */\n\nimport { __EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait } from \"@osdk/api/unstable\";\nimport { useOsdkClient } from \"@osdk/react\";\nimport { useEffect, useRef, useState } from \"react\";\nimport * as UTIF from \"utif\";\nimport { ViewerType } from \"../DocumentViewerApi.js\";\nconst DISABLED_RESULT = {\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: undefined\n};\n\n/**\n * Detects multi-page TIFFs and converts them to PDF via the MIO transform API.\n * Single-page TIFFs are left for the TiffRenderer to handle.\n *\n * @param media - The OSDK Media object (must be a TIFF)\n * @param enabled - Whether to attempt multi-page detection and conversion\n */\nexport function useTiffToPdf(media, enabled) {\n const client = useOsdkClient();\n const [result, setResult] = useState(DISABLED_RESULT);\n const mediaRef = useRef(media);\n mediaRef.current = media;\n useEffect(() => {\n if (!enabled) {\n setResult(DISABLED_RESULT);\n return;\n }\n let cancelled = false;\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: true,\n error: undefined\n });\n async function detectAndTransform() {\n const currentMedia = mediaRef.current;\n\n // Step 1: Fetch TIFF bytes and count pages\n const response = await currentMedia.fetchContents();\n const buffer = await response.arrayBuffer();\n if (cancelled) return;\n const ifds = UTIF.decode(buffer);\n const pageCount = ifds.length;\n if (pageCount <= 1) {\n // Single-page TIFF — use TiffRenderer\n if (!cancelled) {\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: undefined\n });\n }\n return;\n }\n\n // Step 2: Multi-page TIFF — convert to PDF via MIO transform\n const mediaReference = currentMedia.getMediaReference();\n const pdfResponse = await client(__EXPERIMENTAL__NOT_SUPPORTED_YET__transformAndWait).transformAndWait({\n mediaReference,\n transformation: {\n $imageToDocument: {\n $operation: {\n $createPdf: {}\n }\n }\n }\n });\n if (cancelled) return;\n const pdfBuffer = await pdfResponse.arrayBuffer();\n if (!cancelled) {\n setResult({\n viewerType: ViewerType.Pdf,\n pdfData: pdfBuffer,\n loading: false,\n error: undefined\n });\n }\n }\n detectAndTransform().catch(err => {\n if (!cancelled) {\n // eslint-disable-next-line no-console\n console.warn(\"TIFF to PDF conversion failed, falling back to TIFF renderer:\", err);\n setResult({\n viewerType: ViewerType.Tiff,\n pdfData: undefined,\n loading: false,\n error: err instanceof Error ? err : new Error(String(err))\n });\n }\n });\n return () => {\n cancelled = true;\n };\n }, [media, enabled, client]);\n return result;\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 { Spin } from \"@blueprintjs/icons\";\nimport React from \"react\";\nimport { TiffViewerMedia } from \"../images/tiff-renderer/TiffViewerMedia.js\";\nimport { BasePdfViewer } from \"../pdf-viewer/PdfViewer.js\";\nimport styles from \"./DocumentViewer.module.css\";\nimport { ViewerType } from \"./DocumentViewerApi.js\";\nimport { useTiffToPdf } from \"./hooks/useTiffToPdf.js\";\nexport function TiffDocumentViewer({\n media,\n className,\n enableTiffToPdf,\n tiffRendererProps,\n pdfViewerProps\n}) {\n const {\n viewerType,\n pdfData,\n loading\n } = useTiffToPdf(media, enableTiffToPdf);\n if (loading) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Converting document\\u2026\"));\n }\n if (viewerType === ViewerType.Pdf && pdfData != null) {\n return /*#__PURE__*/React.createElement(BasePdfViewer, _extends({\n src: pdfData,\n className: className\n }, pdfViewerProps));\n }\n return /*#__PURE__*/React.createElement(TiffViewerMedia, _extends({\n media: media,\n className: className\n }, tiffRendererProps));\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\n/* cspell:words openxmlformats officedocument wordprocessingml spreadsheetml */\n\nimport { Document as DocumentIcon } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React, { useMemo } from \"react\";\nimport { EmailViewer } from \"../email-viewer/EmailViewer.js\";\nimport { ExcelViewer } from \"../excel-viewer/ExcelViewer.js\";\nimport { ImageViewer } from \"../images/image-viewer/ImageViewer.js\";\nimport { TiffViewerMedia } from \"../images/tiff-renderer/TiffViewerMedia.js\";\nimport { MarkdownViewerMedia } from \"../markdown-renderer/MarkdownViewerMedia.js\";\nimport { PdfViewer } from \"../pdf-viewer/PdfRenderer.js\";\nimport { assertUnreachable } from \"../shared/assertUnreachable.js\";\nimport { VideoViewer } from \"../video-viewer/VideoViewer.js\";\nimport { XmlViewer } from \"../xml-viewer/XmlViewer.js\";\nimport styles from \"./DocumentViewer.module.css\";\nimport { ViewerType } from \"./DocumentViewerApi.js\";\nimport { TiffDocumentViewer } from \"./TiffDocumentViewer.js\";\nconst IMAGE_MIME_TYPES = new Set([\"image/png\", \"image/jpeg\", \"image/gif\", \"image/svg+xml\", \"image/webp\", \"image/bmp\"]);\nconst MARKDOWN_MIME_TYPES = new Set([\"text/markdown\", \"text/x-markdown\"]);\nconst XML_MIME_TYPES = new Set([\"application/xml\", \"text/xml\"]);\nfunction isTiffFile(mimeType, fileName) {\n if (mimeType === \"image/tiff\") {\n return true;\n }\n const lowered = fileName?.toLowerCase();\n return lowered?.endsWith(\".tif\") === true || lowered?.endsWith(\".tiff\") === true;\n}\nfunction getViewerType(mimeType, fileName) {\n if (mimeType === \"application/pdf\") {\n return ViewerType.Pdf;\n }\n if (isTiffFile(mimeType, fileName)) {\n return ViewerType.Tiff;\n }\n if (IMAGE_MIME_TYPES.has(mimeType)) {\n return ViewerType.Image;\n }\n if (mimeType.startsWith(\"video/\")) {\n return ViewerType.Video;\n }\n if (MARKDOWN_MIME_TYPES.has(mimeType)) {\n return ViewerType.Markdown;\n }\n if (mimeType === \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\") {\n return ViewerType.Excel;\n }\n if (mimeType === \"message/rfc822\") {\n return ViewerType.Email;\n }\n if (XML_MIME_TYPES.has(mimeType)) {\n return ViewerType.Xml;\n }\n return ViewerType.Unsupported;\n}\nexport function DocumentViewer({\n media,\n className,\n mimeTypeOverride,\n pdfViewerProps,\n imageViewerProps,\n videoViewerProps,\n tiffRendererProps,\n markdownRendererProps,\n excelViewerProps,\n emailViewerProps,\n xmlViewerProps,\n fileName,\n enableTiffToPdf = false\n}) {\n const mimeType = mimeTypeOverride ?? media.getMediaReference().mimeType;\n const viewerType = useMemo(() => getViewerType(mimeType, fileName), [mimeType, fileName]);\n const rootClassName = classnames(styles.container, className);\n switch (viewerType) {\n case ViewerType.Pdf:\n return /*#__PURE__*/React.createElement(PdfViewer, _extends({\n media: media,\n className: rootClassName\n }, pdfViewerProps));\n case ViewerType.Tiff:\n if (enableTiffToPdf) {\n return /*#__PURE__*/React.createElement(TiffDocumentViewer, {\n media: media,\n className: rootClassName,\n enableTiffToPdf: enableTiffToPdf,\n tiffRendererProps: tiffRendererProps,\n pdfViewerProps: pdfViewerProps\n });\n }\n return /*#__PURE__*/React.createElement(TiffViewerMedia, _extends({\n media: media,\n className: rootClassName\n }, tiffRendererProps));\n case ViewerType.Image:\n return /*#__PURE__*/React.createElement(ImageViewer, _extends({\n media: media,\n className: rootClassName\n }, imageViewerProps));\n case ViewerType.Video:\n return /*#__PURE__*/React.createElement(VideoViewer, _extends({\n media: media,\n className: rootClassName\n }, videoViewerProps));\n case ViewerType.Markdown:\n return /*#__PURE__*/React.createElement(MarkdownViewerMedia, _extends({\n media: media,\n className: rootClassName\n }, markdownRendererProps));\n case ViewerType.Excel:\n return /*#__PURE__*/React.createElement(ExcelViewer, _extends({\n media: media,\n className: rootClassName\n }, excelViewerProps));\n case ViewerType.Email:\n return /*#__PURE__*/React.createElement(EmailViewer, _extends({\n media: media,\n className: rootClassName\n }, emailViewerProps));\n case ViewerType.Xml:\n return /*#__PURE__*/React.createElement(XmlViewer, _extends({\n media: media,\n className: rootClassName\n }, xmlViewerProps));\n case ViewerType.Unsupported:\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, /*#__PURE__*/React.createElement(\"div\", {\n className: styles.unsupportedContainer\n }, /*#__PURE__*/React.createElement(DocumentIcon, {\n className: styles.unsupportedIcon\n }), \"Unsupported file type: \", mimeType));\n default:\n assertUnreachable(viewerType);\n }\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\n// DocumentViewer\nimport { DocumentViewer as _DocumentViewer } from \"../../document-viewer/DocumentViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const DocumentViewer = withOsdkMetrics(_DocumentViewer, \"DocumentViewer\");\nexport { ViewerType } from \"../../document-viewer/DocumentViewerApi.js\";"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKHMOMROL_cjs = require('./chunk-KHMOMROL.cjs');
|
|
4
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/experimental/video-viewer.ts
|
|
7
|
+
var VideoViewer2 = chunk364UCCB2_cjs.withOsdkMetrics(chunkKHMOMROL_cjs.VideoViewer, "VideoViewer");
|
|
8
|
+
|
|
9
|
+
exports.VideoViewer = VideoViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-AEFCONAY.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-AEFCONAY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/video-viewer.ts"],"names":["VideoViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/video-viewer.ts"],"names":["VideoViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-AEFCONAY.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// BaseVideoViewer\nexport { BaseVideoViewer } from \"../../video-viewer/BaseVideoViewer.js\";\n// VideoViewer (Media wrapper)\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nimport { VideoViewer as _VideoViewer } from \"../../video-viewer/VideoViewer.js\";\nexport const VideoViewer = withOsdkMetrics(_VideoViewer, \"VideoViewer\");"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkPKJFOG2Z_cjs = require('./chunk-PKJFOG2Z.cjs');
|
|
4
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/experimental/email-viewer.ts
|
|
7
|
+
var EmailViewer2 = chunk364UCCB2_cjs.withOsdkMetrics(chunkPKJFOG2Z_cjs.EmailViewer, "EmailViewer");
|
|
8
|
+
|
|
9
|
+
exports.EmailViewer = EmailViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-D6RQIMMX.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-D6RQIMMX.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-D6RQIMMX.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// BaseEmailViewer\nexport { BaseEmailViewer } from \"../../email-viewer/BaseEmailViewer.js\";\n// EmailViewer (Media wrapper)\nimport { EmailViewer as _EmailViewer } from \"../../email-viewer/EmailViewer.js\";\nimport { withOsdkMetrics } from \"../../util/withOsdkMetrics.js\";\nexport const EmailViewer = withOsdkMetrics(_EmailViewer, \"EmailViewer\");"]}
|
|
@@ -10,7 +10,7 @@ var chunkDWNKXV5E_cjs = require('./chunk-DWNKXV5E.cjs');
|
|
|
10
10
|
var chunkHNBSGCSZ_cjs = require('./chunk-HNBSGCSZ.cjs');
|
|
11
11
|
var chunk7LXS66DW_cjs = require('./chunk-7LXS66DW.cjs');
|
|
12
12
|
var chunkMD4KDE44_cjs = require('./chunk-MD4KDE44.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunk364UCCB2_cjs = require('./chunk-364UCCB2.cjs');
|
|
14
14
|
var reactTable = require('@tanstack/react-table');
|
|
15
15
|
var React16 = require('react');
|
|
16
16
|
var react = require('@osdk/react');
|
|
@@ -3234,7 +3234,7 @@ function ObjectTable({
|
|
|
3234
3234
|
}
|
|
3235
3235
|
|
|
3236
3236
|
// src/public/experimental/object-table.ts
|
|
3237
|
-
var ObjectTable2 =
|
|
3237
|
+
var ObjectTable2 = chunk364UCCB2_cjs.withOsdkMetrics(ObjectTable, "ObjectTable");
|
|
3238
3238
|
|
|
3239
3239
|
exports.BaseTable = BaseTable;
|
|
3240
3240
|
exports.ColumnConfigDialog = ColumnConfigDialog;
|
|
@@ -3242,5 +3242,5 @@ exports.LoadingCell = LoadingCell;
|
|
|
3242
3242
|
exports.LoadingCellContent = LoadingCellContent;
|
|
3243
3243
|
exports.MultiColumnSortDialog = MultiColumnSortDialog;
|
|
3244
3244
|
exports.ObjectTable = ObjectTable2;
|
|
3245
|
-
//# sourceMappingURL=chunk-
|
|
3246
|
-
//# sourceMappingURL=chunk-
|
|
3245
|
+
//# sourceMappingURL=chunk-LYAAHEAS.cjs.map
|
|
3246
|
+
//# sourceMappingURL=chunk-LYAAHEAS.cjs.map
|