peek-carousel 2.0.0 → 2.0.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/README.en.md +39 -21
- package/README.md +35 -21
- package/THIRD_PARTY_NOTICES.md +33 -23
- package/dist/peek-carousel.cjs +1 -1
- package/dist/peek-carousel.css +1 -1
- package/dist/peek-carousel.esm.js +1 -1
- package/dist/peek-carousel.js +1 -1
- package/dist/peek-carousel.min.css +1 -1
- package/docs/en/reference.md +14 -16
- package/docs/integrations.md +114 -26
- package/docs/ko/reference.md +11 -12
- package/examples/custom-theme.css +140 -58
- package/examples/custom-theme.html +27 -15
- package/examples/custom-theme.ja.html +27 -15
- package/examples/custom-theme.js +2 -2
- package/examples/custom-theme.ko.html +29 -17
- package/examples/example-built.html +61 -57
- package/examples/example-built.ja.html +61 -57
- package/examples/example-built.ko.html +63 -59
- package/examples/example.min.css +2 -2
- package/examples/example.min.js +2 -2
- package/package.json +12 -6
- package/public/favicon-16x16.png +0 -0
- package/public/favicon-32x32.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/OFL-pretendard.txt +94 -0
- package/public/fonts/inter-latin.css +1 -1
- package/public/fonts/noto-sans-ja-bold.woff2 +0 -0
- package/public/fonts/noto-sans-ja.css +26 -2
- package/public/fonts/noto-sans-ja.woff2 +0 -0
- package/public/fonts/{noto-sans-ko.css → peek-preview-kr.css} +4 -4
- package/public/fonts/peek-preview-kr.woff2 +0 -0
- package/public/peek-mark.svg +5 -0
- package/public/fonts/noto-sans-ko.woff2 +0 -0
package/README.en.md
CHANGED
|
@@ -13,10 +13,7 @@ beside the active slide.
|
|
|
13
13
|
[한국어](./README.md) ·
|
|
14
14
|
[Demo](https://lledellebell.github.io/peek-carousel/examples/example-built.html)
|
|
15
15
|
· [Usage reference](./docs/en/reference.md) ·
|
|
16
|
-
[Change notes](https://github.com/lledellebell/peek-carousel/blob/
|
|
17
|
-
|
|
18
|
-
[Wiki user guide](https://github.com/lledellebell/peek-carousel/wiki) ·
|
|
19
|
-
[Questions and ideas](https://github.com/lledellebell/peek-carousel/discussions)
|
|
16
|
+
[Change notes](https://github.com/lledellebell/peek-carousel-docs/blob/main/CHANGELOG.md)
|
|
20
17
|
|
|
21
18
|
The preview supports English, Japanese and Korean. Choose a language in its
|
|
22
19
|
header.
|
|
@@ -33,8 +30,17 @@ application-use license with redistribution restrictions; it is not open source.
|
|
|
33
30
|
npm install peek-carousel
|
|
34
31
|
```
|
|
35
32
|
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
## Choose a layout
|
|
34
|
+
|
|
35
|
+
| Layout | Option value | Presentation and example use |
|
|
36
|
+
| --------- | ------------ | -------------------------------------------------------- |
|
|
37
|
+
| Stack | `'stack'` | Overlapping neighbors around a focused featured image |
|
|
38
|
+
| Radial | `'radial'` | Cards rotating around a circle for a visual showcase |
|
|
39
|
+
| Classic | `'classic'` | Side-by-side horizontal slides for an image gallery |
|
|
40
|
+
| Fan shape | `'fan'` | Up to five cards spread into a fan for a card collection |
|
|
41
|
+
|
|
42
|
+
All layouts wrap around and share the public API. Compare them with the same
|
|
43
|
+
content in the preview before choosing.
|
|
38
44
|
|
|
39
45
|
## Quick start
|
|
40
46
|
|
|
@@ -113,10 +119,16 @@ carousel.next();
|
|
|
113
119
|
// Call carousel.destroy() when unmounting
|
|
114
120
|
```
|
|
115
121
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
122
|
+
This example starts at the first slide, prioritizes page scrolling and disables
|
|
123
|
+
carousel shortcuts. Generated buttons remain keyboard-operable. See the
|
|
124
|
+
[configuration options](./docs/en/reference.md#configuration-options) for
|
|
125
|
+
defaults and shortcut settings.
|
|
126
|
+
|
|
127
|
+
Keep one active instance per container. `destroy()` clears events and timers but
|
|
128
|
+
does not immediately restore generated controls, classes or image attributes.
|
|
129
|
+
Reinitializing the same host after destruction restores the previous generated
|
|
130
|
+
state before applying new options. Original slide nodes and their listeners are
|
|
131
|
+
preserved. See the
|
|
120
132
|
[full options, API, accessibility notes, and troubleshooting](./docs/en/reference.md).
|
|
121
133
|
|
|
122
134
|
[TypeScript, frameworks and other server languages](./docs/integrations.md)
|
|
@@ -141,14 +153,20 @@ container. Changes apply without JavaScript reinitialization.
|
|
|
141
153
|
[CSS variables and live updates](./docs/en/reference.md#multiple-carousels-and-styling)
|
|
142
154
|
· [Custom theme example](./examples/custom-theme.html)
|
|
143
155
|
|
|
144
|
-
##
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
156
|
+
## Upgrading from earlier versions
|
|
157
|
+
|
|
158
|
+
See the
|
|
159
|
+
[upgrade guide](https://github.com/lledellebell/peek-carousel-docs/blob/main/CHANGELOG.md#upgrading-to-200)
|
|
160
|
+
for package entry points, input handling, lifecycle checks and the 2.0.0 terms.
|
|
161
|
+
The npm package and preview are deployed separately, so the latest preview
|
|
162
|
+
design may differ from the installed version.
|
|
163
|
+
|
|
164
|
+
## Support and license
|
|
165
|
+
|
|
166
|
+
- [Report a bug](https://github.com/lledellebell/peek-carousel-docs/issues)
|
|
167
|
+
- [Questions and ideas](https://github.com/lledellebell/peek-carousel-docs/discussions)
|
|
168
|
+
- [Security reporting](https://github.com/lledellebell/peek-carousel-docs/blob/main/SECURITY.md)
|
|
169
|
+
- [Copyright and permitted reuse](./COPYRIGHT.md) ·
|
|
170
|
+
[Application-use terms](./LICENSE)
|
|
171
|
+
- [Legacy MIT material](./LICENSE-MIT) ·
|
|
172
|
+
[Third-party notices](./THIRD_PARTY_NOTICES.md)
|
package/README.md
CHANGED
|
@@ -13,10 +13,7 @@
|
|
|
13
13
|
[English](./README.en.md) ·
|
|
14
14
|
[데모](https://lledellebell.github.io/peek-carousel/examples/example-built.ko.html)
|
|
15
15
|
· [사용 상세](./docs/ko/reference.md) ·
|
|
16
|
-
[변경 안내](https://github.com/lledellebell/peek-carousel/blob/
|
|
17
|
-
|
|
18
|
-
[Wiki 사용자 안내](https://github.com/lledellebell/peek-carousel/wiki) ·
|
|
19
|
-
[질문·기능 제안](https://github.com/lledellebell/peek-carousel/discussions)
|
|
16
|
+
[변경 안내](https://github.com/lledellebell/peek-carousel-docs/blob/main/CHANGELOG.md)
|
|
20
17
|
|
|
21
18
|
미리보기는 영어·일본어·한국어를 지원합니다. 화면 상단에서 언어를 바꿀 수
|
|
22
19
|
있습니다.
|
|
@@ -32,9 +29,17 @@
|
|
|
32
29
|
npm install peek-carousel
|
|
33
30
|
```
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
## 레이아웃 선택
|
|
33
|
+
|
|
34
|
+
| 레이아웃 | 옵션 값 | 표현과 활용 예시 |
|
|
35
|
+
| --------- | ----------- | ---------------------------------------------------------- |
|
|
36
|
+
| Stack | `'stack'` | 중앙 카드에 집중하고 양옆 카드를 겹쳐 보여주는 대표 이미지 |
|
|
37
|
+
| Radial | `'radial'` | 원형으로 배치한 카드가 회전하는 시각적 쇼케이스 |
|
|
38
|
+
| Classic | `'classic'` | 가로로 나란히 이동하는 일반 이미지 갤러리 |
|
|
39
|
+
| Fan shape | `'fan'` | 최대 5장을 부채꼴로 펼쳐 보여주는 카드 컬렉션 |
|
|
40
|
+
|
|
41
|
+
모든 레이아웃은 순환 이동과 같은 공개 API를 사용합니다. 미리보기에서 같은
|
|
42
|
+
콘텐츠로 비교한 뒤 선택하세요.
|
|
38
43
|
|
|
39
44
|
## 빠른 시작
|
|
40
45
|
|
|
@@ -113,9 +118,14 @@ carousel.next();
|
|
|
113
118
|
// 화면에서 제거할 때 carousel.destroy() 호출
|
|
114
119
|
```
|
|
115
120
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
이 예제는 첫 슬라이드부터 시작하고 페이지 스크롤을 우선하며, 캐러셀 단축키를
|
|
122
|
+
끕니다. 생성된 버튼은 키보드로 조작할 수 있습니다. 기본값과 단축키 설정은
|
|
123
|
+
[설정 옵션](./docs/ko/reference.md#설정-옵션)을 참조하세요.
|
|
124
|
+
|
|
125
|
+
컨테이너마다 활성 인스턴스는 하나만 두세요. `destroy()`는 이벤트와 타이머를
|
|
126
|
+
정리하지만 생성한 컨트롤·클래스·이미지 속성은 즉시 복원하지 않습니다. 해제 후
|
|
127
|
+
같은 요소를 재초기화하면 이전 생성 상태를 복원한 뒤 새 옵션을 적용합니다. 원래
|
|
128
|
+
슬라이드 노드와 연결된 이벤트 리스너는 유지합니다.
|
|
119
129
|
[전체 옵션·API·접근성·문제 해결](./docs/ko/reference.md)을 확인하세요.
|
|
120
130
|
|
|
121
131
|
[TypeScript·프레임워크·다른 서버 언어 연동](./docs/integrations.md)
|
|
@@ -140,14 +150,18 @@ JavaScript 재초기화 없이 반영됩니다.
|
|
|
140
150
|
[CSS 변수와 실시간 변경 방법](./docs/ko/reference.md#여러-캐러셀과-스타일-변경)
|
|
141
151
|
· [커스텀 테마 예제](./examples/custom-theme.html)
|
|
142
152
|
|
|
143
|
-
##
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
## 이전 버전에서 전환
|
|
154
|
+
|
|
155
|
+
기존 사용자는
|
|
156
|
+
[버전 전환 안내](https://github.com/lledellebell/peek-carousel-docs/blob/main/CHANGELOG.md#upgrading-to-200)에서
|
|
157
|
+
공개 진입점·입력 처리·생명주기 확인 항목과 2.0.0의 이용 조건을 확인하세요. npm
|
|
158
|
+
패키지와 미리보기는 별도로 배포하므로 최신 미리보기의 디자인이 설치한 버전과
|
|
159
|
+
다를 수 있습니다.
|
|
160
|
+
|
|
161
|
+
## 지원·라이선스
|
|
162
|
+
|
|
163
|
+
- [버그 제보](https://github.com/lledellebell/peek-carousel-docs/issues)
|
|
164
|
+
- [질문·기능 제안](https://github.com/lledellebell/peek-carousel-docs/discussions)
|
|
165
|
+
- [보안 취약점 제보](https://github.com/lledellebell/peek-carousel-docs/blob/main/SECURITY.md)
|
|
166
|
+
- [저작권·이용 조건](./COPYRIGHT.md) · [앱 이용 조건](./LICENSE)
|
|
167
|
+
- [기존 MIT 자료](./LICENSE-MIT) · [제3자 자료 안내](./THIRD_PARTY_NOTICES.md)
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -74,7 +74,7 @@ replace this font license. The font is self-hosted; loading it does not contact
|
|
|
74
74
|
Google Fonts.
|
|
75
75
|
|
|
76
76
|
The subset covers printable ASCII, ©, en/em dashes and curly single quotes at
|
|
77
|
-
weights 400–
|
|
77
|
+
weights 400–750, matching the English preview. Other glyphs use system
|
|
78
78
|
fallbacks.
|
|
79
79
|
|
|
80
80
|
미리보기의 Inter 폰트는 Google Fonts API에서 문자와 굵기를 제한해 받은 서브셋을
|
|
@@ -82,25 +82,35 @@ fallbacks.
|
|
|
82
82
|
않습니다. 영문 화면에 필요한 문자를 포함하며, 나머지 문자는 언어별 폰트 또는
|
|
83
83
|
시스템 폰트로 표시합니다.
|
|
84
84
|
|
|
85
|
-
##
|
|
86
|
-
|
|
87
|
-
`public/fonts/noto-sans-ja.woff2`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
## Japanese preview font · 일본어 폰트
|
|
86
|
+
|
|
87
|
+
`public/fonts/noto-sans-ja.woff2` and `noto-sans-ja-bold.woff2` are Noto Sans JP
|
|
88
|
+
400 and 700 text subsets derived from the Google Fonts CSS API font. The subsets
|
|
89
|
+
retain horizontal text layout features. Japanese pages pair them with Inter.
|
|
90
|
+
Copyright 2014–2021 Adobe, with Reserved Font Name “Source”. The SIL Open Font
|
|
91
|
+
License 1.1 is included at
|
|
92
|
+
[`public/fonts/OFL-noto.txt`](./public/fonts/OFL-noto.txt). See the
|
|
93
|
+
[upstream Noto Sans JP source](https://github.com/google/fonts/tree/main/ofl/notosansjp).
|
|
94
|
+
|
|
95
|
+
## Korean preview font · 한국어 폰트
|
|
96
|
+
|
|
97
|
+
Korean pages use a self-hosted text subset derived from
|
|
98
|
+
[Pretendard v1.3.9](https://github.com/orioncactus/pretendard/tree/v1.3.9). The
|
|
99
|
+
subset includes the preview, theme editor, accessible control names, Latin
|
|
100
|
+
letters and digits. It retains the 400–750 weight range used by the interface.
|
|
101
|
+
It does not load a separate Inter or Noto Sans KR font. Characters outside its
|
|
102
|
+
coverage, including some decorative symbols and foreign-language labels, use
|
|
103
|
+
system-font fallback.
|
|
104
|
+
|
|
105
|
+
Copyright (c) 2021, Kil Hyung-jin. Pretendard is licensed under the SIL Open
|
|
106
|
+
Font License 1.1 with Reserved Font Name Pretendard. This modified subset is
|
|
107
|
+
renamed **Peek Preview KR** internally and is distributed as
|
|
108
|
+
`public/fonts/peek-preview-kr.woff2`. Original copyright and license metadata
|
|
109
|
+
are retained. The full original license is included at
|
|
110
|
+
[`public/fonts/OFL-pretendard.txt`](./public/fonts/OFL-pretendard.txt).
|
|
111
|
+
|
|
112
|
+
한국어 미리보기는 Pretendard의 글자 형태를 유지한 문자·굵기 서브셋을 자체
|
|
113
|
+
호스팅합니다. 예약 이름 조건에 맞춰 서브셋의 내부 이름을 Peek Preview KR로
|
|
114
|
+
변경했으며 원저작자와 OFL 고지를 함께 제공합니다. 폰트를 Google Fonts나 외부
|
|
115
|
+
CDN에서 불러오지 않습니다. 포함하지 않은 문자는 시스템 폰트를 사용합니다.
|
|
116
|
+
프로젝트의 앱 이용 조건으로 이 폰트들을 재허가하지 않습니다.
|
package/dist/peek-carousel.cjs
CHANGED
package/dist/peek-carousel.css
CHANGED
package/dist/peek-carousel.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).PeekCarousel=e()}(this,function(){"use strict";
|
|
2
|
-
/*! PeekCarousel v2.0.
|
|
2
|
+
/*! PeekCarousel v2.0.1
|
|
3
3
|
* Copyright (c) 2025 PeekCarousel
|
|
4
4
|
* Copyright (c) 2026 PeekCarousel contributors
|
|
5
5
|
* @license See LICENSE, LICENSE-MIT and THIRD_PARTY_NOTICES.md.
|
package/docs/en/reference.md
CHANGED
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
## Loading built files
|
|
10
10
|
|
|
11
11
|
See the [quick start](../../README.en.md#quick-start) for ESM and CSS imports.
|
|
12
|
-
Without a bundler, load
|
|
13
|
-
`dist/peek-carousel.js` with a regular `<script>`, then use
|
|
14
|
-
`PeekCarousel` constructor. CommonJS uses `require('peek-carousel')`.
|
|
12
|
+
Without a bundler, load the installed package’s `dist/peek-carousel.min.css`
|
|
13
|
+
with `<link>` and `dist/peek-carousel.js` with a regular `<script>`, then use
|
|
14
|
+
the global `PeekCarousel` constructor. CommonJS uses `require('peek-carousel')`.
|
|
15
15
|
Construction requires a browser DOM; matching ESM/CommonJS declarations support
|
|
16
16
|
TypeScript `NodeNext`.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
generated.
|
|
18
|
+
The npm package includes distribution JS/CSS and type declarations. See
|
|
19
|
+
[installation](../../README.en.md#installation). The UMD filename is
|
|
20
|
+
`peek-carousel.js`; no `peek-carousel.min.js` is generated.
|
|
21
21
|
|
|
22
22
|
## Configuration options
|
|
23
23
|
|
|
@@ -120,11 +120,9 @@ require verification in the integrating application. Accessibility conformance
|
|
|
120
120
|
and compatibility with specific older mobile operating systems are not
|
|
121
121
|
guaranteed.
|
|
122
122
|
|
|
123
|
-
The support target is iOS/iPadOS Safari 15.0 and later.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
Automation exercises current browser engines and selected missing APIs. iOS 15
|
|
127
|
-
physical-device, VoiceOver and native touch-gesture checks remain unverified.
|
|
123
|
+
The support target is iOS/iPadOS Safari 15.0 and later. iOS 15 physical-device,
|
|
124
|
+
VoiceOver and native touch-gesture checks have not yet been performed; automated
|
|
125
|
+
WebKit checks do not replace them.
|
|
128
126
|
|
|
129
127
|
## Multiple carousels and styling
|
|
130
128
|
|
|
@@ -202,9 +200,9 @@ container.style.removeProperty('--peek-carousel-indicator-active-color');
|
|
|
202
200
|
|
|
203
201
|
The [live custom theme example](../../examples/custom-theme.html) includes
|
|
204
202
|
Original, Light, and Flat presets, color/radius/button size controls, and
|
|
205
|
-
generated CSS.
|
|
206
|
-
[
|
|
207
|
-
|
|
203
|
+
generated CSS. Try the
|
|
204
|
+
[hosted theme example](https://lledellebell.github.io/peek-carousel/examples/custom-theme.html)
|
|
205
|
+
without installing the package.
|
|
208
206
|
|
|
209
207
|
## Troubleshooting
|
|
210
208
|
|
|
@@ -216,6 +214,6 @@ open `/examples/custom-theme.html`.
|
|
|
216
214
|
| Duplicate controls after changing views | Keep one active instance per container. Call `destroy()` before reinitializing; the next instance resets the previous generated state. |
|
|
217
215
|
| Demo photos do not load | The main demo requests `picsum.photos`. Check network/CSP settings or supply your own images. |
|
|
218
216
|
|
|
219
|
-
The main demo requests external photos. The custom theme example
|
|
220
|
-
|
|
217
|
+
The main demo requests external photos. The custom theme example uses inline SVG
|
|
218
|
+
and can run without external photo requests. See the
|
|
221
219
|
[third-party notices](../../THIRD_PARTY_NOTICES.md) for image sources.
|
package/docs/integrations.md
CHANGED
|
@@ -1,25 +1,122 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 프로젝트별 연동 · Integrations
|
|
2
|
+
|
|
3
|
+
[한국어](#한국어-연동-안내) · [English](#use-peekcarousel-across-projects)
|
|
4
|
+
|
|
5
|
+
## 한국어 연동 안내
|
|
6
|
+
|
|
7
|
+
PeekCarousel은 브라우저에서 실행합니다. TypeScript 타입 선언을 포함하며,
|
|
8
|
+
Python·Go·Ruby·PHP·Java·.NET 서버 프로젝트는 같은 JS·CSS를 정적 파일로 제공해
|
|
9
|
+
연동합니다. 해당 서버 언어의 네이티브 API를 제공하는 것은 아닙니다.
|
|
10
|
+
|
|
11
|
+
### 설치와 실행 환경
|
|
12
|
+
|
|
13
|
+
[설치 안내](../README.md#설치)에 따라 `npm install peek-carousel`로 설치하세요.
|
|
14
|
+
배포용 JS·CSS와 타입 선언이 포함되어 있어 라이브러리 소스를 따로 빌드하거나
|
|
15
|
+
`@types` 패키지를 설치할 필요가 없습니다. 앱의 번들러·정적 파일 처리 절차는
|
|
16
|
+
그대로 사용하세요. 생성자는 브라우저 DOM이 준비된 뒤 호출해야 합니다.
|
|
17
|
+
|
|
18
|
+
| 환경 | 불러오는 방법 |
|
|
19
|
+
| -------------------- | ------------------------------------ |
|
|
20
|
+
| TypeScript NodeNext | ESM 기본 import 또는 CommonJS 생성자 |
|
|
21
|
+
| TypeScript Bundler | 기본 import와 옵션 타입 |
|
|
22
|
+
| JavaScript `checkJs` | 기본 import와 JSDoc 옵션 타입 |
|
|
23
|
+
| 번들러 없는 브라우저 | CSS link와 UMD script |
|
|
24
|
+
| 서버 템플릿 | HTML과 브라우저용 정적 파일 제공 |
|
|
25
|
+
|
|
26
|
+
### TypeScript와 JavaScript
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import PeekCarousel, {type PeekCarouselOptions} from 'peek-carousel';
|
|
30
|
+
import 'peek-carousel/dist/peek-carousel.css';
|
|
31
|
+
|
|
32
|
+
const options = {
|
|
33
|
+
layoutMode: 'fan',
|
|
34
|
+
startIndex: 0,
|
|
35
|
+
enableKeyboard: false,
|
|
36
|
+
} satisfies PeekCarouselOptions;
|
|
37
|
+
|
|
38
|
+
const host = document.querySelector<HTMLElement>('.gallery-carousel');
|
|
39
|
+
if (!host) {
|
|
40
|
+
throw new Error('Gallery markup is missing');
|
|
41
|
+
}
|
|
42
|
+
const carousel = new PeekCarousel(host, options);
|
|
43
|
+
|
|
44
|
+
carousel.next();
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
호스트 높이와 트랙·슬라이드 마크업은 [빠른 시작](../README.md#빠른-시작)을
|
|
48
|
+
참조하세요. 여러 인스턴스에는 고유한 ID 또는 각각의 DOM 참조를 사용합니다. 일반
|
|
49
|
+
JavaScript에서는 위 코드의 타입 import와 `satisfies`를 빼고 사용하세요.
|
|
50
|
+
`checkJs` 환경에서는 JSDoc에 `import('peek-carousel').PeekCarouselOptions`로
|
|
51
|
+
옵션 타입을 지정할 수 있습니다.
|
|
52
|
+
|
|
53
|
+
### 프레임워크 생명주기
|
|
54
|
+
|
|
55
|
+
| 환경 | 초기화 시점 | 정리 시점 |
|
|
56
|
+
| ------ | --------------------------------- | ---------------------------------- |
|
|
57
|
+
| React | DOM ref를 사용하는 `useEffect` | 반환하는 정리 함수에서 `destroy()` |
|
|
58
|
+
| Vue | template ref가 준비된 `onMounted` | `onBeforeUnmount`에서 `destroy()` |
|
|
59
|
+
| Svelte | 동기 `onMount` 콜백 | 반환하는 정리 함수에서 `destroy()` |
|
|
60
|
+
|
|
61
|
+
인스턴스는 컴포넌트별로 보관하고 DOM 제거·교체 전에 정리하세요. 서버 렌더링
|
|
62
|
+
도중이나 렌더마다 초기화하지 마세요. 프레임워크와 캐러셀이 같은 슬라이드 노드를
|
|
63
|
+
동시에 재배열·교체하지 않도록 하세요. 슬라이드 목록을 바꿀 때는 먼저 해제하고
|
|
64
|
+
마크업을 갱신한 다음 새 인스턴스를 만듭니다.
|
|
65
|
+
|
|
66
|
+
별도의 React·Vue·Svelte 패키지는 제공하지 않으며, 프레임워크별 앱 전체 검증은
|
|
67
|
+
수행하지 않았습니다. 설치한 프레임워크의 CSS 로딩 및 클라이언트·서버 경계 규칙은
|
|
68
|
+
아래 공식 문서를 참조하세요.
|
|
69
|
+
|
|
70
|
+
### Python·Go 등 서버 프로젝트
|
|
71
|
+
|
|
72
|
+
설치한 패키지의 `dist/peek-carousel.min.css`와 `dist/peek-carousel.js`를 앱의
|
|
73
|
+
정적 파일 경로로 복사·제공하세요. 다음은 앱에서 직접 정하는 URL 예시이며,
|
|
74
|
+
호스팅된 CDN 주소가 아닙니다. 스크립트는 표시한 순서대로 불러옵니다.
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<link rel="stylesheet" href="/static/peek-carousel/peek-carousel.min.css" />
|
|
78
|
+
<script src="/static/peek-carousel/peek-carousel.js" defer></script>
|
|
79
|
+
<script src="/static/gallery.js" defer></script>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
별도의 `gallery.js` 파일에서 초기화합니다.
|
|
83
|
+
|
|
84
|
+
```javascript
|
|
85
|
+
const host = document.querySelector('.gallery-carousel');
|
|
86
|
+
if (host) {
|
|
87
|
+
const carousel = new PeekCarousel(host, {layoutMode: 'fan', startIndex: 0});
|
|
88
|
+
// 클라이언트 코드가 호스트를 교체하기 전에 carousel.destroy()를 호출하세요.
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Django·Flask·Go templates·Rails·Laravel·Spring·ASP.NET 등에서 같은 방식을 사용할
|
|
93
|
+
수 있습니다. 클라이언트 라우팅이나 부분 HTML 교체 전에는 기존 인스턴스의
|
|
94
|
+
`destroy()`를 호출하세요. 재배포하는 자산에는 `LICENSE`·`LICENSE-MIT`·
|
|
95
|
+
`THIRD_PARTY_NOTICES.md`를 포함하세요. 앱 통합과 라이브러리 자체의 독립 재배포
|
|
96
|
+
조건은 [이용 조건](../LICENSE)과 [저작권 안내](../COPYRIGHT.md)를 확인하세요.
|
|
97
|
+
|
|
98
|
+
## Use PeekCarousel across projects
|
|
2
99
|
|
|
3
100
|
PeekCarousel runs in the browser. TypeScript projects can use the included
|
|
4
101
|
option and instance types; projects written in another server language can serve
|
|
5
102
|
the same browser JavaScript and CSS. This does not provide native Python, Go,
|
|
6
103
|
Ruby, PHP, Java or .NET APIs.
|
|
7
104
|
|
|
8
|
-
|
|
105
|
+
### Checked entry points
|
|
9
106
|
|
|
10
|
-
| Project setup | Integration |
|
|
11
|
-
| ----------------------------------- | ------------------------------------------ |
|
|
12
|
-
| TypeScript with NodeNext resolution | Default ESM import or CommonJS constructor |
|
|
13
|
-
| TypeScript with Bundler resolution | Default import and named option type |
|
|
14
|
-
| JavaScript with `checkJs` | Default import and JSDoc option type |
|
|
15
|
-
| Browser without a bundler | CSS link and UMD script |
|
|
16
|
-
| Server-rendered templates | Serve the browser assets with the page |
|
|
107
|
+
| Project setup | Integration |
|
|
108
|
+
| ----------------------------------- | ------------------------------------------ |
|
|
109
|
+
| TypeScript with NodeNext resolution | Default ESM import or CommonJS constructor |
|
|
110
|
+
| TypeScript with Bundler resolution | Default import and named option type |
|
|
111
|
+
| JavaScript with `checkJs` | Default import and JSDoc option type |
|
|
112
|
+
| Browser without a bundler | CSS link and UMD script |
|
|
113
|
+
| Server-rendered templates | Serve the browser assets with the page |
|
|
17
114
|
|
|
18
|
-
|
|
115
|
+
Install the published npm package using the
|
|
19
116
|
[installation instructions](../README.en.md#installation). No additional
|
|
20
117
|
`@types` package or runtime dependency is needed.
|
|
21
118
|
|
|
22
|
-
|
|
119
|
+
### TypeScript and JavaScript
|
|
23
120
|
|
|
24
121
|
```typescript
|
|
25
122
|
import PeekCarousel, {type PeekCarouselOptions} from 'peek-carousel';
|
|
@@ -51,7 +148,7 @@ The host needs a height, a `.peek-carousel__track` child, and
|
|
|
51
148
|
contains complete markup. A stable element reference avoids duplicate selector
|
|
52
149
|
IDs when several component instances are mounted.
|
|
53
150
|
|
|
54
|
-
|
|
151
|
+
### Component lifecycle
|
|
55
152
|
|
|
56
153
|
Initialize after the framework has mounted the DOM and destroy before removing
|
|
57
154
|
it. Keep each instance local to its component. Do not initialize during server
|
|
@@ -65,18 +162,17 @@ reorder or replace the same slide nodes.
|
|
|
65
162
|
| Svelte | Synchronous `onMount` callback | Return a function that calls `destroy()` |
|
|
66
163
|
|
|
67
164
|
These are lifecycle integration patterns, not separately published framework
|
|
68
|
-
components.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
fresh instance.
|
|
165
|
+
components. Full React, Vue and Svelte applications have not been verified.
|
|
166
|
+
Follow the installed framework's asset-loading and client/server boundary rules.
|
|
167
|
+
When replacing the slide collection, destroy, update the markup, and initialize
|
|
168
|
+
a fresh instance.
|
|
73
169
|
|
|
74
170
|
The patterns follow the official
|
|
75
171
|
[React effect documentation](https://react.dev/reference/react/useEffect),
|
|
76
172
|
[Vue lifecycle API](https://vuejs.org/api/composition-api-lifecycle.html) and
|
|
77
173
|
[Svelte lifecycle documentation](https://svelte.dev/docs/svelte/lifecycle-hooks).
|
|
78
174
|
|
|
79
|
-
|
|
175
|
+
### Python, Go and other server projects
|
|
80
176
|
|
|
81
177
|
Django, Flask, Go templates, Rails, Laravel, Spring and ASP.NET can serve the
|
|
82
178
|
built assets through their existing static-file mechanism. Render the same HTML
|
|
@@ -105,11 +201,3 @@ current license, legacy MIT license and third-party notices with redistributed
|
|
|
105
201
|
assets. Standalone redistribution of new covered library material requires
|
|
106
202
|
separate written permission. Example URLs above are placeholders for the
|
|
107
203
|
application's static routing, not hosted CDN URLs.
|
|
108
|
-
|
|
109
|
-
## 한국어 요약
|
|
110
|
-
|
|
111
|
-
NodeNext·Bundler 방식의 TypeScript와 타입 검사하는 JavaScript를 검증합니다.
|
|
112
|
-
React·Vue·Svelte에서는 DOM 마운트 후 초기화하고 제거 시 `destroy()`를
|
|
113
|
-
호출합니다. Python·Go 등 서버 프로젝트는 HTML과 정적 JS/CSS를 제공하는 방식으로
|
|
114
|
-
연동합니다. 별도의 네이티브 언어 API나 프레임워크 패키지를 제공하는 것은
|
|
115
|
-
아닙니다.
|
package/docs/ko/reference.md
CHANGED
|
@@ -8,14 +8,15 @@
|
|
|
8
8
|
## 빌드 파일 불러오기
|
|
9
9
|
|
|
10
10
|
ESM·CSS import는 [빠른 시작](../../README.md#빠른-시작)을 참조하세요. 번들러
|
|
11
|
-
없이 사용하려면
|
|
11
|
+
없이 사용하려면 설치한 패키지의 `dist/peek-carousel.min.css`를 `<link>`로,
|
|
12
12
|
`dist/peek-carousel.js`를 일반 `<script>`로 불러온 뒤 전역 `PeekCarousel`
|
|
13
13
|
생성자를 사용합니다. CommonJS는 `require('peek-carousel')`로 불러옵니다.
|
|
14
14
|
생성자는 브라우저 DOM이 필요하며 TypeScript `NodeNext`에 맞는 ESM·CommonJS 타입
|
|
15
15
|
선언을 제공합니다.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
npm으로 설치한 패키지에는 배포용 JS·CSS와 타입 선언이 포함됩니다.
|
|
18
|
+
[설치 안내](../../README.md#설치)를 참조하세요. UMD 파일 이름은
|
|
19
|
+
`peek-carousel.js`이며 `peek-carousel.min.js`는 생성하지 않습니다.
|
|
19
20
|
|
|
20
21
|
## 설정 옵션
|
|
21
22
|
|
|
@@ -114,11 +115,8 @@ Space·Enter는 기본 버튼 활성화 동작을 사용합니다. 일반 페이
|
|
|
114
115
|
설정·키보드 포커스 흐름은 통합한 앱에서 검증해야 합니다. 접근성 규격 준수나 특정
|
|
115
116
|
구형 모바일 OS 호환성을 보장하지 않습니다.
|
|
116
117
|
|
|
117
|
-
지원
|
|
118
|
-
|
|
119
|
-
사용합니다. `:focus-visible` 미지원 브라우저에는 초점 표시 대체 스타일을
|
|
120
|
-
제공합니다. 자동 검증은 현재 브라우저 엔진과 일부 API 부재 조건을 확인합니다.
|
|
121
|
-
iOS 15 실기기·VoiceOver·실제 터치 제스처 검증은 아직 수행하지 않았습니다.
|
|
118
|
+
지원 대상은 iOS/iPadOS Safari 15.0 이상입니다. iOS 15 실기기·VoiceOver·실제 터치
|
|
119
|
+
제스처 검증은 아직 수행하지 않았으며, 자동 WebKit 검사가 이를 대신하지 않습니다.
|
|
122
120
|
|
|
123
121
|
## 여러 캐러셀과 스타일 변경
|
|
124
122
|
|
|
@@ -196,8 +194,9 @@ container.style.removeProperty('--peek-carousel-indicator-active-color');
|
|
|
196
194
|
|
|
197
195
|
[실시간 커스텀 테마 예제](../../examples/custom-theme.html)는
|
|
198
196
|
Original·Light·Flat 프리셋, 색상·모서리·버튼 크기 조절과 CSS 출력 기능을
|
|
199
|
-
제공합니다.
|
|
200
|
-
|
|
197
|
+
제공합니다.
|
|
198
|
+
[호스팅된 한국어 테마 예제](https://lledellebell.github.io/peek-carousel/examples/custom-theme.ko.html)에서
|
|
199
|
+
설치 없이 체험할 수 있습니다.
|
|
201
200
|
|
|
202
201
|
## 문제 해결
|
|
203
202
|
|
|
@@ -209,6 +208,6 @@ Original·Light·Flat 프리셋, 색상·모서리·버튼 크기 조절과 CSS
|
|
|
209
208
|
| 화면 전환 후 컨트롤이 중복됨 | 컨테이너마다 활성 인스턴스는 하나만 두세요. 재생성 전에 `destroy()`를 호출하면 다음 초기화가 이전 생성 상태를 정리합니다. |
|
|
210
209
|
| 데모 사진이 로드되지 않음 | 기본 데모는 `picsum.photos`를 요청합니다. 네트워크·CSP 설정을 확인하거나 직접 제공하는 이미지로 교체하세요. |
|
|
211
210
|
|
|
212
|
-
기본 데모는 외부 사진을 요청합니다. 커스텀 테마
|
|
213
|
-
|
|
211
|
+
기본 데모는 외부 사진을 요청합니다. 커스텀 테마 예제는 인라인 SVG를 사용해 외부
|
|
212
|
+
사진 요청 없이 실행할 수 있습니다. 이미지 출처는
|
|
214
213
|
[제3자 자료 안내](../../THIRD_PARTY_NOTICES.md)를 참조하세요.
|