@ornikar/kitt-universal 32.5.1 → 32.5.2

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 CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [32.5.2](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@32.5.1...@ornikar/kitt-universal@32.5.2) (2025-12-18)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **kitt-universal/DocumentPicker:** add try catch around `getDocumentAsync` to stop Sentry issues [OSE-22127] ([#2815](https://github.com/ornikar/kitt/issues/2815)) ([0d8881c](https://github.com/ornikar/kitt/commit/0d8881c0e1ea41dd9a271bb7ee2b621c28423468))
12
+
13
+
14
+
6
15
  ## [32.5.1](https://github.com/ornikar/kitt/compare/@ornikar/kitt-universal@32.5.0...@ornikar/kitt-universal@32.5.1) (2025-12-17)
7
16
 
8
17
  **Note:** Version bump only for package @ornikar/kitt-universal
@@ -7,9 +7,10 @@ interface ChildElementProps extends ComponentProps<any> {
7
7
  export interface DocumentPickerProps {
8
8
  children: ReactElement<ChildElementProps>;
9
9
  disabled?: boolean;
10
- onDocumentUpload: (document: File) => void;
11
10
  documentPickerOptions?: Except<DocumentPickerOptions, 'multiple'>;
11
+ onDocumentUpload: (document: File) => void;
12
+ onGetDocumentAsyncError?: () => void;
12
13
  }
13
- export declare function DocumentPicker({ onDocumentUpload, children, disabled, documentPickerOptions, }: DocumentPickerProps): ReactNode;
14
+ export declare function DocumentPicker({ children, disabled, documentPickerOptions, onDocumentUpload, onGetDocumentAsyncError, }: DocumentPickerProps): ReactNode;
14
15
  export {};
15
16
  //# sourceMappingURL=DocumentPicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentPicker.d.ts","sourceRoot":"","sources":["../../../../src/forms/DocumentPicker/DocumentPicker.tsx"],"names":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,EAAE,UAAU,CAAC,CAAC;IAClE,gBAAgB,EAAE,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3C,uBAAuB,CAAC,EAAE,MAAM,IAAI,CAAC;CACtC;AAED,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,GACxB,EAAE,mBAAmB,GAAG,SAAS,CA4BjC"}
@@ -6796,24 +6796,35 @@ const DatePicker = /*#__PURE__*/forwardRef((_ref, ref) => {
6796
6796
  });
6797
6797
 
6798
6798
  function DocumentPicker({
6799
- onDocumentUpload,
6800
6799
  children,
6801
6800
  disabled,
6802
- documentPickerOptions
6801
+ documentPickerOptions,
6802
+ onDocumentUpload,
6803
+ onGetDocumentAsyncError
6803
6804
  }) {
6804
6805
  const childElement = Children.only(children);
6805
6806
  return /*#__PURE__*/cloneElement(childElement, {
6806
6807
  // ensure that the press event is not prevented by Button component
6807
6808
  // eslint-disable-next-line @typescript-eslint/no-misused-promises
6808
6809
  onPress: async () => {
6809
- var _childElement$props$o, _childElement$props, _result$assets$;
6810
+ var _childElement$props$o, _childElement$props, _result$assets;
6810
6811
  if (disabled) return;
6811
6812
  (_childElement$props$o = (_childElement$props = childElement.props).onPress) === null || _childElement$props$o === void 0 || _childElement$props$o.call(_childElement$props);
6812
- const result = await getDocumentAsync(_objectSpread(_objectSpread({}, documentPickerOptions), {}, {
6813
- multiple: false
6814
- }));
6815
- if (!result.canceled && (_result$assets$ = result.assets[0]) !== null && _result$assets$ !== void 0 && _result$assets$.file) {
6816
- onDocumentUpload(result.assets[0].file);
6813
+ let result;
6814
+ try {
6815
+ result = await getDocumentAsync(_objectSpread(_objectSpread({}, documentPickerOptions), {}, {
6816
+ multiple: false
6817
+ }));
6818
+ } catch (error) {
6819
+ onGetDocumentAsyncError === null || onGetDocumentAsyncError === void 0 || onGetDocumentAsyncError();
6820
+ result = {
6821
+ canceled: true,
6822
+ assets: null
6823
+ };
6824
+ }
6825
+ const file = (_result$assets = result.assets) === null || _result$assets === void 0 || (_result$assets = _result$assets.at(0)) === null || _result$assets === void 0 ? void 0 : _result$assets.file;
6826
+ if (!result.canceled && file) {
6827
+ onDocumentUpload(file);
6817
6828
  }
6818
6829
  },
6819
6830
  disabled