Repository navigation
fix(deps): update dependency compute-scroll-into-view to v4 - #1142
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.1.1→^4.0.0Release Notes
scroll-into-view/compute-scroll-into-view (compute-scroll-into-view)
v4.0.0Compare Source
Major Changes
#938
d026dbaThanks @tembo! - Ship ESM only, with the packageexportsgenerated by tsdown.dist/index.cjs) is removed. On Node.js 20.19+ and 22.12+,require('compute-scroll-into-view')still works throughrequire(esm)and returns{ compute }."module": "nodenext". With"module": "node16", TypeScript reports TS1479 when CommonJS files import an ES module. ESM files and"moduleResolution": "bundler"are unaffected.exportsis now{ ".": "./dist/index.js" }. Thesourceexport condition and thesourceandtypingsfields are removed.typesreplacestypings.#953
88378bfThanks @stipsan! -compute(target, options)is spec-only. ThescrollMode,boundaryandskipOverflowHiddenElementsoptions are removed, and are middleware instead, with the same behavior. The built-in middleware are exported fromcompute-scroll-into-view/middleware, so the main entry only hascomputeand its types. Middleware can also change how scroll containers are found and measured, likescroll-marginandscroll-padding.optionsis now optional.onlyIfNeeded()after the other middleware, which is how the options combined.ScrollModetype is removed.ComputeOptionsis an alias ofOptions, and theMiddleware,MiddlewareState,MiddlewareReturn,RectsandSideObjecttypes are exported fromcompute-scroll-into-view.Minor Changes
#952
3a93d4cThanks @stipsan! - Add thecontaineroption from the CSSOM View spec'sScrollIntoViewOptions.container: 'nearest'only scrolls the target's nearest scroll container, or the viewport if it has none. The default,'all', scrolls every scroll container as before.#966
245679dThanks @stipsan! - Scroll the scroll containers and the viewport of the parent document too, when the target is in a same-origin iframe, asElement.scrollIntoView()and the CSSOM View spec do. They align the<iframe>where the scrolling inside the frame left the target, up to the top-level document. Cross-origin parents aren't reachable, and aren't scrolled. Aposition: fixedtarget in a frame doesn't move with the frame's viewport, so only the parent document is scrolled for it. This also covers scrolling a frame's target from inside the frame (#694).#951
520fd20Thanks @stipsan! - Respectscroll-paddingand alignscroll-marginlike browsers do.scroll-paddingon scroll containers, and on the root element for the viewport, is now part of the alignment (#831). Padding in percentages is supported.scroll-marginof the target now works withblock: 'center'and'nearest', and together withscroll-padding(#933).scrollMode: 'if-needed'only counts a target as visible when itsscroll-marginbox is within the scroll containers'scroll-padding(#817). For example, a target behind a fixed header that is covered byscroll-padding-topis scrolled into view.nearestis measured from the padding edge of scroll containers with borders, instead of the border edge.#964
ed654a2Thanks @stipsan! - Land on the target's own snap position in its nearest scroll container when that's a scroll snap container, as the CSSOM View spec requires. On each axis that the container'sscroll-snap-typesnaps, the target'sscroll-snap-alignreplacesblockorinlinethere. The outer scroll containers now align the target from where the browser actually snaps the inner one.#970
46be135Thanks @stipsan! - Add theselection()middleware, which scrolls a text selection into view instead of the target element, like editors keep the caret in view (#902). It takes aSelectionor aRange, and defaults to the document's selection. The focus end is aligned, where the caret is: a collapsed caret is measured as the character or node next to it, so empty lines work too.align: 'bounds'aligns the whole selection instead.computestill walks the target's ancestors, so pass an element inside the editor.onlyIfNeeded()checks the selection when it runs afterselection().#950
28e19bcThanks @stipsan! - Follow the target'swriting-modeanddirection, like browsers do, and support negative scroll offsets.blockandinlinenow refer to the target's block and inline axes. For example,inline: 'start'aligns to the right edge of a right-to-left target, andblock: 'start'aligns to the right edge of avertical-rltarget. Horizontal left-to-right targets work as before.vertical-rlones, now get the negativeleftandtopoffsets browsers use for them, instead of being clamped to 0 (#821).Patch Changes
#960
a51675fThanks @stipsan! - Scroll the body when it's a scroll container. Its overflow only applies to the viewport when the root's overflow isvisible, so a body withoverflow: autounder a root withoverflow: hidden,autoorclipis scrolled now, likeElement.scrollIntoView()does.#949
76f855dThanks @stipsan! - Declare the supported browsers as Baseline 2019 in thebrowserslistfield ofpackage.json, and build for it. The bundle now also compiles away optional catch binding for legacy Edge 18, and stays free of optional chaining and nullish coalescing.dist/index.d.ts.mapis no longer published, as it pointed atsrc/, which isn't published either.dist/index.js.mapstill embeds the source.#957
e724874Thanks @feritcemkahraman! - Don't scrolloverflow: visibleelements inside an iframe. Only the iframe document's viewport (its root or scrolling element) is clipped by the iframe and scrolled when its content overflows it.#936
aaaccf9Thanks @tembo! - Check forHTMLElementandShadowRootproperties with type guards instead of type assertions. The checks are the same, so behavior is unchanged. The type declarations now use the JSDoc@defaulttag instead of TSDoc's@defaultValue.#958
3b64201Thanks @satouriko! - Only scroll the scroll containers in the containing block chain of the target, likeElement.scrollIntoView()does. Scroll containers that an absolutely or fixed positioned target escapes don't move it, so they aren't scrolled anymore, and the viewport isn't scrolled for a fixed positioned target either. Containing blocks followpositionand the properties that contain positioned descendants, liketransform,filterandcontain. Middleware still visit those scroll containers, withscrollable: false.#961
4796634Thanks @stipsan! - Scroll the viewport when the target is the scrolling element, or the root element in quirks mode. They have no ancestor that scrolls the viewport, socompute(document.body)returned no actions in quirks mode, andcompute(document.documentElement)didn't in standards mode.#956
9a21f0cThanks @Remiscan! - Scroll the scroll containers in a shadow tree that a slotted target is laid out in. The parent walk now goes from an element to itsassignedSlot, before its parent element, so the slot's ancestors in the shadow tree are scrolled too, likeElement.scrollIntoView()does.#971
f1fc35bThanks @stipsan! - Shrink the published bundle by about a fifth when minified. Measuring the four sides of a box and scrolling each axis now share one code path, andgetPropertyValue()replaces the per-side style lookups. Behavior is unchanged.#962
e49fb1bThanks @stipsan! - Use the target's own document and window for viewport measurements, so scrolling a target inside a frame works whencomputeis called from the parent document.v3.2.2Compare Source
Patch Changes
9fe791eThanks @tembo! - Compile the published bundles to ES2019 syntax again. Releases 3.2.0 and 3.2.1 shipped optional chaining (?.) and nullish coalescing (??) because the browserslist targets drifted, which broke Webpack 4 and other older toolchains (scroll-into-view-if-needed#1235). The build targets are now pinned and the build fails if the output isn't ES2019-compatible.v3.2.1Compare Source
Patch Changes
1ba1f96Thanks @tembo! - Remove theengines.noderequirement added in the previous release. Requiring Node.js 26 was unintentionally breaking for consumers on older Node.js versions, and as a browser library this package has no Node.js runtime requirement (compute-scroll-into-view#928)v3.2.0Compare Source
Minor Changes
c9096c4Thanks @stipsan! - Require Node.js 26 (current LTS) or later, and publish to npm with trusted publishing (OIDC) and provenanceConfiguration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate using a curated preset maintained by
. View repository job log here