@gjsify/adwaita-core 0.42.0 → 0.44.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/lib/esm/carousel.js +1 -1
- package/lib/esm/conformance/carousel.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/swipe.js +1 -0
- package/lib/types/carousel.d.ts +16 -0
- package/lib/types/conformance/carousel.d.ts +4 -3
- package/lib/types/index.d.ts +2 -0
- package/lib/types/swipe.d.ts +190 -0
- package/lib/types/swipe.spec.d.ts +2 -0
- package/package.json +3 -3
package/lib/esm/carousel.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{glibClamp as e}from"./glib.js";const
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{glibClamp as e}from"./glib.js";import{swipeClosestPointIndex as t}from"./swipe.js";const n=150,r=.01;function approx(e,t){return Math.abs(e-t)<2**-52}function carouselSnapPoints(e){let t=0;return e.map(e=>{let n=t+e-1;return t+=e,n})}function carouselSizesFromSnapPoints(e){if(e.length===0)return[];let t=[e[0]+1];for(let n=1;n<e.length;n++)t.push(e[n]-e[n-1]);return t}function carouselPageAllocation(t,n){let r=0;for(let i of n){let n=i.expand?t:e(i.natural,i.minimum??0,t);r=Math.max(r,n)}return{pageSize:r,leadingInset:(t-r)/2}}function carouselRange(e,t=0){let n=e.length>0?e[e.length-1]:0;return{lower:0,upper:Math.max(0,t+n)}}function carouselClampPosition(t,n,r=0){let i=carouselRange(n,r);return e(t,i.lower,i.upper)}function carouselClosestSnapPoint(e,n){return n.length===0?-1:t(n,e)}function carouselPageAtPosition(e,t){return carouselClosestSnapPoint(carouselClampPosition(e,t),t)}function cRound(e){return Math.sign(e)*Math.round(Math.abs(e))}function carouselNavigateTarget(e,t,n){if(t<=0)return null;let r=cRound(e);return n===`back`?r>0?r-1:null:r<t-1?r+1:null}function carouselWheelStep(e){if(e.source===`touchpad`)return 0;let t=e.source===`mouse`,n=0;return(e.orientation===`vertical`||t)&&(e.deltaY>0?n=1:e.deltaY<0&&(n=-1)),e.orientation===`horizontal`&&n===0&&(e.deltaX>0?n=1:e.deltaX<0&&(n=-1)),n}function carouselReorderShift(e){let{closestPoint:t,oldPoint:n,newPoint:r,size:i}=e;return approx(t,n)?r-n:(approx(n,t)||n>t)&&(approx(t,r)||t>r)?i:(approx(r,t)||r>t)&&(approx(t,n)||t>n)?-i:0}function nthPageDiagnostic(e,t){return`adw_carousel_get_nth_page: assertion 'n < adw_carousel_get_n_pages (self)' failed (n = ${e}, n_pages = ${t})`}function positionDiagnostic(e,t){return`${e}: assertion 'position >= -1' failed (position = ${t})`}function unknownPageDiagnostic(e){return`AdwCarousel: no page with id '${e}'`}function nonFiniteDiagnostic(e,t){return`AdwCarousel: ${e} must be a finite double (got ${t})`}var CarouselState=class{constructor(e={}){this._children=[],this._position=0,this._wheelLockedAt=null,this._settledPage=null,this._listeners=new Set,this._pageChangedListeners=new Set,this._diagnostics=[],this._orientation=e.orientation??`horizontal`,this._interactive=e.interactive??!0,this._allowScrollWheel=e.allowScrollWheel??!0,this._allowMouseDrag=e.allowMouseDrag??!0,this._allowLongSwipes=e.allowLongSwipes??!1,this._spacing=e.spacing??0,this._revealDuration=e.revealDuration??0,this._now=e.now??(()=>Date.now()),this._onScrollTo=e.onScrollTo,this._animateScroll=e.animateScroll??!1}subscribe(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}onPageChanged(e){return this._pageChangedListeners.add(e),()=>{this._pageChangedListeners.delete(e)}}_emit(e,t){let n={position:this._position,nPages:this.nPages,page:this.pageAt(this._position),interactive:t,reason:e};for(let e of[...this._listeners])e(n)}get nPages(){let e=0;for(let t of this._children)t.removing||e++;return e}get ids(){return this._children.filter(e=>!e.removing).map(e=>e.id)}get position(){return this._position}get sizes(){return this._children.map(e=>e.size)}get snapPoints(){return carouselSnapPoints(this.sizes)}get range(){return carouselRange(this.snapPoints)}_visibleSnapPoints(){return this.snapPoints.filter((e,t)=>!this._children[t].removing)}pageAt(e){return carouselPageAtPosition(e,this._visibleSnapPoints())}indexOf(e){let t=0;for(let n of this._children)if(!n.removing){if(n.id===e)return t;t++}return-1}snapPointOf(e){let t=this._nthLink(e);return t<0?void 0:this.snapPoints[t]}_nthLink(e){let t=e;for(let e=0;e<this._children.length;e++)if(!this._children[e].removing&&t--===0)return e;return-1}_closestChildIndex(e,t,n){let r=this.snapPoints,i=[],a=[];this._children.forEach((e,o)=>{e.adding&&!t||e.removing&&!n||(i.push(o),a.push(r[o]))});let o=carouselClosestSnapPoint(e,a);return o<0?-1:i[o]}_updateShiftPositionFlag(e){let t=this._closestChildIndex(this._position,!1,!0);t<0||(this._children[e].shiftPosition=t>=e)}_updateShiftFlags(){this._children.forEach((e,t)=>{(e.adding||e.removing)&&this._updateShiftPositionFlag(t)})}setPosition(e,t=!1){if(!Number.isFinite(e))return this._diagnostics.push(nonFiniteDiagnostic(`position`,e)),!1;let n=carouselClampPosition(e,this.snapPoints),r=n!==this._position;return this._position=n,this._updateShiftFlags(),this._emit(`position`,t),r}scrollTo(e,t={}){let n=this.nPages;if(!Number.isInteger(e)||e<0||e>=n)return this._diagnostics.push(nthPageDiagnostic(e,n)),!1;let r=t.interactive??!1,i=t.animate??this._animateScroll,a=this.snapPointOf(e);return this._onScrollTo?.({index:e,position:a,interactive:r,animate:i}),i||(this.setPosition(a,r),this.settle()),!0}settle(){let e=this.pageAt(this._position);this._settledPage=e;for(let t of[...this._pageChangedListeners])t(e)}settleIfArrived(e=r){let t=this.pageAt(this._position),n=this.snapPointOf(t);return n===void 0||Math.abs(this._position-n)>=e?(this._settledPage=null,!1):this._settledPage===t?!1:(this.settle(),!0)}navigate(e){if(!this._interactive)return!1;let t=carouselNavigateTarget(this._position,this.nPages,e);return t===null?!1:this.scrollTo(t,{interactive:!0})}handleWheel(t){if(!this._allowScrollWheel||this._wheelLockedAt!==null&&this._now()-this._wheelLockedAt<150||!this._interactive)return 0;let n=this.nPages;if(n===0)return 0;let r=carouselWheelStep({...t,orientation:this._orientation});if(r===0)return 0;let i=e(this.pageAt(this._position)+r,0,n-1);return this.scrollTo(i,{interactive:!0}),this._wheelLockedAt=this._now(),r}insertPage(e,t=-1){if(!Number.isInteger(t)||t<-1)return this._diagnostics.push(positionDiagnostic(`adw_carousel_insert`,t)),!1;let n={id:e,size:0,adding:!0,removing:!1,shiftPosition:!1},r=t>=0?this._nthLink(t):-1,i=r<0?this._children.length:r;return this._children.splice(i,0,n),this._updateShiftPositionFlag(i),this._emit(`n-pages`,!1),!0}removePage(e){let t=this._children.findIndex(t=>t.id===e&&!t.removing);if(t<0)return this._diagnostics.push(unknownPageDiagnostic(e)),!1;let n=this._children[t];return n.removing=!0,this._updateShiftPositionFlag(t),n.adding&&this._children.splice(t,1),this._emit(`n-pages`,!1),!0}reorderPage(e,t){if(!Number.isInteger(t)||t<-1)return this._diagnostics.push(positionDiagnostic(`adw_carousel_reorder`,t)),!1;let n=this._children.findIndex(t=>t.id===e);if(n<0)return this._diagnostics.push(unknownPageDiagnostic(e)),!1;if(t===n)return!1;let r=this._closestChildIndex(this._position,!0,!0),i=this.snapPoints,a=r<0?0:i[r],o=i[n],s=this.nPages,c=t<0||t>s?s:t;if(n===s-1&&c===s)return!1;let l;l=c===s?-1:c>n?this._nthLink(c+1):this._nthLink(c);let u;u=l>=0?c>n?i[l-1]:i[l]:i[i.length-1];let[d]=this._children.splice(n,1);l<0?this._children.push(d):this._children.splice(l>n?l-1:l,0,d);let f=carouselReorderShift({closestPoint:a,oldPoint:o,newPoint:u,size:d.size});return f===0?(this._emit(`geometry`,!1),!0):(this._position=carouselClampPosition(this._position+f,this.snapPoints),this._updateShiftFlags(),this._emit(`position`,!1),!0)}setPageSize(e,t){if(!Number.isFinite(t))return this._diagnostics.push(nonFiniteDiagnostic(`size of page '${e}'`,t)),!1;let n=this._children.findIndex(t=>t.id===e);if(n<0)return this._diagnostics.push(unknownPageDiagnostic(e)),!1;let r=this._children[n],i=t-r.size,a=r.shiftPosition&&i!==0;return r.size=t,r.removing&&t<=0?this._children.splice(n,1):r.adding&&t>=1&&(r.adding=!1),a?(this._position=carouselClampPosition(this._position+i,this.snapPoints),this._updateShiftFlags(),this._emit(`position`,!1),!0):(this._emit(`geometry`,!1),!0)}skipReveal(e){let t=this._children.find(t=>t.id===e);return!t||!t.adding&&!t.removing?!1:this.setPageSize(e,+!t.removing)}get orientation(){return this._orientation}setOrientation(e){return e===this._orientation?!1:(this._orientation=e,this._emit(`geometry`,!1),!0)}get interactive(){return this._interactive}setInteractive(e){let t=!!e;return t===this._interactive?!1:(this._interactive=t,!0)}get allowScrollWheel(){return this._allowScrollWheel}setAllowScrollWheel(e){let t=!!e;return t===this._allowScrollWheel?!1:(this._allowScrollWheel=t,!0)}get allowMouseDrag(){return this._allowMouseDrag}setAllowMouseDrag(e){let t=!!e;return t===this._allowMouseDrag?!1:(this._allowMouseDrag=t,!0)}get allowLongSwipes(){return this._allowLongSwipes}setAllowLongSwipes(e){let t=!!e;return t===this._allowLongSwipes?!1:(this._allowLongSwipes=t,!0)}get spacing(){return this._spacing}setSpacing(e){return!Number.isFinite(e)||e<0?(this._diagnostics.push(nonFiniteDiagnostic(`spacing`,e)),!1):e===this._spacing?!1:(this._spacing=e,this._emit(`geometry`,!1),!0)}get revealDuration(){return this._revealDuration}setRevealDuration(e){return!Number.isFinite(e)||e<0?(this._diagnostics.push(nonFiniteDiagnostic(`reveal-duration`,e)),!1):e===this._revealDuration?!1:(this._revealDuration=e,!0)}pageDistance(e){return e+this._spacing}get diagnostics(){return this._diagnostics}};export{n as CAROUSEL_SCROLL_TIMEOUT_MS,r as CAROUSEL_SETTLE_EPSILON,CarouselState,carouselClampPosition,carouselClosestSnapPoint,carouselNavigateTarget,carouselPageAllocation,carouselPageAtPosition,carouselRange,carouselReorderShift,carouselSizesFromSnapPoints,carouselSnapPoints,carouselWheelStep};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=[{sizes:[1,1,1],snapPoints:[0,1,2],rule:`settled pages sit one unit apart, starting at 0`},{sizes:[1],snapPoints:[0],rule:`a single page is always at position 0`},{sizes:[1,.5,1],snapPoints:[0,.5,1.5],rule:`a half-revealed page makes the snap points fractional`},{sizes:[0,1,1],snapPoints:[-1,0,1],rule:`a page inserted at 0 starts at size 0 (:1385), so its snap point is NEGATIVE — which is what keeps the pages behind it in place`},{sizes:[1,1,0],snapPoints:[0,1,1],rule:`a trailing size-0 page shares its predecessor’s snap point`},{sizes:[],snapPoints:[],rule:`no pages, no snap points — the swipeable view pads this to [0] (:1269)`}],t=[{snapPoints:[0,1,2],sizes:[1,1,1],rule:`settled pages round-trip to size 1`},{snapPoints:[0,.5,1.5],sizes:[1,.5,1],rule:`a mid-reveal page is recovered as a fraction`},{snapPoints:[-1,0,1],sizes:[0,1,1],rule:`the +1 offset recovers a just-inserted page as size 0`},{snapPoints:[0],sizes:[1],rule:`an EMPTY carousel still measures as one page (:1269 pads to a single 0)`},{snapPoints:[],sizes:[],rule:`nothing in, nothing out`}],n=[{available:480,pages:[{natural:440},{natural:440},{natural:440}],pageSize:440,leadingInset:20,rule:`a page narrower than the carousel keeps its natural size, and the 40px left over is split so BOTH neighbours peek in by 20px`},{available:480,pages:[{natural:200},{natural:440},{natural:300}],pageSize:440,leadingInset:20,rule:`every page is allocated the SAME size, the largest of them (:764)`},{available:480,pages:[{natural:900}],pageSize:480,leadingInset:0,rule:`a page wider than the carousel is capped at it (:754), the only case in which a page IS the carousel width`},{available:480,pages:[{natural:200,expand:!0},{natural:200}],pageSize:480,leadingInset:0,rule:`an expanding page takes the whole carousel (:751-752), and one expanding page sizes them all`},{available:480,pages:[{natural:450,minimum:600}],pageSize:600,leadingInset:-60,rule:`CLAMP tests the HIGH bound first, so a page whose MINIMUM exceeds the carousel gets its minimum and the strip overhangs both edges`},{available:0,pages:[{natural:440}],pageSize:0,leadingInset:0,rule:`a carousel with no width allocates no page, which is why a renderer must wait for its first layout before measuring anything`},{available:480,pages:[],pageSize:0,leadingInset:240,rule:"no pages, no size: `size` starts at 0 (:738) with nothing to MAX it against"}],r=[{snapPoints:[0,1,2],positionShift:0,lower:0,upper:2,rule:`the last snap point is the upper bound`},{snapPoints:[],positionShift:0,lower:0,upper:0,rule:`an empty carousel cannot scroll (:212-219)`},{snapPoints:[0],positionShift:0,lower:0,upper:0,rule:`one page cannot scroll either`},{snapPoints:[0,1,2],positionShift:-5,lower:0,upper:0,rule:`MAX(0, …) floors the bound — a large pending shift collapses the range instead of inverting it`},{snapPoints:[-1,0,1],positionShift:0,lower:0,upper:1,rule:`a negative FIRST snap point does not lower the bound; only the last one is read`}],i=[{position:5,snapPoints:[0,1,2],clamped:2,rule:`past the end clamps to the last snap point`},{position:-3,snapPoints:[0,1,2],clamped:0,rule:`below the start clamps to 0`},{position:1.7,snapPoints:[0,1,2],clamped:1.7,rule:`the clamp BOUNDS the scroll, it does not snap — a fractional position passes through`},{position:5,snapPoints:[],clamped:0,rule:`an empty carousel clamps everything to 0`},{position:0,snapPoints:[0,1,2],clamped:0,rule:`an in-range position is untouched`}],a=[{position:0,snapPoints:[0,1,2],page:0,rule:`exactly on a snap point`},{position:2,snapPoints:[0,1,2],page:2,rule:`exactly on the last snap point`},{position:.5,snapPoints:[0,1,2],page:0,rule:`an exact tie resolves to the LOWER page — Math.round would answer 1 here, and both ports did`},{position:.5000001,snapPoints:[0,1,2],page:1,rule:`a hair past the tie flips to the later page`},{position:.4999999,snapPoints:[0,1,2],page:0,rule:`a hair before the tie stays on the earlier page`},{position:1.5,snapPoints:[0,1,2],page:1,rule:`the tie-break is the same at every boundary`},{position:9,snapPoints:[0,1,2],page:2,rule:`the position is clamped into the range BEFORE the search`},{position:-1,snapPoints:[0,1,2],page:0,rule:`clamped from below the same way`},{position:0,snapPoints:[],page:-1,rule:"an empty carousel has no current page — the -1 `page-changed` documents (:1150-1151)"},{position:.5,snapPoints:[-1,0,1],page:1,rule:`mid-insert geometry: the search runs on snap points, not on indices`}],o=[{position:0,nPages:3,direction:`back`,target:null,rule:`already at the first page (:489-494)`},{position:2,nPages:3,direction:`forward`,target:null,rule:`already at the last page (:495-499)`},{position:0,nPages:3,direction:`forward`,target:1,rule:`one page forward`},{position:2,nPages:3,direction:`back`,target:1,rule:`one page back`},{position:.5,nPages:3,direction:`forward`,target:2,rule:`round(0.5) = 1 — half AWAY FROM ZERO, where the page lookup would have answered 0`},{position:.5,nPages:3,direction:`back`,target:0,rule:`the same rounding backwards: 1 − 1`},{position:1.4,nPages:3,direction:`back`,target:0,rule:`round(1.4) = 1, then −1`},{position:1.6,nPages:3,direction:`forward`,target:null,rule:`round(1.6) = 2, already the last page`},{position:0,nPages:0,direction:`forward`,target:null,rule:`an empty carousel never navigates (:482-484)`},{position:0,nPages:1,direction:`forward`,target:null,rule:`a single page is both bounds`}],s=[{deltaX:0,deltaY:53,orientation:`horizontal`,source:`mouse`,step:1,rule:`a mouse wheel pages a HORIZONTAL carousel — mice rarely have a horizontal wheel (:540-542)`},{deltaX:0,deltaY:-53,orientation:`horizontal`,source:`mouse`,step:-1,rule:`the same, backwards`},{deltaX:-30,deltaY:0,orientation:`horizontal`,source:`mouse`,step:-1,rule:`the dx FALLBACK the web port dropped: it returned early on |dy| <= |dx|, so this did nothing`},{deltaX:30,deltaY:-53,orientation:`horizontal`,source:`mouse`,step:-1,rule:`dx is only consulted when the vertical branch produced nothing (:554)`},{deltaX:-30,deltaY:0,orientation:`horizontal`,source:`touchpad`,step:0,rule:`a touchpad always propagates — its kinetic scroll drives the swipe tracker (:537-538)`},{deltaX:0,deltaY:53,orientation:`horizontal`,source:`other`,step:0,rule:`a non-mouse device may only scroll ALONG the carousel’s axis`},{deltaX:53,deltaY:0,orientation:`horizontal`,source:`other`,step:1,rule:`and along the axis it works for any source`},{deltaX:0,deltaY:-10,orientation:`vertical`,source:`other`,step:-1,rule:`a vertical carousel reads dy`},{deltaX:53,deltaY:0,orientation:`vertical`,source:`mouse`,step:0,rule:`a vertical carousel NEVER reads dx — the fallback branch requires GTK_ORIENTATION_HORIZONTAL (:554)`},{deltaX:0,deltaY:0,orientation:`horizontal`,source:`mouse`,step:0,rule:`a null event propagates`}],c=[{pages:3,steps:[{at:1e3,deltaY:53,step:1,position:1},{at:1100,deltaY:53,step:0,position:1},{at:1150,deltaY:53,step:1,position:2}],rule:`a notch 100 ms later propagates; at exactly 150 ms the lockout has expired (g_timeout_add_once fires AT the duration)`},{pages:3,steps:[{at:0,deltaY:30,step:1,position:1},{at:200,deltaY:-30,step:-1,position:0}],rule:`opposite notches page BOTH ways — the accumulator the web port used cancelled them out instead`},{pages:2,steps:[{at:0,deltaY:53,step:1,position:1},{at:500,deltaY:53,step:1,position:1}],rule:`a notch at the last page still consumes the event and still arms the lockout (:561-576, :567)`}],l=[{closestPoint:1,oldPoint:2,newPoint:0,size:1,shift:1,rule:`a page from AFTER the current one moved BEFORE it: one page of content appeared ahead (:1490-1492)`},{closestPoint:1,oldPoint:0,newPoint:2,size:1,shift:-1,rule:`a page from BEFORE moved AFTER: one page of content disappeared ahead (:1493-1495)`},{closestPoint:1,oldPoint:1,newPoint:2,size:1,shift:1,rule:`the CURRENT page is the one moved, so the position follows it (:1488-1489)`},{closestPoint:0,oldPoint:1,newPoint:2,size:1,shift:0,rule:`a move entirely on one side of the position changes nothing`},{closestPoint:1,oldPoint:2,newPoint:0,size:.5,shift:.5,rule:`the shift is the moved page’s SIZE, so a half-revealed page shifts by half`}],u=[{pages:[`a`,`b`,`c`],ops:[],opResults:[],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`three settled pages sit one unit apart and start on page 0`},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`c`,`d`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:"append — `adw_carousel_append` is insert at -1 (:1349-1357)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:7}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`c`,`d`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:"a position past the end appends — `get_nth_link` returns NULL there (:1388-1391)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:0}],opResults:[!0],pageChanged:[],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:1,page:1},rule:"prepend — `adw_carousel_prepend` is insert at 0 (:1330-1339). The position moves to 1 so the page on screen is still `a`: a page revealed AT OR BEFORE the current one drags the position with it (`shift_position`, :241-258, :293-294)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:-2}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`below -1 fails C’s own precondition (:1381) and adds nothing`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`insert`,id:`d`,position:0}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:3,page:3},rule:"inserting BEFORE the current page moves the position with it, so the same page stays on screen (`shift_position`, :241-258)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:2}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`d`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:`inserting AFTER the current page leaves the position alone`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`a`}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`b`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:1,page:1},rule:"removing a page BEFORE the current one pulls the position back so `c` stays on screen"},{pages:[`a`,`b`,`c`],ops:[{kind:`remove`,id:`c`}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:`removing a page AFTER the current one leaves the position alone`},{pages:[`a`,`b`,`c`],ops:[{kind:`remove`,id:`zz`}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`removing a page that is not there changes nothing`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`c`,position:0}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`c`,`a`,`b`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:"a page from after the current one moved before it shifts the position +size, so `b` is still shown (:1490-1492)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`a`,position:2}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`b`,`c`,`a`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:"a page from before the current one moved after it shifts −size, so `b` is still shown (:1493-1495)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`b`,position:2}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`a`,`c`,`b`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:`moving the CURRENT page carries the position along with it (:1488-1489)`},{pages:[`a`,`b`,`c`],ops:[{kind:`reorder`,id:`a`,position:0}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`reordering a page to where it already is returns before doing anything (:1439-1440)`},{pages:[`a`,`b`,`c`],ops:[{kind:`reorder`,id:`c`,position:-1}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`moving the LAST page to the end is the second early-out, checked after normalisation (:1448-1449)`},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:2}],opResults:[!0],pageChanged:[2],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:"a completed scroll emits `page-changed` (:363-376)"},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:1},{kind:`scrollTo`,index:1}],opResults:[!0,!0],pageChanged:[1,1],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:1,page:1},rule:`settling back onto the SAME page emits again — the web port’s index-change gate swallowed this`},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:99},{kind:`scrollTo`,index:-1},{kind:`scrollTo`,index:1.5},{kind:`scrollTo`,index:NaN}],opResults:[!1,!1,!1,!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:"out-of-range, fractional and NaN targets are REFUSED, not clamped — `get_nth_page` fails its precondition and `scroll_to` returns on the NULL widget (:1616, :385-386). NaN used to set the NS position to NaN"},{pages:[],ops:[{kind:`settle`}],opResults:[!0],pageChanged:[-1],expected:{ids:[],nPages:0,sizes:[],snapPoints:[],position:0,page:-1},rule:`an empty carousel reports index -1, the case the signal documents (:1150-1151) and neither port could produce`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:.5},{kind:`settle`}],opResults:[!0,!0],pageChanged:[0],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:.5,page:0},rule:`settling half-way reports the LOWER page; both ports reported 1`}],d=[{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:0}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[0,1,1,1],snapPoints:[-1,0,1,2],position:0,page:1},rule:"immediately after the insert the page has size 0 and a NEGATIVE snap point, and the carousel still shows `a` (:1385-1386, :782)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`insert`,id:`d`,position:0},{kind:`size`,id:`d`,size:.5}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[.5,1,1,1],snapPoints:[-.5,.5,1.5,2.5],position:1.5,page:2},rule:"half-way through the reveal the position has moved half a page, so `b` has not slid sideways (`resize_animation_value_cb`, :284-297)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`insert`,id:`d`,position:0},{kind:`reveal`,id:`d`}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:2,page:2},rule:"once revealed the shift has moved a full page and `b` is still the current one"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:1},rule:`a removed page leaves n-pages at once (:1522, :1640-1645) but keeps its geometry, so the pages after it have not moved yet`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`},{kind:`size`,id:`b`,size:.5}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,.5,1],snapPoints:[0,.5,1.5],position:1.5,page:1},rule:"while it shrinks the position follows, keeping `c` on screen"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`},{kind:`reveal`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:1,page:1},rule:"reaching size 0 drops the entry from the geometry entirely (`resize_animation_done_cb`, :309-313)"},{pages:[`a`,`b`],ops:[{kind:`insert`,id:`c`},{kind:`remove`,id:`c`}],expected:{ids:[`a`,`b`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:`removing a page that is still revealing frees it on the spot — the skip finishes the animation, which runs the done handler (:329-337 → :309-313)`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`remove`,id:`b`},{kind:`reveal`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:"removing the CURRENT page shifts too — `update_shift_position_flag` counts removing children on purpose (:248-249)"}],f=[{property:`orientation`,value:`horizontal`,rule:`adw_carousel_init (:1205)`},{property:`interactive`,value:!0,rule:`AdwCarousel:interactive defaults TRUE (:1051-1054)`},{property:`allowScrollWheel`,value:!0,rule:`AdwCarousel:allow-scroll-wheel defaults TRUE (:1103-1106, :1201) — the web port defaulted it FALSE`},{property:`allowLongSwipes`,value:!1,rule:`AdwCarousel:allow-long-swipes defaults FALSE (:1115-1118) — one flick, one page`},{property:`spacing`,value:0,rule:`AdwCarousel:spacing defaults 0 (:1061-1066)`},{property:`revealDuration`,value:0,rule:`AdwCarousel:reveal-duration defaults 0 (:1127-1132, :1206)`}];export{i as CAROUSEL_CLAMP_VECTORS,o as CAROUSEL_NAVIGATE_VECTORS,n as CAROUSEL_PAGE_ALLOCATION_VECTORS,a as CAROUSEL_PAGE_AT_POSITION_VECTORS,u as CAROUSEL_PAGE_LIST_VECTORS,f as CAROUSEL_PROPERTY_DEFAULT_VECTORS,r as CAROUSEL_RANGE_VECTORS,l as CAROUSEL_REORDER_SHIFT_VECTORS,d as CAROUSEL_REVEAL_VECTORS,t as CAROUSEL_SIZES_FROM_SNAP_POINTS_VECTORS,e as CAROUSEL_SNAP_POINT_VECTORS,c as CAROUSEL_WHEEL_LOCKOUT_VECTORS,s as CAROUSEL_WHEEL_VECTORS};
|
|
1
|
+
const e=[{sizes:[1,1,1],snapPoints:[0,1,2],rule:`settled pages sit one unit apart, starting at 0`},{sizes:[1],snapPoints:[0],rule:`a single page is always at position 0`},{sizes:[1,.5,1],snapPoints:[0,.5,1.5],rule:`a half-revealed page makes the snap points fractional`},{sizes:[0,1,1],snapPoints:[-1,0,1],rule:`a page inserted at 0 starts at size 0 (:1385), so its snap point is NEGATIVE — which is what keeps the pages behind it in place`},{sizes:[1,1,0],snapPoints:[0,1,1],rule:`a trailing size-0 page shares its predecessor’s snap point`},{sizes:[],snapPoints:[],rule:`no pages, no snap points — the swipeable view pads this to [0] (:1269)`}],t=[{snapPoints:[0,1,2],sizes:[1,1,1],rule:`settled pages round-trip to size 1`},{snapPoints:[0,.5,1.5],sizes:[1,.5,1],rule:`a mid-reveal page is recovered as a fraction`},{snapPoints:[-1,0,1],sizes:[0,1,1],rule:`the +1 offset recovers a just-inserted page as size 0`},{snapPoints:[0],sizes:[1],rule:`an EMPTY carousel still measures as one page (:1269 pads to a single 0)`},{snapPoints:[],sizes:[],rule:`nothing in, nothing out`}],n=[{available:480,pages:[{natural:440},{natural:440},{natural:440}],pageSize:440,leadingInset:20,rule:`a page narrower than the carousel keeps its natural size, and the 40px left over is split so BOTH neighbours peek in by 20px`},{available:480,pages:[{natural:200},{natural:440},{natural:300}],pageSize:440,leadingInset:20,rule:`every page is allocated the SAME size, the largest of them (:764)`},{available:480,pages:[{natural:900}],pageSize:480,leadingInset:0,rule:`a page wider than the carousel is capped at it (:754), the only case in which a page IS the carousel width`},{available:480,pages:[{natural:200,expand:!0},{natural:200}],pageSize:480,leadingInset:0,rule:`an expanding page takes the whole carousel (:751-752), and one expanding page sizes them all`},{available:480,pages:[{natural:450,minimum:600}],pageSize:600,leadingInset:-60,rule:`CLAMP tests the HIGH bound first, so a page whose MINIMUM exceeds the carousel gets its minimum and the strip overhangs both edges`},{available:0,pages:[{natural:440}],pageSize:0,leadingInset:0,rule:`a carousel with no width allocates no page, which is why a renderer must wait for its first layout before measuring anything`},{available:480,pages:[],pageSize:0,leadingInset:240,rule:"no pages, no size: `size` starts at 0 (:738) with nothing to MAX it against"}],r=[{snapPoints:[0,1,2],positionShift:0,lower:0,upper:2,rule:`the last snap point is the upper bound`},{snapPoints:[],positionShift:0,lower:0,upper:0,rule:`an empty carousel cannot scroll (:212-219)`},{snapPoints:[0],positionShift:0,lower:0,upper:0,rule:`one page cannot scroll either`},{snapPoints:[0,1,2],positionShift:-5,lower:0,upper:0,rule:`MAX(0, …) floors the bound — a large pending shift collapses the range instead of inverting it`},{snapPoints:[-1,0,1],positionShift:0,lower:0,upper:1,rule:`a negative FIRST snap point does not lower the bound; only the last one is read`}],i=[{position:5,snapPoints:[0,1,2],clamped:2,rule:`past the end clamps to the last snap point`},{position:-3,snapPoints:[0,1,2],clamped:0,rule:`below the start clamps to 0`},{position:1.7,snapPoints:[0,1,2],clamped:1.7,rule:`the clamp BOUNDS the scroll, it does not snap — a fractional position passes through`},{position:5,snapPoints:[],clamped:0,rule:`an empty carousel clamps everything to 0`},{position:0,snapPoints:[0,1,2],clamped:0,rule:`an in-range position is untouched`}],a=[{position:0,snapPoints:[0,1,2],page:0,rule:`exactly on a snap point`},{position:2,snapPoints:[0,1,2],page:2,rule:`exactly on the last snap point`},{position:.5,snapPoints:[0,1,2],page:0,rule:`an exact tie resolves to the LOWER page — Math.round would answer 1 here, and both ports did`},{position:.5000001,snapPoints:[0,1,2],page:1,rule:`a hair past the tie flips to the later page`},{position:.4999999,snapPoints:[0,1,2],page:0,rule:`a hair before the tie stays on the earlier page`},{position:1.5,snapPoints:[0,1,2],page:1,rule:`the tie-break is the same at every boundary`},{position:9,snapPoints:[0,1,2],page:2,rule:`the position is clamped into the range BEFORE the search`},{position:-1,snapPoints:[0,1,2],page:0,rule:`clamped from below the same way`},{position:0,snapPoints:[],page:-1,rule:"an empty carousel has no current page — the -1 `page-changed` documents (:1150-1151)"},{position:.5,snapPoints:[-1,0,1],page:1,rule:`mid-insert geometry: the search runs on snap points, not on indices`}],o=[{position:0,nPages:3,direction:`back`,target:null,rule:`already at the first page (:489-494)`},{position:2,nPages:3,direction:`forward`,target:null,rule:`already at the last page (:495-499)`},{position:0,nPages:3,direction:`forward`,target:1,rule:`one page forward`},{position:2,nPages:3,direction:`back`,target:1,rule:`one page back`},{position:.5,nPages:3,direction:`forward`,target:2,rule:`round(0.5) = 1 — half AWAY FROM ZERO, where the page lookup would have answered 0`},{position:.5,nPages:3,direction:`back`,target:0,rule:`the same rounding backwards: 1 − 1`},{position:1.4,nPages:3,direction:`back`,target:0,rule:`round(1.4) = 1, then −1`},{position:1.6,nPages:3,direction:`forward`,target:null,rule:`round(1.6) = 2, already the last page`},{position:0,nPages:0,direction:`forward`,target:null,rule:`an empty carousel never navigates (:482-484)`},{position:0,nPages:1,direction:`forward`,target:null,rule:`a single page is both bounds`}],s=[{deltaX:0,deltaY:53,orientation:`horizontal`,source:`mouse`,step:1,rule:`a mouse wheel pages a HORIZONTAL carousel — mice rarely have a horizontal wheel (:540-542)`},{deltaX:0,deltaY:-53,orientation:`horizontal`,source:`mouse`,step:-1,rule:`the same, backwards`},{deltaX:-30,deltaY:0,orientation:`horizontal`,source:`mouse`,step:-1,rule:`the dx FALLBACK the web port dropped: it returned early on |dy| <= |dx|, so this did nothing`},{deltaX:30,deltaY:-53,orientation:`horizontal`,source:`mouse`,step:-1,rule:`dx is only consulted when the vertical branch produced nothing (:554)`},{deltaX:-30,deltaY:0,orientation:`horizontal`,source:`touchpad`,step:0,rule:`a touchpad always propagates — its kinetic scroll drives the swipe tracker (:537-538)`},{deltaX:0,deltaY:53,orientation:`horizontal`,source:`other`,step:0,rule:`a non-mouse device may only scroll ALONG the carousel’s axis`},{deltaX:53,deltaY:0,orientation:`horizontal`,source:`other`,step:1,rule:`and along the axis it works for any source`},{deltaX:0,deltaY:-10,orientation:`vertical`,source:`other`,step:-1,rule:`a vertical carousel reads dy`},{deltaX:53,deltaY:0,orientation:`vertical`,source:`mouse`,step:0,rule:`a vertical carousel NEVER reads dx — the fallback branch requires GTK_ORIENTATION_HORIZONTAL (:554)`},{deltaX:0,deltaY:0,orientation:`horizontal`,source:`mouse`,step:0,rule:`a null event propagates`}],c=[{pages:3,steps:[{at:1e3,deltaY:53,step:1,position:1},{at:1100,deltaY:53,step:0,position:1},{at:1150,deltaY:53,step:1,position:2}],rule:`a notch 100 ms later propagates; at exactly 150 ms the lockout has expired (g_timeout_add_once fires AT the duration)`},{pages:3,steps:[{at:0,deltaY:30,step:1,position:1},{at:200,deltaY:-30,step:-1,position:0}],rule:`opposite notches page BOTH ways — the accumulator the web port used cancelled them out instead`},{pages:2,steps:[{at:0,deltaY:53,step:1,position:1},{at:500,deltaY:53,step:1,position:1}],rule:`a notch at the last page still consumes the event and still arms the lockout (:561-576, :567)`}],l=[{closestPoint:1,oldPoint:2,newPoint:0,size:1,shift:1,rule:`a page from AFTER the current one moved BEFORE it: one page of content appeared ahead (:1490-1492)`},{closestPoint:1,oldPoint:0,newPoint:2,size:1,shift:-1,rule:`a page from BEFORE moved AFTER: one page of content disappeared ahead (:1493-1495)`},{closestPoint:1,oldPoint:1,newPoint:2,size:1,shift:1,rule:`the CURRENT page is the one moved, so the position follows it (:1488-1489)`},{closestPoint:0,oldPoint:1,newPoint:2,size:1,shift:0,rule:`a move entirely on one side of the position changes nothing`},{closestPoint:1,oldPoint:2,newPoint:0,size:.5,shift:.5,rule:`the shift is the moved page’s SIZE, so a half-revealed page shifts by half`}],u=[{pages:[`a`,`b`,`c`],ops:[],opResults:[],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`three settled pages sit one unit apart and start on page 0`},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`c`,`d`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:"append — `adw_carousel_append` is insert at -1 (:1349-1357)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:7}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`c`,`d`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:"a position past the end appends — `get_nth_link` returns NULL there (:1388-1391)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:0}],opResults:[!0],pageChanged:[],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:1,page:1},rule:"prepend — `adw_carousel_prepend` is insert at 0 (:1330-1339). The position moves to 1 so the page on screen is still `a`: a page revealed AT OR BEFORE the current one drags the position with it (`shift_position`, :241-258, :293-294)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:-2}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`below -1 fails C’s own precondition (:1381) and adds nothing`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`insert`,id:`d`,position:0}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:3,page:3},rule:"inserting BEFORE the current page moves the position with it, so the same page stays on screen (`shift_position`, :241-258)"},{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:2}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`,`d`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:0,page:0},rule:`inserting AFTER the current page leaves the position alone`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`a`}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`b`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:1,page:1},rule:"removing a page BEFORE the current one pulls the position back so `c` stays on screen"},{pages:[`a`,`b`,`c`],ops:[{kind:`remove`,id:`c`}],opResults:[!0],pageChanged:[],expected:{ids:[`a`,`b`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:`removing a page AFTER the current one leaves the position alone`},{pages:[`a`,`b`,`c`],ops:[{kind:`remove`,id:`zz`}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`removing a page that is not there changes nothing`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`c`,position:0}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`c`,`a`,`b`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:"a page from after the current one moved before it shifts the position +size, so `b` is still shown (:1490-1492)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`a`,position:2}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`b`,`c`,`a`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:"a page from before the current one moved after it shifts −size, so `b` is still shown (:1493-1495)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`reorder`,id:`b`,position:2}],opResults:[!0,!0],pageChanged:[],expected:{ids:[`a`,`c`,`b`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:`moving the CURRENT page carries the position along with it (:1488-1489)`},{pages:[`a`,`b`,`c`],ops:[{kind:`reorder`,id:`a`,position:0}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`reordering a page to where it already is returns before doing anything (:1439-1440)`},{pages:[`a`,`b`,`c`],ops:[{kind:`reorder`,id:`c`,position:-1}],opResults:[!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:`moving the LAST page to the end is the second early-out, checked after normalisation (:1448-1449)`},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:2}],opResults:[!0],pageChanged:[2],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:2},rule:"a completed scroll emits `page-changed` (:363-376)"},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:1},{kind:`scrollTo`,index:1}],opResults:[!0,!0],pageChanged:[1,1],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:1,page:1},rule:`settling back onto the SAME page emits again — the web port’s index-change gate swallowed this`},{pages:[`a`,`b`,`c`],ops:[{kind:`scrollTo`,index:99},{kind:`scrollTo`,index:-1},{kind:`scrollTo`,index:1.5},{kind:`scrollTo`,index:NaN}],opResults:[!1,!1,!1,!1],pageChanged:[],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:0,page:0},rule:"out-of-range, fractional and NaN targets are REFUSED, not clamped — `get_nth_page` fails its precondition and `scroll_to` returns on the NULL widget (:1616, :385-386). NaN used to set the NS position to NaN"},{pages:[],ops:[{kind:`settle`}],opResults:[!0],pageChanged:[-1],expected:{ids:[],nPages:0,sizes:[],snapPoints:[],position:0,page:-1},rule:`an empty carousel reports index -1, the case the signal documents (:1150-1151) and neither port could produce`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:.5},{kind:`settle`}],opResults:[!0,!0],pageChanged:[0],expected:{ids:[`a`,`b`,`c`],nPages:3,sizes:[1,1,1],snapPoints:[0,1,2],position:.5,page:0},rule:`settling half-way reports the LOWER page; both ports reported 1`}],d=[{pages:[`a`,`b`,`c`],ops:[{kind:`insert`,id:`d`,position:0}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[0,1,1,1],snapPoints:[-1,0,1,2],position:0,page:1},rule:"immediately after the insert the page has size 0 and a NEGATIVE snap point, and the carousel still shows `a` (:1385-1386, :782)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`insert`,id:`d`,position:0},{kind:`size`,id:`d`,size:.5}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[.5,1,1,1],snapPoints:[-.5,.5,1.5,2.5],position:1.5,page:2},rule:"half-way through the reveal the position has moved half a page, so `b` has not slid sideways (`resize_animation_value_cb`, :284-297)"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`insert`,id:`d`,position:0},{kind:`reveal`,id:`d`}],expected:{ids:[`d`,`a`,`b`,`c`],nPages:4,sizes:[1,1,1,1],snapPoints:[0,1,2,3],position:2,page:2},rule:"once revealed the shift has moved a full page and `b` is still the current one"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1,1],snapPoints:[0,1,2],position:2,page:1},rule:`a removed page leaves n-pages at once (:1522, :1640-1645) but keeps its geometry, so the pages after it have not moved yet`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`},{kind:`size`,id:`b`,size:.5}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,.5,1],snapPoints:[0,.5,1.5],position:1.5,page:1},rule:"while it shrinks the position follows, keeping `c` on screen"},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:2},{kind:`remove`,id:`b`},{kind:`reveal`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:1,page:1},rule:"reaching size 0 drops the entry from the geometry entirely (`resize_animation_done_cb`, :309-313)"},{pages:[`a`,`b`],ops:[{kind:`insert`,id:`c`},{kind:`remove`,id:`c`}],expected:{ids:[`a`,`b`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:`removing a page that is still revealing frees it on the spot — the skip finishes the animation, which runs the done handler (:329-337 → :309-313)`},{pages:[`a`,`b`,`c`],ops:[{kind:`setPosition`,position:1},{kind:`remove`,id:`b`},{kind:`reveal`,id:`b`}],expected:{ids:[`a`,`c`],nPages:2,sizes:[1,1],snapPoints:[0,1],position:0,page:0},rule:"removing the CURRENT page shifts too — `update_shift_position_flag` counts removing children on purpose (:248-249)"}],f=[{property:`orientation`,value:`horizontal`,rule:`adw_carousel_init (:1205)`},{property:`interactive`,value:!0,rule:`AdwCarousel:interactive defaults TRUE (:1051-1054)`},{property:`allowScrollWheel`,value:!0,rule:`AdwCarousel:allow-scroll-wheel defaults TRUE (:1103-1106, :1201) — the web port defaulted it FALSE`},{property:`allowMouseDrag`,value:!0,rule:`AdwCarousel:allow-mouse-drag defaults TRUE (:1091-1094) — the property was absent from both ports, and with it the whole mouse-drag gesture`},{property:`allowLongSwipes`,value:!1,rule:`AdwCarousel:allow-long-swipes defaults FALSE (:1115-1118) — one flick, one page`},{property:`spacing`,value:0,rule:`AdwCarousel:spacing defaults 0 (:1061-1066)`},{property:`revealDuration`,value:0,rule:`AdwCarousel:reveal-duration defaults 0 (:1127-1132, :1206)`}];export{i as CAROUSEL_CLAMP_VECTORS,o as CAROUSEL_NAVIGATE_VECTORS,n as CAROUSEL_PAGE_ALLOCATION_VECTORS,a as CAROUSEL_PAGE_AT_POSITION_VECTORS,u as CAROUSEL_PAGE_LIST_VECTORS,f as CAROUSEL_PROPERTY_DEFAULT_VECTORS,r as CAROUSEL_RANGE_VECTORS,l as CAROUSEL_REORDER_SHIFT_VECTORS,d as CAROUSEL_REVEAL_VECTORS,t as CAROUSEL_SIZES_FROM_SNAP_POINTS_VECTORS,e as CAROUSEL_SNAP_POINT_VECTORS,c as CAROUSEL_WHEEL_LOCKOUT_VECTORS,s as CAROUSEL_WHEEL_VECTORS};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{gStrStrip as e,glibClamp as t,stringIsNotEmpty as n,stripMnemonic as r}from"./glib.js";import{ADW_ABOUT_DIALOG_LABELS as i,ADW_CREDITS_SECTION_TITLES as a,ADW_LICENSES as o,ADW_LICENSE_ALIASES as s,ADW_LICENSE_DEFAULTS as c,ADW_LICENSE_WARRANTY_TEMPLATE as l,ADW_TRANSLATOR_CREDITS_SENTINELS as u,GTK_LICENSE as d,aboutDialogVisibility as f,creditsSections as p,isLicenseType as m,legalSectionVisible as h,licenseText as g,licenseTypeForSpdxId as _,parseCreditPerson as v,setLicense as y,setLicenseType as b,translatorCreditsPeople as x}from"./about-dialog.js";import{ADW_ACCENT_BG_COLORS as S,ADW_ACCENT_COLOR_NAMES as C,ADW_ACCENT_FG_COLOR as w,ADW_DEFAULT_ACCENT_COLOR as T,adwaitaAccent as E,adwaitaAccentBgColor as D,adwaitaAccentColor as O,adwaitaStandaloneColor as k,isAdwAccentColorName as A,onAdwaitaAccentChanged as j,setAdwaitaAccent as M}from"./accent.js";import{ActionRowState as N,BUTTON_ROW_ACTIVATABLE as P,ButtonRowState as F,SwitchRowState as I,WindowTitleState as L,deriveRowLabels as R}from"./action-row.js";import{AVATAR_COLORS as z,AVATAR_COLOR_COUNT as B,avatarColor as V,avatarColorClass as H,avatarFontSize as U,avatarInitials as W,avatarMaxFontSize as G,avatarMode as K,flattenAvatarGradient as q,gStrHash as J,randomAvatarColorClass as Y}from"./avatar.js";import{ADW_BANNER_BUTTON_STYLES as X,ADW_BANNER_BUTTON_STYLE_CLASSES as Z,ADW_BANNER_DEFAULTS as Q,bannerButtonStyleClasses as $,bannerButtonText as ee,bannerButtonVisible as te,bannerRenderState as ne,isBannerButtonStyle as re,parseBannerButtonStyle as ie}from"./banner.js";import{AdwBreakpoint as ae,evaluateBreakpointCondition as oe,parseBreakpointCondition as se}from"./breakpoint.js";import{ADW_BUTTON_CONTENT_DEFAULTS as ce,BUTTON_CONTENT_FALLBACK_ICON as le,BUTTON_CONTENT_STYLE_CLASS as ue,buttonContentEllipsize as de,buttonContentIconExpands as fe,buttonContentIconIsEmpty as pe,buttonContentIconName as me,buttonContentLabelText as he,buttonContentLabelVisible as ge,buttonContentRenderState as _e,buttonContentStyleTargetIndex as ve}from"./button-content.js";import{ADW_BUTTON_STYLE_ALIASES as ye,ADW_BUTTON_STYLE_CLASSES as be,buttonStyleClass as xe,buttonStyleClasses as Se}from"./button.js";import{CAROUSEL_SCROLL_TIMEOUT_MS as Ce,CAROUSEL_SETTLE_EPSILON as we,CarouselState as Te,carouselClampPosition as Ee,carouselClosestSnapPoint as De,carouselNavigateTarget as Oe,carouselPageAllocation as ke,carouselPageAtPosition as Ae,carouselRange as je,carouselReorderShift as Me,carouselSizesFromSnapPoints as Ne,carouselSnapPoints as Pe,carouselWheelStep as Fe}from"./carousel.js";import{RadioGroupState as Ie,resolveCheckState as Le}from"./checks.js";import{adwLerp as Re,easeInOutSine as ze,easeOutCubic as Be,inverseLerp as Ve}from"./easing.js";import{ADW_CLAMP_DEFAULTS as He,ADW_CLAMP_SIZE_CLASSES as Ue,ADW_SPINNER_MAX_SIZE as We,ADW_SPINNER_MIN_SIZE as Ge,ADW_TOOLBAR_BAR_CLASSES as Ke,ADW_TOOLBAR_VIEW_CLASSES as qe,ADW_TOOLBAR_VIEW_DEFAULTS as Je,clampAllocate as Ye,clampChildSize as Xe,clampSizeFromChild as Ze,clampThresholds as Qe,normalizeClampSize as $e,parseToolbarStyle as et,resolveSpinnerSize as tt,spinnerGeometry as nt,toolbarBarStyleClasses as rt,toolbarViewAllocate as it,toolbarViewClasses as at,toolbarViewContentForSize as ot,toolbarViewMeasure as st}from"./chrome.js";import{DEFAULT_ICON_COLOR as ct,DEFAULT_ICON_COLOR_DARK as lt,adwaitaColorScheme as ut,isThemeIconColor as dt,onAdwaitaColorSchemeChanged as ft,setAdwaitaColorScheme as pt,themeIconColor as mt,toggleAdwaitaColorScheme as ht}from"./color-scheme.js";import{ADW_DATA_GRID_ROW_VARIANTS as gt,DATA_GRID_CELL_CLASS as _t,DATA_GRID_ROW_CLASS as vt,dataGridCellText as yt,dataGridColumnAlign as bt,dataGridColumnClasses as xt,dataGridRowInteractive as St,dataGridTrackTemplate as Ct,dataGridTracks as wt,normalizeDataGridColumns as Tt,normalizeDataGridVariant as Et}from"./data-grid.js";import{AdwAlertResponses as Dt,BottomSheetPresentation as Ot,resolveBottomSheetClose as kt}from"./dialog.js";import{CAPS_LOCK_ICON_NAME as At,CAPS_LOCK_TOOLTIP as jt,EMPTY_ANIMATION_DURATION_MS as Mt,ENTRY_ROW_APPLY_ICON_NAME as Nt,ENTRY_ROW_APPLY_TOOLTIP as Pt,ENTRY_ROW_EDIT_ICON_NAME as Ft,ENTRY_ROW_MAX_LENGTH_LIMIT as It,ENTRY_ROW_TITLE_SPACING as Lt,EntryRowState as Rt,PASSWORD_CONCEAL_ICON_NAME as zt,PASSWORD_CONCEAL_LABEL as Bt,PASSWORD_REVEAL_ICON_NAME as Vt,PASSWORD_REVEAL_LABEL as Ht,PasswordEntryRowState as Ut,clampEntryText as Wt,entryTextLength as Gt}from"./entry-row.js";import{AdwToast as Kt,AdwToastQueue as qt,DEFAULT_TOAST_TIMEOUT as Jt}from"./toast.js";import{ADW_COMBO_NO_SELECTION as Yt,ComboState as Xt,ExpanderState as Zt,SpinState as Qt,ToggleGroupState as $t,normalizeComboOptions as en}from"./rows.js";import{ViewStackState as tn,normalizeIconName as nn,resolvePageTitle as rn}from"./view-stack.js";import{BACK_BUTTON_FALLBACK_TOOLTIP as an,NavigationViewState as on,describeNavigationDiagnostic as sn}from"./navigation-view.js";import{ADW_SIDEBAR_NO_SELECTION as cn,SidebarState as ln,adjustSidebarSelection as un,clampSidebarSelection as dn,flattenSidebarItems as fn,sidebarHeaders as pn}from"./sidebar.js";import{ADW_SPINNER_CONTRACT_DISTANCE as mn,ADW_SPINNER_CYCLES_PER_LOOP as hn,ADW_SPINNER_CYCLE_LENGTH as gn,ADW_SPINNER_EXTEND_DISTANCE as _n,ADW_SPINNER_IDLE_DISTANCE as vn,ADW_SPINNER_MAX_ARC_LENGTH as yn,ADW_SPINNER_MIN_ARC_LENGTH as bn,ADW_SPINNER_N_CYCLES as xn,ADW_SPINNER_OVERLAP_DISTANCE as Sn,ADW_SPINNER_SPIN_DURATION_MS as Cn,ADW_SPINNER_START_ANGLE as wn,ADW_SPINNER_STILL_PROGRESS as Tn,ADW_SPINNER_TRACK_OPACITY as En,normalizeSpinnerAngle as Dn,spinnerArc as On,spinnerArcEnd as kn,spinnerArcStart as An,spinnerProgressAt as jn}from"./spinner.js";import{parseAccelerator as Mn,parseShortcutLabel as Nn,shortcutKeycaps as Pn}from"./shortcut-label.js";import{ADW_LENGTH_UNITS as Fn,DEFAULT_DPI as In,adwLengthToPx as Ln,normalizeLengthUnit as Rn}from"./length-unit.js";import{ADW_SWIPE_BORDER as zn,DEFAULT_MAX_SIDEBAR_WIDTH as Bn,DEFAULT_MIN_SIDEBAR_WIDTH as Vn,DEFAULT_SIDEBAR_WIDTH_FRACTION as Hn,DEFAULT_SIDEBAR_WIDTH_UNIT as Un,INSTANT_SPLIT_VIEW_ANIMATOR as Wn,NAVIGATION_SPLIT_VIEW_CRITICALS as Gn,NavigationSplitViewState as Kn,OverlaySplitViewState as qn,isSidebarAtVisualStart as Jn,layoutNavigationSplitView as Yn,layoutOverlaySplitView as Xn,measureSplitViewHorizontal as Zn,resolveNaturalSidebarWidth as Qn,resolveNavigationAction as $n,resolveNavigationSidebarWidth as er,resolveNavigationStack as tr,resolveOverlaySidebarWidth as nr,resolveSidebarBounds as rr,resolveSwipeArea as ir,resolveSwipeRelease as ar,resolveSwipeSnapPoints as or,resolveSwipeStart as sr,swipeCancelProgress as cr,tagsConflict as lr}from"./split-view.js";import{DEFAULT_DROPDOWN_TOOLTIP as ur,SPLIT_BUTTON_DISABLED_OPACITY as dr,SplitButtonState as fr,isSplitButtonDirection as pr,menuButtonArrowIcon as mr,menuButtonPopupDirection as hr,parseMenuEntries as gr,resolveDropdownTooltip as _r,splitButtonArrowIcon as vr,splitButtonPopupDirection as yr,splitButtonRootState as br,splitButtonStyleClasses as xr}from"./split-button.js";import{DEFAULT_INDICATOR_DESCRIPTION_STRINGS as Sr,INLINE_VIEW_SWITCHER_DISPLAY_MODES as Cr,VIEW_SWITCHER_BADGE_LIMIT as wr,VIEW_SWITCHER_DRAG_SWITCH_DELAY as Tr,VIEW_SWITCHER_FALLBACK_ICON as Er,VIEW_SWITCHER_NO_SELECTION as Dr,VIEW_SWITCHER_POLICIES as Or,ViewSwitcherBarState as kr,ViewSwitcherDragSwitch as Ar,ViewSwitcherState as jr,buildInlineToggles as Mr,buildViewSwitcherButtons as Nr,createViewSwitcherPage as Pr,inlineToggleTooltip as Fr,isInlineViewSwitcherDisplayMode as Ir,isViewSwitcherButtonVisible as Lr,isViewSwitcherPolicy as Rr,pageIndexForToggle as zr,shouldRevealViewSwitcherBar as Br,toggleIndexForPage as Vr,viewSwitcherBadgeLabel as Hr,viewSwitcherButtonOrientation as Ur,viewSwitcherIconName as Wr,viewSwitcherIndicatorDescription as Gr,viewSwitcherLabel as Kr,viewSwitcherPageFromStackPage as qr,viewSwitcherPagesFromStack as Jr}from"./view-switcher.js";import{DEFAULT_TAB_AUTOHIDE as Yr,TabViewState as Xr,isDescendantOfPage as Zr,successorAfterClose as Qr,tabCloseVisible as $r,tabIconState as ei,tabTooltip as ti,tabTooltipIsMarkup as ni,tabsRevealed as ri}from"./tab-view.js";import{UNTITLED_PAGE_LABEL as ii,collectSearchRows as ai,countVisiblePages as oi,createSearchRowSubtitle as si,defaultCaseFolder as ci,derivePreferencesGroupHeader as li,escapeMarkup as ui,makeComparable as di,rowMatchesQuery as fi,searchPreferences as pi,stripMarkup as mi}from"./preferences.js";import{ADW_MAX_OVERSHOOT_DISTANCE as hi,ADW_OVERSHOOT_SETTLE_MS as gi,ADW_UNDERSHOOT_CLASSES as _i,ADW_UNDERSHOOT_SIZE as vi,accumulateOvershoot as yi,isScrolledFromEnd as bi,isScrolledFromStart as xi,overshootDistance as Si,scrollMaxValue as Ci,scrollUndershootClasses as wi}from"./scrolling.js";import{POPOVER_ITEM_RADIUS as Ti,POPOVER_MENU_PADDING as Ei,POPOVER_PADDING as Di,POPOVER_RADIUS as Oi,PopoverState as ki,resolvePopoverKey as Ai}from"./popover.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as ji,ADW_WRAP_BOX_DEFAULT_JUSTIFY as Mi,ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE as Ni,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as Pi,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as Fi,ADW_WRAP_BOX_DEFAULT_SPACING as Ii,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as Li,ADW_WRAP_BOX_JUSTIFY_MODES as Ri,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as zi,ADW_WRAP_BOX_PACK_DIRECTIONS as Bi,ADW_WRAP_POLICIES as Vi,normalizeNaturalLineLength as Hi,normalizeWrapBoxAlign as Ui,normalizeWrapBoxJustify as Wi,normalizeWrapBoxLengthUnit as Gi,normalizeWrapBoxPackDirection as Ki,normalizeWrapBoxSpacing as qi,normalizeWrapPolicy as Ji,resolveWrapBoxChildOrder as Yi,resolveWrapBoxLine as Xi,wrapBoxLengthToPx as Zi,wrapPolicyFlexShrink as Qi}from"./wrap-box.js";export{i as ADW_ABOUT_DIALOG_LABELS,S as ADW_ACCENT_BG_COLORS,C as ADW_ACCENT_COLOR_NAMES,w as ADW_ACCENT_FG_COLOR,X as ADW_BANNER_BUTTON_STYLES,Z as ADW_BANNER_BUTTON_STYLE_CLASSES,Q as ADW_BANNER_DEFAULTS,ce as ADW_BUTTON_CONTENT_DEFAULTS,ye as ADW_BUTTON_STYLE_ALIASES,be as ADW_BUTTON_STYLE_CLASSES,He as ADW_CLAMP_DEFAULTS,Ue as ADW_CLAMP_SIZE_CLASSES,Yt as ADW_COMBO_NO_SELECTION,a as ADW_CREDITS_SECTION_TITLES,gt as ADW_DATA_GRID_ROW_VARIANTS,T as ADW_DEFAULT_ACCENT_COLOR,Fn as ADW_LENGTH_UNITS,o as ADW_LICENSES,s as ADW_LICENSE_ALIASES,c as ADW_LICENSE_DEFAULTS,l as ADW_LICENSE_WARRANTY_TEMPLATE,hi as ADW_MAX_OVERSHOOT_DISTANCE,gi as ADW_OVERSHOOT_SETTLE_MS,cn as ADW_SIDEBAR_NO_SELECTION,mn as ADW_SPINNER_CONTRACT_DISTANCE,hn as ADW_SPINNER_CYCLES_PER_LOOP,gn as ADW_SPINNER_CYCLE_LENGTH,_n as ADW_SPINNER_EXTEND_DISTANCE,vn as ADW_SPINNER_IDLE_DISTANCE,yn as ADW_SPINNER_MAX_ARC_LENGTH,We as ADW_SPINNER_MAX_SIZE,bn as ADW_SPINNER_MIN_ARC_LENGTH,Ge as ADW_SPINNER_MIN_SIZE,xn as ADW_SPINNER_N_CYCLES,Sn as ADW_SPINNER_OVERLAP_DISTANCE,Cn as ADW_SPINNER_SPIN_DURATION_MS,wn as ADW_SPINNER_START_ANGLE,Tn as ADW_SPINNER_STILL_PROGRESS,En as ADW_SPINNER_TRACK_OPACITY,zn as ADW_SWIPE_BORDER,Ke as ADW_TOOLBAR_BAR_CLASSES,qe as ADW_TOOLBAR_VIEW_CLASSES,Je as ADW_TOOLBAR_VIEW_DEFAULTS,u as ADW_TRANSLATOR_CREDITS_SENTINELS,_i as ADW_UNDERSHOOT_CLASSES,vi as ADW_UNDERSHOOT_SIZE,ji as ADW_WRAP_BOX_DEFAULT_ALIGN,Mi as ADW_WRAP_BOX_DEFAULT_JUSTIFY,Ni as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,Pi as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,Fi as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,Ii as ADW_WRAP_BOX_DEFAULT_SPACING,Li as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,Ri as ADW_WRAP_BOX_JUSTIFY_MODES,zi as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,Bi as ADW_WRAP_BOX_PACK_DIRECTIONS,Vi as ADW_WRAP_POLICIES,z as AVATAR_COLORS,B as AVATAR_COLOR_COUNT,N as ActionRowState,Dt as AdwAlertResponses,ae as AdwBreakpoint,Kt as AdwToast,qt as AdwToastQueue,an as BACK_BUTTON_FALLBACK_TOOLTIP,le as BUTTON_CONTENT_FALLBACK_ICON,ue as BUTTON_CONTENT_STYLE_CLASS,P as BUTTON_ROW_ACTIVATABLE,Ot as BottomSheetPresentation,F as ButtonRowState,At as CAPS_LOCK_ICON_NAME,jt as CAPS_LOCK_TOOLTIP,Ce as CAROUSEL_SCROLL_TIMEOUT_MS,we as CAROUSEL_SETTLE_EPSILON,Te as CarouselState,Xt as ComboState,_t as DATA_GRID_CELL_CLASS,vt as DATA_GRID_ROW_CLASS,In as DEFAULT_DPI,ur as DEFAULT_DROPDOWN_TOOLTIP,ct as DEFAULT_ICON_COLOR,lt as DEFAULT_ICON_COLOR_DARK,Sr as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,Bn as DEFAULT_MAX_SIDEBAR_WIDTH,Vn as DEFAULT_MIN_SIDEBAR_WIDTH,Hn as DEFAULT_SIDEBAR_WIDTH_FRACTION,Un as DEFAULT_SIDEBAR_WIDTH_UNIT,Yr as DEFAULT_TAB_AUTOHIDE,Jt as DEFAULT_TOAST_TIMEOUT,Mt as EMPTY_ANIMATION_DURATION_MS,Nt as ENTRY_ROW_APPLY_ICON_NAME,Pt as ENTRY_ROW_APPLY_TOOLTIP,Ft as ENTRY_ROW_EDIT_ICON_NAME,It as ENTRY_ROW_MAX_LENGTH_LIMIT,Lt as ENTRY_ROW_TITLE_SPACING,Rt as EntryRowState,Zt as ExpanderState,d as GTK_LICENSE,Cr as INLINE_VIEW_SWITCHER_DISPLAY_MODES,Wn as INSTANT_SPLIT_VIEW_ANIMATOR,Gn as NAVIGATION_SPLIT_VIEW_CRITICALS,Kn as NavigationSplitViewState,on as NavigationViewState,qn as OverlaySplitViewState,zt as PASSWORD_CONCEAL_ICON_NAME,Bt as PASSWORD_CONCEAL_LABEL,Vt as PASSWORD_REVEAL_ICON_NAME,Ht as PASSWORD_REVEAL_LABEL,Ti as POPOVER_ITEM_RADIUS,Ei as POPOVER_MENU_PADDING,Di as POPOVER_PADDING,Oi as POPOVER_RADIUS,Ut as PasswordEntryRowState,ki as PopoverState,Ie as RadioGroupState,dr as SPLIT_BUTTON_DISABLED_OPACITY,ln as SidebarState,Qt as SpinState,fr as SplitButtonState,I as SwitchRowState,Xr as TabViewState,$t as ToggleGroupState,ii as UNTITLED_PAGE_LABEL,wr as VIEW_SWITCHER_BADGE_LIMIT,Tr as VIEW_SWITCHER_DRAG_SWITCH_DELAY,Er as VIEW_SWITCHER_FALLBACK_ICON,Dr as VIEW_SWITCHER_NO_SELECTION,Or as VIEW_SWITCHER_POLICIES,tn as ViewStackState,kr as ViewSwitcherBarState,Ar as ViewSwitcherDragSwitch,jr as ViewSwitcherState,L as WindowTitleState,f as aboutDialogVisibility,yi as accumulateOvershoot,un as adjustSidebarSelection,Ln as adwLengthToPx,Re as adwLerp,E as adwaitaAccent,D as adwaitaAccentBgColor,O as adwaitaAccentColor,ut as adwaitaColorScheme,k as adwaitaStandaloneColor,V as avatarColor,H as avatarColorClass,U as avatarFontSize,W as avatarInitials,G as avatarMaxFontSize,K as avatarMode,$ as bannerButtonStyleClasses,ee as bannerButtonText,te as bannerButtonVisible,ne as bannerRenderState,Mr as buildInlineToggles,Nr as buildViewSwitcherButtons,de as buttonContentEllipsize,fe as buttonContentIconExpands,pe as buttonContentIconIsEmpty,me as buttonContentIconName,he as buttonContentLabelText,ge as buttonContentLabelVisible,_e as buttonContentRenderState,ve as buttonContentStyleTargetIndex,xe as buttonStyleClass,Se as buttonStyleClasses,Ee as carouselClampPosition,De as carouselClosestSnapPoint,Oe as carouselNavigateTarget,ke as carouselPageAllocation,Ae as carouselPageAtPosition,je as carouselRange,Me as carouselReorderShift,Ne as carouselSizesFromSnapPoints,Pe as carouselSnapPoints,Fe as carouselWheelStep,Ye as clampAllocate,Xe as clampChildSize,Wt as clampEntryText,dn as clampSidebarSelection,Ze as clampSizeFromChild,Qe as clampThresholds,ai as collectSearchRows,oi as countVisiblePages,si as createSearchRowSubtitle,Pr as createViewSwitcherPage,p as creditsSections,yt as dataGridCellText,bt as dataGridColumnAlign,xt as dataGridColumnClasses,St as dataGridRowInteractive,Ct as dataGridTrackTemplate,wt as dataGridTracks,ci as defaultCaseFolder,li as derivePreferencesGroupHeader,R as deriveRowLabels,sn as describeNavigationDiagnostic,ze as easeInOutSine,Be as easeOutCubic,Gt as entryTextLength,ui as escapeMarkup,oe as evaluateBreakpointCondition,q as flattenAvatarGradient,fn as flattenSidebarItems,J as gStrHash,e as gStrStrip,t as glibClamp,Fr as inlineToggleTooltip,Ve as inverseLerp,A as isAdwAccentColorName,re as isBannerButtonStyle,Zr as isDescendantOfPage,Ir as isInlineViewSwitcherDisplayMode,m as isLicenseType,bi as isScrolledFromEnd,xi as isScrolledFromStart,Jn as isSidebarAtVisualStart,pr as isSplitButtonDirection,dt as isThemeIconColor,Lr as isViewSwitcherButtonVisible,Rr as isViewSwitcherPolicy,Yn as layoutNavigationSplitView,Xn as layoutOverlaySplitView,h as legalSectionVisible,g as licenseText,_ as licenseTypeForSpdxId,di as makeComparable,Zn as measureSplitViewHorizontal,mr as menuButtonArrowIcon,hr as menuButtonPopupDirection,$e as normalizeClampSize,en as normalizeComboOptions,Tt as normalizeDataGridColumns,Et as normalizeDataGridVariant,nn as normalizeIconName,Rn as normalizeLengthUnit,Hi as normalizeNaturalLineLength,Dn as normalizeSpinnerAngle,Ui as normalizeWrapBoxAlign,Wi as normalizeWrapBoxJustify,Gi as normalizeWrapBoxLengthUnit,Ki as normalizeWrapBoxPackDirection,qi as normalizeWrapBoxSpacing,Ji as normalizeWrapPolicy,j as onAdwaitaAccentChanged,ft as onAdwaitaColorSchemeChanged,Si as overshootDistance,zr as pageIndexForToggle,Mn as parseAccelerator,ie as parseBannerButtonStyle,se as parseBreakpointCondition,v as parseCreditPerson,gr as parseMenuEntries,Nn as parseShortcutLabel,et as parseToolbarStyle,Y as randomAvatarColorClass,kt as resolveBottomSheetClose,Le as resolveCheckState,_r as resolveDropdownTooltip,Qn as resolveNaturalSidebarWidth,$n as resolveNavigationAction,er as resolveNavigationSidebarWidth,tr as resolveNavigationStack,nr as resolveOverlaySidebarWidth,rn as resolvePageTitle,Ai as resolvePopoverKey,rr as resolveSidebarBounds,tt as resolveSpinnerSize,ir as resolveSwipeArea,ar as resolveSwipeRelease,or as resolveSwipeSnapPoints,sr as resolveSwipeStart,Yi as resolveWrapBoxChildOrder,Xi as resolveWrapBoxLine,fi as rowMatchesQuery,Ci as scrollMaxValue,wi as scrollUndershootClasses,pi as searchPreferences,M as setAdwaitaAccent,pt as setAdwaitaColorScheme,y as setLicense,b as setLicenseType,Pn as shortcutKeycaps,Br as shouldRevealViewSwitcherBar,pn as sidebarHeaders,On as spinnerArc,kn as spinnerArcEnd,An as spinnerArcStart,nt as spinnerGeometry,jn as spinnerProgressAt,vr as splitButtonArrowIcon,yr as splitButtonPopupDirection,br as splitButtonRootState,xr as splitButtonStyleClasses,n as stringIsNotEmpty,mi as stripMarkup,r as stripMnemonic,Qr as successorAfterClose,cr as swipeCancelProgress,$r as tabCloseVisible,ei as tabIconState,ti as tabTooltip,ni as tabTooltipIsMarkup,ri as tabsRevealed,lr as tagsConflict,mt as themeIconColor,ht as toggleAdwaitaColorScheme,Vr as toggleIndexForPage,rt as toolbarBarStyleClasses,it as toolbarViewAllocate,at as toolbarViewClasses,ot as toolbarViewContentForSize,st as toolbarViewMeasure,x as translatorCreditsPeople,Hr as viewSwitcherBadgeLabel,Ur as viewSwitcherButtonOrientation,Wr as viewSwitcherIconName,Gr as viewSwitcherIndicatorDescription,Kr as viewSwitcherLabel,qr as viewSwitcherPageFromStackPage,Jr as viewSwitcherPagesFromStack,Zi as wrapBoxLengthToPx,Qi as wrapPolicyFlexShrink};
|
|
1
|
+
import{gStrStrip as e,glibClamp as t,stringIsNotEmpty as n,stripMnemonic as r}from"./glib.js";import{ADW_ABOUT_DIALOG_LABELS as i,ADW_CREDITS_SECTION_TITLES as a,ADW_LICENSES as o,ADW_LICENSE_ALIASES as s,ADW_LICENSE_DEFAULTS as c,ADW_LICENSE_WARRANTY_TEMPLATE as l,ADW_TRANSLATOR_CREDITS_SENTINELS as u,GTK_LICENSE as d,aboutDialogVisibility as f,creditsSections as p,isLicenseType as m,legalSectionVisible as h,licenseText as g,licenseTypeForSpdxId as _,parseCreditPerson as v,setLicense as y,setLicenseType as b,translatorCreditsPeople as x}from"./about-dialog.js";import{ADW_ACCENT_BG_COLORS as S,ADW_ACCENT_COLOR_NAMES as C,ADW_ACCENT_FG_COLOR as w,ADW_DEFAULT_ACCENT_COLOR as T,adwaitaAccent as E,adwaitaAccentBgColor as D,adwaitaAccentColor as O,adwaitaStandaloneColor as k,isAdwAccentColorName as A,onAdwaitaAccentChanged as j,setAdwaitaAccent as M}from"./accent.js";import{ActionRowState as N,BUTTON_ROW_ACTIVATABLE as P,ButtonRowState as F,SwitchRowState as I,WindowTitleState as L,deriveRowLabels as R}from"./action-row.js";import{AVATAR_COLORS as z,AVATAR_COLOR_COUNT as B,avatarColor as V,avatarColorClass as H,avatarFontSize as U,avatarInitials as W,avatarMaxFontSize as G,avatarMode as K,flattenAvatarGradient as q,gStrHash as J,randomAvatarColorClass as Y}from"./avatar.js";import{ADW_BANNER_BUTTON_STYLES as X,ADW_BANNER_BUTTON_STYLE_CLASSES as Z,ADW_BANNER_DEFAULTS as Q,bannerButtonStyleClasses as $,bannerButtonText as ee,bannerButtonVisible as te,bannerRenderState as ne,isBannerButtonStyle as re,parseBannerButtonStyle as ie}from"./banner.js";import{AdwBreakpoint as ae,evaluateBreakpointCondition as oe,parseBreakpointCondition as se}from"./breakpoint.js";import{ADW_BUTTON_CONTENT_DEFAULTS as ce,BUTTON_CONTENT_FALLBACK_ICON as le,BUTTON_CONTENT_STYLE_CLASS as ue,buttonContentEllipsize as de,buttonContentIconExpands as fe,buttonContentIconIsEmpty as pe,buttonContentIconName as me,buttonContentLabelText as he,buttonContentLabelVisible as ge,buttonContentRenderState as _e,buttonContentStyleTargetIndex as ve}from"./button-content.js";import{ADW_BUTTON_STYLE_ALIASES as ye,ADW_BUTTON_STYLE_CLASSES as be,buttonStyleClass as xe,buttonStyleClasses as Se}from"./button.js";import{ADW_SWIPE_DECELERATION_TOUCH as Ce,ADW_SWIPE_DECELERATION_TOUCHPAD as we,ADW_SWIPE_DRAG_THRESHOLD as Te,ADW_SWIPE_EPSILON as Ee,ADW_SWIPE_HISTORY_THRESHOLD_MS as De,ADW_SWIPE_PARABOLA_MULTIPLIER as Oe,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H as ke,ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V as Ae,ADW_SWIPE_VELOCITY_CURVE_THRESHOLD as je,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH as Me,ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD as Ne,SwipeTracker as Pe,swipeBounds as Fe,swipeClosestPointIndex as Ie,swipeEndProgress as Le,swipeNextPointIndex as Re,swipePreviousPointIndex as ze,swipeProjectedPointIndex as Be,swipeSlope as Ve,swipeVelocityThreshold as He}from"./swipe.js";import{CAROUSEL_SCROLL_TIMEOUT_MS as Ue,CAROUSEL_SETTLE_EPSILON as We,CarouselState as Ge,carouselClampPosition as Ke,carouselClosestSnapPoint as qe,carouselNavigateTarget as Je,carouselPageAllocation as Ye,carouselPageAtPosition as Xe,carouselRange as Ze,carouselReorderShift as Qe,carouselSizesFromSnapPoints as $e,carouselSnapPoints as et,carouselWheelStep as tt}from"./carousel.js";import{RadioGroupState as nt,resolveCheckState as rt}from"./checks.js";import{adwLerp as it,easeInOutSine as at,easeOutCubic as ot,inverseLerp as st}from"./easing.js";import{ADW_CLAMP_DEFAULTS as ct,ADW_CLAMP_SIZE_CLASSES as lt,ADW_SPINNER_MAX_SIZE as ut,ADW_SPINNER_MIN_SIZE as dt,ADW_TOOLBAR_BAR_CLASSES as ft,ADW_TOOLBAR_VIEW_CLASSES as pt,ADW_TOOLBAR_VIEW_DEFAULTS as mt,clampAllocate as ht,clampChildSize as gt,clampSizeFromChild as _t,clampThresholds as vt,normalizeClampSize as yt,parseToolbarStyle as bt,resolveSpinnerSize as xt,spinnerGeometry as St,toolbarBarStyleClasses as Ct,toolbarViewAllocate as wt,toolbarViewClasses as Tt,toolbarViewContentForSize as Et,toolbarViewMeasure as Dt}from"./chrome.js";import{DEFAULT_ICON_COLOR as Ot,DEFAULT_ICON_COLOR_DARK as kt,adwaitaColorScheme as At,isThemeIconColor as jt,onAdwaitaColorSchemeChanged as Mt,setAdwaitaColorScheme as Nt,themeIconColor as Pt,toggleAdwaitaColorScheme as Ft}from"./color-scheme.js";import{ADW_DATA_GRID_ROW_VARIANTS as It,DATA_GRID_CELL_CLASS as Lt,DATA_GRID_ROW_CLASS as Rt,dataGridCellText as zt,dataGridColumnAlign as Bt,dataGridColumnClasses as Vt,dataGridRowInteractive as Ht,dataGridTrackTemplate as Ut,dataGridTracks as Wt,normalizeDataGridColumns as Gt,normalizeDataGridVariant as Kt}from"./data-grid.js";import{AdwAlertResponses as qt,BottomSheetPresentation as Jt,resolveBottomSheetClose as Yt}from"./dialog.js";import{CAPS_LOCK_ICON_NAME as Xt,CAPS_LOCK_TOOLTIP as Zt,EMPTY_ANIMATION_DURATION_MS as Qt,ENTRY_ROW_APPLY_ICON_NAME as $t,ENTRY_ROW_APPLY_TOOLTIP as en,ENTRY_ROW_EDIT_ICON_NAME as tn,ENTRY_ROW_MAX_LENGTH_LIMIT as nn,ENTRY_ROW_TITLE_SPACING as rn,EntryRowState as an,PASSWORD_CONCEAL_ICON_NAME as on,PASSWORD_CONCEAL_LABEL as sn,PASSWORD_REVEAL_ICON_NAME as cn,PASSWORD_REVEAL_LABEL as ln,PasswordEntryRowState as un,clampEntryText as dn,entryTextLength as fn}from"./entry-row.js";import{AdwToast as pn,AdwToastQueue as mn,DEFAULT_TOAST_TIMEOUT as hn}from"./toast.js";import{ADW_COMBO_NO_SELECTION as gn,ComboState as _n,ExpanderState as vn,SpinState as yn,ToggleGroupState as bn,normalizeComboOptions as xn}from"./rows.js";import{ViewStackState as Sn,normalizeIconName as Cn,resolvePageTitle as wn}from"./view-stack.js";import{BACK_BUTTON_FALLBACK_TOOLTIP as Tn,NavigationViewState as En,describeNavigationDiagnostic as Dn}from"./navigation-view.js";import{ADW_SIDEBAR_NO_SELECTION as On,SidebarState as kn,adjustSidebarSelection as An,clampSidebarSelection as jn,flattenSidebarItems as Mn,sidebarHeaders as Nn}from"./sidebar.js";import{ADW_SPINNER_CONTRACT_DISTANCE as Pn,ADW_SPINNER_CYCLES_PER_LOOP as Fn,ADW_SPINNER_CYCLE_LENGTH as In,ADW_SPINNER_EXTEND_DISTANCE as Ln,ADW_SPINNER_IDLE_DISTANCE as Rn,ADW_SPINNER_MAX_ARC_LENGTH as zn,ADW_SPINNER_MIN_ARC_LENGTH as Bn,ADW_SPINNER_N_CYCLES as Vn,ADW_SPINNER_OVERLAP_DISTANCE as Hn,ADW_SPINNER_SPIN_DURATION_MS as Un,ADW_SPINNER_START_ANGLE as Wn,ADW_SPINNER_STILL_PROGRESS as Gn,ADW_SPINNER_TRACK_OPACITY as Kn,normalizeSpinnerAngle as qn,spinnerArc as Jn,spinnerArcEnd as Yn,spinnerArcStart as Xn,spinnerProgressAt as Zn}from"./spinner.js";import{parseAccelerator as Qn,parseShortcutLabel as $n,shortcutKeycaps as er}from"./shortcut-label.js";import{ADW_LENGTH_UNITS as tr,DEFAULT_DPI as nr,adwLengthToPx as rr,normalizeLengthUnit as ir}from"./length-unit.js";import{ADW_SWIPE_BORDER as ar,DEFAULT_MAX_SIDEBAR_WIDTH as or,DEFAULT_MIN_SIDEBAR_WIDTH as sr,DEFAULT_SIDEBAR_WIDTH_FRACTION as cr,DEFAULT_SIDEBAR_WIDTH_UNIT as lr,INSTANT_SPLIT_VIEW_ANIMATOR as ur,NAVIGATION_SPLIT_VIEW_CRITICALS as dr,NavigationSplitViewState as fr,OverlaySplitViewState as pr,isSidebarAtVisualStart as mr,layoutNavigationSplitView as hr,layoutOverlaySplitView as gr,measureSplitViewHorizontal as _r,resolveNaturalSidebarWidth as vr,resolveNavigationAction as yr,resolveNavigationSidebarWidth as br,resolveNavigationStack as xr,resolveOverlaySidebarWidth as Sr,resolveSidebarBounds as Cr,resolveSwipeArea as wr,resolveSwipeRelease as Tr,resolveSwipeSnapPoints as Er,resolveSwipeStart as Dr,swipeCancelProgress as Or,tagsConflict as kr}from"./split-view.js";import{DEFAULT_DROPDOWN_TOOLTIP as Ar,SPLIT_BUTTON_DISABLED_OPACITY as jr,SplitButtonState as Mr,isSplitButtonDirection as Nr,menuButtonArrowIcon as Pr,menuButtonPopupDirection as Fr,parseMenuEntries as Ir,resolveDropdownTooltip as Lr,splitButtonArrowIcon as Rr,splitButtonPopupDirection as zr,splitButtonRootState as Br,splitButtonStyleClasses as Vr}from"./split-button.js";import{DEFAULT_INDICATOR_DESCRIPTION_STRINGS as Hr,INLINE_VIEW_SWITCHER_DISPLAY_MODES as Ur,VIEW_SWITCHER_BADGE_LIMIT as Wr,VIEW_SWITCHER_DRAG_SWITCH_DELAY as Gr,VIEW_SWITCHER_FALLBACK_ICON as Kr,VIEW_SWITCHER_NO_SELECTION as qr,VIEW_SWITCHER_POLICIES as Jr,ViewSwitcherBarState as Yr,ViewSwitcherDragSwitch as Xr,ViewSwitcherState as Zr,buildInlineToggles as Qr,buildViewSwitcherButtons as $r,createViewSwitcherPage as ei,inlineToggleTooltip as ti,isInlineViewSwitcherDisplayMode as ni,isViewSwitcherButtonVisible as ri,isViewSwitcherPolicy as ii,pageIndexForToggle as ai,shouldRevealViewSwitcherBar as oi,toggleIndexForPage as si,viewSwitcherBadgeLabel as ci,viewSwitcherButtonOrientation as li,viewSwitcherIconName as ui,viewSwitcherIndicatorDescription as di,viewSwitcherLabel as fi,viewSwitcherPageFromStackPage as pi,viewSwitcherPagesFromStack as mi}from"./view-switcher.js";import{DEFAULT_TAB_AUTOHIDE as hi,TabViewState as gi,isDescendantOfPage as _i,successorAfterClose as vi,tabCloseVisible as yi,tabIconState as bi,tabTooltip as xi,tabTooltipIsMarkup as Si,tabsRevealed as Ci}from"./tab-view.js";import{UNTITLED_PAGE_LABEL as wi,collectSearchRows as Ti,countVisiblePages as Ei,createSearchRowSubtitle as Di,defaultCaseFolder as Oi,derivePreferencesGroupHeader as ki,escapeMarkup as Ai,makeComparable as ji,rowMatchesQuery as Mi,searchPreferences as Ni,stripMarkup as Pi}from"./preferences.js";import{ADW_MAX_OVERSHOOT_DISTANCE as Fi,ADW_OVERSHOOT_SETTLE_MS as Ii,ADW_UNDERSHOOT_CLASSES as Li,ADW_UNDERSHOOT_SIZE as Ri,accumulateOvershoot as zi,isScrolledFromEnd as Bi,isScrolledFromStart as Vi,overshootDistance as Hi,scrollMaxValue as Ui,scrollUndershootClasses as Wi}from"./scrolling.js";import{POPOVER_ITEM_RADIUS as Gi,POPOVER_MENU_PADDING as Ki,POPOVER_PADDING as qi,POPOVER_RADIUS as Ji,PopoverState as Yi,resolvePopoverKey as Xi}from"./popover.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as Zi,ADW_WRAP_BOX_DEFAULT_JUSTIFY as Qi,ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE as $i,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as ea,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as ta,ADW_WRAP_BOX_DEFAULT_SPACING as na,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as ra,ADW_WRAP_BOX_JUSTIFY_MODES as ia,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as aa,ADW_WRAP_BOX_PACK_DIRECTIONS as oa,ADW_WRAP_POLICIES as sa,normalizeNaturalLineLength as ca,normalizeWrapBoxAlign as la,normalizeWrapBoxJustify as ua,normalizeWrapBoxLengthUnit as da,normalizeWrapBoxPackDirection as fa,normalizeWrapBoxSpacing as pa,normalizeWrapPolicy as ma,resolveWrapBoxChildOrder as ha,resolveWrapBoxLine as ga,wrapBoxLengthToPx as _a,wrapPolicyFlexShrink as va}from"./wrap-box.js";export{i as ADW_ABOUT_DIALOG_LABELS,S as ADW_ACCENT_BG_COLORS,C as ADW_ACCENT_COLOR_NAMES,w as ADW_ACCENT_FG_COLOR,X as ADW_BANNER_BUTTON_STYLES,Z as ADW_BANNER_BUTTON_STYLE_CLASSES,Q as ADW_BANNER_DEFAULTS,ce as ADW_BUTTON_CONTENT_DEFAULTS,ye as ADW_BUTTON_STYLE_ALIASES,be as ADW_BUTTON_STYLE_CLASSES,ct as ADW_CLAMP_DEFAULTS,lt as ADW_CLAMP_SIZE_CLASSES,gn as ADW_COMBO_NO_SELECTION,a as ADW_CREDITS_SECTION_TITLES,It as ADW_DATA_GRID_ROW_VARIANTS,T as ADW_DEFAULT_ACCENT_COLOR,tr as ADW_LENGTH_UNITS,o as ADW_LICENSES,s as ADW_LICENSE_ALIASES,c as ADW_LICENSE_DEFAULTS,l as ADW_LICENSE_WARRANTY_TEMPLATE,Fi as ADW_MAX_OVERSHOOT_DISTANCE,Ii as ADW_OVERSHOOT_SETTLE_MS,On as ADW_SIDEBAR_NO_SELECTION,Pn as ADW_SPINNER_CONTRACT_DISTANCE,Fn as ADW_SPINNER_CYCLES_PER_LOOP,In as ADW_SPINNER_CYCLE_LENGTH,Ln as ADW_SPINNER_EXTEND_DISTANCE,Rn as ADW_SPINNER_IDLE_DISTANCE,zn as ADW_SPINNER_MAX_ARC_LENGTH,ut as ADW_SPINNER_MAX_SIZE,Bn as ADW_SPINNER_MIN_ARC_LENGTH,dt as ADW_SPINNER_MIN_SIZE,Vn as ADW_SPINNER_N_CYCLES,Hn as ADW_SPINNER_OVERLAP_DISTANCE,Un as ADW_SPINNER_SPIN_DURATION_MS,Wn as ADW_SPINNER_START_ANGLE,Gn as ADW_SPINNER_STILL_PROGRESS,Kn as ADW_SPINNER_TRACK_OPACITY,ar as ADW_SWIPE_BORDER,Ce as ADW_SWIPE_DECELERATION_TOUCH,we as ADW_SWIPE_DECELERATION_TOUCHPAD,Te as ADW_SWIPE_DRAG_THRESHOLD,Ee as ADW_SWIPE_EPSILON,De as ADW_SWIPE_HISTORY_THRESHOLD_MS,Oe as ADW_SWIPE_PARABOLA_MULTIPLIER,ke as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H,Ae as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V,je as ADW_SWIPE_VELOCITY_CURVE_THRESHOLD,Me as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH,Ne as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD,ft as ADW_TOOLBAR_BAR_CLASSES,pt as ADW_TOOLBAR_VIEW_CLASSES,mt as ADW_TOOLBAR_VIEW_DEFAULTS,u as ADW_TRANSLATOR_CREDITS_SENTINELS,Li as ADW_UNDERSHOOT_CLASSES,Ri as ADW_UNDERSHOOT_SIZE,Zi as ADW_WRAP_BOX_DEFAULT_ALIGN,Qi as ADW_WRAP_BOX_DEFAULT_JUSTIFY,$i as ADW_WRAP_BOX_DEFAULT_JUSTIFY_LAST_LINE,ea as ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT,ta as ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION,na as ADW_WRAP_BOX_DEFAULT_SPACING,ra as ADW_WRAP_BOX_DEFAULT_WRAP_POLICY,ia as ADW_WRAP_BOX_JUSTIFY_MODES,aa as ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET,oa as ADW_WRAP_BOX_PACK_DIRECTIONS,sa as ADW_WRAP_POLICIES,z as AVATAR_COLORS,B as AVATAR_COLOR_COUNT,N as ActionRowState,qt as AdwAlertResponses,ae as AdwBreakpoint,pn as AdwToast,mn as AdwToastQueue,Tn as BACK_BUTTON_FALLBACK_TOOLTIP,le as BUTTON_CONTENT_FALLBACK_ICON,ue as BUTTON_CONTENT_STYLE_CLASS,P as BUTTON_ROW_ACTIVATABLE,Jt as BottomSheetPresentation,F as ButtonRowState,Xt as CAPS_LOCK_ICON_NAME,Zt as CAPS_LOCK_TOOLTIP,Ue as CAROUSEL_SCROLL_TIMEOUT_MS,We as CAROUSEL_SETTLE_EPSILON,Ge as CarouselState,_n as ComboState,Lt as DATA_GRID_CELL_CLASS,Rt as DATA_GRID_ROW_CLASS,nr as DEFAULT_DPI,Ar as DEFAULT_DROPDOWN_TOOLTIP,Ot as DEFAULT_ICON_COLOR,kt as DEFAULT_ICON_COLOR_DARK,Hr as DEFAULT_INDICATOR_DESCRIPTION_STRINGS,or as DEFAULT_MAX_SIDEBAR_WIDTH,sr as DEFAULT_MIN_SIDEBAR_WIDTH,cr as DEFAULT_SIDEBAR_WIDTH_FRACTION,lr as DEFAULT_SIDEBAR_WIDTH_UNIT,hi as DEFAULT_TAB_AUTOHIDE,hn as DEFAULT_TOAST_TIMEOUT,Qt as EMPTY_ANIMATION_DURATION_MS,$t as ENTRY_ROW_APPLY_ICON_NAME,en as ENTRY_ROW_APPLY_TOOLTIP,tn as ENTRY_ROW_EDIT_ICON_NAME,nn as ENTRY_ROW_MAX_LENGTH_LIMIT,rn as ENTRY_ROW_TITLE_SPACING,an as EntryRowState,vn as ExpanderState,d as GTK_LICENSE,Ur as INLINE_VIEW_SWITCHER_DISPLAY_MODES,ur as INSTANT_SPLIT_VIEW_ANIMATOR,dr as NAVIGATION_SPLIT_VIEW_CRITICALS,fr as NavigationSplitViewState,En as NavigationViewState,pr as OverlaySplitViewState,on as PASSWORD_CONCEAL_ICON_NAME,sn as PASSWORD_CONCEAL_LABEL,cn as PASSWORD_REVEAL_ICON_NAME,ln as PASSWORD_REVEAL_LABEL,Gi as POPOVER_ITEM_RADIUS,Ki as POPOVER_MENU_PADDING,qi as POPOVER_PADDING,Ji as POPOVER_RADIUS,un as PasswordEntryRowState,Yi as PopoverState,nt as RadioGroupState,jr as SPLIT_BUTTON_DISABLED_OPACITY,kn as SidebarState,yn as SpinState,Mr as SplitButtonState,Pe as SwipeTracker,I as SwitchRowState,gi as TabViewState,bn as ToggleGroupState,wi as UNTITLED_PAGE_LABEL,Wr as VIEW_SWITCHER_BADGE_LIMIT,Gr as VIEW_SWITCHER_DRAG_SWITCH_DELAY,Kr as VIEW_SWITCHER_FALLBACK_ICON,qr as VIEW_SWITCHER_NO_SELECTION,Jr as VIEW_SWITCHER_POLICIES,Sn as ViewStackState,Yr as ViewSwitcherBarState,Xr as ViewSwitcherDragSwitch,Zr as ViewSwitcherState,L as WindowTitleState,f as aboutDialogVisibility,zi as accumulateOvershoot,An as adjustSidebarSelection,rr as adwLengthToPx,it as adwLerp,E as adwaitaAccent,D as adwaitaAccentBgColor,O as adwaitaAccentColor,At as adwaitaColorScheme,k as adwaitaStandaloneColor,V as avatarColor,H as avatarColorClass,U as avatarFontSize,W as avatarInitials,G as avatarMaxFontSize,K as avatarMode,$ as bannerButtonStyleClasses,ee as bannerButtonText,te as bannerButtonVisible,ne as bannerRenderState,Qr as buildInlineToggles,$r as buildViewSwitcherButtons,de as buttonContentEllipsize,fe as buttonContentIconExpands,pe as buttonContentIconIsEmpty,me as buttonContentIconName,he as buttonContentLabelText,ge as buttonContentLabelVisible,_e as buttonContentRenderState,ve as buttonContentStyleTargetIndex,xe as buttonStyleClass,Se as buttonStyleClasses,Ke as carouselClampPosition,qe as carouselClosestSnapPoint,Je as carouselNavigateTarget,Ye as carouselPageAllocation,Xe as carouselPageAtPosition,Ze as carouselRange,Qe as carouselReorderShift,$e as carouselSizesFromSnapPoints,et as carouselSnapPoints,tt as carouselWheelStep,ht as clampAllocate,gt as clampChildSize,dn as clampEntryText,jn as clampSidebarSelection,_t as clampSizeFromChild,vt as clampThresholds,Ti as collectSearchRows,Ei as countVisiblePages,Di as createSearchRowSubtitle,ei as createViewSwitcherPage,p as creditsSections,zt as dataGridCellText,Bt as dataGridColumnAlign,Vt as dataGridColumnClasses,Ht as dataGridRowInteractive,Ut as dataGridTrackTemplate,Wt as dataGridTracks,Oi as defaultCaseFolder,ki as derivePreferencesGroupHeader,R as deriveRowLabels,Dn as describeNavigationDiagnostic,at as easeInOutSine,ot as easeOutCubic,fn as entryTextLength,Ai as escapeMarkup,oe as evaluateBreakpointCondition,q as flattenAvatarGradient,Mn as flattenSidebarItems,J as gStrHash,e as gStrStrip,t as glibClamp,ti as inlineToggleTooltip,st as inverseLerp,A as isAdwAccentColorName,re as isBannerButtonStyle,_i as isDescendantOfPage,ni as isInlineViewSwitcherDisplayMode,m as isLicenseType,Bi as isScrolledFromEnd,Vi as isScrolledFromStart,mr as isSidebarAtVisualStart,Nr as isSplitButtonDirection,jt as isThemeIconColor,ri as isViewSwitcherButtonVisible,ii as isViewSwitcherPolicy,hr as layoutNavigationSplitView,gr as layoutOverlaySplitView,h as legalSectionVisible,g as licenseText,_ as licenseTypeForSpdxId,ji as makeComparable,_r as measureSplitViewHorizontal,Pr as menuButtonArrowIcon,Fr as menuButtonPopupDirection,yt as normalizeClampSize,xn as normalizeComboOptions,Gt as normalizeDataGridColumns,Kt as normalizeDataGridVariant,Cn as normalizeIconName,ir as normalizeLengthUnit,ca as normalizeNaturalLineLength,qn as normalizeSpinnerAngle,la as normalizeWrapBoxAlign,ua as normalizeWrapBoxJustify,da as normalizeWrapBoxLengthUnit,fa as normalizeWrapBoxPackDirection,pa as normalizeWrapBoxSpacing,ma as normalizeWrapPolicy,j as onAdwaitaAccentChanged,Mt as onAdwaitaColorSchemeChanged,Hi as overshootDistance,ai as pageIndexForToggle,Qn as parseAccelerator,ie as parseBannerButtonStyle,se as parseBreakpointCondition,v as parseCreditPerson,Ir as parseMenuEntries,$n as parseShortcutLabel,bt as parseToolbarStyle,Y as randomAvatarColorClass,Yt as resolveBottomSheetClose,rt as resolveCheckState,Lr as resolveDropdownTooltip,vr as resolveNaturalSidebarWidth,yr as resolveNavigationAction,br as resolveNavigationSidebarWidth,xr as resolveNavigationStack,Sr as resolveOverlaySidebarWidth,wn as resolvePageTitle,Xi as resolvePopoverKey,Cr as resolveSidebarBounds,xt as resolveSpinnerSize,wr as resolveSwipeArea,Tr as resolveSwipeRelease,Er as resolveSwipeSnapPoints,Dr as resolveSwipeStart,ha as resolveWrapBoxChildOrder,ga as resolveWrapBoxLine,Mi as rowMatchesQuery,Ui as scrollMaxValue,Wi as scrollUndershootClasses,Ni as searchPreferences,M as setAdwaitaAccent,Nt as setAdwaitaColorScheme,y as setLicense,b as setLicenseType,er as shortcutKeycaps,oi as shouldRevealViewSwitcherBar,Nn as sidebarHeaders,Jn as spinnerArc,Yn as spinnerArcEnd,Xn as spinnerArcStart,St as spinnerGeometry,Zn as spinnerProgressAt,Rr as splitButtonArrowIcon,zr as splitButtonPopupDirection,Br as splitButtonRootState,Vr as splitButtonStyleClasses,n as stringIsNotEmpty,Pi as stripMarkup,r as stripMnemonic,vi as successorAfterClose,Fe as swipeBounds,Or as swipeCancelProgress,Ie as swipeClosestPointIndex,Le as swipeEndProgress,Re as swipeNextPointIndex,ze as swipePreviousPointIndex,Be as swipeProjectedPointIndex,Ve as swipeSlope,He as swipeVelocityThreshold,yi as tabCloseVisible,bi as tabIconState,xi as tabTooltip,Si as tabTooltipIsMarkup,Ci as tabsRevealed,kr as tagsConflict,Pt as themeIconColor,Ft as toggleAdwaitaColorScheme,si as toggleIndexForPage,Ct as toolbarBarStyleClasses,wt as toolbarViewAllocate,Tt as toolbarViewClasses,Et as toolbarViewContentForSize,Dt as toolbarViewMeasure,x as translatorCreditsPeople,ci as viewSwitcherBadgeLabel,li as viewSwitcherButtonOrientation,ui as viewSwitcherIconName,di as viewSwitcherIndicatorDescription,fi as viewSwitcherLabel,pi as viewSwitcherPageFromStackPage,mi as viewSwitcherPagesFromStack,_a as wrapBoxLengthToPx,va as wrapPolicyFlexShrink};
|
package/lib/esm/swipe.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=150,t=16,n=.3,r=.6,i=.998,a=.997,o=2,s=.35,c=.005,l=400,u=300;function clamp(e,t,n){return e>n?n:e<t?t:e}function swipeSlope(e){let t=e===`touchpad`?a:i;return t/(1-t)/1e3}function swipeVelocityThreshold(e){return e===`touchpad`?r:n}function swipeClosestPointIndex(e,t){let n=0;for(let r=1;r<e.length;r++)Math.abs(e[r]-t)<Math.abs(e[n]-t)&&(n=r);return n}function swipeNextPointIndex(e,t){for(let n=0;n<e.length;n++)if(Math.abs(e[n]-t)<2**-52||e[n]>t)return n;return-1}function swipePreviousPointIndex(e,t){for(let n=e.length-1;n>=0;n--)if(Math.abs(e[n]-t)<2**-52||e[n]<t)return n;return-1}function swipeBounds(e,t,n){if(e.length===0)return{lower:0,upper:0};if(n)return{lower:e[0],upper:e[e.length-1]};let r=swipeClosestPointIndex(e,t),i,a;return Math.abs(e[r]-t)<.005?(i=r,a=r):(i=swipePreviousPointIndex(e,t),a=swipeNextPointIndex(e,t)),{lower:e[Math.max(i-1,0)],upper:e[Math.min(a+1,e.length-1)]}}function swipeEndProgress(e){let{points:t,progress:n,velocity:r,source:i}=e;if(e.cancelled===!0)return e.cancelProgress??n;if(t.length===0)return n;let{lower:a,upper:o}=swipeBounds(t,e.initialProgress,e.allowLongSwipes);if(Math.abs(r)<swipeVelocityThreshold(i))return clamp(t[swipeClosestPointIndex(t,n)],a,o);let c=swipeSlope(i),l;if(Math.abs(r)>2){let e=c/2/s,t=Math.abs(r)-2+e;l=s*t*t-s*e*e+c*2}else l=Math.abs(r)*c;return t[swipeProjectedPointIndex(t,clamp(l*Math.sign(r)+n,a,o),e.initialProgress,r)]}function swipeProjectedPointIndex(e,t,n,r){let i=swipeClosestPointIndex(e,n),a=swipePreviousPointIndex(e,t),o=swipeNextPointIndex(e,t);if((r>0?a:o)===i){let e=r>0?o:a;if(e>=0)return e}return swipeClosestPointIndex(e,t)}var SwipeTracker=class{constructor(e){this._options=e,this._history=[],this._initialProgress=0,this._progress=0,this._cancelled=!1}get progress(){return this._progress}get initialProgress(){return this._initialProgress}prepare(e){this._initialProgress=e,this._progress=e,this._cancelled=!1}record(e,t){this._trimHistory(t),this._history.push({delta:e,time:t})}advance(e,t){if(!(t>0))return this._progress;let{lower:n,upper:r}=swipeBounds(this._options.points(),this._initialProgress,this._options.allowLongSwipes());return this._progress=clamp(this._progress+e/t,n,r),this._progress}reset(){this._history.length=0,this._initialProgress=0,this._progress=0,this._cancelled=!1}cancel(){this._cancelled=!0}end(e,t=`touch`){this._trimHistory(e);let n=this._velocity(),r=swipeEndProgress({points:this._options.points(),initialProgress:this._initialProgress,progress:this._progress,velocity:n,allowLongSwipes:this._options.allowLongSwipes(),source:t,cancelled:this._cancelled,cancelProgress:this._options.cancelProgress?.()??this._initialProgress});return this.reset(),{velocity:n,to:r}}_trimHistory(e){let t=e-150,n=0;for(;n<this._history.length&&this._history[n].time<t;)n++;n>0&&this._history.splice(0,n)}_velocity(){if(this._history.length<2)return 0;let e=this._history[0].time,t=this._history[this._history.length-1].time;if(e===t)return 0;let n=0;for(let e=1;e<this._history.length;e++)n+=this._history[e].delta;let r=n/(t-e),{lower:i,upper:a}=swipeBounds(this._options.points(),this._initialProgress,this._options.allowLongSwipes());return this._progress<=i&&r<0||this._progress>=a&&r>0?0:r}};export{i as ADW_SWIPE_DECELERATION_TOUCH,a as ADW_SWIPE_DECELERATION_TOUCHPAD,t as ADW_SWIPE_DRAG_THRESHOLD,c as ADW_SWIPE_EPSILON,e as ADW_SWIPE_HISTORY_THRESHOLD_MS,s as ADW_SWIPE_PARABOLA_MULTIPLIER,l as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H,u as ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V,o as ADW_SWIPE_VELOCITY_CURVE_THRESHOLD,n as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH,r as ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD,SwipeTracker,swipeBounds,swipeClosestPointIndex,swipeEndProgress,swipeNextPointIndex,swipePreviousPointIndex,swipeProjectedPointIndex,swipeSlope,swipeVelocityThreshold};
|
package/lib/types/carousel.d.ts
CHANGED
|
@@ -215,6 +215,8 @@ export interface CarouselStateOptions {
|
|
|
215
215
|
interactive?: boolean;
|
|
216
216
|
/** `AdwCarousel:allow-scroll-wheel`, default TRUE. */
|
|
217
217
|
allowScrollWheel?: boolean;
|
|
218
|
+
/** `AdwCarousel:allow-mouse-drag`, default TRUE. */
|
|
219
|
+
allowMouseDrag?: boolean;
|
|
218
220
|
/** `AdwCarousel:allow-long-swipes`, default FALSE. */
|
|
219
221
|
allowLongSwipes?: boolean;
|
|
220
222
|
/** `AdwCarousel:spacing` in px, default 0. Feeds `distance`. */
|
|
@@ -263,6 +265,7 @@ export declare class CarouselState {
|
|
|
263
265
|
private _orientation;
|
|
264
266
|
private _interactive;
|
|
265
267
|
private _allowScrollWheel;
|
|
268
|
+
private _allowMouseDrag;
|
|
266
269
|
private _allowLongSwipes;
|
|
267
270
|
private _spacing;
|
|
268
271
|
private _revealDuration;
|
|
@@ -470,6 +473,19 @@ export declare class CarouselState {
|
|
|
470
473
|
get allowScrollWheel(): boolean;
|
|
471
474
|
/** Set `allow-scroll-wheel`. Returns whether it changed. */
|
|
472
475
|
setAllowScrollWheel(value: boolean): boolean;
|
|
476
|
+
/**
|
|
477
|
+
* `AdwCarousel:allow-mouse-drag` — whether a POINTER may drag the strip, as opposed
|
|
478
|
+
* to touch, which always can. Defaults TRUE (:1091-1094), and the C documents the
|
|
479
|
+
* off switch as "dragging is only available on touch".
|
|
480
|
+
*
|
|
481
|
+
* Carried here and not in the renderer for the same reason `allow-long-swipes` is:
|
|
482
|
+
* it is a property of the widget, so both ports declare it and one vector table pins
|
|
483
|
+
* its default. The GESTURE is the renderer's — in a browser a mouse drag has to be
|
|
484
|
+
* implemented, because unlike touch there is no native one to inherit.
|
|
485
|
+
*/
|
|
486
|
+
get allowMouseDrag(): boolean;
|
|
487
|
+
/** Set `allow-mouse-drag`. Returns whether it changed. */
|
|
488
|
+
setAllowMouseDrag(value: boolean): boolean;
|
|
473
489
|
/**
|
|
474
490
|
* `AdwCarousel:allow-long-swipes` — whether one flick may cross more than one
|
|
475
491
|
* snap point. Forwarded to the swipe tracker in C; the state
|
|
@@ -269,13 +269,14 @@ export interface CarouselRevealVector {
|
|
|
269
269
|
export declare const CAROUSEL_REVEAL_VECTORS: ReadonlyArray<CarouselRevealVector>;
|
|
270
270
|
/** One property-default expectation. */
|
|
271
271
|
export interface CarouselPropertyDefaultVector {
|
|
272
|
-
property: 'orientation' | 'interactive' | 'allowScrollWheel' | 'allowLongSwipes' | 'spacing' | 'revealDuration';
|
|
272
|
+
property: 'orientation' | 'interactive' | 'allowScrollWheel' | 'allowMouseDrag' | 'allowLongSwipes' | 'spacing' | 'revealDuration';
|
|
273
273
|
value: string | number | boolean;
|
|
274
274
|
rule: string;
|
|
275
275
|
}
|
|
276
276
|
/**
|
|
277
|
-
* The `AdwCarousel` property defaults.
|
|
277
|
+
* The `AdwCarousel` property defaults. Three are regression pins: `allow-scroll-wheel` is
|
|
278
278
|
* TRUE, which a bare attribute-presence read inverts (a plain `<adw-carousel>` then ignores
|
|
279
|
-
* the wheel entirely)
|
|
279
|
+
* the wheel entirely); `allow-long-swipes` is FALSE; and `allow-mouse-drag` is TRUE, which
|
|
280
|
+
* neither port had at all — a `<adw-carousel>` could not be dragged with a mouse, measured.
|
|
280
281
|
*/
|
|
281
282
|
export declare const CAROUSEL_PROPERTY_DEFAULT_VECTORS: ReadonlyArray<CarouselPropertyDefaultVector>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -50,6 +50,8 @@ export { DEFAULT_INDICATOR_DESCRIPTION_STRINGS, INLINE_VIEW_SWITCHER_DISPLAY_MOD
|
|
|
50
50
|
export type { AdwInlineViewSwitcherDisplayMode, AdwViewSwitcherPage, AdwViewSwitcherPageInit, AdwViewSwitcherPolicy, IndicatorDescriptionStrings, InlineToggleModel, ViewSwitcherBarChange, ViewSwitcherBarListener, ViewSwitcherButtonModel, ViewSwitcherDragSwitchOptions, ViewSwitcherScheduler, ViewSwitcherStateChange, ViewSwitcherStateListener, ViewSwitcherStateOptions, ViewSwitcherTimerHandle, } from './view-switcher.js';
|
|
51
51
|
export { DEFAULT_TAB_AUTOHIDE, TabViewState, isDescendantOfPage, successorAfterClose, tabCloseVisible, tabIconState, tabTooltip, tabTooltipIsMarkup, tabsRevealed, } from './tab-view.js';
|
|
52
52
|
export type { AdwTabPageSpec, AdwTabPageState, TabIconState, TabViewHandlers, TabViewPagesChange, TabViewPagesChangeKind, TabViewPagesListener, TabViewSelectionChange, TabViewSelectionListener, } from './tab-view.js';
|
|
53
|
+
export { ADW_SWIPE_DECELERATION_TOUCH, ADW_SWIPE_DECELERATION_TOUCHPAD, ADW_SWIPE_DRAG_THRESHOLD, ADW_SWIPE_EPSILON, ADW_SWIPE_HISTORY_THRESHOLD_MS, ADW_SWIPE_PARABOLA_MULTIPLIER, ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H, ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V, ADW_SWIPE_VELOCITY_CURVE_THRESHOLD, ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH, ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD, SwipeTracker, swipeBounds, swipeClosestPointIndex, swipeEndProgress, swipeNextPointIndex, swipePreviousPointIndex, swipeProjectedPointIndex, swipeSlope, swipeVelocityThreshold, } from './swipe.js';
|
|
54
|
+
export type { AdwSwipeEnd, AdwSwipeEndInput, AdwSwipeRange, AdwSwipeSource } from './swipe.js';
|
|
53
55
|
export { CAROUSEL_SCROLL_TIMEOUT_MS, CAROUSEL_SETTLE_EPSILON, CarouselState, carouselClampPosition, carouselClosestSnapPoint, carouselNavigateTarget, carouselPageAllocation, carouselPageAtPosition, carouselRange, carouselReorderShift, carouselSizesFromSnapPoints, carouselSnapPoints, carouselWheelStep, } from './carousel.js';
|
|
54
56
|
export type { CarouselChangeReason, CarouselDirection, CarouselOrientation, CarouselPageAllocation, CarouselPageChangedListener, CarouselPageMeasurement, CarouselRange, CarouselReorderShiftInput, CarouselScrollOptions, CarouselScrollRequest, CarouselScrollSource, CarouselStateChange, CarouselStateListener, CarouselStateOptions, CarouselWheelInput, } from './carousel.js';
|
|
55
57
|
export { UNTITLED_PAGE_LABEL, collectSearchRows, countVisiblePages, createSearchRowSubtitle, defaultCaseFolder, derivePreferencesGroupHeader, escapeMarkup, makeComparable, rowMatchesQuery, searchPreferences, stripMarkup, } from './preferences.js';
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/** `EVENT_HISTORY_THRESHOLD_MS` — how far back the velocity is measured. */
|
|
2
|
+
export declare const ADW_SWIPE_HISTORY_THRESHOLD_MS = 150;
|
|
3
|
+
/** `DRAG_THRESHOLD_DISTANCE` — px of travel before a drag becomes a swipe. */
|
|
4
|
+
export declare const ADW_SWIPE_DRAG_THRESHOLD = 16;
|
|
5
|
+
/** `VELOCITY_THRESHOLD_TOUCH` — below this (raw units/ms) a touch swipe just snaps back. */
|
|
6
|
+
export declare const ADW_SWIPE_VELOCITY_THRESHOLD_TOUCH = 0.3;
|
|
7
|
+
/** `VELOCITY_THRESHOLD_TOUCHPAD` — the touchpad's higher bar, since its deltas are denser. */
|
|
8
|
+
export declare const ADW_SWIPE_VELOCITY_THRESHOLD_TOUCHPAD = 0.6;
|
|
9
|
+
/** `DECELERATION_TOUCH`. Feeds {@link swipeSlope}; never used directly. */
|
|
10
|
+
export declare const ADW_SWIPE_DECELERATION_TOUCH = 0.998;
|
|
11
|
+
/** `DECELERATION_TOUCHPAD`. */
|
|
12
|
+
export declare const ADW_SWIPE_DECELERATION_TOUCHPAD = 0.997;
|
|
13
|
+
/** `VELOCITY_CURVE_THRESHOLD` — above this the projection leaves the straight line. */
|
|
14
|
+
export declare const ADW_SWIPE_VELOCITY_CURVE_THRESHOLD = 2;
|
|
15
|
+
/** `DECELERATION_PARABOLA_MULTIPLIER`. */
|
|
16
|
+
export declare const ADW_SWIPE_PARABOLA_MULTIPLIER = 0.35;
|
|
17
|
+
/** `EPSILON` — how close to a snap point counts as being ON it. */
|
|
18
|
+
export declare const ADW_SWIPE_EPSILON = 0.005;
|
|
19
|
+
/**
|
|
20
|
+
* `TOUCHPAD_BASE_DISTANCE_H` / `_V` — what a SCROLL delta is divided by instead of the
|
|
21
|
+
* page pitch (adw-swipe-tracker.c:809).
|
|
22
|
+
*
|
|
23
|
+
* Exported although nothing divides by them yet: {@link AdwSwipeSource} offers
|
|
24
|
+
* `'touchpad'` and the two touchpad constants above, and a caller handed those without
|
|
25
|
+
* the divisor has half an API.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_H = 400;
|
|
28
|
+
export declare const ADW_SWIPE_TOUCHPAD_BASE_DISTANCE_V = 300;
|
|
29
|
+
/** Which input drove the gesture. It picks the threshold and the deceleration, nothing else. */
|
|
30
|
+
export type AdwSwipeSource = 'touch' | 'touchpad';
|
|
31
|
+
/**
|
|
32
|
+
* `decel / (1 - decel) / 1000` — the constant that turns a velocity into a distance.
|
|
33
|
+
*
|
|
34
|
+
* A function rather than two more constants because the arithmetic is the interesting
|
|
35
|
+
* part: at `0.998` it is `0.499`, so ~2 raw units/ms projects one page, which is what
|
|
36
|
+
* makes {@link ADW_SWIPE_VELOCITY_CURVE_THRESHOLD} sit exactly where the straight line
|
|
37
|
+
* would start over-shooting.
|
|
38
|
+
*/
|
|
39
|
+
export declare function swipeSlope(source: AdwSwipeSource): number;
|
|
40
|
+
/** The velocity a gesture must beat to be a flick rather than a nudge. */
|
|
41
|
+
export declare function swipeVelocityThreshold(source: AdwSwipeSource): number;
|
|
42
|
+
/**
|
|
43
|
+
* Index of the snap point nearest `position`. `find_closest_point`.
|
|
44
|
+
*
|
|
45
|
+
* A tie takes the EARLIER point, because the scan only replaces its best on a strict
|
|
46
|
+
* `<`. `carouselClosestSnapPoint` in `./carousel.ts` is `get_closest_child_at`, the same
|
|
47
|
+
* arithmetic with the same tie-break — upstream has it twice too, once per file — so
|
|
48
|
+
* that one now delegates here rather than keeping a second copy of a rule whose halves
|
|
49
|
+
* could drift by one comparison operator.
|
|
50
|
+
*/
|
|
51
|
+
export declare function swipeClosestPointIndex(points: readonly number[], position: number): number;
|
|
52
|
+
/** Index of the first snap point at or after `position`, or `-1`. `find_next_point`. */
|
|
53
|
+
export declare function swipeNextPointIndex(points: readonly number[], position: number): number;
|
|
54
|
+
/** Index of the last snap point at or before `position`, or `-1`. `find_previous_point`. */
|
|
55
|
+
export declare function swipePreviousPointIndex(points: readonly number[], position: number): number;
|
|
56
|
+
/** The range a gesture may reach. */
|
|
57
|
+
export interface AdwSwipeRange {
|
|
58
|
+
lower: number;
|
|
59
|
+
upper: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* How far a gesture starting at `position` may travel. `get_bounds` / `get_range`.
|
|
63
|
+
*
|
|
64
|
+
* With `allowLongSwipes` the whole strip is fair game. Without it the reach is ONE snap
|
|
65
|
+
* point either side of where the gesture began — which is the entire meaning of
|
|
66
|
+
* `AdwCarousel:allow-long-swipes`, and the reason the bound is computed from
|
|
67
|
+
* `initialProgress` and not from the live one: a long drag would otherwise keep
|
|
68
|
+
* extending its own limit.
|
|
69
|
+
*/
|
|
70
|
+
export declare function swipeBounds(points: readonly number[], position: number, allowLongSwipes: boolean): AdwSwipeRange;
|
|
71
|
+
/** Everything {@link swipeEndProgress} needs, and nothing about the platform. */
|
|
72
|
+
export interface AdwSwipeEndInput {
|
|
73
|
+
/** Snap points in ascending order, as `adw_swipeable_get_snap_points` returns them. */
|
|
74
|
+
points: readonly number[];
|
|
75
|
+
/** Progress when the gesture was claimed — the bound is measured from here. */
|
|
76
|
+
initialProgress: number;
|
|
77
|
+
/** Progress now, already clamped by {@link swipeBounds}. */
|
|
78
|
+
progress: number;
|
|
79
|
+
/** Raw platform units per millisecond. See the header on why this is not pages/ms. */
|
|
80
|
+
velocity: number;
|
|
81
|
+
allowLongSwipes: boolean;
|
|
82
|
+
source: AdwSwipeSource;
|
|
83
|
+
/** A cancelled gesture ignores everything above and returns {@link cancelProgress}. */
|
|
84
|
+
cancelled?: boolean;
|
|
85
|
+
/** `adw_swipeable_get_cancel_progress` — where a cancelled gesture goes. */
|
|
86
|
+
cancelProgress?: number;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Where the gesture lands. `get_end_progress`.
|
|
90
|
+
*
|
|
91
|
+
* Below the velocity threshold it is the nearest snap point, clamped — a slow drag
|
|
92
|
+
* settles where it was let go. Above it, the velocity is projected (linearly, then along
|
|
93
|
+
* a parabola past {@link ADW_SWIPE_VELOCITY_CURVE_THRESHOLD}) and the projection picks a
|
|
94
|
+
* point through {@link swipeProjectedPointIndex}.
|
|
95
|
+
*/
|
|
96
|
+
export declare function swipeEndProgress(input: AdwSwipeEndInput): number;
|
|
97
|
+
/**
|
|
98
|
+
* Which snap point a projection commits to. `find_point_for_projection`.
|
|
99
|
+
*
|
|
100
|
+
* The special case is what makes a flick always MOVE: if the point behind the projection
|
|
101
|
+
* (ahead of it, going backwards) is the one the gesture started on, the projection did
|
|
102
|
+
* not clear a page, and rounding to the nearest would put the user back where they were
|
|
103
|
+
* after a deliberate gesture. So it takes the next one instead.
|
|
104
|
+
*/
|
|
105
|
+
export declare function swipeProjectedPointIndex(points: readonly number[], target: number, initialProgress: number, velocity: number): number;
|
|
106
|
+
/** What {@link SwipeTracker.end} decided. */
|
|
107
|
+
export interface AdwSwipeEnd {
|
|
108
|
+
/** Raw units per millisecond, as the renderer may want it for an animation duration. */
|
|
109
|
+
velocity: number;
|
|
110
|
+
/** The progress to settle on. */
|
|
111
|
+
to: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The gesture state machine: progress, an event history, and the two answers a renderer
|
|
115
|
+
* needs — what to draw during the drag, and where to land after it.
|
|
116
|
+
*
|
|
117
|
+
* It knows nothing about pointers, touches or scroll events. A renderer feeds it deltas
|
|
118
|
+
* in the platform's own units and the pitch to divide them by; everything else is the C.
|
|
119
|
+
*/
|
|
120
|
+
export declare class SwipeTracker {
|
|
121
|
+
private readonly _options;
|
|
122
|
+
private readonly _history;
|
|
123
|
+
private _initialProgress;
|
|
124
|
+
private _progress;
|
|
125
|
+
private _cancelled;
|
|
126
|
+
constructor(_options: {
|
|
127
|
+
/** Snap points, read fresh on every call: pages can be inserted mid-gesture. */
|
|
128
|
+
points: () => readonly number[];
|
|
129
|
+
/** `AdwCarousel:allow-long-swipes`, likewise read fresh. */
|
|
130
|
+
allowLongSwipes: () => boolean;
|
|
131
|
+
/** `adw_swipeable_get_cancel_progress`; defaults to where the gesture began. */
|
|
132
|
+
cancelProgress?: () => number;
|
|
133
|
+
});
|
|
134
|
+
/** The progress a renderer should be showing. */
|
|
135
|
+
get progress(): number;
|
|
136
|
+
/** Where the gesture started, which is what bounds it. */
|
|
137
|
+
get initialProgress(): number;
|
|
138
|
+
/**
|
|
139
|
+
* `gesture_prepare` — a gesture is now possible, at `progress`.
|
|
140
|
+
*
|
|
141
|
+
* Called on the FIRST move, not when the gesture is claimed, because that is where
|
|
142
|
+
* the C sets `initial_progress` (:202-204) and `initial_progress` is what bounds the
|
|
143
|
+
* whole gesture. Deliberately does NOT clear the history: {@link reset} does, at the
|
|
144
|
+
* end, which is what lets pre-claim moves count toward the velocity.
|
|
145
|
+
*/
|
|
146
|
+
prepare(progress: number): void;
|
|
147
|
+
/**
|
|
148
|
+
* `append_to_history` — record one raw platform delta.
|
|
149
|
+
*
|
|
150
|
+
* Called on EVERY move including the ones before the claim, which is where the C
|
|
151
|
+
* calls it: `append_to_history` sits ahead of the PENDING block in `drag_update_cb`
|
|
152
|
+
* (:670), and nothing clears the array until the gesture ends. Recording only from
|
|
153
|
+
* the claim cost a whole event: with the first record's delta discarded as the
|
|
154
|
+
* clock-starter (see {@link _velocity}), a flick that crossed the threshold on its
|
|
155
|
+
* first move and released on its second measured ZERO velocity and settled back
|
|
156
|
+
* instead of paging.
|
|
157
|
+
*/
|
|
158
|
+
record(delta: number, time: number): void;
|
|
159
|
+
/**
|
|
160
|
+
* `gesture_update` — apply one move to the progress. Returns the progress to draw.
|
|
161
|
+
*
|
|
162
|
+
* Takes the RAW delta and the pitch to divide it by, and does NOT touch the history:
|
|
163
|
+
* the C's `gesture_update` only ever writes progress, because the append already
|
|
164
|
+
* happened. Call it only while the gesture is claimed.
|
|
165
|
+
*/
|
|
166
|
+
advance(delta: number, pitch: number): number;
|
|
167
|
+
/** `reset` — end of gesture. Clears the history so the next one starts from nothing. */
|
|
168
|
+
reset(): void;
|
|
169
|
+
/** Mark the gesture cancelled: {@link end} will return the cancel progress. */
|
|
170
|
+
cancel(): void;
|
|
171
|
+
/**
|
|
172
|
+
* Finish, and say where to go. `gesture_end`.
|
|
173
|
+
*
|
|
174
|
+
* `source` defaults to `'touch'` because that is what the C passes for a DRAG —
|
|
175
|
+
* `is_touchpad` is FALSE on both the touch and the mouse gesture (`drag_end_cb`),
|
|
176
|
+
* and only the scroll path passes TRUE. It is a parameter so the scroll path can
|
|
177
|
+
* reuse this tracker without a second copy of the projection.
|
|
178
|
+
*/
|
|
179
|
+
end(time: number, source?: AdwSwipeSource): AdwSwipeEnd;
|
|
180
|
+
/** `trim_history` — anything older than the window cannot describe the current flick. */
|
|
181
|
+
private _trimHistory;
|
|
182
|
+
/**
|
|
183
|
+
* `calculate_velocity`, minus the overshoot damping AdwCarousel never enables.
|
|
184
|
+
*
|
|
185
|
+
* The FIRST record's delta is deliberately dropped — the C starts its sum at `i == 1`
|
|
186
|
+
* — because the first record only establishes the clock. Summing it would divide a
|
|
187
|
+
* delta by a time window that does not contain it.
|
|
188
|
+
*/
|
|
189
|
+
private _velocity;
|
|
190
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/adwaita-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"description": "Headless Adwaita widget behavior (breakpoint condition grammar + apply/unapply state machine, color-scheme observable, avatar derivation) shared by the web and NativeScript Adwaita renderers — pure TS, no platform imports",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"headless"
|
|
47
47
|
],
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@gjsify/cli": "^0.
|
|
50
|
-
"@gjsify/unit": "^0.
|
|
49
|
+
"@gjsify/cli": "^0.44.0",
|
|
50
|
+
"@gjsify/unit": "^0.44.0",
|
|
51
51
|
"@types/node": "^25.9.2",
|
|
52
52
|
"typescript": "^6.0.3"
|
|
53
53
|
},
|