Skip to content

Commit e12110b

Browse files
committed
Merge branch 'release/0.1.8'
2 parents 12df503 + d58d9e7 commit e12110b

File tree

16 files changed

+210
-98
lines changed

16 files changed

+210
-98
lines changed

@noctaCrdt/Interfaces.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,15 @@ export type ElementType =
1515
| "blockquote"
1616
| "hr";
1717

18-
export type AnimationType = "none" | "highlight" | "gradation";
18+
export type AnimationType =
19+
| "none"
20+
| "highlight"
21+
| "rainbow"
22+
| "fadeIn"
23+
| "slideIn"
24+
| "pulse"
25+
| "gradation"
26+
| "bounce";
1927

2028
export type TextStyleType = "bold" | "italic" | "underline" | "strikethrough";
2129

client/index.html

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="ko">
33

44
<head>
55
<meta charset="UTF-8" />
@@ -14,19 +14,13 @@
1414
<meta property="og:type" content="website" />
1515
<meta property="og:url" content="https://www.nocta.site/" />
1616
<meta property="og:title" content="Nocta" />
17-
<meta
18-
property="og:description"
19-
content="밤하늘의 별빛처럼, 자유로운 인터랙션 실시간 에디터"
20-
/>
17+
<meta property="og:description" content="밤하늘의 별빛처럼, 자유로운 인터랙션 실시간 에디터" />
2118
<meta property="og:image" content="https://www.nocta.site/images/nocta.png" />
2219

2320
<meta property="twitter:card" content="summary_large_image" />
2421
<meta property="twitter:url" content="https://www.nocta.site/" />
2522
<meta property="twitter:title" content="Nocta" />
26-
<meta
27-
property="twitter:description"
28-
content="밤하늘의 별빛처럼, 자유로운 인터랙션 실시간 에디터"
29-
/>
23+
<meta property="twitter:description" content="밤하늘의 별빛처럼, 자유로운 인터랙션 실시간 에디터" />
3024
<meta property="twitter:image" content="https://www.nocta.site/images/nocta.png" />
3125

3226
<meta name="robots" content="index, follow" />

client/src/constants/option.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ export const OPTION_CATEGORIES = {
2222
options: [
2323
{ id: "none", label: "없음" },
2424
{ id: "highlight", label: "하이라이트" },
25+
{ id: "rainbow", label: "레인보우" },
2526
{ id: "gradation", label: "그라데이션" },
27+
{ id: "fadeIn", label: "페이드 인" },
28+
{ id: "slideIn", label: "슬라이드 인" },
29+
{ id: "pulse", label: "펄스" },
30+
{ id: "bounce", label: "바운스" },
2631
] as { id: AnimationType; label: string }[],
2732
},
2833
DUPLICATE: {

client/src/features/editor/components/IconBlock/IconBlock.style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { css, cva } from "@styled-system/css";
44
export const iconContainerStyle = css({
55
display: "flex",
66
justifyContent: "center",
7-
alignItems: "center",
8-
minWidth: "24px",
7+
width: "24px",
8+
height: "24px",
99
marginRight: "8px",
1010
});
1111

client/src/features/editor/components/MenuBlock/MenuBlock.style.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ export const menuBlockStyle = css({
88
left: 0,
99
justifyContent: "center",
1010
alignItems: "center",
11-
width: "20px",
12-
height: "20px",
11+
width: "24px",
12+
height: "24px",
1313
marginLeft: "-20px",
1414
opacity: 0,
1515
transition: "opacity 0.2s ease-in-out",
Lines changed: 135 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
1+
const defaultState = {
2+
background: "transparent",
3+
opacity: 1,
4+
x: 0,
5+
y: 0,
6+
scale: 1,
7+
backgroundSize: "100% 100%",
8+
backgroundPosition: "0 0",
9+
};
10+
111
const none = {
212
initial: {
3-
background: "transparent",
13+
...defaultState,
414
},
515
animate: {
6-
background: "transparent",
16+
...defaultState,
717
},
818
};
919

1020
const highlight = {
1121
initial: {
12-
background: `linear-gradient(to right,
13-
#BFBFFF70 0%,
14-
#BFBFFF70 0%,
15-
transparent 0%,
16-
transparent 100%
17-
)`,
22+
...defaultState,
23+
background: `linear-gradient(to right,
24+
#BFBFFF70 0%,
25+
#BFBFFF70 0%,
26+
transparent 0%,
27+
transparent 100%
28+
)`,
1829
},
1930
animate: {
20-
background: `linear-gradient(to right,
21-
#BFBFFF70 0%,
22-
#BFBFFF70 100%,
23-
transparent 100%,
24-
transparent 100%
25-
)`,
31+
...defaultState,
32+
background: `linear-gradient(to right,
33+
#BFBFFF70 0%,
34+
#BFBFFF70 100%,
35+
transparent 100%,
36+
transparent 100%
37+
)`,
2638
transition: {
2739
duration: 1,
2840
ease: "linear",
2941
},
3042
},
3143
};
3244

33-
const gradation = {
45+
const rainbow = {
3446
initial: {
47+
...defaultState,
3548
background: `linear-gradient(to right,
36-
#BFBFFF 0%,
37-
#B0E2FF 50%,
38-
#FFE4E1 100%
49+
#BFBFFF 0%,
50+
#B0E2FF 50%,
51+
#FFE4E1 100%
3952
)`,
4053
backgroundSize: "300% 100%",
4154
backgroundPosition: "100% 0",
4255
},
4356
animate: {
57+
...defaultState,
4458
background: [
4559
`linear-gradient(to right,
4660
#BFBFFF 0%,
@@ -63,6 +77,7 @@ const gradation = {
6377
#FFE4E1 100%
6478
)`,
6579
],
80+
backgroundSize: "300% 100%",
6681
transition: {
6782
duration: 3,
6883
ease: "linear",
@@ -72,8 +87,110 @@ const gradation = {
7287
},
7388
};
7489

90+
const fadeIn = {
91+
initial: {
92+
...defaultState,
93+
opacity: 0,
94+
},
95+
animate: {
96+
...defaultState,
97+
opacity: 1,
98+
transition: {
99+
duration: 1,
100+
ease: "easeOut",
101+
},
102+
},
103+
};
104+
105+
const slideIn = {
106+
initial: {
107+
...defaultState,
108+
x: -20,
109+
opacity: 0,
110+
},
111+
animate: {
112+
...defaultState,
113+
x: 0,
114+
opacity: 1,
115+
transition: {
116+
duration: 0.5,
117+
ease: "easeOut",
118+
},
119+
},
120+
};
121+
122+
const pulse = {
123+
initial: {
124+
...defaultState,
125+
scale: 1,
126+
},
127+
animate: {
128+
...defaultState,
129+
scale: [1, 1.02, 1],
130+
transition: {
131+
duration: 1.5,
132+
ease: "easeInOut",
133+
repeat: Infinity,
134+
},
135+
},
136+
};
137+
138+
const gradation = {
139+
initial: {
140+
...defaultState,
141+
background: `linear-gradient(
142+
90deg,
143+
rgba(255,255,255,0) 0%,
144+
#BFBFFF80 70%,
145+
rgba(255,255,255,0) 100%
146+
)`,
147+
backgroundSize: "200% 100%",
148+
backgroundPosition: "100% 0",
149+
},
150+
animate: {
151+
...defaultState,
152+
background: `linear-gradient(
153+
90deg,
154+
rgba(255,255,255,0) 0%,
155+
#BFBFFF80 70%,
156+
rgba(255,255,255,0) 100%
157+
)`,
158+
backgroundSize: "200% 100%",
159+
backgroundPosition: ["100% 0", "-100% 0"],
160+
transition: {
161+
duration: 2,
162+
ease: "linear",
163+
repeat: Infinity,
164+
},
165+
},
166+
};
167+
168+
const bounce = {
169+
initial: {
170+
...defaultState,
171+
y: 0,
172+
},
173+
animate: {
174+
...defaultState,
175+
y: [-2, 2, -2],
176+
transition: {
177+
duration: 1,
178+
ease: "easeInOut",
179+
repeat: Infinity,
180+
},
181+
},
182+
};
183+
75184
export const blockAnimation = {
76185
none,
77186
highlight,
187+
rainbow,
188+
fadeIn,
189+
slideIn,
190+
pulse,
78191
gradation,
192+
bounce,
79193
};
194+
195+
// types.ts
196+
export type AnimationType = keyof typeof blockAnimation;

client/src/features/editor/components/block/Block.style.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ export const contentWrapperStyle = cva({
3838
position: "relative",
3939
flex: 1,
4040
flexDirection: "row",
41-
alignItems: "center",
41+
alignItems: "flex-start",
4242
width: "100%",
43+
height: "100%",
4344
},
4445
});
4546

server/src/auth/auth.controller.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ export class AuthController {
103103
// DB에서 refresh token 삭제
104104
await this.authService.removeRefreshToken(user.id);
105105

106-
// 사용자의 token version 증가
107-
await this.authService.increaseTokenVersion(user);
108-
109106
// 쿠키 삭제
110107
this.authService.clearCookie(req.res);
111108
}

server/src/auth/auth.service.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export class AuthService {
7171
return this.jwtService.sign({
7272
sub: user.id,
7373
email: user.email,
74-
tokenVersion: await this.increaseTokenVersion(user),
7574
});
7675
}
7776

@@ -87,12 +86,6 @@ export class AuthService {
8786
return refreshToken;
8887
}
8988

90-
async increaseTokenVersion(user: User): Promise<number> {
91-
const tokenVersion = user.tokenVersion + 1;
92-
await this.userModel.updateOne({ id: user.id }, { tokenVersion });
93-
return tokenVersion;
94-
}
95-
9689
async login(user: User, res: Response): Promise<UserDto> {
9790
const accessToken = await this.generateAccessToken(user);
9891
const refreshToken = await this.generateRefreshToken(user.id);
Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
import { Injectable, ExecutionContext, UnauthorizedException } from "@nestjs/common";
22
import { AuthGuard } from "@nestjs/passport";
3-
import { AuthService } from "../auth.service";
4-
import { JwtService } from "@nestjs/jwt";
53

64
@Injectable()
75
export class JwtAuthGuard extends AuthGuard("jwt") {
8-
constructor(
9-
private readonly authService: AuthService,
10-
private readonly jwtService: JwtService,
11-
) {
6+
constructor() {
127
super();
138
}
149

@@ -22,14 +17,6 @@ export class JwtAuthGuard extends AuthGuard("jwt") {
2217

2318
const canActivate = (await super.canActivate(context)) as boolean;
2419

25-
// Access Token의 tokenVersion과 사용자의 tokenVersion 일치 여부 확인
26-
const decodedToken = this.jwtService.decode(token) as { sub: string; tokenVersion: number };
27-
const user = await this.authService.findById(decodedToken.sub);
28-
29-
if (!user || user.tokenVersion !== decodedToken.tokenVersion) {
30-
throw new UnauthorizedException("Invalid token version");
31-
}
32-
3320
return canActivate;
3421
}
3522
}

0 commit comments

Comments
 (0)