@gjsify/adwaita-nativescript 0.44.0 → 0.46.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/index.js +1 -1
- package/lib/esm/namespace.js +1 -0
- 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-button-row.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-entry-row.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/entry-row-view.js +1 -1
- package/lib/esm/widgets/{adw-button.js → gtk-button.js} +1 -1
- package/lib/esm/widgets/gtk-drop-down.js +1 -0
- package/lib/esm/widgets/gtk-entry.js +1 -0
- package/lib/esm/widgets/{adw-menu-button.js → gtk-menu-button.js} +1 -1
- 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/index.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/wrap-box-layout.js +1 -1
- package/lib/esm/widgets/xml-values.js +1 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/namespace.d.ts +92 -0
- package/lib/types/widgets/adw-about-dialog.d.ts +1 -1
- package/lib/types/widgets/adw-action-row.d.ts +17 -2
- 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 +22 -3
- package/lib/types/widgets/adw-button-content.d.ts +4 -4
- package/lib/types/widgets/adw-button-row.d.ts +4 -4
- package/lib/types/widgets/adw-carousel.d.ts +16 -4
- package/lib/types/widgets/adw-clamp.d.ts +15 -3
- package/lib/types/widgets/adw-combo-row.d.ts +3 -3
- package/lib/types/widgets/adw-data-grid.d.ts +1 -1
- package/lib/types/widgets/adw-entry-row.d.ts +4 -4
- package/lib/types/widgets/adw-expander-row.d.ts +22 -2
- package/lib/types/widgets/adw-header-bar.d.ts +15 -2
- package/lib/types/widgets/adw-icon.d.ts +3 -3
- package/lib/types/widgets/adw-image-button.d.ts +3 -3
- 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 +9 -2
- package/lib/types/widgets/adw-preferences-group.d.ts +13 -1
- package/lib/types/widgets/adw-preferences-page.d.ts +9 -2
- 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 +23 -7
- package/lib/types/widgets/adw-status-page.d.ts +11 -3
- 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-toast-overlay.d.ts +2 -1
- package/lib/types/widgets/adw-toggle-group.d.ts +2 -2
- package/lib/types/widgets/adw-toolbar-view.d.ts +22 -4
- package/lib/types/widgets/adw-view-stack.d.ts +3 -2
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +2 -2
- 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/entry-row-view.d.ts +1 -1
- package/lib/types/widgets/{adw-button.d.ts → gtk-button.d.ts} +7 -2
- package/lib/types/widgets/{adw-drop-down.d.ts → gtk-drop-down.d.ts} +4 -4
- package/lib/types/widgets/{adw-entry.d.ts → gtk-entry.d.ts} +6 -6
- package/lib/types/widgets/{adw-menu-button.d.ts → gtk-menu-button.d.ts} +3 -3
- 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 +21 -14
- package/lib/types/widgets/split-button.d.ts +2 -2
- 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/wrap-box-layout.d.ts +3 -60
- package/lib/types/widgets/xml-values.d.ts +18 -0
- package/package.json +11 -8
- package/lib/esm/widgets/adw-drop-down.js +0 -1
- package/lib/esm/widgets/adw-entry.js +0 -1
|
@@ -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{AdwIcon as n}from"./adw-icon.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwImageButton as i}from"./adw-image-button.js";import{applyTabViewVisibility as a,createTabViewState as o,tabBarVisibility as s,tabCloseVisibilities as c,tabLabelText as l,tabViewNotifyPayload as u}from"./tab-view-state.js";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";import{tabIconState as h}from"@gjsify/adwaita-core";import{windowCloseSymbolic as g}from"@gjsify/adwaita-icons/ui";const _=`notify::selected-page`,v=`pages-changed`,y=`close-page`;var AdwTabView=class extends d{_state=o({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(){super(),this.className=`adw-tab-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`)),this.addRow(new f(1,`star`));let e=new m;e.orientation=`horizontal`,e.horizontalAlignment=`stretch`,e.className=`adw-tab-view-bar`,d.setRow(e,0),this.addChild(e),this._bar=e;let t=new d;t.addColumn(new f(1,`star`)),t.addRow(new f(1,`star`)),d.setRow(t,1),this.addChild(t),this._contentArea=t,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:_,object:this,...u(e)};this.notify(t)})}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selected(){return this._state.selectedIndex}set selected(e){let n=t(e,this.selected);this._state.selectNthPage(n)}isClosing(e){return this._state.isClosing(e)}setSelectedPage(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}selectPreviousPage(){return this._state.selectPreviousPage()}selectNextPage(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}addPage(e,t=null){return this._state.addPage(e,t)}insertPage(e,t){return this._state.insertPage(e,t)}prependPage(e){return this._state.prependPage(e)}appendPage(e){return this._state.appendPage(e)}insertPinnedPage(e,t){return this._state.insertPinnedPage(e,t)}prependPinnedPage(e){return this._state.prependPinnedPage(e)}appendPinnedPage(e){return this._state.appendPinnedPage(e)}setPagePinned(e,t){return this._state.setPagePinned(e,t)}closePage(e){return this._state.closePage(e)}closePageFinish(e,t){return this._state.closePageFinish(e,t)}closeOtherPages(e){this._state.closeOtherPages(e)}closePagesBefore(e){this._state.closePagesBefore(e)}closePagesAfter(e){this._state.closePagesAfter(e)}detachPage(e){return this._state.detachPage(e)}reorderPage(e,t){return this._state.reorderPage(e,t)}reorderBackward(e){return this._state.reorderBackward(e)}reorderForward(e){return this._state.reorderForward(e)}reorderFirst(e){return this._state.reorderFirst(e)}reorderLast(e){return this._state.reorderLast(e)}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:v,object:this,...e};this.notify(t)}_insertChip(e,t){let a=new m;a.orientation=`horizontal`,a.className=`adw-tab-view-tab`,a.verticalAlignment=`middle`;let o=new n;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,a.addChild(o);let s=new n;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,a.addChild(s);let c=new p;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,a.addChild(c);let l=new i;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=g,l.iconSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),a.addChild(l),r(a),a.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(a,t),this._chips.set(e.id,{button:a,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(d.setColumn(u,0),d.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=l(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=h(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){a(this._state);let e=c(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=s(this._state,this._autohide)}_requestClose(e){let t={eventName:y,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,y as CLOSE_PAGE,_ as NOTIFY_SELECTED_PAGE,v as PAGES_CHANGED};
|
|
@@ -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{Label as n,StackLayout as r}from"@nativescript/core";import{ToggleGroupState as i,ToggleGroupState as a}from"@gjsify/adwaita-core";const o=`notify::selected`;var AdwToggleGroup=class extends r{_toggles=[];_segments=[];_state=new a;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:o,object:this,selected:e.selected,value:e.value};this.notify(t)})}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=Array.isArray(e)?e:[],this._toggles.forEach((e,i)=>{let a=new r;if(a.orientation=`horizontal`,a.className=`adw-toggle-button`,a.horizontalAlignment=`center`,e.icon){let n=new t;n.className=`${n.className} adw-toggle-icon`.trim(),n.verticalAlignment=`middle`,n.iconName=e.icon,a.addChild(n)}let o=new n;o.text=e.label,o.className=`adw-toggle-label`,o.verticalAlignment=`middle`,a.addChild(o),a.addEventListener(`tap`,()=>{this._state.setSelected(i)}),this.addChild(a),this._segments.push(a)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);this._state.setSelected(n)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,o as NOTIFY_SELECTED,i as ToggleGroupState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{defaultToolbarViewProps as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{defaultToolbarViewProps as n,toolbarViewClassNames as r}from"./chrome.js";import{NO_INSETS as i,insetsOwedBy as a,toolbarViewInsetPadding as o}from"./window-insets.js";import{resolveHostInsets as s}from"./host-insets.js";import{observeWindowInsets as c}from"./window-insets-source.js";import{GridLayout as l,ItemSpec as u,StackLayout as d}from"@nativescript/core";const f={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},p=[`topBar`,`bottomBar`,`content`];var AdwToolbarView=class extends l{_topBox;_bottomBox;_content=null;_props=n();_insets=i;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(){super(),this.className=f.view,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`)),this.addRow(new u(1,`auto`));let e=new d;e.orientation=`vertical`,e.className=f.topBar,l.setRow(e,0),this.addChild(e),this._topBox=e;let t=new d;t.orientation=`vertical`,t.className=f.bottomBar,l.setRow(t,2),this.addChild(t),this._bottomBox=t,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=c(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null})}addTopBar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}addBottomBar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}setContent(e){this._content&&=(this.removeChild(this._content),null),e&&(l.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,p,`content`)){case`topBar`:this.addTopBar(n);return;case`bottomBar`:this.addBottomBar(n);return;default:this.setContent(n)}}get content(){return this._content}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(t){let n=e(t,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!n,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(t){let n=e(t,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!n,this._applyBarPlacement()}_applyBarPlacement(){l.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,l.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_applyInsets(e){this._insets=e;let t=o(a(e,s(this,e)),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=r({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==t.view&&(this.className=t.view),this._topBox.className!==t.topBar&&(this._topBox.className=t.topBar),this._bottomBox.className!==t.bottomBar&&(this._bottomBox.className=t.bottomBar)}};export{AdwToolbarView};
|
|
@@ -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.iconName=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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{viewConcealSymbolic as e,viewRevealSymbolic as t}from"@gjsify/adwaita-icons/actions";const n=`adw-row adw-action-row adw-entry-row`,r=`${n} adw-password-entry-row`,i=`adw-icon adw-entry-edit`,a=`adw-insensitive`,o=.3;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,n){e.row.className=entryRowClassName(n,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?i:`${i} ${a}`,e.editIcon.opacity=t.editIconSensitive?1:o,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function peekIconSvg(n){return n===`view-conceal-symbolic`?e:t}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{viewConcealSymbolic as e,viewRevealSymbolic as t}from"@gjsify/adwaita-icons/actions";const n=`adw-row adw-action-row adw-entry-row`,r=`${n} adw-password-entry-row`,i=`adw-icon adw-entry-edit`,a=`adw-insensitive`,o=.3;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,n){e.row.className=entryRowClassName(n,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?i:`${i} ${a}`,e.editIcon.opacity=t.editIconSensitive?1:o,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function peekIconSvg(n){return n===`view-conceal-symbolic`?e:t}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.iconName=peekIconSvg(t.peekIconName)}export{i as NS_EDIT_ICON_CLASS,n as NS_ENTRY_ROW_CLASS,a as NS_INSENSITIVE_CLASS,o as NS_INSENSITIVE_OPACITY,r as NS_PASSWORD_ENTRY_ROW_CLASS,applyEntryRowState,applyPasswordEntryRowState,entryRowClassName,nsVisibility,peekIconSvg};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{Button as e}from"@nativescript/core";import{ADW_BUTTON_STYLE_CLASSES as t,buttonStyleClass as n}from"@gjsify/adwaita-core";var
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{Button as e}from"@nativescript/core";import{ADW_BUTTON_STYLE_CLASSES as t,buttonStyleClass as n}from"@gjsify/adwaita-core";var GtkButton=class extends e{_variant=`default`;constructor(){super(),this.className=`adw-button`,this.set(`androidElevation`,0)}get variant(){return this._variant}set variant(e){this._variant=e;let t=e==="default"?null:n(e);this.className=t?`adw-button ${t}`:`adw-button`}static get variantClasses(){return t}};export{GtkButton};
|
|
@@ -0,0 +1 @@
|
|
|
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{Label as r,StackLayout as i,action as a}from"@nativescript/core";import{ComboState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s}from"@gjsify/adwaita-icons/ui";const c=`notify::selected`;var GtkDropDown=class extends i{_label;_chevron;_state=new o;_chooserTitle=``;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let e=new r;e.className=`adw-drop-down-label`,e.text=``;let i=new t;i.className=`adw-drop-down-chevron`,i.iconName=s,this.addChild(e),this.addChild(i),this._label=e,this._chevron=i,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive){let t={eventName:c,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),n(this)}async _openChooser(){if(this._state.count===0)return;let e=this._state.options.map(e=>e.label),t=await a({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selected(){return this._state.selectedIndex}set selected(t){let n=e(t,this.selected);this._state.setSelectedIndex(n)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.options[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,c as NOTIFY_SELECTED};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{GridLayout as n,ItemSpec as r,TextField as i}from"@nativescript/core";import{ENTRY_ROW_MAX_LENGTH_LIMIT as a,clampEntryText as o,entryTextLength as s}from"@gjsify/adwaita-core";const c=`notify::text`,l=`activate`;var GtkEntry=class extends n{_field;_text=``;_maxLength=0;constructor(){super(),this.className=`adw-entry`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`auto`));let e=new i;e.className=`adw-entry-input`,e.set(`backgroundColor`,`transparent`),e.set(`borderWidth`,0),this.addChild(e),this._field=e,e.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),e.addEventListener(`returnPress`,()=>{let e={eventName:l,object:this};this.notify(e)})}_applyText(e){let t=o(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:c,object:this,text:t,textLength:s(t)};this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return s(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let n=t(e,this.maxLength);this._maxLength=Number.isFinite(n)?Math.min(a,Math.max(0,Math.trunc(n))):0,this._applyText(this._text)}get placeholderText(){return this._field.hint??``}set placeholderText(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(t){let n=e(t,this.editable);this._field.editable=!!n}get field(){return this._field}};export{l as ACTIVATE,GtkEntry,c as NOTIFY_TEXT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{action as t}from"@nativescript/core";const n=`menuItemActivated`;var
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{action as t}from"@nativescript/core";const n=`menuItemActivated`;var GtkMenuButton=class extends e{_items=[];_menuTitle=``;constructor(){super(),this.className=`${this.className} adw-menu-button`.trim(),this.addEventListener(`tap`,()=>{this._openMenu()})}get menuItems(){return this._items}set menuItems(e){this._items=Array.isArray(e)?e:[]}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}async _openMenu(){if(this._items.length===0)return;let e=this._items.map(e=>e.label),r=await t({title:this._menuTitle||void 0,cancelButtonText:`Cancel`,actions:e}),i=e.indexOf(r);if(i<0)return;let a=this._items[i],o={eventName:n,object:this,id:a.id??a.label,label:a.label,index:i};this.notify(o)}};export{GtkMenuButton,n as MENU_ITEM_ACTIVATED};
|
|
@@ -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};
|
package/lib/esm/widgets/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{AdwPreferencesPage as e}from"./adw-preferences-page.js";import{AdwPreferencesGroup as t}from"./adw-preferences-group.js";import{ACTIVATED as n,AdwActionRow as r}from"./adw-action-row.js";import{AdwSwitchRow as i,NOTIFY_ACTIVE as ee}from"./adw-switch-row.js";import{adwaitaColorScheme as te,isThemeIconColor as ne,onAdwaitaColorSchemeChanged as re,setAdwaitaColorScheme as ie,themeIconColor as ae,toggleAdwaitaColorScheme as oe}from"./color-scheme.js";import{ADWAITA_ICON_GRID as se,DEFAULT_ICON_COLOR as ce,DEFAULT_ICON_COLOR_DARK as le,extractIconPaths as ue,extractPathData as de}from"./icon-path.js";import{renderSymbolicIcon as a}from"./icons.js";import{AdwIcon as o,DEFAULT_ADW_ICON_SIZE as s}from"./adw-icon.js";import{attachRowPressFeedback as c}from"./row-press.js";import{AdwImageButton as l,DEFAULT_ICON_BUTTON_ICON_SIZE as fe}from"./adw-image-button.js";import{AdwEntryRow as u,NOTIFY_TEXT as pe}from"./adw-entry-row.js";import{AdwPasswordEntryRow as d}from"./adw-password-entry-row.js";import{ACTIVATE as me,AdwEntry as f,NOTIFY_TEXT as he}from"./adw-entry.js";import{AdwComboRow as p,ComboState as ge,NOTIFY_SELECTED as _e}from"./adw-combo-row.js";import{AdwDropDown as m,NOTIFY_SELECTED as ve}from"./adw-drop-down.js";import{AdwSpinRow as h,NOTIFY_VALUE as ye,SpinState as be}from"./adw-spin-row.js";import{AdwSliderRow as g,NOTIFY_SLIDER_VALUE as xe}from"./adw-slider-row.js";import{AdwExpanderRow as _,ExpanderState as Se,NOTIFY_EXPANDED as Ce}from"./adw-expander-row.js";import{AdwButton as v}from"./adw-button.js";import{AdwMenuButton as y,MENU_ITEM_ACTIVATED as we}from"./adw-menu-button.js";import{DEFAULT_CLAMP_MAX_SIZE as Te,DEFAULT_SPINNER_SIZE as Ee}from"./chrome.js";import{AdwBanner as b,BUTTON_CLICKED as x}from"./adw-banner.js";import{avatarInitials as S}from"./avatar-color.js";import{AdwAvatar as C,DEFAULT_AVATAR_SIZE as w}from"./adw-avatar.js";import{AdwWindowTitle as T}from"./adw-window-title.js";import{AdwClamp as E}from"./adw-clamp.js";import{AdwHeaderBar as D}from"./adw-header-bar.js";import{AdwToolbarView as O}from"./adw-toolbar-view.js";import{AdwWrapBox as k}from"./adw-wrap-box.js";import{DATA_GRID_HEADER_CELL_CLASS as De,DATA_GRID_HEADER_ROW_CLASS as Oe,DATA_GRID_SECTION_CELL_CLASS as ke,dataGridCellClass as Ae,dataGridItemSpec as je,dataGridRowClass as Me,dataGridShapeKey as Ne,dataGridTracksKey as Pe,parseDataGridWidth as Fe}from"./data-grid-model.js";import{AdwDataGrid as A,ROW_ACTIVATED as Ie}from"./adw-data-grid.js";import{AdwSpinner as j}from"./adw-spinner.js";import{AdwStatusPage as M}from"./adw-status-page.js";import{AdwButtonRow as N}from"./adw-button-row.js";import{AdwButtonContent as P}from"./adw-button-content.js";import{AdwSplitButton as F,CLICKED as Le,MENU_TAPPED as Re}from"./adw-split-button.js";import{AdwToggleGroup as I,NOTIFY_SELECTED as ze,ToggleGroupState as Be}from"./adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ve,adwaitaNsAccentColor as He,adwaitaNsAccentCss as Ue}from"./accent-theme.js";import{applyAdwaitaNsAccent as We,clearAdwaitaNsAccent as Ge}from"./adw-accent.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as Ke,SHORTCUT_LABEL_CLASS as qe,SHORTCUT_LABEL_DIMMED_CLASS as Je,SHORTCUT_LABEL_DISABLED_CLASS as Ye,SHORTCUT_LABEL_KEYCAP_CLASS as Xe,SHORTCUT_LABEL_KEYS_CLASS as L,SHORTCUT_LABEL_SIDE_CLASS as Ze,SHORTCUT_LABEL_SPACED_CLASS as Qe,shortcutLabelDirection as $e,shortcutLabelPlatform as et,shortcutLabelRenderPlan as tt}from"./shortcut-label.js";import{AdwShortcutLabel as R}from"./adw-shortcut-label.js";import{AdwViewStack as z,NOTIFY_VISIBLE_CHILD as nt}from"./adw-view-stack.js";import{AdwViewSwitcherBase as rt,NOTIFY_SELECTED as it}from"./view-switcher-base.js";import{AdwViewSwitcher as B}from"./adw-view-switcher.js";import{AdwViewSwitcherBar as V}from"./adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as H}from"./adw-inline-view-switcher.js";import{applyTabViewVisibility as at,createTabViewState as ot,tabBarVisibility as st,tabCloseVisibilities as ct,tabLabelText as lt,tabPageVisibilities as ut,tabTooltipText as dt,tabViewNotifyPayload as ft}from"./tab-view-state.js";import{AdwTabView as U,CLOSE_PAGE as pt,NOTIFY_SELECTED_PAGE as mt,PAGES_CHANGED as ht}from"./adw-tab-view.js";import{CarouselScrollSync as gt,DEFAULT_CAROUSEL_PAGE_WIDTH as _t,applyCarouselDots as vt,carouselDotClasses as yt,carouselNotifyPayload as bt,carouselPositionAtOffset as xt,carouselScrollOffset as St,createCarouselState as Ct,normalizeCarouselPageWidth as wt}from"./carousel-state.js";import{AdwCarousel as W,NOTIFY_N_PAGES as Tt,NOTIFY_POSITION as Et,PAGE_CHANGED as Dt}from"./adw-carousel.js";import{NOTIFY_VISIBLE_PAGE as Ot}from"./navigation-stack.js";import{AdwNavigationView as G}from"./adw-navigation-view.js";import{NsNavigationSplitViewState as kt,NsOverlaySplitViewState as At,splitViewColumns as jt}from"./split-view-state.js";import{AdwSplitViewBase as Mt,NOTIFY_SHOW_SIDEBAR as Nt}from"./split-view-base.js";import{AdwNavigationSplitView as K}from"./adw-navigation-split-view.js";import{AdwOverlaySplitView as q}from"./adw-overlay-split-view.js";import{AdwSidebar as J,NOTIFY_SELECTED as Pt}from"./adw-sidebar.js";import{CLOSE_ATTEMPT as Ft,NOTIFY_OPEN as It,SHEET_CLOSE as Lt}from"./bottom-sheet-state.js";import{AdwBottomSheet as Y}from"./adw-bottom-sheet.js";import{AdwToast as Rt,AdwToastOverlay as X,AdwToastQueue as zt,DEFAULT_TOAST_TIMEOUT as Bt,TOAST_BUTTON_CLICKED as Vt}from"./adw-toast-overlay.js";import{AdwAlertDialog as Ht,AdwAlertResponses as Ut,NOTIFY_RESPONSE as Wt}from"./adw-alert-dialog.js";import{AdwAboutDialog as Z,CLOSED as Gt}from"./adw-about-dialog.js";import{AdwPreferencesDialog as Q,CLOSED as Kt}from"./adw-preferences-dialog.js";import{AdwBreakpoint as qt,addBreakpoints as Jt,evaluateBreakpointCondition as Yt,parseBreakpointCondition as Xt}from"./breakpoint.js";const Zt={AdwPreferencesPage:e,AdwPreferencesGroup:t,AdwActionRow:r,AdwSwitchRow:i,AdwEntryRow:u,AdwPasswordEntryRow:d,AdwEntry:f,AdwComboRow:p,AdwDropDown:m,AdwSpinRow:h,AdwSliderRow:g,AdwExpanderRow:_,AdwButton:v,AdwImageButton:l,AdwMenuButton:y,AdwIcon:o,AdwBanner:b,AdwAvatar:C,AdwWindowTitle:T,AdwClamp:E,AdwHeaderBar:D,AdwToolbarView:O,AdwWrapBox:k,AdwDataGrid:A,AdwSpinner:j,AdwStatusPage:M,AdwButtonRow:N,AdwButtonContent:P,AdwSplitButton:F,AdwToggleGroup:I,AdwShortcutLabel:R,AdwViewStack:z,AdwViewSwitcher:B,AdwViewSwitcherBar:V,AdwInlineViewSwitcher:H,AdwTabView:U,AdwCarousel:W,AdwNavigationView:G,AdwNavigationSplitView:K,AdwOverlaySplitView:q,AdwSidebar:J,AdwBottomSheet:Y,AdwToastOverlay:X,AdwAboutDialog:Z,AdwPreferencesDialog:Q};let $=!1;function registerAdwaitaElements(){if(!$&&typeof registerElement==`function`){for(let[e,t]of Object.entries(Zt))registerElement(e,()=>t);$=!0}}export{Gt as ABOUT_CLOSED,n as ACTIVATED,se as ADWAITA_ICON_GRID,Ve as ADWAITA_NS_ACCENT_RULES,Z as AdwAboutDialog,r as AdwActionRow,Ht as AdwAlertDialog,Ut as AdwAlertResponses,C as AdwAvatar,b as AdwBanner,Y as AdwBottomSheet,qt as AdwBreakpoint,v as AdwButton,P as AdwButtonContent,N as AdwButtonRow,W as AdwCarousel,E as AdwClamp,p as AdwComboRow,A as AdwDataGrid,m as AdwDropDown,f as AdwEntry,u as AdwEntryRow,_ as AdwExpanderRow,D as AdwHeaderBar,o as AdwIcon,l as AdwImageButton,H as AdwInlineViewSwitcher,y as AdwMenuButton,K as AdwNavigationSplitView,G as AdwNavigationView,q as AdwOverlaySplitView,d as AdwPasswordEntryRow,Q as AdwPreferencesDialog,t as AdwPreferencesGroup,e as AdwPreferencesPage,R as AdwShortcutLabel,J as AdwSidebar,g as AdwSliderRow,h as AdwSpinRow,j as AdwSpinner,F as AdwSplitButton,Mt as AdwSplitViewBase,M as AdwStatusPage,i as AdwSwitchRow,U as AdwTabView,Rt as AdwToast,X as AdwToastOverlay,zt as AdwToastQueue,I as AdwToggleGroup,O as AdwToolbarView,z as AdwViewStack,B as AdwViewSwitcher,V as AdwViewSwitcherBar,rt as AdwViewSwitcherBase,T as AdwWindowTitle,k as AdwWrapBox,x as BUTTON_CLICKED,Le as CLICKED,Ft as CLOSE_ATTEMPT,pt as CLOSE_PAGE,gt as CarouselScrollSync,ge as ComboState,De as DATA_GRID_HEADER_CELL_CLASS,Oe as DATA_GRID_HEADER_ROW_CLASS,ke as DATA_GRID_SECTION_CELL_CLASS,s as DEFAULT_ADW_ICON_SIZE,w as DEFAULT_AVATAR_SIZE,_t as DEFAULT_CAROUSEL_PAGE_WIDTH,Te as DEFAULT_CLAMP_MAX_SIZE,fe as DEFAULT_ICON_BUTTON_ICON_SIZE,ce as DEFAULT_ICON_COLOR,le as DEFAULT_ICON_COLOR_DARK,Ee as DEFAULT_SPINNER_SIZE,Bt as DEFAULT_TOAST_TIMEOUT,me as ENTRY_ACTIVATE,Se as ExpanderState,we as MENU_ITEM_ACTIVATED,Re as MENU_TAPPED,ee as NOTIFY_ACTIVE,ve as NOTIFY_DROP_DOWN_SELECTED,he as NOTIFY_ENTRY_TEXT,Ce as NOTIFY_EXPANDED,Tt as NOTIFY_N_PAGES,It as NOTIFY_OPEN,Et as NOTIFY_POSITION,Wt as NOTIFY_RESPONSE,_e as NOTIFY_SELECTED,mt as NOTIFY_SELECTED_PAGE,Nt as NOTIFY_SHOW_SIDEBAR,Pt as NOTIFY_SIDEBAR_SELECTED,xe as NOTIFY_SLIDER_VALUE,pe as NOTIFY_TEXT,ze as NOTIFY_TOGGLE_SELECTED,ye as NOTIFY_VALUE,it as NOTIFY_VIEW_SELECTED,nt as NOTIFY_VISIBLE_CHILD,Ot as NOTIFY_VISIBLE_PAGE,kt as NsNavigationSplitViewState,At as NsOverlaySplitViewState,ht as PAGES_CHANGED,Dt as PAGE_CHANGED,Kt as PREFERENCES_CLOSED,Ie as ROW_ACTIVATED,Lt as SHEET_CLOSE,Ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,qe as SHORTCUT_LABEL_CLASS,Je as SHORTCUT_LABEL_DIMMED_CLASS,Ye as SHORTCUT_LABEL_DISABLED_CLASS,Xe as SHORTCUT_LABEL_KEYCAP_CLASS,L as SHORTCUT_LABEL_KEYS_CLASS,Ze as SHORTCUT_LABEL_SIDE_CLASS,Qe as SHORTCUT_LABEL_SPACED_CLASS,be as SpinState,Vt as TOAST_BUTTON_CLICKED,Be as ToggleGroupState,Jt as addBreakpoints,te as adwaitaColorScheme,He as adwaitaNsAccentColor,Ue as adwaitaNsAccentCss,We as applyAdwaitaNsAccent,vt as applyCarouselDots,at as applyTabViewVisibility,c as attachRowPressFeedback,S as avatarInitials,yt as carouselDotClasses,bt as carouselNotifyPayload,xt as carouselPositionAtOffset,St as carouselScrollOffset,Ge as clearAdwaitaNsAccent,Ct as createCarouselState,ot as createTabViewState,Ae as dataGridCellClass,je as dataGridItemSpec,Me as dataGridRowClass,Ne as dataGridShapeKey,Pe as dataGridTracksKey,Yt as evaluateBreakpointCondition,ue as extractIconPaths,de as extractPathData,ne as isThemeIconColor,wt as normalizeCarouselPageWidth,re as onAdwaitaColorSchemeChanged,Xt as parseBreakpointCondition,Fe as parseDataGridWidth,registerAdwaitaElements,a as renderSymbolicIcon,ie as setAdwaitaColorScheme,$e as shortcutLabelDirection,et as shortcutLabelPlatform,tt as shortcutLabelRenderPlan,jt as splitViewColumns,st as tabBarVisibility,ct as tabCloseVisibilities,lt as tabLabelText,ut as tabPageVisibilities,dt as tabTooltipText,ft as tabViewNotifyPayload,ae as themeIconColor,oe as toggleAdwaitaColorScheme};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{AdwPreferencesPage as e}from"./adw-preferences-page.js";import{AdwPreferencesGroup as t}from"./adw-preferences-group.js";import{ACTIVATED as n,AdwActionRow as r}from"./adw-action-row.js";import{AdwSwitchRow as i,NOTIFY_ACTIVE as ee}from"./adw-switch-row.js";import{adwaitaColorScheme as te,isThemeIconColor as ne,onAdwaitaColorSchemeChanged as re,setAdwaitaColorScheme as ie,themeIconColor as ae,toggleAdwaitaColorScheme as oe}from"./color-scheme.js";import{ADWAITA_ICON_GRID as se,DEFAULT_ICON_COLOR as ce,DEFAULT_ICON_COLOR_DARK as le,extractIconPaths as ue,extractPathData as de}from"./icon-path.js";import{renderSymbolicIcon as a}from"./icons.js";import{AdwIcon as o,DEFAULT_ADW_ICON_SIZE as s}from"./adw-icon.js";import{attachRowPressFeedback as c}from"./row-press.js";import{AdwImageButton as l,DEFAULT_ICON_BUTTON_ICON_SIZE as fe}from"./adw-image-button.js";import{AdwEntryRow as u,NOTIFY_TEXT as pe}from"./adw-entry-row.js";import{AdwPasswordEntryRow as d}from"./adw-password-entry-row.js";import{ACTIVATE as me,GtkEntry as f,NOTIFY_TEXT as he}from"./gtk-entry.js";import{AdwComboRow as p,ComboState as ge,NOTIFY_SELECTED as _e}from"./adw-combo-row.js";import{GtkDropDown as m,NOTIFY_SELECTED as ve}from"./gtk-drop-down.js";import{AdwSpinRow as h,NOTIFY_VALUE as ye,SpinState as be}from"./adw-spin-row.js";import{AdwSliderRow as g,NOTIFY_SLIDER_VALUE as xe}from"./adw-slider-row.js";import{AdwExpanderRow as _,ExpanderState as Se,NOTIFY_EXPANDED as Ce}from"./adw-expander-row.js";import{GtkButton as v}from"./gtk-button.js";import{GtkMenuButton as y,MENU_ITEM_ACTIVATED as we}from"./gtk-menu-button.js";import{DEFAULT_CLAMP_MAX_SIZE as Te,DEFAULT_SPINNER_SIZE as Ee}from"./chrome.js";import{AdwBanner as b,BUTTON_CLICKED as x}from"./adw-banner.js";import{avatarInitials as S}from"./avatar-color.js";import{AdwAvatar as C,DEFAULT_AVATAR_SIZE as w}from"./adw-avatar.js";import{AdwWindowTitle as T}from"./adw-window-title.js";import{AdwClamp as E}from"./adw-clamp.js";import{AdwHeaderBar as D}from"./adw-header-bar.js";import{AdwToolbarView as O}from"./adw-toolbar-view.js";import{AdwWrapBox as k}from"./adw-wrap-box.js";import{DATA_GRID_HEADER_CELL_CLASS as De,DATA_GRID_HEADER_ROW_CLASS as Oe,DATA_GRID_SECTION_CELL_CLASS as ke,dataGridCellClass as Ae,dataGridItemSpec as je,dataGridRowClass as Me,dataGridShapeKey as Ne,dataGridTracksKey as Pe,parseDataGridWidth as Fe}from"./data-grid-model.js";import{AdwDataGrid as A,ROW_ACTIVATED as Ie}from"./adw-data-grid.js";import{AdwSpinner as j}from"./adw-spinner.js";import{AdwStatusPage as M}from"./adw-status-page.js";import{AdwButtonRow as N}from"./adw-button-row.js";import{AdwButtonContent as P}from"./adw-button-content.js";import{AdwSplitButton as F,CLICKED as Le,MENU_TAPPED as Re}from"./adw-split-button.js";import{AdwToggleGroup as I,NOTIFY_SELECTED as ze,ToggleGroupState as Be}from"./adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ve,adwaitaNsAccentColor as He,adwaitaNsAccentCss as Ue}from"./accent-theme.js";import{applyAdwaitaNsAccent as We,clearAdwaitaNsAccent as Ge}from"./adw-accent.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as Ke,SHORTCUT_LABEL_CLASS as qe,SHORTCUT_LABEL_DIMMED_CLASS as Je,SHORTCUT_LABEL_DISABLED_CLASS as Ye,SHORTCUT_LABEL_KEYCAP_CLASS as Xe,SHORTCUT_LABEL_KEYS_CLASS as L,SHORTCUT_LABEL_SIDE_CLASS as Ze,SHORTCUT_LABEL_SPACED_CLASS as Qe,shortcutLabelDirection as $e,shortcutLabelPlatform as et,shortcutLabelRenderPlan as tt}from"./shortcut-label.js";import{AdwShortcutLabel as R}from"./adw-shortcut-label.js";import{AdwViewStack as z,NOTIFY_VISIBLE_CHILD as nt}from"./adw-view-stack.js";import{AdwViewSwitcherBase as rt,NOTIFY_SELECTED as it}from"./view-switcher-base.js";import{AdwViewSwitcher as B}from"./adw-view-switcher.js";import{AdwViewSwitcherBar as V}from"./adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as H}from"./adw-inline-view-switcher.js";import{applyTabViewVisibility as at,createTabViewState as ot,tabBarVisibility as st,tabCloseVisibilities as ct,tabLabelText as lt,tabPageVisibilities as ut,tabTooltipText as dt,tabViewNotifyPayload as ft}from"./tab-view-state.js";import{AdwTabView as U,CLOSE_PAGE as pt,NOTIFY_SELECTED_PAGE as mt,PAGES_CHANGED as ht}from"./adw-tab-view.js";import{CarouselScrollSync as gt,DEFAULT_CAROUSEL_PAGE_WIDTH as _t,applyCarouselDots as vt,carouselDotClasses as yt,carouselNotifyPayload as bt,carouselPositionAtOffset as xt,carouselScrollOffset as St,createCarouselState as Ct,normalizeCarouselPageWidth as wt}from"./carousel-state.js";import{AdwCarousel as W,NOTIFY_N_PAGES as Tt,NOTIFY_POSITION as Et,PAGE_CHANGED as Dt}from"./adw-carousel.js";import{NOTIFY_VISIBLE_PAGE as Ot}from"./navigation-stack.js";import{AdwNavigationView as G}from"./adw-navigation-view.js";import{NsNavigationSplitViewState as kt,NsOverlaySplitViewState as At,splitViewColumns as jt}from"./split-view-state.js";import{AdwSplitViewBase as Mt,NOTIFY_SHOW_SIDEBAR as Nt}from"./split-view-base.js";import{AdwNavigationSplitView as K}from"./adw-navigation-split-view.js";import{AdwOverlaySplitView as q}from"./adw-overlay-split-view.js";import{AdwSidebar as J,NOTIFY_SELECTED as Pt}from"./adw-sidebar.js";import{CLOSE_ATTEMPT as Ft,NOTIFY_OPEN as It,SHEET_CLOSE as Lt}from"./bottom-sheet-state.js";import{AdwBottomSheet as Y}from"./adw-bottom-sheet.js";import{AdwToast as Rt,AdwToastOverlay as X,AdwToastQueue as zt,DEFAULT_TOAST_TIMEOUT as Bt,TOAST_BUTTON_CLICKED as Vt}from"./adw-toast-overlay.js";import{AdwAlertDialog as Ht,AdwAlertResponses as Ut,NOTIFY_RESPONSE as Wt}from"./adw-alert-dialog.js";import{AdwAboutDialog as Z,CLOSED as Gt}from"./adw-about-dialog.js";import{AdwPreferencesDialog as Q,CLOSED as Kt}from"./adw-preferences-dialog.js";import{AdwBreakpoint as qt,addBreakpoints as Jt,evaluateBreakpointCondition as Yt,parseBreakpointCondition as Xt}from"./breakpoint.js";const Zt={AdwPreferencesPage:e,AdwPreferencesGroup:t,AdwActionRow:r,AdwSwitchRow:i,AdwEntryRow:u,AdwPasswordEntryRow:d,GtkEntry:f,AdwComboRow:p,GtkDropDown:m,AdwSpinRow:h,AdwSliderRow:g,AdwExpanderRow:_,GtkButton:v,AdwImageButton:l,GtkMenuButton:y,AdwIcon:o,AdwBanner:b,AdwAvatar:C,AdwWindowTitle:T,AdwClamp:E,AdwHeaderBar:D,AdwToolbarView:O,AdwWrapBox:k,AdwDataGrid:A,AdwSpinner:j,AdwStatusPage:M,AdwButtonRow:N,AdwButtonContent:P,AdwSplitButton:F,AdwToggleGroup:I,AdwShortcutLabel:R,AdwViewStack:z,AdwViewSwitcher:B,AdwViewSwitcherBar:V,AdwInlineViewSwitcher:H,AdwTabView:U,AdwCarousel:W,AdwNavigationView:G,AdwNavigationSplitView:K,AdwOverlaySplitView:q,AdwSidebar:J,AdwBottomSheet:Y,AdwToastOverlay:X,AdwAboutDialog:Z,AdwPreferencesDialog:Q};let $=!1;function registerAdwaitaElements(){if(!$&&typeof registerElement==`function`){for(let[e,t]of Object.entries(Zt))registerElement(e,()=>t);$=!0}}export{Gt as ABOUT_CLOSED,n as ACTIVATED,se as ADWAITA_ICON_GRID,Ve as ADWAITA_NS_ACCENT_RULES,Z as AdwAboutDialog,r as AdwActionRow,Ht as AdwAlertDialog,Ut as AdwAlertResponses,C as AdwAvatar,b as AdwBanner,Y as AdwBottomSheet,qt as AdwBreakpoint,P as AdwButtonContent,N as AdwButtonRow,W as AdwCarousel,E as AdwClamp,p as AdwComboRow,A as AdwDataGrid,u as AdwEntryRow,_ as AdwExpanderRow,D as AdwHeaderBar,o as AdwIcon,l as AdwImageButton,H as AdwInlineViewSwitcher,K as AdwNavigationSplitView,G as AdwNavigationView,q as AdwOverlaySplitView,d as AdwPasswordEntryRow,Q as AdwPreferencesDialog,t as AdwPreferencesGroup,e as AdwPreferencesPage,R as AdwShortcutLabel,J as AdwSidebar,g as AdwSliderRow,h as AdwSpinRow,j as AdwSpinner,F as AdwSplitButton,Mt as AdwSplitViewBase,M as AdwStatusPage,i as AdwSwitchRow,U as AdwTabView,Rt as AdwToast,X as AdwToastOverlay,zt as AdwToastQueue,I as AdwToggleGroup,O as AdwToolbarView,z as AdwViewStack,B as AdwViewSwitcher,V as AdwViewSwitcherBar,rt as AdwViewSwitcherBase,T as AdwWindowTitle,k as AdwWrapBox,x as BUTTON_CLICKED,Le as CLICKED,Ft as CLOSE_ATTEMPT,pt as CLOSE_PAGE,gt as CarouselScrollSync,ge as ComboState,De as DATA_GRID_HEADER_CELL_CLASS,Oe as DATA_GRID_HEADER_ROW_CLASS,ke as DATA_GRID_SECTION_CELL_CLASS,s as DEFAULT_ADW_ICON_SIZE,w as DEFAULT_AVATAR_SIZE,_t as DEFAULT_CAROUSEL_PAGE_WIDTH,Te as DEFAULT_CLAMP_MAX_SIZE,fe as DEFAULT_ICON_BUTTON_ICON_SIZE,ce as DEFAULT_ICON_COLOR,le as DEFAULT_ICON_COLOR_DARK,Ee as DEFAULT_SPINNER_SIZE,Bt as DEFAULT_TOAST_TIMEOUT,me as ENTRY_ACTIVATE,Se as ExpanderState,v as GtkButton,m as GtkDropDown,f as GtkEntry,y as GtkMenuButton,we as MENU_ITEM_ACTIVATED,Re as MENU_TAPPED,ee as NOTIFY_ACTIVE,ve as NOTIFY_DROP_DOWN_SELECTED,he as NOTIFY_ENTRY_TEXT,Ce as NOTIFY_EXPANDED,Tt as NOTIFY_N_PAGES,It as NOTIFY_OPEN,Et as NOTIFY_POSITION,Wt as NOTIFY_RESPONSE,_e as NOTIFY_SELECTED,mt as NOTIFY_SELECTED_PAGE,Nt as NOTIFY_SHOW_SIDEBAR,Pt as NOTIFY_SIDEBAR_SELECTED,xe as NOTIFY_SLIDER_VALUE,pe as NOTIFY_TEXT,ze as NOTIFY_TOGGLE_SELECTED,ye as NOTIFY_VALUE,it as NOTIFY_VIEW_SELECTED,nt as NOTIFY_VISIBLE_CHILD,Ot as NOTIFY_VISIBLE_PAGE,kt as NsNavigationSplitViewState,At as NsOverlaySplitViewState,ht as PAGES_CHANGED,Dt as PAGE_CHANGED,Kt as PREFERENCES_CLOSED,Ie as ROW_ACTIVATED,Lt as SHEET_CLOSE,Ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,qe as SHORTCUT_LABEL_CLASS,Je as SHORTCUT_LABEL_DIMMED_CLASS,Ye as SHORTCUT_LABEL_DISABLED_CLASS,Xe as SHORTCUT_LABEL_KEYCAP_CLASS,L as SHORTCUT_LABEL_KEYS_CLASS,Ze as SHORTCUT_LABEL_SIDE_CLASS,Qe as SHORTCUT_LABEL_SPACED_CLASS,be as SpinState,Vt as TOAST_BUTTON_CLICKED,Be as ToggleGroupState,Jt as addBreakpoints,te as adwaitaColorScheme,He as adwaitaNsAccentColor,Ue as adwaitaNsAccentCss,We as applyAdwaitaNsAccent,vt as applyCarouselDots,at as applyTabViewVisibility,c as attachRowPressFeedback,S as avatarInitials,yt as carouselDotClasses,bt as carouselNotifyPayload,xt as carouselPositionAtOffset,St as carouselScrollOffset,Ge as clearAdwaitaNsAccent,Ct as createCarouselState,ot as createTabViewState,Ae as dataGridCellClass,je as dataGridItemSpec,Me as dataGridRowClass,Ne as dataGridShapeKey,Pe as dataGridTracksKey,Yt as evaluateBreakpointCondition,ue as extractIconPaths,de as extractPathData,ne as isThemeIconColor,wt as normalizeCarouselPageWidth,re as onAdwaitaColorSchemeChanged,Xt as parseBreakpointCondition,Fe as parseDataGridWidth,registerAdwaitaElements,a as renderSymbolicIcon,ie as setAdwaitaColorScheme,$e as shortcutLabelDirection,et as shortcutLabelPlatform,tt as shortcutLabelRenderPlan,jt as splitViewColumns,st as tabBarVisibility,ct as tabCloseVisibilities,lt as tabLabelText,ut as tabPageVisibilities,dt as tabTooltipText,ft as tabViewNotifyPayload,ae as themeIconColor,oe as toggleAdwaitaColorScheme};
|
|
@@ -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.iconName=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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{ADW_WRAP_BOX_DEFAULT_SPACING as e,normalizeWrapBoxSpacing as t,
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{ADW_WRAP_BOX_DEFAULT_SPACING as e,normalizeWrapBoxSpacing as t,wrapBoxChildFlex as n,wrapBoxFlexStyle as r}from"@gjsify/adwaita-core";const i=e;function wrapBoxSpacingChanges(e,n){return t(n)!==t(e)}function wrapBoxChildMargin(e,n){let r=t(e)/2,i=t(n)/2;return`${i} ${r} ${i} ${r}`}export{i as DEFAULT_WRAP_BOX_SPACING,t as normalizeWrapBoxSpacing,n as wrapBoxChildFlex,wrapBoxChildMargin,r as wrapBoxFlexStyle,wrapBoxSpacingChanges};
|
|
@@ -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};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { assertNativeScript, isNativeScript, isAndroid, isIOS } from '@gjsify/native-platform';
|
|
2
|
-
export { AdwPreferencesPage, AdwPreferencesGroup, AdwActionRow, AdwSwitchRow, NOTIFY_ACTIVE, AdwEntryRow, NOTIFY_TEXT, AdwPasswordEntryRow,
|
|
2
|
+
export { AdwPreferencesPage, AdwPreferencesGroup, AdwActionRow, AdwSwitchRow, NOTIFY_ACTIVE, AdwEntryRow, NOTIFY_TEXT, AdwPasswordEntryRow, GtkEntry, ENTRY_ACTIVATE, NOTIFY_ENTRY_TEXT, AdwComboRow, ComboState, NOTIFY_SELECTED, GtkDropDown, NOTIFY_DROP_DOWN_SELECTED, AdwSpinRow, SpinState, NOTIFY_VALUE, AdwSliderRow, NOTIFY_SLIDER_VALUE, AdwExpanderRow, ExpanderState, NOTIFY_EXPANDED, GtkButton, AdwImageButton, DEFAULT_ICON_BUTTON_ICON_SIZE, GtkMenuButton, MENU_ITEM_ACTIVATED, AdwIcon, DEFAULT_ADW_ICON_SIZE, AdwBanner, BUTTON_CLICKED, AdwAvatar, DEFAULT_AVATAR_SIZE, avatarInitials, AdwWindowTitle, AdwClamp, DEFAULT_CLAMP_MAX_SIZE, AdwHeaderBar, AdwToolbarView, AdwWrapBox, AdwDataGrid, ROW_ACTIVATED, dataGridCellClass, dataGridItemSpec, dataGridRowClass, dataGridShapeKey, dataGridTracksKey, parseDataGridWidth, DATA_GRID_HEADER_CELL_CLASS, DATA_GRID_HEADER_ROW_CLASS, DATA_GRID_SECTION_CELL_CLASS, AdwSpinner, DEFAULT_SPINNER_SIZE, AdwStatusPage, AdwButtonRow, ACTIVATED, AdwButtonContent, AdwSplitButton, CLICKED, MENU_TAPPED, AdwToggleGroup, ToggleGroupState, NOTIFY_TOGGLE_SELECTED, applyAdwaitaNsAccent, clearAdwaitaNsAccent, ADWAITA_NS_ACCENT_RULES, adwaitaNsAccentColor, adwaitaNsAccentCss, AdwShortcutLabel, SHORTCUT_LABEL_CAP_TEXT_CLASS, SHORTCUT_LABEL_CLASS, SHORTCUT_LABEL_DIMMED_CLASS, SHORTCUT_LABEL_DISABLED_CLASS, SHORTCUT_LABEL_KEYCAP_CLASS, SHORTCUT_LABEL_KEYS_CLASS, SHORTCUT_LABEL_SIDE_CLASS, SHORTCUT_LABEL_SPACED_CLASS, shortcutLabelDirection, shortcutLabelPlatform, shortcutLabelRenderPlan, AdwViewStack, NOTIFY_VISIBLE_CHILD, AdwViewSwitcherBase, NOTIFY_VIEW_SELECTED, AdwViewSwitcher, AdwViewSwitcherBar, AdwInlineViewSwitcher, AdwTabView, AdwCarousel, DEFAULT_CAROUSEL_PAGE_WIDTH, NOTIFY_POSITION, AdwNavigationView, NOTIFY_VISIBLE_PAGE, AdwSplitViewBase, NOTIFY_SHOW_SIDEBAR, AdwNavigationSplitView, AdwOverlaySplitView, NsNavigationSplitViewState, NsOverlaySplitViewState, splitViewColumns, AdwSidebar, NOTIFY_SIDEBAR_SELECTED, AdwBottomSheet, NOTIFY_OPEN, AdwToast, AdwToastOverlay, AdwToastQueue, DEFAULT_TOAST_TIMEOUT, TOAST_BUTTON_CLICKED, AdwAlertDialog, AdwAlertResponses, NOTIFY_RESPONSE, AdwAboutDialog, ABOUT_CLOSED, AdwPreferencesDialog, PREFERENCES_CLOSED, attachRowPressFeedback, renderSymbolicIcon, extractIconPaths, extractPathData, ADWAITA_ICON_GRID, DEFAULT_ICON_COLOR, DEFAULT_ICON_COLOR_DARK, adwaitaColorScheme, isThemeIconColor, onAdwaitaColorSchemeChanged, setAdwaitaColorScheme, themeIconColor, toggleAdwaitaColorScheme, AdwBreakpoint, addBreakpoints, evaluateBreakpointCondition, parseBreakpointCondition, registerAdwaitaElements, } from './widgets/index.js';
|
|
3
3
|
export type { NotifyActiveEventData, NotifyTextEventData, NotifyEntryTextEventData, AdwComboOption, ComboStateChange, ComboStateListener, NotifySelectedEventData, NotifyDropDownSelectedEventData, NotifyValueEventData, SpinStateChange, SpinStateListener, NotifySliderValueEventData, NotifyExpandedEventData, ExpanderStateListener, AdwButtonVariant, AdwMenuItem, MenuItemActivatedEventData, MenuTappedEventData, RowActivatedEventData, DataGridItemSpec, NotifyToggleSelectedEventData, ToggleGroupStateChange, ToggleGroupStateListener, AccentRole, AccentRule, ShortcutLabelRenderPlan, ShortcutLabelViewSpec, AdwViewStackPage, NotifyVisibleChildEventData, AdwViewPage, NotifyViewSelectedEventData, NotifyPositionEventData, NotifyVisiblePageEventData, NotifyShowSidebarEventData, NsShowSidebarNotification, NsSplitViewHost, NsSplitViewState, NotifySidebarSelectedEventData, NotifyOpenEventData, AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, ToastScheduler, ToastTimerHandle, NotifyResponseEventData, AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, OrderedConfirmResponses, SymbolicIconOptions, IconPath, AdwColorScheme, AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './widgets/index.js';
|
|
4
|
+
export { Adw, Gtk } from './namespace.js';
|
|
4
5
|
export { ADWAITA_SANS_FONT_FAMILY, ADWAITA_SANS_TTF_FILES, adwaitaFontInstallInstructions, hasAdwaitaSans, } from './fonts.js';
|
|
5
6
|
/**
|
|
6
7
|
* One-call convenience setup for the Adwaita NativeScript layer.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { AdwAboutDialog } from './widgets/adw-about-dialog.js';
|
|
2
|
+
import { AdwActionRow } from './widgets/adw-action-row.js';
|
|
3
|
+
import { AdwAlertDialog } from './widgets/adw-alert-dialog.js';
|
|
4
|
+
import { AdwAvatar } from './widgets/adw-avatar.js';
|
|
5
|
+
import { AdwBanner } from './widgets/adw-banner.js';
|
|
6
|
+
import { AdwBottomSheet } from './widgets/adw-bottom-sheet.js';
|
|
7
|
+
import { AdwButtonContent } from './widgets/adw-button-content.js';
|
|
8
|
+
import { AdwButtonRow } from './widgets/adw-button-row.js';
|
|
9
|
+
import { AdwCarousel } from './widgets/adw-carousel.js';
|
|
10
|
+
import { AdwClamp } from './widgets/adw-clamp.js';
|
|
11
|
+
import { AdwComboRow } from './widgets/adw-combo-row.js';
|
|
12
|
+
import { AdwEntryRow } from './widgets/adw-entry-row.js';
|
|
13
|
+
import { AdwExpanderRow } from './widgets/adw-expander-row.js';
|
|
14
|
+
import { AdwHeaderBar } from './widgets/adw-header-bar.js';
|
|
15
|
+
import { AdwIcon } from './widgets/adw-icon.js';
|
|
16
|
+
import { AdwInlineViewSwitcher } from './widgets/adw-inline-view-switcher.js';
|
|
17
|
+
import { AdwNavigationSplitView } from './widgets/adw-navigation-split-view.js';
|
|
18
|
+
import { AdwNavigationView } from './widgets/adw-navigation-view.js';
|
|
19
|
+
import { AdwOverlaySplitView } from './widgets/adw-overlay-split-view.js';
|
|
20
|
+
import { AdwPasswordEntryRow } from './widgets/adw-password-entry-row.js';
|
|
21
|
+
import { AdwPreferencesDialog } from './widgets/adw-preferences-dialog.js';
|
|
22
|
+
import { AdwPreferencesGroup } from './widgets/adw-preferences-group.js';
|
|
23
|
+
import { AdwPreferencesPage } from './widgets/adw-preferences-page.js';
|
|
24
|
+
import { AdwShortcutLabel } from './widgets/adw-shortcut-label.js';
|
|
25
|
+
import { AdwSidebar } from './widgets/adw-sidebar.js';
|
|
26
|
+
import { AdwSpinRow } from './widgets/adw-spin-row.js';
|
|
27
|
+
import { AdwSpinner } from './widgets/adw-spinner.js';
|
|
28
|
+
import { AdwSplitButton } from './widgets/adw-split-button.js';
|
|
29
|
+
import { AdwStatusPage } from './widgets/adw-status-page.js';
|
|
30
|
+
import { AdwSwitchRow } from './widgets/adw-switch-row.js';
|
|
31
|
+
import { AdwTabView } from './widgets/adw-tab-view.js';
|
|
32
|
+
import { AdwToastOverlay } from './widgets/adw-toast-overlay.js';
|
|
33
|
+
import { AdwToggleGroup } from './widgets/adw-toggle-group.js';
|
|
34
|
+
import { AdwToolbarView } from './widgets/adw-toolbar-view.js';
|
|
35
|
+
import { AdwViewStack } from './widgets/adw-view-stack.js';
|
|
36
|
+
import { AdwViewSwitcherBar } from './widgets/adw-view-switcher-bar.js';
|
|
37
|
+
import { AdwViewSwitcher } from './widgets/adw-view-switcher.js';
|
|
38
|
+
import { AdwWindowTitle } from './widgets/adw-window-title.js';
|
|
39
|
+
import { AdwWrapBox } from './widgets/adw-wrap-box.js';
|
|
40
|
+
import { GtkButton } from './widgets/gtk-button.js';
|
|
41
|
+
import { GtkDropDown } from './widgets/gtk-drop-down.js';
|
|
42
|
+
import { GtkEntry } from './widgets/gtk-entry.js';
|
|
43
|
+
import { GtkMenuButton } from './widgets/gtk-menu-button.js';
|
|
44
|
+
/** The libadwaita half: every widget whose own spelling is an `adw-*` tag. */
|
|
45
|
+
export declare const Adw: {
|
|
46
|
+
AboutDialog: typeof AdwAboutDialog;
|
|
47
|
+
ActionRow: typeof AdwActionRow;
|
|
48
|
+
AlertDialog: typeof AdwAlertDialog;
|
|
49
|
+
Avatar: typeof AdwAvatar;
|
|
50
|
+
Banner: typeof AdwBanner;
|
|
51
|
+
BottomSheet: typeof AdwBottomSheet;
|
|
52
|
+
ButtonContent: typeof AdwButtonContent;
|
|
53
|
+
ButtonRow: typeof AdwButtonRow;
|
|
54
|
+
Carousel: typeof AdwCarousel;
|
|
55
|
+
Clamp: typeof AdwClamp;
|
|
56
|
+
ComboRow: typeof AdwComboRow;
|
|
57
|
+
EntryRow: typeof AdwEntryRow;
|
|
58
|
+
ExpanderRow: typeof AdwExpanderRow;
|
|
59
|
+
HeaderBar: typeof AdwHeaderBar;
|
|
60
|
+
InlineViewSwitcher: typeof AdwInlineViewSwitcher;
|
|
61
|
+
NavigationSplitView: typeof AdwNavigationSplitView;
|
|
62
|
+
NavigationView: typeof AdwNavigationView;
|
|
63
|
+
OverlaySplitView: typeof AdwOverlaySplitView;
|
|
64
|
+
PasswordEntryRow: typeof AdwPasswordEntryRow;
|
|
65
|
+
PreferencesDialog: typeof AdwPreferencesDialog;
|
|
66
|
+
PreferencesGroup: typeof AdwPreferencesGroup;
|
|
67
|
+
PreferencesPage: typeof AdwPreferencesPage;
|
|
68
|
+
ShortcutLabel: typeof AdwShortcutLabel;
|
|
69
|
+
Sidebar: typeof AdwSidebar;
|
|
70
|
+
Spinner: typeof AdwSpinner;
|
|
71
|
+
SpinRow: typeof AdwSpinRow;
|
|
72
|
+
SplitButton: typeof AdwSplitButton;
|
|
73
|
+
StatusPage: typeof AdwStatusPage;
|
|
74
|
+
SwitchRow: typeof AdwSwitchRow;
|
|
75
|
+
TabView: typeof AdwTabView;
|
|
76
|
+
ToastOverlay: typeof AdwToastOverlay;
|
|
77
|
+
ToggleGroup: typeof AdwToggleGroup;
|
|
78
|
+
ToolbarView: typeof AdwToolbarView;
|
|
79
|
+
ViewStack: typeof AdwViewStack;
|
|
80
|
+
ViewSwitcher: typeof AdwViewSwitcher;
|
|
81
|
+
ViewSwitcherBar: typeof AdwViewSwitcherBar;
|
|
82
|
+
WindowTitle: typeof AdwWindowTitle;
|
|
83
|
+
WrapBox: typeof AdwWrapBox;
|
|
84
|
+
};
|
|
85
|
+
/** The GTK half: the widgets `NS_WIDGET_ALIGNMENT` declares a `gir` alias of a GTK type. */
|
|
86
|
+
export declare const Gtk: {
|
|
87
|
+
Button: typeof GtkButton;
|
|
88
|
+
DropDown: typeof GtkDropDown;
|
|
89
|
+
Entry: typeof GtkEntry;
|
|
90
|
+
Image: typeof AdwIcon;
|
|
91
|
+
MenuButton: typeof GtkMenuButton;
|
|
92
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { View } from '@nativescript/core';
|
|
2
|
+
import { GridLayout, StackLayout, Label } from '@nativescript/core';
|
|
2
3
|
import { ActionRowState } from './row-state.js';
|
|
3
4
|
/** Event name emitted when the row is activated. Mirrors `Adw.ActionRow::activated`. */
|
|
4
5
|
export declare const ACTIVATED = "activated";
|
|
@@ -38,6 +39,20 @@ export declare class AdwActionRow extends GridLayout {
|
|
|
38
39
|
/** Install a suffix widget in column 2. Replaces any previous one; `null` clears. */
|
|
39
40
|
setSuffix(view: View | null): void;
|
|
40
41
|
get suffix(): View | null;
|
|
42
|
+
/**
|
|
43
|
+
* An XML child goes to a named edge, and a bare one to the SUFFIX.
|
|
44
|
+
*
|
|
45
|
+
* The fallback is libadwaita's: `AdwActionRow`'s buildable adds an untyped child
|
|
46
|
+
* with `adw_action_row_add_suffix`. Without this override, `LayoutBase`'s default
|
|
47
|
+
* `addChild` drops the child into the grid with no `adw-row-prefix` /
|
|
48
|
+
* `adw-row-suffix` class and no column, so it lands on top of the title.
|
|
49
|
+
*
|
|
50
|
+
* The subclasses inherit it, and that is deliberate but sharp-edged: a switch row
|
|
51
|
+
* builds its own `Switch` as the suffix in its constructor, and `setSuffix`
|
|
52
|
+
* REPLACES. An explicit `<AdwSwitchRow.suffix>` therefore takes the switch's
|
|
53
|
+
* place, which is what "set the suffix" has to mean.
|
|
54
|
+
*/
|
|
55
|
+
_addChildFromBuilder(name: string, view: View): void;
|
|
41
56
|
/** `Adw.ActionRow:activatable-widget` — the widget this row activates. */
|
|
42
57
|
get activatableWidget(): View | null;
|
|
43
58
|
/**
|
|
@@ -53,7 +68,7 @@ export declare class AdwActionRow extends GridLayout {
|
|
|
53
68
|
syncActivatableWidgetSensitivity(): void;
|
|
54
69
|
/** `GtkListBoxRow:activatable` — whether a tap activates this row at all. */
|
|
55
70
|
get activatable(): boolean;
|
|
56
|
-
set activatable(value: boolean);
|
|
71
|
+
set activatable(value: boolean | string);
|
|
57
72
|
/**
|
|
58
73
|
* `adw_action_row_activate`: forward to the activatable widget, then emit
|
|
59
74
|
* `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
|
}
|