@gjsify/adwaita-nativescript 0.43.0 → 0.45.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/widgets/adw-about-dialog.js +1 -1
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-avatar.js +1 -1
- package/lib/esm/widgets/adw-banner.js +1 -1
- package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
- package/lib/esm/widgets/adw-button-content.js +1 -1
- package/lib/esm/widgets/adw-carousel.js +1 -1
- package/lib/esm/widgets/adw-clamp.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-data-grid.js +1 -1
- package/lib/esm/widgets/adw-drop-down.js +1 -1
- package/lib/esm/widgets/adw-entry-row.js +1 -1
- package/lib/esm/widgets/adw-entry.js +1 -1
- package/lib/esm/widgets/adw-expander-row.js +1 -1
- package/lib/esm/widgets/adw-header-bar.js +1 -1
- package/lib/esm/widgets/adw-icon.js +1 -1
- package/lib/esm/widgets/adw-image-button.js +1 -1
- package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
- package/lib/esm/widgets/adw-navigation-view.js +1 -1
- package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
- package/lib/esm/widgets/adw-password-entry-row.js +1 -1
- package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
- package/lib/esm/widgets/adw-preferences-group.js +1 -1
- package/lib/esm/widgets/adw-preferences-page.js +1 -1
- package/lib/esm/widgets/adw-sidebar.js +1 -1
- package/lib/esm/widgets/adw-slider-row.js +1 -1
- package/lib/esm/widgets/adw-spin-row.js +1 -1
- package/lib/esm/widgets/adw-spinner.js +1 -1
- package/lib/esm/widgets/adw-split-button.js +1 -1
- package/lib/esm/widgets/adw-status-page.js +1 -1
- package/lib/esm/widgets/adw-switch-row.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toggle-group.js +1 -1
- package/lib/esm/widgets/adw-toolbar-view.js +1 -1
- package/lib/esm/widgets/adw-view-stack.js +1 -1
- package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
- package/lib/esm/widgets/adw-wrap-box.js +1 -1
- package/lib/esm/widgets/builder-slots.js +1 -0
- package/lib/esm/widgets/host-insets.android.js +1 -0
- package/lib/esm/widgets/host-insets.ios.js +1 -0
- package/lib/esm/widgets/host-insets.js +1 -0
- package/lib/esm/widgets/icon-path.js +2 -2
- package/lib/esm/widgets/icons.android.js +1 -1
- package/lib/esm/widgets/icons.ios.js +1 -1
- package/lib/esm/widgets/split-view-base.js +1 -1
- package/lib/esm/widgets/view-switcher-base.js +1 -1
- package/lib/esm/widgets/window-insets.js +1 -1
- package/lib/esm/widgets/xml-values.js +1 -0
- package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
- package/lib/types/widgets/adw-action-row.d.ts +15 -1
- package/lib/types/widgets/adw-avatar.d.ts +1 -1
- package/lib/types/widgets/adw-banner.d.ts +2 -2
- package/lib/types/widgets/adw-bottom-sheet.d.ts +20 -2
- package/lib/types/widgets/adw-button-content.d.ts +2 -2
- package/lib/types/widgets/adw-carousel.d.ts +14 -3
- package/lib/types/widgets/adw-clamp.d.ts +13 -2
- package/lib/types/widgets/adw-combo-row.d.ts +1 -1
- package/lib/types/widgets/adw-data-grid.d.ts +1 -1
- package/lib/types/widgets/adw-drop-down.d.ts +1 -1
- package/lib/types/widgets/adw-entry-row.d.ts +4 -4
- package/lib/types/widgets/adw-entry.d.ts +2 -2
- package/lib/types/widgets/adw-expander-row.d.ts +20 -1
- package/lib/types/widgets/adw-header-bar.d.ts +13 -1
- package/lib/types/widgets/adw-icon.d.ts +1 -1
- package/lib/types/widgets/adw-image-button.d.ts +1 -1
- package/lib/types/widgets/adw-navigation-split-view.d.ts +1 -1
- package/lib/types/widgets/adw-navigation-view.d.ts +13 -2
- package/lib/types/widgets/adw-overlay-split-view.d.ts +1 -1
- package/lib/types/widgets/adw-password-entry-row.d.ts +2 -2
- package/lib/types/widgets/adw-preferences-dialog.d.ts +7 -1
- package/lib/types/widgets/adw-preferences-group.d.ts +11 -0
- package/lib/types/widgets/adw-preferences-page.d.ts +7 -1
- package/lib/types/widgets/adw-sidebar.d.ts +1 -1
- package/lib/types/widgets/adw-slider-row.d.ts +4 -4
- package/lib/types/widgets/adw-spin-row.d.ts +4 -4
- package/lib/types/widgets/adw-spinner.d.ts +2 -2
- package/lib/types/widgets/adw-split-button.d.ts +2 -2
- package/lib/types/widgets/adw-status-page.d.ts +7 -0
- package/lib/types/widgets/adw-switch-row.d.ts +1 -1
- package/lib/types/widgets/adw-tab-view.d.ts +2 -2
- package/lib/types/widgets/adw-toggle-group.d.ts +1 -1
- package/lib/types/widgets/adw-toolbar-view.d.ts +20 -3
- package/lib/types/widgets/adw-view-stack.d.ts +1 -1
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +1 -1
- package/lib/types/widgets/adw-wrap-box.d.ts +7 -7
- package/lib/types/widgets/builder-slots.d.ts +16 -0
- package/lib/types/widgets/host-insets.android.d.ts +4 -0
- package/lib/types/widgets/host-insets.d.ts +13 -0
- package/lib/types/widgets/host-insets.ios.d.ts +4 -0
- package/lib/types/widgets/icon-path.d.ts +72 -7
- package/lib/types/widgets/index.d.ts +13 -6
- package/lib/types/widgets/split-view-base.d.ts +15 -6
- package/lib/types/widgets/view-switcher-base.d.ts +1 -1
- package/lib/types/widgets/window-insets.d.ts +24 -0
- package/lib/types/widgets/xml-values.d.ts +18 -0
- package/package.json +11 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyViewStackVisibility as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyViewStackVisibility as t,createViewStackState as n,viewStackNotifyPayload as r}from"./view-stack-state.js";import{GridLayout as i,ItemSpec as a}from"@nativescript/core";const o=`notify::visible-child`;var AdwViewStack=class extends i{_state=n();constructor(){super(),this.className=`adw-view-stack`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`star`)),this._state.subscribe(e=>{t(this._state);let n={eventName:o,object:this,...r(e)};this.notify(n)})}add(e,n,r,a){let o=this._state.addPage({name:n,title:r,icon:a,content:e});return i.setColumn(e,0),i.setRow(e,0),this.addChild(e),t(this._state),o}addTitled(e,t,n){return this.add(e,t,n)}removePage(e){let n=this._state.pages[this._state.indexOfName(e)]?.content;return this._state.removePage(e)?(n&&this.removeChild(n),t(this._state),!0):!1}setPageVisible(e,n){let r=this._state.setPageVisible(e,n);return t(this._state),r}get pages(){return this._state.pages}get visibleChildIndex(){return this._state.visibleIndex}set visibleChildIndex(t){let n=e(t,this.visibleChildIndex);this._state.setVisibleIndex(n)}get visibleChildName(){return this._state.visibleName}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}};export{AdwViewStack,o as NOTIFY_VISIBLE_CHILD};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{NOTIFY_VISIBLE_CHILD as r}from"./adw-view-stack.js";import{createViewSwitcherBarState as i,nsIconSvg as a}from"./view-switcher-model.js";import{GridLayout as o,ItemSpec as s,Label as c,StackLayout as l}from"@nativescript/core";import{buildViewSwitcherButtons as u,viewSwitcherPagesFromStack as d}from"@gjsify/adwaita-core";var AdwViewSwitcherBar=class extends o{_bar;_nodes=[];_stack=null;_stackListener=null;_barState=i();constructor(){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`auto`));let e=new o;e.className=`adw-viewswitcherbar-box`,e.addRow(new s(1,`auto`)),o.setRow(e,0),this.addChild(e),this._bar=e,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack())}setStack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){this.setStack(e)}get reveal(){return this._barState.reveal}set reveal(t){let n=e(t,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(r,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(r,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=u(d(e),this._stack?.visibleChildIndex??-1,`narrow`);if(t.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=t.map((e,t)=>(this._bar.addColumn(new s(1,`star`)),this._buildButton(e.pageIndex,t)))}t.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.icon=a(e.iconName),n.label.text=e.label,n.badge.text=e.badgeLabel,n.badge.visibility=e.badgeLabel.length>0||e.needsAttention?`visible`:`collapse`,n.badge.className=e.badgeLabel.length===0&&e.needsAttention?`adw-viewswitcherbar-button-badge needs-attention`:`adw-viewswitcherbar-button-badge`)}),this._applyRevealed()}_buildButton(e,r){let i=new l;i.orientation=`vertical`,i.className=`adw-viewswitcherbar-button`,i.horizontalAlignment=`stretch`;let a=new t;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,i.addChild(a);let s=new c;s.className=`adw-viewswitcherbar-button-label`,s.horizontalAlignment=`center`,s.textAlignment=`center`,i.addChild(s);let u=new c;return u.className=`adw-viewswitcherbar-button-badge`,u.horizontalAlignment=`center`,u.textAlignment=`center`,i.addChild(u),n(i),i.addEventListener(`tap`,()=>{this._stack&&(this._stack.visibleChildIndex=e)}),o.setColumn(i,r),this._bar.addChild(i),{button:i,icon:a,label:s,badge:u}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`}};export{AdwViewSwitcherBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{DEFAULT_WRAP_BOX_SPACING as n,normalizeWrapBoxSpacing as r,wrapBoxChildFlex as i,wrapBoxChildMargin as a,wrapBoxFlexStyle as o,wrapBoxSpacingChanges as s}from"./wrap-box-layout.js";import{FlexboxLayout as c}from"@nativescript/core";import{ADW_WRAP_BOX_DEFAULT_ALIGN as l,ADW_WRAP_BOX_DEFAULT_JUSTIFY as u,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as d,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as f,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as p,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as m,normalizeNaturalLineLength as h,normalizeWrapBoxAlign as g,normalizeWrapBoxJustify as _,normalizeWrapBoxLengthUnit as v,normalizeWrapBoxPackDirection as y,normalizeWrapPolicy as b,resolveWrapBoxChildOrder as x,wrapBoxLengthToPx as S}from"@gjsify/adwaita-core";var AdwWrapBox=class extends c{_childSpacing=n;_lineSpacing=n;_childSpacingUnit=d;_lineSpacingUnit=d;_align=l;_justify=u;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=p;_packDirection=f;_orientation=`horizontal`;_naturalLineLength=m;_naturalLineLengthUnit=d;constructor(){super(),this.className=`adw-wrap-box`,this._applyLayout()}add(e){this.addChild(e)}remove(e){this.removeChild(e)}removeAll(){this.removeChildren()}addChild(e){super.addChild(e),this._applyChildren()}insertChildAfter(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorderChildAfter(e,t=null){return this._applyOrder(`reorder-after`,e,t)}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=x({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),this._applyChildren(),!0)}get childSpacing(){return this._childSpacing}set childSpacing(e){let n=t(e,this._childSpacing);s(this._childSpacing,n)&&(this._childSpacing=r(n),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=v(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let n=t(e,this._lineSpacing);s(this._lineSpacing,n)&&(this._lineSpacing=r(n),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=v(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let n=g(t(e,this.align));n!==this._align&&(this._align=n,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=_(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(t){let n=!!e(t,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(t){let n=!!e(t,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(t){let n=!!e(t,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=b(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=y(e);t!==this._packDirection&&(this._packDirection=t,this._applyLayout(),this._notify(`pack-direction`))}get orientation(){return this._orientation}set orientation(e){let t=e===`vertical`?`vertical`:`horizontal`;t!==this._orientation&&(this._orientation=t,this._applyLayout(),this._notify(`orientation`))}get naturalLineLength(){return this._naturalLineLength}set naturalLineLength(e){let n=h(t(e,this.naturalLineLength));n!==this._naturalLineLength&&(this._naturalLineLength=n,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=v(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return S(this._naturalLineLength,this._naturalLineLengthUnit)}_notify(e){this.notify({eventName:`notify::${e}`,object:this})}_flexInput(){return{orientation:this._orientation,packDirection:this._packDirection,wrapReverse:this._wrapReverse,justify:this._justify,justifyLastLine:this._justifyLastLine,align:this._align,lineHomogeneous:this._lineHomogeneous,wrapPolicy:this._wrapPolicy}}_applyLayout(){let e=o(this._flexInput());this.flexDirection=e.flexDirection,this.flexWrap=e.flexWrap,this.justifyContent=e.justifyContent,this.alignContent=e.alignContent,this.alignItems=`stretch`,this._applyChildren()}_applyChildren(){let e=a(S(this._childSpacing,this._childSpacingUnit),S(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=i(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),c.setFlexGrow(r,n.flexGrow),c.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";function resolveBuilderSlot(e,t,n){if(typeof e!=`string`)return n;let r=e.lastIndexOf(`.`),i=r===-1?e:e.slice(r+1);return t.includes(i)?i:n}export{resolveBuilderSlot};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{NO_HOST_PAYMENT as e}from"./window-insets.js";const t={top:!1,bottom:!0};function resolveHostInsets(n,r){let i=n.page;return i?(r.top>0&&i.androidOverflowEdge!==`top`&&(i.androidOverflowEdge=`top`),t):e}export{resolveHostInsets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{NO_HOST_PAYMENT as e}from"./window-insets.js";function resolveHostInsets(t,n){return e}export{resolveHostInsets};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{NO_HOST_PAYMENT as e}from"./window-insets.js";function resolveHostInsets(t,n){return e}export{resolveHostInsets};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_COLOR as e,DEFAULT_ICON_COLOR_DARK as t}from"@gjsify/adwaita-core";const n=16;function
|
|
2
|
-
`||e===`\r`,isNumStart=e=>e>=`0`&&e<=`9`||e===`.`||e===`+`||e===`-`,n=0,r=``,skipWs=()=>{for(;n<t&&isWs(e[n]);)n++},readNumber=()=>{let r=n;for((e[n]===`+`||e[n]===`-`)&&n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;if(e[n]===`.`)for(n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;if(e[n]===`e`||e[n]===`E`)for(n++,(e[n]===`+`||e[n]===`-`)&&n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;return e.slice(r,n)};for(;n<t;){let i=e[n];if(i===`a`||i===`A`)for(r+=i,n++;skipWs(),!(n>=t||!isNumStart(e[n]));)r+=` `+readNumber(),skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+e[n++],skipWs(),r+=` `+e[n++],skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+readNumber();else r+=i,n++}return r}export{n as ADWAITA_ICON_GRID,e as DEFAULT_ICON_COLOR,t as DEFAULT_ICON_COLOR_DARK,extractIconPaths,extractPathData,normalizeArcFlags,parseHexColor};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_COLOR as e,DEFAULT_ICON_COLOR_DARK as t}from"@gjsify/adwaita-core";const n=16,r=[1,0,0,1,0,0];function composeTransforms(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}const i=/([a-zA-Z]+)\s*\(([^)]*)\)/g,a=Math.PI/180;function parseIconTransform(e){let t=r,n=!1;i.lastIndex=0;let o;for(;(o=i.exec(e))!==null;){let e=o[2].split(/[\s,]+/).filter(e=>e!==``).map(Number);if(e.some(e=>!Number.isFinite(e)))return null;let r;switch(o[1]){case`matrix`:if(e.length!==6)return null;r=[e[0],e[1],e[2],e[3],e[4],e[5]];break;case`translate`:if(e.length<1||e.length>2)return null;r=[1,0,0,1,e[0],e[1]??0];break;case`scale`:if(e.length<1||e.length>2)return null;r=[e[0],0,0,e[1]??e[0],0,0];break;case`rotate`:{if(e.length!==1&&e.length!==3)return null;let t=Math.cos(e[0]*a),n=Math.sin(e[0]*a),i=[t,n,-n,t,0,0];if(e.length===1){r=i;break}let[o,s]=[e[1],e[2]];r=composeTransforms(composeTransforms([1,0,0,1,o,s],i),[1,0,0,1,-o,-s]);break}case`skewX`:if(e.length!==1)return null;r=[1,0,Math.tan(e[0]*a),1,0,0];break;case`skewY`:if(e.length!==1)return null;r=[1,Math.tan(e[0]*a),0,1,0,0];break;default:return null}t=composeTransforms(t,r),n=!0}return n?t:null}const o=/\s(d|fill|fill-rule|fill-opacity|transform|style)\s*=\s*"([^"]*)"/g;function tagAttributes(e){let t=new Map;o.lastIndex=0;let n;for(;(n=o.exec(e))!==null;)t.set(n[1],n[2]);return t}function presentationValue(e,t){let n=e.get(`style`);if(n!==void 0){let e=RegExp(`(?:^|;)\\s*${t}\\s*:\\s*([^;]+)`).exec(n)?.[1];if(e!==void 0)return e.trim()}return e.get(t)}const s=/<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>/g,c=new Set([`defs`,`clipPath`,`mask`,`symbol`,`marker`,`pattern`]);function extractIconPaths(e){let t=[],n=/<(g|path|defs|clipPath|mask|symbol|marker|pattern)\b((?:"[^"]*"|'[^']*'|[^"'<>])*)>|<\/(g|defs|clipPath|mask|symbol|marker|pattern)\s*>/g,i=[],a=0,o,l=e.replace(s,``);for(;(o=n.exec(l))!==null;){let[e,n,s,l]=o;if(n===void 0){c.has(l)?a=Math.max(0,a-1):a===0&&i.pop();continue}let u=s.trimEnd().endsWith(`/`);if(c.has(n)){u||a++;continue}if(a>0)continue;let d=tagAttributes(e),f=d.has(`transform`)?parseIconTransform(d.get(`transform`)):r,p=i.length>0?i[i.length-1]:r,m=f===null?null:composeTransforms(p,f);if(n===`g`){u||i.push(m??p);continue}let h=d.get(`d`)?.trim();if(!h||m===null)continue;let g=presentationValue(d,`fill-opacity`),_=g===void 0?1:Number.parseFloat(g),v=presentationValue(d,`fill`);t.push({d:normalizeArcFlags(h),opacity:Number.isFinite(_)?Math.min(1,Math.max(0,_)):1,transform:m,fillRule:presentationValue(d,`fill-rule`)===`evenodd`?`evenodd`:`nonzero`,fill:v===void 0||v===`currentColor`||v===`none`?null:v})}return t}function extractPathData(e){return extractIconPaths(e).map(e=>e.d).join(` `)}function parseHexColor(e){return parseHexColorOrNull(e)??{red:0,green:0,blue:0,alpha:1}}function parseHexColorOrNull(e){let t=e.trim().replace(/^#/,``);if(!/^[0-9a-fA-F]+$/.test(t))return null;let n=255,r,i,a;if(t.length===3)r=Number.parseInt(t[0]+t[0],16),i=Number.parseInt(t[1]+t[1],16),a=Number.parseInt(t[2]+t[2],16);else if(t.length===6)r=Number.parseInt(t.slice(0,2),16),i=Number.parseInt(t.slice(2,4),16),a=Number.parseInt(t.slice(4,6),16);else if(t.length===8)n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),i=Number.parseInt(t.slice(4,6),16),a=Number.parseInt(t.slice(6,8),16);else return null;return{red:r/255,green:i/255,blue:a/255,alpha:n/255}}function normalizeArcFlags(e){if(e.indexOf(`a`)===-1&&e.indexOf(`A`)===-1)return e;let t=e.length,isWs=e=>e===` `||e===`,`||e===` `||e===`
|
|
2
|
+
`||e===`\r`,isNumStart=e=>e>=`0`&&e<=`9`||e===`.`||e===`+`||e===`-`,n=0,r=``,skipWs=()=>{for(;n<t&&isWs(e[n]);)n++},readNumber=()=>{let r=n;for((e[n]===`+`||e[n]===`-`)&&n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;if(e[n]===`.`)for(n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;if(e[n]===`e`||e[n]===`E`)for(n++,(e[n]===`+`||e[n]===`-`)&&n++;n<t&&e[n]>=`0`&&e[n]<=`9`;)n++;return e.slice(r,n)};for(;n<t;){let i=e[n];if(i===`a`||i===`A`)for(r+=i,n++;skipWs(),!(n>=t||!isNumStart(e[n]));)r+=` `+readNumber(),skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+e[n++],skipWs(),r+=` `+e[n++],skipWs(),r+=` `+readNumber(),skipWs(),r+=` `+readNumber();else r+=i,n++}return r}export{n as ADWAITA_ICON_GRID,e as DEFAULT_ICON_COLOR,t as DEFAULT_ICON_COLOR_DARK,r as IDENTITY_TRANSFORM,extractIconPaths,extractPathData,normalizeArcFlags,parseHexColor,parseHexColorOrNull,parseIconTransform};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{ADWAITA_ICON_GRID as e,DEFAULT_ICON_COLOR as t,DEFAULT_ICON_COLOR_DARK as n,extractIconPaths as r,extractPathData as i}from"./icon-path.js";import{ImageSource as a,Screen as o}from"@nativescript/core";function renderSymbolicIcon(e,n){let i=android?.graphics,s=androidx?.core?.graphics?.PathParser;if(!i||!s)return null;let c=r(e);if(c.length===0)return null;let l=n?.size??16,u=o.mainScreen?.scale||1,d=Math.max(1,Math.round(l*u)),f=d/16,p=i.Bitmap.createBitmap(d,d,i.Bitmap.Config.ARGB_8888),m=new i.Canvas(p),h=i.Color.parseColor(n?.color??t),g=new i.Paint;g.setAntiAlias(!0),g.setStyle(i.Paint.Style.FILL);let _=!1;for(let{d:e,opacity:t}of c){let
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{ADWAITA_ICON_GRID as e,DEFAULT_ICON_COLOR as t,DEFAULT_ICON_COLOR_DARK as n,extractIconPaths as r,extractPathData as i}from"./icon-path.js";import{ImageSource as a,Screen as o}from"@nativescript/core";function renderSymbolicIcon(e,n){let i=android?.graphics,s=androidx?.core?.graphics?.PathParser;if(!i||!s)return null;let c=r(e);if(c.length===0)return null;let l=n?.size??16,u=o.mainScreen?.scale||1,d=Math.max(1,Math.round(l*u)),f=d/16,p=i.Bitmap.createBitmap(d,d,i.Bitmap.Config.ARGB_8888),m=new i.Canvas(p),h=i.Color.parseColor(n?.color??t),g=new i.Paint;g.setAntiAlias(!0),g.setStyle(i.Paint.Style.FILL);let _=!1;for(let{d:e,opacity:t,transform:n,fillRule:r,fill:a}of c){let o=null;try{o=s.createPathFromPathData(e)}catch{o=null}if(!o)continue;r===`evenodd`&&o.setFillType(i.Path.FillType.EVEN_ODD);let c=new i.Matrix;c.setValues([n[0],n[2],n[4],n[1],n[3],n[5],0,0,1]),c.postScale(f,f),o.transform(c);let l=h;if(a!==null)try{l=i.Color.parseColor(a)}catch{l=h}g.setColor(l),g.setAlpha(Math.round(255*t)),m.drawPath(o,g),_=!0}return _?new a(p):null}export{e as ADWAITA_ICON_GRID,t as DEFAULT_ICON_COLOR,n as DEFAULT_ICON_COLOR_DARK,r as extractIconPaths,i as extractPathData,renderSymbolicIcon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{ADWAITA_ICON_GRID as e,DEFAULT_ICON_COLOR as t,DEFAULT_ICON_COLOR_DARK as n,extractIconPaths as r,extractPathData as i,parseHexColor as a}from"./icon-path.js";import{parseSvgPath as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{ADWAITA_ICON_GRID as e,DEFAULT_ICON_COLOR as t,DEFAULT_ICON_COLOR_DARK as n,extractIconPaths as r,extractPathData as i,parseHexColor as a,parseHexColorOrNull as o}from"./icon-path.js";import{parseSvgPath as s}from"./svg-path.js";import{ImageSource as c,Screen as l}from"@nativescript/core";function renderSymbolicIcon(e,n){if(!UIBezierPath||!UIColor||!CGPointMake||!CGSizeMake||!CGAffineTransformMakeScale||!CGAffineTransformMake||!UIGraphicsBeginImageContextWithOptions||!UIGraphicsGetImageFromCurrentImageContext||!UIGraphicsEndImageContext)return null;let i=r(e);if(i.length===0)return null;let u=n?.size??16,d=l.mainScreen?.scale||1,f=u/16,{red:p,green:m,blue:h,alpha:g}=a(n?.color??t);UIGraphicsBeginImageContextWithOptions(CGSizeMake(u,u),!1,d);let _=!1;try{for(let{d:e,opacity:t,transform:n,fillRule:r,fill:a}of i){let i=s(e);if(i.length===0)continue;let c=UIBezierPath.bezierPath();for(let e of i)switch(e.type){case`M`:c.moveToPoint(CGPointMake(e.x,e.y));break;case`L`:c.addLineToPoint(CGPointMake(e.x,e.y));break;case`C`:c.addCurveToPointControlPoint1ControlPoint2(CGPointMake(e.x,e.y),CGPointMake(e.x1,e.y1),CGPointMake(e.x2,e.y2));break;case`Z`:c.closePath();break}r===`evenodd`&&(c.usesEvenOddFillRule=!0),c.applyTransform(CGAffineTransformMake(n[0],n[1],n[2],n[3],n[4],n[5])),c.applyTransform(CGAffineTransformMakeScale(f,f));let l=(a===null?null:o(a))??{red:p,green:m,blue:h,alpha:g};UIColor.colorWithRedGreenBlueAlpha(l.red,l.green,l.blue,l.alpha*t).setFill(),c.fill(),_=!0}if(!_)return null;let e=UIGraphicsGetImageFromCurrentImageContext();return e?new c(e):null}finally{UIGraphicsEndImageContext()}}export{e as ADWAITA_ICON_GRID,t as DEFAULT_ICON_COLOR,n as DEFAULT_ICON_COLOR_DARK,r as extractIconPaths,i as extractPathData,renderSymbolicIcon};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{resolveBuilderSlot as n}from"./builder-slots.js";import{appliesDerivedSidebarWidth as r,defaultSidebarWidthProps as i,normalizeWidthFraction as a,normalizeWidthProp as o,sidebarWidthFor as s}from"./split-view-width.js";import{splitViewColumns as c}from"./split-view-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=`notify::show-sidebar`,f=[`sidebar`,`content`];var AdwSplitViewBase=class extends l{_widthRule;_state;_sidebar=null;_content=null;_widthProps=i();_measuredWidth=0;_sidebarWidthOverride=null;constructor(e,t,n){super(),this._widthRule=t,this._state=n,this.className=e,this.addRow(new u(1,`star`)),this._state.bind({applyLayout:()=>this._applyLayout(),transitionSidebar:()=>this._transitionSidebar(),notifyShowSidebar:e=>this._emitShowSidebar(e)}),this.addEventListener(`layoutChanged`,()=>this._applySidebarWidth()),this._syncColumns()}_syncColumns(){this.removeColumns(),c(this._state.sidebarPosition,this.textDirection).sidebar===0?(this.addColumn(new u(1,`auto`)),this.addColumn(new u(1,`star`))):(this.addColumn(new u(1,`star`)),this.addColumn(new u(1,`auto`)))}_syncSidebarSide(e=this._sidebar){if(!e)return;let t=c(this._state.sidebarPosition,this.textDirection).sidebar===0,n=(e.className??``).split(` `).filter(e=>e&&e!==`adw-sidebar-at-visual-start`&&e!==`adw-sidebar-at-visual-end`);n.push(t?`adw-sidebar-at-visual-start`:`adw-sidebar-at-visual-end`),e.className=n.join(` `)}get textDirection(){return this.style?.direction===`rtl`?`rtl`:`ltr`}_emitShowSidebar(e){let t={eventName:d,object:this,showSidebar:e.showSidebar,collapsed:e.collapsed};this.notify(t)}_transitionSidebar(){this._applyLayout()}_pending=[];_shouldAnimate(){return typeof(this._sidebar??this._content??this).animate==`function`&&this.isLoaded===!0}_track(e){return this._pending.push(e),e}_cancelPending(){for(let e of this._pending)try{e.cancel()}catch{}this._pending=[]}_isChild(e){for(let t=0;t<this.getChildrenCount();t++)if(this.getChildAt(t)===e)return!0;return!1}setSidebar(e){this._sidebar&&this.removeChild(this._sidebar),this._sidebar=e,e&&(e.className=`${e.className??``} adw-split-view-sidebar`.trim(),this._syncSidebarSide(e),e.width=this.sidebarWidth,this.addChild(e)),this._state.setPaneMounted(`sidebar`,e!==null),this._applyLayout()}setContent(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-split-view-content`.trim(),this.addChild(e)),this._state.setPaneMounted(`content`,e!==null),this._applyLayout()}_addChildFromBuilder(e,t){n(e,f,`content`)===`sidebar`?this.setSidebar(t):this.setContent(t)}showSidebarPane(){this.showSidebar=!0}hideSidebarPane(){this.showSidebar=!1}get collapsed(){return this._state.collapsed}set collapsed(t){let n=e(t,this.collapsed);this._state.setCollapsed(!!n)}get showSidebar(){return this._state.showSidebar}set showSidebar(t){let n=e(t,this.showSidebar);this._state.setShowSidebar(!!n)}get sidebarWidth(){return this._sidebarWidthOverride??s(this._measuredWidth,this._widthProps,this._widthRule,{collapsed:this._state.collapsed})}set sidebarWidth(e){let n=t(e,this.sidebarWidth);this._sidebarWidthOverride=Number.isFinite(n)&&n>0?n:null,this._applySidebarWidth()}get minSidebarWidth(){return this._widthProps.minSidebarWidth}set minSidebarWidth(e){let n=t(e,this.minSidebarWidth);this._widthProps.minSidebarWidth=o(n,i().minSidebarWidth),this._applySidebarWidth()}get maxSidebarWidth(){return this._widthProps.maxSidebarWidth}set maxSidebarWidth(e){let n=t(e,this.maxSidebarWidth);this._widthProps.maxSidebarWidth=o(n,i().maxSidebarWidth),this._applySidebarWidth()}get sidebarWidthFraction(){return this._widthProps.sidebarWidthFraction}set sidebarWidthFraction(e){let n=t(e,this.sidebarWidthFraction);this._widthProps.sidebarWidthFraction=a(n),this._applySidebarWidth()}_applySidebarWidth(){let e=this.getActualSize?.();e&&e.width>0&&(this._measuredWidth=e.width),this._sidebar&&r(this._state.collapsed,this._widthRule)&&(this._sidebar.width=this.sidebarWidth)}get sidebarPosition(){return this._state.sidebarPosition}set sidebarPosition(e){this._state.setSidebarPosition(e===`end`?`end`:`start`)&&(this._syncColumns(),this._syncSidebarSide(),this._applyLayout())}get sidebar(){return this._sidebar}get content(){return this._content}};export{AdwSplitViewBase,d as NOTIFY_SHOW_SIDEBAR};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{applyViewSwitcherVisibility as r,createViewSwitcherState as i,nsIconSvg as a,switcherButtonVisible as o,viewSwitcherNotifyPayload as s,viewSwitcherPageSpecs as c}from"./view-switcher-model.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{buildViewSwitcherButtons as p}from"@gjsify/adwaita-core";const m=`notify::selected`;var AdwViewSwitcherBase=class extends l{_bar;_policy=`narrow`;_contentArea;_pages=[];_state=i();_nodes=[];get policy(){return this._policy}get switcherPolicy(){return this._policy}set switcherPolicy(e){let t=e===`wide`?`wide`:`narrow`;t!==this._policy&&(this._policy=t,this._applySelection(),this.notify({eventName:`notify::policy`,object:this}))}get buttonDisplayMode(){return`both`}constructor(e){super(),this.className=e,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`));let t=new l;t.horizontalAlignment=`stretch`,t.addRow(new u(1,`auto`)),l.setRow(t,0),this.addChild(t),this._bar=t;let n=new l;n.addColumn(new u(1,`star`)),n.addRow(new u(1,`star`)),l.setRow(n,1),this.addChild(n),this._contentArea=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:m,object:this,...s(e)};this.notify(t)})}_initClasses(){this._bar.className=this.barClass}setViews(e){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns();for(let e of this._pages)this._contentArea.removeChild(e.content);this._pages.length=0,this._pages.push(...e);for(let[e,t]of this._pages.entries())this._nodes.push(this._buildButton(e)),l.setColumn(t.content,0),l.setRow(t.content,0),this._contentArea.addChild(t.content);this._state.setPages(c(this._pages)),this._applySelection()}_buildButton(e){let r=new f;r.orientation=`horizontal`,r.className=this.buttonClass,r.horizontalAlignment=`center`;let i=new t;i.className=`${i.className} ${this.buttonClass}-icon`.trim(),i.verticalAlignment=`middle`,r.addChild(i);let a=new d;a.className=`${this.buttonClass}-label`,a.verticalAlignment=`middle`,r.addChild(a);let o=new d;return o.className=`${this.buttonClass}-badge`,o.verticalAlignment=`middle`,r.addChild(o),n(r),r.addEventListener(`tap`,()=>{this._state.setSelected(e)}),this._bar.addColumn(new u(1,`star`)),l.setColumn(r,e),l.setRow(r,0),this._bar.addChild(r),{button:r,icon:i,label:a,badge:o}}get switcherKind(){return`switcher`}_applySelection(){r(this._pages,this._state.selected);let e=this.buttonDisplayMode!==`labels`,t=this.buttonDisplayMode!==`icons`;p(this._state.pages,this._state.selected,this.policy).forEach((n,r)=>{let i=this._nodes[r];if(!i)return;let s=this._state.pages[r]?.visible??!1;i.button.visibility=o(this.switcherKind,n.visible,s)?`visible`:`collapse`,i.button.orientation=n.orientation===`horizontal`?`horizontal`:`vertical`,i.button.className=n.selected?`${this.buttonClass} active`:this.buttonClass,i.icon.icon=a(n.iconName),i.icon.visibility=e?`visible`:`collapse`,i.label.text=n.label,i.label.visibility=t?`visible`:`collapse`,i.badge.text=n.badgeLabel,i.badge.visibility=n.badgeLabel.length>0||n.needsAttention?`visible`:`collapse`,n.badgeLabel.length===0&&n.needsAttention?i.badge.className=`${this.buttonClass}-badge needs-attention`:i.badge.className=`${this.buttonClass}-badge`,i.button.accessibilityLabel=n.description||n.label})}get views(){return this._pages}set views(e){this.setViews(Array.isArray(e)?e:[])}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);this._state.setSelected(n)}get selectedName(){return this._state.selectedName}setPageVisible(e,t){let n=this._state.setPageVisible(e,t);return this._applySelection(),n}};export{AdwViewSwitcherBase,m as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";const e={top:0,bottom:0,left:0,right:0};function toolbarViewInsetPadding(e,t){return{topBarTop:t.hasTopBar?e.top:0,contentTop:t.hasTopBar?0:e.top,bottomBarBottom:t.hasBottomBar?e.bottom:0,contentBottom:t.hasBottomBar?0:e.bottom}}function normaliseInsets(e){let at=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:0;return{top:at(e?.top),bottom:at(e?.bottom),left:at(e?.left),right:at(e?.right)}}var WindowInsetsBroadcast=class{_listeners=new Set;_last=e;get last(){return this._last}subscribe(e){return this._listeners.add(e),e(this._last),()=>{this._listeners.delete(e)}}publish(e){let t=normaliseInsets(e);if(t.top===this._last.top&&t.bottom===this._last.bottom&&t.left===this._last.left&&t.right===this._last.right)return!1;this._last=t;for(let e of[...this._listeners])e(t);return!0}};export{e as NO_INSETS,WindowInsetsBroadcast,normaliseInsets,toolbarViewInsetPadding};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e={top:0,bottom:0,left:0,right:0},t={top:!1,bottom:!1};function insetsOwedBy(e,t){return{top:t.top?0:e.top,bottom:t.bottom?0:e.bottom,left:e.left,right:e.right}}function toolbarViewInsetPadding(e,t){return{topBarTop:t.hasTopBar?e.top:0,contentTop:t.hasTopBar?0:e.top,bottomBarBottom:t.hasBottomBar?e.bottom:0,contentBottom:t.hasBottomBar?0:e.bottom}}function normaliseInsets(e){let at=e=>typeof e==`number`&&Number.isFinite(e)&&e>0?e:0;return{top:at(e?.top),bottom:at(e?.bottom),left:at(e?.left),right:at(e?.right)}}var WindowInsetsBroadcast=class{_listeners=new Set;_last=e;get last(){return this._last}subscribe(e){return this._listeners.add(e),e(this._last),()=>{this._listeners.delete(e)}}publish(e){let t=normaliseInsets(e);if(t.top===this._last.top&&t.bottom===this._last.bottom&&t.left===this._last.left&&t.right===this._last.right)return!1;this._last=t;for(let e of[...this._listeners])e(t);return!0}};export{t as NO_HOST_PAYMENT,e as NO_INSETS,WindowInsetsBroadcast,insetsOwedBy,normaliseInsets,toolbarViewInsetPadding};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";function xmlNumber(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`)return t;let n=e.trim();if(n===``)return t;let r=Number(n);return Number.isFinite(r)?r:t}function xmlBoolean(e,t){if(typeof e==`boolean`)return e;if(typeof e!=`string`)return t;let n=e.trim().toLowerCase();return n===`true`?!0:n===`false`?!1:t}export{xmlBoolean,xmlNumber};
|
|
@@ -38,6 +38,20 @@ export declare class AdwActionRow extends GridLayout {
|
|
|
38
38
|
/** Install a suffix widget in column 2. Replaces any previous one; `null` clears. */
|
|
39
39
|
setSuffix(view: View | null): void;
|
|
40
40
|
get suffix(): View | null;
|
|
41
|
+
/**
|
|
42
|
+
* An XML child goes to a named edge, and a bare one to the SUFFIX.
|
|
43
|
+
*
|
|
44
|
+
* The fallback is libadwaita's: `AdwActionRow`'s buildable adds an untyped child
|
|
45
|
+
* with `adw_action_row_add_suffix`. Without this override, `LayoutBase`'s default
|
|
46
|
+
* `addChild` drops the child into the grid with no `adw-row-prefix` /
|
|
47
|
+
* `adw-row-suffix` class and no column, so it lands on top of the title.
|
|
48
|
+
*
|
|
49
|
+
* The subclasses inherit it, and that is deliberate but sharp-edged: a switch row
|
|
50
|
+
* builds its own `Switch` as the suffix in its constructor, and `setSuffix`
|
|
51
|
+
* REPLACES. An explicit `<AdwSwitchRow.suffix>` therefore takes the switch's
|
|
52
|
+
* place, which is what "set the suffix" has to mean.
|
|
53
|
+
*/
|
|
54
|
+
_addChildFromBuilder(name: string, view: View): void;
|
|
41
55
|
/** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
|
|
42
56
|
get activatableWidget(): View | null;
|
|
43
57
|
/**
|
|
@@ -53,7 +67,7 @@ export declare class AdwActionRow extends GridLayout {
|
|
|
53
67
|
syncActivatableWidgetSensitivity(): void;
|
|
54
68
|
/** `GtkListBoxRow:activatable` — whether a tap activates this row at all. */
|
|
55
69
|
get activatable(): boolean;
|
|
56
|
-
set activatable(value: boolean);
|
|
70
|
+
set activatable(value: boolean | string);
|
|
57
71
|
/**
|
|
58
72
|
* `adw_action_row_activate`: forward to the activatable widget, then emit
|
|
59
73
|
* `activated`. A no-op while unactivatable, because a tap on a non-activatable
|
|
@@ -21,7 +21,7 @@ export declare class AdwBanner extends GridLayout {
|
|
|
21
21
|
* closer to what GTK paints than the raw tags would be.
|
|
22
22
|
*/
|
|
23
23
|
get useMarkup(): boolean;
|
|
24
|
-
set useMarkup(value: boolean);
|
|
24
|
+
set useMarkup(value: boolean | string);
|
|
25
25
|
/**
|
|
26
26
|
* The action button label. A non-empty value adds the button to the tree;
|
|
27
27
|
* empty or `null` removes it, matching `label && label[0]` (:663).
|
|
@@ -39,6 +39,6 @@ export declare class AdwBanner extends GridLayout {
|
|
|
39
39
|
set buttonStyle(value: AdwBannerButtonStyle);
|
|
40
40
|
/** Whether the banner is shown. Defaults to FALSE (:456-459). */
|
|
41
41
|
get revealed(): boolean;
|
|
42
|
-
set revealed(value: boolean);
|
|
42
|
+
set revealed(value: boolean | string);
|
|
43
43
|
private _renderTitle;
|
|
44
44
|
}
|
|
@@ -16,6 +16,24 @@ export declare class AdwBottomSheet extends GridLayout {
|
|
|
16
16
|
setContent(view: View | null): void;
|
|
17
17
|
/** Set (or replace) the sheet panel's child (shown when open). */
|
|
18
18
|
setSheet(view: View | null): void;
|
|
19
|
+
/**
|
|
20
|
+
* An XML child asks for the sheet or for the content, and a bare one is CONTENT —
|
|
21
|
+
* the always-visible layer, which is what a sheet with nothing behind it would be
|
|
22
|
+
* missing. `LayoutBase`'s inherited default would put either into the grid
|
|
23
|
+
* alongside the sheet panel, where it neither paints under the sheet nor moves
|
|
24
|
+
* with it.
|
|
25
|
+
*/
|
|
26
|
+
_addChildFromBuilder(name: string, view: View): void;
|
|
27
|
+
/**
|
|
28
|
+
* The always-visible content layer, or `null`.
|
|
29
|
+
*
|
|
30
|
+
* A read-back for `setContent`: a write-only pane cannot be asserted, and the XML
|
|
31
|
+
* door made that concrete — the gallery probe has to ask the widget where the
|
|
32
|
+
* child it declared actually went.
|
|
33
|
+
*/
|
|
34
|
+
get content(): View | null;
|
|
35
|
+
/** The sheet panel's child, or `null` — the read-back for `setSheet`. */
|
|
36
|
+
get sheet(): View | null;
|
|
19
37
|
/** Open the sheet programmatically. */
|
|
20
38
|
open(): void;
|
|
21
39
|
/**
|
|
@@ -25,13 +43,13 @@ export declare class AdwBottomSheet extends GridLayout {
|
|
|
25
43
|
close(): void;
|
|
26
44
|
/** Whether the sheet is open. Toggling shows/hides the panel + emits `notify::open`. */
|
|
27
45
|
get openState(): boolean;
|
|
28
|
-
set openState(value: boolean);
|
|
46
|
+
set openState(value: boolean | string);
|
|
29
47
|
/**
|
|
30
48
|
* Whether the user may dismiss the sheet (`AdwBottomSheet:can-close`). When
|
|
31
49
|
* off, a refused dismissal emits `close-attempt` instead of closing.
|
|
32
50
|
*/
|
|
33
51
|
get canClose(): boolean;
|
|
34
|
-
set canClose(
|
|
52
|
+
set canClose(raw: boolean | string);
|
|
35
53
|
/**
|
|
36
54
|
* Route a dismissal affordance through the shared gate and act on the
|
|
37
55
|
* verdict: close, emit `close-attempt`, emit `sheet.close` for the host to
|
|
@@ -41,7 +41,7 @@ export declare class AdwButtonContent extends StackLayout {
|
|
|
41
41
|
* Defaults to FALSE (:253-256), so an underscore is a literal unless asked.
|
|
42
42
|
*/
|
|
43
43
|
get useUnderline(): boolean;
|
|
44
|
-
set useUnderline(
|
|
44
|
+
set useUnderline(raw: boolean | string);
|
|
45
45
|
/**
|
|
46
46
|
* Whether the label may be smaller than its natural size (:489-491).
|
|
47
47
|
*
|
|
@@ -51,7 +51,7 @@ export declare class AdwButtonContent extends StackLayout {
|
|
|
51
51
|
* but the truncation ellipsis is not available on this platform.
|
|
52
52
|
*/
|
|
53
53
|
get canShrink(): boolean;
|
|
54
|
-
set canShrink(
|
|
54
|
+
set canShrink(raw: boolean | string);
|
|
55
55
|
/** The label's `PangoEllipsizeMode` for the current `canShrink` (:462). */
|
|
56
56
|
get ellipsize(): ButtonContentEllipsize;
|
|
57
57
|
private _renderLabel;
|
|
@@ -33,6 +33,15 @@ export declare class AdwCarousel extends GridLayout {
|
|
|
33
33
|
constructor();
|
|
34
34
|
/** Append a page — `adw_carousel_append` (adw-carousel.c:1348-1357). */
|
|
35
35
|
addPage(view: View): void;
|
|
36
|
+
/**
|
|
37
|
+
* An XML child is a PAGE, appended in document order.
|
|
38
|
+
*
|
|
39
|
+
* The name is ignored: a carousel has one kind of child. Without this,
|
|
40
|
+
* `LayoutBase`'s default puts the view straight into the grid the carousel builds
|
|
41
|
+
* its scroller and dots in — on top of the track rather than on it, and the page
|
|
42
|
+
* never gets a width, a `adw-carousel-page` class or a dot.
|
|
43
|
+
*/
|
|
44
|
+
_addChildFromBuilder(_name: string, view: View): void;
|
|
36
45
|
/**
|
|
37
46
|
* Insert a page at `position` — `adw_carousel_insert` (adw-carousel.c:1370-1407).
|
|
38
47
|
* `-1` or a position past the end appends. Returns whether it was added.
|
|
@@ -51,6 +60,8 @@ export declare class AdwCarousel extends GridLayout {
|
|
|
51
60
|
scrollToPage(index: number): void;
|
|
52
61
|
/** One keynav step — `navigate_to_direction` (adw-carousel.c:475-508). */
|
|
53
62
|
navigate(direction: 'back' | 'forward'): boolean;
|
|
63
|
+
/** The pages on the track, in order — the read-back for `addPage`/`insertPage`. */
|
|
64
|
+
get pages(): readonly View[];
|
|
54
65
|
/** The number of pages. */
|
|
55
66
|
get nPages(): number;
|
|
56
67
|
/** The fractional scroll position; 1 matches 1 page. */
|
|
@@ -63,19 +74,19 @@ export declare class AdwCarousel extends GridLayout {
|
|
|
63
74
|
* `get_page_at_position` rule used everywhere else, so 0.5 lands on page 0
|
|
64
75
|
* where the old `Math.round` picked page 1.
|
|
65
76
|
*/
|
|
66
|
-
set position(
|
|
77
|
+
set position(raw: number | string);
|
|
67
78
|
/** The page the current position settles on, `-1` when the carousel is empty. */
|
|
68
79
|
get currentPage(): number;
|
|
69
80
|
/** Whether the carousel can be navigated (`AdwCarousel:interactive`, default TRUE). */
|
|
70
81
|
get interactive(): boolean;
|
|
71
|
-
set interactive(
|
|
82
|
+
set interactive(raw: boolean | string);
|
|
72
83
|
/**
|
|
73
84
|
* The per-page width in DIPs used for scroll-offset math. Set this to the
|
|
74
85
|
* carousel's on-screen width so `scrollToPage` lands cleanly. Re-applies to
|
|
75
86
|
* all existing pages.
|
|
76
87
|
*/
|
|
77
88
|
get pageWidth(): number;
|
|
78
|
-
set pageWidth(
|
|
89
|
+
set pageWidth(raw: number | string);
|
|
79
90
|
/** The px pitch between two page origins — `self->distance` (adw-carousel.c:767). */
|
|
80
91
|
private _distance;
|
|
81
92
|
/** The state's id for a page view, or `null` when it is not one of ours. */
|
|
@@ -11,9 +11,20 @@ export declare class AdwClamp extends GridLayout {
|
|
|
11
11
|
setChild(view: View | null): void;
|
|
12
12
|
/** The currently-clamped child, or `null`. */
|
|
13
13
|
get child(): View | null;
|
|
14
|
+
/**
|
|
15
|
+
* XML inflation — every child a template declares is THE clamped child.
|
|
16
|
+
*
|
|
17
|
+
* Without this the `LayoutBase` default calls `addChild`, which puts the view
|
|
18
|
+
* in the grid and leaves `_child` null, so `_allocate` returns early: measured
|
|
19
|
+
* on Android, a clamp written in markup rendered its child at full width with
|
|
20
|
+
* no size class at all, i.e. as if there were no clamp around it. The name is
|
|
21
|
+
* ignored because there is only one destination — `<AdwClamp.child>` and a
|
|
22
|
+
* bare child mean the same thing.
|
|
23
|
+
*/
|
|
24
|
+
_addChildFromBuilder(_name: string, view: View): void;
|
|
14
25
|
/** `Adw.Clamp:maximum-size` — the widest the child may ever get, in DIPs. */
|
|
15
26
|
get maximumSize(): number;
|
|
16
|
-
set maximumSize(value: number);
|
|
27
|
+
set maximumSize(value: number | string);
|
|
17
28
|
/**
|
|
18
29
|
* `Adw.Clamp:tightening-threshold` — the width above which the clamp starts
|
|
19
30
|
* tightening its grip, easing the child toward {@link maximumSize} instead of
|
|
@@ -21,7 +32,7 @@ export declare class AdwClamp extends GridLayout {
|
|
|
21
32
|
* only the GTK pane responded to it.
|
|
22
33
|
*/
|
|
23
34
|
get tighteningThreshold(): number;
|
|
24
|
-
set tighteningThreshold(value: number);
|
|
35
|
+
set tighteningThreshold(value: number | string);
|
|
25
36
|
/**
|
|
26
37
|
* Re-run libadwaita's allocation against the container's current width.
|
|
27
38
|
*
|
|
@@ -37,7 +37,7 @@ export declare class AdwComboRow extends AdwActionRow {
|
|
|
37
37
|
set options(value: AdwComboOption[]);
|
|
38
38
|
/** The selected option index. Updates the inline value label. */
|
|
39
39
|
get selectedIndex(): number;
|
|
40
|
-
set selectedIndex(
|
|
40
|
+
set selectedIndex(raw: number | string);
|
|
41
41
|
/** The selected option's `value`, or `''` when out of range. */
|
|
42
42
|
get selectedValue(): string;
|
|
43
43
|
set selectedValue(value: string);
|
|
@@ -35,7 +35,7 @@ export declare class AdwDataGrid extends GridLayout {
|
|
|
35
35
|
* `interactive` class and answer a tap, and nothing about the layout.
|
|
36
36
|
*/
|
|
37
37
|
get interactive(): boolean;
|
|
38
|
-
set interactive(
|
|
38
|
+
set interactive(raw: boolean | string);
|
|
39
39
|
private _render;
|
|
40
40
|
/**
|
|
41
41
|
* (Re)declare the column tracks from the descriptors.
|
|
@@ -29,7 +29,7 @@ export declare class AdwDropDown extends StackLayout {
|
|
|
29
29
|
set options(value: AdwComboOption[]);
|
|
30
30
|
/** The selected option index (`Gtk.DropDown:selected`). */
|
|
31
31
|
get selected(): number;
|
|
32
|
-
set selected(
|
|
32
|
+
set selected(raw: number | string);
|
|
33
33
|
/** The selected option's `value`, or `''` when out of range. */
|
|
34
34
|
get selectedValue(): string;
|
|
35
35
|
set selectedValue(value: string);
|
|
@@ -60,16 +60,16 @@ export declare class AdwEntryRow extends AdwActionRow {
|
|
|
60
60
|
get textLength(): number;
|
|
61
61
|
/** `Adw.EntryRow:max-length` — maximum number of characters, `0` = unlimited. */
|
|
62
62
|
get maxLength(): number;
|
|
63
|
-
set maxLength(
|
|
63
|
+
set maxLength(raw: number | string);
|
|
64
64
|
/** Whether the entry accepts edits (`GtkEditable:editable`). */
|
|
65
65
|
get editable(): boolean;
|
|
66
|
-
set editable(
|
|
66
|
+
set editable(raw: boolean | string);
|
|
67
67
|
/** `Adw.EntryRow:show-apply-button` — typing reveals an apply button. */
|
|
68
68
|
get showApplyButton(): boolean;
|
|
69
|
-
set showApplyButton(
|
|
69
|
+
set showApplyButton(raw: boolean | string);
|
|
70
70
|
/** `Adw.EntryRow:activates-default` — reported on `entry-activated`, acted on by the host. */
|
|
71
71
|
get activatesDefault(): boolean;
|
|
72
|
-
set activatesDefault(
|
|
72
|
+
set activatesDefault(raw: boolean | string);
|
|
73
73
|
/** Whether the field currently has focus. */
|
|
74
74
|
get editing(): boolean;
|
|
75
75
|
/** Append a suffix — `adw_entry_row_add_suffix` appends into a BOX, so suffixes COEXIST. */
|
|
@@ -31,13 +31,13 @@ export declare class AdwEntry extends GridLayout {
|
|
|
31
31
|
get textLength(): number;
|
|
32
32
|
/** Maximum number of characters, `0` = unlimited. */
|
|
33
33
|
get maxLength(): number;
|
|
34
|
-
set maxLength(
|
|
34
|
+
set maxLength(raw: number | string);
|
|
35
35
|
/** Placeholder shown while the entry is empty (`Gtk.Entry:placeholder-text`). */
|
|
36
36
|
get placeholder(): string;
|
|
37
37
|
set placeholder(value: string);
|
|
38
38
|
/** Whether the entry accepts edits (`GtkEditable:editable`). */
|
|
39
39
|
get editable(): boolean;
|
|
40
|
-
set editable(
|
|
40
|
+
set editable(raw: boolean | string);
|
|
41
41
|
/** The inner `TextField` — for focus, selection and host-specific keyboard options. */
|
|
42
42
|
get field(): TextField;
|
|
43
43
|
}
|
|
@@ -25,7 +25,26 @@ export declare class AdwExpanderRow extends AdwActionRow {
|
|
|
25
25
|
addRow(viewOrSpec: View | ItemSpec): void;
|
|
26
26
|
/** Remove a previously-added child row from the disclosure container. */
|
|
27
27
|
removeRow(view: View): void;
|
|
28
|
+
/**
|
|
29
|
+
* An XML child is a ROW inside the disclosure — the one placement an expander row
|
|
30
|
+
* adds over its base, and the reason this overrides `AdwActionRow`'s prefix/suffix
|
|
31
|
+
* rule rather than inheriting it. The two edges stay reachable by name.
|
|
32
|
+
*/
|
|
33
|
+
_addChildFromBuilder(name: string, view: View): void;
|
|
34
|
+
/**
|
|
35
|
+
* The rows inside the disclosure, in order — the read-back for `addRow`.
|
|
36
|
+
*
|
|
37
|
+
* NOT `rows`, which is what it was called first. `GridLayoutBase` declares `rows`
|
|
38
|
+
* as a SETTER-ONLY accessor (its getter is `rowsInternal`), so a getter of that
|
|
39
|
+
* name on a subclass shadows it: `expanderRow.rows = 'auto,*'` then throws
|
|
40
|
+
* `TypeError: Cannot set property rows … which has only a getter` in strict mode,
|
|
41
|
+
* which every NativeScript bundle is. Measured against that prototype shape, and
|
|
42
|
+
* it would have broken apps that never touch XML. `rows` and `columns` are the
|
|
43
|
+
* only two accessors of that shape on the bases this package extends —
|
|
44
|
+
* `scripts/check-nativescript-accessor-shadowing.mjs` holds both.
|
|
45
|
+
*/
|
|
46
|
+
get disclosureRows(): readonly View[];
|
|
28
47
|
/** Whether the disclosure is revealed. */
|
|
29
48
|
get expanded(): boolean;
|
|
30
|
-
set expanded(value: boolean);
|
|
49
|
+
set expanded(value: boolean | string);
|
|
31
50
|
}
|
|
@@ -19,7 +19,7 @@ export declare class AdwHeaderBar extends GridLayout {
|
|
|
19
19
|
* matching `Adw.HeaderBar`'s `.flat` style. Toggling swaps the `flat` class.
|
|
20
20
|
*/
|
|
21
21
|
get flat(): boolean;
|
|
22
|
-
set flat(
|
|
22
|
+
set flat(raw: boolean | string);
|
|
23
23
|
/** Pack a widget at the start (left) of the bar — `gtk_box_append`. */
|
|
24
24
|
packStart(view: View): void;
|
|
25
25
|
/**
|
|
@@ -35,6 +35,18 @@ export declare class AdwHeaderBar extends GridLayout {
|
|
|
35
35
|
packEnd(view: View): void;
|
|
36
36
|
/** Replace the centered title widget with a custom one (e.g. a URL entry). */
|
|
37
37
|
setTitleWidget(view: View): void;
|
|
38
|
+
/**
|
|
39
|
+
* XML inflation — route a template's child through the packing API.
|
|
40
|
+
*
|
|
41
|
+
* NativeScript spells a slot as a complex property, so `<AdwHeaderBar.endBox>`
|
|
42
|
+
* arrives here as `endBox`; a bare child arrives under its element name and
|
|
43
|
+
* takes the fallback, `packStart`. Without this the `GridLayout` default added
|
|
44
|
+
* the view straight to the grid at column 0: measured on Android, a header bar
|
|
45
|
+
* written in markup left `startBox` and `endBox` empty while the button still
|
|
46
|
+
* appeared, so it LOOKED packed and was not — a second one would have been
|
|
47
|
+
* drawn on top of the first rather than beside it.
|
|
48
|
+
*/
|
|
49
|
+
_addChildFromBuilder(name: string, view: View): void;
|
|
38
50
|
/** The centered title widget. */
|
|
39
51
|
get titleWidget(): View;
|
|
40
52
|
/** The start (left) slot container. */
|
|
@@ -23,7 +23,7 @@ export declare class AdwImageButton extends GridLayout {
|
|
|
23
23
|
set iconColor(value: string);
|
|
24
24
|
/** The icon size in DIPs (default 16). Re-renders + resizes the image box. */
|
|
25
25
|
get iconSize(): number;
|
|
26
|
-
set iconSize(
|
|
26
|
+
set iconSize(raw: number | string);
|
|
27
27
|
/** The underlying icon {@link Image} (e.g. to tweak alignment). */
|
|
28
28
|
get image(): Image;
|
|
29
29
|
}
|
|
@@ -29,5 +29,5 @@ export declare class AdwNavigationSplitView extends AdwSplitViewBase<NsNavigatio
|
|
|
29
29
|
pop(): NavigationActionResult;
|
|
30
30
|
/** `Adw.NavigationSplitView:show-content`, the C's own spelling of the flag. */
|
|
31
31
|
get showContent(): boolean;
|
|
32
|
-
set showContent(
|
|
32
|
+
set showContent(raw: boolean | string);
|
|
33
33
|
}
|
|
@@ -22,6 +22,17 @@ export declare class AdwNavigationView extends GridLayout {
|
|
|
22
22
|
* which also re-arms after `replace([])`.
|
|
23
23
|
*/
|
|
24
24
|
add(view: View, tag?: string | null, options?: Omit<AdwNavigationPageProps, 'tag'>): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* An XML child is a PAGE, registered in document order — so the first one is
|
|
27
|
+
* pushed and the rest wait behind it, exactly as `add` already promises.
|
|
28
|
+
*
|
|
29
|
+
* Registered with NO TAG: `add(view)` defaults it to `null`, and nothing in the
|
|
30
|
+
* markup can supply one, because a `tag` is this widget's own idea rather than a
|
|
31
|
+
* property of the child. `pushByTag` is therefore not reachable for a page that
|
|
32
|
+
* came from a template; a loader that wants it registers the page itself, or
|
|
33
|
+
* calls `setPageTag` on one it looked up. What XML contributes is the tree.
|
|
34
|
+
*/
|
|
35
|
+
_addChildFromBuilder(_name: string, view: View): void;
|
|
25
36
|
/**
|
|
26
37
|
* Remove a page (`AdwNavigationView.remove`). One that is on the stack is
|
|
27
38
|
* removed once it is POPPED. Named `removePage` rather than `remove` so the
|
|
@@ -80,9 +91,9 @@ export declare class AdwNavigationView extends GridLayout {
|
|
|
80
91
|
* subset has no transition, so the swap is instant either way.
|
|
81
92
|
*/
|
|
82
93
|
get animateTransitions(): boolean;
|
|
83
|
-
set animateTransitions(
|
|
94
|
+
set animateTransitions(raw: boolean | string);
|
|
84
95
|
/** `Adw.NavigationView:pop-on-escape` — consulted by {@link popFromEscape}. */
|
|
85
96
|
get popOnEscape(): boolean;
|
|
86
|
-
set popOnEscape(
|
|
97
|
+
set popOnEscape(raw: boolean | string);
|
|
87
98
|
private _emit;
|
|
88
99
|
}
|
|
@@ -10,7 +10,7 @@ export declare class AdwOverlaySplitView extends AdwSplitViewBase<NsOverlaySplit
|
|
|
10
10
|
* default FALSE) — whether collapsing leaves the sidebar's visibility alone.
|
|
11
11
|
*/
|
|
12
12
|
get pinSidebar(): boolean;
|
|
13
|
-
set pinSidebar(
|
|
13
|
+
set pinSidebar(raw: boolean | string);
|
|
14
14
|
protected _applyLayout(): void;
|
|
15
15
|
/** Animate a collapsed show/hide toggle; fall back to instant off-screen/off-device. */
|
|
16
16
|
protected _transitionSidebar(): void;
|
|
@@ -18,14 +18,14 @@ export declare class AdwPasswordEntryRow extends AdwEntryRow {
|
|
|
18
18
|
constructor();
|
|
19
19
|
/** Whether the contents are shown in clear text (`GtkText:visibility`). */
|
|
20
20
|
get revealed(): boolean;
|
|
21
|
-
set revealed(value: boolean);
|
|
21
|
+
set revealed(value: boolean | string);
|
|
22
22
|
/**
|
|
23
23
|
* Legacy spelling of {@link revealed}. The web port called it `revealed`, this
|
|
24
24
|
* one called it `peeking`, and neither name is in the C — kept so existing
|
|
25
25
|
* NativeScript callers keep working while `revealed` is the shared name.
|
|
26
26
|
*/
|
|
27
27
|
get peeking(): boolean;
|
|
28
|
-
set peeking(value: boolean);
|
|
28
|
+
set peeking(value: boolean | string);
|
|
29
29
|
/** Flip masked↔revealed — `show_text_clicked_cb` (C:90-97). */
|
|
30
30
|
togglePeek(): boolean;
|
|
31
31
|
/** Whether Caps Lock is engaged, as last reported by the host. */
|