@hed-hog/core 0.0.292 → 0.0.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
- 'use client';
2
-
3
- import { Dashboard } from '@hed-hog/api-types';
4
- import { useApp, useQuery } from '@hed-hog/next-app-provider';
5
- import { useRouter } from 'next/navigation';
6
- import { useEffect } from 'react';
7
-
8
- export default function DashboardRedirectPage() {
9
- const router = useRouter();
10
- const { request, currentLocaleCode } = useApp();
11
-
12
- const { data: dashboardData, isLoading } = useQuery<Dashboard | null>({
13
- queryKey: ['dashboard-home-redirect', currentLocaleCode],
14
- queryFn: async () => {
15
- const response = await request<Dashboard>({
16
- url: '/dashboard-core/home',
17
- });
18
- return response.data ?? null;
19
- },
20
- });
21
-
22
- useEffect(() => {
23
- if (isLoading) return;
24
-
25
- router.replace(`/core/dashboard/${dashboardData?.slug ?? 'default'}`);
26
- }, [dashboardData?.slug, isLoading, router]);
27
-
28
- return null;
29
- }
1
+ 'use client';
2
+
3
+ import { Dashboard } from '@hed-hog/api-types';
4
+ import { useApp, useQuery } from '@hed-hog/next-app-provider';
5
+ import { useRouter } from 'next/navigation';
6
+ import { useEffect } from 'react';
7
+
8
+ export default function DashboardRedirectPage() {
9
+ const router = useRouter();
10
+ const { request, currentLocaleCode } = useApp();
11
+
12
+ const { data: dashboardData, isLoading } = useQuery<Dashboard | null>({
13
+ queryKey: ['dashboard-home-redirect', currentLocaleCode],
14
+ queryFn: async () => {
15
+ const response = await request<Dashboard>({
16
+ url: '/dashboard-core/home',
17
+ });
18
+ return response.data ?? null;
19
+ },
20
+ });
21
+
22
+ useEffect(() => {
23
+ if (isLoading) return;
24
+
25
+ router.replace(`/core/dashboard/${dashboardData?.slug ?? 'default'}`);
26
+ }, [dashboardData?.slug, isLoading, router]);
27
+
28
+ return null;
29
+ }
@@ -1,5 +1,6 @@
1
1
  'use client';
2
2
 
3
+ import dynamic from 'next/dynamic';
3
4
  import type React from 'react';
4
5
 
5
6
  import {
@@ -9,7 +10,6 @@ import {
9
10
  PaginationFooter,
10
11
  SearchBar,
11
12
  } from '@/components/entity-list';
12
- import { RichTextEditor } from '@/components/rich-text-editor';
13
13
  import {
14
14
  AlertDialog,
15
15
  AlertDialogAction,
@@ -70,6 +70,19 @@ import { useTranslations } from 'next-intl';
70
70
  import { useEffect, useState } from 'react';
71
71
  import { toast } from 'sonner';
72
72
 
73
+ const RichTextEditor = dynamic(
74
+ () =>
75
+ import('@/components/rich-text-editor').then((mod) => ({
76
+ default: mod.RichTextEditor,
77
+ })),
78
+ {
79
+ ssr: false,
80
+ loading: () => (
81
+ <div className="min-h-48 bg-muted rounded-md animate-pulse" />
82
+ ),
83
+ }
84
+ );
85
+
73
86
  interface Mail {
74
87
  id: number;
75
88
  slug: string;
@@ -779,7 +792,9 @@ export default function EmailTemplatesPage() {
779
792
  <TableHead>{t('tableSubject')}</TableHead>
780
793
  <TableHead>{t('tableVariables')}</TableHead>
781
794
  <TableHead>{t('tableUpdated')}</TableHead>
782
- <TableHead className="text-right">{t('tableActions')}</TableHead>
795
+ <TableHead className="text-right">
796
+ {t('tableActions')}
797
+ </TableHead>
783
798
  </TableRow>
784
799
  </TableHeader>
785
800
  <TableBody>
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@hed-hog/core",
3
- "version": "0.0.292",
3
+ "version": "0.0.293",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
7
- "@aws-sdk/client-s3": "^3.918.0",
8
- "@aws-sdk/s3-request-presigner": "^3.918.0",
7
+ "@aws-sdk/client-s3": "^3.1014.0",
8
+ "@aws-sdk/s3-request-presigner": "^3.1014.0",
9
9
  "@azure/storage-blob": "^12.27.0",
10
10
  "@google-cloud/storage": "^7.16.0",
11
11
  "@nestjs/axios": "*",
@@ -30,11 +30,11 @@
30
30
  "sharp": "^0.34.2",
31
31
  "speakeasy": "^2.0.0",
32
32
  "uuid": "^11.1.0",
33
- "@hed-hog/api-mail": "0.0.8",
34
- "@hed-hog/api-types": "0.0.1",
33
+ "@hed-hog/api": "0.0.4",
35
34
  "@hed-hog/api-pagination": "0.0.6",
36
35
  "@hed-hog/api-locale": "0.0.13",
37
- "@hed-hog/api": "0.0.4",
36
+ "@hed-hog/api-types": "0.0.1",
37
+ "@hed-hog/api-mail": "0.0.8",
38
38
  "@hed-hog/api-prisma": "0.0.5"
39
39
  },
40
40
  "exports": {
@@ -1,5 +1,5 @@
1
- import { PaginationDTO } from '@hed-hog/api-pagination';
2
- import { Prisma, PrismaService } from '@hed-hog/api-prisma';
1
+ import { PaginationDTO } from '@hed-hog/api-pagination';
2
+ import { Prisma, PrismaService } from '@hed-hog/api-prisma';
3
3
  import {
4
4
  BadRequestException,
5
5
  forwardRef,
@@ -8,7 +8,7 @@ import {
8
8
  Logger,
9
9
  NotFoundException,
10
10
  } from '@nestjs/common';
11
- import axios from 'axios';
11
+ import axios from 'axios';
12
12
  import { createHash } from 'crypto';
13
13
  import pdfParse from 'pdf-parse';
14
14
  import { DeleteDTO } from '../dto/delete.dto';
@@ -1,19 +1,19 @@
1
1
  import { Public, Role, User, UserOptional } from '@hed-hog/api';
2
2
  import { Locale } from '@hed-hog/api-locale';
3
- import {
4
- BadRequestException,
5
- Body,
6
- Controller,
7
- forwardRef,
3
+ import {
4
+ BadRequestException,
5
+ Body,
6
+ Controller,
7
+ forwardRef,
8
8
  Get,
9
9
  Headers,
10
10
  Inject,
11
- Ip,
12
- Post,
13
- Req,
14
- Res,
15
- UnauthorizedException,
16
- } from '@nestjs/common';
11
+ Ip,
12
+ Post,
13
+ Req,
14
+ Res,
15
+ UnauthorizedException,
16
+ } from '@nestjs/common';
17
17
  import { TokenService } from '../token/token.service';
18
18
  import { CreateWithEmailAndPasswordDTO } from '../user/dto/create-with-email-and-password.dto';
19
19
  import { UserService } from '../user/user.service';
@@ -1,14 +1,14 @@
1
1
  import { getLocaleText } from '@hed-hog/api-locale';
2
2
  import { PrismaService } from '@hed-hog/api-prisma';
3
3
  import { User } from '@hed-hog/api-types';
4
- import {
5
- BadRequestException,
6
- forwardRef,
7
- Inject,
8
- Injectable,
9
- NotFoundException,
10
- UnauthorizedException,
11
- } from '@nestjs/common';
4
+ import {
5
+ BadRequestException,
6
+ forwardRef,
7
+ Inject,
8
+ Injectable,
9
+ NotFoundException,
10
+ UnauthorizedException,
11
+ } from '@nestjs/common';
12
12
  import { ChallengeService } from '../challenge/challenge.service';
13
13
  import { MailService as MailManagerService } from '../mail/mail.service';
14
14
  import { SecurityService } from '../security/security.service';
@@ -1,7 +1,7 @@
1
- import { Prisma, PrismaService } from '@hed-hog/api-prisma';
2
- import { Injectable, Logger } from '@nestjs/common';
3
- import { Cron, CronExpression } from '@nestjs/schedule';
4
- import { SettingService } from '../setting/setting.service';
1
+ import { Prisma, PrismaService } from '@hed-hog/api-prisma';
2
+ import { Injectable, Logger } from '@nestjs/common';
3
+ import { Cron, CronExpression } from '@nestjs/schedule';
4
+ import { SettingService } from '../setting/setting.service';
5
5
 
6
6
  @Injectable()
7
7
  export class TasksService {
@@ -225,4 +225,4 @@ export class TasksService {
225
225
  `Unverified MFA with expired challenges cleaned up in ${Date.now() - startAt}ms`,
226
226
  );
227
227
  }
228
- }
228
+ }