@egjs/react-flicking 4.15.0 → 4.16.0-beta.1
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.
- package/dev/archive/App.css +32 -0
- package/dev/archive/App.tsx +52 -0
- package/dev/archive/DebugPage.css +21 -0
- package/dev/archive/DebugPage.tsx +93 -0
- package/dev/archive/Header.tsx +52 -0
- package/dev/archive/StatePage.css +21 -0
- package/dev/archive/StatePage.tsx +107 -0
- package/dev/archive/css/align.css +79 -0
- package/dev/archive/css/bound.css +88 -0
- package/dev/archive/css/common.css +76 -0
- package/dev/archive/css/cross.css +21 -0
- package/dev/archive/css/features.css +49 -0
- package/dev/archive/css/gap.css +13 -0
- package/dev/archive/css/highlight.css +96 -0
- package/dev/archive/css/infinite.css +35 -0
- package/dev/archive/css/parallax.css +3 -0
- package/dev/archive/css/plugins.css +46 -0
- package/dev/archive/css/progress.css +16 -0
- package/dev/archive/css/variable-size.css +15 -0
- package/dev/archive/features/Align.tsx +149 -0
- package/dev/archive/features/Bound.tsx +83 -0
- package/dev/archive/features/CrossFlicking.tsx +74 -0
- package/dev/archive/features/FreeScroll.tsx +66 -0
- package/dev/archive/features/InfiniteFlicking.tsx +192 -0
- package/dev/archive/features/PlaceHolderItem.tsx +36 -0
- package/dev/archive/features/Progress.tsx +241 -0
- package/dev/archive/features/PropChange.tsx +171 -0
- package/dev/archive/features/Snap.tsx +95 -0
- package/dev/archive/features/VariableSize.tsx +42 -0
- package/dev/archive/features/Virtual.tsx +45 -0
- package/dev/archive/plugins/Arrow.tsx +25 -0
- package/dev/archive/plugins/AutoPlay.tsx +70 -0
- package/dev/archive/plugins/Fade.tsx +69 -0
- package/dev/archive/plugins/Parallax.tsx +70 -0
- package/dev/archive/utils.ts +3 -0
- package/dev/basic-sample/App.tsx +36 -0
- package/dev/basic-sample/index.html +12 -0
- package/dev/basic-sample/main.tsx +10 -0
- package/dev/index.html +18 -0
- package/dev/plugin-check/App.tsx +341 -0
- package/dev/plugin-check/index.html +15 -0
- package/dev/plugin-check/main.tsx +6 -0
- package/dev/scratch/App.tsx +34 -0
- package/dev/scratch/index.html +15 -0
- package/dev/scratch/main.tsx +13 -0
- package/dev/tsconfig.json +12 -0
- package/dev/vite-env.d.ts +3 -0
- package/{declaration → dist}/CrossFlicking.d.ts +3 -5
- package/{declaration → dist}/CrossGroup.d.ts +1 -1
- package/{declaration → dist}/Flicking.d.ts +8 -8
- package/{declaration → dist}/NonStrictPanel.d.ts +1 -1
- package/{declaration → dist}/ReactRenderer.d.ts +1 -1
- package/{declaration → dist}/StrictPanel.d.ts +1 -1
- package/{declaration → dist}/ViewportSlot.d.ts +1 -1
- package/dist/flicking.cjs.js +1514 -579
- package/dist/flicking.cjs.js.map +1 -1
- package/dist/flicking.esm.js +1573 -651
- package/dist/flicking.esm.js.map +1 -1
- package/dist/flicking.js +1634 -0
- package/dist/flicking.js.map +1 -0
- package/{declaration → dist}/index.d.ts +3 -3
- package/{declaration → dist}/types.d.ts +1 -2
- package/package.json +18 -33
- package/src/react-flicking/CrossFlicking.tsx +28 -37
- package/src/react-flicking/CrossGroup.tsx +6 -8
- package/src/react-flicking/Flicking.tsx +81 -69
- package/src/react-flicking/NonStrictPanel.tsx +15 -7
- package/src/react-flicking/ReactElementProvider.ts +6 -4
- package/src/react-flicking/ReactRenderer.ts +1 -2
- package/src/react-flicking/StrictPanel.tsx +10 -6
- package/src/react-flicking/consts.ts +14 -14
- package/src/react-flicking/index.ts +4 -7
- package/src/react-flicking/index.umd.ts +1 -1
- package/src/react-flicking/reactive.ts +3 -3
- package/src/react-flicking/types.ts +17 -17
- package/tsconfig.json +2 -9
- package/vite.config.ts +38 -0
- package/vite.dev.config.ts +58 -0
- package/dist/flicking.umd.js +0 -699
- package/dist/flicking.umd.js.map +0 -1
- /package/{declaration → dist}/ReactElementProvider.d.ts +0 -0
- /package/{declaration → dist}/consts.d.ts +0 -0
- /package/{declaration → dist}/index.umd.d.ts +0 -0
- /package/{declaration → dist}/reactive.d.ts +0 -0
|
@@ -0,0 +1,341 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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>
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
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>
|
|
@@ -0,0 +1,13 @@
|
|
|
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 />);
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import { CrossFlickingEvent, HoldStartEvent, HoldEndEvent, MoveStartEvent, MoveEvent, MoveEndEvent, WillChangeEvent, ChangedEvent, CrossFlickingOptions, FlickingOptions } from "@egjs/flicking";
|
|
3
|
-
import { FlickingProps } from "./types";
|
|
1
|
+
import { ChangedEvent, CrossFlickingEvent, HoldEndEvent, HoldStartEvent, MoveEndEvent, MoveEvent, MoveStartEvent, WillChangeEvent } from "@egjs/flicking";
|
|
4
2
|
import Flicking from "./Flicking";
|
|
3
|
+
import { FlickingProps } from "./types";
|
|
5
4
|
export interface CrossFlickingProps extends FlickingProps {
|
|
6
5
|
onSideHoldStart: (e: CrossFlickingEvent<HoldStartEvent<Flicking>>) => any;
|
|
7
6
|
onSideHoldEnd: (e: CrossFlickingEvent<HoldEndEvent<Flicking>>) => any;
|
|
@@ -16,9 +15,8 @@ export interface CrossFlickingProps extends FlickingProps {
|
|
|
16
15
|
export declare const CROSSFLICKING_DEFAULT_PROPS: CrossFlickingProps;
|
|
17
16
|
declare class CrossFlicking extends Flicking {
|
|
18
17
|
static defaultProps: CrossFlickingProps;
|
|
19
|
-
constructor(props: Partial<FlickingProps & FlickingOptions & CrossFlickingOptions & CrossFlickingProps>);
|
|
20
18
|
componentDidMount(): void;
|
|
21
|
-
render(): JSX.Element;
|
|
19
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
22
20
|
protected _bindEvents(): void;
|
|
23
21
|
}
|
|
24
22
|
interface CrossFlicking extends Flicking {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
1
|
import Component from "@egjs/component";
|
|
2
|
+
import VanillaFlicking, { FlickingEvents, FlickingOptions } from "@egjs/flicking";
|
|
3
3
|
import ListDiffer from "@egjs/list-differ";
|
|
4
|
-
import
|
|
5
|
-
import { FlickingProps } from "./types";
|
|
6
|
-
import StrictPanel from "./StrictPanel";
|
|
4
|
+
import * as React from "react";
|
|
7
5
|
import NonStrictPanel from "./NonStrictPanel";
|
|
6
|
+
import StrictPanel from "./StrictPanel";
|
|
7
|
+
import { FlickingProps } from "./types";
|
|
8
8
|
declare class Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>> {
|
|
9
9
|
static defaultProps: FlickingProps;
|
|
10
10
|
protected _vanillaFlicking: VanillaFlicking;
|
|
@@ -15,9 +15,9 @@ declare class Flicking extends React.Component<Partial<FlickingProps & FlickingO
|
|
|
15
15
|
private _diffResult;
|
|
16
16
|
private _renderEmitter;
|
|
17
17
|
protected _prevChildren: React.ReactElement[];
|
|
18
|
-
get reactPanels(): (
|
|
18
|
+
get reactPanels(): (NonStrictPanel | StrictPanel | HTMLDivElement)[];
|
|
19
19
|
get renderEmitter(): Component<{
|
|
20
|
-
render:
|
|
20
|
+
render: undefined;
|
|
21
21
|
}>;
|
|
22
22
|
constructor(props: Partial<FlickingProps & FlickingOptions>);
|
|
23
23
|
componentDidMount(): void;
|
|
@@ -25,7 +25,7 @@ declare class Flicking extends React.Component<Partial<FlickingProps & FlickingO
|
|
|
25
25
|
shouldComponentUpdate(nextProps: Readonly<Partial<FlickingProps & FlickingOptions>>): boolean;
|
|
26
26
|
beforeRender(): void;
|
|
27
27
|
componentDidUpdate(): void;
|
|
28
|
-
render(): JSX.Element;
|
|
28
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
private _createPanelRefs;
|
|
30
30
|
protected _bindEvents(): void;
|
|
31
31
|
protected _bindEvent(eventName: keyof FlickingEvents): void;
|
|
@@ -48,7 +48,7 @@ declare class Flicking extends React.Component<Partial<FlickingProps & FlickingO
|
|
|
48
48
|
protected _getViewportSlot(): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
|
49
49
|
private _unpackFragment;
|
|
50
50
|
private _getVirtualPanels;
|
|
51
|
-
protected _getPanels(): JSX.Element[];
|
|
51
|
+
protected _getPanels(): import("react/jsx-runtime").JSX.Element[];
|
|
52
52
|
private _isFragment;
|
|
53
53
|
}
|
|
54
54
|
interface Flicking extends React.Component<Partial<FlickingProps & FlickingOptions>>, VanillaFlicking {
|
|
@@ -7,7 +7,7 @@ declare class NonStrictPanel extends React.Component<{
|
|
|
7
7
|
get nativeElement(): HTMLElement;
|
|
8
8
|
get rendered(): boolean;
|
|
9
9
|
get elRef(): React.RefObject<HTMLElement>;
|
|
10
|
-
render(): JSX.Element;
|
|
10
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
show(): void;
|
|
12
12
|
hide(): void;
|
|
13
13
|
}
|
|
@@ -11,6 +11,6 @@ declare class ReactRenderer extends ExternalRenderer {
|
|
|
11
11
|
forceRenderAllPanels(): Promise<void>;
|
|
12
12
|
destroy(): void;
|
|
13
13
|
protected _collectPanels(): void;
|
|
14
|
-
protected _createPanel(externalComponent: StrictPanel, options: PanelOptions): import("@egjs/flicking/
|
|
14
|
+
protected _createPanel(externalComponent: StrictPanel, options: PanelOptions): import("@egjs/flicking/dist/core/panel/Panel").default;
|
|
15
15
|
}
|
|
16
16
|
export default ReactRenderer;
|
|
@@ -7,7 +7,7 @@ declare class StrictPanel extends React.Component<{
|
|
|
7
7
|
get nativeElement(): HTMLElement;
|
|
8
8
|
get rendered(): boolean;
|
|
9
9
|
get elRef(): React.RefObject<HTMLElement>;
|
|
10
|
-
render(): JSX.Element;
|
|
10
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
show(): void;
|
|
12
12
|
hide(): void;
|
|
13
13
|
private _getElement;
|