@aws-amplify/ui-react-storage 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/browser.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-D6jJJVE_.js');
5
+ var createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-BcuxpEzi.js');
6
6
  var internals = require('@aws-amplify/storage/internals');
7
7
  require('@aws-amplify/ui');
8
8
  require('aws-amplify/storage');
@@ -32,7 +32,7 @@ function _interopNamespace(e) {
32
32
 
33
33
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
34
34
 
35
- const VERSION = '3.8.1';
35
+ const VERSION = '3.9.0';
36
36
 
37
37
  const constructBucket = ({ bucket: bucketName, region, }) => ({ bucketName, region });
38
38
  const parseAccessGrantLocation = (location) => {
@@ -3067,10 +3067,10 @@ const ERROR_MESSAGE = '`useAction` must be called from within `StorageBrowser.Pr
3067
3067
  const useAction = (key, options) => {
3068
3068
  if (key === 'listLocations' ||
3069
3069
  key === 'listLocationItems') {
3070
- throw new Error(`Value of \`${key}\` cannot be used to index \`useAction\``);
3070
+ throw new Error(`Value of \`${key}\` cannot be provided to \`useAction\``);
3071
3071
  }
3072
3072
  const { handlers } = useActionHandlers({ errorMessage: ERROR_MESSAGE });
3073
- const handler = handlers[key];
3073
+ const handler = handlers?.[key];
3074
3074
  if (!handler) {
3075
3075
  throw new Error(`No handler found for value of \`${key}\` provided to \`useAction\``);
3076
3076
  }
@@ -4918,7 +4918,10 @@ function createStorageBrowser(input) {
4918
4918
  React__namespace["default"].createElement(ViewsProvider, { actions: actions, views: views },
4919
4919
  React__namespace["default"].createElement(ComponentsProvider, { composables: composables, elements: elementsDefault }, children))))))));
4920
4920
  }
4921
- const StorageBrowser = ({ views, displayText }) => (React__namespace["default"].createElement(ErrorBoundary, null,
4921
+ const ErrorBoundary$1 = input.ErrorBoundary === null
4922
+ ? React__namespace["default"].Fragment
4923
+ : input.ErrorBoundary ?? ErrorBoundary;
4924
+ const StorageBrowser = ({ views, displayText }) => (React__namespace["default"].createElement(ErrorBoundary$1, null,
4922
4925
  React__namespace["default"].createElement(Provider, { displayText: displayText, views: views },
4923
4926
  React__namespace["default"].createElement(StorageBrowserDefault, null))));
4924
4927
  StorageBrowser.LocationActionView =
@@ -6,9 +6,9 @@ import '@aws-amplify/ui';
6
6
  import 'aws-amplify/storage';
7
7
  import './actions/configs/context.mjs';
8
8
 
9
- const StorageBrowser = ({ views, displayText, }) => {
10
- const { StorageBrowser } = React__default.useRef(createStorageBrowser({ config: createAmplifyAuthAdapter() })).current;
11
- return React__default.createElement(StorageBrowser, { views: views, displayText: displayText });
12
- };
9
+ function StorageBrowser(props) {
10
+ const { StorageBrowser: StorageBrowserComponent } = React__default.useRef(createStorageBrowser({ config: createAmplifyAuthAdapter() })).current;
11
+ return React__default.createElement(StorageBrowserComponent, { ...props });
12
+ }
13
13
 
14
14
  export { StorageBrowser };
@@ -86,7 +86,10 @@ function createStorageBrowser(input) {
86
86
  React__default.createElement(ViewsProvider, { actions: actions, views: views },
87
87
  React__default.createElement(ComponentsProvider, { composables: composables, elements: elementsDefault }, children))))))));
88
88
  }
89
- const StorageBrowser = ({ views, displayText }) => (React__default.createElement(ErrorBoundary, null,
89
+ const ErrorBoundary$1 = input.ErrorBoundary === null
90
+ ? React__default.Fragment
91
+ : input.ErrorBoundary ?? ErrorBoundary;
92
+ const StorageBrowser = ({ views, displayText }) => (React__default.createElement(ErrorBoundary$1, null,
90
93
  React__default.createElement(Provider, { displayText: displayText, views: views },
91
94
  React__default.createElement(StorageBrowserDefault, null))));
92
95
  StorageBrowser.LocationActionView =
@@ -5,10 +5,10 @@ const ERROR_MESSAGE = '`useAction` must be called from within `StorageBrowser.Pr
5
5
  const useAction = (key, options) => {
6
6
  if (key === 'listLocations' ||
7
7
  key === 'listLocationItems') {
8
- throw new Error(`Value of \`${key}\` cannot be used to index \`useAction\``);
8
+ throw new Error(`Value of \`${key}\` cannot be provided to \`useAction\``);
9
9
  }
10
10
  const { handlers } = useActionHandlers({ errorMessage: ERROR_MESSAGE });
11
- const handler = handlers[key];
11
+ const handler = handlers?.[key];
12
12
  if (!handler) {
13
13
  throw new Error(`No handler found for value of \`${key}\` provided to \`useAction\``);
14
14
  }
@@ -1,3 +1,3 @@
1
- const VERSION = '3.8.1';
1
+ const VERSION = '3.9.0';
2
2
 
3
3
  export { VERSION };
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var uiReactCore = require('@aws-amplify/ui-react-core');
9
9
  var auth = require('aws-amplify/auth');
10
10
  var storage = require('aws-amplify/storage');
11
11
  var internal = require('@aws-amplify/ui-react/internal');
12
- var createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-D6jJJVE_.js');
12
+ var createAmplifyAuthAdapter = require('./createAmplifyAuthAdapter-BcuxpEzi.js');
13
13
  require('@aws-amplify/storage/internals');
14
14
  require('@aws-amplify/ui-react-core/elements');
15
15
  require('aws-amplify');
@@ -1071,10 +1071,10 @@ const StorageManager = Object.assign({}, StorageManagerBase, {
1071
1071
  FilePicker,
1072
1072
  });
1073
1073
 
1074
- const StorageBrowser = ({ views, displayText, }) => {
1075
- const { StorageBrowser } = React__namespace["default"].useRef(createAmplifyAuthAdapter.createStorageBrowser({ config: createAmplifyAuthAdapter.createAmplifyAuthAdapter() })).current;
1076
- return React__namespace["default"].createElement(StorageBrowser, { views: views, displayText: displayText });
1077
- };
1074
+ function StorageBrowser(props) {
1075
+ const { StorageBrowser: StorageBrowserComponent } = React__namespace["default"].useRef(createAmplifyAuthAdapter.createStorageBrowser({ config: createAmplifyAuthAdapter.createAmplifyAuthAdapter() })).current;
1076
+ return React__namespace["default"].createElement(StorageBrowserComponent, { ...props });
1077
+ }
1078
1078
 
1079
1079
  exports.FileUploader = FileUploader;
1080
1080
  exports.StorageBrowser = StorageBrowser;
package/dist/styles.css CHANGED
@@ -50,7 +50,8 @@
50
50
  --amplify-components-ai-conversation-attachment-padding-block: var(--amplify-space-xxxs);
51
51
  --amplify-components-ai-conversation-attachment-padding-inline: var(--amplify-space-xs);
52
52
  --amplify-components-ai-conversation-attachment-gap: var(--amplify-space-xs);
53
- --amplify-components-ai-conversation-attachment-list-padding-block-start: var(--amplify-space-xs);
53
+ --amplify-components-ai-conversation-attachment-list-padding: var(--amplify-space-xs);
54
+ --amplify-components-ai-conversation-attachment-list-padding-block-start: 0;
54
55
  --amplify-components-ai-conversation-attachment-list-gap: var(--amplify-space-xxs);
55
56
  --amplify-components-ai-conversation-attachment-name-color: var(--amplify-colors-font-primary);
56
57
  --amplify-components-ai-conversation-attachment-name-font-size: var(--amplify-font-sizes-small);
@@ -3077,6 +3078,7 @@ strong.amplify-text {
3077
3078
  -moz-user-select: text;
3078
3079
  user-select: text;
3079
3080
  white-space: pre-wrap;
3081
+ max-height: 100%;
3080
3082
  }
3081
3083
  .amplify-textarea:focus {
3082
3084
  border-color: var(--amplify-components-fieldcontrol-focus-border-color);
@@ -5802,6 +5804,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
5802
5804
  }
5803
5805
 
5804
5806
  .amplify-textareafield {
5807
+ max-height: 100%;
5805
5808
  flex-direction: column;
5806
5809
  --amplify-components-fieldcontrol-color: var(
5807
5810
  --amplify-components-textareafield-color
@@ -6837,16 +6840,24 @@ html[dir=rtl] .amplify-field-group__inner-start {
6837
6840
  --internal-flex-direction: row;
6838
6841
  --internal-body-align-items: flex-start;
6839
6842
  }
6843
+ .amplify-ai-conversation__scrollview {
6844
+ flex: 1 0 50%;
6845
+ }
6840
6846
  .amplify-ai-conversation__form {
6841
6847
  display: flex;
6842
6848
  flex-direction: row;
6843
6849
  align-items: flex-start;
6850
+ padding: var(--amplify-components-ai-conversation-form-padding);
6844
6851
  gap: var(--amplify-components-ai-conversation-form-gap);
6852
+ max-height: 100%;
6853
+ overflow: hidden;
6845
6854
  }
6846
6855
  .amplify-ai-conversation__form__dropzone {
6847
6856
  text-align: initial;
6848
6857
  border: none;
6849
- padding: var(--amplify-components-ai-conversation-form-padding);
6858
+ padding: 0;
6859
+ display: grid;
6860
+ overflow: hidden;
6850
6861
  }
6851
6862
  .amplify-ai-conversation__form__error {
6852
6863
  padding: 0;
@@ -6871,6 +6882,7 @@ html[dir=rtl] .amplify-field-group__inner-start {
6871
6882
  flex-direction: row;
6872
6883
  flex-wrap: wrap;
6873
6884
  gap: var(--amplify-components-ai-conversation-attachment-list-gap);
6885
+ padding: var(--amplify-components-ai-conversation-attachment-list-padding);
6874
6886
  padding-block-start: var(--amplify-components-ai-conversation-attachment-list-padding-block-start);
6875
6887
  }
6876
6888
  .amplify-ai-conversation__attachment__image {
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- interface ErrorBoundaryProps {
3
- children: React.ReactNode;
4
- }
5
2
  interface ErrorBoundaryState {
6
3
  hasError: boolean;
7
4
  }
8
- export declare class ErrorBoundary extends React.Component<ErrorBoundaryProps, ErrorBoundaryState> {
9
- constructor(props: ErrorBoundaryProps);
5
+ export type ErrorBoundaryType = React.ComponentType<React.PropsWithChildren>;
6
+ export declare class ErrorBoundary extends React.Component<React.PropsWithChildren, ErrorBoundaryState> {
7
+ constructor(props: React.PropsWithChildren);
10
8
  static getDerivedStateFromError(_error: Error): ErrorBoundaryState;
11
9
  render(): React.ReactNode;
12
10
  }
@@ -1 +1 @@
1
- export { ErrorBoundary } from './ErrorBoundary';
1
+ export { ErrorBoundary, ErrorBoundaryType } from './ErrorBoundary';
@@ -2,4 +2,4 @@ import React from 'react';
2
2
  import { StorageBrowserProps as StorageBrowserPropsBase } from './types';
3
3
  export interface StorageBrowserProps extends StorageBrowserPropsBase {
4
4
  }
5
- export declare const StorageBrowser: ({ views, displayText, }: StorageBrowserProps) => React.JSX.Element;
5
+ export declare function StorageBrowser(props: StorageBrowserProps): React.JSX.Element;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { CustomActionConfigs, DefaultActionConfigs, ExtendedActionConfigs, ListLocations } from './actions';
3
3
  import { GetLocationCredentials } from './credentials/types';
4
4
  import { Components } from './ComponentsProvider';
5
+ import { ErrorBoundaryType } from './ErrorBoundary';
5
6
  import { RegisterAuthListener, StoreProviderProps } from './providers';
6
7
  import { CopyViewType, CreateFolderViewType, DeleteViewType, UploadViewType, LocationActionViewType, LocationDetailViewType, LocationsViewType, Views, UseView } from './views';
7
8
  import { StorageBrowserDisplayText } from './displayText';
@@ -22,6 +23,11 @@ export interface CreateStorageBrowserInput {
22
23
  actions?: StorageBrowserActions;
23
24
  config: Config;
24
25
  components?: Components;
26
+ /**
27
+ * Custom ErrorBoundary class. If omitted, a default ErrorBoundary is provided.
28
+ * To disable ErrorBoundary, set to `null`.
29
+ */
30
+ ErrorBoundary?: ErrorBoundaryType | null;
25
31
  }
26
32
  export interface StorageBrowserProps<K = string, V = {}> {
27
33
  displayText?: StorageBrowserDisplayText;
@@ -1 +1 @@
1
- export declare const VERSION = "3.8.1";
1
+ export declare const VERSION = "3.9.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-storage",
3
- "version": "3.8.1",
3
+ "version": "3.9.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.mjs",
6
6
  "exports": {
@@ -45,9 +45,9 @@
45
45
  "typecheck": "tsc --noEmit"
46
46
  },
47
47
  "dependencies": {
48
- "@aws-amplify/ui": "6.8.2",
49
- "@aws-amplify/ui-react": "6.9.2",
50
- "@aws-amplify/ui-react-core": "3.3.2",
48
+ "@aws-amplify/ui": "6.9.1",
49
+ "@aws-amplify/ui-react": "6.9.4",
50
+ "@aws-amplify/ui-react-core": "3.3.4",
51
51
  "tslib": "^2.5.2"
52
52
  },
53
53
  "peerDependencies": {