@opentui/core 0.0.0-20251006-283f60d7 → 0.0.0-20251008-63d6b70d
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/3d.js +1 -1
- package/{index-hxktycf0.js → index-pxa2sv92.js} +12 -12
- package/{index-hxktycf0.js.map → index-pxa2sv92.js.map} +3 -3
- package/index.js +9 -4
- package/index.js.map +3 -3
- package/lib/scroll-acceleration.d.ts +1 -0
- package/package.json +7 -7
- package/renderables/ScrollBox.d.ts +2 -0
- package/testing.js +1 -1
package/3d.js
CHANGED
|
@@ -4430,6 +4430,7 @@ class MacOSScrollAccel {
|
|
|
4430
4430
|
velocityHistory = [];
|
|
4431
4431
|
historySize = 3;
|
|
4432
4432
|
streakTimeout = 150;
|
|
4433
|
+
minTickInterval = 6;
|
|
4433
4434
|
constructor(opts = {}) {
|
|
4434
4435
|
this.opts = opts;
|
|
4435
4436
|
}
|
|
@@ -4438,21 +4439,20 @@ class MacOSScrollAccel {
|
|
|
4438
4439
|
const tau = this.opts.tau ?? 3;
|
|
4439
4440
|
const maxMultiplier = this.opts.maxMultiplier ?? 6;
|
|
4440
4441
|
const dt = this.lastTickTime ? now - this.lastTickTime : Infinity;
|
|
4441
|
-
this.
|
|
4442
|
-
|
|
4442
|
+
if (dt === Infinity || dt > this.streakTimeout) {
|
|
4443
|
+
this.lastTickTime = now;
|
|
4443
4444
|
this.velocityHistory = [];
|
|
4444
4445
|
return 1;
|
|
4445
4446
|
}
|
|
4446
|
-
if (dt
|
|
4447
|
-
this.velocityHistory.push(dt);
|
|
4448
|
-
if (this.velocityHistory.length > this.historySize) {
|
|
4449
|
-
this.velocityHistory.shift();
|
|
4450
|
-
}
|
|
4451
|
-
}
|
|
4452
|
-
const avgInterval = this.velocityHistory.length > 0 ? this.velocityHistory.reduce((a, b) => a + b, 0) / this.velocityHistory.length : Infinity;
|
|
4453
|
-
if (avgInterval === Infinity) {
|
|
4447
|
+
if (dt < this.minTickInterval) {
|
|
4454
4448
|
return 1;
|
|
4455
4449
|
}
|
|
4450
|
+
this.lastTickTime = now;
|
|
4451
|
+
this.velocityHistory.push(dt);
|
|
4452
|
+
if (this.velocityHistory.length > this.historySize) {
|
|
4453
|
+
this.velocityHistory.shift();
|
|
4454
|
+
}
|
|
4455
|
+
const avgInterval = this.velocityHistory.reduce((a, b) => a + b, 0) / this.velocityHistory.length;
|
|
4456
4456
|
const referenceInterval = 100;
|
|
4457
4457
|
const velocity = referenceInterval / avgInterval;
|
|
4458
4458
|
const x = velocity / tau;
|
|
@@ -10883,5 +10883,5 @@ Captured output:
|
|
|
10883
10883
|
|
|
10884
10884
|
export { __toESM, __commonJS, __export, __require, Edge, Gutter, exports_src, BorderChars, getBorderFromSides, getBorderSides, borderCharsToArray, BorderCharArrays, nonAlphanumericKeys, parseKeypress, ANSI, KeyEvent, PasteEvent, KeyHandler, InternalKeyHandler, RGBA, hexToRgb, rgbToHex, hsvToRgb, parseColor, fonts, measureText, getCharacterPositions, coordinateToCharacterIndex, renderFontToFrameBuffer, TextAttributes, DebugOverlayCorner, createTextAttributes, visualizeRenderableTree, isStyledText, StyledText, stringToStyledText, black, red, green, yellow, blue, magenta, cyan, white, brightBlack, brightRed, brightGreen, brightYellow, brightBlue, brightMagenta, brightCyan, brightWhite, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bold, italic, underline, strikethrough, dim, reverse, blink, fg, bg, t, convertThemeToStyles, SyntaxStyle, hastToStyledText, LinearScrollAccel, MacOSScrollAccel, parseAlign, parseBoxSizing, parseDimension, parseDirection, parseDisplay, parseEdge, parseFlexDirection, parseGutter, parseJustify, parseLogLevel, parseMeasureMode, parseOverflow, parsePositionType, parseUnit, parseWrap, MouseParser, Selection, convertGlobalToLocalSelection, ASCIIFontSelectionHelper, envRegistry, registerEnvVar, clearEnvCache, generateEnvMarkdown, generateEnvColored, env, treeSitterToTextChunks, treeSitterToStyledText, addDefaultParsers, TreeSitterClient, DataPathsManager, getDataPaths, extToFiletype, pathToFiletype, main, getTreeSitterClient, TextBuffer, LogLevel2 as LogLevel, setRenderLibPath, resolveRenderLib, OptimizedBuffer, h, isVNode, maybeMakeRenderable, wrapWithDelegates, instantiate, delegate, isValidPercentage, LayoutEvents, RenderableEvents, isRenderable, BaseRenderable, Renderable, RootRenderable, capture, ConsolePosition, TerminalConsole, getObjectsInViewport, MouseEvent, MouseButton, createCliRenderer, CliRenderEvents, CliRenderer };
|
|
10885
10885
|
|
|
10886
|
-
//# debugId=
|
|
10887
|
-
//# sourceMappingURL=index-
|
|
10886
|
+
//# debugId=66FAF32C902A5E0B64756E2164756E21
|
|
10887
|
+
//# sourceMappingURL=index-pxa2sv92.js.map
|