@leav/ui 0.4.0-9b47d86 → 0.4.0-bc44cb0

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.
@@ -1,9 +1,9 @@
1
- import { ErrorInfo, ReactNode } from 'react';
1
+ import { ErrorInfo, FunctionComponent, ReactNode } from 'react';
2
2
  interface IErrorBoundaryContentProps {
3
3
  error?: Error;
4
4
  errorInfo?: ErrorInfo;
5
5
  recoveryButtons?: ReactNode[];
6
6
  showRecoveryButtons?: boolean;
7
7
  }
8
- declare function ErrorBoundaryContent({ error, errorInfo, recoveryButtons }: IErrorBoundaryContentProps): JSX.Element;
8
+ declare const ErrorBoundaryContent: FunctionComponent<IErrorBoundaryContentProps>;
9
9
  export default ErrorBoundaryContent;
@@ -7,6 +7,7 @@ import { ConfigProvider, Result, Space, theme } from 'antd';
7
7
  import styled from 'styled-components';
8
8
  import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
9
9
  import { customTheme, themeVars } from '../../../antdTheme';
10
+ import { isDevEnv } from '../../../_utils/isDevEnv';
10
11
  const ErrorResult = styled(Result) `
11
12
  font-size: 1rem;
12
13
 
@@ -28,10 +29,10 @@ const ButtonsWrapper = styled(Space) `
28
29
  margin-bottom: 1rem;
29
30
  }
30
31
  `;
31
- function ErrorBoundaryContent({ error, errorInfo, recoveryButtons }) {
32
+ const ErrorBoundaryContent = ({ error, errorInfo, recoveryButtons }) => {
32
33
  const { token } = theme.useToken();
33
34
  const { t } = useSharedTranslation();
34
- return (_jsx(ConfigProvider, { theme: customTheme, children: _jsxs(ErrorResult, { status: "error", title: t('error.error_occurred'), icon: _jsx(FrownOutlined, {}), "$themeToken": token, children: [!!recoveryButtons?.length && _jsx(ButtonsWrapper, { children: recoveryButtons }), _jsxs("details", { style: { whiteSpace: 'pre-wrap' }, children: [error && error.toString(), _jsx("br", {}), errorInfo.componentStack] })] }) }));
35
- }
35
+ return (_jsx(ConfigProvider, { theme: customTheme, children: _jsxs(ErrorResult, { status: "error", title: t('error.error_occurred'), icon: _jsx(FrownOutlined, {}), "$themeToken": token, children: [!!recoveryButtons?.length && _jsx(ButtonsWrapper, { children: recoveryButtons }), isDevEnv() && (_jsxs("details", { style: { whiteSpace: 'pre-wrap' }, children: [error?.toString(), _jsx("br", {}), errorInfo.componentStack] }))] }) }));
36
+ };
36
37
  export default ErrorBoundaryContent;
37
38
  //# sourceMappingURL=ErrorBoundaryContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBoundaryContent.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/ErrorBoundaryContent/ErrorBoundaryContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAE1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAS1E,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAA+B;;;;;;;;gCAQjC,SAAS,CAAC,WAAW;6BACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY;;;;CAI3D,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;;;;;;CAMnC,CAAC;AAEF,SAAS,oBAAoB,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAA6B;IACzF,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO,CACH,KAAC,cAAc,IAAC,KAAK,EAAE,WAAW,YAC9B,MAAC,WAAW,IAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAE,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,KAAC,aAAa,KAAG,iBAAe,KAAK,aACpG,CAAC,CAAC,eAAe,EAAE,MAAM,IAAI,KAAC,cAAc,cAAE,eAAe,GAAkB,EAChF,mBAAS,KAAK,EAAE,EAAC,UAAU,EAAE,UAAU,EAAC,aACnC,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,EAC1B,cAAM,EACL,SAAS,CAAC,cAAc,IACnB,IACA,GACD,CACpB,CAAC;AACN,CAAC;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"ErrorBoundaryContent.js","sourceRoot":"","sources":["../../../../src/components/ErrorBoundary/ErrorBoundaryContent/ErrorBoundaryContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,MAAM,CAAC;AAE1D,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAiB,WAAW,EAAE,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAE7C,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAA+B;;;;;;;;gCAQjC,SAAS,CAAC,WAAW;6BACxB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,YAAY;;;;CAI3D,CAAC;AAEF,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;;;;;;CAMnC,CAAC;AASF,MAAM,oBAAoB,GAAkD,CAAC,EAAC,KAAK,EAAE,SAAS,EAAE,eAAe,EAAC,EAAE,EAAE;IAChH,MAAM,EAAC,KAAK,EAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;IACjC,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO,CACH,KAAC,cAAc,IAAC,KAAK,EAAE,WAAW,YAC9B,MAAC,WAAW,IAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAE,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,KAAC,aAAa,KAAG,iBAAe,KAAK,aACpG,CAAC,CAAC,eAAe,EAAE,MAAM,IAAI,KAAC,cAAc,cAAE,eAAe,GAAkB,EAC/E,QAAQ,EAAE,IAAI,CACX,mBAAS,KAAK,EAAE,EAAC,UAAU,EAAE,UAAU,EAAC,aACnC,KAAK,EAAE,QAAQ,EAAE,EAClB,cAAM,EACL,SAAS,CAAC,cAAc,IACnB,CACb,IACS,GACD,CACpB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -1,7 +1,7 @@
1
- import { ErrorInfo } from 'react';
1
+ import { ErrorInfo, FunctionComponent } from 'react';
2
2
  interface IErrorBoundaryContentProps {
3
3
  error?: Error;
4
4
  errorInfo?: ErrorInfo;
5
5
  }
6
- declare function SimpleErrorBoundaryContent({ error, errorInfo }: IErrorBoundaryContentProps): JSX.Element;
6
+ declare const SimpleErrorBoundaryContent: FunctionComponent<IErrorBoundaryContentProps>;
7
7
  export default SimpleErrorBoundaryContent;
@@ -5,6 +5,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { FrownOutlined } from '@ant-design/icons';
6
6
  import { Result } from 'antd';
7
7
  import styled from 'styled-components';
8
+ import { isDevEnv } from '../../../_utils/isDevEnv';
9
+ import { useSharedTranslation } from '../../../hooks/useSharedTranslation';
8
10
  const ErrorResult = styled(Result) `
9
11
  font-size: 1rem;
10
12
 
@@ -19,8 +21,9 @@ const ErrorResult = styled(Result) `
19
21
  }
20
22
  }
21
23
  `;
22
- function SimpleErrorBoundaryContent({ error, errorInfo }) {
23
- return (_jsx(ErrorResult, { status: "error", title: "An error occurred", icon: _jsx(FrownOutlined, {}), children: _jsxs("details", { style: { whiteSpace: 'pre-wrap' }, children: [error && error.toString(), _jsx("br", {}), errorInfo.componentStack] }) }));
24
- }
24
+ const SimpleErrorBoundaryContent = ({ error, errorInfo }) => {
25
+ const { t } = useSharedTranslation();
26
+ return (_jsx(ErrorResult, { status: "error", title: t('error.error_occurred'), icon: _jsx(FrownOutlined, {}), children: isDevEnv() && (_jsxs("details", { style: { whiteSpace: 'pre-wrap' }, children: [error?.toString(), _jsx("br", {}), errorInfo.componentStack] })) }));
27
+ };
25
28
  export default SimpleErrorBoundaryContent;
26
29
  //# sourceMappingURL=SimpleErrorBoundaryContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleErrorBoundaryContent.js","sourceRoot":"","sources":["../../../../src/components/SimpleErrorBoundary/SimpleErrorBoundaryContent/SimpleErrorBoundaryContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAOvC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;;;;;;;;CAajC,CAAC;AAEF,SAAS,0BAA0B,CAAC,EAAC,KAAK,EAAE,SAAS,EAA6B;IAC9E,OAAO,CACH,KAAC,WAAW,IAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAC,mBAAmB,EAAC,IAAI,EAAE,KAAC,aAAa,KAAG,YACzE,mBAAS,KAAK,EAAE,EAAC,UAAU,EAAE,UAAU,EAAC,aACnC,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,EAC1B,cAAM,EACL,SAAS,CAAC,cAAc,IACnB,GACA,CACjB,CAAC;AACN,CAAC;AAED,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"SimpleErrorBoundaryContent.js","sourceRoot":"","sources":["../../../../src/components/SimpleErrorBoundary/SimpleErrorBoundaryContent/SimpleErrorBoundaryContent.tsx"],"names":[],"mappings":";AAAA,oFAAoF;AACpF,sCAAsC;AACtC,sEAAsE;AACtE,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,MAAM,CAAC;AAE5B,OAAO,MAAM,MAAM,mBAAmB,CAAC;AACvC,OAAO,EAAC,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAC,oBAAoB,EAAC,MAAM,gCAAgC,CAAC;AAEpE,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA;;;;;;;;;;;;;CAajC,CAAC;AAOF,MAAM,0BAA0B,GAAkD,CAAC,EAAC,KAAK,EAAE,SAAS,EAAC,EAAE,EAAE;IACrG,MAAM,EAAC,CAAC,EAAC,GAAG,oBAAoB,EAAE,CAAC;IAEnC,OAAO,CACH,KAAC,WAAW,IAAC,MAAM,EAAC,OAAO,EAAC,KAAK,EAAE,CAAC,CAAC,sBAAsB,CAAC,EAAE,IAAI,EAAE,KAAC,aAAa,KAAG,YAChF,QAAQ,EAAE,IAAI,CACX,mBAAS,KAAK,EAAE,EAAC,UAAU,EAAE,UAAU,EAAC,aACnC,KAAK,EAAE,QAAQ,EAAE,EAClB,cAAM,EACL,SAAS,CAAC,cAAc,IACnB,CACb,GACS,CACjB,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leav/ui",
3
- "version": "0.4.0-9b47d86",
3
+ "version": "0.4.0-bc44cb0",
4
4
  "description": "Shared React components and hooks",
5
5
  "scripts": {
6
6
  "prepublishOnly": "yarn build",
@@ -59,7 +59,8 @@
59
59
  "react-dom": "18.2.0",
60
60
  "react-i18next": "12",
61
61
  "react-icons": ">=4",
62
- "styled-components": ">=5.3"
62
+ "styled-components": ">=5.3",
63
+ "react-router-dom": "^6.22.0"
63
64
  },
64
65
  "dependencies": {
65
66
  "@ckeditor/ckeditor5-build-inline": "39.0.1",
@@ -77,7 +78,6 @@
77
78
  "react-beautiful-dnd": "13.1.1",
78
79
  "react-icons": "4.7.1",
79
80
  "react-markdown": "5.0.3",
80
- "react-router-dom": "6.22.0",
81
81
  "react-table": "7.8.0",
82
82
  "react-table-sticky": "1.1.3",
83
83
  "uuid": "9.0.1",