@egjs/react-flicking 4.16.0-beta.1 → 4.17.0-beta.2

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.
Files changed (52) hide show
  1. package/.env +1 -0
  2. package/package.json +2 -2
  3. package/dev/archive/App.css +0 -32
  4. package/dev/archive/App.tsx +0 -52
  5. package/dev/archive/DebugPage.css +0 -21
  6. package/dev/archive/DebugPage.tsx +0 -93
  7. package/dev/archive/Header.tsx +0 -52
  8. package/dev/archive/StatePage.css +0 -21
  9. package/dev/archive/StatePage.tsx +0 -107
  10. package/dev/archive/css/align.css +0 -79
  11. package/dev/archive/css/bound.css +0 -88
  12. package/dev/archive/css/common.css +0 -76
  13. package/dev/archive/css/cross.css +0 -21
  14. package/dev/archive/css/features.css +0 -49
  15. package/dev/archive/css/gap.css +0 -13
  16. package/dev/archive/css/highlight.css +0 -96
  17. package/dev/archive/css/infinite.css +0 -35
  18. package/dev/archive/css/parallax.css +0 -3
  19. package/dev/archive/css/plugins.css +0 -46
  20. package/dev/archive/css/progress.css +0 -16
  21. package/dev/archive/css/variable-size.css +0 -15
  22. package/dev/archive/features/Align.tsx +0 -149
  23. package/dev/archive/features/Bound.tsx +0 -83
  24. package/dev/archive/features/CrossFlicking.tsx +0 -74
  25. package/dev/archive/features/FreeScroll.tsx +0 -66
  26. package/dev/archive/features/InfiniteFlicking.tsx +0 -192
  27. package/dev/archive/features/PlaceHolderItem.tsx +0 -36
  28. package/dev/archive/features/Progress.tsx +0 -241
  29. package/dev/archive/features/PropChange.tsx +0 -171
  30. package/dev/archive/features/Snap.tsx +0 -95
  31. package/dev/archive/features/VariableSize.tsx +0 -42
  32. package/dev/archive/features/Virtual.tsx +0 -45
  33. package/dev/archive/plugins/Arrow.tsx +0 -25
  34. package/dev/archive/plugins/AutoPlay.tsx +0 -70
  35. package/dev/archive/plugins/Fade.tsx +0 -69
  36. package/dev/archive/plugins/Parallax.tsx +0 -70
  37. package/dev/archive/utils.ts +0 -3
  38. package/dev/basic-sample/App.tsx +0 -36
  39. package/dev/basic-sample/index.html +0 -12
  40. package/dev/basic-sample/main.tsx +0 -10
  41. package/dev/index.html +0 -18
  42. package/dev/plugin-check/App.tsx +0 -341
  43. package/dev/plugin-check/index.html +0 -15
  44. package/dev/plugin-check/main.tsx +0 -6
  45. package/dev/scratch/App.tsx +0 -34
  46. package/dev/scratch/index.html +0 -15
  47. package/dev/scratch/main.tsx +0 -13
  48. package/dev/tsconfig.json +0 -12
  49. package/dev/vite-env.d.ts +0 -3
  50. package/tsconfig.json +0 -23
  51. package/vite.config.ts +0 -38
  52. package/vite.dev.config.ts +0 -58
@@ -1,341 +0,0 @@
1
- /**
2
- * 플러그인 마이그레이션 검증용 (임시)
3
- * docs 데모 추가 후 제거 예정
4
- *
5
- * 참고: https://naver.github.io/egjs-flicking/ko/Plugins
6
- */
7
-
8
- import { Arrow, AutoPlay, Fade, Pagination, Parallax, Perspective, Sync } from "@dev/plugins";
9
- import Flicking, { ViewportSlot } from "@dev/react-flicking";
10
- import { useEffect, useRef, useState } from "react";
11
-
12
- const css: Record<string, React.CSSProperties> = {
13
- section: {
14
- marginBottom: 48
15
- },
16
- title: {
17
- fontSize: 18,
18
- fontWeight: "bold",
19
- marginBottom: 12,
20
- borderBottom: "2px solid #333",
21
- paddingBottom: 4
22
- },
23
- note: {
24
- fontSize: 12,
25
- color: "#666",
26
- marginTop: 8
27
- },
28
- panel: {
29
- minWidth: 200,
30
- height: 160,
31
- margin: "0 5px",
32
- background: "#e0e7ff",
33
- borderRadius: 8,
34
- display: "flex",
35
- alignItems: "center",
36
- justifyContent: "center",
37
- fontSize: 24,
38
- fontWeight: "bold",
39
- overflow: "hidden"
40
- },
41
- pluginsPanel: {
42
- position: "relative",
43
- width: "100%",
44
- height: 200,
45
- overflow: "hidden"
46
- },
47
- panelImage: {
48
- width: "100%",
49
- height: "100%",
50
- objectFit: "cover"
51
- },
52
- thumbPanel: {
53
- width: 100,
54
- height: 70,
55
- margin: "0 2px",
56
- overflow: "hidden",
57
- opacity: 0.5,
58
- transition: "opacity 0.3s"
59
- },
60
- thumbImage: {
61
- width: "100%",
62
- height: "100%",
63
- objectFit: "cover"
64
- },
65
- syncItem: {
66
- display: "inline-block",
67
- padding: "8px 16px",
68
- margin: "0 4px",
69
- background: "#f5f5f5",
70
- borderRadius: 4,
71
- whiteSpace: "nowrap"
72
- }
73
- };
74
-
75
- const images = [
76
- "https://picsum.photos/seed/a/600/300",
77
- "https://picsum.photos/seed/b/600/300",
78
- "https://picsum.photos/seed/c/600/300",
79
- "https://picsum.photos/seed/d/600/300",
80
- "https://picsum.photos/seed/e/600/300",
81
- "https://picsum.photos/seed/f/600/300"
82
- ];
83
-
84
- function Section({ title, children }: { title: string; children: React.ReactNode }) {
85
- return (
86
- <div style={css.section}>
87
- <div style={css.title}>{title}</div>
88
- {children}
89
- </div>
90
- );
91
- }
92
-
93
- /* ── Arrow ── */
94
- function ArrowCheck() {
95
- const plugins = [new Arrow()];
96
-
97
- return (
98
- <Section title="Arrow">
99
- <Flicking circular={true} plugins={plugins}>
100
- {[1, 2, 3, 4, 5].map(n => (
101
- <div key={n} style={css.panel}>
102
- {n}
103
- </div>
104
- ))}
105
- <ViewportSlot>
106
- <span className="flicking-arrow-prev"></span>
107
- <span className="flicking-arrow-next"></span>
108
- </ViewportSlot>
109
- </Flicking>
110
- </Section>
111
- );
112
- }
113
-
114
- /* ── AutoPlay ── */
115
- function AutoPlayCheck() {
116
- const plugins = [new AutoPlay()];
117
-
118
- return (
119
- <Section title="AutoPlay">
120
- <Flicking circular={true} preventDefaultOnDrag={true} plugins={plugins}>
121
- {images.slice(0, 3).map((src, i) => (
122
- <div key={i} style={css.pluginsPanel}>
123
- <img style={css.panelImage} src={src} />
124
- </div>
125
- ))}
126
- </Flicking>
127
- </Section>
128
- );
129
- }
130
-
131
- /* ── Pagination (bullet) ── */
132
- function PaginationCheck() {
133
- const plugins = [new Pagination({ type: "bullet" })];
134
-
135
- return (
136
- <Section title="Pagination (bullet)">
137
- <Flicking circular={true} plugins={plugins}>
138
- {[1, 2, 3, 4, 5, 6, 7, 8].map(n => (
139
- <div key={n} style={css.panel}>
140
- {n}
141
- </div>
142
- ))}
143
- <ViewportSlot>
144
- <div className="flicking-pagination"></div>
145
- </ViewportSlot>
146
- </Flicking>
147
- </Section>
148
- );
149
- }
150
-
151
- /* ── Fade ── */
152
- function FadeCheck() {
153
- const plugins = [new Fade()];
154
-
155
- return (
156
- <Section title="Fade">
157
- <Flicking circular={true} preventDefaultOnDrag={true} plugins={plugins}>
158
- {images.slice(0, 3).map((src, i) => (
159
- <div key={i} style={css.pluginsPanel}>
160
- <img style={css.panelImage} src={src} />
161
- </div>
162
- ))}
163
- </Flicking>
164
- </Section>
165
- );
166
- }
167
-
168
- /* ── Parallax ── */
169
- function ParallaxCheck() {
170
- const plugins = [new Parallax("img")];
171
-
172
- return (
173
- <Section title="Parallax">
174
- <Flicking className="parallax" circular={true} preventDefaultOnDrag={true} plugins={plugins} gap={2}>
175
- {images.slice(0, 3).map((src, i) => (
176
- <div key={i} style={{ ...css.pluginsPanel, width: "100%" }}>
177
- <img style={{ ...css.panelImage, width: "150%", maxWidth: "none" }} src={src} />
178
- </div>
179
- ))}
180
- </Flicking>
181
- </Section>
182
- );
183
- }
184
-
185
- /* ── Perspective ── */
186
- function PerspectiveCheck() {
187
- const plugins = [new Perspective({ rotate: 1, scale: 2, perspective: 600 })];
188
-
189
- return (
190
- <Section title="Perspective">
191
- <Flicking circular={true} plugins={plugins}>
192
- {[1, 2, 3, 4, 5].map(n => (
193
- <div key={n} style={css.panel}>
194
- {n}
195
- </div>
196
- ))}
197
- </Flicking>
198
- </Section>
199
- );
200
- }
201
-
202
- /* ── Sync (camera) ── */
203
- function SyncCameraCheck() {
204
- const flicking0 = useRef<Flicking>(null);
205
- const flicking1 = useRef<Flicking>(null);
206
- const flicking2 = useRef<Flicking>(null);
207
- const [plugins, setPlugins] = useState<Sync[]>([]);
208
-
209
- useEffect(() => {
210
- setPlugins([
211
- new Sync({
212
- type: "camera",
213
- synchronizedFlickingOptions: [
214
- { flicking: flicking0.current!, isClickable: false },
215
- { flicking: flicking1.current!, isClickable: false },
216
- { flicking: flicking2.current!, isClickable: false }
217
- ]
218
- })
219
- ]);
220
- }, []);
221
-
222
- return (
223
- <Section title="Sync (camera)">
224
- <Flicking ref={flicking0} align="prev" bound={true} bounce={30} plugins={plugins}>
225
- {[
226
- "🍎 Apple",
227
- "🍉 Watermelon",
228
- "🥝 Kiwi",
229
- "🍊 Orange",
230
- "🍇 Grape",
231
- "🍓 Strawberry",
232
- "🍑 Peach",
233
- "🍋 Lemon",
234
- "🫐 Blueberry",
235
- "🍌 Banana"
236
- ].map(item => (
237
- <span key={item} style={css.syncItem}>
238
- {item}
239
- </span>
240
- ))}
241
- </Flicking>
242
- <div style={{ marginTop: 4 }}>
243
- <Flicking ref={flicking1} align="prev" bound={true} bounce={30}>
244
- {[
245
- "🍔 Hamburger",
246
- "🍕 Pizza",
247
- "🍞 Bread",
248
- "🌮 Taco",
249
- "🍜 Ramen",
250
- "🍣 Sushi",
251
- "🥗 Salad",
252
- "🍝 Pasta",
253
- "🥘 Stew",
254
- "🍱 Bento"
255
- ].map(item => (
256
- <span key={item} style={css.syncItem}>
257
- {item}
258
- </span>
259
- ))}
260
- </Flicking>
261
- </div>
262
- <div style={{ marginTop: 4 }}>
263
- <Flicking ref={flicking2} align="prev" bound={true} bounce={30}>
264
- {[
265
- "🥛 Milk",
266
- "☕ Coffee",
267
- "🍵 Green tea",
268
- "🧃 Juice",
269
- "🥤 Soda",
270
- "🍺 Beer",
271
- "🧋 Bubble tea",
272
- "🍷 Wine",
273
- "🥥 Coconut",
274
- "🍶 Sake"
275
- ].map(item => (
276
- <span key={item} style={css.syncItem}>
277
- {item}
278
- </span>
279
- ))}
280
- </Flicking>
281
- </div>
282
- </Section>
283
- );
284
- }
285
-
286
- /* ── Sync (index + thumbnail) ── */
287
- function SyncIndexCheck() {
288
- const mainRef = useRef<Flicking>(null);
289
- const thumbRef = useRef<Flicking>(null);
290
- const [plugins, setPlugins] = useState<Sync[]>([]);
291
-
292
- useEffect(() => {
293
- setPlugins([
294
- new Sync({
295
- type: "index",
296
- synchronizedFlickingOptions: [
297
- { flicking: mainRef.current!, isSlidable: true },
298
- { flicking: thumbRef.current!, isClickable: true, activeClass: "active" }
299
- ]
300
- })
301
- ]);
302
- }, []);
303
-
304
- return (
305
- <Section title="Sync (index + thumbnail)">
306
- <Flicking ref={mainRef} bounce={30} preventDefaultOnDrag={true} plugins={plugins}>
307
- {images.map((src, i) => (
308
- <div key={i} style={css.pluginsPanel}>
309
- <img style={css.panelImage} src={src} />
310
- </div>
311
- ))}
312
- </Flicking>
313
- <div style={{ marginTop: 8 }}>
314
- <Flicking ref={thumbRef} moveType="freeScroll" bound={true} bounce={30} preventDefaultOnDrag={true}>
315
- {images.map((src, i) => (
316
- <div key={i} style={css.thumbPanel}>
317
- <img style={css.thumbImage} src={src} />
318
- </div>
319
- ))}
320
- </Flicking>
321
- </div>
322
- </Section>
323
- );
324
- }
325
-
326
- export default function App() {
327
- return (
328
- <div style={{ maxWidth: 640, margin: "0 auto", padding: 20 }}>
329
- <h1>Plugin Check</h1>
330
- <p style={css.note}>마이그레이션 검증용 — docs 데모 추가 후 제거 예정</p>
331
- <ArrowCheck />
332
- <AutoPlayCheck />
333
- <PaginationCheck />
334
- <FadeCheck />
335
- <ParallaxCheck />
336
- <PerspectiveCheck />
337
- <SyncCameraCheck />
338
- <SyncIndexCheck />
339
- </div>
340
- );
341
- }
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Plugin Check - React Flicking</title>
7
- <style>
8
- body { margin: 0; padding: 20px; font-family: sans-serif; }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- <script type="module" src="./main.tsx"></script>
14
- </body>
15
- </html>
@@ -1,6 +0,0 @@
1
- import { createRoot } from "react-dom/client";
2
- import "@dev/flicking-css";
3
- import "@dev/plugins-css";
4
- import App from "./App";
5
-
6
- createRoot(document.getElementById("root")!).render(<App />);
@@ -1,34 +0,0 @@
1
- /**
2
- * 이슈 재현 템플릿
3
- *
4
- * 이 파일을 덮어써서 이슈를 재현하세요.
5
- */
6
- import Flicking from "@dev/react-flicking";
7
-
8
- const css: Record<string, React.CSSProperties> = {
9
- panel: {
10
- minWidth: 200,
11
- height: 200,
12
- margin: "0 5px",
13
- background: "#f0f0f0",
14
- borderRadius: 8,
15
- display: "flex",
16
- alignItems: "center",
17
- justifyContent: "center",
18
- fontSize: 24,
19
- fontWeight: "bold"
20
- }
21
- };
22
-
23
- export default function App() {
24
- return (
25
- <div>
26
- <h2>Scratch</h2>
27
- <Flicking align="prev" circular={true}>
28
- <div style={css.panel}>1</div>
29
- <div style={css.panel}>2</div>
30
- <div style={css.panel}>3</div>
31
- </Flicking>
32
- </div>
33
- );
34
- }
@@ -1,15 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Scratch - React Flicking</title>
7
- <style>
8
- body { margin: 0; padding: 20px; font-family: sans-serif; }
9
- </style>
10
- </head>
11
- <body>
12
- <div id="root"></div>
13
- <script type="module" src="./main.tsx"></script>
14
- </body>
15
- </html>
@@ -1,13 +0,0 @@
1
- /**
2
- * Scratch - 이슈 재현용 독립 페이지
3
- *
4
- * http://localhost:3001/scratch/
5
- *
6
- * 이 파일은 수정하지 마세요.
7
- * 재현 코드는 App.tsx에 작성합니다.
8
- */
9
- import { createRoot } from "react-dom/client";
10
- import "@dev/flicking-css";
11
- import App from "./App";
12
-
13
- createRoot(document.getElementById("root")!).render(<App />);
package/dev/tsconfig.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "extends": "../tsconfig.json",
3
- "compilerOptions": {
4
- "baseUrl": ".",
5
- "paths": {
6
- "@dev/react-flicking": ["../src/react-flicking/index.ts"],
7
- "@dev/flicking": ["../../flicking/src/index.ts"],
8
- "@dev/plugins": ["../../flicking-plugins/src/index.ts"]
9
- }
10
- },
11
- "include": ["./**/*.ts", "./**/*.tsx"]
12
- }
package/dev/vite-env.d.ts DELETED
@@ -1,3 +0,0 @@
1
- /// <reference types="vite/client" />
2
-
3
- declare const __DEV__: boolean;
package/tsconfig.json DELETED
@@ -1,23 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strictNullChecks": true,
8
- "esModuleInterop": true,
9
- "importHelpers": true,
10
- "experimentalDecorators": true,
11
- "allowSyntheticDefaultImports": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "module": "esnext",
14
- "moduleResolution": "node",
15
- "resolveJsonModule": true,
16
- "jsx": "react-jsx",
17
- "strict": false,
18
- "isolatedModules": true,
19
- "noEmit": true,
20
- "noFallthroughCasesInSwitch": true
21
- },
22
- "include": ["src"]
23
- }
package/vite.config.ts DELETED
@@ -1,38 +0,0 @@
1
- import { createViteConfig } from "../../config/vite-build-helper";
2
- // @ts-expect-error: resolveJsonModule issue in build environment
3
- import pkg from "./package.json";
4
-
5
- const name = "ReactFlicking";
6
- const external = {
7
- react: "React",
8
- "react-dom": "ReactDOM",
9
- "@egjs/flicking": "Flicking",
10
- "@egjs/component": "Component",
11
- "@egjs/list-differ": "eg.ListDiffer"
12
- };
13
-
14
- // Determine build target based on environment variable
15
- // usage: VITE_BUILD_FORMAT=umd vite build
16
- const buildFormat = process.env.VITE_BUILD_FORMAT || "esm";
17
-
18
- let input = "src/react-flicking/index.ts";
19
- let formats: any[] = ["es"];
20
-
21
- if (buildFormat === "cjs") {
22
- input = "src/react-flicking/index.umd.ts";
23
- formats = ["cjs"];
24
- } else if (buildFormat === "umd") {
25
- input = "src/react-flicking/index.umd.ts";
26
- formats = ["umd"];
27
- }
28
- // Default (esm) uses index.ts
29
-
30
- export default createViteConfig({
31
- input,
32
- name,
33
- packageJson: pkg,
34
- external,
35
- formats,
36
- tsconfig: "tsconfig.build.json", // Use build specific tsconfig
37
- output: "dist/flicking" // Base name for output files
38
- });
@@ -1,58 +0,0 @@
1
- import path from "node:path";
2
- import react from "@vitejs/plugin-react";
3
- import { defineConfig } from "vite";
4
-
5
- export default defineConfig(({ mode }) => {
6
- const useBuild = mode === "production";
7
-
8
- return {
9
- plugins: [
10
- react({
11
- babel: {
12
- plugins: [
13
- ["@babel/plugin-proposal-decorators", { legacy: true }],
14
- ["@babel/plugin-proposal-class-properties", { loose: true }]
15
- ]
16
- }
17
- })
18
- ],
19
- root: path.resolve(__dirname, "dev"),
20
- server: {
21
- port: 3001,
22
- open: true,
23
- fs: {
24
- allow: [".."]
25
- }
26
- },
27
- resolve: {
28
- alias: useBuild
29
- ? {
30
- // 빌드 검증 모드 - 빌드 결과물 사용
31
- "@dev/flicking": path.resolve(__dirname, "../flicking/dist/flicking.esm.js"),
32
- "@dev/react-flicking": path.resolve(__dirname, "dist/flicking.esm.js"),
33
- "@dev/plugins": path.resolve(__dirname, "../flicking-plugins/dist/plugins.esm.js"),
34
- "@dev/flicking-css": path.resolve(__dirname, "../flicking/dist/flicking.css"),
35
- "@dev/plugins-css": path.resolve(__dirname, "../flicking-plugins/dist/flicking-plugins.css"),
36
- // 소스코드 내부의 @egjs/flicking 참조용
37
- "@egjs/flicking": path.resolve(__dirname, "../flicking/dist/flicking.esm.js")
38
- }
39
- : {
40
- // 개발 모드 - 모든 소스 직접 참조 (HMR!)
41
- "@dev/flicking": path.resolve(__dirname, "../flicking/src/index.ts"),
42
- "@dev/react-flicking": path.resolve(__dirname, "src/react-flicking/index.ts"),
43
- "@dev/plugins": path.resolve(__dirname, "../flicking-plugins/src/index.ts"),
44
- "@dev/flicking-css": path.resolve(__dirname, "../flicking/sass/flicking.sass"),
45
- "@dev/plugins-css": path.resolve(__dirname, "../flicking-plugins/css/all.css"),
46
- // 소스코드 내부의 @egjs/flicking 참조용
47
- "@egjs/flicking": path.resolve(__dirname, "../flicking/src/index.ts")
48
- },
49
- extensions: [".ts", ".tsx", ".js", ".jsx"]
50
- },
51
- optimizeDeps: {
52
- include: ["react", "react-dom", "@egjs/axes", "@egjs/component", "@egjs/imready", "@egjs/list-differ"]
53
- },
54
- define: {
55
- __DEV__: JSON.stringify(!useBuild)
56
- }
57
- };
58
- });