@flipdish/portal-library 1.0.3 → 1.0.5
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/components/index.d.ts +0 -1
- package/dist/components/index.js +1 -1
- package/dist/components/themes/flipdishPublicTheme.js.map +1 -1
- package/dist/components/ui/LazyComponent/LazyComponent.js.map +1 -1
- package/dist/components/ui/NotFoundPage/NotFoundPage.js.map +1 -1
- package/dist/components/ui/PortalMock/PortalMock.js.map +1 -1
- package/dist/components/ui/Spacer/Spacer.js.map +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.24.5/node_modules/@babel/runtime/helpers/esm/extends.js.map +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.24.5/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js.map +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.24.5/node_modules/@babel/runtime/helpers/extends.js.map +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.24.5/node_modules/@babel/runtime/helpers/interopRequireDefault.js.map +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.24.5/node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js.map +1 -1
- package/dist/node_modules/.pnpm/@emotion_cache@11.13.1/node_modules/@emotion/cache/dist/emotion-cache.esm.js.map +1 -1
- package/dist/node_modules/.pnpm/@emotion_memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -1
- package/dist/node_modules/.pnpm/@emotion_sheet@1.4.0/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js.map +1 -1
- package/dist/node_modules/.pnpm/@emotion_weak-memoize@0.4.0/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/CircularProgress/CircularProgress.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/Typography/Typography.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/blue.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/common.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/green.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/grey.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/lightBlue.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/orange.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/purple.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/colors/red.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/createPalette.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/createTheme.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/createTransitions.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/createTypography.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/defaultTheme.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/rootShouldForwardProp.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/shadows.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/styled.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_material@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_style_oc5snlirzewyt2bjqzs6ppevzu/node_modules/@mui/material/styles/zIndex.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_styled-engine@5.16.6_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion__hzldfpemk3n3pozg66h7iqzmce/node_modules/@mui/styled-engine/GlobalStyles/GlobalStyles.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_styled-engine@5.16.6_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion__hzldfpemk3n3pozg66h7iqzmce/node_modules/@mui/styled-engine/index.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/colorManipulator.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/createStyled.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/borders.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/breakpoints.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/createTheme/applyStyles.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/createTheme/createBreakpoints.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/createTheme/createSpacing.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/createTheme/createTheme.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/createTheme/shape.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/cssGrid.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/palette.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/responsivePropType.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/sizing.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/spacing.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/style.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/styleFunctionSx/defaultSxConfig.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/styleFunctionSx/extendSxProp.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/styleFunctionSx/styleFunctionSx.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_system@5.16.7_@emotion_react@11.13.3_@types_react@18.3.11_react@18.3.1__@emotion_styled@_o44stj6xodossuagg3jw6vmktq/node_modules/@mui/system/esm/useTheme.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/capitalize/capitalize.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/chainPropTypes/chainPropTypes.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/composeClasses/composeClasses.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/deepmerge/deepmerge.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/getDisplayName/getDisplayName.js.map +1 -1
- package/dist/node_modules/.pnpm/@mui_utils@5.16.6_@types_react@18.3.11_react@18.3.1/node_modules/@mui/utils/esm/resolveProps/resolveProps.js.map +1 -1
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js.map +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js.map +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.js.map +1 -1
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js.map +1 -1
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
- package/dist/node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js.map +1 -1
- package/dist/node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
- package/dist/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Enum.js.map +1 -1
- package/dist/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Middleware.js.map +1 -1
- package/dist/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Parser.js.map +1 -1
- package/dist/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Tokenizer.js.map +1 -1
- package/dist/node_modules/.pnpm/stylis@4.2.0/node_modules/stylis/src/Utility.js.map +1 -1
- package/dist/providers/TranslationProvider.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.d.ts +0 -9
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js +0 -2
- package/dist/components/ui/FDErrorBoundary/FDErrorBoundary.js.map +0 -1
- package/dist/node_modules/.pnpm/react-error-boundary@4.1.1_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js +0 -2
- package/dist/node_modules/.pnpm/react-error-boundary@4.1.1_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FDErrorBoundary.js","sources":["../../../../src/components/ui/FDErrorBoundary/FDErrorBoundary.tsx"],"sourcesContent":["import { ErrorBoundary } from 'react-error-boundary';\nimport { useTranslation } from '../../../providers/TranslationProvider';\nimport { ReactNode } from 'react';\nimport { styled } from '@mui/material/styles';\n\nconst StyledTextContainer = styled('div')(({ theme }) => ({\n marginTop: theme.spacing(2),\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n}));\n\nconst FDErrorBoundary = ({ identifier, children }: { identifier: string; children: ReactNode }) => {\n const { translate } = useTranslation();\n return (\n <ErrorBoundary\n FallbackComponent={() => <StyledTextContainer>{translate('Something_went_wrong_please_refresh_the_page')}</StyledTextContainer>}\n onError={(error, info) => {\n window.fdlogger?.error(`${identifier?.toString()} Error Boundary`, {\n message: error?.message,\n stack: info,\n });\n }}\n >\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default FDErrorBoundary;\n"],"names":["StyledTextContainer","styled","theme","marginTop","spacing","display","justifyContent","alignItems","FDErrorBoundary","identifier","children","translate","useTranslation","_jsx","ErrorBoundary","FallbackComponent","onError","error","info","window","fdlogger","toString","message","stack"],"mappings":"0eAKA,MAAMA,EAAsBC,EAAO,MAAPA,EAAc,EAAGC,YAAa,CACtDC,UAAWD,EAAME,QAAQ,GACzBC,QAAS,OACTC,eAAgB,SAChBC,WAAY,aAGVC,EAAkB,EAAGC,aAAYC,eACnC,MAAMC,UAAEA,GAAcC,IACtB,OACIC,EAACC,EACG,CAAAC,kBAAmB,IAAMF,EAACb,EAAmB,CAAAU,SAAEC,EAAU,kDACzDK,QAAS,CAACC,EAAOC,KACbC,OAAOC,UAAUH,MAAM,GAAGR,GAAYY,4BAA6B,CAC/DC,QAASL,GAAOK,QAChBC,MAAOL,GACT,EAGLR,SAAAA,GAEP"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createContext as r,Component as e,createElement as t}from"react";const o=r(null),s={didCatch:!1,error:null};class n extends e{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=s}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(null!==r){for(var e,t,o=arguments.length,n=new Array(o),i=0;i<o;i++)n[i]=arguments[i];null===(e=(t=this.props).onReset)||void 0===e||e.call(t,{args:n,reason:"imperative-api"}),this.setState(s)}}componentDidCatch(r,e){var t,o;null===(t=(o=this.props).onError)||void 0===t||t.call(o,r,e)}componentDidUpdate(r,e){const{didCatch:t}=this.state,{resetKeys:o}=this.props;var n,i;t&&null!==e.error&&function(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r.length!==e.length||r.some(((r,t)=>!Object.is(r,e[t])))}(r.resetKeys,o)&&(null===(n=(i=this.props).onReset)||void 0===n||n.call(i,{next:o,prev:r.resetKeys,reason:"keys"}),this.setState(s))}render(){const{children:r,fallbackRender:e,FallbackComponent:s,fallback:n}=this.props,{didCatch:i,error:a}=this.state;let l=r;if(i){const r={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)l=e(r);else if(s)l=t(s,r);else{if(void 0===n)throw a;l=n}}return t(o.Provider,{value:{didCatch:i,error:a,resetErrorBoundary:this.resetErrorBoundary}},l)}}export{n as ErrorBoundary,o as ErrorBoundaryContext};
|
|
2
|
-
//# sourceMappingURL=react-error-boundary.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-error-boundary.esm.js","sources":["../../../../../../../../../node_modules/.pnpm/react-error-boundary@4.1.1_react@18.3.1/node_modules/react-error-boundary/dist/react-error-boundary.esm.js"],"sourcesContent":["'use client';\nimport { createContext, Component, createElement, useContext, useState, useMemo, forwardRef } from 'react';\n\nconst ErrorBoundaryContext = createContext(null);\n\nconst initialState = {\n didCatch: false,\n error: null\n};\nclass ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.resetErrorBoundary = this.resetErrorBoundary.bind(this);\n this.state = initialState;\n }\n static getDerivedStateFromError(error) {\n return {\n didCatch: true,\n error\n };\n }\n resetErrorBoundary() {\n const {\n error\n } = this.state;\n if (error !== null) {\n var _this$props$onReset, _this$props;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_this$props$onReset = (_this$props = this.props).onReset) === null || _this$props$onReset === void 0 ? void 0 : _this$props$onReset.call(_this$props, {\n args,\n reason: \"imperative-api\"\n });\n this.setState(initialState);\n }\n }\n componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n (_this$props$onError = (_this$props2 = this.props).onError) === null || _this$props$onError === void 0 ? void 0 : _this$props$onError.call(_this$props2, error, info);\n }\n componentDidUpdate(prevProps, prevState) {\n const {\n didCatch\n } = this.state;\n const {\n resetKeys\n } = this.props;\n\n // There's an edge case where if the thing that triggered the error happens to *also* be in the resetKeys array,\n // we'd end up resetting the error boundary immediately.\n // This would likely trigger a second error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call of cDU after the error is set.\n\n if (didCatch && prevState.error !== null && hasArrayChanged(prevProps.resetKeys, resetKeys)) {\n var _this$props$onReset2, _this$props3;\n (_this$props$onReset2 = (_this$props3 = this.props).onReset) === null || _this$props$onReset2 === void 0 ? void 0 : _this$props$onReset2.call(_this$props3, {\n next: resetKeys,\n prev: prevProps.resetKeys,\n reason: \"keys\"\n });\n this.setState(initialState);\n }\n }\n render() {\n const {\n children,\n fallbackRender,\n FallbackComponent,\n fallback\n } = this.props;\n const {\n didCatch,\n error\n } = this.state;\n let childToRender = children;\n if (didCatch) {\n const props = {\n error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof fallbackRender === \"function\") {\n childToRender = fallbackRender(props);\n } else if (FallbackComponent) {\n childToRender = createElement(FallbackComponent, props);\n } else if (fallback !== undefined) {\n childToRender = fallback;\n } else {\n throw error;\n }\n }\n return createElement(ErrorBoundaryContext.Provider, {\n value: {\n didCatch,\n error,\n resetErrorBoundary: this.resetErrorBoundary\n }\n }, childToRender);\n }\n}\nfunction hasArrayChanged() {\n let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n return a.length !== b.length || a.some((item, index) => !Object.is(item, b[index]));\n}\n\nfunction assertErrorBoundaryContext(value) {\n if (value == null || typeof value.didCatch !== \"boolean\" || typeof value.resetErrorBoundary !== \"function\") {\n throw new Error(\"ErrorBoundaryContext not found\");\n }\n}\n\nfunction useErrorBoundary() {\n const context = useContext(ErrorBoundaryContext);\n assertErrorBoundaryContext(context);\n const [state, setState] = useState({\n error: null,\n hasError: false\n });\n const memoized = useMemo(() => ({\n resetBoundary: () => {\n context.resetErrorBoundary();\n setState({\n error: null,\n hasError: false\n });\n },\n showBoundary: error => setState({\n error,\n hasError: true\n })\n }), [context.resetErrorBoundary]);\n if (state.hasError) {\n throw state.error;\n }\n return memoized;\n}\n\nfunction withErrorBoundary(component, errorBoundaryProps) {\n const Wrapped = forwardRef((props, ref) => createElement(ErrorBoundary, errorBoundaryProps, createElement(component, {\n ...props,\n ref\n })));\n\n // Format for display in DevTools\n const name = component.displayName || component.name || \"Unknown\";\n Wrapped.displayName = \"withErrorBoundary(\".concat(name, \")\");\n return Wrapped;\n}\n\nexport { ErrorBoundary, ErrorBoundaryContext, useErrorBoundary, withErrorBoundary };\n"],"names":["ErrorBoundaryContext","createContext","initialState","didCatch","error","ErrorBoundary","Component","constructor","props","super","this","resetErrorBoundary","bind","state","getDerivedStateFromError","_this$props$onReset","_this$props","_len","arguments","length","args","Array","_key","onReset","call","reason","setState","componentDidCatch","info","_this$props$onError","_this$props2","onError","componentDidUpdate","prevProps","prevState","resetKeys","_this$props$onReset2","_this$props3","a","undefined","b","some","item","index","Object","is","hasArrayChanged","next","prev","render","children","fallbackRender","FallbackComponent","fallback","childToRender","createElement","Provider","value"],"mappings":"wEAGK,MAACA,EAAuBC,EAAc,MAErCC,EAAe,CACnBC,UAAU,EACVC,MAAO,MAET,MAAMC,UAAsBC,EAC1B,WAAAC,CAAYC,GACVC,MAAMD,GACNE,KAAKC,mBAAqBD,KAAKC,mBAAmBC,KAAKF,MACvDA,KAAKG,MAAQX,CACd,CACD,+BAAOY,CAAyBV,GAC9B,MAAO,CACLD,UAAU,EACVC,QAEH,CACD,kBAAAO,GACE,MAAMP,MACJA,GACEM,KAAKG,MACT,GAAc,OAAVT,EAAgB,CAElB,IADA,IAAIW,EAAqBC,EAChBC,EAAOC,UAAUC,OAAQC,EAAO,IAAIC,MAAMJ,GAAOK,EAAO,EAAGA,EAAOL,EAAMK,IAC/EF,EAAKE,GAAQJ,UAAUI,GAEsC,QAA9DP,GAAuBC,EAAcN,KAAKF,OAAOe,eAA6C,IAAxBR,GAA0CA,EAAoBS,KAAKR,EAAa,CACrJI,OACAK,OAAQ,mBAEVf,KAAKgB,SAASxB,EACf,CACF,CACD,iBAAAyB,CAAkBvB,EAAOwB,GACvB,IAAIC,EAAqBC,EACuC,QAA/DD,GAAuBC,EAAepB,KAAKF,OAAOuB,eAA6C,IAAxBF,GAA0CA,EAAoBL,KAAKM,EAAc1B,EAAOwB,EACjK,CACD,kBAAAI,CAAmBC,EAAWC,GAC5B,MAAM/B,SACJA,GACEO,KAAKG,OACHsB,UACJA,GACEzB,KAAKF,MAQP,IAAI4B,EAAsBC,EADxBlC,GAAgC,OAApB+B,EAAU9B,OA8C9B,WACE,IAAIkC,EAAIpB,UAAUC,OAAS,QAAsBoB,IAAjBrB,UAAU,GAAmBA,UAAU,GAAK,GACxEsB,EAAItB,UAAUC,OAAS,QAAsBoB,IAAjBrB,UAAU,GAAmBA,UAAU,GAAK,GAC5E,OAAOoB,EAAEnB,SAAWqB,EAAErB,QAAUmB,EAAEG,MAAK,CAACC,EAAMC,KAAWC,OAAOC,GAAGH,EAAMF,EAAEG,KAC7E,CAlDgDG,CAAgBb,EAAUE,UAAWA,KAEd,QAAhEC,GAAwBC,EAAe3B,KAAKF,OAAOe,eAA8C,IAAzBa,GAA2CA,EAAqBZ,KAAKa,EAAc,CAC1JU,KAAMZ,EACNa,KAAMf,EAAUE,UAChBV,OAAQ,SAEVf,KAAKgB,SAASxB,GAEjB,CACD,MAAA+C,GACE,MAAMC,SACJA,EAAQC,eACRA,EAAcC,kBACdA,EAAiBC,SACjBA,GACE3C,KAAKF,OACHL,SACJA,EAAQC,MACRA,GACEM,KAAKG,MACT,IAAIyC,EAAgBJ,EACpB,GAAI/C,EAAU,CACZ,MAAMK,EAAQ,CACZJ,QACAO,mBAAoBD,KAAKC,oBAE3B,GAA8B,mBAAnBwC,EACTG,EAAgBH,EAAe3C,QAC1B,GAAI4C,EACTE,EAAgBC,EAAcH,EAAmB5C,OAC5C,SAAiB+B,IAAbc,EAGT,MAAMjD,EAFNkD,EAAgBD,CAGjB,CACF,CACD,OAAOE,EAAcvD,EAAqBwD,SAAU,CAClDC,MAAO,CACLtD,WACAC,QACAO,mBAAoBD,KAAKC,qBAE1B2C,EACJ","x_google_ignoreList":[0]}
|