pixi-scrollbox 2.3.0 → 3.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.
@@ -0,0 +1,362 @@
1
+ import { Container as e, Graphics as t, Ticker as n } from "pixi.js";
2
+ import { Viewport as r } from "pixi-viewport";
3
+ // \0rolldown/runtime.js
4
+ var i = Object.create, a = Object.defineProperty, o = Object.getOwnPropertyDescriptor, s = Object.getOwnPropertyNames, c = Object.getPrototypeOf, l = Object.prototype.hasOwnProperty, u = (e, t) => () => (t || (e((t = { exports: {} }).exports, t, t.exports), e = null), t.exports), d = (e, t, n, r) => {
5
+ if (t && typeof t == "object" || typeof t == "function") for (var i = s(t), c = 0, u = i.length, d; c < u; c++) d = i[c], !l.call(e, d) && d !== n && a(e, d, {
6
+ get: ((e) => t[e]).bind(null, d),
7
+ enumerable: !(r = o(t, d)) || r.enumerable
8
+ });
9
+ return e;
10
+ }, f = /* @__PURE__ */ ((e, t, n) => (n = e == null ? {} : i(c(e)), d(t || !e || !e.__esModule || !l.call(e, "default") ? a(n, "default", {
11
+ value: e,
12
+ enumerable: !0
13
+ }) : n, e)))((/* @__PURE__ */ u(((e, t, n) => {
14
+ (function() {
15
+ var n = {
16
+ linear: function(e, t, n, r) {
17
+ return n * e / r + t;
18
+ },
19
+ easeInQuad: function(e, t, n, r) {
20
+ return n * (e /= r) * e + t;
21
+ },
22
+ easeOutQuad: function(e, t, n, r) {
23
+ return -n * (e /= r) * (e - 2) + t;
24
+ },
25
+ easeInOutQuad: function(e, t, n, r) {
26
+ return (e /= r / 2) < 1 ? n / 2 * e * e + t : -n / 2 * (--e * (e - 2) - 1) + t;
27
+ },
28
+ easeInCubic: function(e, t, n, r) {
29
+ return n * (e /= r) * e * e + t;
30
+ },
31
+ easeOutCubic: function(e, t, n, r) {
32
+ return n * ((e = e / r - 1) * e * e + 1) + t;
33
+ },
34
+ easeInOutCubic: function(e, t, n, r) {
35
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e + t : n / 2 * ((e -= 2) * e * e + 2) + t;
36
+ },
37
+ easeInQuart: function(e, t, n, r) {
38
+ return n * (e /= r) * e * e * e + t;
39
+ },
40
+ easeOutQuart: function(e, t, n, r) {
41
+ return -n * ((e = e / r - 1) * e * e * e - 1) + t;
42
+ },
43
+ easeInOutQuart: function(e, t, n, r) {
44
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e * e + t : -n / 2 * ((e -= 2) * e * e * e - 2) + t;
45
+ },
46
+ easeInQuint: function(e, t, n, r) {
47
+ return n * (e /= r) * e * e * e * e + t;
48
+ },
49
+ easeOutQuint: function(e, t, n, r) {
50
+ return n * ((e = e / r - 1) * e * e * e * e + 1) + t;
51
+ },
52
+ easeInOutQuint: function(e, t, n, r) {
53
+ return (e /= r / 2) < 1 ? n / 2 * e * e * e * e * e + t : n / 2 * ((e -= 2) * e * e * e * e + 2) + t;
54
+ },
55
+ easeInSine: function(e, t, n, r) {
56
+ return -n * Math.cos(e / r * (Math.PI / 2)) + n + t;
57
+ },
58
+ easeOutSine: function(e, t, n, r) {
59
+ return n * Math.sin(e / r * (Math.PI / 2)) + t;
60
+ },
61
+ easeInOutSine: function(e, t, n, r) {
62
+ return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t;
63
+ },
64
+ easeInExpo: function(e, t, n, r) {
65
+ return e === 0 ? t : n * 2 ** (10 * (e / r - 1)) + t;
66
+ },
67
+ easeOutExpo: function(e, t, n, r) {
68
+ return e === r ? t + n : n * (-(2 ** (-10 * e / r)) + 1) + t;
69
+ },
70
+ easeInOutExpo: function(e, t, n, r) {
71
+ return e === r && t + n, (e /= r / 2) < 1 ? n / 2 * 2 ** (10 * (e - 1)) + t : n / 2 * (-(2 ** (-10 * --e)) + 2) + t;
72
+ },
73
+ easeInCirc: function(e, t, n, r) {
74
+ return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t;
75
+ },
76
+ easeOutCirc: function(e, t, n, r) {
77
+ return n * Math.sqrt(1 - (e = e / r - 1) * e) + t;
78
+ },
79
+ easeInOutCirc: function(e, t, n, r) {
80
+ return (e /= r / 2) < 1 ? -n / 2 * (Math.sqrt(1 - e * e) - 1) + t : n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t;
81
+ },
82
+ easeInElastic: function(e, t, n, r) {
83
+ var i, a, o = 1.70158;
84
+ return a = 0, i = n, e === 0 || (e /= r) === 1 && t + n, a ||= r * .3, i < Math.abs(n) ? (i = n, o = a / 4) : o = a / (2 * Math.PI) * Math.asin(n / i), -(i * 2 ** (10 * --e) * Math.sin((e * r - o) * (2 * Math.PI) / a)) + t;
85
+ },
86
+ easeOutElastic: function(e, t, n, r) {
87
+ var i, a, o = 1.70158;
88
+ return a = 0, i = n, e === 0 || (e /= r) === 1 && t + n, a ||= r * .3, i < Math.abs(n) ? (i = n, o = a / 4) : o = a / (2 * Math.PI) * Math.asin(n / i), i * 2 ** (-10 * e) * Math.sin((e * r - o) * (2 * Math.PI) / a) + n + t;
89
+ },
90
+ easeInOutElastic: function(e, t, n, r) {
91
+ var i, a, o = 1.70158;
92
+ return a = 0, i = n, e === 0 || (e /= r / 2) == 2 && t + n, a ||= .3 * 1.5 * r, i < Math.abs(n) ? (i = n, o = a / 4) : o = a / (2 * Math.PI) * Math.asin(n / i), e < 1 ? -.5 * (i * 2 ** (10 * --e) * Math.sin((e * r - o) * (2 * Math.PI) / a)) + t : i * 2 ** (-10 * --e) * Math.sin((e * r - o) * (2 * Math.PI) / a) * .5 + n + t;
93
+ },
94
+ easeInBack: function(e, t, n, r, i) {
95
+ return i === void 0 && (i = 1.70158), n * (e /= r) * e * ((i + 1) * e - i) + t;
96
+ },
97
+ easeOutBack: function(e, t, n, r, i) {
98
+ return i === void 0 && (i = 1.70158), n * ((e = e / r - 1) * e * ((i + 1) * e + i) + 1) + t;
99
+ },
100
+ easeInOutBack: function(e, t, n, r, i) {
101
+ return i === void 0 && (i = 1.70158), (e /= r / 2) < 1 ? n / 2 * (e * e * (((i *= 1.525) + 1) * e - i)) + t : n / 2 * ((e -= 2) * e * (((i *= 1.525) + 1) * e + i) + 2) + t;
102
+ },
103
+ easeInBounce: function(e, t, r, i) {
104
+ return r - n.easeOutBounce(i - e, 0, r, i) + t;
105
+ },
106
+ easeOutBounce: function(e, t, n, r) {
107
+ return (e /= r) < 1 / 2.75 ? n * (7.5625 * e * e) + t : e < 2 / 2.75 ? n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t;
108
+ },
109
+ easeInOutBounce: function(e, t, r, i) {
110
+ var a;
111
+ return e < i / 2 ? (a = n.easeInBounce(e * 2, 0, r, i), a * .5 + t) : (a = n.easeOutBounce(e * 2 - i, 0, r, i), a * .5 + r * .5 + t);
112
+ }
113
+ };
114
+ (function(n) {
115
+ return typeof e == "object" ? t.exports = n : typeof define == "function" && define.amd ? define([], n) : this.penner = n;
116
+ })(n);
117
+ }).call(n);
118
+ })))()), p = {
119
+ boxWidth: 100,
120
+ boxHeight: 100,
121
+ scrollbarSize: 10,
122
+ scrollbarBackground: 14540253,
123
+ scrollbarBackgroundAlpha: 1,
124
+ scrollbarForeground: 8947848,
125
+ scrollbarForegroundAlpha: 1,
126
+ dragScroll: !0,
127
+ stopPropagation: !0,
128
+ scrollbarOffsetHorizontal: 0,
129
+ scrollbarOffsetVertical: 0,
130
+ underflow: "top-left",
131
+ fade: !1,
132
+ fadeScrollbarTime: 1e3,
133
+ fadeScrollboxWait: 3e3,
134
+ fadeScrollboxEase: "easeInOutSine",
135
+ passiveWheel: !1,
136
+ clampWheel: !0,
137
+ wheelSwapAxes: !1
138
+ }, m = class extends e {
139
+ constructor(e = {}) {
140
+ if (super(), this.options = Object.assign({}, p, e), !this.options.events) throw Error("pixi-scrollbox: options.events is required (e.g., new Scrollbox({ events: app.renderer.events }))");
141
+ e.overflow && (this.options.overflowX = this.options.overflowY = e.overflow), e.fadeScrollbar && (this.options.fade = !0), this.options.ticker = e.ticker || n.shared, this.ease = typeof this.options.fadeScrollboxEase == "function" ? this.options.fadeScrollboxEase : f.default[this.options.fadeScrollboxEase], this.content = this.addChild(new r({
142
+ passiveWheel: this.options.passiveWheel,
143
+ stopPropagation: this.options.stopPropagation,
144
+ screenWidth: this.options.boxWidth,
145
+ screenHeight: this.options.boxHeight,
146
+ events: this.options.events,
147
+ noTicker: this.options.noTicker,
148
+ ticker: this.options.ticker
149
+ })), this.content.decelerate().on("moved", () => this._drawScrollbars()), this.scrollbar = this.addChild(new t()), this.scrollbar.eventMode = "static", this.scrollbar.hitArea = { contains: (e, t) => this._scrollbarContains(e, t) }, this.scrollbar.on("pointerdown", this.scrollbarDown, this), this.scrollbar.on("pointerup", this.scrollbarUp, this), this.scrollbar.on("pointerupoutside", this.scrollbarUp, this), this.scrollbar.on("pointercancel", this.scrollbarUp, this), this._maskContent = this.addChild(new t()), this._maskContent.eventMode = "none", this.update(), this.options.noTicker || (this.tickerFunction = () => this.updateLoop(Math.min(this.options.ticker.elapsedMS, 16.6667)), this.options.ticker.add(this.tickerFunction));
150
+ }
151
+ get scrollbarOffsetHorizontal() {
152
+ return this.options.scrollbarOffsetHorizontal;
153
+ }
154
+ set scrollbarOffsetHorizontal(e) {
155
+ this.options.scrollbarOffsetHorizontal = e;
156
+ }
157
+ get scrollbarOffsetVertical() {
158
+ return this.options.scrollbarOffsetVertical;
159
+ }
160
+ set scrollbarOffsetVertical(e) {
161
+ this.options.scrollbarOffsetVertical = e;
162
+ }
163
+ get disable() {
164
+ return this._disabled;
165
+ }
166
+ set disable(e) {
167
+ this._disabled !== e && (this._disabled = e, this.update());
168
+ }
169
+ get stopPropagation() {
170
+ return this.options.stopPropagation;
171
+ }
172
+ set stopPropagation(e) {
173
+ this.options.stopPropagation = e, this.content.options.stopPropagation = e;
174
+ }
175
+ get dragScroll() {
176
+ return this.options.dragScroll;
177
+ }
178
+ set dragScroll(e) {
179
+ this.options.dragScroll = e, e || this.content.plugins.remove("drag"), this.update();
180
+ }
181
+ get boxWidth() {
182
+ return this.options.boxWidth;
183
+ }
184
+ set boxWidth(e) {
185
+ this.options.boxWidth = e, this.content.screenWidth = e, this.update();
186
+ }
187
+ get overflow() {
188
+ return this.options.overflow;
189
+ }
190
+ set overflow(e) {
191
+ this.options.overflow = e, this.options.overflowX = e, this.options.overflowY = e, this.update();
192
+ }
193
+ get overflowX() {
194
+ return this.options.overflowX;
195
+ }
196
+ set overflowX(e) {
197
+ this.options.overflowX = e, this.update();
198
+ }
199
+ get overflowY() {
200
+ return this.options.overflowY;
201
+ }
202
+ set overflowY(e) {
203
+ this.options.overflowY = e, this.update();
204
+ }
205
+ get boxHeight() {
206
+ return this.options.boxHeight;
207
+ }
208
+ set boxHeight(e) {
209
+ this.options.boxHeight = e, this.content.screenHeight = e, this.update();
210
+ }
211
+ get scrollbarSize() {
212
+ return this.options.scrollbarSize;
213
+ }
214
+ set scrollbarSize(e) {
215
+ this.options.scrollbarSize = e;
216
+ }
217
+ get contentWidth() {
218
+ return this.options.boxWidth - (this.isScrollbarVertical ? this.options.scrollbarSize : 0);
219
+ }
220
+ get contentHeight() {
221
+ return this.options.boxHeight - (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0);
222
+ }
223
+ get isScrollbarVertical() {
224
+ return this._isScrollbarVertical;
225
+ }
226
+ get isScrollbarHorizontal() {
227
+ return this._isScrollbarHorizontal;
228
+ }
229
+ get scrollTop() {
230
+ return this.content.top;
231
+ }
232
+ set scrollTop(e) {
233
+ this.content.top = e, this._clampAndDraw();
234
+ }
235
+ get scrollLeft() {
236
+ return this.content.left;
237
+ }
238
+ set scrollLeft(e) {
239
+ this.content.left = e, this._clampAndDraw();
240
+ }
241
+ get scrollWidth() {
242
+ return this._scrollWidth || this.content.width;
243
+ }
244
+ set scrollWidth(e) {
245
+ this._scrollWidth = e;
246
+ }
247
+ get scrollHeight() {
248
+ return this._scrollHeight || this.content.height;
249
+ }
250
+ set scrollHeight(e) {
251
+ this._scrollHeight = e;
252
+ }
253
+ _drawScrollbars() {
254
+ this._isScrollbarHorizontal = this.overflowX === "scroll" || ["hidden", "none"].indexOf(this.overflowX) === -1 && this.scrollWidth > this.options.boxWidth, this._isScrollbarVertical = this.overflowY === "scroll" || ["hidden", "none"].indexOf(this.overflowY) === -1 && this.scrollHeight > this.options.boxHeight, this.scrollbar.clear();
255
+ let e = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0), t = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0);
256
+ this.scrollbarTop = this.content.top / t * this.boxHeight, this.scrollbarTop = this.scrollbarTop < 0 ? 0 : this.scrollbarTop, this.scrollbarHeight = this.boxHeight / t * this.boxHeight, this.scrollbarHeight = this.scrollbarTop + this.scrollbarHeight > this.boxHeight ? this.boxHeight - this.scrollbarTop : this.scrollbarHeight, this.scrollbarLeft = this.content.left / e * this.boxWidth, this.scrollbarLeft = this.scrollbarLeft < 0 ? 0 : this.scrollbarLeft, this.scrollbarWidth = this.boxWidth / e * this.boxWidth, this.scrollbarWidth = this.scrollbarWidth + this.scrollbarLeft > this.boxWidth ? this.boxWidth - this.scrollbarLeft : this.scrollbarWidth;
257
+ let n = {
258
+ color: this.options.scrollbarBackground,
259
+ alpha: this.options.scrollbarBackgroundAlpha
260
+ }, r = {
261
+ color: this.options.scrollbarForeground,
262
+ alpha: this.options.scrollbarForegroundAlpha
263
+ };
264
+ this.isScrollbarVertical && this.scrollbar.rect(this._scrollbarVerticalX, 0, this.scrollbarSize, this.boxHeight).fill(n), this.isScrollbarHorizontal && this.scrollbar.rect(0, this._scrollbarHorizontalY, this.boxWidth, this.scrollbarSize).fill(n), this.isScrollbarVertical && this.scrollbar.rect(this._scrollbarVerticalX, this.scrollbarTop, this.scrollbarSize, this.scrollbarHeight).fill(r), this.isScrollbarHorizontal && this.scrollbar.rect(this.scrollbarLeft, this._scrollbarHorizontalY, this.scrollbarWidth, this.scrollbarSize).fill(r), this.activateFade();
265
+ }
266
+ get _scrollbarVerticalX() {
267
+ return this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical;
268
+ }
269
+ get _scrollbarHorizontalY() {
270
+ return this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal;
271
+ }
272
+ _scrollbarContains(e, t) {
273
+ return this._disabled ? !1 : this.isScrollbarHorizontal && this._overHorizontal(e, t) ? !0 : this.isScrollbarVertical && this._overVertical(e, t);
274
+ }
275
+ _overHorizontal(e, t) {
276
+ return e >= 0 && e <= this.boxWidth && t >= this._scrollbarHorizontalY && t <= this._scrollbarHorizontalY + this.scrollbarSize;
277
+ }
278
+ _overVertical(e, t) {
279
+ return t >= 0 && t <= this.boxHeight && e >= this._scrollbarVerticalX && e <= this._scrollbarVerticalX + this.scrollbarSize;
280
+ }
281
+ _clampAndDraw() {
282
+ let e = this.content.plugins.get("clamp", !0);
283
+ e && e.update(), this._drawScrollbars();
284
+ }
285
+ _drawMask() {
286
+ this._maskContent.rect(0, 0, this.boxWidth, this.boxHeight).fill(0), this.content.mask = this._maskContent;
287
+ }
288
+ update() {
289
+ if (this.content.mask = null, this._maskContent.clear(), this._disabled) this.scrollbar.clear();
290
+ else {
291
+ this._drawScrollbars(), this._drawMask();
292
+ let e = this.isScrollbarHorizontal && this.isScrollbarVertical ? "all" : this.isScrollbarHorizontal ? "x" : "y";
293
+ this.options.dragScroll && this.content.drag({
294
+ clampWheel: this.options.clampWheel,
295
+ direction: e,
296
+ wheelSwapAxes: this.options.wheelSwapAxes
297
+ }), this.content.clamp({
298
+ direction: e,
299
+ underflow: this.options.underflow
300
+ });
301
+ }
302
+ }
303
+ updateLoop(e) {
304
+ if (this.options.noTicker && this.content.update(e), this.fade) {
305
+ if (this.fade.wait > 0) {
306
+ if (this.fade.wait -= e, this.fade.wait <= 0) e = -this.fade.wait;
307
+ else return;
308
+ }
309
+ this.fade.duration += e, this.fade.duration >= this.options.fadeScrollbarTime ? (this.fade = null, this.scrollbar.alpha = 0) : this.scrollbar.alpha = this.ease(this.fade.duration, 1, -1, this.options.fadeScrollbarTime), this.content.dirty = !0;
310
+ }
311
+ }
312
+ get dirty() {
313
+ return this.content.dirty;
314
+ }
315
+ set dirty(e) {
316
+ this.content.dirty = e;
317
+ }
318
+ activateFade() {
319
+ this.options.fade && (this.scrollbar.alpha = 1, this.fade = {
320
+ wait: this.options.fadeScrollboxWait,
321
+ duration: 0
322
+ });
323
+ }
324
+ scrollbarDown(e) {
325
+ let t = this.toLocal(e.global);
326
+ this.isScrollbarHorizontal && this._overHorizontal(t.x, t.y) ? (t.x >= this.scrollbarLeft && t.x <= this.scrollbarLeft + this.scrollbarWidth ? this._startScrollbarDrag("horizontal", t) : (t.x > this.scrollbarLeft ? this.content.left += this.content.worldScreenWidth : this.content.left -= this.content.worldScreenWidth, this._clampAndDraw()), this.options.stopPropagation && e.stopPropagation()) : this.isScrollbarVertical && this._overVertical(t.x, t.y) && (t.y >= this.scrollbarTop && t.y <= this.scrollbarTop + this.scrollbarHeight ? this._startScrollbarDrag("vertical", t) : (t.y > this.scrollbarTop ? this.content.top += this.content.worldScreenHeight : this.content.top -= this.content.worldScreenHeight, this._clampAndDraw()), this.options.stopPropagation && e.stopPropagation());
327
+ }
328
+ _startScrollbarDrag(e, t) {
329
+ this.pointerDown = {
330
+ type: e,
331
+ last: t
332
+ }, this.scrollbar.on("globalpointermove", this.scrollbarMove, this);
333
+ }
334
+ scrollbarMove(e) {
335
+ if (this.pointerDown) {
336
+ let t = this.toLocal(e.global);
337
+ if (this.pointerDown.type === "horizontal") {
338
+ let e = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0);
339
+ this.scrollbarLeft += t.x - this.pointerDown.last.x, this.content.left = this.scrollbarLeft / this.boxWidth * e;
340
+ } else {
341
+ let e = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0);
342
+ this.scrollbarTop += t.y - this.pointerDown.last.y, this.content.top = this.scrollbarTop / this.boxHeight * e;
343
+ }
344
+ this.pointerDown.last = t, this._clampAndDraw(), this.options.stopPropagation && e.stopPropagation();
345
+ }
346
+ }
347
+ scrollbarUp() {
348
+ this.pointerDown = null, this.scrollbar.off("globalpointermove", this.scrollbarMove, this);
349
+ }
350
+ resize(e) {
351
+ this.options.boxWidth = e.boxWidth === void 0 ? this.options.boxWidth : e.boxWidth, this.options.boxHeight = e.boxHeight === void 0 ? this.options.boxHeight : e.boxHeight, e.scrollWidth && (this.scrollWidth = e.scrollWidth), e.scrollHeight && (this.scrollHeight = e.scrollHeight), this.content.resize(this.options.boxWidth, this.options.boxHeight, this.scrollWidth, this.scrollHeight), this.update();
352
+ }
353
+ ensureVisible(e, t, n, r) {
354
+ this.content.ensureVisible(e, t, n, r), this._drawScrollbars();
355
+ }
356
+ destroy(e) {
357
+ this.tickerFunction &&= (this.options.ticker.remove(this.tickerFunction), null), this.scrollbarUp(), this.content.destroy(e), super.destroy(e);
358
+ }
359
+ };
360
+ export { m as Scrollbox };
361
+
362
+ //# sourceMappingURL=scrollbox.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scrollbox.mjs","names":["Penner","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__commonJSMin","mod","cb","__copyProps","from","keys","i","n","key","to","except","k","desc","import_penner","isNodeMode","target","penner","c","t","d","b","a","p","s","v","exports","factory","this$1","scrollboxOptions","\"boxWidth\"","\"boxHeight\"","\"scrollbarSize\"","\"scrollbarBackground\"","\"scrollbarBackgroundAlpha\"","\"scrollbarForeground\"","\"scrollbarForegroundAlpha\"","\"dragScroll\"","\"stopPropagation\"","\"scrollbarOffsetHorizontal\"","\"scrollbarOffsetVertical\"","\"underflow\"","\"fade\"","\"fadeScrollbarTime\"","\"fadeScrollboxWait\"","\"fadeScrollboxEase\"","\"passiveWheel\"","\"clampWheel\"","\"wheelSwapAxes\"","Scrollbox","Container","options","Ticker","Viewport","Graphics","x","y","value","top","left","width","height","background","foreground","clamp","direction","elapsed","local"],"sources":["../node_modules/.pnpm/penner@0.1.3/node_modules/penner/penner.js","../src/scrollbox.js"],"sourcesContent":["\n/*\n\tCopyright © 2001 Robert Penner\n\tAll rights reserved.\n\n\tRedistribution and use in source and binary forms, with or without modification, \n\tare permitted provided that the following conditions are met:\n\n\tRedistributions of source code must retain the above copyright notice, this list of \n\tconditions and the following disclaimer.\n\tRedistributions in binary form must reproduce the above copyright notice, this list \n\tof conditions and the following disclaimer in the documentation and/or other materials \n\tprovided with the distribution.\n\n\tNeither the name of the author nor the names of contributors may be used to endorse \n\tor promote products derived from this software without specific prior written permission.\n\n\tTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY \n\tEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\tMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n\tCOPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\tEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE\n\tGOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED \n\tAND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n\tNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED \n\tOF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n(function() {\n var penner, umd;\n\n umd = function(factory) {\n if (typeof exports === 'object') {\n return module.exports = factory;\n } else if (typeof define === 'function' && define.amd) {\n return define([], factory);\n } else {\n return this.penner = factory;\n }\n };\n\n penner = {\n linear: function(t, b, c, d) {\n return c * t / d + b;\n },\n easeInQuad: function(t, b, c, d) {\n return c * (t /= d) * t + b;\n },\n easeOutQuad: function(t, b, c, d) {\n return -c * (t /= d) * (t - 2) + b;\n },\n easeInOutQuad: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t + b;\n } else {\n return -c / 2 * ((--t) * (t - 2) - 1) + b;\n }\n },\n easeInCubic: function(t, b, c, d) {\n return c * (t /= d) * t * t + b;\n },\n easeOutCubic: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t + 1) + b;\n },\n easeInOutCubic: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t + 2) + b;\n }\n },\n easeInQuart: function(t, b, c, d) {\n return c * (t /= d) * t * t * t + b;\n },\n easeOutQuart: function(t, b, c, d) {\n return -c * ((t = t / d - 1) * t * t * t - 1) + b;\n },\n easeInOutQuart: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t + b;\n } else {\n return -c / 2 * ((t -= 2) * t * t * t - 2) + b;\n }\n },\n easeInQuint: function(t, b, c, d) {\n return c * (t /= d) * t * t * t * t + b;\n },\n easeOutQuint: function(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t * t * t + 1) + b;\n },\n easeInOutQuint: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return c / 2 * t * t * t * t * t + b;\n } else {\n return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;\n }\n },\n easeInSine: function(t, b, c, d) {\n return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;\n },\n easeOutSine: function(t, b, c, d) {\n return c * Math.sin(t / d * (Math.PI / 2)) + b;\n },\n easeInOutSine: function(t, b, c, d) {\n return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n },\n easeInExpo: function(t, b, c, d) {\n if (t === 0) {\n return b;\n } else {\n return c * Math.pow(2, 10 * (t / d - 1)) + b;\n }\n },\n easeOutExpo: function(t, b, c, d) {\n if (t === d) {\n return b + c;\n } else {\n return c * (-Math.pow(2, -10 * t / d) + 1) + b;\n }\n },\n easeInOutExpo: function(t, b, c, d) {\n if (t === 0) {\n b;\n }\n if (t === d) {\n b + c;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * Math.pow(2, 10 * (t - 1)) + b;\n } else {\n return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;\n }\n },\n easeInCirc: function(t, b, c, d) {\n return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;\n },\n easeOutCirc: function(t, b, c, d) {\n return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;\n },\n easeInOutCirc: function(t, b, c, d) {\n if ((t /= d / 2) < 1) {\n return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;\n } else {\n return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;\n }\n },\n easeInElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n },\n easeOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d) === 1) {\n b + c;\n }\n if (!p) {\n p = d * .3;\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;\n },\n easeInOutElastic: function(t, b, c, d) {\n var a, p, s;\n s = 1.70158;\n p = 0;\n a = c;\n if (t === 0) {\n b;\n } else if ((t /= d / 2) === 2) {\n b + c;\n }\n if (!p) {\n p = d * (.3 * 1.5);\n }\n if (a < Math.abs(c)) {\n a = c;\n s = p / 4;\n } else {\n s = p / (2 * Math.PI) * Math.asin(c / a);\n }\n if (t < 1) {\n return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;\n } else {\n return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;\n }\n },\n easeInBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * (t /= d) * t * ((s + 1) * t - s) + b;\n },\n easeOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;\n },\n easeInOutBack: function(t, b, c, d, s) {\n if (s === void 0) {\n s = 1.70158;\n }\n if ((t /= d / 2) < 1) {\n return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b;\n } else {\n return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b;\n }\n },\n easeInBounce: function(t, b, c, d) {\n var v;\n v = penner.easeOutBounce(d - t, 0, c, d);\n return c - v + b;\n },\n easeOutBounce: function(t, b, c, d) {\n if ((t /= d) < 1 / 2.75) {\n return c * (7.5625 * t * t) + b;\n } else if (t < 2 / 2.75) {\n return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b;\n } else if (t < 2.5 / 2.75) {\n return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b;\n } else {\n return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b;\n }\n },\n easeInOutBounce: function(t, b, c, d) {\n var v;\n if (t < d / 2) {\n v = penner.easeInBounce(t * 2, 0, c, d);\n return v * .5 + b;\n } else {\n v = penner.easeOutBounce(t * 2 - d, 0, c, d);\n return v * .5 + c * .5 + b;\n }\n }\n };\n\n umd(penner);\n\n}).call(this);\n","import { Container, Graphics, Ticker } from 'pixi.js'\nimport { Viewport } from 'pixi-viewport'\nimport Penner from 'penner'\n\nconst scrollboxOptions = {\n 'boxWidth': 100,\n 'boxHeight': 100,\n 'scrollbarSize': 10,\n 'scrollbarBackground': 14540253,\n 'scrollbarBackgroundAlpha': 1,\n 'scrollbarForeground': 8947848,\n 'scrollbarForegroundAlpha': 1,\n 'dragScroll': true,\n 'stopPropagation': true,\n 'scrollbarOffsetHorizontal': 0,\n 'scrollbarOffsetVertical': 0,\n 'underflow': 'top-left',\n 'fade': false,\n 'fadeScrollbarTime': 1000,\n 'fadeScrollboxWait': 3000,\n 'fadeScrollboxEase': 'easeInOutSine',\n 'passiveWheel': false,\n 'clampWheel': true,\n 'wheelSwapAxes': false\n}\n\n/**\n * pixi.js scrollbox: a masked content box that can scroll vertically or horizontally with scrollbars\n */\nexport class Scrollbox extends Container {\n /**\n * create a scrollbox\n * @param {object} options\n * @param {PIXI.EventSystem} options.events the renderer's EventSystem (app.renderer.events); required by pixi-viewport for wheel and pointer positions\n * @param {boolean} [options.dragScroll=true] user may drag the content area to scroll content\n * @param {string} [options.overflowX=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown\n * @param {string} [options.overflowY=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown\n * @param {string} [options.overflow] (none, scroll, hidden, auto) sets overflowX and overflowY to this value\n * @param {number} [options.boxWidth=100] width of scrollbox including scrollbar (in pixels)\n * @param {number} [options.boxHeight=100] height of scrollbox including scrollbar (in pixels)\n * @param {number} [options.scrollbarSize=10] size of scrollbar (in pixels)\n * @param {number} [options.scrollbarOffsetHorizontal=0] offset of horizontal scrollbar (in pixels)\n * @param {number} [options.scrollbarOffsetVertical=0] offset of vertical scrollbar (in pixels)\n * @param {boolean} [options.stopPropagation=true] call stopPropagation on any events that impact scrollbox\n * @param {number} [options.scrollbarBackground=0xdddddd] background color of scrollbar\n * @param {number} [options.scrollbarBackgroundAlpha=1] alpha of background of scrollbar\n * @param {number} [options.scrollbarForeground=0x888888] foreground color of scrollbar\n * @param {number} [options.scrollbarForegroundAlpha=1] alpha of foreground of scrollbar\n * @param {string} [options.underflow=top-left] what to do when content underflows the scrollbox size: none: do nothing; (left/right/center AND top/bottom/center); OR center (e.g., 'top-left', 'center', 'none', 'bottomright')\n * @param {boolean} [options.noTicker] do not use PIXI.Ticker (you will need to manually call updateLoop(elapsed) on each frame)\n * @param {PIXI.Ticker} [options.ticker=PIXI.Ticker.shared] use this PIXI.Ticker for updates\n * @param {boolean} [options.fade] fade the scrollbar when not in use\n * @param {number} [options.fadeScrollbarTime=1000] time to fade scrollbar if options.fade is set\n * @param {number} [options.fadeScrollboxWait=3000] time to wait before fading the scrollbar if options.fade is set\n * @param {(string|function)} [options.fadeScrollboxEase=easeInOutSine] easing function to use for fading\n * @param {boolean} [options.passiveWheel=false] whether wheel events are propogated beyond the scrollbox (if false, e.preventDefault() is called when the wheel scrolls the scrollbox)\n * @param {boolean} [options.clampWheel=true] wheel events should be clamped (to avoid weird bounce with mouse wheel)\n * @param {boolean} [options.wheelSwapAxes=false] swap the wheel's x and y axes (e.g., so a mouse wheel scrolls a horizontal scrollbox)\n */\n constructor(options = {}) {\n super()\n this.options = Object.assign({}, scrollboxOptions, options)\n if (!this.options.events) {\n throw new Error('pixi-scrollbox: options.events is required (e.g., new Scrollbox({ events: app.renderer.events }))')\n }\n if (options.overflow) {\n this.options.overflowX = this.options.overflowY = options.overflow\n }\n if (options.fadeScrollbar) {\n this.options.fade = true\n }\n this.options.ticker = options.ticker || Ticker.shared\n this.ease = typeof this.options.fadeScrollboxEase === 'function' ? this.options.fadeScrollboxEase : Penner[this.options.fadeScrollboxEase]\n\n /**\n * content in placed in here\n * you can use any function from pixi-viewport on content to manually move the content (see https://viewport.pixijs.io/jsdoc/)\n * @type {Viewport}\n */\n this.content = this.addChild(new Viewport({\n passiveWheel: this.options.passiveWheel,\n stopPropagation: this.options.stopPropagation,\n screenWidth: this.options.boxWidth,\n screenHeight: this.options.boxHeight,\n events: this.options.events,\n noTicker: this.options.noTicker,\n ticker: this.options.ticker,\n }))\n this.content\n .decelerate()\n .on('moved', () => this._drawScrollbars())\n\n /**\n * graphics element for drawing the scrollbars\n * @type {PIXI.Graphics}\n */\n this.scrollbar = this.addChild(new Graphics())\n this.scrollbar.eventMode = 'static'\n this.scrollbar.hitArea = { contains: (x, y) => this._scrollbarContains(x, y) }\n this.scrollbar.on('pointerdown', this.scrollbarDown, this)\n this.scrollbar.on('pointerup', this.scrollbarUp, this)\n this.scrollbar.on('pointerupoutside', this.scrollbarUp, this)\n this.scrollbar.on('pointercancel', this.scrollbarUp, this)\n\n // the mask is only used for clipping, so it must never be the target of pointer events\n this._maskContent = this.addChild(new Graphics())\n this._maskContent.eventMode = 'none'\n this.update()\n\n if (!this.options.noTicker) {\n this.tickerFunction = () => this.updateLoop(Math.min(this.options.ticker.elapsedMS, 16.6667))\n this.options.ticker.add(this.tickerFunction)\n }\n }\n\n /**\n * offset of horizontal scrollbar (in pixels)\n * @type {number}\n */\n get scrollbarOffsetHorizontal() {\n return this.options.scrollbarOffsetHorizontal\n }\n set scrollbarOffsetHorizontal(value) {\n this.options.scrollbarOffsetHorizontal = value\n }\n\n /**\n * offset of vertical scrollbar (in pixels)\n * @type {number}\n */\n get scrollbarOffsetVertical() {\n return this.options.scrollbarOffsetVertical\n }\n set scrollbarOffsetVertical(value) {\n this.options.scrollbarOffsetVertical = value\n }\n\n /**\n * disable the scrollbox (if set to true this will also remove the mask)\n * @type {boolean}\n */\n get disable() {\n return this._disabled\n }\n set disable(value) {\n if (this._disabled !== value) {\n this._disabled = value\n this.update()\n }\n }\n\n /**\n * call stopPropagation on any events that impact scrollbox\n * @type {boolean}\n */\n get stopPropagation() {\n return this.options.stopPropagation\n }\n set stopPropagation(value) {\n this.options.stopPropagation = value\n this.content.options.stopPropagation = value\n }\n\n /**\n * user may drag the content area to scroll content\n * @type {boolean}\n */\n get dragScroll() {\n return this.options.dragScroll\n }\n set dragScroll(value) {\n this.options.dragScroll = value\n if (!value) {\n this.content.plugins.remove('drag')\n }\n this.update()\n }\n\n /**\n * width of scrollbox including the scrollbar (if visible)- this changes the size and not the scale of the box\n * @type {number}\n */\n get boxWidth() {\n return this.options.boxWidth\n }\n set boxWidth(value) {\n this.options.boxWidth = value\n this.content.screenWidth = value\n this.update()\n }\n\n /**\n * sets overflowX and overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown\n * scroll = always show scrollbar\n * hidden = hide overflow and do not show scrollbar\n * auto = if content is larger than box size, then show scrollbar\n * @type {string}\n */\n get overflow() {\n return this.options.overflow\n }\n set overflow(value) {\n this.options.overflow = value\n this.options.overflowX = value\n this.options.overflowY = value\n this.update()\n }\n\n /**\n * sets overflowX to (scroll, hidden, auto) changing whether the scrollbar is shown\n * scroll = always show scrollbar\n * hidden = hide overflow and do not show scrollbar\n * auto = if content is larger than box size, then show scrollbar\n * @type {string}\n */\n get overflowX() {\n return this.options.overflowX\n }\n set overflowX(value) {\n this.options.overflowX = value\n this.update()\n }\n\n /**\n * sets overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown\n * scroll = always show scrollbar\n * hidden = hide overflow and do not show scrollbar\n * auto = if content is larger than box size, then show scrollbar\n * @type {string}\n */\n get overflowY() {\n return this.options.overflowY\n }\n set overflowY(value) {\n this.options.overflowY = value\n this.update()\n }\n\n /**\n * height of scrollbox including the scrollbar (if visible) - this changes the size and not the scale of the box\n * @type {number}\n */\n get boxHeight() {\n return this.options.boxHeight\n }\n set boxHeight(value) {\n this.options.boxHeight = value\n this.content.screenHeight = value\n this.update()\n }\n\n /**\n * scrollbar size in pixels\n * @type {number}\n */\n get scrollbarSize() {\n return this.options.scrollbarSize\n }\n set scrollbarSize(value) {\n this.options.scrollbarSize = value\n }\n\n /**\n * width of scrollbox less the scrollbar (if visible)\n * @type {number}\n * @readonly\n */\n get contentWidth() {\n return this.options.boxWidth - (this.isScrollbarVertical ? this.options.scrollbarSize : 0)\n }\n\n /**\n * height of scrollbox less the scrollbar (if visible)\n * @type {number}\n * @readonly\n */\n get contentHeight() {\n return this.options.boxHeight - (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0)\n }\n\n /**\n * is the vertical scrollbar visible\n * @type {boolean}\n * @readonly\n */\n get isScrollbarVertical() {\n return this._isScrollbarVertical\n }\n\n /**\n * is the horizontal scrollbar visible\n * @type {boolean}\n * @readonly\n */\n get isScrollbarHorizontal() {\n return this._isScrollbarHorizontal\n }\n\n /**\n * top coordinate of scrollbar\n */\n get scrollTop() {\n return this.content.top\n }\n set scrollTop(top) {\n this.content.top = top\n this._clampAndDraw()\n }\n\n /**\n * left coordinate of scrollbar\n */\n get scrollLeft() {\n return this.content.left\n }\n set scrollLeft(left) {\n this.content.left = left\n this._clampAndDraw()\n }\n\n /**\n * width of content area\n * if not set then it uses content.width to calculate width\n */\n get scrollWidth() {\n return this._scrollWidth || this.content.width\n }\n set scrollWidth(value) {\n this._scrollWidth = value\n }\n\n /**\n * height of content area\n * if not set then it uses content.height to calculate height\n */\n get scrollHeight() {\n return this._scrollHeight || this.content.height\n }\n set scrollHeight(value) {\n this._scrollHeight = value\n }\n\n /**\n * draws scrollbars\n * @private\n */\n _drawScrollbars() {\n this._isScrollbarHorizontal = this.overflowX === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowX) !== -1 ? false : this.scrollWidth > this.options.boxWidth\n this._isScrollbarVertical = this.overflowY === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowY) !== -1 ? false : this.scrollHeight > this.options.boxHeight\n this.scrollbar.clear()\n const width = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0)\n const height = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0)\n this.scrollbarTop = (this.content.top / height) * this.boxHeight\n this.scrollbarTop = this.scrollbarTop < 0 ? 0 : this.scrollbarTop\n this.scrollbarHeight = (this.boxHeight / height) * this.boxHeight\n this.scrollbarHeight = this.scrollbarTop + this.scrollbarHeight > this.boxHeight ? this.boxHeight - this.scrollbarTop : this.scrollbarHeight\n this.scrollbarLeft = (this.content.left / width) * this.boxWidth\n this.scrollbarLeft = this.scrollbarLeft < 0 ? 0 : this.scrollbarLeft\n this.scrollbarWidth = (this.boxWidth / width) * this.boxWidth\n this.scrollbarWidth = this.scrollbarWidth + this.scrollbarLeft > this.boxWidth ? this.boxWidth - this.scrollbarLeft : this.scrollbarWidth\n const background = { color: this.options.scrollbarBackground, alpha: this.options.scrollbarBackgroundAlpha }\n const foreground = { color: this.options.scrollbarForeground, alpha: this.options.scrollbarForegroundAlpha }\n if (this.isScrollbarVertical) {\n this.scrollbar\n .rect(this._scrollbarVerticalX, 0, this.scrollbarSize, this.boxHeight)\n .fill(background)\n }\n if (this.isScrollbarHorizontal) {\n this.scrollbar\n .rect(0, this._scrollbarHorizontalY, this.boxWidth, this.scrollbarSize)\n .fill(background)\n }\n if (this.isScrollbarVertical) {\n this.scrollbar\n .rect(this._scrollbarVerticalX, this.scrollbarTop, this.scrollbarSize, this.scrollbarHeight)\n .fill(foreground)\n }\n if (this.isScrollbarHorizontal) {\n this.scrollbar\n .rect(this.scrollbarLeft, this._scrollbarHorizontalY, this.scrollbarWidth, this.scrollbarSize)\n .fill(foreground)\n }\n this.activateFade()\n }\n\n /**\n * x-coordinate of the vertical scrollbar\n * @private\n */\n get _scrollbarVerticalX() {\n return this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical\n }\n\n /**\n * y-coordinate of the horizontal scrollbar\n * @private\n */\n get _scrollbarHorizontalY() {\n return this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal\n }\n\n /**\n * whether a point (in the scrollbox's coordinates) is over a visible scrollbar\n * used as the scrollbar's hitArea so it works even when the scrollbar is transparent\n * @private\n */\n _scrollbarContains(x, y) {\n if (this._disabled) {\n return false\n }\n if (this.isScrollbarHorizontal && this._overHorizontal(x, y)) {\n return true\n }\n return this.isScrollbarVertical && this._overVertical(x, y)\n }\n\n /** @private */\n _overHorizontal(x, y) {\n return x >= 0 && x <= this.boxWidth && y >= this._scrollbarHorizontalY && y <= this._scrollbarHorizontalY + this.scrollbarSize\n }\n\n /** @private */\n _overVertical(x, y) {\n return y >= 0 && y <= this.boxHeight && x >= this._scrollbarVerticalX && x <= this._scrollbarVerticalX + this.scrollbarSize\n }\n\n /**\n * clamps the content after moving it directly and redraws the scrollbars\n * @private\n */\n _clampAndDraw() {\n const clamp = this.content.plugins.get('clamp', true)\n if (clamp) {\n clamp.update()\n }\n this._drawScrollbars()\n }\n\n /**\n * draws mask layer\n * @private\n */\n _drawMask() {\n this._maskContent\n .rect(0, 0, this.boxWidth, this.boxHeight)\n .fill(0)\n this.content.mask = this._maskContent\n }\n\n /**\n * call when scrollbox content changes\n */\n update() {\n this.content.mask = null\n this._maskContent.clear()\n if (!this._disabled) {\n this._drawScrollbars()\n this._drawMask()\n const direction = this.isScrollbarHorizontal && this.isScrollbarVertical ? 'all' : this.isScrollbarHorizontal ? 'x' : 'y'\n if (this.options.dragScroll) {\n this.content.drag({ clampWheel: this.options.clampWheel, direction, wheelSwapAxes: this.options.wheelSwapAxes })\n }\n this.content.clamp({ direction, underflow: this.options.underflow })\n }\n else {\n this.scrollbar.clear()\n }\n }\n\n /**\n * called on each frame to update fade scrollbars (if enabled)\n * if options.noTicker is set then call this on each frame (it also updates the underlying viewport)\n * @param {number} elapsed since last frame in milliseconds (usually capped at 16.6667)\n */\n updateLoop(elapsed) {\n if (this.options.noTicker) {\n this.content.update(elapsed)\n }\n if (this.fade) {\n if (this.fade.wait > 0) {\n this.fade.wait -= elapsed\n if (this.fade.wait <= 0) {\n elapsed = -this.fade.wait\n }\n else {\n return\n }\n }\n this.fade.duration += elapsed\n if (this.fade.duration >= this.options.fadeScrollbarTime) {\n this.fade = null\n this.scrollbar.alpha = 0\n }\n else {\n this.scrollbar.alpha = this.ease(this.fade.duration, 1, -1, this.options.fadeScrollbarTime)\n }\n this.content.dirty = true\n }\n }\n\n /**\n * dirty value (used for optimizing draws) for underlying viewport (scrollbox.content)\n * @type {boolean}\n */\n get dirty() {\n return this.content.dirty\n }\n set dirty(value) {\n this.content.dirty = value\n }\n\n /**\n * show the scrollbar and restart the timer for fade if options.fade is set\n */\n activateFade() {\n if (this.options.fade) {\n this.scrollbar.alpha = 1\n this.fade = { wait: this.options.fadeScrollboxWait, duration: 0 }\n }\n }\n\n /**\n * handle pointer down on scrollbar\n * @param {PIXI.FederatedPointerEvent} e\n * @private\n */\n scrollbarDown(e) {\n const local = this.toLocal(e.global)\n if (this.isScrollbarHorizontal && this._overHorizontal(local.x, local.y)) {\n if (local.x >= this.scrollbarLeft && local.x <= this.scrollbarLeft + this.scrollbarWidth) {\n this._startScrollbarDrag('horizontal', local)\n }\n else {\n if (local.x > this.scrollbarLeft) {\n this.content.left += this.content.worldScreenWidth\n }\n else {\n this.content.left -= this.content.worldScreenWidth\n }\n this._clampAndDraw()\n }\n if (this.options.stopPropagation) {\n e.stopPropagation()\n }\n return\n }\n if (this.isScrollbarVertical && this._overVertical(local.x, local.y)) {\n if (local.y >= this.scrollbarTop && local.y <= this.scrollbarTop + this.scrollbarHeight) {\n this._startScrollbarDrag('vertical', local)\n }\n else {\n if (local.y > this.scrollbarTop) {\n this.content.top += this.content.worldScreenHeight\n }\n else {\n this.content.top -= this.content.worldScreenHeight\n }\n this._clampAndDraw()\n }\n if (this.options.stopPropagation) {\n e.stopPropagation()\n }\n }\n }\n\n /**\n * start dragging a scrollbar; listens to moves anywhere on the stage until the pointer is released\n * @private\n */\n _startScrollbarDrag(type, local) {\n this.pointerDown = { type, last: local }\n this.scrollbar.on('globalpointermove', this.scrollbarMove, this)\n }\n\n /**\n * handle pointer move on scrollbar\n * @param {PIXI.FederatedPointerEvent} e\n * @private\n */\n scrollbarMove(e) {\n if (this.pointerDown) {\n const local = this.toLocal(e.global)\n if (this.pointerDown.type === 'horizontal') {\n const width = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0)\n this.scrollbarLeft += local.x - this.pointerDown.last.x\n this.content.left = this.scrollbarLeft / this.boxWidth * width\n }\n else {\n const height = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0)\n this.scrollbarTop += local.y - this.pointerDown.last.y\n this.content.top = this.scrollbarTop / this.boxHeight * height\n }\n this.pointerDown.last = local\n this._clampAndDraw()\n if (this.options.stopPropagation) {\n e.stopPropagation()\n }\n }\n }\n\n /**\n * handle pointer up on scrollbar\n * @private\n */\n scrollbarUp() {\n this.pointerDown = null\n this.scrollbar.off('globalpointermove', this.scrollbarMove, this)\n }\n\n /**\n * resize the mask for the container\n * @param {object} options\n * @param {number} [options.boxWidth] width of scrollbox including scrollbar (in pixels)\n * @param {number} [options.boxHeight] height of scrollbox including scrollbar (in pixels)\n * @param {number} [options.scrollWidth] set the width of the inside of the scrollbox (leave null to use content.width)\n * @param {number} [options.scrollHeight] set the height of the inside of the scrollbox (leave null to use content.height)\n */\n resize(options) {\n this.options.boxWidth = typeof options.boxWidth !== 'undefined' ? options.boxWidth : this.options.boxWidth\n this.options.boxHeight = typeof options.boxHeight !== 'undefined' ? options.boxHeight : this.options.boxHeight\n if (options.scrollWidth) {\n this.scrollWidth = options.scrollWidth\n }\n if (options.scrollHeight) {\n this.scrollHeight = options.scrollHeight\n }\n this.content.resize(this.options.boxWidth, this.options.boxHeight, this.scrollWidth, this.scrollHeight)\n this.update()\n }\n\n /**\n * ensure that the bounding box is visible\n * @param {number} x - relative to content's coordinate system\n * @param {number} y\n * @param {number} width\n * @param {number} height\n */\n ensureVisible(x, y, width, height) {\n this.content.ensureVisible(x, y, width, height)\n this._drawScrollbars()\n }\n\n /**\n * removes the ticker and the viewport's wheel listener, then destroys the scrollbox\n * @param {PIXI.DestroyOptions} [options]\n */\n destroy(options) {\n if (this.tickerFunction) {\n this.options.ticker.remove(this.tickerFunction)\n this.tickerFunction = null\n }\n this.scrollbarUp()\n this.content.destroy(options)\n super.destroy(options)\n }\n}\n"],"ignoreList":[0],"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AAM,KAAK,eAAe,KAAK,YAAYN;GAC5D;GAGA,AAFA,KAAK,YAAY,OAAOM,GACxB,KAAK,cAAc,GACf,KAAK,QAAQ,mBACb,EAAE,gBAAgB;EAE1B;CACJ;CAMA,cAAc;EAEV,AADA,KAAK,cAAc,MACnB,KAAK,UAAU,IAAI,qBAAqB,KAAK,eAAe,IAAI;CACpE;CAUA,OAAO,GAAS;EAUZ,AATA,KAAK,QAAQ,WAAkBhB,EAAQ,aAAa,SAAiC,KAAK,QAAQ,WAAhCA,EAAQ,UAC1E,KAAK,QAAQ,YAAmBA,EAAQ,cAAc,SAAkC,KAAK,QAAQ,YAAjCA,EAAQ,WACxEA,EAAQ,gBACR,KAAK,cAAcA,EAAQ,cAE3BA,EAAQ,iBACR,KAAK,eAAeA,EAAQ,eAEhC,KAAK,QAAQ,OAAO,KAAK,QAAQ,UAAU,KAAK,QAAQ,WAAW,KAAK,aAAa,KAAK,YAAY,GACtG,KAAK,OAAO;CAChB;CASA,cAAc,GAAG,GAAG,GAAO,GAAQ;EAE/B,AADA,KAAK,QAAQ,cAAcI,GAAGC,GAAGI,GAAOC,CAAM,GAC9C,KAAK,gBAAgB;CACzB;CAMA,QAAQ,GAAS;EAOb,AANA,AAEI,KAAK,oBADL,KAAK,QAAQ,OAAO,OAAO,KAAK,cAAc,GACxB,OAE1B,KAAK,YAAY,GACjB,KAAK,QAAQ,QAAQV,CAAO,GAC5B,MAAM,QAAQA,CAAO;CACzB;AACJ"}
package/package.json CHANGED
@@ -1,70 +1,63 @@
1
1
  {
2
- "name": "pixi-scrollbox",
3
- "version": "2.3.0",
4
- "description": "a scrollbox built for pixi.js using a masked box that scrolls vertically and/or horizontally with optional scrollbars",
5
- "main": "dist/scrollbox.js",
6
- "module": "dist/scrollbox.es.js",
7
- "types": "@types/index.d.ts",
8
- "directories": {
9
- "doc": "docs"
10
- },
11
- "files": [
12
- "dist",
13
- "@types"
14
- ],
15
- "scripts": {
16
- "start": "rollup -c rollup.dev.js --watch",
17
- "upgrade": "yarn upgrade-interactive --latest",
18
- "build-demo": "rollup -c docs/rollup.config.js",
19
- "docs": "jsdoc -c .jsdoc.json",
20
- "build": "rollup -c rollup.config.js",
21
- "prepublishOnly": "yarn run build && yarn run build-demo && yarn run docs"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/davidfig/pixi-scrollbox.git"
26
- },
27
- "keywords": [
28
- "PIXI",
29
- "pixi.js",
30
- "scrollbox",
31
- "UI"
32
- ],
33
- "author": "David Figatner",
34
- "license": "MIT",
35
- "bugs": {
36
- "url": "https://github.com/davidfig/pixi-scrollbox/issues"
37
- },
38
- "homepage": "https://github.com/davidfig/pixi-scrollbox#readme",
39
- "peerDependencies": {
40
- "pixi-viewport": ">=4.3.4",
41
- "pixi.js": ">=6.0.0"
42
- },
43
- "dependencies": {
44
- "penner": "^0.1.3"
45
- },
46
- "devDependencies": {
47
- "@joseph184/rollup-plugin-node-builtins": "^2.1.4",
48
- "@pixi/display": "^6.0.2",
49
- "@pixi/interaction": "^6.0.2",
50
- "@pixi/math": "^6.0.2",
51
- "@pixi/ticker": "^6.0.2",
52
- "@rollup/plugin-commonjs": "^17.0.0",
53
- "@rollup/plugin-node-resolve": "^11.0.0",
54
- "clicked": "^3.0.0",
55
- "fork-me-github": "^1.2.0",
56
- "highlight.js": "^10.4.0",
57
- "jsdoc": "^3.6.3",
58
- "pixi-viewport": "^4.30.4",
59
- "pixi.js": "^6.0.2",
60
- "rollup": "^2.34.0",
61
- "rollup-plugin-node-globals": "^1.4.0",
62
- "rollup-plugin-peer-deps-external": "^2.2.0",
63
- "rollup-plugin-serve": "^1.0.1",
64
- "rollup-plugin-terser": "^5.1.2",
65
- "yy-counter": "^2.1.0",
66
- "yy-fps": "^1.1.0",
67
- "yy-jsdoc-template": "^1.3.0",
68
- "yy-random": "^1.8.0"
2
+ "name": "pixi-scrollbox",
3
+ "version": "3.0.0",
4
+ "description": "a scrollbox built for pixi.js using a masked box that scrolls vertically and/or horizontally with optional scrollbars",
5
+ "main": "./dist/scrollbox.js",
6
+ "module": "./dist/scrollbox.mjs",
7
+ "types": "./@types/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./@types/index.d.ts",
11
+ "import": "./dist/scrollbox.mjs",
12
+ "require": "./dist/scrollbox.js"
69
13
  }
70
- }
14
+ },
15
+ "directories": {
16
+ "doc": "docs"
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "@types"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/davidfig/pixi-scrollbox.git"
25
+ },
26
+ "keywords": [
27
+ "PIXI",
28
+ "pixi.js",
29
+ "scrollbox",
30
+ "UI"
31
+ ],
32
+ "author": "David Figatner",
33
+ "license": "MIT",
34
+ "bugs": {
35
+ "url": "https://github.com/davidfig/pixi-scrollbox/issues"
36
+ },
37
+ "homepage": "https://github.com/davidfig/pixi-scrollbox#readme",
38
+ "peerDependencies": {
39
+ "pixi-viewport": "^7",
40
+ "pixi.js": "^8"
41
+ },
42
+ "devDependencies": {
43
+ "highlight.js": "11.12.0",
44
+ "jsdoc": "4.0.5",
45
+ "jsdom": "29.1.1",
46
+ "penner": "0.1.3",
47
+ "pixi-viewport": "7.0.0",
48
+ "pixi.js": "8.22.0",
49
+ "typescript": "5.9.3",
50
+ "vite": "8.3.5",
51
+ "vitest": "5.0.5",
52
+ "yy-jsdoc-template": "1.3.0"
53
+ },
54
+ "scripts": {
55
+ "dev": "vite --config vite.demo.mjs",
56
+ "build": "vite build",
57
+ "build-demo": "rm -rf docs/assets && vite build --config vite.demo.mjs",
58
+ "docs": "jsdoc -c .jsdoc.json",
59
+ "test": "vitest run",
60
+ "typecheck": "tsc -p tsconfig.json",
61
+ "upgrade": "pnpm update --interactive --latest"
62
+ }
63
+ }