@osdk/react-components 0.25.0 → 0.26.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 +6 -0
- package/build/browser/excel-viewer/parseSpreadsheet.js +1 -1
- package/build/browser/excel-viewer/parseSpreadsheet.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/cjs/{chunk-5JJQ5X5R.cjs → chunk-3FFHTVG7.cjs} +6 -6
- package/build/cjs/{chunk-5JJQ5X5R.cjs.map → chunk-3FFHTVG7.cjs.map} +1 -1
- package/build/cjs/{chunk-4VJIPB7R.cjs → chunk-3SJODG6U.cjs} +5 -5
- package/build/cjs/chunk-3SJODG6U.cjs.map +1 -0
- package/build/cjs/{chunk-6L63NPQG.cjs → chunk-3VL5YVFA.cjs} +4 -4
- package/build/cjs/{chunk-6L63NPQG.cjs.map → chunk-3VL5YVFA.cjs.map} +1 -1
- package/build/cjs/{chunk-XWS2AC35.cjs → chunk-DY6YZDDT.cjs} +4 -4
- package/build/cjs/{chunk-XWS2AC35.cjs.map → chunk-DY6YZDDT.cjs.map} +1 -1
- package/build/cjs/chunk-GKWXRVFO.cjs +11 -0
- package/build/cjs/{chunk-WWLCXYON.cjs.map → chunk-GKWXRVFO.cjs.map} +1 -1
- package/build/cjs/{chunk-JP47JG5E.cjs → chunk-IFOPHNX3.cjs} +4 -4
- package/build/cjs/{chunk-JP47JG5E.cjs.map → chunk-IFOPHNX3.cjs.map} +1 -1
- package/build/cjs/chunk-JPVZGQXS.cjs +11 -0
- package/build/cjs/{chunk-IR6JZWJL.cjs.map → chunk-JPVZGQXS.cjs.map} +1 -1
- package/build/cjs/{chunk-35GST4FB.cjs → chunk-OZ3OGPEA.cjs} +4 -4
- package/build/cjs/{chunk-35GST4FB.cjs.map → chunk-OZ3OGPEA.cjs.map} +1 -1
- package/build/cjs/{chunk-QT5CNZF3.cjs → chunk-RDILWZTC.cjs} +4 -4
- package/build/cjs/{chunk-QT5CNZF3.cjs.map → chunk-RDILWZTC.cjs.map} +1 -1
- package/build/cjs/chunk-UJXNFENA.cjs +11 -0
- package/build/cjs/{chunk-QUDOYYWI.cjs.map → chunk-UJXNFENA.cjs.map} +1 -1
- package/build/cjs/{chunk-MQTQLA4O.cjs → chunk-UTB55N5Y.cjs} +3 -3
- package/build/cjs/{chunk-MQTQLA4O.cjs.map → chunk-UTB55N5Y.cjs.map} +1 -1
- package/build/cjs/chunk-W6C6UWUN.cjs +11 -0
- package/build/cjs/{chunk-ZQTIVTJW.cjs.map → chunk-W6C6UWUN.cjs.map} +1 -1
- package/build/cjs/{chunk-VW7HAI4H.cjs → chunk-Y4OUZFGE.cjs} +4 -4
- package/build/cjs/{chunk-VW7HAI4H.cjs.map → chunk-Y4OUZFGE.cjs.map} +1 -1
- package/build/cjs/chunk-YLYICFCA.cjs +11 -0
- package/build/cjs/{chunk-UXOUQ5BH.cjs.map → chunk-YLYICFCA.cjs.map} +1 -1
- package/build/cjs/public/experimental/action-form.cjs +4 -4
- package/build/cjs/public/experimental/document-viewer.cjs +5 -5
- package/build/cjs/public/experimental/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/excel-viewer.cjs +5 -5
- 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 +50 -50
- package/build/esm/excel-viewer/parseSpreadsheet.js +1 -1
- package/build/esm/excel-viewer/parseSpreadsheet.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/package.json +5 -5
- package/build/cjs/chunk-4VJIPB7R.cjs.map +0 -1
- package/build/cjs/chunk-IR6JZWJL.cjs +0 -11
- package/build/cjs/chunk-QUDOYYWI.cjs +0 -11
- package/build/cjs/chunk-UXOUQ5BH.cjs +0 -11
- package/build/cjs/chunk-WWLCXYON.cjs +0 -11
- package/build/cjs/chunk-ZQTIVTJW.cjs +0 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 67d5449: Replace `xlsx` dependency with `xlsx-republish`, a community republish of the latest SheetJS CDN release (`0.20.3`) back to npm. The maintainer-published `xlsx` on npm is pinned at `0.18.5` (which has a known prototype-pollution CVE) and SheetJS now distributes fixed releases only via their own CDN, so npm consumers cannot get a patched version through the registry.
|
|
8
|
+
|
|
3
9
|
## 0.25.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
/* cspell:words defval */
|
|
18
18
|
|
|
19
|
-
import { read, utils } from "xlsx";
|
|
19
|
+
import { read, utils } from "xlsx-republish";
|
|
20
20
|
export async function parseSpreadsheetFromResponse(response) {
|
|
21
21
|
const buffer = await response.arrayBuffer();
|
|
22
22
|
const workbook = read(buffer, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseSpreadsheet.js","names":["read","utils","parseSpreadsheetFromResponse","response","buffer","arrayBuffer","workbook","type","sheets","SheetNames","map","name","sheet","Sheets","rows","sheet_to_json","header","defval","raw"],"sources":["parseSpreadsheet.ts"],"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/* cspell:words defval */\n\nimport { read, utils } from \"xlsx\";\nimport type { ParsedSpreadsheet, SheetData } from \"./ExcelViewerApi.js\";\n\nexport async function parseSpreadsheetFromResponse(\n response: Response,\n): Promise<ParsedSpreadsheet> {\n const buffer = await response.arrayBuffer();\n const workbook = read(buffer, { type: \"array\" });\n\n const sheets: SheetData[] = workbook.SheetNames.map((name) => {\n const sheet = workbook.Sheets[name];\n const rows: string[][] = sheet != null\n ? utils.sheet_to_json<string[]>(sheet, {\n header: 1,\n defval: \"\",\n raw: false,\n })\n : [];\n return { name, rows };\n });\n\n return { sheets };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"parseSpreadsheet.js","names":["read","utils","parseSpreadsheetFromResponse","response","buffer","arrayBuffer","workbook","type","sheets","SheetNames","map","name","sheet","Sheets","rows","sheet_to_json","header","defval","raw"],"sources":["parseSpreadsheet.ts"],"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/* cspell:words defval */\n\nimport { read, utils } from \"xlsx-republish\";\nimport type { ParsedSpreadsheet, SheetData } from \"./ExcelViewerApi.js\";\n\nexport async function parseSpreadsheetFromResponse(\n response: Response,\n): Promise<ParsedSpreadsheet> {\n const buffer = await response.arrayBuffer();\n const workbook = read(buffer, { type: \"array\" });\n\n const sheets: SheetData[] = workbook.SheetNames.map((name) => {\n const sheet = workbook.Sheets[name];\n const rows: string[][] = sheet != null\n ? utils.sheet_to_json<string[]>(sheet, {\n header: 1,\n defval: \"\",\n raw: false,\n })\n : [];\n return { name, rows };\n });\n\n return { sheets };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,SAASA,IAAI,EAAEC,KAAK,QAAQ,gBAAgB;AAG5C,OAAO,eAAeC,4BAA4BA,CAChDC,QAAkB,EACU;EAC5B,MAAMC,MAAM,GAAG,MAAMD,QAAQ,CAACE,WAAW,CAAC,CAAC;EAC3C,MAAMC,QAAQ,GAAGN,IAAI,CAACI,MAAM,EAAE;IAAEG,IAAI,EAAE;EAAQ,CAAC,CAAC;EAEhD,MAAMC,MAAmB,GAAGF,QAAQ,CAACG,UAAU,CAACC,GAAG,CAAEC,IAAI,IAAK;IAC5D,MAAMC,KAAK,GAAGN,QAAQ,CAACO,MAAM,CAACF,IAAI,CAAC;IACnC,MAAMG,IAAgB,GAAGF,KAAK,IAAI,IAAI,GAClCX,KAAK,CAACc,aAAa,CAAWH,KAAK,EAAE;MACrCI,MAAM,EAAE,CAAC;MACTC,MAAM,EAAE,EAAE;MACVC,GAAG,EAAE;IACP,CAAC,CAAC,GACA,EAAE;IACN,OAAO;MAAEP,IAAI;MAAEG;IAAK,CAAC;EACvB,CAAC,CAAC;EAEF,OAAO;IAAEN;EAAO,CAAC;AACnB","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.26.0"}`;
|
|
18
18
|
export function componentUserAgent(componentName) {
|
|
19
19
|
return `${PACKAGE_USER_AGENT}/${componentName}`;
|
|
20
20
|
}
|
|
@@ -7,9 +7,9 @@ var chunkIISDOJPR_cjs = require('./chunk-IISDOJPR.cjs');
|
|
|
7
7
|
var chunkKHMOMROL_cjs = require('./chunk-KHMOMROL.cjs');
|
|
8
8
|
var chunkOUJQJQ7N_cjs = require('./chunk-OUJQJQ7N.cjs');
|
|
9
9
|
var chunkPKJFOG2Z_cjs = require('./chunk-PKJFOG2Z.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunk3SJODG6U_cjs = require('./chunk-3SJODG6U.cjs');
|
|
11
11
|
var chunkUCTQICPR_cjs = require('./chunk-UCTQICPR.cjs');
|
|
12
|
-
var
|
|
12
|
+
var chunkUTB55N5Y_cjs = require('./chunk-UTB55N5Y.cjs');
|
|
13
13
|
var icons = require('@blueprintjs/icons');
|
|
14
14
|
var classnames = require('classnames');
|
|
15
15
|
var React2 = require('react');
|
|
@@ -282,7 +282,7 @@ function DocumentViewer({
|
|
|
282
282
|
className: rootClassName
|
|
283
283
|
}, markdownRendererProps));
|
|
284
284
|
case ViewerType.Excel:
|
|
285
|
-
return /* @__PURE__ */ React2__default.default.createElement(
|
|
285
|
+
return /* @__PURE__ */ React2__default.default.createElement(chunk3SJODG6U_cjs.ExcelViewer, _extends2({
|
|
286
286
|
media,
|
|
287
287
|
className: rootClassName
|
|
288
288
|
}, excelViewerProps));
|
|
@@ -310,9 +310,9 @@ function DocumentViewer({
|
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
// src/public/experimental/document-viewer.ts
|
|
313
|
-
var DocumentViewer2 =
|
|
313
|
+
var DocumentViewer2 = chunkUTB55N5Y_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-3FFHTVG7.cjs.map
|
|
318
|
+
//# sourceMappingURL=chunk-3FFHTVG7.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,IA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B,QAAQ,CAAC,CAAA;AAAA,IAC1C;AACE,MAAAC,mCAAA,CAAkB,UAAU,CAAA;AAAA;AAElC;;;ACnIO,IAAMC,eAAAA,GAAiBC,iCAAA,CAAgB,cAAA,EAAiB,gBAAgB","file":"chunk-5JJQ5X5R.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\";"]}
|
|
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,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;AAAA,QAC1D,KAAA;AAAA,QACA,SAAA,EAAW;AAAA,OACb,EAAG,cAAc,CAAC,CAAA;AAAA,IACpB,KAAK,UAAA,CAAW,WAAA;AACd,MAAA,uBAAoBJ,uBAAAA,CAAM,aAAA,CAAc,KAAA,EAAO;AAAA,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-3FFHTVG7.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\";"]}
|
|
@@ -4,7 +4,7 @@ var chunkMVQKV5BJ_cjs = require('./chunk-MVQKV5BJ.cjs');
|
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var icons = require('@blueprintjs/icons');
|
|
7
|
-
var
|
|
7
|
+
var xlsxRepublish = require('xlsx-republish');
|
|
8
8
|
|
|
9
9
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
10
|
|
|
@@ -87,12 +87,12 @@ function BaseExcelViewer({
|
|
|
87
87
|
}
|
|
88
88
|
async function parseSpreadsheetFromResponse(response) {
|
|
89
89
|
const buffer = await response.arrayBuffer();
|
|
90
|
-
const workbook =
|
|
90
|
+
const workbook = xlsxRepublish.read(buffer, {
|
|
91
91
|
type: "array"
|
|
92
92
|
});
|
|
93
93
|
const sheets = workbook.SheetNames.map((name) => {
|
|
94
94
|
const sheet = workbook.Sheets[name];
|
|
95
|
-
const rows = sheet != null ?
|
|
95
|
+
const rows = sheet != null ? xlsxRepublish.utils.sheet_to_json(sheet, {
|
|
96
96
|
header: 1,
|
|
97
97
|
defval: "",
|
|
98
98
|
raw: false
|
|
@@ -145,5 +145,5 @@ function ExcelViewer({
|
|
|
145
145
|
|
|
146
146
|
exports.BaseExcelViewer = BaseExcelViewer;
|
|
147
147
|
exports.ExcelViewer = ExcelViewer;
|
|
148
|
-
//# sourceMappingURL=chunk-
|
|
149
|
-
//# sourceMappingURL=chunk-
|
|
148
|
+
//# sourceMappingURL=chunk-3SJODG6U.cjs.map
|
|
149
|
+
//# sourceMappingURL=chunk-3SJODG6U.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/excel-viewer/BaseExcelViewer.module.css","../../src/excel-viewer/BaseExcelViewer.tsx","../../src/excel-viewer/parseSpreadsheet.ts","../../src/excel-viewer/ExcelViewer.tsx"],"names":["React","useMemo","useState","classnames","useCallback","read","utils","useMediaContents","Spin","ErrorIcon"],"mappings":";;;;;;;;;;;;;;AAAA,IAAA,uBAAA,GAAA,EAAA;;;ACsBA,SAAS,oBAAoB,KAAA,EAAO;AAClC,EAAA,IAAI,MAAA,GAAS,EAAA;AACb,EAAA,IAAI,GAAA,GAAM,KAAA;AACV,EAAA,GAAG;AACD,IAAA,MAAM,YAAY,GAAA,GAAM,EAAA;AACxB,IAAA,MAAA,GAAS,MAAA,CAAO,YAAA,CAAa,EAAA,GAAK,SAAS,CAAA,GAAI,MAAA;A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A,GAAgBD,2BAAAA,CAAW,uBAAA,CAAO,SAAA,EAAW,SAAS,CAAA;AAC5D,EAAA,uBAAoBH,sBAAAA,CAAM,aAAA,CAAc,KAAA,EAAO;AAAA,IAC7C,SAAA,EAAW;AAAA,GACb,EAAG,OAAA,oBAAwBA,sBAAAA,CAAM,cAAc,KAAA,EAAO;AAAA,IACpD,WAAW,uBAAA,CAAO;AAAA,GACpB,kBAAgBA,sBAAAA,CAAM,aAAA,CAAcQ,UAAA,EAAM;AAAA,IACxC,WAAW,uBAAA,CAAO;AAAA,GACnB,GAAG,eAAe,CAAA,EAAG,SAAS,IAAA,oBAAqBR,sBAAAA,CAAM,aAAA,CAAc,KAAA,EAAO;AAAA,IAC7E,WAAW,uBAAA,CAAO;AAAA,GACpB,kBAAgBA,sBAAAA,CAAM,aAAA,CAAcS,WAAA,EAAW;AAAA,IAC7C,WAAW,uBAAA,CAAO;AAAA,GACnB,CAAA,EAAG,8BAAA,EAAgC,KAAA,CAAM,OAAO,CAAA,EAAG,WAAA,IAAe,IAAA,oBAAqBT,sBAAAA,CAAM,aAAA,CAAc,eAAA,EAAiB,QAAA,CAAS;AAAA,IACpI;AAAA,GACF,EAAG,gBAAgB,CAAC,CAAC,CAAA;AACvB","file":"chunk-3SJODG6U.cjs","sourcesContent":[".container {\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n background-color: var(--osdk-excel-viewer-bg);\n border: var(--osdk-excel-viewer-border);\n border-radius: var(--osdk-surface-border-radius);\n overflow: hidden;\n}\n\n.tableContainer {\n flex: 1;\n overflow: auto;\n}\n\n.table {\n border-collapse: collapse;\n width: max-content;\n min-width: 100%;\n font-family: var(--osdk-typography-family-default);\n font-size: var(--osdk-typography-size-body-small);\n border-spacing: 0;\n}\n\n/* Column letter headers (A, B, C...) */\n.columnHeader {\n background-color: var(--osdk-excel-viewer-header-bg);\n border: 1px solid var(--osdk-excel-viewer-cell-border);\n padding: var(--osdk-excel-viewer-cell-padding);\n text-align: center;\n font-weight: var(--osdk-typography-weight-default);\n color: var(--osdk-excel-viewer-header-color);\n position: sticky;\n top: 0;\n z-index: 2;\n min-width: var(--osdk-excel-viewer-col-min-width);\n user-select: none;\n}\n\n/* Top-left corner cell */\n.cornerCell {\n background-color: var(--osdk-excel-viewer-header-bg);\n border: 1px solid var(--osdk-excel-viewer-cell-border);\n position: sticky;\n top: 0;\n left: 0;\n z-index: 3;\n min-width: var(--osdk-excel-viewer-row-header-width);\n width: var(--osdk-excel-viewer-row-header-width);\n}\n\n/* Row number headers (1, 2, 3...) */\n.rowHeader {\n background-color: var(--osdk-excel-viewer-header-bg);\n border: 1px solid var(--osdk-excel-viewer-cell-border);\n padding: var(--osdk-excel-viewer-cell-padding);\n text-align: center;\n font-weight: var(--osdk-typography-weight-default);\n color: var(--osdk-excel-viewer-header-color);\n position: sticky;\n left: 0;\n z-index: 1;\n min-width: var(--osdk-excel-viewer-row-header-width);\n width: var(--osdk-excel-viewer-row-header-width);\n user-select: none;\n}\n\n/* Data cells */\n.cell {\n border: 1px solid var(--osdk-excel-viewer-cell-border);\n padding: var(--osdk-excel-viewer-cell-padding);\n white-space: nowrap;\n min-width: var(--osdk-excel-viewer-col-min-width);\n}\n\n/* Sheet tabs bar */\n.tabBar {\n display: flex;\n align-items: flex-end;\n gap: var(--osdk-excel-viewer-tab-gap);\n border-top: var(--osdk-excel-viewer-tab-border);\n background-color: var(--osdk-excel-viewer-tab-bg);\n flex-shrink: 0;\n overflow-x: auto;\n padding: var(--osdk-excel-viewer-tab-bar-padding) var(--osdk-excel-viewer-tab-bar-padding) 0;\n}\n\n.tab {\n padding: var(--osdk-excel-viewer-tab-padding);\n border: var(--osdk-excel-viewer-tab-border);\n border-bottom: none;\n border-radius: var(--osdk-excel-viewer-tab-border-radius) var(--osdk-excel-viewer-tab-border-radius) 0 0;\n background-color: var(--osdk-excel-viewer-tab-bg);\n font-family: var(--osdk-typography-family-default);\n font-size: var(--osdk-typography-size-body-x-small);\n color: var(--osdk-typography-color-muted);\n cursor: pointer;\n white-space: nowrap;\n position: relative;\n top: 1px;\n}\n\n.tab:hover {\n background-color: var(--osdk-excel-viewer-tab-hover-bg);\n color: var(--osdk-typography-color-default-rest);\n}\n\n.tabActive {\n background-color: var(--osdk-excel-viewer-tab-active-bg);\n color: var(--osdk-typography-color-default-rest);\n font-weight: var(--osdk-typography-weight-bold);\n border-bottom: 1px solid var(--osdk-excel-viewer-tab-active-bg);\n}\n\n.emptySheet {\n display: flex;\n align-items: center;\n justify-content: center;\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.loadingContainer {\n composes: loadingContainer from \"../shared/LoadingError.module.css\";\n}\n\n.errorContainer {\n composes: errorContainer from \"../shared/LoadingError.module.css\";\n}\n\n.spinnerIcon {\n composes: spinnerIcon from \"../shared/LoadingError.module.css\";\n}\n\n.errorIcon {\n composes: errorIcon 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\nimport classnames from \"classnames\";\nimport React, { useCallback, useMemo, useState } from \"react\";\nimport styles from \"./BaseExcelViewer.module.css\";\n/**\n * Converts a 0-based column index to a spreadsheet column letter (0=A, 1=B, ..., 25=Z, 26=AA).\n */\nfunction columnIndexToLetter(index) {\n let letter = \"\";\n let num = index;\n do {\n const remainder = num % 26;\n letter = String.fromCharCode(65 + remainder) + letter;\n num = Math.floor(num / 26) - 1;\n } while (num >= 0);\n return letter;\n}\nconst SheetTable = /*#__PURE__*/React.memo(({\n sheet\n}) => {\n const maxCols = useMemo(() => sheet.rows.reduce((max, row) => Math.max(max, row.length), 0), [sheet.rows]);\n if (sheet.rows.length === 0) {\n return /*#__PURE__*/React.createElement(\"div\", {\n className: styles.emptySheet\n }, \"Empty sheet\");\n }\n return /*#__PURE__*/React.createElement(\"div\", {\n className: styles.tableContainer\n }, /*#__PURE__*/React.createElement(\"table\", {\n className: styles.table\n }, /*#__PURE__*/React.createElement(\"thead\", null, /*#__PURE__*/React.createElement(\"tr\", null, /*#__PURE__*/React.createElement(\"th\", {\n className: styles.cornerCell\n }), Array.from({\n length: maxCols\n }, (_, i) => /*#__PURE__*/React.createElement(\"th\", {\n key: i,\n className: styles.columnHeader\n }, columnIndexToLetter(i))))), /*#__PURE__*/React.createElement(\"tbody\", null, sheet.rows.map((row, rowIndex) => /*#__PURE__*/React.createElement(\"tr\", {\n key: rowIndex\n }, /*#__PURE__*/React.createElement(\"td\", {\n className: styles.rowHeader\n }, rowIndex + 1), Array.from({\n length: maxCols\n }, (_, cellIndex) => /*#__PURE__*/React.createElement(\"td\", {\n key: cellIndex,\n className: styles.cell\n }, row[cellIndex] ?? \"\")))))));\n});\nSheetTable.displayName = \"SheetTable\";\nexport function BaseExcelViewer({\n spreadsheet,\n className\n}) {\n const [activeSheetIndex, setActiveSheetIndex] = useState(0);\n const rootClassName = classnames(styles.container, className);\n const safeIndex = Math.min(activeSheetIndex, Math.max(0, spreadsheet.sheets.length - 1));\n const activeSheet = useMemo(() => spreadsheet.sheets[safeIndex], [spreadsheet.sheets, safeIndex]);\n const handleTabClick = useCallback(index => {\n setActiveSheetIndex(index);\n }, []);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, activeSheet != null ? /*#__PURE__*/React.createElement(SheetTable, {\n sheet: activeSheet\n }) : /*#__PURE__*/React.createElement(\"div\", {\n className: styles.emptySheet\n }, \"No sheets\"), spreadsheet.sheets.length > 1 && /*#__PURE__*/React.createElement(\"div\", {\n className: styles.tabBar\n }, spreadsheet.sheets.map((sheet, index) => /*#__PURE__*/React.createElement(\"button\", {\n key: sheet.name,\n className: classnames(styles.tab, {\n [styles.tabActive]: index === safeIndex\n }),\n onClick: () => handleTabClick(index),\n type: \"button\"\n }, sheet.name))));\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 defval */\n\nimport { read, utils } from \"xlsx-republish\";\nexport async function parseSpreadsheetFromResponse(response) {\n const buffer = await response.arrayBuffer();\n const workbook = read(buffer, {\n type: \"array\"\n });\n const sheets = workbook.SheetNames.map(name => {\n const sheet = workbook.Sheets[name];\n const rows = sheet != null ? utils.sheet_to_json(sheet, {\n header: 1,\n defval: \"\",\n raw: false\n }) : [];\n return {\n name,\n rows\n };\n });\n return {\n sheets\n };\n}","function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\n/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Error as ErrorIcon, Spin } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React, { useCallback } from \"react\";\nimport { useMediaContents } from \"../shared/hooks/useMediaContents.js\";\nimport { BaseExcelViewer } from \"./BaseExcelViewer.js\";\nimport styles from \"./BaseExcelViewer.module.css\";\nimport { parseSpreadsheetFromResponse } from \"./parseSpreadsheet.js\";\nexport function ExcelViewer({\n media,\n className,\n ...excelViewerProps\n}) {\n const {\n data: spreadsheet,\n loading,\n error\n } = useMediaContents(media, useCallback(parseSpreadsheetFromResponse, []));\n const rootClassName = classnames(styles.container, className);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: rootClassName\n }, loading && /*#__PURE__*/React.createElement(\"div\", {\n className: styles.loadingContainer\n }, /*#__PURE__*/React.createElement(Spin, {\n className: styles.spinnerIcon\n }), \"Loading\\u2026\"), error != null && /*#__PURE__*/React.createElement(\"div\", {\n className: styles.errorContainer\n }, /*#__PURE__*/React.createElement(ErrorIcon, {\n className: styles.errorIcon\n }), \"Failed to load spreadsheet: \", error.message), spreadsheet != null && /*#__PURE__*/React.createElement(BaseExcelViewer, _extends({\n spreadsheet: spreadsheet\n }, excelViewerProps)));\n}"]}
|
|
@@ -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 chunkUTB55N5Y_cjs = require('./chunk-UTB55N5Y.cjs');
|
|
10
10
|
var button = require('@base-ui/react/button');
|
|
11
11
|
var classnames3 = require('classnames');
|
|
12
12
|
var React13 = require('react');
|
|
@@ -5384,7 +5384,7 @@ function summarizeFilterValue(definition, state) {
|
|
|
5384
5384
|
}
|
|
5385
5385
|
|
|
5386
5386
|
// src/public/experimental/filter-list.ts
|
|
5387
|
-
var FilterList2 =
|
|
5387
|
+
var FilterList2 = chunkUTB55N5Y_cjs.withOsdkMetrics(FilterList, "FilterList");
|
|
5388
5388
|
|
|
5389
5389
|
exports.BaseFilterList = BaseFilterList;
|
|
5390
5390
|
exports.FilterInput = FilterInput;
|
|
@@ -5399,5 +5399,5 @@ exports.narrowObjectSet = narrowObjectSet;
|
|
|
5399
5399
|
exports.serializeFilterStates = serializeFilterStates;
|
|
5400
5400
|
exports.summarizeFilterValue = summarizeFilterValue;
|
|
5401
5401
|
exports.useFilterListState = useFilterListState;
|
|
5402
|
-
//# sourceMappingURL=chunk-
|
|
5403
|
-
//# sourceMappingURL=chunk-
|
|
5402
|
+
//# sourceMappingURL=chunk-3VL5YVFA.cjs.map
|
|
5403
|
+
//# sourceMappingURL=chunk-3VL5YVFA.cjs.map
|