diff --git a/.eslintignore b/.eslintignore
index 5a8bfc2..21feb23 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,4 +1,6 @@
.vscode
.eslintrc.js
packlint.config.mjs
-node_modules
\ No newline at end of file
+node_modules
+esm
+dist
diff --git a/.gitignore b/.gitignore
index d1595af..e17b911 100644
--- a/.gitignore
+++ b/.gitignore
@@ -34,3 +34,9 @@ yarn-error.log*
# vercel
.vercel
+
+# bundled
+dist
+esm
+
+stats.html
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 2fde182..d0b855d 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,9 +1,8 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
- "eslint.packageManager": "pnpm",
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
- "cSpell.words": ["packlint", "nextjs", "sulsul"],
+ "cSpell.words": ["packlint", "nextjs", "sulsul", "jsxcss"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
diff --git a/apps/falling/package.json b/apps/falling/package.json
index 8144113..2b392e5 100644
--- a/apps/falling/package.json
+++ b/apps/falling/package.json
@@ -22,7 +22,7 @@
"@tanstack/react-query-devtools": "^4.29.3",
"axios": "^1.3.6",
"framer-motion": "^10.12.4",
- "next": "13.4.4",
+ "next": "13.4.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.43.9",
diff --git a/apps/falling/public/images/bubble-beer.png b/apps/falling/public/images/bubble-beer.png
new file mode 100644
index 0000000..a322414
Binary files /dev/null and b/apps/falling/public/images/bubble-beer.png differ
diff --git a/apps/falling/public/images/bubble-goryanju.png b/apps/falling/public/images/bubble-goryanju.png
new file mode 100644
index 0000000..16e4584
Binary files /dev/null and b/apps/falling/public/images/bubble-goryanju.png differ
diff --git a/apps/falling/public/images/bubble-soju.png b/apps/falling/public/images/bubble-soju.png
new file mode 100644
index 0000000..4afe316
Binary files /dev/null and b/apps/falling/public/images/bubble-soju.png differ
diff --git a/apps/falling/public/images/bubble-whisky.png b/apps/falling/public/images/bubble-whisky.png
new file mode 100644
index 0000000..8d89a96
Binary files /dev/null and b/apps/falling/public/images/bubble-whisky.png differ
diff --git a/apps/falling/public/images/bubble-wine.png b/apps/falling/public/images/bubble-wine.png
new file mode 100644
index 0000000..4649868
Binary files /dev/null and b/apps/falling/public/images/bubble-wine.png differ
diff --git a/apps/falling/src/app/components/Falling.tsx b/apps/falling/src/app/components/Falling.tsx
new file mode 100644
index 0000000..2056179
--- /dev/null
+++ b/apps/falling/src/app/components/Falling.tsx
@@ -0,0 +1,39 @@
+'use client';
+
+import { StackView, useStackBall } from '@sulsul/ui';
+import { useEffect, useState } from 'react';
+import { drinkImage, drinks } from '../constants/drinks';
+
+export const Falling = () => {
+ const [isFirstTouch, setIsFirstTouch] = useState(false);
+ const { addBall, boxRef, canvasRef } = useStackBall();
+
+ useEffect(() => {
+ const addItem = (event: any) => {
+ if (!isFirstTouch) {
+ setIsFirstTouch(true);
+ return;
+ }
+
+ if (event.detail.data === undefined) {
+ throw new Error('event.detail.data is undefined');
+ }
+
+ const { image, size } = drinkImage[event.detail.data as drinks];
+ addBall(image, size);
+
+ window.sulsulBridge.onAddBallSuccess(event.detail.data as drinks);
+ };
+ window.addEventListener('addBall', addItem);
+
+ return () => {
+ window.removeEventListener('addBall', addItem);
+ };
+ }, [addBall, isFirstTouch]);
+
+ return (
+
+
+
+ );
+};
diff --git a/apps/falling/src/app/constants/drinks.ts b/apps/falling/src/app/constants/drinks.ts
new file mode 100644
index 0000000..9855f47
--- /dev/null
+++ b/apps/falling/src/app/constants/drinks.ts
@@ -0,0 +1,24 @@
+export const drinkImage = {
+ 소주: {
+ image: '/images/bubble-soju.png',
+ size: 80,
+ },
+ 맥주: {
+ image: '/images/bubble-beer.png',
+ size: 100,
+ },
+ 와인: {
+ image: '/images/bubble-wine.png',
+ size: 92,
+ },
+ 고량주: {
+ image: '/images/bubble-goryanju.png',
+ size: 68,
+ },
+ 위스키: {
+ image: '/images/bubble-whisky.png',
+ size: 68,
+ },
+} as const;
+
+export type drinks = keyof typeof drinkImage;
diff --git a/apps/falling/src/app/layout.tsx b/apps/falling/src/app/layout.tsx
index 2d68a84..6af4fe0 100644
--- a/apps/falling/src/app/layout.tsx
+++ b/apps/falling/src/app/layout.tsx
@@ -7,10 +7,17 @@ import { SuspensiveConfigs, SuspensiveProvider } from '@suspensive/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { Inter } from 'next/font/google';
+import { AndroidWebviewProvider } from '~/contexts/androidWeview';
import RootStyleRegistry from '../../emotion';
import './globals.css';
+declare global {
+ interface Window {
+ sulsulBridge: any;
+ }
+}
+
const queryClient = new QueryClient({
defaultOptions: {
queries: {
@@ -34,16 +41,18 @@ export default function RootLayout({ children }: { children: React.ReactNode })
return (
-
-
-
-
- {children}
-
-
-
-
-
+
+
+
+
+
+ {children}
+
+
+
+
+
+
);
diff --git a/apps/falling/src/app/page.tsx b/apps/falling/src/app/page.tsx
index 7a58bf6..ff91014 100644
--- a/apps/falling/src/app/page.tsx
+++ b/apps/falling/src/app/page.tsx
@@ -1,5 +1,7 @@
'use client';
+import { Falling } from './components/Falling';
+
export default function Home() {
- return explore amplify test;
+ return ;
}
diff --git a/apps/falling/src/contexts/androidWeview/index.tsx b/apps/falling/src/contexts/androidWeview/index.tsx
new file mode 100644
index 0000000..9810949
--- /dev/null
+++ b/apps/falling/src/contexts/androidWeview/index.tsx
@@ -0,0 +1,72 @@
+import {
+ createContext,
+ PropsWithChildren,
+ ReactNode,
+ Suspense,
+ useContext,
+ useEffect,
+ useState,
+} from 'react';
+
+const AndroidWebviewContext = createContext(null);
+export const AndroidWebviewProvider = (props: PropsWithChildren) => {
+ const [androidWebview, setAndroidWebview] = useState(null);
+ useEffect(() => {
+ if ((window as any).android) {
+ setAndroidWebview((window as any).android);
+ }
+ }, []);
+ return ;
+};
+
+export const AndroidWebviewGuaranteed = ({
+ render,
+ fallback,
+}: {
+ render: (androidWebview: AndroidWebview) => ReactNode;
+ fallback?: ReactNode;
+}) => {
+ const androidWebviewContextValue = useContext(AndroidWebviewContext);
+
+ if (androidWebviewContextValue === null) {
+ return <>{fallback}>;
+ }
+ const androidWebview = androidWebviewContextValue;
+ return <>{render(androidWebview)}>;
+};
+
+interface AndroidWebview {
+ showToastMessage(): void;
+}
+
+export const useAndroidWebview = (): AndroidWebview => {
+ const androidWebviewContextValue = useContext(AndroidWebviewContext);
+
+ if (androidWebviewContextValue === null) {
+ throw new Promise(() => {});
+ }
+
+ return androidWebviewContextValue;
+};
+
+export const Comp = () => {
+ return (
+ <>
+ hihihih jijojooj
+ loading...>}>
+
+
+ }
+ />
+ >
+ );
+};
+
+const AndroidWebviewUser = () => {
+ const androidWebview = useAndroidWebview();
+
+ const handleClick = () => androidWebview.showToastMessage();
+
+ return ;
+};
diff --git a/apps/onboarding/.eslintrc.js b/apps/onboarding/.eslintrc.js
index a01a20e..907cb2a 100644
--- a/apps/onboarding/.eslintrc.js
+++ b/apps/onboarding/.eslintrc.js
@@ -1,4 +1,7 @@
module.exports = {
root: true,
extends: ['@sulsul/eslint-config/react-ts-noimport', 'plugin:@next/next/recommended'],
+ rules: {
+ 'react/no-unknown-property': ['error', { ignore: ['css'] }],
+ },
};
diff --git a/apps/onboarding/emotion.tsx b/apps/onboarding/emotion.tsx
deleted file mode 100644
index 521f6a2..0000000
--- a/apps/onboarding/emotion.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-'use client';
-
-import { useState } from 'react';
-import createCache from '@emotion/cache';
-import { CacheProvider } from '@emotion/react';
-import { useServerInsertedHTML } from 'next/navigation';
-
-export default function RootStyleRegistry({ children }: { children: JSX.Element }) {
- const [cache] = useState(() => {
- const cache = createCache({ key: 'css' });
- cache.compat = true;
- return cache;
- });
-
- useServerInsertedHTML(() => (
-
- ));
-
- return {children};
-}
diff --git a/apps/onboarding/env.d.ts b/apps/onboarding/env.d.ts
new file mode 100644
index 0000000..477616d
--- /dev/null
+++ b/apps/onboarding/env.d.ts
@@ -0,0 +1,6 @@
+declare namespace NodeJS {
+ interface ProcessEnv {
+ readonly NODE_ENV: 'development' | 'production' | 'test';
+ readonly NEXT_PUBLIC_DOMAIN: string;
+ }
+}
diff --git a/apps/onboarding/next.config.js b/apps/onboarding/next.config.js
index f2ef010..5692981 100644
--- a/apps/onboarding/next.config.js
+++ b/apps/onboarding/next.config.js
@@ -8,8 +8,15 @@ const nextConfig = {
'@suspensive/react',
'@suspensive/react-query',
],
- compiler: {
- emotion: true,
+ webpack: (config) => {
+ config.module.rules.push({
+ test: /\.svg$/i,
+ use: ['@svgr/webpack'],
+ });
+ return config;
+ },
+ images: {
+ formats: ['image/avif', 'image/webp'],
},
};
diff --git a/apps/onboarding/openapi-config.json b/apps/onboarding/openapi-config.json
new file mode 100644
index 0000000..51d63b2
--- /dev/null
+++ b/apps/onboarding/openapi-config.json
@@ -0,0 +1,3 @@
+{
+ "allowUnicodeIdentifiers": true
+}
diff --git a/apps/onboarding/openapitools.json b/apps/onboarding/openapitools.json
new file mode 100644
index 0000000..cd53ff4
--- /dev/null
+++ b/apps/onboarding/openapitools.json
@@ -0,0 +1,7 @@
+{
+ "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
+ "spaces": 2,
+ "generator-cli": {
+ "version": "6.6.0"
+ }
+}
diff --git a/apps/onboarding/package.json b/apps/onboarding/package.json
index a1c9d68..3289a74 100644
--- a/apps/onboarding/package.json
+++ b/apps/onboarding/package.json
@@ -6,7 +6,9 @@
"build": "next build",
"dev": "next dev --port 3000",
"lint": "next lint",
- "start": "next start"
+ "spec:api": "openapi-generator-cli generate -g typescript-axios -i ../../openapispec.json -o ./src/api -c openapi-config.json",
+ "start": "next start",
+ "type:check": "tsc --noEmit"
},
"dependencies": {
"@emotion/react": "^11.11.0",
@@ -18,21 +20,26 @@
"@sulsul/ui": "workspace:*",
"@suspensive/react": "^1.11.2",
"@suspensive/react-query": "^1.11.2",
+ "@svgr/webpack": "^8.0.1",
"@tanstack/react-query": "^4.29.3",
"@tanstack/react-query-devtools": "^4.29.3",
"axios": "^1.3.6",
"framer-motion": "^10.12.4",
- "next": "13.4.4",
+ "next": "13.4.12",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.43.9",
"react-hook-step": "workspace:*",
+ "tss-react": "^4.8.8",
"zod": "^3.21.4"
},
"devDependencies": {
+ "@emotion/babel-plugin": "^11.11.0",
"@next/eslint-plugin-next": "13.4.6",
+ "@openapitools/openapi-generator-cli": "^2.6.0",
"@sulsul/eslint-config": "workspace:*",
"@sulsul/tsconfig": "workspace:*",
+ "@svgr/webpack": "^8.0.1",
"@types/node": "^17.0.12",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
diff --git a/apps/onboarding/public/favicons/android-chrome-192x192.png b/apps/onboarding/public/favicons/android-chrome-192x192.png
new file mode 100644
index 0000000..04dbb33
Binary files /dev/null and b/apps/onboarding/public/favicons/android-chrome-192x192.png differ
diff --git a/apps/onboarding/public/favicons/android-chrome-512x512.png b/apps/onboarding/public/favicons/android-chrome-512x512.png
new file mode 100644
index 0000000..012d0c6
Binary files /dev/null and b/apps/onboarding/public/favicons/android-chrome-512x512.png differ
diff --git a/apps/onboarding/public/favicons/apple-touch-icon.png b/apps/onboarding/public/favicons/apple-touch-icon.png
new file mode 100644
index 0000000..55226d0
Binary files /dev/null and b/apps/onboarding/public/favicons/apple-touch-icon.png differ
diff --git a/apps/onboarding/public/favicons/favicon-16x16.png b/apps/onboarding/public/favicons/favicon-16x16.png
new file mode 100644
index 0000000..7f44840
Binary files /dev/null and b/apps/onboarding/public/favicons/favicon-16x16.png differ
diff --git a/apps/onboarding/public/favicons/favicon-32x32.png b/apps/onboarding/public/favicons/favicon-32x32.png
new file mode 100644
index 0000000..d8403de
Binary files /dev/null and b/apps/onboarding/public/favicons/favicon-32x32.png differ
diff --git a/apps/onboarding/public/favicons/site.webmanifest b/apps/onboarding/public/favicons/site.webmanifest
new file mode 100644
index 0000000..ae4d9a7
--- /dev/null
+++ b/apps/onboarding/public/favicons/site.webmanifest
@@ -0,0 +1,19 @@
+{
+ "name": "sulsul",
+ "short_name": "sulsul",
+ "icons": [
+ {
+ "src": "/favicons/android-chrome-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "/favicons/android-chrome-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ],
+ "theme_color": "#ffffff",
+ "background_color": "#ffffff",
+ "display": "standalone"
+}
diff --git a/apps/onboarding/public/images/bubble-beer.png b/apps/onboarding/public/images/bubble-beer.png
new file mode 100644
index 0000000..a322414
Binary files /dev/null and b/apps/onboarding/public/images/bubble-beer.png differ
diff --git a/apps/onboarding/public/images/bubble-goryanju.png b/apps/onboarding/public/images/bubble-goryanju.png
new file mode 100644
index 0000000..16e4584
Binary files /dev/null and b/apps/onboarding/public/images/bubble-goryanju.png differ
diff --git a/apps/onboarding/public/images/bubble-soju.png b/apps/onboarding/public/images/bubble-soju.png
new file mode 100644
index 0000000..4afe316
Binary files /dev/null and b/apps/onboarding/public/images/bubble-soju.png differ
diff --git a/apps/onboarding/public/images/bubble-whisky.png b/apps/onboarding/public/images/bubble-whisky.png
new file mode 100644
index 0000000..8d89a96
Binary files /dev/null and b/apps/onboarding/public/images/bubble-whisky.png differ
diff --git a/apps/onboarding/public/images/bubble-wine.png b/apps/onboarding/public/images/bubble-wine.png
new file mode 100644
index 0000000..4649868
Binary files /dev/null and b/apps/onboarding/public/images/bubble-wine.png differ
diff --git a/apps/onboarding/public/metadata/images/baby.png b/apps/onboarding/public/metadata/images/baby.png
new file mode 100644
index 0000000..def56fc
Binary files /dev/null and b/apps/onboarding/public/metadata/images/baby.png differ
diff --git a/public/images/result/card/card_2_common.png b/apps/onboarding/public/metadata/images/common.png
similarity index 100%
rename from public/images/result/card/card_2_common.png
rename to apps/onboarding/public/metadata/images/common.png
diff --git a/public/images/result/card/card_6_god.png b/apps/onboarding/public/metadata/images/god.png
similarity index 100%
rename from public/images/result/card/card_6_god.png
rename to apps/onboarding/public/metadata/images/god.png
diff --git a/public/images/result/card/card_5_heaven.png b/apps/onboarding/public/metadata/images/heaven.png
similarity index 100%
rename from public/images/result/card/card_5_heaven.png
rename to apps/onboarding/public/metadata/images/heaven.png
diff --git a/public/images/result/card/card_3_master.png b/apps/onboarding/public/metadata/images/master.png
similarity index 100%
rename from public/images/result/card/card_3_master.png
rename to apps/onboarding/public/metadata/images/master.png
diff --git a/public/images/result/card/card_4_ghost.png b/apps/onboarding/public/metadata/images/monster.png
similarity index 100%
rename from public/images/result/card/card_4_ghost.png
rename to apps/onboarding/public/metadata/images/monster.png
diff --git a/public/images/main_image.png b/apps/onboarding/public/metadata/main_image.png
similarity index 100%
rename from public/images/main_image.png
rename to apps/onboarding/public/metadata/main_image.png
diff --git a/apps/onboarding/public/next.svg b/apps/onboarding/public/next.svg
deleted file mode 100644
index 5174b28..0000000
--- a/apps/onboarding/public/next.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/onboarding/public/svgs/grainy.svg b/apps/onboarding/public/svgs/grainy.svg
new file mode 100644
index 0000000..f9fe124
--- /dev/null
+++ b/apps/onboarding/public/svgs/grainy.svg
@@ -0,0 +1,11 @@
+
diff --git a/apps/onboarding/public/vercel.svg b/apps/onboarding/public/vercel.svg
deleted file mode 100644
index d2f8422..0000000
--- a/apps/onboarding/public/vercel.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/apps/onboarding/src/.babelrc b/apps/onboarding/src/.babelrc
new file mode 100644
index 0000000..3570a7a
--- /dev/null
+++ b/apps/onboarding/src/.babelrc
@@ -0,0 +1,8 @@
+{
+ "env": {
+ "production": {
+ "plugins": ["@emotion"]
+ }
+ },
+ "plugins": ["@emotion"]
+}
diff --git a/apps/onboarding/src/GlobalCSS.tsx b/apps/onboarding/src/GlobalCSS.tsx
new file mode 100644
index 0000000..841d53b
--- /dev/null
+++ b/apps/onboarding/src/GlobalCSS.tsx
@@ -0,0 +1,339 @@
+'use client';
+import { Global, css } from '@emotion/react';
+
+export const GlobalCSS = () => (
+
+);
diff --git a/apps/onboarding/src/KakaoScript.tsx b/apps/onboarding/src/KakaoScript.tsx
new file mode 100644
index 0000000..94165ce
--- /dev/null
+++ b/apps/onboarding/src/KakaoScript.tsx
@@ -0,0 +1,18 @@
+'use client';
+
+import Script from 'next/script';
+
+export const KakaoScript = () => (
+