@osdk/react-components 0.64.0 → 0.65.0-main-9755094ff5471c4508269be1d72eef98667b5042
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 +14 -0
- package/build/browser/cbac-picker/CbacBannerPopover.js +9 -3
- package/build/browser/cbac-picker/CbacBannerPopover.js.map +1 -1
- package/build/browser/cbac-picker/CbacPicker.js +4 -1
- package/build/browser/cbac-picker/CbacPicker.js.map +1 -1
- package/build/browser/cbac-picker/CbacPickerDialog.js +5 -2
- package/build/browser/cbac-picker/CbacPickerDialog.js.map +1 -1
- package/build/browser/cbac-picker/useCbacPickerState.js +3 -3
- package/build/browser/cbac-picker/useCbacPickerState.js.map +1 -1
- package/build/browser/cbac-picker/useCbacSelection.js +2 -2
- package/build/browser/cbac-picker/useCbacSelection.js.map +1 -1
- package/build/browser/util/UserAgent.js +1 -1
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/{chunk-QDAYLZLL.cjs → chunk-34HADMUV.cjs} +4 -4
- package/build/cjs/{chunk-QDAYLZLL.cjs.map → chunk-34HADMUV.cjs.map} +1 -1
- package/build/cjs/chunk-3H2NCAME.cjs +11 -0
- package/build/cjs/{chunk-SR3D5O46.cjs.map → chunk-3H2NCAME.cjs.map} +1 -1
- package/build/cjs/chunk-5243YJNC.cjs +11 -0
- package/build/cjs/{chunk-J6DBSMUF.cjs.map → chunk-5243YJNC.cjs.map} +1 -1
- package/build/cjs/chunk-6M5KQOZ6.cjs +11 -0
- package/build/cjs/{chunk-D366MJHS.cjs.map → chunk-6M5KQOZ6.cjs.map} +1 -1
- package/build/cjs/{chunk-FJJZBIZS.cjs → chunk-726QUP47.cjs} +4 -4
- package/build/cjs/{chunk-FJJZBIZS.cjs.map → chunk-726QUP47.cjs.map} +1 -1
- package/build/cjs/chunk-75ZD2NHY.cjs +11 -0
- package/build/cjs/{chunk-FEOGIJSU.cjs.map → chunk-75ZD2NHY.cjs.map} +1 -1
- package/build/cjs/{chunk-TP2QNA4B.cjs → chunk-77BOCZAM.cjs} +4 -4
- package/build/cjs/{chunk-TP2QNA4B.cjs.map → chunk-77BOCZAM.cjs.map} +1 -1
- package/build/cjs/{chunk-LKIRWUG5.cjs → chunk-7AQBXS2L.cjs} +4 -4
- package/build/cjs/{chunk-LKIRWUG5.cjs.map → chunk-7AQBXS2L.cjs.map} +1 -1
- package/build/cjs/{chunk-C6VFD5EN.cjs → chunk-BO6OKCG2.cjs} +4 -4
- package/build/cjs/{chunk-C6VFD5EN.cjs.map → chunk-BO6OKCG2.cjs.map} +1 -1
- package/build/cjs/{chunk-MO74K4T3.cjs → chunk-GBVW7HRR.cjs} +4 -4
- package/build/cjs/{chunk-MO74K4T3.cjs.map → chunk-GBVW7HRR.cjs.map} +1 -1
- package/build/cjs/{chunk-WGAWZJK4.cjs → chunk-H3CEGHF3.cjs} +4 -4
- package/build/cjs/{chunk-WGAWZJK4.cjs.map → chunk-H3CEGHF3.cjs.map} +1 -1
- package/build/cjs/{chunk-LVJWX4CM.cjs → chunk-I7ZFEB4Z.cjs} +27 -15
- package/build/cjs/chunk-I7ZFEB4Z.cjs.map +1 -0
- package/build/cjs/{chunk-2Z5GI4QO.cjs → chunk-IOHWJK33.cjs} +4 -4
- package/build/cjs/{chunk-2Z5GI4QO.cjs.map → chunk-IOHWJK33.cjs.map} +1 -1
- package/build/cjs/chunk-J7G2Y4ZS.cjs +12 -0
- package/build/cjs/{chunk-KWVQF3JK.cjs.map → chunk-J7G2Y4ZS.cjs.map} +1 -1
- package/build/cjs/{chunk-N7USCC4H.cjs → chunk-JNF7XYSC.cjs} +4 -4
- package/build/cjs/{chunk-N7USCC4H.cjs.map → chunk-JNF7XYSC.cjs.map} +1 -1
- package/build/cjs/{chunk-343SJFZO.cjs → chunk-MHYYCLV7.cjs} +4 -4
- package/build/cjs/{chunk-343SJFZO.cjs.map → chunk-MHYYCLV7.cjs.map} +1 -1
- package/build/cjs/chunk-MO6GNA55.cjs +48 -0
- package/build/cjs/{chunk-CLJJIOMQ.cjs.map → chunk-MO6GNA55.cjs.map} +1 -1
- package/build/cjs/chunk-OD3JT5DM.cjs +34 -0
- package/build/cjs/{chunk-LLXTLPQC.cjs.map → chunk-OD3JT5DM.cjs.map} +1 -1
- package/build/cjs/{chunk-YJD7G6PU.cjs → chunk-OOBIACIP.cjs} +3 -3
- package/build/cjs/chunk-OOBIACIP.cjs.map +1 -0
- package/build/cjs/chunk-S36H3BR7.cjs +11 -0
- package/build/cjs/{chunk-UURZ5VQG.cjs.map → chunk-S36H3BR7.cjs.map} +1 -1
- package/build/cjs/{chunk-OEMEPLPV.cjs → chunk-SLCGRIET.cjs} +5 -5
- package/build/cjs/{chunk-OEMEPLPV.cjs.map → chunk-SLCGRIET.cjs.map} +1 -1
- package/build/cjs/{chunk-DSLFS5GB.cjs → chunk-TKPRKEKB.cjs} +4 -4
- package/build/cjs/{chunk-DSLFS5GB.cjs.map → chunk-TKPRKEKB.cjs.map} +1 -1
- package/build/cjs/{chunk-URREX4NI.cjs → chunk-TRXQORSH.cjs} +8 -8
- package/build/cjs/{chunk-URREX4NI.cjs.map → chunk-TRXQORSH.cjs.map} +1 -1
- package/build/cjs/chunk-V36OAXDG.cjs +12 -0
- package/build/cjs/{chunk-3VYKQYVG.cjs.map → chunk-V36OAXDG.cjs.map} +1 -1
- package/build/cjs/{chunk-L363OBZO.cjs → chunk-VXZ46YRP.cjs} +5 -5
- package/build/cjs/{chunk-L363OBZO.cjs.map → chunk-VXZ46YRP.cjs.map} +1 -1
- package/build/cjs/chunk-XT24DYNF.cjs +11 -0
- package/build/cjs/{chunk-UI5SSWRC.cjs.map → chunk-XT24DYNF.cjs.map} +1 -1
- package/build/cjs/public/action-form.cjs +4 -4
- package/build/cjs/public/document-viewer.cjs +4 -4
- package/build/cjs/public/email-viewer.cjs +3 -3
- package/build/cjs/public/experimental/action-form.cjs +5 -5
- package/build/cjs/public/experimental/cbac-picker.cjs +11 -11
- package/build/cjs/public/experimental/cbac-picker.d.cts +11 -3
- package/build/cjs/public/experimental/document-viewer.cjs +5 -5
- package/build/cjs/public/experimental/email-viewer.cjs +5 -5
- package/build/cjs/public/experimental/filter-list.cjs +16 -16
- package/build/cjs/public/experimental/image-viewer.cjs +5 -5
- package/build/cjs/public/experimental/markdown-renderer.cjs +7 -7
- package/build/cjs/public/experimental/object-table.cjs +23 -23
- package/build/cjs/public/experimental/pdf-viewer.cjs +25 -25
- package/build/cjs/public/experimental/spreadsheet-viewer.cjs +5 -5
- package/build/cjs/public/experimental/tiff-renderer.cjs +7 -7
- package/build/cjs/public/experimental/video-viewer.cjs +5 -5
- package/build/cjs/public/experimental/xml-viewer.cjs +5 -5
- package/build/cjs/public/experimental.cjs +112 -112
- package/build/cjs/public/filter-list.cjs +15 -15
- package/build/cjs/public/image-viewer.cjs +3 -3
- package/build/cjs/public/markdown-viewer.cjs +3 -3
- package/build/cjs/public/object-table.cjs +22 -22
- package/build/cjs/public/pdf-viewer.cjs +7 -7
- package/build/cjs/public/spreadsheet-viewer.cjs +3 -3
- package/build/cjs/public/tiff-viewer.cjs +3 -3
- package/build/cjs/public/video-viewer.cjs +3 -3
- package/build/cjs/public/xml-viewer.cjs +3 -3
- package/build/esm/cbac-picker/CbacBannerPopover.js +9 -3
- package/build/esm/cbac-picker/CbacBannerPopover.js.map +1 -1
- package/build/esm/cbac-picker/CbacPicker.js +4 -1
- package/build/esm/cbac-picker/CbacPicker.js.map +1 -1
- package/build/esm/cbac-picker/CbacPickerDialog.js +5 -2
- package/build/esm/cbac-picker/CbacPickerDialog.js.map +1 -1
- package/build/esm/cbac-picker/useCbacPickerState.js +3 -3
- package/build/esm/cbac-picker/useCbacPickerState.js.map +1 -1
- package/build/esm/cbac-picker/useCbacSelection.js +2 -2
- package/build/esm/cbac-picker/useCbacSelection.js.map +1 -1
- package/build/esm/util/UserAgent.js +1 -1
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/cbac-picker/CbacBannerPopover.d.ts +2 -1
- package/build/types/cbac-picker/CbacBannerPopover.d.ts.map +1 -1
- package/build/types/cbac-picker/CbacPicker.d.ts +7 -1
- package/build/types/cbac-picker/CbacPicker.d.ts.map +1 -1
- package/build/types/cbac-picker/CbacPickerDialog.d.ts +2 -1
- package/build/types/cbac-picker/CbacPickerDialog.d.ts.map +1 -1
- package/build/types/cbac-picker/useCbacPickerState.d.ts +4 -1
- package/build/types/cbac-picker/useCbacPickerState.d.ts.map +1 -1
- package/build/types/cbac-picker/useCbacSelection.d.ts +2 -2
- package/build/types/cbac-picker/useCbacSelection.d.ts.map +1 -1
- package/docs/CbacPicker.md +8 -6
- package/package.json +7 -7
- package/build/cjs/chunk-3VYKQYVG.cjs +0 -12
- package/build/cjs/chunk-CLJJIOMQ.cjs +0 -48
- package/build/cjs/chunk-D366MJHS.cjs +0 -11
- package/build/cjs/chunk-FEOGIJSU.cjs +0 -11
- package/build/cjs/chunk-J6DBSMUF.cjs +0 -11
- package/build/cjs/chunk-KWVQF3JK.cjs +0 -12
- package/build/cjs/chunk-LLXTLPQC.cjs +0 -34
- package/build/cjs/chunk-LVJWX4CM.cjs.map +0 -1
- package/build/cjs/chunk-SR3D5O46.cjs +0 -11
- package/build/cjs/chunk-UI5SSWRC.cjs +0 -11
- package/build/cjs/chunk-UURZ5VQG.cjs +0 -11
- package/build/cjs/chunk-YJD7G6PU.cjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @osdk/react-components
|
|
2
2
|
|
|
3
|
+
## 0.65.0-main-9755094ff5471c4508269be1d72eef98667b5042
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9755094: add `includeDeleted` option to `useMarkings`/`useMarkingCategories` and an `includeDeleted` prop to `CbacPicker`, `CbacPickerDialog`, and `CbacBannerPopover` (default `true`, matching the platform API)
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [9755094]
|
|
12
|
+
- @osdk/react@2.81.0-main-9755094ff5471c4508269be1d72eef98667b5042
|
|
13
|
+
- @osdk/api@2.81.0-main-9755094ff5471c4508269be1d72eef98667b5042
|
|
14
|
+
- @osdk/client@2.81.0-main-9755094ff5471c4508269be1d72eef98667b5042
|
|
15
|
+
- @osdk/aip-core@0.13.0
|
|
16
|
+
|
|
3
17
|
## 0.64.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -23,6 +23,7 @@ export function CbacBannerPopover({
|
|
|
23
23
|
markingIds,
|
|
24
24
|
onChange,
|
|
25
25
|
maxClassificationConstraint,
|
|
26
|
+
includeDeleted,
|
|
26
27
|
className
|
|
27
28
|
}) {
|
|
28
29
|
const {
|
|
@@ -38,13 +39,17 @@ export function CbacBannerPopover({
|
|
|
38
39
|
isLoading: categoriesLoading,
|
|
39
40
|
error: categoriesError,
|
|
40
41
|
refetch: refetchCategories
|
|
41
|
-
} = useMarkingCategories(
|
|
42
|
+
} = useMarkingCategories({
|
|
43
|
+
includeDeleted
|
|
44
|
+
});
|
|
42
45
|
const {
|
|
43
46
|
markings,
|
|
44
47
|
isLoading: markingsLoading,
|
|
45
48
|
error: markingsError,
|
|
46
49
|
refetch: refetchMarkings
|
|
47
|
-
} = useMarkings(
|
|
50
|
+
} = useMarkings({
|
|
51
|
+
includeDeleted
|
|
52
|
+
});
|
|
48
53
|
const [isDialogOpen, setIsDialogOpen] = React.useState(false);
|
|
49
54
|
const handleRetry = React.useCallback(() => {
|
|
50
55
|
refetchBanner();
|
|
@@ -77,7 +82,8 @@ export function CbacBannerPopover({
|
|
|
77
82
|
onOpenChange: setIsDialogOpen,
|
|
78
83
|
onConfirm: handleConfirm,
|
|
79
84
|
initialMarkingIds: markingIds,
|
|
80
|
-
maxClassificationConstraint: maxClassificationConstraint
|
|
85
|
+
maxClassificationConstraint: maxClassificationConstraint,
|
|
86
|
+
includeDeleted: includeDeleted
|
|
81
87
|
}));
|
|
82
88
|
}
|
|
83
89
|
//# sourceMappingURL=CbacBannerPopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CbacBannerPopover.js","names":["useCbacBanner","useMarkingCategories","useMarkings","React","BaseCbacBannerPopover","CbacPickerDialog","groupMarkingsByCategory","resolveBannerDisplay","CbacBannerPopover","markingIds","onChange","maxClassificationConstraint","className","banner","isLoading","bannerLoading","error","bannerError","refetch","refetchBanner","categories","categoriesLoading","categoriesError","refetchCategories","markings","markingsLoading","markingsError","refetchMarkings","isDialogOpen","setIsDialogOpen","useState","handleRetry","useCallback","appliedMarkings","useMemo","resolved","description","length","classificationString","handleEditClick","handleConfirm","newMarkingIds","createElement","Fragment","textColor","backgroundColors","onEditClick","onRetry","isOpen","onOpenChange","onConfirm","initialMarkingIds"],"sources":["CbacBannerPopover.tsx"],"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\nimport {\n useCbacBanner,\n useMarkingCategories,\n useMarkings,\n} from \"@osdk/react/platform-apis\";\nimport React from \"react\";\n\nimport { BaseCbacBannerPopover } from \"./base/BaseCbacBannerPopover.js\";\nimport { CbacPickerDialog } from \"./CbacPickerDialog.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport {\n groupMarkingsByCategory,\n resolveBannerDisplay,\n} from \"./utils/cbacPickerUtils.js\";\n\nexport interface CbacBannerPopoverProps {\n markingIds: string[];\n onChange: (markingIds: string[]) => void;\n maxClassificationConstraint?: MaxClassificationConstraint;\n className?: string;\n}\n\nexport function CbacBannerPopover({\n markingIds,\n onChange,\n maxClassificationConstraint,\n className,\n}: CbacBannerPopoverProps): React.ReactElement {\n const {\n banner,\n isLoading: bannerLoading,\n error: bannerError,\n refetch: refetchBanner,\n } = useCbacBanner({ markingIds });\n const {\n categories,\n isLoading: categoriesLoading,\n error: categoriesError,\n refetch: refetchCategories,\n } = useMarkingCategories();\n const {\n markings,\n isLoading: markingsLoading,\n error: markingsError,\n refetch: refetchMarkings,\n } = useMarkings();\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n\n const isLoading = bannerLoading || categoriesLoading || markingsLoading;\n\n const error = bannerError ?? categoriesError ?? markingsError;\n\n const handleRetry = React.useCallback(() => {\n refetchBanner();\n refetchCategories();\n refetchMarkings();\n }, [refetchBanner, refetchCategories, refetchMarkings]);\n\n const appliedMarkings = React.useMemo(\n () => groupMarkingsByCategory(markingIds, categories, markings),\n [markingIds, categories, markings],\n );\n\n const resolved = resolveBannerDisplay(banner);\n\n const description =\n markingIds.length === 0\n ? \"This data has no classification restrictions.\"\n : `This data is classified as: ${resolved.classificationString}`;\n\n const handleEditClick = React.useCallback(() => {\n setIsDialogOpen(true);\n }, []);\n\n const handleConfirm = React.useCallback(\n (newMarkingIds: string[]) => {\n onChange(newMarkingIds);\n setIsDialogOpen(false);\n },\n [onChange],\n );\n\n return (\n <>\n <BaseCbacBannerPopover\n classificationString={resolved.classificationString}\n textColor={resolved.textColor}\n backgroundColors={resolved.backgroundColors}\n appliedMarkings={appliedMarkings}\n onEditClick={handleEditClick}\n description={description}\n isLoading={isLoading}\n error={error}\n onRetry={handleRetry}\n className={className}\n />\n {isDialogOpen && (\n <CbacPickerDialog\n isOpen={isDialogOpen}\n onOpenChange={setIsDialogOpen}\n onConfirm={handleConfirm}\n initialMarkingIds={markingIds}\n maxClassificationConstraint={maxClassificationConstraint}\n />\n )}\n </>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,oBAAoB,EACpBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,qBAAqB,QAAQ,iCAAiC;AACvE,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SACEC,uBAAuB,EACvBC,oBAAoB,QACf,4BAA4B;
|
|
1
|
+
{"version":3,"file":"CbacBannerPopover.js","names":["useCbacBanner","useMarkingCategories","useMarkings","React","BaseCbacBannerPopover","CbacPickerDialog","groupMarkingsByCategory","resolveBannerDisplay","CbacBannerPopover","markingIds","onChange","maxClassificationConstraint","includeDeleted","className","banner","isLoading","bannerLoading","error","bannerError","refetch","refetchBanner","categories","categoriesLoading","categoriesError","refetchCategories","markings","markingsLoading","markingsError","refetchMarkings","isDialogOpen","setIsDialogOpen","useState","handleRetry","useCallback","appliedMarkings","useMemo","resolved","description","length","classificationString","handleEditClick","handleConfirm","newMarkingIds","createElement","Fragment","textColor","backgroundColors","onEditClick","onRetry","isOpen","onOpenChange","onConfirm","initialMarkingIds"],"sources":["CbacBannerPopover.tsx"],"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\nimport {\n useCbacBanner,\n useMarkingCategories,\n useMarkings,\n} from \"@osdk/react/platform-apis\";\nimport React from \"react\";\n\nimport { BaseCbacBannerPopover } from \"./base/BaseCbacBannerPopover.js\";\nimport { CbacPickerDialog } from \"./CbacPickerDialog.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport {\n groupMarkingsByCategory,\n resolveBannerDisplay,\n} from \"./utils/cbacPickerUtils.js\";\n\nexport interface CbacBannerPopoverProps {\n markingIds: string[];\n onChange: (markingIds: string[]) => void;\n maxClassificationConstraint?: MaxClassificationConstraint;\n includeDeleted?: boolean;\n className?: string;\n}\n\nexport function CbacBannerPopover({\n markingIds,\n onChange,\n maxClassificationConstraint,\n includeDeleted,\n className,\n}: CbacBannerPopoverProps): React.ReactElement {\n const {\n banner,\n isLoading: bannerLoading,\n error: bannerError,\n refetch: refetchBanner,\n } = useCbacBanner({ markingIds });\n const {\n categories,\n isLoading: categoriesLoading,\n error: categoriesError,\n refetch: refetchCategories,\n } = useMarkingCategories({ includeDeleted });\n const {\n markings,\n isLoading: markingsLoading,\n error: markingsError,\n refetch: refetchMarkings,\n } = useMarkings({ includeDeleted });\n\n const [isDialogOpen, setIsDialogOpen] = React.useState(false);\n\n const isLoading = bannerLoading || categoriesLoading || markingsLoading;\n\n const error = bannerError ?? categoriesError ?? markingsError;\n\n const handleRetry = React.useCallback(() => {\n refetchBanner();\n refetchCategories();\n refetchMarkings();\n }, [refetchBanner, refetchCategories, refetchMarkings]);\n\n const appliedMarkings = React.useMemo(\n () => groupMarkingsByCategory(markingIds, categories, markings),\n [markingIds, categories, markings],\n );\n\n const resolved = resolveBannerDisplay(banner);\n\n const description =\n markingIds.length === 0\n ? \"This data has no classification restrictions.\"\n : `This data is classified as: ${resolved.classificationString}`;\n\n const handleEditClick = React.useCallback(() => {\n setIsDialogOpen(true);\n }, []);\n\n const handleConfirm = React.useCallback(\n (newMarkingIds: string[]) => {\n onChange(newMarkingIds);\n setIsDialogOpen(false);\n },\n [onChange],\n );\n\n return (\n <>\n <BaseCbacBannerPopover\n classificationString={resolved.classificationString}\n textColor={resolved.textColor}\n backgroundColors={resolved.backgroundColors}\n appliedMarkings={appliedMarkings}\n onEditClick={handleEditClick}\n description={description}\n isLoading={isLoading}\n error={error}\n onRetry={handleRetry}\n className={className}\n />\n {isDialogOpen && (\n <CbacPickerDialog\n isOpen={isDialogOpen}\n onOpenChange={setIsDialogOpen}\n onConfirm={handleConfirm}\n initialMarkingIds={markingIds}\n maxClassificationConstraint={maxClassificationConstraint}\n includeDeleted={includeDeleted}\n />\n )}\n </>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,oBAAoB,EACpBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,qBAAqB,QAAQ,iCAAiC;AACvE,SAASC,gBAAgB,QAAQ,uBAAuB;AAExD,SACEC,uBAAuB,EACvBC,oBAAoB,QACf,4BAA4B;AAUnC,OAAO,SAASC,iBAAiBA,CAAC;EAChCC,UAAU;EACVC,QAAQ;EACRC,2BAA2B;EAC3BC,cAAc;EACdC;AACsB,CAAC,EAAsB;EAC7C,MAAM;IACJC,MAAM;IACNC,SAAS,EAAEC,aAAa;IACxBC,KAAK,EAAEC,WAAW;IAClBC,OAAO,EAAEC;EACX,CAAC,GAAGpB,aAAa,CAAC;IAAES;EAAW,CAAC,CAAC;EACjC,MAAM;IACJY,UAAU;IACVN,SAAS,EAAEO,iBAAiB;IAC5BL,KAAK,EAAEM,eAAe;IACtBJ,OAAO,EAAEK;EACX,CAAC,GAAGvB,oBAAoB,CAAC;IAAEW;EAAe,CAAC,CAAC;EAC5C,MAAM;IACJa,QAAQ;IACRV,SAAS,EAAEW,eAAe;IAC1BT,KAAK,EAAEU,aAAa;IACpBR,OAAO,EAAES;EACX,CAAC,GAAG1B,WAAW,CAAC;IAAEU;EAAe,CAAC,CAAC;EAEnC,MAAM,CAACiB,YAAY,EAAEC,eAAe,CAAC,GAAG3B,KAAK,CAAC4B,QAAQ,CAAC,KAAK,CAAC;EAM7D,MAAMC,WAAW,GAAG7B,KAAK,CAAC8B,WAAW,CAAC,MAAM;IAC1Cb,aAAa,CAAC,CAAC;IACfI,iBAAiB,CAAC,CAAC;IACnBI,eAAe,CAAC,CA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EACDgB,YAAY,iBACX1B,KAAA,CAAAwC,aAAA,CAACtC,gBAAgB;IACf4C,MAAM,EAAEpB,YAAa;IACrBqB,YAAY,EAAEpB,eAAgB;IAC9BqB,SAAS,EAAEV,aAAc;IACzBW,iBAAiB,EAAE3C,UAAW;IAC9BE,2BAA2B,EAAEA,2BAA4B;IACzDC,cAAc,EAAEA;EAAe,CAChC,CAEH,CAAC;AAEP","ignoreList":[]}
|
|
@@ -25,6 +25,7 @@ export function CbacPicker({
|
|
|
25
25
|
onChange,
|
|
26
26
|
maxClassificationConstraint,
|
|
27
27
|
readOnly,
|
|
28
|
+
includeDeleted,
|
|
28
29
|
className
|
|
29
30
|
}) {
|
|
30
31
|
const {
|
|
@@ -37,7 +38,9 @@ export function CbacPicker({
|
|
|
37
38
|
isValid,
|
|
38
39
|
isLoading,
|
|
39
40
|
error
|
|
40
|
-
} = useCbacSelection(initialMarkingIds
|
|
41
|
+
} = useCbacSelection(initialMarkingIds, {
|
|
42
|
+
includeDeleted
|
|
43
|
+
});
|
|
41
44
|
const handleMarkingToggle = React.useCallback(markingId => {
|
|
42
45
|
if (readOnly) {
|
|
43
46
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CbacPicker.js","names":["React","BaseCbacPicker","ConstraintCallout","useCbacSelection","EMPTY_ARRAY","toggleMarking","CbacPicker","initialMarkingIds","onChange","maxClassificationConstraint","readOnly","className","selectedIdsRef","setSelectedIds","categoryGroups","markingStates","banner","requiredMarkingGroups","isValid","isLoading","error","handleMarkingToggle","useCallback","markingId","newSelection","current","handleDismiss","constraintCallout","useMemo","createElement","constraint","undefined","categories","onMarkingToggle","onDismissBanner","validationCallouts"],"sources":["CbacPicker.tsx"],"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\nimport React from \"react\";\n\nimport { BaseCbacPicker } from \"./base/BaseCbacPicker.js\";\nimport { ConstraintCallout } from \"./ConstraintCallout.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport { useCbacSelection } from \"./useCbacSelection.js\";\nimport { EMPTY_ARRAY } from \"./utils/cbacPickerUtils.js\";\nimport { toggleMarking } from \"./utils/selectionLogic.js\";\n\nexport interface CbacPickerProps {\n /**\n * Initial set of selected marking IDs.\n *\n * @default []\n */\n initialMarkingIds?: string[];\n\n /**\n * Called when the selection changes.\n *\n * @param markingIds The currently selected marking IDs\n */\n onChange: (markingIds: string[]) => void;\n\n /**\n * Optional constraint capping the maximum classification a user may select.\n * When set, the picker surfaces a callout if the selection exceeds it.\n */\n maxClassificationConstraint?: MaxClassificationConstraint;\n\n /**\n * Disables marking toggle interactions.\n *\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * CSS class for the picker container.\n */\n className?: string;\n}\n\nexport function CbacPicker({\n initialMarkingIds,\n onChange,\n maxClassificationConstraint,\n readOnly,\n className,\n}: CbacPickerProps): React.ReactElement {\n const {\n selectedIdsRef,\n setSelectedIds,\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups,\n isValid,\n isLoading,\n error,\n } = useCbacSelection(initialMarkingIds);\n\n const handleMarkingToggle = React.useCallback(\n (markingId: string) => {\n if (readOnly) {\n return;\n }\n const newSelection = toggleMarking(\n markingId,\n selectedIdsRef.current,\n categoryGroups,\n );\n setSelectedIds(newSelection);\n onChange(newSelection);\n },\n [readOnly, categoryGroups, onChange],\n );\n\n const handleDismiss = React.useCallback(() => {\n setSelectedIds(EMPTY_ARRAY);\n onChange(EMPTY_ARRAY);\n }, [onChange]);\n\n const constraintCallout = React.useMemo(\n () =>\n maxClassificationConstraint != null ? (\n <ConstraintCallout constraint={maxClassificationConstraint} />\n ) : undefined,\n [maxClassificationConstraint],\n );\n\n return (\n <BaseCbacPicker\n categories={categoryGroups}\n markingStates={markingStates}\n banner={banner}\n onMarkingToggle={handleMarkingToggle}\n onDismissBanner={handleDismiss}\n requiredMarkingGroups={requiredMarkingGroups}\n isValid={isValid}\n readOnly={readOnly}\n isLoading={isLoading}\n error={error}\n validationCallouts={constraintCallout}\n className={className}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,aAAa,QAAQ,2BAA2B;
|
|
1
|
+
{"version":3,"file":"CbacPicker.js","names":["React","BaseCbacPicker","ConstraintCallout","useCbacSelection","EMPTY_ARRAY","toggleMarking","CbacPicker","initialMarkingIds","onChange","maxClassificationConstraint","readOnly","includeDeleted","className","selectedIdsRef","setSelectedIds","categoryGroups","markingStates","banner","requiredMarkingGroups","isValid","isLoading","error","handleMarkingToggle","useCallback","markingId","newSelection","current","handleDismiss","constraintCallout","useMemo","createElement","constraint","undefined","categories","onMarkingToggle","onDismissBanner","validationCallouts"],"sources":["CbacPicker.tsx"],"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\nimport React from \"react\";\n\nimport { BaseCbacPicker } from \"./base/BaseCbacPicker.js\";\nimport { ConstraintCallout } from \"./ConstraintCallout.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport { useCbacSelection } from \"./useCbacSelection.js\";\nimport { EMPTY_ARRAY } from \"./utils/cbacPickerUtils.js\";\nimport { toggleMarking } from \"./utils/selectionLogic.js\";\n\nexport interface CbacPickerProps {\n /**\n * Initial set of selected marking IDs.\n *\n * @default []\n */\n initialMarkingIds?: string[];\n\n /**\n * Called when the selection changes.\n *\n * @param markingIds The currently selected marking IDs\n */\n onChange: (markingIds: string[]) => void;\n\n /**\n * Optional constraint capping the maximum classification a user may select.\n * When set, the picker surfaces a callout if the selection exceeds it.\n */\n maxClassificationConstraint?: MaxClassificationConstraint;\n\n /**\n * Disables marking toggle interactions.\n *\n * @default false\n */\n readOnly?: boolean;\n\n /**\n * Whether deleted markings and marking categories are shown.\n *\n * @default true\n */\n includeDeleted?: boolean;\n\n /**\n * CSS class for the picker container.\n */\n className?: string;\n}\n\nexport function CbacPicker({\n initialMarkingIds,\n onChange,\n maxClassificationConstraint,\n readOnly,\n includeDeleted,\n className,\n}: CbacPickerProps): React.ReactElement {\n const {\n selectedIdsRef,\n setSelectedIds,\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups,\n isValid,\n isLoading,\n error,\n } = useCbacSelection(initialMarkingIds, { includeDeleted });\n\n const handleMarkingToggle = React.useCallback(\n (markingId: string) => {\n if (readOnly) {\n return;\n }\n const newSelection = toggleMarking(\n markingId,\n selectedIdsRef.current,\n categoryGroups,\n );\n setSelectedIds(newSelection);\n onChange(newSelection);\n },\n [readOnly, categoryGroups, onChange],\n );\n\n const handleDismiss = React.useCallback(() => {\n setSelectedIds(EMPTY_ARRAY);\n onChange(EMPTY_ARRAY);\n }, [onChange]);\n\n const constraintCallout = React.useMemo(\n () =>\n maxClassificationConstraint != null ? (\n <ConstraintCallout constraint={maxClassificationConstraint} />\n ) : undefined,\n [maxClassificationConstraint],\n );\n\n return (\n <BaseCbacPicker\n categories={categoryGroups}\n markingStates={markingStates}\n banner={banner}\n onMarkingToggle={handleMarkingToggle}\n onDismissBanner={handleDismiss}\n requiredMarkingGroups={requiredMarkingGroups}\n isValid={isValid}\n readOnly={readOnly}\n isLoading={isLoading}\n error={error}\n validationCallouts={constraintCallout}\n className={className}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,aAAa,QAAQ,2BAA2B;AA2CzD,OAAO,SAASC,UAAUA,CAAC;EACzBC,iBAAiB;EACjBC,QAAQ;EACRC,2BAA2B;EAC3BC,QAAQ;EACRC,cAAc;EACdC;AACe,CAAC,EAAsB;EACtC,MAAM;IACJC,cAAc;IACdC,cAAc;IACdC,cAAc;IACdC,aAAa;IACbC,MAAM;IACNC,qBAAqB;IACrBC,OAAO;IACPC,SAAS;IACTC;EACF,CAAC,GAAGlB,gBAAgB,CAACI,iBAAiB,EAAE;IAAEI;EAAe,CAAC,CAAC;EAE3D,MAAMW,mBAAmB,GAAGtB,KAAK,CAACuB,WAAW,CAC1CC,SAAiB,IAAK;IACrB,IAAId,QAAQ,EAAE;MACZ;IACF;IACA,MAAMe,YAAY,GAAGpB,aAAa,CAChCmB,SAAS,EACTX,cAAc,CAACa,OAAO,EACtBX,cACF,CAAC;IACDD,cAAc,CAACW,YAAY,CAAC;IAC5BjB,QAAQ,CAACiB,YAAY,CAAC;EACxB,CAAC,EACD,CAACf,QAAQ,EAAEK,cAAc,EAAEP,QAAQ,CACrC,CAAC;EAED,MAAMmB,aAAa,GAAG3B,KAAK,CAACuB,WAAW,CAAC,MAAM;IAC5CT,cAAc,CAACV,WAAW,CAAC;IAC3BI,QAAQ,CAACJ,WAAW,CAAC;EACvB,CAAC,EAAE,CAACI,QAAQ,CAAC,CAAC;EAEd,MAAMoB,iBAAiB,GAAG5B,KAAK,CAAC6B,OAAO,CACrC,MACEpB,2BAA2B,IAAI,IAAI,gBACjCT,KAAA,CAAA8B,aAAA,CAAC5B,iBAAiB;IAAC6B,UAAU,EAAEtB;EAA4B,CAAE,CAAC,GAC5DuB,SAAS,EACf,CAACvB,2BAA2B,CAC9B,CAAC;EAED,oBACET,KAAA,CAAA8B,aAAA,CAAC7B,cAAc;IACbgC,UAAU,EAAElB,cAAe;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,MAAM,EAAEA,MAAO;IACfiB,eAAe,EAAEZ,mBAAoB;IACrCa,eAAe,EAAER,aAAc;IAC/BT,qBAAqB,EAAEA,qBAAsB;IAC7CC,OAAO,EAAEA,OAAQ;IACjBT,QAAQ,EAAEA,QAAS;IACnBU,SAAS,EAAEA,SAAU;IACrBC,KAAK,EAAEA,KAAM;IACbe,kBAAkB,EAAER,iBAAkB;IACtChB,SAAS,EAAEA;EAAU,CACtB,CAAC;AAEN","ignoreList":[]}
|
|
@@ -24,7 +24,8 @@ export function CbacPickerDialog({
|
|
|
24
24
|
onOpenChange,
|
|
25
25
|
onConfirm,
|
|
26
26
|
initialMarkingIds,
|
|
27
|
-
maxClassificationConstraint
|
|
27
|
+
maxClassificationConstraint,
|
|
28
|
+
includeDeleted
|
|
28
29
|
}) {
|
|
29
30
|
const {
|
|
30
31
|
selectedIds,
|
|
@@ -40,7 +41,9 @@ export function CbacPickerDialog({
|
|
|
40
41
|
toggle,
|
|
41
42
|
dismiss,
|
|
42
43
|
reset
|
|
43
|
-
} = useCbacSelection(initialMarkingIds
|
|
44
|
+
} = useCbacSelection(initialMarkingIds, {
|
|
45
|
+
includeDeleted
|
|
46
|
+
});
|
|
44
47
|
|
|
45
48
|
// Parent controls dialog close on confirm (e.g. to show a loading state)
|
|
46
49
|
const handleConfirm = React.useCallback(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CbacPickerDialog.js","names":["React","BaseCbacPickerDialog","ConstraintCallout","useCbacSelection","getSubmitDisabledReason","CbacPickerDialog","isOpen","onOpenChange","onConfirm","initialMarkingIds","maxClassificationConstraint","selectedIds","categoryGroups","markingStates","banner","requiredMarkingGroups","isValid","userSatisfiesMarkings","disallowedMarkingIds","isLoading","error","toggle","dismiss","reset","handleConfirm","useCallback","handleCancel","hasInitialMarkings","undefined","length","submitDisabledReason","useMemo","constraintCallout","createElement","constraint","onCancel","title","categories","onMarkingToggle","onDismissBanner","validationCallouts"],"sources":["CbacPickerDialog.tsx"],"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\nimport React from \"react\";\n\nimport { BaseCbacPickerDialog } from \"./base/BaseCbacPickerDialog.js\";\nimport { ConstraintCallout } from \"./ConstraintCallout.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport { useCbacSelection } from \"./useCbacSelection.js\";\nimport { getSubmitDisabledReason } from \"./utils/validationMessages.js\";\n\nexport interface CbacPickerDialogProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n onConfirm: (markingIds: string[]) => void;\n initialMarkingIds?: string[];\n maxClassificationConstraint?: MaxClassificationConstraint;\n}\n\nexport function CbacPickerDialog({\n isOpen,\n onOpenChange,\n onConfirm,\n initialMarkingIds,\n maxClassificationConstraint,\n}: CbacPickerDialogProps): React.ReactElement {\n const {\n selectedIds,\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n toggle,\n dismiss,\n reset,\n } = useCbacSelection(initialMarkingIds);\n\n // Parent controls dialog close on confirm (e.g. to show a loading state)\n const handleConfirm = React.useCallback(() => {\n onConfirm(selectedIds);\n }, [onConfirm, selectedIds]);\n\n const handleCancel = React.useCallback(() => {\n reset();\n onOpenChange(false);\n }, [reset, onOpenChange]);\n\n const hasInitialMarkings =\n initialMarkingIds !== undefined && initialMarkingIds.length > 0;\n\n const submitDisabledReason = React.useMemo(\n () =>\n getSubmitDisabledReason({\n isValid,\n requiredMarkingGroups,\n selectedIds,\n disallowedMarkingIds,\n userSatisfiesMarkings,\n }),\n [\n isValid,\n requiredMarkingGroups,\n selectedIds,\n disallowedMarkingIds,\n userSatisfiesMarkings,\n ],\n );\n\n const constraintCallout = React.useMemo(\n () =>\n maxClassificationConstraint != null ? (\n <ConstraintCallout constraint={maxClassificationConstraint} />\n ) : undefined,\n [maxClassificationConstraint],\n );\n\n return (\n <BaseCbacPickerDialog\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n title={hasInitialMarkings ? \"Edit classification\" : \"Add classification\"}\n categories={categoryGroups}\n markingStates={markingStates}\n banner={banner}\n onMarkingToggle={toggle}\n onDismissBanner={dismiss}\n requiredMarkingGroups={requiredMarkingGroups}\n isValid={isValid}\n submitDisabledReason={submitDisabledReason}\n validationCallouts={constraintCallout}\n isLoading={isLoading}\n error={error}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,uBAAuB,QAAQ,+BAA+B;
|
|
1
|
+
{"version":3,"file":"CbacPickerDialog.js","names":["React","BaseCbacPickerDialog","ConstraintCallout","useCbacSelection","getSubmitDisabledReason","CbacPickerDialog","isOpen","onOpenChange","onConfirm","initialMarkingIds","maxClassificationConstraint","includeDeleted","selectedIds","categoryGroups","markingStates","banner","requiredMarkingGroups","isValid","userSatisfiesMarkings","disallowedMarkingIds","isLoading","error","toggle","dismiss","reset","handleConfirm","useCallback","handleCancel","hasInitialMarkings","undefined","length","submitDisabledReason","useMemo","constraintCallout","createElement","constraint","onCancel","title","categories","onMarkingToggle","onDismissBanner","validationCallouts"],"sources":["CbacPickerDialog.tsx"],"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\nimport React from \"react\";\n\nimport { BaseCbacPickerDialog } from \"./base/BaseCbacPickerDialog.js\";\nimport { ConstraintCallout } from \"./ConstraintCallout.js\";\nimport type { MaxClassificationConstraint } from \"./types.js\";\nimport { useCbacSelection } from \"./useCbacSelection.js\";\nimport { getSubmitDisabledReason } from \"./utils/validationMessages.js\";\n\nexport interface CbacPickerDialogProps {\n isOpen: boolean;\n onOpenChange: (open: boolean) => void;\n onConfirm: (markingIds: string[]) => void;\n initialMarkingIds?: string[];\n maxClassificationConstraint?: MaxClassificationConstraint;\n includeDeleted?: boolean;\n}\n\nexport function CbacPickerDialog({\n isOpen,\n onOpenChange,\n onConfirm,\n initialMarkingIds,\n maxClassificationConstraint,\n includeDeleted,\n}: CbacPickerDialogProps): React.ReactElement {\n const {\n selectedIds,\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n toggle,\n dismiss,\n reset,\n } = useCbacSelection(initialMarkingIds, { includeDeleted });\n\n // Parent controls dialog close on confirm (e.g. to show a loading state)\n const handleConfirm = React.useCallback(() => {\n onConfirm(selectedIds);\n }, [onConfirm, selectedIds]);\n\n const handleCancel = React.useCallback(() => {\n reset();\n onOpenChange(false);\n }, [reset, onOpenChange]);\n\n const hasInitialMarkings =\n initialMarkingIds !== undefined && initialMarkingIds.length > 0;\n\n const submitDisabledReason = React.useMemo(\n () =>\n getSubmitDisabledReason({\n isValid,\n requiredMarkingGroups,\n selectedIds,\n disallowedMarkingIds,\n userSatisfiesMarkings,\n }),\n [\n isValid,\n requiredMarkingGroups,\n selectedIds,\n disallowedMarkingIds,\n userSatisfiesMarkings,\n ],\n );\n\n const constraintCallout = React.useMemo(\n () =>\n maxClassificationConstraint != null ? (\n <ConstraintCallout constraint={maxClassificationConstraint} />\n ) : undefined,\n [maxClassificationConstraint],\n );\n\n return (\n <BaseCbacPickerDialog\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n onConfirm={handleConfirm}\n onCancel={handleCancel}\n title={hasInitialMarkings ? \"Edit classification\" : \"Add classification\"}\n categories={categoryGroups}\n markingStates={markingStates}\n banner={banner}\n onMarkingToggle={toggle}\n onDismissBanner={dismiss}\n requiredMarkingGroups={requiredMarkingGroups}\n isValid={isValid}\n submitDisabledReason={submitDisabledReason}\n validationCallouts={constraintCallout}\n isLoading={isLoading}\n error={error}\n />\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,oBAAoB,QAAQ,gCAAgC;AACrE,SAASC,iBAAiB,QAAQ,wBAAwB;AAE1D,SAASC,gBAAgB,QA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B;IAACiC,UAAU,EAAEzB;EAA4B,CAAE,CAAC,GAC5DmB,SAAS,EACf,CAACnB,2BAA2B,CAC9B,CAAC;EAED,oBACEV,KAAA,CAAAkC,aAAA,CAACjC,oBAAoB;IACnBK,MAAM,EAAEA,MAAO;IACfC,YAAY,EAAEA,YAAa;IAC3BC,SAAS,EAAEiB,aAAc;IACzBW,QAAQ,EAAET,YAAa;IACvBU,KAAK,EAAET,kBAAkB,GAAG,qBAAqB,GAAG,oBAAqB;IACzEU,UAAU,EAAEzB,cAAe;IAC3BC,aAAa,EAAEA,aAAc;IAC7BC,MAAM,EAAEA,MAAO;IACfwB,eAAe,EAAEjB,MAAO;IACxBkB,eAAe,EAAEjB,OAAQ;IACzBP,qBAAqB,EAAEA,qBAAsB;IAC7CC,OAAO,EAAEA,OAAQ;IACjBc,oBAAoB,EAAEA,oBAAqB;IAC3CU,kBAAkB,EAAER,iBAAkB;IACtCb,SAAS,EAAEA,SAAU;IACrBC,KAAK,EAAEA;EAAM,CACd,CAAC;AAEN","ignoreList":[]}
|
|
@@ -26,20 +26,20 @@ function useStableArray(arr) {
|
|
|
26
26
|
}
|
|
27
27
|
return ref.current;
|
|
28
28
|
}
|
|
29
|
-
export function useCbacPickerState(selectedIds) {
|
|
29
|
+
export function useCbacPickerState(selectedIds, options) {
|
|
30
30
|
const stableSelectedIds = useStableArray(selectedIds);
|
|
31
31
|
const {
|
|
32
32
|
categories: rawCategories,
|
|
33
33
|
isLoading: categoriesLoading,
|
|
34
34
|
error: categoriesError,
|
|
35
35
|
refetch: refetchCategories
|
|
36
|
-
} = useMarkingCategories();
|
|
36
|
+
} = useMarkingCategories(options);
|
|
37
37
|
const {
|
|
38
38
|
markings: rawMarkings,
|
|
39
39
|
isLoading: markingsLoading,
|
|
40
40
|
error: markingsError,
|
|
41
41
|
refetch: refetchMarkings
|
|
42
|
-
} = useMarkings();
|
|
42
|
+
} = useMarkings(options);
|
|
43
43
|
const {
|
|
44
44
|
banner: latestBanner,
|
|
45
45
|
isLoading: bannerLoading,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCbacPickerState.js","names":["useCbacBanner","useCbacMarkingRestrictions","useMarkingCategories","useMarkings","React","EMPTY_ARRAY","resolveRequiredGroups","computeMarkingStates","groupMarkingsByCategory","EMPTY_GROUPS","useStableArray","arr","ref","useRef","length","current","some","id","i","useCbacPickerState","selectedIds","stableSelectedIds","categories","rawCategories","isLoading","categoriesLoading","error","categoriesError","refetch","refetchCategories","markings","rawMarkings","markingsLoading","markingsError","refetchMarkings","banner","latestBanner","bannerLoading","bannerError","refetchBanner","markingIds","bannerRef","restrictions","restrictionsLoading","restrictionsError","refetchRestrictions","impliedMarkingIds","impliedMarkings","disallowedMarkingIds","disallowedMarkings","requiredMarkingGroups","requiredMarkings","isValid","userSatisfiesMarkings","useMemo","errors","filter","e","AggregateError","map","message","join","retry","useCallback","categoryGroups","undefined","markingStates","resolvedRequiredGroups"],"sources":["useCbacPickerState.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\nimport {\n useCbacBanner,\n useCbacMarkingRestrictions,\n useMarkingCategories,\n useMarkings,\n} from \"@osdk/react/platform-apis\";\nimport React from \"react\";\n\nimport type {\n CategoryMarkingGroup,\n CbacBannerData,\n MarkingSelectionState,\n RequiredMarkingGroup,\n} from \"./types.js\";\nimport { EMPTY_ARRAY, resolveRequiredGroups } from \"./utils/cbacPickerUtils.js\";\nimport {\n computeMarkingStates,\n groupMarkingsByCategory,\n} from \"./utils/selectionLogic.js\";\n\nconst EMPTY_GROUPS: string[][] = [];\n\nexport interface UseCbacPickerStateResult {\n categoryGroups: CategoryMarkingGroup[];\n markingStates: Map<string, MarkingSelectionState>;\n banner: CbacBannerData | undefined;\n requiredMarkingGroups: RequiredMarkingGroup[];\n isValid: boolean;\n userSatisfiesMarkings: boolean;\n disallowedMarkingIds: readonly string[];\n isLoading: boolean;\n error: Error | undefined;\n retry: () => void;\n}\n\nfunction useStableArray(arr: string[]): string[] {\n const ref = React.useRef(arr);\n if (\n arr.length !== ref.current.length ||\n arr.some((id, i) => id !== ref.current[i])\n ) {\n ref.current = arr;\n }\n return ref.current;\n}\n\nexport function useCbacPickerState(\n selectedIds: string[],\n): UseCbacPickerStateResult {\n const stableSelectedIds = useStableArray(selectedIds);\n const {\n categories: rawCategories,\n isLoading: categoriesLoading,\n error: categoriesError,\n refetch: refetchCategories,\n } = useMarkingCategories();\n const {\n markings: rawMarkings,\n isLoading: markingsLoading,\n error: markingsError,\n refetch: refetchMarkings,\n } = useMarkings();\n const {\n banner: latestBanner,\n isLoading: bannerLoading,\n error: bannerError,\n refetch: refetchBanner,\n } = useCbacBanner({ markingIds: stableSelectedIds });\n\n const bannerRef = React.useRef(latestBanner);\n if (latestBanner != null) {\n bannerRef.current = latestBanner;\n }\n const banner = latestBanner ?? bannerRef.current;\n const {\n restrictions,\n isLoading: restrictionsLoading,\n error: restrictionsError,\n refetch: refetchRestrictions,\n } = useCbacMarkingRestrictions({ markingIds: stableSelectedIds });\n\n const impliedMarkingIds = restrictions?.impliedMarkings ?? EMPTY_ARRAY;\n const disallowedMarkingIds = restrictions?.disallowedMarkings ?? EMPTY_ARRAY;\n const requiredMarkingGroups = restrictions?.requiredMarkings ?? EMPTY_GROUPS;\n const isValid = restrictions?.isValid ?? true;\n const userSatisfiesMarkings = restrictions?.userSatisfiesMarkings ?? true;\n\n const isLoading =\n categoriesLoading ||\n markingsLoading ||\n restrictionsLoading ||\n bannerLoading;\n\n const error = React.useMemo(() => {\n const errors = [\n categoriesError,\n markingsError,\n restrictionsError,\n bannerError,\n ].filter((e): e is Error => e != null);\n if (errors.length > 1) {\n return new AggregateError(\n errors,\n errors.map((e) => e.message).join(\"; \"),\n );\n }\n return errors[0];\n }, [categoriesError, markingsError, restrictionsError, bannerError]);\n\n const retry = React.useCallback(() => {\n refetchCategories();\n refetchMarkings();\n refetchBanner();\n refetchRestrictions();\n }, [refetchCategories, refetchMarkings, refetchBanner, refetchRestrictions]);\n\n const categoryGroups = React.useMemo((): CategoryMarkingGroup[] => {\n if (rawCategories === undefined || rawMarkings === undefined) {\n return [];\n }\n return groupMarkingsByCategory(rawMarkings, rawCategories);\n }, [rawMarkings, rawCategories]);\n\n const markingStates = React.useMemo(\n () =>\n computeMarkingStates(\n stableSelectedIds,\n impliedMarkingIds,\n disallowedMarkingIds,\n ),\n [stableSelectedIds, impliedMarkingIds, disallowedMarkingIds],\n );\n\n const resolvedRequiredGroups = React.useMemo(\n () => resolveRequiredGroups(categoryGroups, requiredMarkingGroups),\n [categoryGroups, requiredMarkingGroups],\n );\n\n return React.useMemo(\n () => ({\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups: resolvedRequiredGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n retry,\n }),\n [\n categoryGroups,\n markingStates,\n banner,\n resolvedRequiredGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n retry,\n ],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,0BAA0B,EAC1BC,oBAAoB,EACpBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,KAAK,MAAM,OAAO;AAQzB,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,4BAA4B;AAC/E,SACEC,oBAAoB,EACpBC,uBAAuB,QAClB,2BAA2B;AAElC,MAAMC,YAAwB,GAAG,EAAE;
|
|
1
|
+
{"version":3,"file":"useCbacPickerState.js","names":["useCbacBanner","useCbacMarkingRestrictions","useMarkingCategories","useMarkings","React","EMPTY_ARRAY","resolveRequiredGroups","computeMarkingStates","groupMarkingsByCategory","EMPTY_GROUPS","useStableArray","arr","ref","useRef","length","current","some","id","i","useCbacPickerState","selectedIds","options","stableSelectedIds","categories","rawCategories","isLoading","categoriesLoading","error","categoriesError","refetch","refetchCategories","markings","rawMarkings","markingsLoading","markingsError","refetchMarkings","banner","latestBanner","bannerLoading","bannerError","refetchBanner","markingIds","bannerRef","restrictions","restrictionsLoading","restrictionsError","refetchRestrictions","impliedMarkingIds","impliedMarkings","disallowedMarkingIds","disallowedMarkings","requiredMarkingGroups","requiredMarkings","isValid","userSatisfiesMarkings","useMemo","errors","filter","e","AggregateError","map","message","join","retry","useCallback","categoryGroups","undefined","markingStates","resolvedRequiredGroups"],"sources":["useCbacPickerState.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\nimport {\n useCbacBanner,\n useCbacMarkingRestrictions,\n useMarkingCategories,\n useMarkings,\n} from \"@osdk/react/platform-apis\";\nimport React from \"react\";\n\nimport type {\n CategoryMarkingGroup,\n CbacBannerData,\n MarkingSelectionState,\n RequiredMarkingGroup,\n} from \"./types.js\";\nimport { EMPTY_ARRAY, resolveRequiredGroups } from \"./utils/cbacPickerUtils.js\";\nimport {\n computeMarkingStates,\n groupMarkingsByCategory,\n} from \"./utils/selectionLogic.js\";\n\nconst EMPTY_GROUPS: string[][] = [];\n\nexport interface UseCbacPickerStateOptions {\n includeDeleted?: boolean;\n}\n\nexport interface UseCbacPickerStateResult {\n categoryGroups: CategoryMarkingGroup[];\n markingStates: Map<string, MarkingSelectionState>;\n banner: CbacBannerData | undefined;\n requiredMarkingGroups: RequiredMarkingGroup[];\n isValid: boolean;\n userSatisfiesMarkings: boolean;\n disallowedMarkingIds: readonly string[];\n isLoading: boolean;\n error: Error | undefined;\n retry: () => void;\n}\n\nfunction useStableArray(arr: string[]): string[] {\n const ref = React.useRef(arr);\n if (\n arr.length !== ref.current.length ||\n arr.some((id, i) => id !== ref.current[i])\n ) {\n ref.current = arr;\n }\n return ref.current;\n}\n\nexport function useCbacPickerState(\n selectedIds: string[],\n options?: UseCbacPickerStateOptions,\n): UseCbacPickerStateResult {\n const stableSelectedIds = useStableArray(selectedIds);\n const {\n categories: rawCategories,\n isLoading: categoriesLoading,\n error: categoriesError,\n refetch: refetchCategories,\n } = useMarkingCategories(options);\n const {\n markings: rawMarkings,\n isLoading: markingsLoading,\n error: markingsError,\n refetch: refetchMarkings,\n } = useMarkings(options);\n const {\n banner: latestBanner,\n isLoading: bannerLoading,\n error: bannerError,\n refetch: refetchBanner,\n } = useCbacBanner({ markingIds: stableSelectedIds });\n\n const bannerRef = React.useRef(latestBanner);\n if (latestBanner != null) {\n bannerRef.current = latestBanner;\n }\n const banner = latestBanner ?? bannerRef.current;\n const {\n restrictions,\n isLoading: restrictionsLoading,\n error: restrictionsError,\n refetch: refetchRestrictions,\n } = useCbacMarkingRestrictions({ markingIds: stableSelectedIds });\n\n const impliedMarkingIds = restrictions?.impliedMarkings ?? EMPTY_ARRAY;\n const disallowedMarkingIds = restrictions?.disallowedMarkings ?? EMPTY_ARRAY;\n const requiredMarkingGroups = restrictions?.requiredMarkings ?? EMPTY_GROUPS;\n const isValid = restrictions?.isValid ?? true;\n const userSatisfiesMarkings = restrictions?.userSatisfiesMarkings ?? true;\n\n const isLoading =\n categoriesLoading ||\n markingsLoading ||\n restrictionsLoading ||\n bannerLoading;\n\n const error = React.useMemo(() => {\n const errors = [\n categoriesError,\n markingsError,\n restrictionsError,\n bannerError,\n ].filter((e): e is Error => e != null);\n if (errors.length > 1) {\n return new AggregateError(\n errors,\n errors.map((e) => e.message).join(\"; \"),\n );\n }\n return errors[0];\n }, [categoriesError, markingsError, restrictionsError, bannerError]);\n\n const retry = React.useCallback(() => {\n refetchCategories();\n refetchMarkings();\n refetchBanner();\n refetchRestrictions();\n }, [refetchCategories, refetchMarkings, refetchBanner, refetchRestrictions]);\n\n const categoryGroups = React.useMemo((): CategoryMarkingGroup[] => {\n if (rawCategories === undefined || rawMarkings === undefined) {\n return [];\n }\n return groupMarkingsByCategory(rawMarkings, rawCategories);\n }, [rawMarkings, rawCategories]);\n\n const markingStates = React.useMemo(\n () =>\n computeMarkingStates(\n stableSelectedIds,\n impliedMarkingIds,\n disallowedMarkingIds,\n ),\n [stableSelectedIds, impliedMarkingIds, disallowedMarkingIds],\n );\n\n const resolvedRequiredGroups = React.useMemo(\n () => resolveRequiredGroups(categoryGroups, requiredMarkingGroups),\n [categoryGroups, requiredMarkingGroups],\n );\n\n return React.useMemo(\n () => ({\n categoryGroups,\n markingStates,\n banner,\n requiredMarkingGroups: resolvedRequiredGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n retry,\n }),\n [\n categoryGroups,\n markingStates,\n banner,\n resolvedRequiredGroups,\n isValid,\n userSatisfiesMarkings,\n disallowedMarkingIds,\n isLoading,\n error,\n retry,\n ],\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SACEA,aAAa,EACbC,0BAA0B,EAC1BC,oBAAoB,EACpBC,WAAW,QACN,2BAA2B;AAClC,OAAOC,KAAK,MAAM,OAAO;AAQzB,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,4BAA4B;AAC/E,SACEC,oBAAoB,EACpBC,uBAAuB,QAClB,2BAA2B;AA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,CAAC;IACjBK,aAAa,CAAC,CAAC;IACfM,mBAAmB,CAAC,CAAC;EACvB,CAAC,EAAE,CAAChB,iBAAiB,EAAEK,eAAe,EAAEK,aAAa,EAAEM,mBAAmB,CAAC,CAAC;EAE5E,MAAMmB,cAAc,GAAG7D,KAAK,CAACmD,OAAO,CAAC,MAA8B;IACjE,IAAI/B,aAAa,KAAK0C,SAAS,IAAIlC,WAAW,KAAKkC,SAAS,EAAE;MAC5D,OAAO,EAAE;IACX;IACA,OAAO1D,uBAAuB,CAACwB,WAAW,EAAER,aAAa,CAAC;EAC5D,CAAC,EAAE,CAACQ,WAAW,EAAER,aAAa,CAAC,CAAC;EAEhC,MAAM2C,aAAa,GAAG/D,KAAK,CAACmD,OAAO,CACjC,MACEhD,oBAAoB,CAClBe,iBAAiB,EACjByB,iBAAiB,EACjBE,oBACF,CAAC,EACH,CAAC3B,iBAAiB,EAAEyB,iBAAiB,EAAEE,oBAAoB,CAC7D,CAAC;EAED,MAAMmB,sBAAsB,GAAGhE,KAAK,CAACmD,OAAO,CAC1C,MAAMjD,qBAAqB,CAAC2D,cAAc,EAAEd,qBAAqB,CAAC,EAClE,CAACc,cAAc,EAAEd,qBAAqB,CACxC,CAAC;EAED,OAAO/C,KAAK,CAACmD,OAAO,CAClB,OAAO;IACLU,cAAc;IACdE,aAAa;IACb/B,MAAM;IACNe,qBAAqB,EAAEiB,sBAAsB;IAC7Cf,OAAO;IACPC,qBAAqB;IACrBL,oBAAoB;IACpBxB,SAAS;IACTE,KAAK;IACLoC;EACF,CAAC,CAAC,EACF,CACEE,cAAc,EACdE,aAAa,EACb/B,MAAM,EACNgC,sBAAsB,EACtBf,OAAO,EACPC,qBAAqB,EACrBL,oBAAoB,EACpBxB,SAAS,EACTE,KAAK,EACLoC,KAAK,CAET,CAAC;AACH","ignoreList":[]}
|
|
@@ -18,14 +18,14 @@ import React from "react";
|
|
|
18
18
|
import { useCbacPickerState } from "./useCbacPickerState.js";
|
|
19
19
|
import { EMPTY_ARRAY } from "./utils/cbacPickerUtils.js";
|
|
20
20
|
import { toggleMarking } from "./utils/selectionLogic.js";
|
|
21
|
-
export function useCbacSelection(initialMarkingIds) {
|
|
21
|
+
export function useCbacSelection(initialMarkingIds, options) {
|
|
22
22
|
const [selectedIds, setSelectedIds] = React.useState(initialMarkingIds ?? EMPTY_ARRAY);
|
|
23
23
|
const [prevInitialIds, setPrevInitialIds] = React.useState(initialMarkingIds);
|
|
24
24
|
if (initialMarkingIds !== prevInitialIds) {
|
|
25
25
|
setPrevInitialIds(initialMarkingIds);
|
|
26
26
|
setSelectedIds(initialMarkingIds ?? EMPTY_ARRAY);
|
|
27
27
|
}
|
|
28
|
-
const pickerState = useCbacPickerState(selectedIds);
|
|
28
|
+
const pickerState = useCbacPickerState(selectedIds, options);
|
|
29
29
|
const selectedIdsRef = React.useRef(selectedIds);
|
|
30
30
|
selectedIdsRef.current = selectedIds;
|
|
31
31
|
const categoryGroupsRef = React.useRef(pickerState.categoryGroups);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCbacSelection.js","names":["React","useCbacPickerState","EMPTY_ARRAY","toggleMarking","useCbacSelection","initialMarkingIds","selectedIds","setSelectedIds","useState","prevInitialIds","setPrevInitialIds","pickerState","selectedIdsRef","useRef","current","categoryGroupsRef","categoryGroups","toggle","useCallback","markingId","prev","dismiss","reset"],"sources":["useCbacSelection.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\nimport React from \"react\";\n\nimport type { CategoryMarkingGroup } from \"./types.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"useCbacSelection.js","names":["React","useCbacPickerState","EMPTY_ARRAY","toggleMarking","useCbacSelection","initialMarkingIds","options","selectedIds","setSelectedIds","useState","prevInitialIds","setPrevInitialIds","pickerState","selectedIdsRef","useRef","current","categoryGroupsRef","categoryGroups","toggle","useCallback","markingId","prev","dismiss","reset"],"sources":["useCbacSelection.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\nimport React from \"react\";\n\nimport type { CategoryMarkingGroup } from \"./types.js\";\nimport type {\n UseCbacPickerStateOptions,\n UseCbacPickerStateResult,\n} from \"./useCbacPickerState.js\";\nimport { useCbacPickerState } from \"./useCbacPickerState.js\";\nimport { EMPTY_ARRAY } from \"./utils/cbacPickerUtils.js\";\nimport { toggleMarking } from \"./utils/selectionLogic.js\";\n\nexport interface UseCbacSelectionResult extends UseCbacPickerStateResult {\n selectedIds: string[];\n selectedIdsRef: React.MutableRefObject<string[]>;\n setSelectedIds: React.Dispatch<React.SetStateAction<string[]>>;\n toggle: (markingId: string) => void;\n dismiss: () => void;\n reset: () => void;\n}\n\nexport function useCbacSelection(\n initialMarkingIds: string[] | undefined,\n options?: UseCbacPickerStateOptions,\n): UseCbacSelectionResult {\n const [selectedIds, setSelectedIds] = React.useState<string[]>(\n initialMarkingIds ?? EMPTY_ARRAY,\n );\n\n const [prevInitialIds, setPrevInitialIds] = React.useState(initialMarkingIds);\n if (initialMarkingIds !== prevInitialIds) {\n setPrevInitialIds(initialMarkingIds);\n setSelectedIds(initialMarkingIds ?? EMPTY_ARRAY);\n }\n\n const pickerState = useCbacPickerState(selectedIds, options);\n\n const selectedIdsRef = React.useRef(selectedIds);\n selectedIdsRef.current = selectedIds;\n\n const categoryGroupsRef = React.useRef<CategoryMarkingGroup[]>(\n pickerState.categoryGroups,\n );\n categoryGroupsRef.current = pickerState.categoryGroups;\n\n const toggle = React.useCallback((markingId: string) => {\n setSelectedIds((prev) =>\n toggleMarking(markingId, prev, categoryGroupsRef.current),\n );\n }, []);\n\n const dismiss = React.useCallback(() => {\n setSelectedIds(EMPTY_ARRAY);\n }, []);\n\n const reset = React.useCallback(() => {\n setSelectedIds(initialMarkingIds ?? EMPTY_ARRAY);\n }, [initialMarkingIds]);\n\n return {\n selectedIds,\n selectedIdsRef,\n setSelectedIds,\n ...pickerState,\n toggle,\n dismiss,\n reset,\n };\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,KAAK,MAAM,OAAO;AAOzB,SAASC,kBAAkB,QAAQ,yBAAyB;AAC5D,SAASC,WAAW,QAAQ,4BAA4B;AACxD,SAASC,aAAa,QAAQ,2BAA2B;AAWzD,OAAO,SAASC,gBAAgBA,CAC9BC,iBAAuC,EACvCC,OAAmC,EACX;EACxB,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGR,KAAK,CAACS,QAAQ,CAClDJ,iBAAiB,IAAIH,WACvB,CAAC;EAED,MAAM,CAACQ,cAAc,EAAEC,iBAAiB,CAAC,GAAGX,KAAK,CAACS,QAAQ,CAACJ,iBAAiB,CAAC;EAC7E,IAAIA,iBAAiB,KAAKK,cAAc,EAAE;IACxCC,iBAAiB,CAACN,iBAAiB,CAAC;IACpCG,cAAc,CAACH,iBAAiB,IAAIH,WAAW,CAAC;EAClD;EAEA,MAAMU,WAAW,GAAGX,kBAAkB,CAACM,WAAW,EAAED,OAAO,CAAC;EAE5D,MAAMO,cAAc,GAAGb,KAAK,CAACc,MAAM,CAACP,WAAW,CAAC;EAChDM,cAAc,CAACE,OAAO,GAAGR,WAAW;EAEpC,MAAMS,iBAAiB,GAAGhB,KAAK,CAACc,MAAM,CACpCF,WAAW,CAACK,cACd,CAAC;EACDD,iBAAiB,CAACD,OAAO,GAAGH,WAAW,CAACK,cAAc;EAEtD,MAAMC,MAAM,GAAGlB,KAAK,CAACmB,WAAW,CAAEC,SAAiB,IAAK;IACtDZ,cAAc,CAAEa,IAAI,IAClBlB,aAAa,CAACiB,SAAS,EAAEC,IAAI,EAAEL,iBAAiB,CAACD,OAAO,CAC1D,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMO,OAAO,GAAGtB,KAAK,CAACmB,WAAW,CAAC,MAAM;IACtCX,cAAc,CAACN,WAAW,CAAC;EAC7B,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMqB,KAAK,GAAGvB,KAAK,CAACmB,WAAW,CAAC,MAAM;IACpCX,cAAc,CAACH,iBAAiB,IAAIH,WAAW,CAAC;EAClD,CAAC,EAAE,CAACG,iBAAiB,CAAC,CAAC;EAEvB,OAAO;IACLE,WAAW;IACXM,cAAc;IACdL,cAAc;IACd,GAAGI,WAAW;IACdM,MAAM;IACNI,OAAO;IACPC;EACF,CAAC;AACH","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.65.0-main-9755094ff5471c4508269be1d72eef98667b5042"}`;
|
|
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 = `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,GAAG,
|
|
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 = `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,GAAG,iFAAsD;AAEjF,OAAO,SAASC,kBAAkBA,CAACC,aAAqB,EAAU;EAChE,OAAO,GAAGF,kBAAkB,IAAIE,aAAa,EAAE;AACjD","ignoreList":[]}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3H2NCAME_cjs = require('./chunk-3H2NCAME.cjs');
|
|
4
4
|
var chunkRVZE7LPI_cjs = require('./chunk-RVZE7LPI.cjs');
|
|
5
5
|
|
|
6
6
|
// src/public/experimental/xml-viewer.ts
|
|
7
7
|
var BaseXmlViewer2 = chunkRVZE7LPI_cjs.BaseXmlViewer;
|
|
8
|
-
var XmlViewer2 =
|
|
8
|
+
var XmlViewer2 = chunk3H2NCAME_cjs.XmlViewer;
|
|
9
9
|
|
|
10
10
|
exports.BaseXmlViewer = BaseXmlViewer2;
|
|
11
11
|
exports.XmlViewer = XmlViewer2;
|
|
12
|
-
//# sourceMappingURL=chunk-
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
12
|
+
//# sourceMappingURL=chunk-34HADMUV.cjs.map
|
|
13
|
+
//# sourceMappingURL=chunk-34HADMUV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/experimental/xml-viewer.ts"],"names":["BaseXmlViewer","XmlViewer"],"mappings":";;;;;;AAmBO,IAAMA,cAAAA,GAAuBA;AAO7B,IAAMC,UAAAA,GAAmBA","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/experimental/xml-viewer.ts"],"names":["BaseXmlViewer","XmlViewer"],"mappings":";;;;;;AAmBO,IAAMA,cAAAA,GAAuBA;AAO7B,IAAMC,UAAAA,GAAmBA","file":"chunk-34HADMUV.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\nimport * as Stable from \"../xml-viewer.js\";\n\n/** @deprecated Import from `@osdk/react-components/xml-viewer` instead. */\nexport const BaseXmlViewer = Stable.BaseXmlViewer;\n\n/** @deprecated Import from `@osdk/react-components/xml-viewer` instead. */\n\n/** @deprecated Import from `@osdk/react-components/xml-viewer` instead. */\n\n/** @deprecated Import from `@osdk/react-components/xml-viewer` instead. */\nexport const XmlViewer = Stable.XmlViewer;"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkRVZE7LPI_cjs = require('./chunk-RVZE7LPI.cjs');
|
|
4
|
+
var chunkOOBIACIP_cjs = require('./chunk-OOBIACIP.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/xml-viewer.ts
|
|
7
|
+
var XmlViewer2 = chunkOOBIACIP_cjs.withOsdkMetrics(chunkRVZE7LPI_cjs.XmlViewer, "XmlViewer");
|
|
8
|
+
|
|
9
|
+
exports.XmlViewer = XmlViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-3H2NCAME.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-3H2NCAME.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/xml-viewer.ts"],"names":["XmlViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/xml-viewer.ts"],"names":["XmlViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-3H2NCAME.cjs","sourcesContent":["/*\n * Copyright 2026 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// BaseXmlViewer\nexport { BaseXmlViewer } from \"../xml-viewer/BaseXmlViewer.js\";\n// XmlViewer (Media wrapper)\nimport { withOsdkMetrics } from \"../util/withOsdkMetrics.js\";\nimport { XmlViewer as _XmlViewer } from \"../xml-viewer/XmlViewer.js\";\nexport const XmlViewer = withOsdkMetrics(_XmlViewer, \"XmlViewer\");"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkPA7IYPBX_cjs = require('./chunk-PA7IYPBX.cjs');
|
|
4
|
+
var chunkOOBIACIP_cjs = require('./chunk-OOBIACIP.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/email-viewer.ts
|
|
7
|
+
var EmailViewer2 = chunkOOBIACIP_cjs.withOsdkMetrics(chunkPA7IYPBX_cjs.EmailViewer, "EmailViewer");
|
|
8
|
+
|
|
9
|
+
exports.EmailViewer = EmailViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-5243YJNC.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-5243YJNC.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/email-viewer.ts"],"names":["EmailViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-5243YJNC.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\");"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkDTYFQRFD_cjs = require('./chunk-DTYFQRFD.cjs');
|
|
4
|
+
var chunkOOBIACIP_cjs = require('./chunk-OOBIACIP.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/tiff-viewer.ts
|
|
7
|
+
var TiffViewer2 = chunkOOBIACIP_cjs.withOsdkMetrics(chunkDTYFQRFD_cjs.TiffViewer, "TiffViewer");
|
|
8
|
+
|
|
9
|
+
exports.TiffViewer = TiffViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-6M5KQOZ6.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-6M5KQOZ6.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/tiff-viewer.ts"],"names":["TiffViewer","withOsdkMetrics"],"mappings":";;;;;;AAsBO,IAAMA,WAAAA,GAAaC,iCAAA,CAAgBD,4BAAA,EAAa,YAAY","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/tiff-viewer.ts"],"names":["TiffViewer","withOsdkMetrics"],"mappings":";;;;;;AAsBO,IAAMA,WAAAA,GAAaC,iCAAA,CAAgBD,4BAAA,EAAa,YAAY","file":"chunk-6M5KQOZ6.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 { TiffViewer as _TiffViewer } from \"../images/tiff-viewer/TiffViewer.js\";\nimport { withOsdkMetrics } from \"../util/withOsdkMetrics.js\";\n\n// BaseTiffViewer\nexport { BaseTiffViewer } from \"../images/tiff-viewer/BaseTiffViewer.js\";\n// TiffViewer (Media wrapper)\nexport const TiffViewer = withOsdkMetrics(_TiffViewer, \"TiffViewer\");"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk4KHF42ZL_cjs = require('./chunk-4KHF42ZL.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkOOBIACIP_cjs = require('./chunk-OOBIACIP.cjs');
|
|
5
5
|
var icons = require('@blueprintjs/icons');
|
|
6
6
|
var classnames = require('classnames');
|
|
7
7
|
require('pdfjs-dist/web/pdf_viewer.css');
|
|
@@ -187,12 +187,12 @@ function usePdfViewerInstance(options) {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
// src/public/pdf-viewer.ts
|
|
190
|
-
var PdfViewer2 =
|
|
190
|
+
var PdfViewer2 = chunkOOBIACIP_cjs.withOsdkMetrics(chunk4KHF42ZL_cjs.PdfViewer, "PdfViewer");
|
|
191
191
|
|
|
192
192
|
exports.PdfViewer = PdfViewer2;
|
|
193
193
|
exports.PdfViewerContent = PdfViewerContent;
|
|
194
194
|
exports.PdfViewerProvider = PdfViewerProvider;
|
|
195
195
|
exports.usePdfViewerContext = usePdfViewerContext;
|
|
196
196
|
exports.usePdfViewerInstance = usePdfViewerInstance;
|
|
197
|
-
//# sourceMappingURL=chunk-
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
197
|
+
//# sourceMappingURL=chunk-726QUP47.cjs.map
|
|
198
|
+
//# sourceMappingURL=chunk-726QUP47.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/pdf-viewer/components/PdfViewerContent.tsx","../../src/pdf-viewer/PdfViewerContext.tsx","../../src/public/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","BasePdfViewer_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;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA,EAAc,gBAAA;AAAA,EACd,aAAA,EAAe,iBAAA;AAAA,EACf,QAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,EAAG;AACD,EAAA,MAAM,SAASC,kCAAA,CAAiB;AAAA,IAC9B,GAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACD,CAAA;AACD,EAAA,MAAM,iBAAA,GAAoBC,0CAAwB,WAAW,CAAA;AAC7D,EAAAC,kCAAA,CAAiB;AAAA,IACf,cAAc,MAAA,CAAO,YAAA;AAAA,IACrB,aAAa,MAAA,CAAO,WAAA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AA;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;;;ACjEO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-FJJZBIZS.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 { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nimport styles from \"../BasePdfViewer.module.css\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n defaultPage,\n initialPage,\n defaultScale,\n initialScale,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n defaultPage,\n initialPage,\n defaultScale,\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 defaultPage: options.defaultPage,\n initialPage: options.initialPage,\n defaultScale: options.defaultScale,\n initialScale: options.initialScale,\n defaultAutoSize: options.defaultAutoSize,\n initialAutoSize: options.initialAutoSize,\n defaultSidebarOpen: options.defaultSidebarOpen,\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.enableHighlight ?? 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\n // `highlightEnabled` is the deprecated spelling of `enableHighlight`.\n const highlightEnabled = options.enableHighlight ?? 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// BasePdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/BasePdfViewer.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\n// PdfViewer context\n\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../pdf-viewer/PdfViewerContext.js\";\n\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/PdfViewer.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/pdf-viewer.ts"],"names":["EMPTY_ANNOTATION_ARRAY","usePdfViewerCore","usePdfAnnotationsByPage","usePdfFormFields","useRef","useEffect","classnames","BasePdfViewer_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;AAAA,EACA,WAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA,EAAc,gBAAA;AAAA,EACd,aAAA,EAAe,iBAAA;AAAA,EACf,QAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAAA,EAAG;AACD,EAAA,MAAM,SAASC,kCAAA,CAAiB;AAAA,IAC9B,GAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,YAAA;AAAA,IACA;AAAA,GACD,CAAA;AAC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,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;;;ACjEO,IAAMC,UAAAA,GAAYC,iCAAA,CAAgBD,2BAAA,EAAY,WAAW","file":"chunk-726QUP47.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 { PdfAnnotationOverlay } from \"./PdfAnnotationOverlay.js\";\nimport styles from \"../BasePdfViewer.module.css\";\nexport function PdfViewerContent({\n src,\n annotations = EMPTY_ANNOTATION_ARRAY,\n onAnnotationClick,\n defaultPage,\n initialPage,\n defaultScale,\n initialScale,\n onPageChange: onPageChangeProp,\n onScaleChange: onScaleChangeProp,\n formData,\n onFormChange,\n className\n}) {\n const viewer = usePdfViewerCore({\n src,\n defaultPage,\n initialPage,\n defaultScale,\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 defaultPage: options.defaultPage,\n initialPage: options.initialPage,\n defaultScale: options.defaultScale,\n initialScale: options.initialScale,\n defaultAutoSize: options.defaultAutoSize,\n initialAutoSize: options.initialAutoSize,\n defaultSidebarOpen: options.defaultSidebarOpen,\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.enableHighlight ?? 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\n // `highlightEnabled` is the deprecated spelling of `enableHighlight`.\n const highlightEnabled = options.enableHighlight ?? 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// BasePdfViewer\nexport { BasePdfViewer } from \"../pdf-viewer/BasePdfViewer.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\n// PdfViewer context\n\nexport { PdfViewerProvider, usePdfViewerContext, usePdfViewerInstance } from \"../pdf-viewer/PdfViewerContext.js\";\n\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/PdfViewer.js\";\nimport { withOsdkMetrics } from \"../util/withOsdkMetrics.js\";\nexport const PdfViewer = withOsdkMetrics(_PdfViewer, \"PdfViewer\");"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkKHMOMROL_cjs = require('./chunk-KHMOMROL.cjs');
|
|
4
|
+
var chunkOOBIACIP_cjs = require('./chunk-OOBIACIP.cjs');
|
|
5
|
+
|
|
6
|
+
// src/public/video-viewer.ts
|
|
7
|
+
var VideoViewer2 = chunkOOBIACIP_cjs.withOsdkMetrics(chunkKHMOMROL_cjs.VideoViewer, "VideoViewer");
|
|
8
|
+
|
|
9
|
+
exports.VideoViewer = VideoViewer2;
|
|
10
|
+
//# sourceMappingURL=chunk-75ZD2NHY.cjs.map
|
|
11
|
+
//# sourceMappingURL=chunk-75ZD2NHY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/public/video-viewer.ts"],"names":["VideoViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../../src/public/video-viewer.ts"],"names":["VideoViewer","withOsdkMetrics"],"mappings":";;;;;;AAqBO,IAAMA,YAAAA,GAAcC,iCAAA,CAAgBD,6BAAA,EAAc,aAAa","file":"chunk-75ZD2NHY.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\");"]}
|