diff --git a/apps/xi.front/app/community/[cid]/announce/[id]/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/announce/page.tsx similarity index 100% rename from apps/xi.front/app/community/[cid]/announce/[id]/page.tsx rename to apps/xi.front/app/communities/[community-id]/channels/[channel-id]/announce/page.tsx diff --git a/apps/xi.front/app/community/[cid]/editor/[id]/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/editor/page.tsx similarity index 100% rename from apps/xi.front/app/community/[cid]/editor/[id]/page.tsx rename to apps/xi.front/app/communities/[community-id]/channels/[channel-id]/editor/page.tsx diff --git a/apps/xi.front/app/community/[cid]/posts/[id]/post/[postId]/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/post/page.tsx similarity index 100% rename from apps/xi.front/app/community/[cid]/posts/[id]/post/[postId]/page.tsx rename to apps/xi.front/app/communities/[community-id]/channels/[channel-id]/post/page.tsx diff --git a/apps/xi.front/app/community/[cid]/posts/[id]/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/posts/page.tsx similarity index 100% rename from apps/xi.front/app/community/[cid]/posts/[id]/page.tsx rename to apps/xi.front/app/communities/[community-id]/channels/[channel-id]/posts/page.tsx diff --git a/apps/xi.front/app/community/[cid]/videoconference/[id]/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/videoconference/page.tsx similarity index 86% rename from apps/xi.front/app/community/[cid]/videoconference/[id]/page.tsx rename to apps/xi.front/app/communities/[community-id]/channels/[channel-id]/videoconference/page.tsx index 7271548e..1c5db108 100644 --- a/apps/xi.front/app/community/[cid]/videoconference/[id]/page.tsx +++ b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/videoconference/page.tsx @@ -14,7 +14,7 @@ export default function VideoConferenceInCommunity({ params }: { params: { vid: const token = useMainSt((state) => state.token); React.useEffect(() => { - getToken(params.vid); + getToken(params['[channel-id]']); }, []); return ( @@ -22,7 +22,7 @@ export default function VideoConferenceInCommunity({ params }: { params: { vid: {token === null ? ( <>

Видеоконференция

-

{`id: ${params.vid}`}

+

{`id: ${params['[channel-id]']}`}

) : ( diff --git a/apps/xi.front/app/community/[cid]/home/page.tsx b/apps/xi.front/app/communities/[community-id]/home/page.tsx similarity index 100% rename from apps/xi.front/app/community/[cid]/home/page.tsx rename to apps/xi.front/app/communities/[community-id]/home/page.tsx diff --git a/apps/xi.front/app/community/layout.tsx b/apps/xi.front/app/communities/layout.tsx similarity index 100% rename from apps/xi.front/app/community/layout.tsx rename to apps/xi.front/app/communities/layout.tsx diff --git a/apps/xi.front/app/invite/[iid]/page.tsx b/apps/xi.front/app/invite/[iid]/page.tsx index 72095e70..56bd26aa 100644 --- a/apps/xi.front/app/invite/[iid]/page.tsx +++ b/apps/xi.front/app/invite/[iid]/page.tsx @@ -78,7 +78,7 @@ export default function InvitePage({ params }: { params: { iid: string } }) { const date = useRef(new Date()); const onSubmit = () => { - redirect('/community/1/home'); + redirect('/communities/1/home'); }; return ( diff --git a/apps/xi.front/app/providers.tsx b/apps/xi.front/app/providers.tsx index 9e972b9c..39241e5f 100644 --- a/apps/xi.front/app/providers.tsx +++ b/apps/xi.front/app/providers.tsx @@ -5,6 +5,7 @@ import { redirect, usePathname } from 'next/navigation'; import { ReactNode, useEffect } from 'react'; import { Toaster } from 'sonner'; import { useMainSt } from 'pkg.stores'; +// import { useSocketIO } from 'pkg.utils'; import Load from './load'; const mapsOfPathsWithoutRedirect = ['/', '/signin', '/signup', '/reset-password']; @@ -28,6 +29,49 @@ type AuthProviderT = { children: ReactNode; }; +// const SocketProvider = ({ children }: { children: ReactNode }) => { +// const socket = useSocketIO(); +// const isLogin = useMainSt((state) => state.isLogin); + +// useEffect(() => { +// if (!socket.connected && isLogin) { +// socket.connect(); +// } + +// socket?.on('connect', () => { +// console.info('SIO connect', socket?.id); +// }); + +// socket?.on('disconnect', () => { +// console.info('SIO disconnect', socket?.id); +// }); + +// socket?.on('error', () => { +// toast('Ошибка вебсокета'); +// }); + +// socket?.on('connect_error', (error) => { +// if (socket.active) { +// toast('Ошибка вебсокета, автоматическое переподключение'); +// // temporary failure, the socket will automatically try to reconnect +// } else { +// toast('Ошибка вебсокета, переподключение'); +// socket.connect(); +// // the connection was denied by the server +// // in that case, `socket.connect()` must be manually called in order to reconnect +// console.log(error.message); +// } +// }); + +// return () => { +// socket?.off(); +// socket?.disconnect(); +// }; +// }, []); + +// return children; +// }; + const AuthProvider = ({ children }: AuthProviderT) => { const pathname = usePathname(); @@ -57,7 +101,7 @@ const AuthProvider = ({ children }: AuthProviderT) => { onboardingStage === 'completed' && welcomePagesPaths.includes(pathname) ) { - redirect('/community/1/home'); + redirect('/communities/1/home'); } if ( @@ -87,7 +131,10 @@ export const Providers = ({ children }: ProvidersT) => { return ( - {children} + + {/* {children} */} + {children} + ); }; diff --git a/apps/xi.front/app/welcome/final/page.tsx b/apps/xi.front/app/welcome/final/page.tsx index 0e1946ef..5f644ef0 100644 --- a/apps/xi.front/app/welcome/final/page.tsx +++ b/apps/xi.front/app/welcome/final/page.tsx @@ -19,7 +19,7 @@ export default function WelcomeFinal() { const handleNext = () => { updateUser({ onboardingStage: 'completed' }); - router.push('/community/1/home'); + router.push('/communities/1/home'); }; return ( @@ -39,7 +39,7 @@ export default function WelcomeFinal() { Добро пожаловать!
diff --git a/apps/xi.front/next.config.js b/apps/xi.front/next.config.js index 44d24f45..85a7e5b1 100644 --- a/apps/xi.front/next.config.js +++ b/apps/xi.front/next.config.js @@ -63,6 +63,9 @@ const nextConfig = { '@xipkg/label', '@xipkg/tabs', '@xipkg/toggle', + '@xipkg/datepicker', + '@xipkg/popover', + '@xipkg/calendar', ], compiler: { removeConsole: process.env.NODE_ENV !== 'development', diff --git a/apps/xi.front/public/sw.js b/apps/xi.front/public/sw.js index 16c5d384..d49adff3 100644 --- a/apps/xi.front/public/sw.js +++ b/apps/xi.front/public/sw.js @@ -1 +1 @@ -if(!self.define){let e,s={};const a=(a,c)=>(a=new URL(a+".js",c).href,s[a]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=a,e.onload=s,document.head.appendChild(e)}else e=a,importScripts(a),s()})).then((()=>{let e=s[a];if(!e)throw new Error(`Module ${a} didn’t register its module`);return e})));self.define=(c,i)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let t={};const o=e=>a(e,n),r={module:{uri:n},exports:t,require:o};s[n]=Promise.all(c.map((e=>r[e]||o(e)))).then((e=>(i(...e),t)))}}define(["./workbox-c9018aa3"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"b4ef6d6c2bfc3f1e9d931bacc21af06b"},{url:"/_next/static/7QxPzkAE3KeqyNLNkyaMB/_buildManifest.js",revision:"5ff242c7208fa2e7a70b81269c90f396"},{url:"/_next/static/7QxPzkAE3KeqyNLNkyaMB/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/1053-44fe7b4ca6e555f3.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/1217.ea442cae48ac7a5d.js",revision:"ea442cae48ac7a5d"},{url:"/_next/static/chunks/1733-7c967c852c07327a.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/1dd3208c-8e56e9065b6e109a.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/2024-8ddcb9a8c6023751.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/2128.d4c72db42cb86047.js",revision:"d4c72db42cb86047"},{url:"/_next/static/chunks/2688-813bb629ea27f374.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/2884-ac760e302d30491d.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/3659.de634ca3259e6ebd.js",revision:"de634ca3259e6ebd"},{url:"/_next/static/chunks/3785-dc49dd77a413abe5.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/395.e884f2af038ab07c.js",revision:"e884f2af038ab07c"},{url:"/_next/static/chunks/39af6c14.24fe2c9a34dd7f5b.js",revision:"24fe2c9a34dd7f5b"},{url:"/_next/static/chunks/4241-156740fc3c53bbed.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/4269-9f82344a8418c342.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/4274-5387b300b50e8faa.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/5013-f0450ffcb394e4e0.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/5268-bdc3057cae7194d8.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/5441-2065029bb32775b6.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/6072-81c59ac451b0cb61.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/7175.1b04d716315a0cea.js",revision:"1b04d716315a0cea"},{url:"/_next/static/chunks/768-d518ba315c6266b5.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/794.12cb24796a42b3e8.js",revision:"12cb24796a42b3e8"},{url:"/_next/static/chunks/8190.2f6fab86029be2bd.js",revision:"2f6fab86029be2bd"},{url:"/_next/static/chunks/9724-5c146ab5496f1db2.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/_not-found-bb12889ccf863249.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/community/%5Bcid%5D/announce/%5Bid%5D/page-5d361b4fc4a3f518.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/community/%5Bcid%5D/editor/%5Bid%5D/page-22a3960de2357053.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/community/%5Bcid%5D/home/page-98380ee34fc165d4.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/community/%5Bcid%5D/videoconference/%5Bid%5D/page-2a2274457a58bc76.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/community/layout-0fd7d1057709494c.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/confirm-email/%5Bid%5D/page-41928293bce38cd2.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/error-3892d6bfc1cba415.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/global-error-133e9df8b4b50b1f.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/layout-537a2f3b8b2a830f.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/page-548fee8018e31300.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/reset-password/%5Bid%5D/page-ffa21a0b47bbc9e7.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/reset-password/page-7c0d97c0d9094cfc.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/signin/page-2917cf63c56e2e7e.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/signup/page-928838de85581899.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/welcome/community-create/page-6cf44449a69b95d3.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/welcome/community-invite/page-a4d245975c04827c.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/welcome/community/page-d71dd95bec40e590.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/welcome/final/page-d66a29c96cdeb8d9.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/app/welcome/user-info/page-c118f8ed5a253967.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/b6b9d1ec.79e82b7dabe1a5dc.js",revision:"79e82b7dabe1a5dc"},{url:"/_next/static/chunks/b7bbbec9.782e257b60bd3e90.js",revision:"782e257b60bd3e90"},{url:"/_next/static/chunks/framework-d8458ae884c231d6.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/main-0f9c997c5f3e9fb4.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/main-app-123b71ab1fcb5b4f.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/pages/_app-013031cb62eb513d.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/pages/_error-a65490bee5b09197.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js",revision:"837c0df77fd5009c9e46d446188ecfd0"},{url:"/_next/static/chunks/webpack-4af1b238ed8cedb6.js",revision:"7QxPzkAE3KeqyNLNkyaMB"},{url:"/_next/static/css/2b14853e15a24ad7.css",revision:"2b14853e15a24ad7"},{url:"/_next/static/css/d38261e715b3739d.css",revision:"d38261e715b3739d"},{url:"/_next/static/media/05a31a2ca4975f99-s.woff2",revision:"f1b44860c66554b91f3b1c81556f73ca"},{url:"/_next/static/media/513657b02c5c193f-s.p.woff2",revision:"c4eb7f37bc4206c901ab08601f21f0f2"},{url:"/_next/static/media/51ed15f9841b9f9d-s.woff2",revision:"bb9d99fb9bbc695be80777ca2c1c2bee"},{url:"/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2",revision:"74c3556b9dad12fb76f84af53ba69410"},{url:"/_next/static/media/d6b16ce4a6175f26-s.woff2",revision:"dd930bafc6297347be3213f22cc53d3e"},{url:"/_next/static/media/ec159349637c90ad-s.woff2",revision:"0e89df9522084290e01e4127495fae99"},{url:"/_next/static/media/fd4db3eb5472fc27-s.woff2",revision:"71f3fcaf22131c3368d9ec28ef839831"},{url:"/assets/avatarrep.svg",revision:"4277856ede8073aed18e907473ccb16b"},{url:"/assets/brand/idlogo-default-dark.svg",revision:"b72b287391a7944409bd220aaef82763"},{url:"/assets/brand/idlogo-default-light.svg",revision:"f565500e24bc57cae2f52826f81b3e05"},{url:"/assets/brand/navigationlogo-default-dark.svg",revision:"57ef947eb72c3d4c82b0a636a860edf7"},{url:"/assets/brand/navigationlogo-default-light.svg",revision:"a15444008bc500a7f70fe6e8f9633ed2"},{url:"/assets/brand/navigationlogo-small-dark.svg",revision:"2988496d2e57ac969eaee0f66321501e"},{url:"/assets/brand/navigationlogo-small-light.svg",revision:"9be513feb04cf34e1ccf6aa2be706b5c"},{url:"/assets/community-home-page/change-community-screenshot.svg",revision:"7c1c1ceacbaf5d97d059fcfa0f24eb7a"},{url:"/assets/community-home-page/left-menu-screenshot.svg",revision:"a3597008a1f65a4b0e1432704e8d90cb"},{url:"/assets/community-home-page/manual-icon.svg",revision:"99d1181494955665822afd358d7cff80"},{url:"/assets/community-home-page/roles-screenshot.svg",revision:"6d2b9cfdb9243b230a5a9b5164f149bd"},{url:"/assets/community-home-page/support-box-heart.svg",revision:"f36be2899d56ed629224f7389b3c025f"},{url:"/assets/community-home-page/tg-filled-icon.svg",revision:"1b806891696de69b4276dc73bf85956a"},{url:"/assets/icons/apple-touch-icon-120x120-precomposed.png",revision:"a4c255fea139db3f9ed1fa8ee41d740e"},{url:"/assets/icons/apple-touch-icon-120x120.png",revision:"c1eb7682cfae37803b8c8a3f0c9023a3"},{url:"/assets/icons/apple-touch-icon-152x152-precomposed.png",revision:"f08c10a0bbd03b23e3aa2df8a7f28e58"},{url:"/assets/icons/apple-touch-icon-152x152.png",revision:"a9a10a1b6e85a906691b3ee61a81d64b"},{url:"/assets/icons/apple-touch-icon-180x180-precomposed.png",revision:"8d2663ab80b84b1363da506a3dbcd2e0"},{url:"/assets/icons/apple-touch-icon-180x180.png",revision:"54938157042b9e94517bf7332e6dc7fc"},{url:"/assets/icons/apple-touch-icon-60x60-precomposed.png",revision:"e1cf9f51d7b7c706b79c196b826204de"},{url:"/assets/icons/apple-touch-icon-60x60.png",revision:"85ed82806641b3de9246334d43581ad9"},{url:"/assets/icons/apple-touch-icon-76x76-precomposed.png",revision:"e6c2fdd100be720b0edceca3f9a24662"},{url:"/assets/icons/apple-touch-icon-76x76.png",revision:"5a2363031dafad468d3a52e0f3a7c1eb"},{url:"/assets/icons/apple-touch-icon-precomposed.png",revision:"8d2663ab80b84b1363da506a3dbcd2e0"},{url:"/assets/icons/apple-touch-icon.png",revision:"54938157042b9e94517bf7332e6dc7fc"},{url:"/assets/icons/favicon-16x16.png",revision:"9b9c3bae0d66acae5035e72062ed9786"},{url:"/assets/icons/favicon-32x32.png",revision:"98e18c86655c72a2ee389b5f9d9f52c7"},{url:"/assets/icons/icon-144x144.png",revision:"c8b04135f67230d873a17dbe48037192"},{url:"/assets/icons/icon-192x192.png",revision:"5b009d152da14f621c3d58bfd0d96c93"},{url:"/assets/icons/icon-256x256.png",revision:"3e9cdcfe679d8188e2b360e313160fe0"},{url:"/assets/icons/icon-36x36.png",revision:"6cba026644288af5b1c9228e5e3eb8c6"},{url:"/assets/icons/icon-384x384.png",revision:"91912f5112c359f018046cc507adc9c5"},{url:"/assets/icons/icon-48x48.png",revision:"17f1219d11082910026ded56d610e1cc"},{url:"/assets/icons/icon-512x512.png",revision:"c2f0746e098e924b2bf0017432a3059b"},{url:"/assets/icons/icon-72x72.png",revision:"1e4f074faf2f924d2552db62d792b769"},{url:"/assets/icons/icon-96x96.png",revision:"19d956b0fef5336f51aa5ddfb62aadb5"},{url:"/assets/icons/mstile-144x144.png",revision:"f3b246ca663e3872c2c5e3c2c8328f58"},{url:"/assets/icons/mstile-150x150.png",revision:"2fe7e49a8ca19dd20d406569f83b2284"},{url:"/assets/icons/mstile-310x150.png",revision:"8b8b07cce22acee6f864658edbfaa7a3"},{url:"/assets/icons/mstile-310x310.png",revision:"9dc38c0afd454e811ab5c792fe9c01b9"},{url:"/assets/icons/mstile-70x70.png",revision:"c18b9fb768c5e03f4a53a594e617d16b"},{url:"/assets/icons/safari-pinned-tab.svg",revision:"5abcd4e192369d5df81a9210f53642b7"},{url:"/assets/welcome/community-add.png",revision:"87a7310d1105e3e2fac883d679c9b082"},{url:"/assets/welcome/community.png",revision:"5539467569ca4016a37ca14c7183d1a5"},{url:"/assets/welcome/final.png",revision:"2920aab69ae54b863976213ab22265c0"},{url:"/assets/welcome/user-info.png",revision:"42b8adbdbd02b52bedb482ac39203781"},{url:"/favicon-for-dark.svg",revision:"6825e74a748ef61f38418d0a77983974"},{url:"/favicon-for-light.svg",revision:"b1a97d320dba69a91e06391d5db81743"},{url:"/favicon.ico",revision:"501d94411940282fef1a69e6a8c1c0d7"},{url:"/manifest.webmanifest",revision:"0e07ef18af0502a5ea38551e362c104a"},{url:"/test/avatar.svg",revision:"3b81fe6bbfcc5a70c922ff470c070f44"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:a,state:c})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")}),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")}),new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>!(self.origin===e.origin)),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")})); +if(!self.define){let e,s={};const c=(c,i)=>(c=new URL(c+".js",i).href,s[c]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=c,e.onload=s,document.head.appendChild(e)}else e=c,importScripts(c),s()})).then((()=>{let e=s[c];if(!e)throw new Error(`Module ${c} didn’t register its module`);return e})));self.define=(i,n)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(s[a])return;let t={};const o=e=>c(e,a),r={module:{uri:a},exports:t,require:o};s[a]=Promise.all(i.map((e=>r[e]||o(e)))).then((e=>(n(...e),t)))}}define(["./workbox-c9018aa3"],(function(e){"use strict";importScripts(),self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"/_next/app-build-manifest.json",revision:"d4d58d24cbc2a342ff64ddedd448c3d4"},{url:"/_next/static/WOncwv67BJ0LR3PCTpiCC/_buildManifest.js",revision:"569996067c04eca7cdc4c0165ca2b6aa"},{url:"/_next/static/WOncwv67BJ0LR3PCTpiCC/_ssgManifest.js",revision:"b6652df95db52feb4daf4eca35380933"},{url:"/_next/static/chunks/1053-f07bbe4588169e43.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/1702-0827eaa477eefc2b.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/1813.52b1e5e8146feb77.js",revision:"52b1e5e8146feb77"},{url:"/_next/static/chunks/1874.f26ca3f14362fc3c.js",revision:"f26ca3f14362fc3c"},{url:"/_next/static/chunks/1dd3208c-2c5c2056538bb13d.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/2024-228d3998177bf076.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/2056-b4db8f2d0dbab3ad.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/2688-790fae1dafea03bf.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/2691.4fbb7ab2616fae53.js",revision:"4fbb7ab2616fae53"},{url:"/_next/static/chunks/2697.367d22c31076e045.js",revision:"367d22c31076e045"},{url:"/_next/static/chunks/2884-88af1a5926f29c98.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/29-9236fbd69a41feee.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/3146-90f5e567d7c912d6.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/354.c779c854b8f9643f.js",revision:"c779c854b8f9643f"},{url:"/_next/static/chunks/3659.d9e5025bd6a96109.js",revision:"d9e5025bd6a96109"},{url:"/_next/static/chunks/395.0ec85c4e0695c6c7.js",revision:"0ec85c4e0695c6c7"},{url:"/_next/static/chunks/39af6c14.11f39a01f25fae29.js",revision:"11f39a01f25fae29"},{url:"/_next/static/chunks/4241-fc917253435fb067.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/4269-046158a8426b107b.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/5013-1bd0a6f9a0c92ccb.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/5069.ae2b2fbb05accc3d.js",revision:"ae2b2fbb05accc3d"},{url:"/_next/static/chunks/5268-9a21eca754417c2a.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/5441-d027ecdb196a7de7.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/5496.76b63fecbbd3acd3.js",revision:"76b63fecbbd3acd3"},{url:"/_next/static/chunks/6112-a05fc378b78ba8d5.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/768-4de75980b8da25d1.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/794.b48b9d7527142a43.js",revision:"b48b9d7527142a43"},{url:"/_next/static/chunks/8781-74a3cd5bde92cac5.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/9724-bc5683acfe640979.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/973.96bc0bcc578656d2.js",revision:"96bc0bcc578656d2"},{url:"/_next/static/chunks/app/_not-found-5c230891ed937e49.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/channels/%5Bchannel-id%5D/announce/page-ba9101737d44c3c9.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/channels/%5Bchannel-id%5D/editor/page-7156e8bda0782e9a.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/channels/%5Bchannel-id%5D/post/page-9055362dfbc53d5b.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/channels/%5Bchannel-id%5D/posts/page-f0e04b1f8a7ce9ad.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/channels/%5Bchannel-id%5D/videoconference/page-f93d4214d0152ecb.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/%5Bcommunity-id%5D/home/page-54cadeb8ef3314ad.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/communities/layout-b257ef2992513cb1.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/confirm-email/%5Bid%5D/page-b83b281e8d0658e9.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/error-cf82b7c1d3338748.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/global-error-8c5ef5c582a545b3.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/invite/%5Biid%5D/page-9e23bca64da9d0fa.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/layout-1d3ea9651c69f13d.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/page-2980776f4d0834d2.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/reset-password/%5Bid%5D/page-ec088eb487fa5ae0.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/reset-password/page-b541f97b21b8a089.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/signin/page-ad0d127a207ceabe.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/signup/page-036abdcd6d82238e.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/welcome/community-create/page-19fed0adbfbc6d63.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/welcome/community-invite/page-5dd28ceea55dd1a6.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/welcome/community/page-6a1489bef326ec6d.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/welcome/final/page-146dbeddd65cf63a.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/app/welcome/user-info/page-8e8d3febf71cd782.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/b6b9d1ec.a94ef09410b2058d.js",revision:"a94ef09410b2058d"},{url:"/_next/static/chunks/b7bbbec9.6e54dda2d262d74a.js",revision:"6e54dda2d262d74a"},{url:"/_next/static/chunks/framework-37fc2906c9012f20.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/main-04336e6f45d21889.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/main-app-2fc07588db1645a9.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/pages/_app-bcd0fff46a6634e8.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/pages/_error-eb96b7a312ebaea0.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js",revision:"837c0df77fd5009c9e46d446188ecfd0"},{url:"/_next/static/chunks/webpack-91946d1dda5fa254.js",revision:"WOncwv67BJ0LR3PCTpiCC"},{url:"/_next/static/css/77633f47cb821f20.css",revision:"77633f47cb821f20"},{url:"/_next/static/css/d38261e715b3739d.css",revision:"d38261e715b3739d"},{url:"/_next/static/css/f9a059cbab2fa210.css",revision:"f9a059cbab2fa210"},{url:"/_next/static/media/05a31a2ca4975f99-s.woff2",revision:"f1b44860c66554b91f3b1c81556f73ca"},{url:"/_next/static/media/513657b02c5c193f-s.p.woff2",revision:"c4eb7f37bc4206c901ab08601f21f0f2"},{url:"/_next/static/media/51ed15f9841b9f9d-s.woff2",revision:"bb9d99fb9bbc695be80777ca2c1c2bee"},{url:"/_next/static/media/c9a5bc6a7c948fb0-s.p.woff2",revision:"74c3556b9dad12fb76f84af53ba69410"},{url:"/_next/static/media/d6b16ce4a6175f26-s.woff2",revision:"dd930bafc6297347be3213f22cc53d3e"},{url:"/_next/static/media/ec159349637c90ad-s.woff2",revision:"0e89df9522084290e01e4127495fae99"},{url:"/_next/static/media/fd4db3eb5472fc27-s.woff2",revision:"71f3fcaf22131c3368d9ec28ef839831"},{url:"/assets/avatarrep.svg",revision:"4277856ede8073aed18e907473ccb16b"},{url:"/assets/avatarrep2.svg",revision:"f0340143227cc3546b667fd9c4d1e1d8"},{url:"/assets/avatarrep3.svg",revision:"42ed55fd57254c4ca8e750fb808b3b3f"},{url:"/assets/brand/idlogo-default-dark.svg",revision:"b72b287391a7944409bd220aaef82763"},{url:"/assets/brand/idlogo-default-light.svg",revision:"f565500e24bc57cae2f52826f81b3e05"},{url:"/assets/brand/navigationlogo-default-dark.svg",revision:"57ef947eb72c3d4c82b0a636a860edf7"},{url:"/assets/brand/navigationlogo-default-light.svg",revision:"a15444008bc500a7f70fe6e8f9633ed2"},{url:"/assets/brand/navigationlogo-small-dark.svg",revision:"2988496d2e57ac969eaee0f66321501e"},{url:"/assets/brand/navigationlogo-small-light.svg",revision:"9be513feb04cf34e1ccf6aa2be706b5c"},{url:"/assets/community-home-page/change-community-screenshot.svg",revision:"7c1c1ceacbaf5d97d059fcfa0f24eb7a"},{url:"/assets/community-home-page/left-menu-screenshot.svg",revision:"a3597008a1f65a4b0e1432704e8d90cb"},{url:"/assets/community-home-page/manual-icon.svg",revision:"99d1181494955665822afd358d7cff80"},{url:"/assets/community-home-page/roles-screenshot.svg",revision:"6d2b9cfdb9243b230a5a9b5164f149bd"},{url:"/assets/community-home-page/support-box-heart.svg",revision:"f36be2899d56ed629224f7389b3c025f"},{url:"/assets/community-home-page/tg-filled-icon.svg",revision:"1b806891696de69b4276dc73bf85956a"},{url:"/assets/icons/apple-touch-icon-120x120-precomposed.png",revision:"a4c255fea139db3f9ed1fa8ee41d740e"},{url:"/assets/icons/apple-touch-icon-120x120.png",revision:"c1eb7682cfae37803b8c8a3f0c9023a3"},{url:"/assets/icons/apple-touch-icon-152x152-precomposed.png",revision:"f08c10a0bbd03b23e3aa2df8a7f28e58"},{url:"/assets/icons/apple-touch-icon-152x152.png",revision:"a9a10a1b6e85a906691b3ee61a81d64b"},{url:"/assets/icons/apple-touch-icon-180x180-precomposed.png",revision:"8d2663ab80b84b1363da506a3dbcd2e0"},{url:"/assets/icons/apple-touch-icon-180x180.png",revision:"54938157042b9e94517bf7332e6dc7fc"},{url:"/assets/icons/apple-touch-icon-60x60-precomposed.png",revision:"e1cf9f51d7b7c706b79c196b826204de"},{url:"/assets/icons/apple-touch-icon-60x60.png",revision:"85ed82806641b3de9246334d43581ad9"},{url:"/assets/icons/apple-touch-icon-76x76-precomposed.png",revision:"e6c2fdd100be720b0edceca3f9a24662"},{url:"/assets/icons/apple-touch-icon-76x76.png",revision:"5a2363031dafad468d3a52e0f3a7c1eb"},{url:"/assets/icons/apple-touch-icon-precomposed.png",revision:"8d2663ab80b84b1363da506a3dbcd2e0"},{url:"/assets/icons/apple-touch-icon.png",revision:"54938157042b9e94517bf7332e6dc7fc"},{url:"/assets/icons/favicon-16x16.png",revision:"9b9c3bae0d66acae5035e72062ed9786"},{url:"/assets/icons/favicon-32x32.png",revision:"98e18c86655c72a2ee389b5f9d9f52c7"},{url:"/assets/icons/icon-144x144.png",revision:"c8b04135f67230d873a17dbe48037192"},{url:"/assets/icons/icon-192x192.png",revision:"5b009d152da14f621c3d58bfd0d96c93"},{url:"/assets/icons/icon-256x256.png",revision:"3e9cdcfe679d8188e2b360e313160fe0"},{url:"/assets/icons/icon-36x36.png",revision:"6cba026644288af5b1c9228e5e3eb8c6"},{url:"/assets/icons/icon-384x384.png",revision:"91912f5112c359f018046cc507adc9c5"},{url:"/assets/icons/icon-48x48.png",revision:"17f1219d11082910026ded56d610e1cc"},{url:"/assets/icons/icon-512x512.png",revision:"c2f0746e098e924b2bf0017432a3059b"},{url:"/assets/icons/icon-72x72.png",revision:"1e4f074faf2f924d2552db62d792b769"},{url:"/assets/icons/icon-96x96.png",revision:"19d956b0fef5336f51aa5ddfb62aadb5"},{url:"/assets/icons/mstile-144x144.png",revision:"f3b246ca663e3872c2c5e3c2c8328f58"},{url:"/assets/icons/mstile-150x150.png",revision:"2fe7e49a8ca19dd20d406569f83b2284"},{url:"/assets/icons/mstile-310x150.png",revision:"8b8b07cce22acee6f864658edbfaa7a3"},{url:"/assets/icons/mstile-310x310.png",revision:"9dc38c0afd454e811ab5c792fe9c01b9"},{url:"/assets/icons/mstile-70x70.png",revision:"c18b9fb768c5e03f4a53a594e617d16b"},{url:"/assets/icons/safari-pinned-tab.svg",revision:"5abcd4e192369d5df81a9210f53642b7"},{url:"/assets/welcome/community-add.png",revision:"87a7310d1105e3e2fac883d679c9b082"},{url:"/assets/welcome/community.png",revision:"5539467569ca4016a37ca14c7183d1a5"},{url:"/assets/welcome/final.png",revision:"2920aab69ae54b863976213ab22265c0"},{url:"/assets/welcome/user-info.png",revision:"42b8adbdbd02b52bedb482ac39203781"},{url:"/favicon-for-dark.svg",revision:"6825e74a748ef61f38418d0a77983974"},{url:"/favicon-for-light.svg",revision:"b1a97d320dba69a91e06391d5db81743"},{url:"/favicon.ico",revision:"501d94411940282fef1a69e6a8c1c0d7"},{url:"/manifest.webmanifest",revision:"0e07ef18af0502a5ea38551e362c104a"},{url:"/test/avatar.svg",revision:"3b81fe6bbfcc5a70c922ff470c070f44"}],{ignoreURLParametersMatching:[]}),e.cleanupOutdatedCaches(),e.registerRoute("/",new e.NetworkFirst({cacheName:"start-url",plugins:[{cacheWillUpdate:async({request:e,response:s,event:c,state:i})=>s&&"opaqueredirect"===s.type?new Response(s.body,{status:200,statusText:"OK",headers:s.headers}):s}]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:gstatic)\.com\/.*/i,new e.CacheFirst({cacheName:"google-fonts-webfonts",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:31536e3})]}),"GET"),e.registerRoute(/^https:\/\/fonts\.(?:googleapis)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts-stylesheets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i,new e.StaleWhileRevalidate({cacheName:"static-font-assets",plugins:[new e.ExpirationPlugin({maxEntries:4,maxAgeSeconds:604800})]}),"GET"),e.registerRoute(/\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i,new e.StaleWhileRevalidate({cacheName:"static-image-assets",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/image\?url=.+$/i,new e.StaleWhileRevalidate({cacheName:"next-image",plugins:[new e.ExpirationPlugin({maxEntries:64,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp3|wav|ogg)$/i,new e.CacheFirst({cacheName:"static-audio-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:mp4)$/i,new e.CacheFirst({cacheName:"static-video-assets",plugins:[new e.RangeRequestsPlugin,new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:js)$/i,new e.StaleWhileRevalidate({cacheName:"static-js-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:css|less)$/i,new e.StaleWhileRevalidate({cacheName:"static-style-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\/_next\/data\/.+\/.+\.json$/i,new e.StaleWhileRevalidate({cacheName:"next-data",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute(/\.(?:json|xml|csv)$/i,new e.NetworkFirst({cacheName:"static-data-assets",plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;const s=e.pathname;return!s.startsWith("/api/auth/")&&!!s.startsWith("/api/")}),new e.NetworkFirst({cacheName:"apis",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:16,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>{if(!(self.origin===e.origin))return!1;return!e.pathname.startsWith("/api/")}),new e.NetworkFirst({cacheName:"others",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:86400})]}),"GET"),e.registerRoute((({url:e})=>!(self.origin===e.origin)),new e.NetworkFirst({cacheName:"cross-origin",networkTimeoutSeconds:10,plugins:[new e.ExpirationPlugin({maxEntries:32,maxAgeSeconds:3600})]}),"GET")})); diff --git a/package-lock.json b/package-lock.json index d4cc3186..6d156890 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1854,7 +1854,8 @@ }, "node_modules/@hookform/resolvers": { "version": "3.3.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.3.4.tgz", + "integrity": "sha512-o5cgpGOuJYrd+iMKvkttOclgwRW86EsWJZZRC23prf0uU2i48Htq4PuT73AVb9ionFyZrwYEITuOFGF+BydEtQ==", "peerDependencies": { "react-hook-form": "^7.0.0" } @@ -2707,6 +2708,150 @@ } } }, + "node_modules/@radix-ui/react-popover": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.0.7.tgz", + "integrity": "sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-dismissable-layer": "1.0.5", + "@radix-ui/react-focus-guards": "1.0.1", + "@radix-ui/react-focus-scope": "1.0.4", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-popper": "1.1.3", + "@radix-ui/react-portal": "1.0.4", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-slot": "1.0.2", + "@radix-ui/react-use-controllable-state": "1.0.1", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz", + "integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-callback-ref": "1.0.1", + "@radix-ui/react-use-escape-keydown": "1.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz", + "integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-callback-ref": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.1.3.tgz", + "integrity": "sha512-cKpopj/5RHZWjrbF2846jBNacjQVwkP068DfmgrNJXpvVWrOvlAmE9xSiy5OqeE+Gi8D9fP+oDhUnPqNMY8/5w==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@floating-ui/react-dom": "^2.0.0", + "@radix-ui/react-arrow": "1.0.3", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-callback-ref": "1.0.1", + "@radix-ui/react-use-layout-effect": "1.0.1", + "@radix-ui/react-use-rect": "1.0.1", + "@radix-ui/react-use-size": "1.0.1", + "@radix-ui/rect": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-portal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz", + "integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.1.2", "license": "MIT", @@ -3177,6 +3322,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@socket.io/component-emitter": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@socket.io/component-emitter/-/component-emitter-3.1.2.tgz", + "integrity": "sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==" + }, "node_modules/@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", "license": "Apache-2.0", @@ -3839,7 +3989,7 @@ }, "node_modules/@xipkg/badge": { "version": "0.1.0", - "resolved": "http://npm.prakticum-team.ru/@xipkg/badge/-/badge-0.1.0.tgz", + "resolved": "https://registry.npmjs.org/@xipkg/badge/-/badge-0.1.0.tgz", "integrity": "sha512-AktxXVTEZc69Rn+g/IkQZs7ESeWFShC3QiqSJR1Yb0nATlhzr4i2DHoSHaARehEhdVqxzMHEq7d90rtc1xfr3g==", "dependencies": { "@xipkg/utils": "^1.0.1", @@ -3849,17 +3999,53 @@ }, "node_modules/@xipkg/button": { "version": "1.1.3", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@xipkg/button/-/button-1.1.3.tgz", + "integrity": "sha512-c41sBRi1nZ5c3wqEL6sMtn+4g58Bjf1upvLFmoBeVpyKhmXuo3Zvp1ntaD7zpbyjxdn1s4SVd/6EkmmVX0FQVQ==", + "dependencies": { + "@radix-ui/react-slot": "^1.0.2", + "@xipkg/utils": "^1.0.1", + "class-variance-authority": "^0.7.0", + "react": "^18.2.0" + } + }, + "node_modules/@xipkg/calendar": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@xipkg/calendar/-/calendar-0.0.1.tgz", + "integrity": "sha512-nwnSgclqKRNJotOpQh7yxxlX2feUnX3LJ7wlPDJPAcPW7KT3J/WaYct5O9qDKFmb6Ra2ivkJZE4OWjPkUAYlzw==", "dependencies": { "@radix-ui/react-slot": "^1.0.2", + "@xipkg/button": "1.1.3", + "@xipkg/icons": "0.9.0", "@xipkg/utils": "^1.0.1", "class-variance-authority": "^0.7.0", + "react": "^18.2.0", + "react-day-picker": "8.10.0" + } + }, + "node_modules/@xipkg/calendar/node_modules/@xipkg/icons": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.9.0.tgz", + "integrity": "sha512-vwn0/ak02kJ5GR5P8Y+MxqEDLiwb1ToylCLVobIopH2HGacs7QD063DtVlzvTRm0BHtHmrC/Rg2rF9LB/XcspA==", + "dependencies": { + "@xipkg/utils": "1.1.0", + "class-variance-authority": "0.7.0", "react": "^18.2.0" } }, + "node_modules/@xipkg/calendar/node_modules/@xipkg/utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@xipkg/utils/-/utils-1.1.0.tgz", + "integrity": "sha512-cT3t9JjGhCTwQs8A8szIl/Z4Fesmp4mcEMSdtouTWQH0e79Xn1efAT7MOUhMVopjZjAP7y/8Ps3GBVvqoDvqdg==", + "dependencies": { + "clsx": "^2.0.0", + "react": "^18.2.0", + "tailwind-merge": "^1.14.0" + } + }, "node_modules/@xipkg/checkbox": { "version": "1.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@xipkg/checkbox/-/checkbox-1.1.0.tgz", + "integrity": "sha512-Ok0SZOjkb+6E/tUIfExVRTxmhj2QKzgo3Ngz7goONsHZJeLmqZ5l2UGmTJ7mW1kyyrMZOsxlhy1J2fP4Cmocjg==", "dependencies": { "@radix-ui/react-checkbox": "1.0.4", "@xipkg/utils": "^1.0.1", @@ -3867,9 +4053,46 @@ "react": "^18.2.0" } }, + "node_modules/@xipkg/datepicker": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@xipkg/datepicker/-/datepicker-0.2.0.tgz", + "integrity": "sha512-KiNvqbgtWuDBZagH9z44XQngIC8N+CfpF3n+QnH9tooxUMTWyKL5NQOZg0eeP65BB5wcKhz1cgBtguaSJsG/fw==", + "dependencies": { + "@radix-ui/react-slot": "^1.0.2", + "@xipkg/button": "1.1.3", + "@xipkg/calendar": "0.0.1", + "@xipkg/icons": "0.9.0", + "@xipkg/popover": "1.2.0", + "@xipkg/utils": "^1.0.1", + "class-variance-authority": "^0.7.0", + "react": "^18.2.0", + "react-day-picker": "8.10.0" + } + }, + "node_modules/@xipkg/datepicker/node_modules/@xipkg/icons": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.9.0.tgz", + "integrity": "sha512-vwn0/ak02kJ5GR5P8Y+MxqEDLiwb1ToylCLVobIopH2HGacs7QD063DtVlzvTRm0BHtHmrC/Rg2rF9LB/XcspA==", + "dependencies": { + "@xipkg/utils": "1.1.0", + "class-variance-authority": "0.7.0", + "react": "^18.2.0" + } + }, + "node_modules/@xipkg/datepicker/node_modules/@xipkg/utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@xipkg/utils/-/utils-1.1.0.tgz", + "integrity": "sha512-cT3t9JjGhCTwQs8A8szIl/Z4Fesmp4mcEMSdtouTWQH0e79Xn1efAT7MOUhMVopjZjAP7y/8Ps3GBVvqoDvqdg==", + "dependencies": { + "clsx": "^2.0.0", + "react": "^18.2.0", + "tailwind-merge": "^1.14.0" + } + }, "node_modules/@xipkg/dropdown": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@xipkg/dropdown/-/dropdown-1.2.0.tgz", + "integrity": "sha512-XnEWGqGNNBfzSX4+4PhKXDWgmkbiFAzITY/J2v9RuK15UfH/4JaFmWwxF6eSekjgkf3+lZ512cIujHKPwfTVfQ==", "dependencies": { "@radix-ui/react-dropdown-menu": "2.0.5", "@xipkg/utils": "^1.0.1", @@ -3921,7 +4144,8 @@ }, "node_modules/@xipkg/form": { "version": "2.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@xipkg/form/-/form-2.0.0.tgz", + "integrity": "sha512-Qy6FFOHA/Yb6bEBoKhoIcmPKMENFddpgYU78gfD/uV/cV1H6v4octOvL+zFRknKo5c2uHXbPBVuzHjlPw0ghqA==", "dependencies": { "@hookform/resolvers": "3.3.4", "@radix-ui/react-label": "2.0.2", @@ -3949,7 +4173,7 @@ }, "node_modules/@xipkg/icons": { "version": "0.9.3", - "resolved": "http://npm.prakticum-team.ru/@xipkg/icons/-/icons-0.9.3.tgz", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.9.3.tgz", "integrity": "sha512-AKqkm1oF5j2ybEWrGrDejWInZdo0a2/nj9FubnYyhHbmUfAlnB1rX/02vjYEOMTFH+s2qweDXm3WsBntAiFPcA==", "dependencies": { "@xipkg/utils": "1.1.0", @@ -3968,7 +4192,7 @@ }, "node_modules/@xipkg/input": { "version": "0.1.1", - "resolved": "http://npm.prakticum-team.ru/@xipkg/input/-/input-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/@xipkg/input/-/input-0.1.1.tgz", "integrity": "sha512-Aa94s46Ofk6qJiri1UYFEATZoGwEciLsmLUbjDRU02Q5mlP37xjmSSF5jJjTkALS6/m1AkjzbBX21LgqS3C5kQ==", "dependencies": { "@xipkg/utils": "^1.0.1", @@ -4010,6 +4234,35 @@ "react": "^18.2.0" } }, + "node_modules/@xipkg/popover": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xipkg/popover/-/popover-1.2.0.tgz", + "integrity": "sha512-9vAusPjNCrg17k3/XMnP0HDlMasJfaO7JZNcW3GheHEJYyeC7r6IStjpe5ynhEbBXxF6SDfq1cen53o+l0ukHQ==", + "dependencies": { + "@radix-ui/react-popover": "1.0.7", + "@xipkg/icons": "^0.8.2", + "@xipkg/utils": "^1.1.0", + "react": "^18.2.0" + } + }, + "node_modules/@xipkg/popover/node_modules/@xipkg/icons": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.8.6.tgz", + "integrity": "sha512-mhF8fhh3nJ7E7bGkHxbVS9Ti5tShhsa1hVb16DZVq8cprBRXiAb8WZRDc+lXbrK/qXjOaY7bW5zLK75npWZ+uA==", + "dependencies": { + "react": "^18.2.0" + } + }, + "node_modules/@xipkg/popover/node_modules/@xipkg/utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@xipkg/utils/-/utils-1.2.3.tgz", + "integrity": "sha512-Q6MoqAAqNU+7CuRJMZXPYQbi16ULoAfdU97IEmKcFdZNmHaKy7yE+ASMXZaCXGd1RMi/K9JHkU7Qp/fBzn2OEA==", + "dependencies": { + "clsx": "^2.0.0", + "react": "^18.2.0", + "tailwind-merge": "^1.14.0" + } + }, "node_modules/@xipkg/select": { "version": "0.2.0", "license": "MIT", @@ -4044,7 +4297,8 @@ }, "node_modules/@xipkg/toggle": { "version": "0.1.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@xipkg/toggle/-/toggle-0.1.0.tgz", + "integrity": "sha512-onYLil/URvPgWsosWOPuG2FGE+gc5w0S9ZYMdRlL3yWvlTVkZUDdHhN9cPI+0QbZ5yMVQ1OnQW9Cq/xgSkTrlQ==", "dependencies": { "@radix-ui/react-switch": "1.0.3", "@xipkg/utils": "^1.0.1", @@ -5195,6 +5449,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/date-fns": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.6.0.tgz", + "integrity": "sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww==", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/debug": { "version": "4.3.4", "license": "MIT", @@ -5470,6 +5733,26 @@ "node": ">= 4" } }, + "node_modules/engine.io-client": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-6.5.3.tgz", + "integrity": "sha512-9Z0qLB0NIisTRt1DZ/8U2k12RJn8yls/nXMZLn+/N8hANT3TcYjKFKcwbw5zFQiN4NTde3TSY9zb79e1ij6j9Q==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1", + "engine.io-parser": "~5.2.1", + "ws": "~8.11.0", + "xmlhttprequest-ssl": "~2.0.0" + } + }, + "node_modules/engine.io-parser": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.2.2.tgz", + "integrity": "sha512-RcyUFKA93/CXH20l4SoVvzZfrSDMOTUS3bWVpTt2FuFP+XYrL8i8oonHP7WInRyVHXh0n/ORtoeiE1os+8qkSw==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/enhanced-resolve": { "version": "5.16.0", "license": "MIT", @@ -11923,6 +12206,10 @@ "resolved": "packages/pkg.logo", "link": true }, + "node_modules/pkg.modal.category-create": { + "resolved": "packages/pkg.modal.category-create", + "link": true + }, "node_modules/pkg.modal.change-email": { "resolved": "packages/pkg.modal.change-email", "link": true @@ -11931,6 +12218,10 @@ "resolved": "packages/pkg.modal.change-password", "link": true }, + "node_modules/pkg.modal.invite-community": { + "resolved": "packages/pkg.modal.invite-community", + "link": true + }, "node_modules/pkg.models": { "resolved": "packages/pkg.models", "link": true @@ -12343,6 +12634,19 @@ "node": ">=0.10.0" } }, + "node_modules/react-day-picker": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-8.10.0.tgz", + "integrity": "sha512-mz+qeyrOM7++1NCb1ARXmkjMkzWVh2GL9YiPbRjKe0zHccvekk4HE+0MPOZOrosn8r8zTHIIeOUXTmXRqmkRmg==", + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/gpbl" + }, + "peerDependencies": { + "date-fns": "^2.28.0 || ^3.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-dom": { "version": "18.2.0", "license": "MIT", @@ -13164,6 +13468,32 @@ "no-case": "^2.2.0" } }, + "node_modules/socket.io-client": { + "version": "4.7.5", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-4.7.5.tgz", + "integrity": "sha512-sJ/tqHOCe7Z50JCBCXrsY3I2k03iOiUe+tj1OmKeD2lXPiGH/RUCdTZFoqVyN7l1MnpIzPrGtLcijffmeouNlQ==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.2", + "engine.io-client": "~6.5.2", + "socket.io-parser": "~4.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/socket.io-parser": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.2.4.tgz", + "integrity": "sha512-/GbIKmo8ioc+NIWIhwdecY0ge+qVBSMdgxGygevmdHj24bsfgtCmcUUcQ5ZzcylGFHsN3k4HB4Cgkl96KVnuew==", + "dependencies": { + "@socket.io/component-emitter": "~3.1.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/socks": { "version": "2.8.1", "dev": true, @@ -14843,10 +15173,38 @@ "version": "1.0.2", "license": "ISC" }, + "node_modules/ws": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.11.0.tgz", + "integrity": "sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xi.front": { "resolved": "apps/xi.front", "link": true }, + "node_modules/xmlhttprequest-ssl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-2.0.0.tgz", + "integrity": "sha512-QKxVRxiRACQcVuQEYFsI1hhkrMlrXHPegbbd1yn9UHOmRxY+si12nQYzri3vbzt8VdTTRviqcKxcyllFas5z2A==", + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/yallist": { "version": "3.1.1", "license": "ISC" @@ -14884,7 +15242,8 @@ }, "node_modules/zod": { "version": "3.22.4", - "license": "MIT", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", "funding": { "url": "https://github.com/sponsors/colinhacks" } @@ -14977,7 +15336,7 @@ "@xipkg/icons": "0.8.4", "@xipkg/input": "0.1.1", "@xipkg/label": "0.0.9", - "@xipkg/modal": "1.1.2", + "@xipkg/modal": "^2.1.0", "next": "^13.5.6", "react": "^18.2.0" }, @@ -14999,6 +15358,18 @@ "react": "^18.2.0" } }, + "packages/pkg.community.channel-create/node_modules/@xipkg/modal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@xipkg/modal/-/modal-2.1.0.tgz", + "integrity": "sha512-j97rhgEWIj1MMFp+3Tb7GaCvkkGdQitZhtNeY5bWuuQc/onM9G3LcyFnbYnhNqbYrx8xoikCkyvD2ucoX2FY2Q==", + "dependencies": { + "@radix-ui/react-dialog": "1.0.4", + "@xipkg/icons": "^0.8.2", + "@xipkg/utils": "^1.0.1", + "lucide-react": "0.276.0", + "react": "^18.2.0" + } + }, "packages/pkg.community.settings": { "version": "0.0.0", "license": "MIT", @@ -15074,6 +15445,34 @@ "tailwind-merge": "^1.14.0" } }, + "packages/pkg.form.category-create": { + "version": "0.0.0", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@xipkg/button": "^1.2.0", + "@xipkg/form": "^2.0.0", + "@xipkg/input": "^0.1.1", + "@xipkg/modal": "^1.5.0", + "@xipkg/toggle": "^0.1.0", + "next": "^13.5.6", + "react": "^18.2.0" + }, + "devDependencies": { + "@types/node": "^20.3.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@xipkg/eslint": "1.4.0", + "@xipkg/tailwind": "0.3.6", + "@xipkg/typescript": "latest", + "eslint-config-custom": "*", + "typescript": "^5.4.2" + }, + "peerDependencies": { + "@hookform/resolvers": "^3.1.1", + "react-hook-form": "^7.0.0" + } + }, "packages/pkg.form.new-password": { "version": "0.0.0", "license": "MIT", @@ -15258,6 +15657,77 @@ "integrity": "sha512-TQUnUh5f1IgOqBietMXFp1NQVRQBy1CVB7k0Mpq0mEhe92yqt7dHU0R/Pnm18GIIM71tBAsQwnvrG3E2mGUonA==", "dev": true }, + "packages/pkg.modal.category-create": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "@xipkg/button": "^1.2.0", + "@xipkg/checkbox": "^2.0.0", + "@xipkg/form": "^2.0.0", + "@xipkg/icons": "^0.8.6", + "@xipkg/input": "^0.1.1", + "@xipkg/modal": "^2.1.0", + "@xipkg/toggle": "^0.1.0", + "next": "^13.5.6", + "react": "^18.2.0" + }, + "devDependencies": { + "@types/node": "^20.3.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@xipkg/eslint": "1.4.0", + "@xipkg/tailwind": "0.3.6", + "@xipkg/typescript": "latest", + "eslint-config-custom": "*", + "typescript": "^5.4.2" + }, + "peerDependencies": { + "@hookform/resolvers": "^3.1.1", + "react-hook-form": "^7.0.0" + } + }, + "packages/pkg.modal.category-create/node_modules/@xipkg/button": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xipkg/button/-/button-1.2.0.tgz", + "integrity": "sha512-IGbqd79HhQdl+kAoVJARRlfoImkzeSXvZ5p9aMdrknfN8i3NDUXl33gf4tPxt/xWK0Av/jaq3kjUyRe+8U4Hww==", + "dependencies": { + "@radix-ui/react-slot": "^1.0.2", + "@xipkg/utils": "^1.0.1", + "class-variance-authority": "^0.7.0", + "react": "^18.2.0" + } + }, + "packages/pkg.modal.category-create/node_modules/@xipkg/checkbox": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@xipkg/checkbox/-/checkbox-2.0.0.tgz", + "integrity": "sha512-HXdGnAkBiK5PBdBI0Y8bzZoFqOLj5RpvWB7K/bezjXYqoRbO4/Ng4VwH6NVG0ftxYnJoJkrOI14LW7RXJ2+kZg==", + "dependencies": { + "@radix-ui/react-checkbox": "1.0.4", + "@xipkg/utils": "^1.0.1", + "lucide-react": "0.276.0", + "react": "^18.2.0" + } + }, + "packages/pkg.modal.category-create/node_modules/@xipkg/icons": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.8.6.tgz", + "integrity": "sha512-mhF8fhh3nJ7E7bGkHxbVS9Ti5tShhsa1hVb16DZVq8cprBRXiAb8WZRDc+lXbrK/qXjOaY7bW5zLK75npWZ+uA==", + "dependencies": { + "react": "^18.2.0" + } + }, + "packages/pkg.modal.category-create/node_modules/@xipkg/modal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@xipkg/modal/-/modal-2.1.0.tgz", + "integrity": "sha512-j97rhgEWIj1MMFp+3Tb7GaCvkkGdQitZhtNeY5bWuuQc/onM9G3LcyFnbYnhNqbYrx8xoikCkyvD2ucoX2FY2Q==", + "dependencies": { + "@radix-ui/react-dialog": "1.0.4", + "@xipkg/icons": "^0.8.2", + "@xipkg/utils": "^1.0.1", + "lucide-react": "0.276.0", + "react": "^18.2.0" + } + }, "packages/pkg.modal.change-email": { "version": "0.0.0", "license": "MIT", @@ -15370,6 +15840,57 @@ "react-dom": "^18.0.0" } }, + "packages/pkg.modal.invite-community": { + "version": "0.0.0", + "license": "MIT", + "dependencies": { + "@hookform/resolvers": "^3.3.4", + "@xipkg/badge": "^0.1.0", + "@xipkg/button": "^1.1.3", + "@xipkg/datepicker": "^0.2.0", + "@xipkg/dropdown": "^1.2.0", + "@xipkg/form": "^2.0.0", + "@xipkg/icons": "^0.8.6", + "@xipkg/input": "^0.1.1", + "@xipkg/modal": "^1.5.0", + "@xipkg/popover": "^1.2.0", + "date-fns": "^3.6.0", + "next": "^13.5.6", + "next-themes": "^0.2.1", + "react": "^18.2.0", + "zod": "^3.22.4" + }, + "devDependencies": { + "@types/node": "^20.3.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@xipkg/eslint": "1.4.0", + "@xipkg/tailwind": "0.3.6", + "@xipkg/typescript": "latest", + "eslint-config-custom": "*", + "typescript": "^5.4.2" + } + }, + "packages/pkg.modal.invite-community/node_modules/@xipkg/icons": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@xipkg/icons/-/icons-0.8.6.tgz", + "integrity": "sha512-mhF8fhh3nJ7E7bGkHxbVS9Ti5tShhsa1hVb16DZVq8cprBRXiAb8WZRDc+lXbrK/qXjOaY7bW5zLK75npWZ+uA==", + "dependencies": { + "react": "^18.2.0" + } + }, + "packages/pkg.modal.invite-community/node_modules/@xipkg/modal": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@xipkg/modal/-/modal-1.5.0.tgz", + "integrity": "sha512-UyzTQkL1SojCxcs7C9w4Ro+YrtWPvav7KR1A4trNX+64ZKzXpTlNLvXLTsf/rQYdELhnEnaESjrUHM4srwwmDA==", + "dependencies": { + "@radix-ui/react-dialog": "1.0.4", + "@xipkg/icons": "^0.8.2", + "@xipkg/utils": "^1.0.1", + "lucide-react": "0.276.0", + "react": "^18.2.0" + } + }, "packages/pkg.models": { "version": "0.0.0", "license": "MIT", @@ -15564,6 +16085,8 @@ "pkg.community.channel-create": "*", "pkg.community.settings": "*", "pkg.logo": "*", + "pkg.modal.category-create": "*", + "pkg.modal.invite-community": "*", "pkg.models": "*", "pkg.module.add-community": "*", "pkg.router.url": "*", @@ -15744,7 +16267,8 @@ "license": "MIT", "dependencies": { "next": "^13.5.6", - "react": "^18.2.0" + "react": "^18.2.0", + "socket.io-client": "4.7.5" }, "devDependencies": { "@types/node": "^20.3.1", diff --git a/packages/pkg.community.channel-create/CommunityChannelCreate.tsx b/packages/pkg.community.channel-create/CommunityChannelCreate.tsx index 62bc4d25..e000d8d2 100644 --- a/packages/pkg.community.channel-create/CommunityChannelCreate.tsx +++ b/packages/pkg.community.channel-create/CommunityChannelCreate.tsx @@ -1,7 +1,6 @@ -import React, { ReactNode } from 'react'; +import React from 'react'; import { Modal, - ModalTrigger, ModalContent, ModalHeader, ModalFooter, @@ -15,7 +14,8 @@ import { Button } from '@xipkg/button'; import { ActionsSheetButton } from './components/ActionsSheetButton'; interface CommunityChannelCreateT { - children: ReactNode; + open: boolean; + onOpenChange: (value: React.SetStateAction) => void; } // border-[6px] создает визуал радио-кнопки, по дизайну ширина 6px у обводки синий. const classBtnActive = 'border-[6px] border-solid border-brand-80'; @@ -46,14 +46,11 @@ const actionsSheetList = [ }, ]; -export const CommunityChannelCreate = ({ children }: CommunityChannelCreateT) => { +export const CommunityChannelCreate = ({ open, onOpenChange }: CommunityChannelCreateT) => { const [currentAction, setCurrentAction] = React.useState(null); return ( - - - {children} - + Создание канала @@ -61,7 +58,7 @@ export const CommunityChannelCreate = ({ children }: CommunityChannelCreateT) => -
+
diff --git a/packages/pkg.community.channel-create/package.json b/packages/pkg.community.channel-create/package.json index 746688c2..eb2e7b0d 100644 --- a/packages/pkg.community.channel-create/package.json +++ b/packages/pkg.community.channel-create/package.json @@ -9,21 +9,21 @@ }, "dependencies": { "@xipkg/button": "1.1.3", + "@xipkg/icons": "0.8.4", "@xipkg/input": "0.1.1", "@xipkg/label": "0.0.9", - "@xipkg/modal": "1.1.2", - "@xipkg/icons": "0.8.4", + "@xipkg/modal": "^2.1.0", "next": "^13.5.6", "react": "^18.2.0" }, "devDependencies": { - "eslint-config-custom": "*", "@types/node": "^20.3.1", "@types/react": "^18.2.14", "@types/react-dom": "^18.2.6", "@xipkg/eslint": "1.4.0", "@xipkg/tailwind": "0.3.6", "@xipkg/typescript": "latest", + "eslint-config-custom": "*", "typescript": "^5.4.2" }, "description": "Dialog box for creating a new channel", diff --git a/packages/pkg.form.signin/Signin.tsx b/packages/pkg.form.signin/Signin.tsx index ca2c74ea..f392f07d 100644 --- a/packages/pkg.form.signin/Signin.tsx +++ b/packages/pkg.form.signin/Signin.tsx @@ -75,10 +75,17 @@ export const SignIn = ({ onSignIn }: SignInT) => { formState: { errors }, } = form; + const [isButtonActive, setIsButtonActive] = React.useState(true); + const onSubmit = async (data: z.infer) => { trigger(); + setIsButtonActive(false); const status = await onSignIn({ ...data, setError }); - if (status === 200) router.push('/community/1/home'); + if (status === 200) { + router.push('/communities/1/home'); + } else { + setIsButtonActive(true); + } }; const [isPasswordShow, setIsPasswordShow] = React.useState(false); @@ -144,7 +151,7 @@ export const SignIn = ({ onSignIn }: SignInT) => { Восстановить пароль
-
+
{ Зарегистрироваться
- + { + isButtonActive ? + + :
diff --git a/packages/pkg.form.signin/package.json b/packages/pkg.form.signin/package.json index 42026c78..e2dda707 100644 --- a/packages/pkg.form.signin/package.json +++ b/packages/pkg.form.signin/package.json @@ -8,7 +8,7 @@ "lint": "eslint \"**/*.{ts,tsx}\"" }, "dependencies": { - "@xipkg/button": "1.0.3", + "@xipkg/button": "1.3.0", "@xipkg/form": "^2.0.0", "@xipkg/icons": "0.8.4", "@xipkg/input": "0.1.1", diff --git a/packages/pkg.form.signup/Signup.tsx b/packages/pkg.form.signup/Signup.tsx index 0b26b8f2..ae478cf8 100644 --- a/packages/pkg.form.signup/Signup.tsx +++ b/packages/pkg.form.signup/Signup.tsx @@ -73,10 +73,17 @@ export const SignUp = ({ onSignUp }: SignUpT) => { formState: { errors }, } = form; + const [isButtonActive, setIsButtonActive] = React.useState(true); + const onSubmit = async (data: z.infer) => { trigger(); + setIsButtonActive(false); const status = await onSignUp({ ...data, setError }); - if (status === 200) router.push('/welcome/user-info'); + if (status === 200) { + router.push('/welcome/user-info'); + } else { + setIsButtonActive(true); + } }; const [isPasswordShow, setIsPasswordShow] = React.useState(false); @@ -166,14 +173,16 @@ export const SignUp = ({ onSignUp }: SignUpT) => { )} />
-
+
Войти
- + { + isButtonActive ? + + :
diff --git a/packages/pkg.form.signup/package.json b/packages/pkg.form.signup/package.json index a4af29a1..3c98d15d 100644 --- a/packages/pkg.form.signup/package.json +++ b/packages/pkg.form.signup/package.json @@ -8,7 +8,7 @@ "lint": "eslint \"**/*.{ts,tsx}\"" }, "dependencies": { - "@xipkg/button": "1.1.3", + "@xipkg/button": "1.3.0", "@xipkg/form": "^2.0.0", "@xipkg/icons": "0.8.4", "@xipkg/input": "0.1.1", diff --git a/packages/pkg.modal.category-create/CategoryCreate.tsx b/packages/pkg.modal.category-create/CategoryCreate.tsx new file mode 100644 index 00000000..506167fe --- /dev/null +++ b/packages/pkg.modal.category-create/CategoryCreate.tsx @@ -0,0 +1,25 @@ +'use client'; + +import React from 'react'; +import * as M from '@xipkg/modal'; +import { Close } from '@xipkg/icons'; +import { Form } from './components/Form'; + +type CategoryCreatePropsT = { + open: boolean; + onOpenChange: (value: React.SetStateAction) => void; +}; + +export const CategoryCreate = ({ open, onOpenChange }: CategoryCreatePropsT) => ( + + + + + + + Создание категории + +
+ + +); diff --git a/packages/pkg.modal.category-create/components/Form.tsx b/packages/pkg.modal.category-create/components/Form.tsx new file mode 100644 index 00000000..33538b2d --- /dev/null +++ b/packages/pkg.modal.category-create/components/Form.tsx @@ -0,0 +1,145 @@ +/* eslint-disable no-irregular-whitespace */ + +import React from 'react'; +import * as z from 'zod'; +import * as M from '@xipkg/modal'; +import { zodResolver } from '@hookform/resolvers/zod'; + +import { Input } from '@xipkg/input'; +import { Button } from '@xipkg/button'; +import { Toggle } from '@xipkg/toggle'; +import { + Form as FormComponent, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + useForm, +} from '@xipkg/form'; +import { Checkbox } from '@xipkg/checkbox'; + +const FormSchema = z.object({ + title: z.string().min(1, { message: 'Поле не должно быть пустым' }), + subtitle: z.string(), + channels: z.array(z.string()).default([]), + isPrivate: z.boolean().default(false), +}); + +type FormSchemaT = z.infer; + +// Варианты каналов, которые можно добавить +const channelsOptions = ['Объявления', 'Задания', 'Видеоконференции', 'Чат со студентами']; + +export const Form = () => { + const form = useForm({ + resolver: zodResolver(FormSchema), + defaultValues: { + title: '', + subtitle: '', + channels: [], + isPrivate: false, + }, + }); + + // Функция добавления/удаления каналов из channels + const toggleChannels = (channelName: string, isChannel: boolean | string) => { + const channelsValue = form.getValues('channels'); + + if (isChannel) { + form.setValue('channels', [...channelsValue, channelName]); + return; + } + + // Если isChannel === false, удаляем указанный канал из массива + const updatedChannels = channelsValue.filter((channel) => channel !== channelName); + form.setValue('channels', updatedChannels); + }; + + const onSubmit = (values: FormSchemaT) => { + console.log(values); + }; + + return ( + + +
+ ( + + Название + + + + + )} + /> + ( + + Подзаголовок + + + + + )} + /> + ( + + Каналы + Какие каналы будут созданы автоматически +
+ {channelsOptions.map((channel) => ( + + toggleChannels(channel, isChecked)} + > +

{channel}

+
+
+ ))} +
+
+ )} + /> +
+
+

Приватная категория

+

+ Контент в данной категории будет доступен только выбранным классам и ролям +

+
+ ( + + + form.setValue('isPrivate', isChecked)} + /> + + + )} + /> +
+
+ + + + +
+ ); +}; diff --git a/packages/pkg.modal.category-create/index.tsx b/packages/pkg.modal.category-create/index.tsx new file mode 100644 index 00000000..ba996831 --- /dev/null +++ b/packages/pkg.modal.category-create/index.tsx @@ -0,0 +1 @@ +export { CategoryCreate } from './CategoryCreate'; diff --git a/packages/pkg.modal.category-create/package.json b/packages/pkg.modal.category-create/package.json new file mode 100644 index 00000000..45569925 --- /dev/null +++ b/packages/pkg.modal.category-create/package.json @@ -0,0 +1,37 @@ +{ + "name": "pkg.modal.category-create", + "version": "0.0.0", + "main": "./index.tsx", + "types": "./index.tsx", + "license": "MIT", + "scripts": { + "lint": "eslint \"**/*.{ts,tsx}\"" + }, + "dependencies": { + "@xipkg/button": "^1.2.0", + "@xipkg/checkbox": "^2.0.0", + "@xipkg/form": "^2.0.0", + "@xipkg/icons": "^0.8.6", + "@xipkg/input": "^0.1.1", + "@xipkg/modal": "^2.1.0", + "@xipkg/toggle": "^0.1.0", + "next": "^13.5.6", + "react": "^18.2.0" + }, + "devDependencies": { + "@types/node": "^20.3.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@xipkg/eslint": "1.4.0", + "@xipkg/tailwind": "0.3.6", + "@xipkg/typescript": "latest", + "eslint-config-custom": "*", + "typescript": "^5.4.2" + }, + "peerDependencies": { + "@hookform/resolvers": "^3.1.1", + "react-hook-form": "^7.0.0" + }, + "description": "modal form for creating category", + "author": "xi.effect" +} diff --git a/packages/pkg.modal.category-create/tsconfig.json b/packages/pkg.modal.category-create/tsconfig.json new file mode 100644 index 00000000..101f22f8 --- /dev/null +++ b/packages/pkg.modal.category-create/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@xipkg/typescript/react-library.json", + "include": ["*"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/pkg.modal.invite-community/InviteCommunityModal.tsx b/packages/pkg.modal.invite-community/InviteCommunityModal.tsx new file mode 100644 index 00000000..f315dc38 --- /dev/null +++ b/packages/pkg.modal.invite-community/InviteCommunityModal.tsx @@ -0,0 +1,27 @@ +'use client'; + +import React from 'react'; + +import { Close } from '@xipkg/icons'; +import * as M from '@xipkg/modal'; + +import { Form } from './components/Form'; + +type InviteCommunityModalPropsT = { + open: boolean; + onOpenChange: (value: React.SetStateAction) => void; +}; + +export const InviteCommunityModal = ({ open, onOpenChange }: InviteCommunityModalPropsT) => ( + + + + + + + Создание приглашения + +
+ + +); diff --git a/packages/pkg.modal.invite-community/components/Form.tsx b/packages/pkg.modal.invite-community/components/Form.tsx new file mode 100644 index 00000000..e9e4c9f3 --- /dev/null +++ b/packages/pkg.modal.invite-community/components/Form.tsx @@ -0,0 +1,339 @@ +/* eslint-disable no-irregular-whitespace */ + +import React, { useState } from 'react'; + +import * as z from 'zod'; +import * as M from '@xipkg/modal'; +import { format } from 'date-fns'; +import { ru } from 'date-fns/locale'; +import { zodResolver } from '@hookform/resolvers/zod'; + +import { Input } from '@xipkg/input'; +import { Button } from '@xipkg/button'; +import { Calendar, Plus } from '@xipkg/icons'; +import { DatePicker } from '@xipkg/datepicker'; +import { + Form as FormComponent, + FormControl, + FormDescription, + FormField, + FormItem, + FormLabel, + useForm, +} from '@xipkg/form'; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from '@xipkg/dropdown'; + +const RoleSchema = z.object({ + name: z.string(), + bgColorMain: z.string(), + bgColorSecondary: z.string(), +}); + +const FormSchema = z.object({ + maxUsageCount: z.string(), + date: z + .string() + .regex(/^\d{4}-\d{2}-\d{2}$/) + .nullish() + .or(z.string().max(0)), + time: z + .string() + .regex(/^([01]\d|2[0-3]):([0-5]\d)$/) + .nullish() + .or(z.string().max(0)), + roles: z.array(RoleSchema), +}); + +type FormBlockPropsT = { + setIsOpen: React.Dispatch>; +}; + +// Создаю список выбора часов для дропдауна +const timeOptions = [ + '00:00', + '01:00', + '02:00', + '03:00', + '04:00', + '05:00', + '06:00', + '07:00', + '08:00', + '09:00', + '10:00', + '11:00', + '12:00', + '13:00', + '14:00', + '15:00', + '16:00', + '17:00', + '18:00', + '19:00', + '20:00', + '21:00', + '22:00', + '23:00', +]; + +// Временный список ролей +const rolesTemplate = [ + { name: 'Администратор', bgColorMain: 'bg-violet-100', bgColorSecondary: 'bg-violet-20' }, + { name: 'Преподаватель', bgColorMain: 'bg-brand-100', bgColorSecondary: 'bg-brand-0' }, + { name: 'Студент', bgColorMain: 'bg-green-100', bgColorSecondary: 'bg-green-0' }, + { name: 'Гость', bgColorMain: 'bg-red-100', bgColorSecondary: 'bg-red-0' }, + { name: '1', bgColorMain: 'bg-gray-80', bgColorSecondary: 'bg-gray-5' }, + { name: '2', bgColorMain: 'bg-gray-80', bgColorSecondary: 'bg-gray-5' }, +]; + +// Взял типизацию из react-day-picker +type Matcher = boolean | ((date: Date) => boolean) | Date | Date[]; + +export const Form = ({ setIsOpen }: FormBlockPropsT) => { + const [date, setDate] = useState(); + const [unusedRoles, setUnusedRoles] = useState(rolesTemplate); + + const form = useForm>({ + resolver: zodResolver(FormSchema), + defaultValues: { + maxUsageCount: '', + date: '', + time: '', + roles: [], + }, + }); + + // Отключаем все предыдущие даты перед текущей + const currentDate = new Date(); + const dateMatcher: Matcher = (selectedDate: Date) => { + const today = currentDate.setHours(0, 0, 0, 0); + const selectedDay = new Date(selectedDate).setHours(0, 0, 0, 0); + return selectedDay < today; + }; + + function resetForm() { + form.reset(); + setDate(undefined); + setUnusedRoles(rolesTemplate); + } + + function onSubmit(values: z.infer) { + console.log(values); + } + + return ( + + +
+ ( + + Максимальное число использований + + Для приглашения без ограничения оставить пустым + + + { + const inputValue = event.target.value; + const onlyNumbers = inputValue.replace(/[^1-9]/g, ''); // Можно вводить только цифры + + form.setValue('maxUsageCount', onlyNumbers); + }} + /> + + + )} + /> +
+ Ограничение по времени + + Для приглашения без ограничения оставить пустым + + +
+ ( + + + { + if (selectedDate) { + form.setValue( + 'date', + format(selectedDate, 'yyyy-MM-dd', { + locale: ru, + }), + ); + setDate(selectedDate); + } + }} + > + + } + /> + + + + )} + /> + ( + + + + + + + + {timeOptions.map((option, index) => ( + { + form.setValue('time', option); + }} + > +

{option}

+
+ ))} +
+
+
+
+ )} + /> +
+
+ ( + + Роли +
+ + + + + } + /> + + + {unusedRoles.map((roleTemplate, index) => ( + { + form.setValue('roles', [...form.getValues('roles'), roleTemplate]); + setUnusedRoles(unusedRoles.filter((role) => role !== roleTemplate)); + }} + > + +

{roleTemplate.name}

+
+ ))} +
+
+
+ {form.getValues('roles').length > 0 && ( +
    + {form.getValues('roles').map((role, index) => ( +
  • + + {role.name} +
  • + ))} +
+ )} +
+
+ )} + /> +
+ +
+ + +
+ +
+ +
+ ); +}; diff --git a/packages/pkg.modal.invite-community/index.tsx b/packages/pkg.modal.invite-community/index.tsx new file mode 100644 index 00000000..f88fc856 --- /dev/null +++ b/packages/pkg.modal.invite-community/index.tsx @@ -0,0 +1 @@ +export { InviteCommunityModal } from './InviteCommunityModal'; diff --git a/packages/pkg.modal.invite-community/package.json b/packages/pkg.modal.invite-community/package.json new file mode 100644 index 00000000..4d9a8d6d --- /dev/null +++ b/packages/pkg.modal.invite-community/package.json @@ -0,0 +1,39 @@ +{ + "name": "pkg.modal.invite-community", + "version": "0.0.0", + "main": "./index.tsx", + "types": "./index.tsx", + "license": "MIT", + "scripts": { + "lint": "eslint \"**/*.{ts,tsx}\"" + }, + "dependencies": { + "@hookform/resolvers": "^3.3.4", + "@xipkg/badge": "^0.1.0", + "@xipkg/button": "^1.1.3", + "@xipkg/datepicker": "^0.2.0", + "@xipkg/dropdown": "^1.2.0", + "@xipkg/form": "^2.0.0", + "@xipkg/icons": "^0.8.6", + "@xipkg/input": "^0.1.1", + "@xipkg/modal": "^1.5.0", + "@xipkg/popover": "^1.2.0", + "date-fns": "^3.6.0", + "next": "^13.5.6", + "next-themes": "^0.2.1", + "react": "^18.2.0", + "zod": "^3.22.4" + }, + "devDependencies": { + "@types/node": "^20.3.1", + "@types/react": "^18.2.14", + "@types/react-dom": "^18.2.6", + "@xipkg/eslint": "1.4.0", + "@xipkg/tailwind": "0.3.6", + "@xipkg/typescript": "latest", + "eslint-config-custom": "*", + "typescript": "^5.4.2" + }, + "description": "modal form for invite to community", + "author": "xi.effect" +} diff --git a/packages/pkg.modal.invite-community/tsconfig.json b/packages/pkg.modal.invite-community/tsconfig.json new file mode 100644 index 00000000..101f22f8 --- /dev/null +++ b/packages/pkg.modal.invite-community/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "@xipkg/typescript/react-library.json", + "include": ["*"], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/packages/pkg.navigation/components/CategoryContainer.tsx b/packages/pkg.navigation/components/CategoryContainer.tsx index a994ed79..963728e8 100644 --- a/packages/pkg.navigation/components/CategoryContainer.tsx +++ b/packages/pkg.navigation/components/CategoryContainer.tsx @@ -1,8 +1,7 @@ -import { useMemo } from 'react'; -import { IChannel, ICategory } from './types'; +import React, { useMemo } from 'react'; import { SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import React from 'react'; +import { IChannel, ICategory } from './types'; import { Channel } from './Channel'; interface ICategoryContainer { @@ -13,12 +12,10 @@ interface ICategoryContainer { export function CategoryContainer({ category, channels, setSlideIndex }: ICategoryContainer) { const { title, subtitle, id } = category; - const channelsIds = useMemo(() => { - return channels.map((channel: IChannel) => channel.elId); - }, [channels]); + const channelsIds = useMemo(() => channels.map((channel: IChannel) => channel.elId), [channels]); const { setNodeRef, attributes, listeners, transform, transition, isDragging } = useSortable({ - id: id, + id, data: { type: 'Category', category, @@ -34,7 +31,7 @@ export function CategoryContainer({ category, channels, setSlideIndex }: ICatego if (isDragging) { return (
-
+
); } @@ -51,9 +48,9 @@ export function CategoryContainer({ category, channels, setSlideIndex }: ICatego
- {channels.map((channel: IChannel) => { - return ; - })} + {channels.map((channel: IChannel) => ( + + ))}
diff --git a/packages/pkg.navigation/components/Channel.tsx b/packages/pkg.navigation/components/Channel.tsx index 6d1b7ed3..6dc86b65 100644 --- a/packages/pkg.navigation/components/Channel.tsx +++ b/packages/pkg.navigation/components/Channel.tsx @@ -1,10 +1,13 @@ -import { ReactNode, useState } from 'react'; -import { IChannel } from './types'; +/* eslint-disable jsx-a11y/no-static-element-interactions */ +/* eslint-disable jsx-a11y/click-events-have-key-events */ +/* eslint-disable no-unused-expressions */ + +import React, { ReactNode, useState } from 'react'; import { useSortable } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; -import React from 'react'; import { useRouter } from 'next/navigation'; import { Announce, Calendar, Chat, Conference, Home, Task, Updates, Move } from '@xipkg/icons'; +import { IChannel } from './types'; interface IChannelProps { channel: IChannel; @@ -53,7 +56,7 @@ export function Channel({ channel, setSlideIndex }: IChannelProps) { if (isDragging) { return (
-
+
); } diff --git a/packages/pkg.navigation/components/CommunityItems.tsx b/packages/pkg.navigation/components/CommunityItems.tsx index 0e9e1a28..b68d5279 100644 --- a/packages/pkg.navigation/components/CommunityItems.tsx +++ b/packages/pkg.navigation/components/CommunityItems.tsx @@ -1,9 +1,8 @@ +/* eslint-disable no-param-reassign */ + 'use client'; -import { useMemo, useState } from 'react'; -import { CategoryContainer } from './CategoryContainer'; -import React from 'react'; -import { IChannel, ICategory } from './types'; +import React, { useMemo, useState } from 'react'; import { DndContext, useSensors, @@ -16,10 +15,11 @@ import { MeasuringStrategy, closestCorners, } from '@dnd-kit/core'; -import { arrayMove } from '@dnd-kit/sortable'; -import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable'; -import { Channel } from './Channel'; +import { arrayMove, SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable'; import { createPortal } from 'react-dom'; +import { CategoryContainer } from './CategoryContainer'; +import { IChannel, ICategory } from './types'; +import { Channel } from './Channel'; const defaultCategories: ICategory[] = [ { @@ -46,7 +46,7 @@ const defaultChannels: IChannel[] = [ icon: 'announce', type: 'announce', label: 'Объявления', - link: '/community/1/announce/1', + link: '/communities/1/channels/1/announce', }, { elId: '2', @@ -54,7 +54,7 @@ const defaultChannels: IChannel[] = [ type: 'task', categoryId: 'B1.2', label: 'Задания', - link: '/community/1/task/1', + link: '/communities/1/channels/2/task', }, { elId: '3', @@ -62,7 +62,7 @@ const defaultChannels: IChannel[] = [ type: 'chat', categoryId: 'B1.2', label: 'Чат', - link: '/community/1/chat/1', + link: '/communities/1/channels/3/chat', }, { elId: '4', @@ -70,7 +70,7 @@ const defaultChannels: IChannel[] = [ type: 'videoconference', categoryId: 'B1.2', label: 'Видеоконференция', - link: '/community/1/videoconference/1', + link: '/communities/1/channels/4/videoconference', }, { elId: '5', @@ -78,7 +78,7 @@ const defaultChannels: IChannel[] = [ categoryId: 'B2.0', type: 'announce', label: 'Объявления', - link: '/community/1/announce/1', + link: '/communities/1/channels/5/announce', }, { elId: '6', @@ -86,7 +86,7 @@ const defaultChannels: IChannel[] = [ type: 'task', categoryId: 'B2.0', label: 'Задания', - link: '/community/1/task/1', + link: '/communities/1/channels/6/task', }, { elId: '7', @@ -94,7 +94,7 @@ const defaultChannels: IChannel[] = [ type: 'chat', categoryId: 'B2.0', label: 'Чат', - link: '/community/1/chat/1', + link: '/communities/1/channels/7/chat', }, { elId: '8', @@ -102,7 +102,7 @@ const defaultChannels: IChannel[] = [ categoryId: 'B2.0', type: 'videoconference', label: 'Видеоконференция', - link: '/community/1/videoconference/1', + link: '/communities/1/channels/8/videoconference', }, { elId: '9', @@ -110,7 +110,7 @@ const defaultChannels: IChannel[] = [ categoryId: 'empty', type: 'home', label: 'Главная', - link: '/community/1/home', + link: '/communities/1/home', }, { elId: '10', diff --git a/packages/pkg.navigation/components/CommunityMenu.tsx b/packages/pkg.navigation/components/CommunityMenu.tsx index 1f787b1f..6cbb8e31 100644 --- a/packages/pkg.navigation/components/CommunityMenu.tsx +++ b/packages/pkg.navigation/components/CommunityMenu.tsx @@ -3,7 +3,12 @@ /* eslint-disable jsx-a11y/no-static-element-interactions */ /* eslint-disable jsx-a11y/click-events-have-key-events */ +import { Modal, ModalContent } from '@xipkg/modal'; +import { CategoryCreate } from 'pkg.modal.category-create'; +import { CommunitySettings } from 'pkg.community.settings'; import { AddCommunityModal } from 'pkg.module.add-community'; +import { CommunityChannelCreate } from 'pkg.community.channel-create'; +import { InviteCommunityModal } from 'pkg.modal.invite-community'; import { CategoryAdd, @@ -23,15 +28,12 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from '@xipkg/dropdown'; -import { CommunityChannelCreate } from 'pkg.community.channel-create'; +import Link from 'next/link'; import Image from 'next/image'; import { driver } from 'driver.js'; import 'driver.js/dist/driver.css'; -import { Modal, ModalContent } from '@xipkg/modal'; -import { CommunitySettings } from 'pkg.community.settings'; import { useParams } from 'next/navigation'; -import Link from 'next/link'; // Временный список мок-сообществ const communitiesTemplate = [ @@ -114,7 +116,7 @@ const CommunityLink = ({ }) => ( { const [isOpen, setIsOpen] = React.useState(false); const [isOpenCommunitySettings, setIsOpenCommunitySettings] = React.useState(false); + const [isInviteCommunityModalOpen, setIsInviteCommunityModalOpen] = React.useState(false); const [isAddCommunityModalOpen, setIsAddCommunityModalOpen] = React.useState(false); + const [isCategoryCreateOpen, setIsCategoryCreateOpen] = React.useState(false); + const [isCommunityChannelCreateOpen, setIsCommunityChannelCreateOpen] = React.useState(false); - // Берем [cid] из URL + // Берем community-id из URL const params = useParams(); // Делим все сообщества пользователя на то, на странице которого мы сейчас // и на остальные @@ -137,8 +142,10 @@ export const CommunityMenu = () => { const [otherCommunities, setOtherCommunities] = useState(); useEffect(() => { - const currentCommunity = communitiesTemplate.find((community) => community.id === params.cid); - const otherCommunities = communitiesTemplate.filter((community) => community.id !== params.cid); + const currentCommunity = communitiesTemplate.find( + (community) => community.id === params['community-id'], + ); + const otherCommunities = communitiesTemplate.filter((community) => community.id !== params['community-id']); setCurrentCommunity(currentCommunity); setOtherCommunities(otherCommunities); }, [params]); @@ -225,6 +232,18 @@ export const CommunityMenu = () => { + setIsCategoryCreateOpen((prev) => !prev)} + /> + setIsCommunityChannelCreateOpen((prev) => !prev)} + /> + setIsInviteCommunityModalOpen((prev) => !prev)} + /> {currentCommunity && ( <> @@ -250,12 +269,18 @@ export const CommunityMenu = () => { /> {currentCommunity.isOwner && ( <> - + Пройти обучение - + setIsInviteCommunityModalOpen((prev) => !prev)} + > Пригласить людей { - - - Создать канал - - + setIsCommunityChannelCreateOpen((prev) => !prev)} + > + Создать канал + - + setIsCategoryCreateOpen((prev) => !prev)} + > Создать категорию diff --git a/packages/pkg.navigation/components/types.ts b/packages/pkg.navigation/components/types.ts index 0af6e429..7c95cd51 100644 --- a/packages/pkg.navigation/components/types.ts +++ b/packages/pkg.navigation/components/types.ts @@ -10,4 +10,4 @@ export interface IChannel { type: string, label: string, link: string, -} \ No newline at end of file +} diff --git a/packages/pkg.navigation/package.json b/packages/pkg.navigation/package.json index 1a08eff6..f5e471a3 100644 --- a/packages/pkg.navigation/package.json +++ b/packages/pkg.navigation/package.json @@ -24,8 +24,10 @@ "sonner": "1.0.3", "pkg.router.url": "*", "pkg.community.channel-create": "*", + "pkg.modal.category-create": "*", "pkg.user.settings": "*", "pkg.community.settings": "*", + "pkg.modal.invite-community": "*", "pkg.models": "*", "pkg.logo": "*", "pkg.stores": "*", diff --git a/packages/pkg.utils/index.tsx b/packages/pkg.utils/index.tsx index 8996c7ba..668e0522 100644 --- a/packages/pkg.utils/index.tsx +++ b/packages/pkg.utils/index.tsx @@ -1,5 +1,6 @@ import { get, put, post, patch, del } from './fetch'; import { useMedia } from './useMedia'; import { useSessionStorage } from './useSessionStorage'; +import { useSocketIO } from './useSocketIO'; -export { get, put, post, patch, del, useMedia, useSessionStorage }; +export { get, put, post, patch, del, useMedia, useSessionStorage, useSocketIO }; diff --git a/packages/pkg.utils/package.json b/packages/pkg.utils/package.json index b04c3df4..0f4a9874 100644 --- a/packages/pkg.utils/package.json +++ b/packages/pkg.utils/package.json @@ -9,7 +9,8 @@ }, "dependencies": { "react": "^18.2.0", - "next": "^13.5.6" + "next": "^13.5.6", + "socket.io-client": "4.7.5" }, "devDependencies": { "eslint-config-custom": "*", diff --git a/packages/pkg.utils/useSocketIO.ts b/packages/pkg.utils/useSocketIO.ts new file mode 100644 index 00000000..c0d74d71 --- /dev/null +++ b/packages/pkg.utils/useSocketIO.ts @@ -0,0 +1,10 @@ +import { io } from 'socket.io-client'; + +export const useSocketIO = (url?: string) => { + const socket = io(url || 'https://api.xieffect.ru/', { + withCredentials: true, + transports: ['websocket', 'polling'], + }); + + return socket; +};