react-easy-wall 1.0.21 → 1.0.24
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/cjs/components/panel/Panel.js +0 -1
- package/dist/cjs/components/panel/Panel.js.map +1 -1
- package/dist/cjs/components/panel/PanelAvatar.js +2 -4
- package/dist/cjs/components/panel/PanelAvatar.js.map +1 -1
- package/dist/cjs/components/panel/PanelButton.js +0 -1
- package/dist/cjs/components/panel/PanelButton.js.map +1 -1
- package/dist/cjs/components/panel/PanelDivider.js +0 -1
- package/dist/cjs/components/panel/PanelDivider.js.map +1 -1
- package/dist/cjs/components/panel/PanelFooter.js +0 -1
- package/dist/cjs/components/panel/PanelFooter.js.map +1 -1
- package/dist/cjs/components/panel/PanelHeader.js +0 -1
- package/dist/cjs/components/panel/PanelHeader.js.map +1 -1
- package/dist/cjs/components/panel/PanelItem.js +0 -1
- package/dist/cjs/components/panel/PanelItem.js.map +1 -1
- package/dist/cjs/components/panel/PanelListItems.js +0 -1
- package/dist/cjs/components/panel/PanelListItems.js.map +1 -1
- package/dist/cjs/components/session/SessionProvider.js +0 -1
- package/dist/cjs/components/session/SessionProvider.js.map +1 -1
- package/dist/cjs/components/session/SessionUserContext.js +0 -1
- package/dist/cjs/components/session/SessionUserContext.js.map +1 -1
- package/dist/cjs/components/session/SessionUserProvider.js +0 -1
- package/dist/cjs/components/session/SessionUserProvider.js.map +1 -1
- package/dist/cjs/node_modules/@apollo/client/errors/CombinedProtocolErrors.js +85 -0
- package/dist/cjs/node_modules/@apollo/client/errors/CombinedProtocolErrors.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/errors/ServerError.js +80 -0
- package/dist/cjs/node_modules/@apollo/client/errors/ServerError.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/errors/ServerParseError.js +77 -0
- package/dist/cjs/node_modules/@apollo/client/errors/ServerParseError.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/errors/index.js +9 -0
- package/dist/cjs/node_modules/@apollo/client/errors/index.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/errors/utils.js +19 -0
- package/dist/cjs/node_modules/@apollo/client/errors/utils.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/client-awareness/ClientAwarenessLink.js +91 -0
- package/dist/cjs/node_modules/@apollo/client/link/client-awareness/ClientAwarenessLink.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/core/ApolloLink.js +262 -0
- package/dist/cjs/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/BaseHttpLink.js +155 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/BaseHttpLink.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/HttpLink.js +41 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/HttpLink.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js +168 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/rewriteURIForGET.js +56 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/rewriteURIForGET.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js +106 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/selectURI.js +18 -0
- package/dist/cjs/node_modules/@apollo/client/link/http/selectURI.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/utils/createOperation.js +40 -0
- package/dist/cjs/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/link/utils/filterOperationVariables.js +27 -0
- package/dist/cjs/node_modules/@apollo/client/link/utils/filterOperationVariables.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/caching/sizes.js +31 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/environment/index.production.js +6 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/environment/index.production.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/graphql/operations.js +65 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/graphql/operations.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/graphql/print.js +31 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.js +49 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.js +62 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/compact.js +27 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/compact.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +16 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationName.js +13 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/global.js +21 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/maybe.js +11 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +13 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +19 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/memoize.js +33 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +20 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/invariant/index.js +94 -0
- package/dist/cjs/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -0
- package/dist/cjs/node_modules/@apollo/client/version.js +6 -0
- package/dist/cjs/node_modules/@apollo/client/version.js.map +1 -0
- package/dist/cjs/node_modules/@wry/caches/lib/weak.js +147 -0
- package/dist/cjs/node_modules/@wry/caches/lib/weak.js.map +1 -0
- package/dist/cjs/node_modules/@wry/trie/lib/index.js +86 -0
- package/dist/cjs/node_modules/@wry/trie/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/graphql/error/GraphQLError.js +232 -0
- package/dist/cjs/node_modules/graphql/error/GraphQLError.js.map +1 -0
- package/dist/cjs/node_modules/graphql/error/syntaxError.js +18 -0
- package/dist/cjs/node_modules/graphql/error/syntaxError.js.map +1 -0
- package/dist/cjs/node_modules/graphql/jsutils/devAssert.js +12 -0
- package/dist/cjs/node_modules/graphql/jsutils/devAssert.js.map +1 -0
- package/dist/cjs/node_modules/graphql/jsutils/inspect.js +120 -0
- package/dist/cjs/node_modules/graphql/jsutils/inspect.js.map +1 -0
- package/dist/cjs/node_modules/graphql/jsutils/instanceOf.js +63 -0
- package/dist/cjs/node_modules/graphql/jsutils/instanceOf.js.map +1 -0
- package/dist/cjs/node_modules/graphql/jsutils/invariant.js +14 -0
- package/dist/cjs/node_modules/graphql/jsutils/invariant.js.map +1 -0
- package/dist/cjs/node_modules/graphql/jsutils/isObjectLike.js +12 -0
- package/dist/cjs/node_modules/graphql/jsutils/isObjectLike.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/ast.js +227 -0
- package/dist/cjs/node_modules/graphql/language/ast.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/blockString.js +114 -0
- package/dist/cjs/node_modules/graphql/language/blockString.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/characterClasses.js +73 -0
- package/dist/cjs/node_modules/graphql/language/characterClasses.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/directiveLocation.js +34 -0
- package/dist/cjs/node_modules/graphql/language/directiveLocation.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/kinds.js +63 -0
- package/dist/cjs/node_modules/graphql/language/kinds.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/lexer.js +925 -0
- package/dist/cjs/node_modules/graphql/language/lexer.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/location.js +36 -0
- package/dist/cjs/node_modules/graphql/language/location.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/parser.js +1582 -0
- package/dist/cjs/node_modules/graphql/language/parser.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/printLocation.js +72 -0
- package/dist/cjs/node_modules/graphql/language/printLocation.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/printString.js +181 -0
- package/dist/cjs/node_modules/graphql/language/printString.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/printer.js +374 -0
- package/dist/cjs/node_modules/graphql/language/printer.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/source.js +56 -0
- package/dist/cjs/node_modules/graphql/language/source.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/tokenKind.js +39 -0
- package/dist/cjs/node_modules/graphql/language/tokenKind.js.map +1 -0
- package/dist/cjs/node_modules/graphql/language/visitor.js +274 -0
- package/dist/cjs/node_modules/graphql/language/visitor.js.map +1 -0
- package/dist/cjs/node_modules/graphql-tag/lib/index.js +129 -0
- package/dist/cjs/node_modules/graphql-tag/lib/index.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Observable.js +106 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscriber.js +158 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.js +148 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/config.js +7 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/observable/empty.js +8 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +20 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +6 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +17 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +11 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +15 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +10 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/identity.js +8 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +8 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/noop.js +6 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/pipe.js +18 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +14 -0
- package/dist/cjs/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -0
- package/dist/cjs/node_modules/tslib/tslib.es6.js +93 -0
- package/dist/cjs/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/cjs/shared/apollo/apollo.client.js +2 -2
- package/dist/cjs/shared/apollo/apollo.client.js.map +1 -1
- package/dist/cjs/shared/types/generated.js +2 -2
- package/dist/cjs/shared/types/generated.js.map +1 -1
- package/dist/esm/_virtual/_commonjsHelpers.js +1 -30
- package/dist/esm/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/esm/components/panel/Panel.js +0 -1
- package/dist/esm/components/panel/Panel.js.map +1 -1
- package/dist/esm/components/panel/PanelAvatar.js +2 -4
- package/dist/esm/components/panel/PanelAvatar.js.map +1 -1
- package/dist/esm/components/panel/PanelButton.js +0 -1
- package/dist/esm/components/panel/PanelButton.js.map +1 -1
- package/dist/esm/components/panel/PanelDivider.js +0 -1
- package/dist/esm/components/panel/PanelDivider.js.map +1 -1
- package/dist/esm/components/panel/PanelFooter.js +0 -1
- package/dist/esm/components/panel/PanelFooter.js.map +1 -1
- package/dist/esm/components/panel/PanelHeader.js +0 -1
- package/dist/esm/components/panel/PanelHeader.js.map +1 -1
- package/dist/esm/components/panel/PanelItem.js +0 -1
- package/dist/esm/components/panel/PanelItem.js.map +1 -1
- package/dist/esm/components/panel/PanelListItems.js +0 -1
- package/dist/esm/components/panel/PanelListItems.js.map +1 -1
- package/dist/esm/components/session/SessionProvider.js +0 -1
- package/dist/esm/components/session/SessionProvider.js.map +1 -1
- package/dist/esm/components/session/SessionUserContext.js +0 -1
- package/dist/esm/components/session/SessionUserContext.js.map +1 -1
- package/dist/esm/components/session/SessionUserProvider.js +0 -1
- package/dist/esm/components/session/SessionUserProvider.js.map +1 -1
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/hooks.js +2 -2
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/hooks.js.map +1 -1
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js +2 -2
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js.map +1 -1
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/views.js +2 -2
- package/dist/esm/node_modules/@cobuildlab/react-simple-state/lib/views.js.map +1 -1
- package/dist/esm/node_modules/@mui/material-nextjs/esm/nextCompatRouter.js +1 -1
- package/dist/esm/node_modules/@mui/material-nextjs/esm/v13-appRouter/nextNavigation.js +1 -1
- package/dist/esm/shared/apollo/apollo.client.js +1 -1
- package/dist/esm/shared/types/generated.js +1 -1
- package/dist/esm/types/components/panel/PanelAvatar.d.ts +3 -1
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Panel.js","sources":["../../../../src/components/panel/Panel.tsx"],"sourcesContent":["'use client';\nimport { Box, Drawer, DrawerProps } from '@mui/material';\nimport React from 'react';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { handlePanelClick } from './panel.actions';\n\nexport interface PanelProps extends DrawerProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n size?: number;\n}\n\nexport const Panel: React.FC<PanelProps> = ({ children, footer, size = 300, ...rest }) => {\n const { isOpen } = useStore(panelStore);\n\n return (\n <Drawer open={isOpen} onClose={() => handlePanelClick(false)} {...rest}>\n <Box\n sx={{ width: size }}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n height=\"100%\">\n <Box>{children}</Box>\n <Box>{footer}</Box>\n </Box>\n </Drawer>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Panel.js","sources":["../../../../src/components/panel/Panel.tsx"],"sourcesContent":["'use client';\nimport { Box, Drawer, DrawerProps } from '@mui/material';\nimport React from 'react';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\nimport { handlePanelClick } from './panel.actions';\n\nexport interface PanelProps extends DrawerProps {\n children?: React.ReactNode;\n footer?: React.ReactNode;\n size?: number;\n}\n\nexport const Panel: React.FC<PanelProps> = ({ children, footer, size = 300, ...rest }) => {\n const { isOpen } = useStore(panelStore);\n\n return (\n <Drawer open={isOpen} onClose={() => handlePanelClick(false)} {...rest}>\n <Box\n sx={{ width: size }}\n display=\"flex\"\n flexDirection=\"column\"\n justifyContent=\"space-between\"\n height=\"100%\">\n <Box>{children}</Box>\n <Box>{footer}</Box>\n </Box>\n </Drawer>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAaO;;AAGL;AAaF;;"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
import { useSession } from '../session/session.hooks.js';
|
|
5
|
-
import Corona from '../../assets/corona.svg.js';
|
|
6
4
|
import Box from '../../node_modules/@mui/material/esm/Box/Box.js';
|
|
7
5
|
import Avatar from '../../node_modules/@mui/material/esm/Avatar/Avatar.js';
|
|
8
6
|
import Link from '../../node_modules/@mui/material/esm/Link/Link.js';
|
|
9
7
|
|
|
10
|
-
const PanelAvatar = ({ avatarProps, textLink = 'Admin Account', }) => {
|
|
8
|
+
const PanelAvatar = ({ avatarProps, textLink = 'Admin Account', subscriptionImage = null, subscriptionImageContainerProps = {}, }) => {
|
|
11
9
|
const { user, config, subscription } = useSession();
|
|
12
|
-
return (jsxs(Box, { px: 1.5, py: 1, display: "flex", alignItems: "center", children: [jsxs(Box, { mr: 1, position: "relative", children: [jsx(Avatar, { sx: { width: 40, height: 40, ...avatarProps?.sx }, src: user?.avatar, ...avatarProps }), subscription ?
|
|
10
|
+
return (jsxs(Box, { px: 1.5, py: 1, display: "flex", alignItems: "center", children: [jsxs(Box, { mr: 1, position: "relative", children: [jsx(Avatar, { sx: { width: 40, height: 40, ...avatarProps?.sx }, src: user?.avatar, ...avatarProps }), subscription ? jsx(Box, { ...subscriptionImageContainerProps, children: subscriptionImage }) : null] }), jsxs(Box, { children: [jsx(Box, { mb: 0, children: decodeURIComponent(user?.name) }), jsx(Link, { href: config?.urlPortal, children: jsx(Box, { fontSize: 12, children: textLink }) })] })] }));
|
|
13
11
|
};
|
|
14
12
|
|
|
15
13
|
export { PanelAvatar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelAvatar.js","sources":["../../../../src/components/panel/PanelAvatar.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { Box, Avatar, Link, AvatarProps } from '@mui/material';\nimport { useSession } from '../session/session.hooks';\
|
|
1
|
+
{"version":3,"file":"PanelAvatar.js","sources":["../../../../src/components/panel/PanelAvatar.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { Box, Avatar, Link, AvatarProps, BoxProps } from '@mui/material';\nimport { useSession } from '../session/session.hooks';\n\nexport interface PanelAvatarProps {\n avatarProps?: AvatarProps;\n textLink?: string;\n subscriptionImage?: React.ReactNode | null;\n subscriptionImageContainerProps?: BoxProps;\n}\n\nexport const PanelAvatar: React.FC<PanelAvatarProps> = ({\n avatarProps,\n textLink = 'Admin Account',\n subscriptionImage = null,\n subscriptionImageContainerProps = {},\n}) => {\n const { user, config, subscription } = useSession();\n\n return (\n <Box px={1.5} py={1} display=\"flex\" alignItems=\"center\">\n <Box mr={1} position=\"relative\">\n <Avatar\n sx={{ width: 40, height: 40, ...avatarProps?.sx }}\n src={user?.avatar as string}\n {...avatarProps}\n />\n {subscription ? <Box {...subscriptionImageContainerProps}>{subscriptionImage}</Box> : null}\n </Box>\n <Box>\n <Box mb={0}>{decodeURIComponent(user?.name as string)}</Box>\n <Link href={config?.urlPortal}>\n <Box fontSize={12}>{textLink}</Box>\n </Link>\n </Box>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAsCA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client'\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\n\nexport interface PanelButtonProps extends ButtonProps {\n children: React.ReactNode;\n}\n\nexport const PanelButton: FC<PanelButtonProps> = ({ children, ...rest }) => {\n const { isOpen } = useStore(panelStore);\n\n return <Button onClick={() => handlePanelClick(!isOpen)} {...rest}>\n {children}\n </Button>;\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelButton.js","sources":["../../../../src/components/panel/PanelButton.tsx"],"sourcesContent":["'use client'\nimport React, { FC } from 'react';\nimport { Button, ButtonProps } from '@mui/material';\nimport { handlePanelClick } from './panel.actions';\nimport { useStore } from '@cobuildlab/react-simple-state';\nimport { panelStore } from './panel.store';\n\nexport interface PanelButtonProps extends ButtonProps {\n children: React.ReactNode;\n}\n\nexport const PanelButton: FC<PanelButtonProps> = ({ children, ...rest }) => {\n const { isOpen } = useStore(panelStore);\n\n return <Button onClick={() => handlePanelClick(!isOpen)} {...rest}>\n {children}\n </Button>;\n};\n"],"names":[],"mappings":";;;;;;;AAWO;;AAGL;AAGF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelDivider.js","sources":["../../../../src/components/panel/PanelDivider.tsx"],"sourcesContent":["'use client'\nimport { DividerProps, Divider } from '@mui/material';\nimport React from 'react';\n\nexport interface PanelDividerProps extends DividerProps {}\n\nexport const PanelDivider: React.FC<PanelDividerProps> = ({ sx, ...rest }) => {\n return (\n <Divider\n sx={{\n backgroundColor: '#e7e7e7',\n height: 1.5,\n ...sx,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelDivider.js","sources":["../../../../src/components/panel/PanelDivider.tsx"],"sourcesContent":["'use client'\nimport { DividerProps, Divider } from '@mui/material';\nimport React from 'react';\n\nexport interface PanelDividerProps extends DividerProps {}\n\nexport const PanelDivider: React.FC<PanelDividerProps> = ({ sx, ...rest }) => {\n return (\n <Divider\n sx={{\n backgroundColor: '#e7e7e7',\n height: 1.5,\n ...sx,\n }}\n {...rest}\n />\n );\n};\n"],"names":[],"mappings":";;;;AAMO;AACL;AAGM;AACA;AACA;;AAKR;;"}
|
|
@@ -6,7 +6,6 @@ import { theme } from '../../shared/mui/theme.js';
|
|
|
6
6
|
import PowerSettingsNewIcon from '../../node_modules/@mui/icons-material/esm/PowerSettingsNew.js';
|
|
7
7
|
import { handleLogout } from './panel.actions.js';
|
|
8
8
|
import { useSession } from '../session/session.hooks.js';
|
|
9
|
-
import 'react';
|
|
10
9
|
import List from '../../node_modules/@mui/material/esm/List/List.js';
|
|
11
10
|
import ListItemIcon from '../../node_modules/@mui/material/esm/ListItemIcon/ListItemIcon.js';
|
|
12
11
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelFooter.js","sources":["../../../../src/components/panel/PanelFooter.tsx"],"sourcesContent":["'use client';\nimport {\n DividerProps,\n List,\n ListItemIcon,\n ListItemProps,\n ListItemTextProps,\n ListProps,\n} from '@mui/material';\nimport { PanelDivider } from './PanelDivider';\nimport { PanelItem } from './PanelItem';\nimport { theme } from '../../shared/mui/theme';\nimport PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';\nimport { handleLogout } from './panel.actions';\nimport { useSession } from '../session/session.hooks';\nimport React from 'react';\n\nexport interface PanelFooterProps {\n dividerProps?: DividerProps;\n listProps?: ListProps;\n listItemProps?: ListItemProps & { href?: string };\n listItemTextProps?: ListItemTextProps;\n}\n\nexport const PanelFooter: React.FC<PanelFooterProps> = ({\n dividerProps,\n listProps,\n listItemProps,\n listItemTextProps,\n}) => {\n const { config } = useSession();\n return (\n <List disablePadding {...listProps}>\n <PanelDivider {...dividerProps} />\n <PanelItem\n listItemProps={{\n onClick: () => handleLogout(config),\n secondaryAction: (\n <ListItemIcon sx={{ marginRight: theme.spacing(1.5), minWidth: 0 }}>\n <PowerSettingsNewIcon />\n </ListItemIcon>\n ),\n component: 'div',\n ...listItemProps,\n }}\n listItemTextProps={{\n primary: 'Cerrar sesión',\n primaryTypographyProps: { sx: { fontWeight: 'bold', fontSize: 18 } },\n ...listItemTextProps,\n }}\n />\n </List>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelFooter.js","sources":["../../../../src/components/panel/PanelFooter.tsx"],"sourcesContent":["'use client';\nimport {\n DividerProps,\n List,\n ListItemIcon,\n ListItemProps,\n ListItemTextProps,\n ListProps,\n} from '@mui/material';\nimport { PanelDivider } from './PanelDivider';\nimport { PanelItem } from './PanelItem';\nimport { theme } from '../../shared/mui/theme';\nimport PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNew';\nimport { handleLogout } from './panel.actions';\nimport { useSession } from '../session/session.hooks';\nimport React from 'react';\n\nexport interface PanelFooterProps {\n dividerProps?: DividerProps;\n listProps?: ListProps;\n listItemProps?: ListItemProps & { href?: string };\n listItemTextProps?: ListItemTextProps;\n}\n\nexport const PanelFooter: React.FC<PanelFooterProps> = ({\n dividerProps,\n listProps,\n listItemProps,\n listItemTextProps,\n}) => {\n const { config } = useSession();\n return (\n <List disablePadding {...listProps}>\n <PanelDivider {...dividerProps} />\n <PanelItem\n listItemProps={{\n onClick: () => handleLogout(config),\n secondaryAction: (\n <ListItemIcon sx={{ marginRight: theme.spacing(1.5), minWidth: 0 }}>\n <PowerSettingsNewIcon />\n </ListItemIcon>\n ),\n component: 'div',\n ...listItemProps,\n }}\n listItemTextProps={{\n primary: 'Cerrar sesión',\n primaryTypographyProps: { sx: { fontWeight: 'bold', fontSize: 18 } },\n ...listItemTextProps,\n }}\n />\n </List>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AAwBO;AAML;AACA;AAKQ;;AAMA;AACA;AACD;AAEC;AACA;AACA;;AAKV;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelHeader.js","sources":["../../../../src/components/panel/PanelHeader.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { BoxProps, Box } from '@mui/material';\n\nexport interface PanelHeaderProps {\n containerProps?: BoxProps;\n imageProps?: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;\n}\n\nexport const PanelHeader: React.FC<PanelHeaderProps> = ({\n imageProps = {},\n containerProps = {},\n}) => {\n return (\n <Box {...containerProps}>\n <img {...imageProps} alt={imageProps?.alt} />\n </Box>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelHeader.js","sources":["../../../../src/components/panel/PanelHeader.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport { BoxProps, Box } from '@mui/material';\n\nexport interface PanelHeaderProps {\n containerProps?: BoxProps;\n imageProps?: React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>;\n}\n\nexport const PanelHeader: React.FC<PanelHeaderProps> = ({\n imageProps = {},\n containerProps = {},\n}) => {\n return (\n <Box {...containerProps}>\n <img {...imageProps} alt={imageProps?.alt} />\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;AASO;AAIL;AAKF;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
|
-
import 'react';
|
|
4
3
|
import ArrowForwardIosIcon from '../../node_modules/@mui/icons-material/esm/ArrowForwardIos.js';
|
|
5
4
|
import { theme } from '../../shared/mui/theme.js';
|
|
6
5
|
import ListItem from '../../node_modules/@mui/material/esm/ListItem/ListItem.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelItem.js","sources":["../../../../src/components/panel/PanelItem.tsx"],"sourcesContent":["'use client'\nimport React from 'react';\nimport {\n ListItem,\n ListItemButton,\n ListItemText,\n IconButton,\n ListItemProps,\n ListItemTextProps,\n} from '@mui/material';\nimport ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';\nimport { theme } from '../../shared/mui/theme';\n\nexport interface PanelItemProps {\n listItemProps?: ListItemProps & { href?: string };\n listItemTextProps?: ListItemTextProps;\n}\n\nexport const PanelItem: React.FC<PanelItemProps> = ({ listItemProps, listItemTextProps }) => {\n return (\n <ListItem\n disablePadding\n component=\"a\"\n secondaryAction={\n <IconButton>\n <ArrowForwardIosIcon fontSize=\"small\" />\n </IconButton>\n }\n {...listItemProps}>\n <ListItemButton sx={{ alignItems: 'center', paddingLeft: theme.spacing(1.5) }}>\n <ListItemText {...listItemTextProps} />\n </ListItemButton>\n </ListItem>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelItem.js","sources":["../../../../src/components/panel/PanelItem.tsx"],"sourcesContent":["'use client'\nimport React from 'react';\nimport {\n ListItem,\n ListItemButton,\n ListItemText,\n IconButton,\n ListItemProps,\n ListItemTextProps,\n} from '@mui/material';\nimport ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';\nimport { theme } from '../../shared/mui/theme';\n\nexport interface PanelItemProps {\n listItemProps?: ListItemProps & { href?: string };\n listItemTextProps?: ListItemTextProps;\n}\n\nexport const PanelItem: React.FC<PanelItemProps> = ({ listItemProps, listItemTextProps }) => {\n return (\n <ListItem\n disablePadding\n component=\"a\"\n secondaryAction={\n <IconButton>\n <ArrowForwardIosIcon fontSize=\"small\" />\n </IconButton>\n }\n {...listItemProps}>\n <ListItemButton sx={{ alignItems: 'center', paddingLeft: theme.spacing(1.5) }}>\n <ListItemText {...listItemTextProps} />\n </ListItemButton>\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAkBO;;AAgBP;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanelListItems.js","sources":["../../../../src/components/panel/PanelListItems.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport {\n ListProps,\n Box,\n Typography,\n DividerProps,\n BoxProps,\n List,\n TypographyProps,\n} from '@mui/material';\nimport { PanelDivider } from './PanelDivider';\nimport { theme } from '../../shared/mui/theme';\nimport { PanelListRoute } from './panel.types';\nimport { PanelItem } from './PanelItem';\n\nexport interface PanelListItems {\n dividerProps?: DividerProps;\n containerProps?: BoxProps;\n listProps?: ListProps;\n routes?: PanelListRoute[];\n titleProps?: TypographyProps;\n title?: string;\n}\n\nexport const PanelListItems: React.FC<PanelListItems> = ({\n dividerProps,\n containerProps,\n listProps,\n titleProps,\n routes = [],\n title = 'Title',\n}) => {\n return (\n <Box {...containerProps}>\n {title ? (\n <>\n <Typography\n px={1.5}\n mb={1}\n lineHeight={1.2}\n fontWeight=\"bold\"\n fontSize={16}\n {...titleProps}>\n {title}\n </Typography>\n <PanelDivider {...dividerProps} />\n </>\n ) : null}\n\n <List disablePadding sx={{ marginBottom: theme.spacing(1) }} {...listProps}>\n {routes.map((route, index) => (\n <PanelItem\n key={index}\n listItemProps={{\n href: route.path,\n }}\n listItemTextProps={{\n primary: route.name,\n primaryTypographyProps: { sx: { fontWeight: 400, fontSize: 16 } },\n }}\n />\n ))}\n </List>\n </Box>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PanelListItems.js","sources":["../../../../src/components/panel/PanelListItems.tsx"],"sourcesContent":["'use client';\nimport React from 'react';\nimport {\n ListProps,\n Box,\n Typography,\n DividerProps,\n BoxProps,\n List,\n TypographyProps,\n} from '@mui/material';\nimport { PanelDivider } from './PanelDivider';\nimport { theme } from '../../shared/mui/theme';\nimport { PanelListRoute } from './panel.types';\nimport { PanelItem } from './PanelItem';\n\nexport interface PanelListItems {\n dividerProps?: DividerProps;\n containerProps?: BoxProps;\n listProps?: ListProps;\n routes?: PanelListRoute[];\n titleProps?: TypographyProps;\n title?: string;\n}\n\nexport const PanelListItems: React.FC<PanelListItems> = ({\n dividerProps,\n containerProps,\n listProps,\n titleProps,\n routes = [],\n title = 'Title',\n}) => {\n return (\n <Box {...containerProps}>\n {title ? (\n <>\n <Typography\n px={1.5}\n mb={1}\n lineHeight={1.2}\n fontWeight=\"bold\"\n fontSize={16}\n {...titleProps}>\n {title}\n </Typography>\n <PanelDivider {...dividerProps} />\n </>\n ) : null}\n\n <List disablePadding sx={{ marginBottom: theme.spacing(1) }} {...listProps}>\n {routes.map((route, index) => (\n <PanelItem\n key={index}\n listItemProps={{\n href: route.path,\n }}\n listItemTextProps={{\n primary: route.name,\n primaryTypographyProps: { sx: { fontWeight: 400, fontSize: 16 } },\n }}\n />\n ))}\n </List>\n </Box>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAiCE;;AAuBW;;AAGC;AACD;AAMb;;"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import 'react';
|
|
3
2
|
import { SessionUserProvider } from './SessionUserProvider.js';
|
|
4
3
|
import { getUserServer } from './session.server.actions.js';
|
|
5
4
|
import AppRouterCacheProvider from '../../node_modules/@mui/material-nextjs/esm/v13-appRouter/appRouterV13.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n config: Config;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children, config }) => {\n const user = await getUserServer(config);\n console.log({ user });\n return (\n <AppRouterCacheProvider>\n <SessionUserProvider initial={user} config={config}>\n {children}\n </SessionUserProvider>\n </AppRouterCacheProvider>\n );\n};\n"],"names":["_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionProvider.js","sources":["../../../../src/components/session/SessionProvider.tsx"],"sourcesContent":["import React from 'react';\nimport { Config } from '../../config/config.types';\nimport { SessionUserProvider } from './SessionUserProvider';\nimport { AppRouterCacheProvider } from '@mui/material-nextjs/v15-appRouter';\nimport { getUserServer } from './session.server.actions';\n\ntype SessionProviderProps = {\n children: React.ReactNode;\n config: Config;\n};\n\nexport const SessionProvider: React.FC<SessionProviderProps> = async ({ children, config }) => {\n const user = await getUserServer(config);\n console.log({ user });\n return (\n <AppRouterCacheProvider>\n <SessionUserProvider initial={user} config={config}>\n {children}\n </SessionUserProvider>\n </AppRouterCacheProvider>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;AAWO,MAAM,eAAe,GAAmC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAI;AAC5F,IAAA,MAAM,IAAI,GAAG,MAAM,aAAa,CAAC,MAAM,CAAC;AACxC,IAAA,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;AACrB,IAAA,QACEA,GAAA,CAAC,sBAAsB,cACrBA,GAAA,CAAC,mBAAmB,IAAC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAA,QAAA,EAC/C,QAAQ,EAAA,CACW,EAAA,CACC;AAE7B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionUserContext.js","sources":["../../../../src/components/session/SessionUserContext.tsx"],"sourcesContent":["'use client'\nimport { createContext } from 'react';\n\nimport { SessionContextDefaultValues } from './session.types';\nimport { DEFAULT_USER_CONTEXT } from './session.constants';\n\nexport const Context = createContext<SessionContextDefaultValues>(DEFAULT_USER_CONTEXT);\n\nexport const { Provider } = Context;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionUserContext.js","sources":["../../../../src/components/session/SessionUserContext.tsx"],"sourcesContent":["'use client'\nimport { createContext } from 'react';\n\nimport { SessionContextDefaultValues } from './session.types';\nimport { DEFAULT_USER_CONTEXT } from './session.constants';\n\nexport const Context = createContext<SessionContextDefaultValues>(DEFAULT_USER_CONTEXT);\n\nexport const { Provider } = Context;\n"],"names":[],"mappings":";;;;;AAQO;;"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
-
import '../../shared/types/generated.js';
|
|
5
4
|
import { Provider } from './SessionUserContext.js';
|
|
6
5
|
import { theme } from '../../shared/mui/theme.js';
|
|
7
6
|
import ThemeProvider from '../../node_modules/@mui/material/esm/styles/ThemeProvider.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: { id: 1 },\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SessionUserProvider.js","sources":["../../../../src/components/session/SessionUserProvider.tsx"],"sourcesContent":["'use client';\nimport React, { useState } from 'react';\nimport { User } from '../../shared/types/generated';\nimport { Provider } from './SessionUserContext';\nimport { SessionContextDefaultValues } from './session.types';\nimport { Config } from '../../config/config.types';\nimport { ThemeProvider } from '@mui/material/styles';\nimport CssBaseline from '@mui/material/CssBaseline';\nimport { theme } from '../../shared/mui/theme';\n\ntype SessionUserProviderProps = {\n children: React.ReactNode;\n initial: User | null | undefined;\n config: Config;\n};\n\nexport const SessionUserProvider: React.FC<SessionUserProviderProps> = ({\n children,\n initial,\n config,\n}) => {\n const [user] = useState<User | null | undefined>(initial);\n\n const values: SessionContextDefaultValues = {\n user,\n config,\n subscription: { id: 1 },\n };\n return (\n <Provider value={values}>\n <ThemeProvider theme={theme}>\n <CssBaseline />\n\n {children}\n </ThemeProvider>\n </Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAgBO;;AAOL;;;AAGE;;;AAWJ;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as hooks } from '../../../../_virtual/hooks.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
var hasRequiredHooks;
|
|
5
5
|
|
|
@@ -28,7 +28,7 @@ function requireHooks () {
|
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(hooks, "__esModule", { value: true });
|
|
30
30
|
hooks.useCallAction = hooks.useFetchAction = hooks.useEvent = hooks.useSubscription = void 0;
|
|
31
|
-
var react_1 =
|
|
31
|
+
var react_1 = React__default;
|
|
32
32
|
/**
|
|
33
33
|
* React Hook to subscribe to an specific event.
|
|
34
34
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/hooks.js"],"sourcesContent":["\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useCallAction = exports.useFetchAction = exports.useEvent = exports.useSubscription = void 0;\nvar react_1 = require(\"react\");\n/**\n * React Hook to subscribe to an specific event.\n *\n * @param {Event} event - The event to subscribe. The Event is considered constant across renders.\n * @param {Function} callback - A function to be called when the subscription gets triggered.\n * @param {any[]} deps - List of dependencies for the callback. Follow the same rules of useEffect.\n * @returns {void} - Void hook.\n */\nfunction useSubscription(event, callback, deps) {\n if (deps === void 0) { deps = undefined; }\n var callbackRef = (0, react_1.useRef)(callback);\n callbackRef.current = callback;\n if (deps) {\n console.warn(\"Deps param has been deprecated, it is not useful anymore.\");\n }\n (0, react_1.useEffect)(function () {\n var subscriptionCallback = function (eventData) {\n callbackRef.current(eventData);\n };\n var subscription = event.subscribe(subscriptionCallback);\n return function () {\n subscription.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [event]);\n}\nexports.useSubscription = useSubscription;\n/**\n * React Hook to subscribe to an Event.\n *\n * @param {Event} event - The event.\n * @param {object} params - Params.\n * @param {object} params.initialValue - Initial Value.\n * @param {Function} params.reducer - Reducer for transform the data.\n * @returns {object} Data object.\n */\nfunction useEvent(event, params) {\n var _a = params || {}, reducer = _a.reducer, initialValue = _a.initialValue;\n var _b = (0, react_1.useState)(function () {\n if (initialValue && event.isEmpty()) {\n return initialValue;\n }\n else if (reducer) {\n return reducer(event.get());\n }\n return event.get();\n }), value = _b[0], setValue = _b[1];\n var reducerRef = (0, react_1.useRef)(params === null || params === void 0 ? void 0 : params.reducer);\n reducerRef.current = params === null || params === void 0 ? void 0 : params.reducer;\n (0, react_1.useEffect)(function () {\n var handleStateChange = function (state) {\n var eventState = reducerRef.current\n ? reducerRef.current(state)\n : state;\n setValue(eventState);\n };\n var subscription = event.subscribe(handleStateChange);\n return function () {\n subscription.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [event]);\n return value;\n}\nexports.useEvent = useEvent;\n/**\n * Hook that handle fetch promise actions, like querys to database.\n * This hook uses a declarative pattern.\n *\n * @param {ActionType} action - Action to fetch.\n * @param {Array} params - Param to call the action.\n * @param {UseFetchActionOptions} options - Option to handle the actions.\n * @param {Function} options.onCompleted - A callback to be called when the promise get resolved.\n * @param {Function} options.onError - A callback to be called when an error occurs.\n * @param {Function} options.skip - To skip the fetch ultil some validation happen.\n * @returns {UseFetchActionReturn} - Hook state result.\n */\nfunction useFetchAction(action, params, options) {\n var _a = options || {}, onCompleted = _a.onCompleted, onError = _a.onError, skip = _a.skip;\n var event = action.event, errorEvent = action.errorEvent;\n var _b = (0, react_1.useState)(function () { return ({\n value: event.get(),\n loading: (options === null || options === void 0 ? void 0 : options.skip) ? false : true,\n error: null,\n }); }), _c = _b[0], value = _c.value, loading = _c.loading, error = _c.error, setState = _b[1];\n var callbacksRef = (0, react_1.useRef)({\n completed: onCompleted,\n error: onError,\n });\n callbacksRef.current = {\n completed: onCompleted,\n error: onError,\n };\n var fetch = (0, react_1.useCallback)(function () {\n setState(function (state) { return (__assign(__assign({}, state), { loading: true })); });\n action.apply(void 0, params);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, __spreadArray([action], params, true));\n (0, react_1.useEffect)(function () {\n if (skip) {\n return;\n }\n fetch();\n }, [fetch, skip]);\n (0, react_1.useEffect)(function () {\n var onSuccessCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, value: data })); });\n if (callbacksRef.current.completed)\n callbacksRef.current.completed(data);\n };\n var onErrorCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, error: data })); });\n if (callbacksRef.current.error)\n callbacksRef.current.error(data);\n };\n var successSub = event.subscribe(onSuccessCallback);\n var errorSub = errorEvent.subscribe(onErrorCallback);\n return function () {\n successSub.unsubscribe();\n errorSub.unsubscribe();\n };\n }, [event, errorEvent]);\n return [\n value,\n loading,\n {\n error: error,\n refetch: fetch,\n },\n ];\n}\nexports.useFetchAction = useFetchAction;\n/**\n * Hook that handle call promise actions, like mutations to database in a declarative way.\n *\n * @param {ActionType} action - The action to be called.\n * @param {UseActionOptions} options - Option to handle the actions.\n * @param {Function} options.onCompleted - A callback to be called when the promise get resolved.\n * @param {Function} options.onError - A callback to be called when an error occurs.\n * @returns {UseCallActionReturn} - Hook state result.\n */\nfunction useCallAction(action, options) {\n var _a = options || {}, onCompleted = _a.onCompleted, onError = _a.onError;\n var event = action.event, errorEvent = action.errorEvent;\n var _b = (0, react_1.useState)(function () { return ({\n value: event.get(),\n loading: false,\n error: null,\n }); }), _c = _b[0], value = _c.value, loading = _c.loading, error = _c.error, setState = _b[1];\n var callbacksRef = (0, react_1.useRef)({\n completed: onCompleted,\n error: onError,\n });\n callbacksRef.current = {\n completed: onCompleted,\n error: onError,\n };\n var call = (0, react_1.useCallback)(function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n setState(function (state) { return (__assign(__assign({}, state), { loading: true })); });\n action.apply(void 0, params);\n }, [action]);\n (0, react_1.useEffect)(function () {\n var onSuccessCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, value: data })); });\n if (callbacksRef.current.completed)\n callbacksRef.current.completed(data);\n };\n var onErrorCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, error: data })); });\n if (callbacksRef.current.error)\n callbacksRef.current.error(data);\n };\n var successSub = event.subscribe(onSuccessCallback);\n var errorSub = errorEvent.subscribe(onErrorCallback);\n return function () {\n successSub.unsubscribe();\n errorSub.unsubscribe();\n };\n }, [event, errorEvent]);\n return [\n call,\n loading,\n {\n error: error,\n data: value,\n },\n ];\n}\nexports.useCallAction = useCallAction;\n"],"names":["this"],"mappings":";;;;;;;;CACA,IAAI,QAAQ,GAAG,CAACA,KAAI,IAAIA,KAAI,CAAC,QAAQ,KAAK,YAAY;KAClD,QAAQ,GAAG,MAAM,CAAC,MAAM,IAAI,SAAS,CAAC,EAAE;SACpC,KAAK,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;AAC7D,aAAY,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;AAC5B,aAAY,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;iBAC3D,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3B,SAAA;AACA,SAAQ,OAAO,CAAC;KAChB,CAAK;KACD,OAAO,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC;CAC1C,CAAC;AACD,CAAA,IAAI,aAAa,GAAG,CAACA,KAAI,IAAIA,KAAI,CAAC,aAAa,KAAK,UAAU,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;AAC9E,KAAI,IAAI,IAAI,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;SACjF,IAAI,EAAE,IAAI,EAAE,CAAC,IAAI,IAA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CAAC,OAAO,CAAC,SAAS;AAC9C,iBAAgB,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;SACpD,CAAS;AACT,SAAQ,IAAI,eAAe,GAAG,UAAU,IAAI,EAAE;AAC9C,aAAY,QAAQ,CAAC,UAAU,KAAK,EAAE,EAAE,QAAQ,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAA,CAAE,CAAC;AACnH,aAAY,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK;AAC1C,iBAAgB,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;SAChD,CAAS;SACD,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;SACnD,IAAI,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC;AAC5D,SAAQ,OAAO,YAAY;aACf,UAAU,CAAC,WAAW,EAAE;aACxB,QAAQ,CAAC,WAAW,EAAE;SAClC,CAAS;AACT,KAAA,CAAK,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC3B,KAAI,OAAO;AACX,SAAQ,IAAI;AACZ,SAAQ,OAAO;SACP;aACI,KAAK,EAAE,KAAK;aACZ,IAAI,EAAE,KAAK;UACd;MACJ;AACL,CAAA;AACA,CAAA,KAAA,CAAA,aAAqB,GAAG,aAAa;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"hooks.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/hooks.js"],"sourcesContent":["\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useCallAction = exports.useFetchAction = exports.useEvent = exports.useSubscription = void 0;\nvar react_1 = require(\"react\");\n/**\n * React Hook to subscribe to an specific event.\n *\n * @param {Event} event - The event to subscribe. The Event is considered constant across renders.\n * @param {Function} callback - A function to be called when the subscription gets triggered.\n * @param {any[]} deps - List of dependencies for the callback. Follow the same rules of useEffect.\n * @returns {void} - Void hook.\n */\nfunction useSubscription(event, callback, deps) {\n if (deps === void 0) { deps = undefined; }\n var callbackRef = (0, react_1.useRef)(callback);\n callbackRef.current = callback;\n if (deps) {\n console.warn(\"Deps param has been deprecated, it is not useful anymore.\");\n }\n (0, react_1.useEffect)(function () {\n var subscriptionCallback = function (eventData) {\n callbackRef.current(eventData);\n };\n var subscription = event.subscribe(subscriptionCallback);\n return function () {\n subscription.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [event]);\n}\nexports.useSubscription = useSubscription;\n/**\n * React Hook to subscribe to an Event.\n *\n * @param {Event} event - The event.\n * @param {object} params - Params.\n * @param {object} params.initialValue - Initial Value.\n * @param {Function} params.reducer - Reducer for transform the data.\n * @returns {object} Data object.\n */\nfunction useEvent(event, params) {\n var _a = params || {}, reducer = _a.reducer, initialValue = _a.initialValue;\n var _b = (0, react_1.useState)(function () {\n if (initialValue && event.isEmpty()) {\n return initialValue;\n }\n else if (reducer) {\n return reducer(event.get());\n }\n return event.get();\n }), value = _b[0], setValue = _b[1];\n var reducerRef = (0, react_1.useRef)(params === null || params === void 0 ? void 0 : params.reducer);\n reducerRef.current = params === null || params === void 0 ? void 0 : params.reducer;\n (0, react_1.useEffect)(function () {\n var handleStateChange = function (state) {\n var eventState = reducerRef.current\n ? reducerRef.current(state)\n : state;\n setValue(eventState);\n };\n var subscription = event.subscribe(handleStateChange);\n return function () {\n subscription.unsubscribe();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [event]);\n return value;\n}\nexports.useEvent = useEvent;\n/**\n * Hook that handle fetch promise actions, like querys to database.\n * This hook uses a declarative pattern.\n *\n * @param {ActionType} action - Action to fetch.\n * @param {Array} params - Param to call the action.\n * @param {UseFetchActionOptions} options - Option to handle the actions.\n * @param {Function} options.onCompleted - A callback to be called when the promise get resolved.\n * @param {Function} options.onError - A callback to be called when an error occurs.\n * @param {Function} options.skip - To skip the fetch ultil some validation happen.\n * @returns {UseFetchActionReturn} - Hook state result.\n */\nfunction useFetchAction(action, params, options) {\n var _a = options || {}, onCompleted = _a.onCompleted, onError = _a.onError, skip = _a.skip;\n var event = action.event, errorEvent = action.errorEvent;\n var _b = (0, react_1.useState)(function () { return ({\n value: event.get(),\n loading: (options === null || options === void 0 ? void 0 : options.skip) ? false : true,\n error: null,\n }); }), _c = _b[0], value = _c.value, loading = _c.loading, error = _c.error, setState = _b[1];\n var callbacksRef = (0, react_1.useRef)({\n completed: onCompleted,\n error: onError,\n });\n callbacksRef.current = {\n completed: onCompleted,\n error: onError,\n };\n var fetch = (0, react_1.useCallback)(function () {\n setState(function (state) { return (__assign(__assign({}, state), { loading: true })); });\n action.apply(void 0, params);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, __spreadArray([action], params, true));\n (0, react_1.useEffect)(function () {\n if (skip) {\n return;\n }\n fetch();\n }, [fetch, skip]);\n (0, react_1.useEffect)(function () {\n var onSuccessCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, value: data })); });\n if (callbacksRef.current.completed)\n callbacksRef.current.completed(data);\n };\n var onErrorCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, error: data })); });\n if (callbacksRef.current.error)\n callbacksRef.current.error(data);\n };\n var successSub = event.subscribe(onSuccessCallback);\n var errorSub = errorEvent.subscribe(onErrorCallback);\n return function () {\n successSub.unsubscribe();\n errorSub.unsubscribe();\n };\n }, [event, errorEvent]);\n return [\n value,\n loading,\n {\n error: error,\n refetch: fetch,\n },\n ];\n}\nexports.useFetchAction = useFetchAction;\n/**\n * Hook that handle call promise actions, like mutations to database in a declarative way.\n *\n * @param {ActionType} action - The action to be called.\n * @param {UseActionOptions} options - Option to handle the actions.\n * @param {Function} options.onCompleted - A callback to be called when the promise get resolved.\n * @param {Function} options.onError - A callback to be called when an error occurs.\n * @returns {UseCallActionReturn} - Hook state result.\n */\nfunction useCallAction(action, options) {\n var _a = options || {}, onCompleted = _a.onCompleted, onError = _a.onError;\n var event = action.event, errorEvent = action.errorEvent;\n var _b = (0, react_1.useState)(function () { return ({\n value: event.get(),\n loading: false,\n error: null,\n }); }), _c = _b[0], value = _c.value, loading = _c.loading, error = _c.error, setState = _b[1];\n var callbacksRef = (0, react_1.useRef)({\n completed: onCompleted,\n error: onError,\n });\n callbacksRef.current = {\n completed: onCompleted,\n error: onError,\n };\n var call = (0, react_1.useCallback)(function () {\n var params = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n params[_i] = arguments[_i];\n }\n setState(function (state) { return (__assign(__assign({}, state), { loading: true })); });\n action.apply(void 0, params);\n }, [action]);\n (0, react_1.useEffect)(function () {\n var onSuccessCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, value: data })); });\n if (callbacksRef.current.completed)\n callbacksRef.current.completed(data);\n };\n var onErrorCallback = function (data) {\n setState(function (state) { return (__assign(__assign({}, state), { loading: false, error: data })); });\n if (callbacksRef.current.error)\n callbacksRef.current.error(data);\n };\n var successSub = event.subscribe(onSuccessCallback);\n var errorSub = errorEvent.subscribe(onErrorCallback);\n return function () {\n successSub.unsubscribe();\n errorSub.unsubscribe();\n };\n }, [event, errorEvent]);\n return [\n call,\n loading,\n {\n error: error,\n data: value,\n },\n ];\n}\nexports.useCallAction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,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAA,CAAE,CAAC;AACnH,aAAY,IAAI,YAAY,CAAC,OAAO,CAAC,KAAK;AAC1C,iBAAgB,YAAY,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;SAChD,CAAS;SACD,IAAI,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,iBAAiB,CAAC;SACnD,IAAI,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC;AAC5D,SAAQ,OAAO,YAAY;aACf,UAAU,CAAC,WAAW,EAAE;aACxB,QAAQ,CAAC,WAAW,EAAE;SAClC,CAAS;AACT,KAAA,CAAK,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;AAC3B,KAAI,OAAO;AACX,SAAQ,IAAI;AACZ,SAAQ,OAAO;SACP;aACI,KAAK,EAAE,KAAK;aACZ,IAAI,EAAE,KAAK;UACd;MACJ;AACL,CAAA;AACA,CAAA,KAAA,CAAA,aAAqB,GAAG,aAAa;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as storeHooks } from '../../../../_virtual/store-hooks.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
var hasRequiredStoreHooks;
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ function requireStoreHooks () {
|
|
|
8
8
|
hasRequiredStoreHooks = 1;
|
|
9
9
|
Object.defineProperty(storeHooks, "__esModule", { value: true });
|
|
10
10
|
storeHooks.useStoreError = storeHooks.useStore = storeHooks.useStoreErrorSubscription = storeHooks.useStoreSubcription = void 0;
|
|
11
|
-
var react_1 =
|
|
11
|
+
var react_1 = React__default;
|
|
12
12
|
/**
|
|
13
13
|
* @param {Store} store - Store to subscribe.
|
|
14
14
|
* @param {Function} callback - Function to call on each dipatch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store-hooks.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useStoreError = exports.useStore = exports.useStoreErrorSubscription = exports.useStoreSubcription = void 0;\nvar react_1 = require(\"react\");\n/**\n * @param {Store} store - Store to subscribe.\n * @param {Function} callback - Function to call on each dipatch.\n * @param {Function} errorCallback - Function to call on each error dipatch.\n */\nfunction useStoreSubcription(store, callback, errorCallback) {\n var callbacksRef = (0, react_1.useRef)({\n callback: callback,\n errorCallback: errorCallback,\n });\n callbacksRef.current = {\n callback: callback,\n errorCallback: errorCallback,\n };\n var hasCallBack = Boolean(callback);\n var hasErrorCallBack = Boolean(errorCallback);\n (0, react_1.useEffect)(function () {\n if (!hasCallBack) {\n return;\n }\n var unsubscribe = store.subscribe(function (data) {\n if (callbacksRef.current.callback) {\n callbacksRef.current.callback(data);\n }\n });\n return function () {\n unsubscribe.unsubscribe();\n };\n }, [store, hasCallBack]);\n (0, react_1.useEffect)(function () {\n if (!hasErrorCallBack) {\n return;\n }\n var unsubscribe = store.subscribeError(function (data) {\n if (callbacksRef.current.errorCallback) {\n callbacksRef.current.errorCallback(data);\n }\n });\n return function () {\n unsubscribe.unsubscribe();\n };\n }, [store, hasErrorCallBack]);\n}\nexports.useStoreSubcription = useStoreSubcription;\n/**\n * @param {Store} store - Store to subscribe.\n * @param {Function} errorcCallback - Function to call on each error dipatch.\n */\nfunction useStoreErrorSubscription(store, errorcCallback) {\n var callbacksRef = (0, react_1.useRef)({\n errorcCallback: errorcCallback,\n });\n callbacksRef.current = {\n errorcCallback: errorcCallback,\n };\n (0, react_1.useEffect)(function () {\n var unsubscribeError = store.subscribeError(function (data) {\n if (callbacksRef.current.errorcCallback) {\n callbacksRef.current.errorcCallback(data);\n }\n });\n return function () {\n unsubscribeError.unsubscribe();\n };\n }, [store]);\n}\nexports.useStoreErrorSubscription = useStoreErrorSubscription;\n/**\n * @param {Store} store - Store to subscribe.\n * @returns {Object} - Resulto object from the store.\n */\nfunction useStore(store) {\n var _a = (0, react_1.useState)(store.get()), state = _a[0], setState = _a[1];\n useStoreSubcription(store, function (data) {\n setState(data);\n });\n return state;\n}\nexports.useStore = useStore;\n/**\n * @param {Store} store - Store to subscribe.\n * @returns {Object} - Resulto object from the store.\n */\nfunction useStoreError(store) {\n var _a = (0, react_1.useState)(null), state = _a[0], setState = _a[1];\n useStoreErrorSubscription(store, function (data) {\n setState(data);\n });\n return state;\n}\nexports.useStoreError = useStoreError;\n"],"names":[],"mappings":";;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAA,UAAA,CAAA,aAAqB,GAAG,mBAAgB,GAAG,UAAA,CAAA,yBAAiC,GAAG,UAAA,CAAA,mBAA2B,GAAG,MAAM;CACnH,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"store-hooks.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/store-hooks.js"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useStoreError = exports.useStore = exports.useStoreErrorSubscription = exports.useStoreSubcription = void 0;\nvar react_1 = require(\"react\");\n/**\n * @param {Store} store - Store to subscribe.\n * @param {Function} callback - Function to call on each dipatch.\n * @param {Function} errorCallback - Function to call on each error dipatch.\n */\nfunction useStoreSubcription(store, callback, errorCallback) {\n var callbacksRef = (0, react_1.useRef)({\n callback: callback,\n errorCallback: errorCallback,\n });\n callbacksRef.current = {\n callback: callback,\n errorCallback: errorCallback,\n };\n var hasCallBack = Boolean(callback);\n var hasErrorCallBack = Boolean(errorCallback);\n (0, react_1.useEffect)(function () {\n if (!hasCallBack) {\n return;\n }\n var unsubscribe = store.subscribe(function (data) {\n if (callbacksRef.current.callback) {\n callbacksRef.current.callback(data);\n }\n });\n return function () {\n unsubscribe.unsubscribe();\n };\n }, [store, hasCallBack]);\n (0, react_1.useEffect)(function () {\n if (!hasErrorCallBack) {\n return;\n }\n var unsubscribe = store.subscribeError(function (data) {\n if (callbacksRef.current.errorCallback) {\n callbacksRef.current.errorCallback(data);\n }\n });\n return function () {\n unsubscribe.unsubscribe();\n };\n }, [store, hasErrorCallBack]);\n}\nexports.useStoreSubcription = useStoreSubcription;\n/**\n * @param {Store} store - Store to subscribe.\n * @param {Function} errorcCallback - Function to call on each error dipatch.\n */\nfunction useStoreErrorSubscription(store, errorcCallback) {\n var callbacksRef = (0, react_1.useRef)({\n errorcCallback: errorcCallback,\n });\n callbacksRef.current = {\n errorcCallback: errorcCallback,\n };\n (0, react_1.useEffect)(function () {\n var unsubscribeError = store.subscribeError(function (data) {\n if (callbacksRef.current.errorcCallback) {\n callbacksRef.current.errorcCallback(data);\n }\n });\n return function () {\n unsubscribeError.unsubscribe();\n };\n }, [store]);\n}\nexports.useStoreErrorSubscription = useStoreErrorSubscription;\n/**\n * @param {Store} store - Store to subscribe.\n * @returns {Object} - Resulto object from the store.\n */\nfunction useStore(store) {\n var _a = (0, react_1.useState)(store.get()), state = _a[0], setState = _a[1];\n useStoreSubcription(store, function (data) {\n setState(data);\n });\n return state;\n}\nexports.useStore = useStore;\n/**\n * @param {Store} store - Store to subscribe.\n * @returns {Object} - Resulto object from the store.\n */\nfunction useStoreError(store) {\n var _a = (0, react_1.useState)(null), state = _a[0], setState = _a[1];\n useStoreErrorSubscription(store, function (data) {\n setState(data);\n });\n return state;\n}\nexports.useStoreError = useStoreError;\n"],"names":["require$$0"],"mappings":";;;;;;;;AACA,CAAA,MAAM,CAAC,cAAc,CAAC,UAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAA,UAAA,CAAA,aAAqB,GAAG,mBAAgB,GAAG,UAAA,CAAA,yBAAiC,GAAG,UAAA,CA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,CAAA;AACA,CAAA,UAAA,CAAA,QAAgB,GAAG,QAAQ;AAC3B;AACA;AACA;AACA;CACA,SAAS,aAAa,CAAC,KAAK,EAAE;KAC1B,IAAI,EAAE,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC;AACzE,KAAI,yBAAyB,CAAC,KAAK,EAAE,UAAU,IAAI,EAAE;SAC7C,QAAQ,CAAC,IAAI,CAAC;AACtB,KAAA,CAAK,CAAC;AACN,KAAI,OAAO,KAAK;AAChB,CAAA;AACA,CAAA,UAAA,CAAA,aAAqB,GAAG,aAAa;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __exports as views } from '../../../../_virtual/views.js';
|
|
2
|
-
import
|
|
2
|
+
import React__default from 'react';
|
|
3
3
|
|
|
4
4
|
var hasRequiredViews;
|
|
5
5
|
|
|
@@ -23,7 +23,7 @@ function requireViews () {
|
|
|
23
23
|
})();
|
|
24
24
|
Object.defineProperty(views, "__esModule", { value: true });
|
|
25
25
|
views.View = void 0;
|
|
26
|
-
var react_1 =
|
|
26
|
+
var react_1 = React__default;
|
|
27
27
|
var View = /** @class */ (function (_super) {
|
|
28
28
|
__extends(View, _super);
|
|
29
29
|
function View() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"views.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/views.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.View = void 0;\nvar react_1 = require(\"react\");\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.subscriptions = [];\n _this.toBeSubscribedIfUnMounted = [];\n _this.hasBeenUnmounted = false;\n return _this;\n }\n /**\n * Subscribe to an Event\n * This is a helpful method to keep track of your subscriptions on UnMount and Mount of the Component.\n *\n * @param {Event} event - The Event object to which you want to subscribe\n * @param {Function }callback - The callback function that's gonna be executed when it happens\n * @param {boolean}receiveLastValue - Whether the callback should receive the last value immediately\n * @return {Subscription} subscription The subscription for this event in the Store\n */\n View.prototype.subscribe = function (event, callback, receiveLastValue) {\n if (receiveLastValue === void 0) { receiveLastValue = false; }\n var subscription = event.subscribe(callback, receiveLastValue);\n this.subscriptions.push(subscription);\n // on an event where the component is unmounted and then mounted:\n this.toBeSubscribedIfUnMounted.push({ event: event, callback: callback, receiveLastValue: receiveLastValue });\n return subscription;\n };\n View.prototype.componentDidMount = function () {\n if (!this.hasBeenUnmounted)\n return;\n var that = this;\n this.toBeSubscribedIfUnMounted.forEach(function (observer) {\n var store = observer.store;\n if (store !== null && store !== undefined) {\n var subscription = store.subscribe(observer.eventName, observer.callback, observer.receiveLastValue);\n that.subscriptions.push(subscription);\n }\n else {\n var event_1 = observer.event;\n if (event_1 !== null && event_1 !== undefined) {\n var subscription = event_1.subscribe(observer.callback, observer.receiveLastValue);\n that.subscriptions.push(subscription);\n }\n }\n });\n };\n View.prototype.componentWillUnmount = function () {\n this.subscriptions.forEach(function (subscription) {\n subscription.unsubscribe();\n });\n this.subscriptions = [];\n this.hasBeenUnmounted = true;\n };\n return View;\n}(react_1.Component));\nexports.View = View;\n"],"names":["this"],"mappings":";;;;;;;;C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K,EAAE,IAAI,EAAE,CAAC;AAC7D,CAAA,KAAA,CAAA,IAAY,GAAG,MAAM;CACrB,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"views.js","sources":["../../../../../../node_modules/@cobuildlab/react-simple-state/lib/views.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.View = void 0;\nvar react_1 = require(\"react\");\nvar View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.subscriptions = [];\n _this.toBeSubscribedIfUnMounted = [];\n _this.hasBeenUnmounted = false;\n return _this;\n }\n /**\n * Subscribe to an Event\n * This is a helpful method to keep track of your subscriptions on UnMount and Mount of the Component.\n *\n * @param {Event} event - The Event object to which you want to subscribe\n * @param {Function }callback - The callback function that's gonna be executed when it happens\n * @param {boolean}receiveLastValue - Whether the callback should receive the last value immediately\n * @return {Subscription} subscription The subscription for this event in the Store\n */\n View.prototype.subscribe = function (event, callback, receiveLastValue) {\n if (receiveLastValue === void 0) { receiveLastValue = false; }\n var subscription = event.subscribe(callback, receiveLastValue);\n this.subscriptions.push(subscription);\n // on an event where the component is unmounted and then mounted:\n this.toBeSubscribedIfUnMounted.push({ event: event, callback: callback, receiveLastValue: receiveLastValue });\n return subscription;\n };\n View.prototype.componentDidMount = function () {\n if (!this.hasBeenUnmounted)\n return;\n var that = this;\n this.toBeSubscribedIfUnMounted.forEach(function (observer) {\n var store = observer.store;\n if (store !== null && store !== undefined) {\n var subscription = store.subscribe(observer.eventName, observer.callback, observer.receiveLastValue);\n that.subscriptions.push(subscription);\n }\n else {\n var event_1 = observer.event;\n if (event_1 !== null && event_1 !== undefined) {\n var subscription = event_1.subscribe(observer.callback, observer.receiveLastValue);\n that.subscriptions.push(subscription);\n }\n }\n });\n };\n View.prototype.componentWillUnmount = function () {\n this.subscriptions.forEach(function (subscription) {\n subscription.unsubscribe();\n });\n this.subscriptions = [];\n this.hasBeenUnmounted = true;\n };\n return View;\n}(react_1.Component));\nexports.View = View;\n"],"names":["this","require$$0"],"mappings":";;;;;;;;CACA,IAAI,SAAS,GAAG,CAACA,KAAI,IAAIA,KAAI,CAAC,SAAS,KAAK,CAAC,YAAY;AACzD,KAAI,IAAI,aAAa,GAAG,UAAU,CAAC,EAAE,CAAC,EAAE;AACxC,SAAQ,aAAa,GAAG,MAAM,CAAC,cAAc;cAChC,EAAE,SAAS,EAAE,EAAE,EAAE,YAAY,KAAK,IAAI,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAA,CAAE,CAAC;AACxF,aAAY,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA,CAAE;AAC7G,SAAQ,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC;KAClC,CAAK;AACL,KAAI,OAAO,UAAU,CAAC,EAAE,CAAC,EAAE;SACnB,IAAI,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,IAAI;AACjD,aAAY,MAAM,IAAI,SAAS,CAAC,sBAAsB,GAAG,M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AAC,UAAU,YAAY,EAAE;aAC/C,YAAY,CAAC,WAAW,EAAE;AACtC,SAAA,CAAS,CAAC;AACV,SAAQ,IAAI,CAAC,aAAa,GAAG,EAAE;AAC/B,SAAQ,IAAI,CAAC,gBAAgB,GAAG,IAAI;KACpC,CAAK;AACL,KAAI,OAAO,IAAI;AACf,CAAA,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AACrB,CAAA,KAAA,CAAA,IAAY,GAAG,IAAI;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HttpLink } from '@apollo/client';
|
|
2
1
|
import { registerApolloClient, ApolloClient, InMemoryCache } from '@apollo/client-integration-nextjs';
|
|
2
|
+
import { HttpLink } from '../../node_modules/@apollo/client/link/http/HttpLink.js';
|
|
3
3
|
|
|
4
4
|
const apolloClient = (config) => {
|
|
5
5
|
const { uri } = config;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { AvatarProps } from '@mui/material';
|
|
2
|
+
import { AvatarProps, BoxProps } from '@mui/material';
|
|
3
3
|
export interface PanelAvatarProps {
|
|
4
4
|
avatarProps?: AvatarProps;
|
|
5
5
|
textLink?: string;
|
|
6
|
+
subscriptionImage?: React.ReactNode | null;
|
|
7
|
+
subscriptionImageContainerProps?: BoxProps;
|
|
6
8
|
}
|
|
7
9
|
export declare const PanelAvatar: React.FC<PanelAvatarProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ declare const Panel: React.FC<PanelProps>;
|
|
|
12
12
|
interface PanelAvatarProps {
|
|
13
13
|
avatarProps?: AvatarProps;
|
|
14
14
|
textLink?: string;
|
|
15
|
+
subscriptionImage?: React.ReactNode | null;
|
|
16
|
+
subscriptionImageContainerProps?: BoxProps;
|
|
15
17
|
}
|
|
16
18
|
declare const PanelAvatar: React.FC<PanelAvatarProps>;
|
|
17
19
|
|