@evermade/overflow-slider 3.3.1 → 4.0.0
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/.nvmrc +1 -1
- package/README.md +115 -29
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +609 -1
- package/dist/index.esm.js.map +1 -0
- package/dist/index.min.js +2 -1
- package/dist/index.min.js.map +1 -0
- package/dist/mixins.scss +14 -0
- package/dist/overflow-slider.css +1 -1
- package/dist/plugins/arrows/index.d.ts +26 -0
- package/dist/plugins/arrows/index.min.js +1 -1
- package/dist/plugins/autoplay/index.d.ts +41 -0
- package/dist/plugins/autoplay/index.esm.js +233 -0
- package/dist/plugins/autoplay/index.min.js +1 -0
- package/dist/plugins/core/index.d.ts +75 -0
- package/dist/plugins/core/index.d2.ts +23 -0
- package/dist/plugins/dots/index.d.ts +16 -0
- package/dist/plugins/dots/index.min.js +1 -1
- package/dist/plugins/drag-scrolling/index.d.ts +9 -0
- package/dist/plugins/drag-scrolling/index.esm.js +2 -2
- package/dist/plugins/drag-scrolling/index.min.js +1 -1
- package/dist/plugins/fade/index.d.ts +16 -0
- package/dist/plugins/fade/index.min.js +1 -1
- package/dist/plugins/full-width/index.d.ts +11 -0
- package/dist/plugins/full-width/index.esm.js +14 -3
- package/dist/plugins/full-width/index.min.js +1 -1
- package/dist/plugins/infinite-scroll/index.d.ts +25 -0
- package/dist/plugins/infinite-scroll/index.esm.js +75 -0
- package/dist/plugins/infinite-scroll/index.min.js +1 -0
- package/dist/plugins/scroll-indicator/index.d.ts +14 -0
- package/dist/plugins/scroll-indicator/index.esm.js +3 -1
- package/dist/plugins/scroll-indicator/index.min.js +1 -1
- package/dist/plugins/skip-links/index.d.ts +17 -0
- package/dist/plugins/skip-links/index.esm.js +7 -1
- package/dist/plugins/skip-links/index.min.js +1 -1
- package/dist/plugins/thumbnails/index.d.ts +9 -0
- package/dist/plugins/thumbnails/index.min.js +1 -1
- package/dist/{core/utils.min.js → utils-Sxwcz8zp.js} +1 -1
- package/dist/{core/utils.esm.js → utils-ayDxlweP.js} +1 -1
- package/docs/assets/demo.css +115 -0
- package/docs/assets/demo.js +68 -0
- package/docs/dist/index.d.ts +1 -0
- package/docs/dist/index.esm.js +609 -1
- package/docs/dist/index.esm.js.map +1 -0
- package/docs/dist/index.min.js +2 -1
- package/docs/dist/index.min.js.map +1 -0
- package/docs/dist/mixins.scss +14 -0
- package/docs/dist/overflow-slider.css +1 -1
- package/docs/dist/plugins/arrows/index.d.ts +26 -0
- package/docs/dist/plugins/arrows/index.min.js +1 -1
- package/docs/dist/plugins/autoplay/index.d.ts +41 -0
- package/docs/dist/plugins/autoplay/index.esm.js +233 -0
- package/docs/dist/plugins/autoplay/index.min.js +1 -0
- package/docs/dist/plugins/core/index.d.ts +23 -0
- package/docs/dist/plugins/core/index.d2.ts +75 -0
- package/docs/dist/plugins/dots/index.d.ts +16 -0
- package/docs/dist/plugins/dots/index.min.js +1 -1
- package/docs/dist/plugins/drag-scrolling/index.d.ts +9 -0
- package/docs/dist/plugins/drag-scrolling/index.esm.js +2 -2
- package/docs/dist/plugins/drag-scrolling/index.min.js +1 -1
- package/docs/dist/plugins/fade/index.d.ts +16 -0
- package/docs/dist/plugins/fade/index.min.js +1 -1
- package/docs/dist/plugins/full-width/index.d.ts +11 -0
- package/docs/dist/plugins/full-width/index.esm.js +14 -3
- package/docs/dist/plugins/full-width/index.min.js +1 -1
- package/docs/dist/plugins/infinite-scroll/index.d.ts +25 -0
- package/docs/dist/plugins/infinite-scroll/index.esm.js +75 -0
- package/docs/dist/plugins/infinite-scroll/index.min.js +1 -0
- package/docs/dist/plugins/scroll-indicator/index.d.ts +14 -0
- package/docs/dist/plugins/scroll-indicator/index.esm.js +3 -1
- package/docs/dist/plugins/scroll-indicator/index.min.js +1 -1
- package/docs/dist/plugins/skip-links/index.d.ts +17 -0
- package/docs/dist/plugins/skip-links/index.esm.js +7 -1
- package/docs/dist/plugins/skip-links/index.min.js +1 -1
- package/docs/dist/plugins/thumbnails/index.d.ts +9 -0
- package/docs/dist/plugins/thumbnails/index.min.js +1 -1
- package/docs/dist/{core/utils.min.js → utils-Sxwcz8zp.js} +1 -1
- package/docs/dist/{core/utils.esm.js → utils-ayDxlweP.js} +1 -1
- package/docs/index-rtl.html +78 -2
- package/docs/index.html +77 -1
- package/package.json +50 -27
- package/rollup.config.js +90 -66
- package/src/core/details.ts +4 -0
- package/src/core/overflow-slider.ts +4 -2
- package/src/core/slider.ts +91 -64
- package/src/core/types.ts +29 -1
- package/src/mixins.scss +14 -0
- package/src/overflow-slider.scss +12 -10
- package/src/plugins/arrows/index.ts +2 -2
- package/src/plugins/autoplay/index.ts +276 -0
- package/src/plugins/autoplay/styles.scss +11 -0
- package/src/plugins/dots/index.ts +2 -2
- package/src/plugins/drag-scrolling/index.ts +4 -4
- package/src/plugins/fade/index.ts +2 -2
- package/src/plugins/full-width/index.ts +17 -5
- package/src/plugins/infinite-scroll/index.ts +109 -0
- package/src/plugins/scroll-indicator/index.ts +5 -3
- package/src/plugins/skip-links/index.ts +2 -2
- package/src/plugins/thumbnails/index.ts +2 -2
- package/tsconfig.json +4 -2
- package/changelog.md +0 -5
- package/dist/core/details.esm.js +0 -35
- package/dist/core/details.min.js +0 -1
- package/dist/core/overflow-slider.esm.js +0 -29
- package/dist/core/overflow-slider.min.js +0 -1
- package/dist/core/slider.esm.js +0 -499
- package/dist/core/slider.min.js +0 -1
- package/docs/dist/core/details.esm.js +0 -35
- package/docs/dist/core/details.min.js +0 -1
- package/docs/dist/core/overflow-slider.esm.js +0 -29
- package/docs/dist/core/overflow-slider.min.js +0 -1
- package/docs/dist/core/slider.esm.js +0 -499
- package/docs/dist/core/slider.min.js +0 -1
package/docs/index.html
CHANGED
|
@@ -190,6 +190,67 @@
|
|
|
190
190
|
</div>
|
|
191
191
|
</div>
|
|
192
192
|
|
|
193
|
+
<div class="entry__item">
|
|
194
|
+
<h3>Autoplay (slide)</h3>
|
|
195
|
+
<p>Use autoplay and set delay. If user prefers reduced motion, autoplay does not execute.</p>
|
|
196
|
+
<div class="example-container-1-autoplay-wrap-slide">
|
|
197
|
+
<div class="overflow-slider example-container example-container-1-autoplay-slide">
|
|
198
|
+
<a href="#1" class="example-item example-item--1">1</a>
|
|
199
|
+
<a href="#2" class="example-item example-item--2">2</a>
|
|
200
|
+
<a href="#3" class="example-item example-item--3">3</a>
|
|
201
|
+
<a href="#4" class="example-item example-item--4">4</a>
|
|
202
|
+
<a href="#5" class="example-item example-item--5">5</a>
|
|
203
|
+
<a href="#6" class="example-item example-item--6">6</a>
|
|
204
|
+
<a href="#7" class="example-item example-item--7">7</a>
|
|
205
|
+
<a href="#8" class="example-item example-item--8">8</a>
|
|
206
|
+
<a href="#9" class="example-item example-item--9">9</a>
|
|
207
|
+
<a href="#10" class="example-item example-item--10">10</a>
|
|
208
|
+
</div>
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
|
|
212
|
+
<div class="entry__item">
|
|
213
|
+
<h3>Autoplay (view)</h3>
|
|
214
|
+
<p>Use autoplay and set delay. If user prefers reduced motion, autoplay does not execute.</p>
|
|
215
|
+
<div class="example-container-1-autoplay-wrap-view">
|
|
216
|
+
<div class="overflow-slider example-container example-container-1-autoplay-view">
|
|
217
|
+
<a href="#1" class="example-item example-item--1">1</a>
|
|
218
|
+
<a href="#2" class="example-item example-item--2">2</a>
|
|
219
|
+
<a href="#3" class="example-item example-item--3">3</a>
|
|
220
|
+
<a href="#4" class="example-item example-item--4">4</a>
|
|
221
|
+
<a href="#5" class="example-item example-item--5">5</a>
|
|
222
|
+
<a href="#6" class="example-item example-item--6">6</a>
|
|
223
|
+
<a href="#7" class="example-item example-item--7">7</a>
|
|
224
|
+
<a href="#8" class="example-item example-item--8">8</a>
|
|
225
|
+
<a href="#9" class="example-item example-item--9">9</a>
|
|
226
|
+
<a href="#10" class="example-item example-item--10">10</a>
|
|
227
|
+
</div>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
<!--
|
|
231
|
+
<div class="entry__item">
|
|
232
|
+
<h3>Infinite scroll</h3>
|
|
233
|
+
<p>This is a bad idea. Please don't use.</p>
|
|
234
|
+
<div class="example-container-1-infinite-wrap">
|
|
235
|
+
<div class="overflow-slider example-container example-container-1-infinite">
|
|
236
|
+
<a href="#1" class="example-item example-item--1">1</a>
|
|
237
|
+
<a href="#2" class="example-item example-item--2">2</a>
|
|
238
|
+
<a href="#3" class="example-item example-item--3">3</a>
|
|
239
|
+
<a href="#4" class="example-item example-item--4">4</a>
|
|
240
|
+
<a href="#5" class="example-item example-item--5">5</a>
|
|
241
|
+
<a href="#6" class="example-item example-item--6">6</a>
|
|
242
|
+
<a href="#7" class="example-item example-item--7">7</a>
|
|
243
|
+
<a href="#8" class="example-item example-item--8">8</a>
|
|
244
|
+
<a href="#9" class="example-item example-item--9">9</a>
|
|
245
|
+
<a href="#10" class="example-item example-item--10">10</a>
|
|
246
|
+
<a href="#11" class="example-item example-item--11">11</a>
|
|
247
|
+
<a href="#12" class="example-item example-item--12">12</a>
|
|
248
|
+
<a href="#13" class="example-item example-item--13">13</a>
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
-->
|
|
253
|
+
|
|
193
254
|
</section>
|
|
194
255
|
|
|
195
256
|
<section class="entry__section">
|
|
@@ -363,7 +424,7 @@
|
|
|
363
424
|
|
|
364
425
|
<div class="entry__item">
|
|
365
426
|
<h3>Synced Slider</h3>
|
|
366
|
-
<p>Sync slides from thumbnails
|
|
427
|
+
<p>Sync slides from thumbnails.</p>
|
|
367
428
|
<div class="example-container-4-thumbnails-wrapper">
|
|
368
429
|
<div class="overflow-slider example-container-4-synced-main">
|
|
369
430
|
<a href="#1" class="example-item example-item--1">1</a>
|
|
@@ -396,6 +457,21 @@
|
|
|
396
457
|
</div>
|
|
397
458
|
</div>
|
|
398
459
|
|
|
460
|
+
<div class="entry__item">
|
|
461
|
+
<h3>Autoplaying Hero</h3>
|
|
462
|
+
<p>It's possible. Not saying you should.</p>
|
|
463
|
+
<div class="example-container-4-hero__wrapper">
|
|
464
|
+
<div class="example-container-4-hero__autoplay"></div>
|
|
465
|
+
<div class="example-container-4-hero__dots"></div>
|
|
466
|
+
<div class="overflow-slider example-container-4-hero">
|
|
467
|
+
<a href="#1" class="example-item example-item--1">1</a>
|
|
468
|
+
<a href="#2" class="example-item example-item--2">2</a>
|
|
469
|
+
<a href="#3" class="example-item example-item--3">3</a>
|
|
470
|
+
<a href="#4" class="example-item example-item--4">4</a>
|
|
471
|
+
</div>
|
|
472
|
+
</div>
|
|
473
|
+
</div>
|
|
474
|
+
|
|
399
475
|
</section>
|
|
400
476
|
|
|
401
477
|
</div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evermade/overflow-slider",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Accessible slider
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Accessible slider that is powered by overflow: auto.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -9,41 +9,63 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./dist/index.esm.js",
|
|
12
|
-
"require": "./dist/index.min.js"
|
|
12
|
+
"require": "./dist/index.min.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
13
14
|
},
|
|
14
15
|
"./plugins/drag-scrolling": {
|
|
15
16
|
"import": "./dist/plugins/drag-scrolling/index.esm.js",
|
|
16
|
-
"require": "./dist/plugins/drag-scrolling/index.min.js"
|
|
17
|
+
"require": "./dist/plugins/drag-scrolling/index.min.js",
|
|
18
|
+
"types": "./dist/plugins/drag-scrolling/index.d.ts"
|
|
17
19
|
},
|
|
18
20
|
"./plugins/skip-links": {
|
|
19
21
|
"import": "./dist/plugins/skip-links/index.esm.js",
|
|
20
|
-
"require": "./dist/plugins/skip-links/index.min.js"
|
|
22
|
+
"require": "./dist/plugins/skip-links/index.min.js",
|
|
23
|
+
"types": "./dist/plugins/skip-links/index.d.ts"
|
|
21
24
|
},
|
|
22
25
|
"./plugins/scroll-indicator": {
|
|
23
26
|
"import": "./dist/plugins/scroll-indicator/index.esm.js",
|
|
24
|
-
"require": "./dist/plugins/scroll-indicator/index.min.js"
|
|
27
|
+
"require": "./dist/plugins/scroll-indicator/index.min.js",
|
|
28
|
+
"types": "./dist/plugins/scroll-indicator/index.d.ts"
|
|
25
29
|
},
|
|
26
30
|
"./plugins/arrows": {
|
|
27
31
|
"import": "./dist/plugins/arrows/index.esm.js",
|
|
28
|
-
"require": "./dist/plugins/arrows/index.min.js"
|
|
32
|
+
"require": "./dist/plugins/arrows/index.min.js",
|
|
33
|
+
"types": "./dist/plugins/arrows/index.d.ts"
|
|
34
|
+
},
|
|
35
|
+
"./plugins/autoplay": {
|
|
36
|
+
"import": "./dist/plugins/autoplay/index.esm.js",
|
|
37
|
+
"require": "./dist/plugins/autoplay/index.min.js",
|
|
38
|
+
"types": "./dist/plugins/autoplay/index.d.ts"
|
|
29
39
|
},
|
|
30
40
|
"./plugins/full-width": {
|
|
31
41
|
"import": "./dist/plugins/full-width/index.esm.js",
|
|
32
|
-
"require": "./dist/plugins/full-width/index.min.js"
|
|
42
|
+
"require": "./dist/plugins/full-width/index.min.js",
|
|
43
|
+
"types": "./dist/plugins/full-width/index.d.ts"
|
|
33
44
|
},
|
|
34
45
|
"./plugins/dots": {
|
|
35
46
|
"import": "./dist/plugins/dots/index.esm.js",
|
|
36
|
-
"require": "./dist/plugins/dots/index.min.js"
|
|
47
|
+
"require": "./dist/plugins/dots/index.min.js",
|
|
48
|
+
"types": "./dist/plugins/dots/index.d.ts"
|
|
37
49
|
},
|
|
38
50
|
"./plugins/thumbnails": {
|
|
39
51
|
"import": "./dist/plugins/thumbnails/index.esm.js",
|
|
40
|
-
"require": "./dist/plugins/thumbnails/index.min.js"
|
|
52
|
+
"require": "./dist/plugins/thumbnails/index.min.js",
|
|
53
|
+
"types": "./dist/plugins/thumbnails/index.d.ts"
|
|
41
54
|
},
|
|
42
55
|
"./plugins/fade": {
|
|
43
56
|
"import": "./dist/plugins/fade/index.esm.js",
|
|
44
|
-
"require": "./dist/plugins/fade/index.min.js"
|
|
57
|
+
"require": "./dist/plugins/fade/index.min.js",
|
|
58
|
+
"types": "./dist/plugins/fade/index.d.ts"
|
|
59
|
+
},
|
|
60
|
+
"./plugins/infinite-scroll": {
|
|
61
|
+
"import": "./dist/plugins/infinite-scroll/index.esm.js",
|
|
62
|
+
"require": "./dist/plugins/infinite-scroll/index.min.js",
|
|
63
|
+
"types": "./dist/plugins/infinite-scroll/index.d.ts"
|
|
45
64
|
},
|
|
46
|
-
"./style.css": "./dist/overflow-slider.css"
|
|
65
|
+
"./style.css": "./dist/overflow-slider.css",
|
|
66
|
+
"./style": "./dist/overflow-slider.css",
|
|
67
|
+
"./mixins.scss": "./dist/mixins.scss",
|
|
68
|
+
"./mixins": "./dist/mixins.scss"
|
|
47
69
|
},
|
|
48
70
|
"repository": {
|
|
49
71
|
"type": "git",
|
|
@@ -53,11 +75,11 @@
|
|
|
53
75
|
"overflow-slider"
|
|
54
76
|
],
|
|
55
77
|
"scripts": {
|
|
56
|
-
"build": "rollup -c",
|
|
78
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
57
79
|
"compress": "gzip -9 -fkc dist/index.min.js > dist/index.min.js.gz",
|
|
58
80
|
"show": "ls -lh dist/index.min.js.gz | awk '{print \"Gzipped script size:\", $5\"B\"}'",
|
|
59
81
|
"size": "npm run build -- --silent && npm run compress --silent && npm run show && rm dist/index.min.js.gz",
|
|
60
|
-
"
|
|
82
|
+
"start": "rollup -c -w --bundleConfigAsCjs",
|
|
61
83
|
"test": "echo \"No tests specified\" && exit 0"
|
|
62
84
|
},
|
|
63
85
|
"author": "Teemu Suoranta, Evermade",
|
|
@@ -66,21 +88,22 @@
|
|
|
66
88
|
"url": "https://github.com/evermade/overflow-slider/issues"
|
|
67
89
|
},
|
|
68
90
|
"devDependencies": {
|
|
69
|
-
"@rollup/plugin-commonjs": "^
|
|
70
|
-
"@rollup/plugin-node-resolve": "^
|
|
71
|
-
"@rollup/plugin-
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@wordpress/
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
91
|
+
"@rollup/plugin-commonjs": "^28.0.6",
|
|
92
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
93
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
94
|
+
"@rollup/plugin-typescript": "^12.1.3",
|
|
95
|
+
"@tsconfig/recommended": "^1.0.10",
|
|
96
|
+
"@wordpress/eslint-plugin": "^22.11.0",
|
|
97
|
+
"@wordpress/prettier-config": "^4.25.0",
|
|
98
|
+
"autoprefixer": "^10.4.21",
|
|
99
|
+
"cssnano": "^7.0.7",
|
|
100
|
+
"eslint": "^9.29.0",
|
|
101
|
+
"rollup": "^4.44.0",
|
|
79
102
|
"rollup-plugin-copy": "^3.5.0",
|
|
103
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
80
104
|
"rollup-plugin-postcss": "^4.0.2",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"typescript": "^5.1.6"
|
|
105
|
+
"sass": "^1.89.2",
|
|
106
|
+
"typescript": "^5.8.3"
|
|
84
107
|
},
|
|
85
108
|
"homepage": "https://github.com/evermade/overflow-slider#readme",
|
|
86
109
|
"publishConfig": {
|
package/rollup.config.js
CHANGED
|
@@ -1,79 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
// rollup.config.js
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import glob from 'glob';
|
|
2
4
|
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
|
3
5
|
import commonjs from '@rollup/plugin-commonjs';
|
|
4
6
|
import typescript from '@rollup/plugin-typescript';
|
|
5
7
|
import postcss from 'rollup-plugin-postcss';
|
|
6
8
|
import copy from 'rollup-plugin-copy';
|
|
7
|
-
import
|
|
9
|
+
import terser from '@rollup/plugin-terser';
|
|
10
|
+
import { dts } from 'rollup-plugin-dts';
|
|
11
|
+
|
|
12
|
+
// Define core entry and plugin entries separately
|
|
13
|
+
const coreInput = 'src/index.ts';
|
|
14
|
+
const pluginInputs = glob
|
|
15
|
+
.sync('src/plugins/*/index.ts')
|
|
16
|
+
.reduce((out, file) => {
|
|
17
|
+
const name = path.basename(path.dirname(file));
|
|
18
|
+
out[name] = file;
|
|
19
|
+
return out;
|
|
20
|
+
}, {});
|
|
21
|
+
// For declarations, include both core and plugins
|
|
22
|
+
const allEntries = { index: coreInput, ...pluginInputs };
|
|
8
23
|
|
|
9
24
|
const plugins = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
})
|
|
25
|
+
typescript({
|
|
26
|
+
tsconfig: './tsconfig.json',
|
|
27
|
+
declaration: false,
|
|
28
|
+
declarationMap: false,
|
|
29
|
+
}),
|
|
30
|
+
nodeResolve(),
|
|
31
|
+
commonjs({ include: 'node_modules/**' }),
|
|
32
|
+
postcss({
|
|
33
|
+
extract: 'overflow-slider.css',
|
|
34
|
+
plugins: [ require('autoprefixer'), require('cssnano')({ preset: 'default' }) ],
|
|
35
|
+
minimize: true,
|
|
36
|
+
sourceMap: false,
|
|
37
|
+
extensions: ['.scss', '.css'],
|
|
38
|
+
}),
|
|
39
|
+
copy({ targets: [{ src: 'dist/*', dest: 'docs/dist' }], hook: 'writeBundle' }),
|
|
40
|
+
copy({
|
|
41
|
+
targets: [
|
|
42
|
+
{ src: 'src/mixins.scss', dest: 'dist' },
|
|
43
|
+
{ src: 'dist/*', dest: 'docs/dist' },
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
32
46
|
];
|
|
33
47
|
|
|
34
|
-
//
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const baseOutput = {
|
|
45
|
-
preserveModules: true,
|
|
46
|
-
preserveModulesRoot: 'src',
|
|
47
|
-
};
|
|
48
|
+
// Helper for plugin file naming
|
|
49
|
+
function entryFmt(ext, isMin) {
|
|
50
|
+
return chunk => {
|
|
51
|
+
const id = chunk.facadeModuleId;
|
|
52
|
+
const pluginName = path.basename(path.dirname(id));
|
|
53
|
+
return `plugins/${pluginName}/index.${ext}.js`;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
48
56
|
|
|
49
57
|
export default [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
58
|
+
// —— Flat core ESM build (no internal imports) ——
|
|
59
|
+
{
|
|
60
|
+
input: coreInput,
|
|
61
|
+
output: { file: 'dist/index.esm.js', format: 'es', sourcemap: true, inlineDynamicImports: true },
|
|
62
|
+
plugins,
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
// —— Flat core CJS build (minified) ——
|
|
66
|
+
{
|
|
67
|
+
input: coreInput,
|
|
68
|
+
output: { file: 'dist/index.min.js', format: 'cjs', sourcemap: true, inlineDynamicImports: true, exports: 'auto' },
|
|
69
|
+
plugins: [...plugins, terser()],
|
|
70
|
+
},
|
|
71
|
+
|
|
72
|
+
// —— Per-plugin ESM build ——
|
|
73
|
+
{
|
|
74
|
+
input: pluginInputs,
|
|
75
|
+
output: { dir: 'dist', format: 'es', entryFileNames: entryFmt('esm', false) },
|
|
76
|
+
plugins,
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
// —— Per-plugin minified build ——
|
|
80
|
+
{
|
|
81
|
+
input: pluginInputs,
|
|
82
|
+
output: { dir: 'dist', format: 'es', entryFileNames: entryFmt('min', true) },
|
|
83
|
+
plugins: [...plugins, terser()],
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// —— Declarations bundle (multi-entry) ——
|
|
87
|
+
{
|
|
88
|
+
input: allEntries,
|
|
89
|
+
external: [/\.scss$/],
|
|
90
|
+
output: {
|
|
91
|
+
dir: 'dist',
|
|
92
|
+
format: 'es',
|
|
93
|
+
preserveModules: true,
|
|
94
|
+
preserveModulesRoot: 'src',
|
|
95
|
+
entryFileNames: chunk => {
|
|
96
|
+
if (chunk.name === 'index') return 'index.d.ts';
|
|
97
|
+
const pluginName = path.basename(path.dirname(chunk.facadeModuleId));
|
|
98
|
+
return `plugins/${pluginName}/index.d.ts`;
|
|
99
|
+
},
|
|
78
100
|
},
|
|
101
|
+
plugins: [dts()],
|
|
102
|
+
},
|
|
79
103
|
];
|
package/src/core/details.ts
CHANGED
|
@@ -7,6 +7,7 @@ export default function details( slider: Slider) {
|
|
|
7
7
|
let hasOverflow = false;
|
|
8
8
|
let slideCount = 0;
|
|
9
9
|
let containerWidth = 0;
|
|
10
|
+
let containerHeight = 0;
|
|
10
11
|
let scrollableAreaWidth = 0;
|
|
11
12
|
let amountOfPages = 0;
|
|
12
13
|
let currentPage = 1;
|
|
@@ -19,6 +20,8 @@ export default function details( slider: Slider) {
|
|
|
19
20
|
|
|
20
21
|
containerWidth = slider.container.offsetWidth;
|
|
21
22
|
|
|
23
|
+
containerHeight = slider.container.offsetHeight;
|
|
24
|
+
|
|
22
25
|
scrollableAreaWidth = slider.getInclusiveScrollWidth();
|
|
23
26
|
|
|
24
27
|
amountOfPages = Math.ceil(scrollableAreaWidth / containerWidth);
|
|
@@ -35,6 +38,7 @@ export default function details( slider: Slider) {
|
|
|
35
38
|
hasOverflow,
|
|
36
39
|
slideCount,
|
|
37
40
|
containerWidth,
|
|
41
|
+
containerHeight,
|
|
38
42
|
scrollableAreaWidth,
|
|
39
43
|
amountOfPages,
|
|
40
44
|
currentPage,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import Slider from './slider';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
SliderOptionArgs,
|
|
4
5
|
SliderOptions,
|
|
5
6
|
SliderPlugin,
|
|
6
7
|
} from './types';
|
|
7
8
|
|
|
8
9
|
export default function OverflowSlider (
|
|
9
10
|
container: HTMLElement,
|
|
10
|
-
options?:
|
|
11
|
+
options?: SliderOptionArgs,
|
|
11
12
|
plugins?: SliderPlugin[]
|
|
12
13
|
) {
|
|
13
14
|
try {
|
|
@@ -17,7 +18,8 @@ export default function OverflowSlider (
|
|
|
17
18
|
throw new Error(`Container must be HTML element, found ${typeof container}`);
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
const defaults = {
|
|
21
|
+
const defaults: SliderOptionArgs = {
|
|
22
|
+
cssVariableContainer: container,
|
|
21
23
|
scrollBehavior: "smooth",
|
|
22
24
|
scrollStrategy: "fullSlide",
|
|
23
25
|
slidesSelector: ":scope > *",
|