@gjsify/adwaita-nativescript 0.64.1 → 0.64.2-next.254
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/builder/index.js +1 -1
- package/lib/esm/builder/param-values.js +1 -0
- package/lib/esm/canvas2d/canvas2d-bridge.js +1 -1
- package/lib/esm/capabilities.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/namespace/adw.js +1 -1
- package/lib/esm/namespace/gdk.js +1 -1
- package/lib/esm/namespace/gio.js +1 -1
- package/lib/esm/namespace/glib.js +1 -1
- package/lib/esm/namespace/gobject.js +1 -1
- package/lib/esm/namespace/gtk.js +1 -1
- package/lib/esm/widgets/adw-about-dialog.js +2 -1
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-alert-dialog.js +1 -1
- package/lib/esm/widgets/adw-application-window.js +1 -1
- package/lib/esm/widgets/adw-avatar.js +1 -1
- package/lib/esm/widgets/adw-banner.js +1 -1
- package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
- package/lib/esm/widgets/adw-button-content.js +1 -1
- package/lib/esm/widgets/adw-carousel.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-data-grid.js +1 -1
- package/lib/esm/widgets/adw-dialog.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-image-button.js +1 -1
- package/lib/esm/widgets/adw-navigation-page.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-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-switch-row.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toast-overlay.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-switcher-bar.js +1 -1
- package/lib/esm/widgets/adw-wrap-box.js +1 -1
- package/lib/esm/widgets/application.js +1 -1
- package/lib/esm/widgets/construct-props.js +1 -1
- package/lib/esm/widgets/gtk-action-bar.js +1 -1
- package/lib/esm/widgets/gtk-box.js +1 -1
- package/lib/esm/widgets/gtk-button.js +1 -1
- package/lib/esm/widgets/gtk-check-button.js +1 -1
- package/lib/esm/widgets/gtk-drawing-area.js +1 -1
- package/lib/esm/widgets/gtk-drop-down.js +1 -1
- package/lib/esm/widgets/gtk-entry.js +1 -1
- package/lib/esm/widgets/gtk-grid.js +1 -1
- package/lib/esm/widgets/gtk-image.js +1 -1
- package/lib/esm/widgets/gtk-label.js +1 -1
- package/lib/esm/widgets/gtk-list-box.js +1 -1
- package/lib/esm/widgets/gtk-menu-button.js +1 -1
- package/lib/esm/widgets/gtk-revealer.js +1 -1
- package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
- package/lib/esm/widgets/gtk-stack.js +1 -1
- package/lib/esm/widgets/gtk-text-view.js +1 -1
- package/lib/esm/widgets/gtk-toggle-button.js +1 -1
- package/lib/esm/widgets/gtk-window.js +1 -1
- package/lib/esm/widgets/icon-path.js +1 -1
- package/lib/esm/widgets/icon-render.js +1 -0
- package/lib/esm/widgets/icon-theme.js +1 -1
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/stack-page.js +1 -1
- package/lib/esm/widgets/view-stack-page.js +1 -1
- package/lib/esm/widgets/widget-layout.js +1 -1
- package/lib/esm/widgets/widget-mapping.js +1 -0
- package/lib/types/about-dialog-doors.spec.d.ts +1 -0
- package/lib/types/builder/index.d.ts +4 -0
- package/lib/types/builder/param-values.d.ts +21 -0
- package/lib/types/carousel-doors.spec.d.ts +1 -0
- package/lib/types/gio-resource.spec.d.ts +1 -0
- package/lib/types/gio.spec.d.ts +2 -0
- package/lib/types/icon-resources.spec.d.ts +2 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/types/namespace/adw.d.ts +1 -1
- package/lib/types/namespace/gdk.d.ts +1 -0
- package/lib/types/namespace/gio.d.ts +2 -0
- package/lib/types/namespace/glib.d.ts +2 -1
- package/lib/types/namespace/gtk.d.ts +1 -0
- package/lib/types/param-values.spec.d.ts +1 -0
- package/lib/types/testing/ns-core.d.mts +55 -14
- package/lib/types/widget-map.spec.d.ts +1 -0
- package/lib/types/widgets/adw-about-dialog.d.ts +34 -2
- package/lib/types/widgets/adw-action-row.d.ts +10 -1
- package/lib/types/widgets/adw-alert-dialog.d.ts +37 -13
- package/lib/types/widgets/adw-application-window.d.ts +0 -3
- package/lib/types/widgets/adw-avatar.d.ts +10 -1
- package/lib/types/widgets/adw-banner.d.ts +10 -1
- package/lib/types/widgets/adw-bottom-sheet.d.ts +10 -1
- package/lib/types/widgets/adw-button-content.d.ts +10 -1
- package/lib/types/widgets/adw-carousel.d.ts +24 -3
- package/lib/types/widgets/adw-clamp.d.ts +10 -1
- package/lib/types/widgets/adw-combo-row.d.ts +4 -0
- package/lib/types/widgets/adw-data-grid.d.ts +10 -1
- package/lib/types/widgets/adw-header-bar.d.ts +10 -1
- package/lib/types/widgets/adw-image-button.d.ts +13 -2
- package/lib/types/widgets/adw-navigation-page.d.ts +10 -1
- package/lib/types/widgets/adw-navigation-view.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-dialog.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-group.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-page.d.ts +10 -1
- package/lib/types/widgets/adw-shortcut-label.d.ts +10 -1
- package/lib/types/widgets/adw-sidebar.d.ts +10 -1
- package/lib/types/widgets/adw-slider-row.d.ts +10 -1
- package/lib/types/widgets/adw-spinner.d.ts +10 -1
- package/lib/types/widgets/adw-split-button.d.ts +10 -1
- package/lib/types/widgets/adw-status-page.d.ts +10 -1
- package/lib/types/widgets/adw-switch-row.d.ts +2 -0
- package/lib/types/widgets/adw-tab-view.d.ts +10 -1
- package/lib/types/widgets/adw-toast-overlay.d.ts +21 -17
- package/lib/types/widgets/adw-toggle-group.d.ts +10 -1
- package/lib/types/widgets/adw-toggle.d.ts +10 -1
- package/lib/types/widgets/adw-toolbar-view.d.ts +10 -1
- package/lib/types/widgets/adw-view-stack.d.ts +10 -1
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +10 -1
- package/lib/types/widgets/adw-window-title.d.ts +10 -1
- package/lib/types/widgets/adw-wrap-box.d.ts +10 -1
- package/lib/types/widgets/application.d.ts +2 -1
- package/lib/types/widgets/carousel-indicator-base.d.ts +10 -1
- package/lib/types/widgets/construct-props.d.ts +11 -2
- package/lib/types/widgets/gtk-action-bar.d.ts +10 -1
- package/lib/types/widgets/gtk-button.d.ts +13 -2
- package/lib/types/widgets/gtk-check-button.d.ts +10 -0
- package/lib/types/widgets/gtk-drop-down.d.ts +10 -1
- package/lib/types/widgets/gtk-entry.d.ts +10 -1
- package/lib/types/widgets/gtk-image.d.ts +13 -2
- package/lib/types/widgets/gtk-label.d.ts +10 -1
- package/lib/types/widgets/gtk-popover-menu.d.ts +10 -1
- package/lib/types/widgets/gtk-stack.d.ts +10 -1
- package/lib/types/widgets/gtk-text-view.d.ts +10 -1
- package/lib/types/widgets/gtk-window.d.ts +5 -0
- package/lib/types/widgets/icon-path.d.ts +9 -0
- package/lib/types/widgets/icon-render.d.ts +9 -0
- package/lib/types/widgets/icon-theme.d.ts +43 -40
- package/lib/types/widgets/index.d.ts +4 -4
- package/lib/types/widgets/signals.d.ts +16 -1
- package/lib/types/widgets/split-view-base.d.ts +10 -1
- package/lib/types/widgets/stack-page.d.ts +10 -1
- package/lib/types/widgets/styled-layout-base.d.ts +10 -1
- package/lib/types/widgets/view-stack-page.d.ts +10 -1
- package/lib/types/widgets/view-switcher-base.d.ts +10 -1
- package/lib/types/widgets/widget-layout.d.ts +14 -0
- package/lib/types/widgets/widget-mapping.d.ts +9 -0
- package/package.json +14 -13
- package/src/testing/ns-core.mts +147 -18
- package/src/theme/adwaita.css +13 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_PIXEL_SIZE as e,gtkIconSizeNick as t,iconPixelSize as n,storedPixelSize as r}from"./gtk-icon-size.js";import{applyConstructProps as i}from"./construct-props.js";import{xmlNumber as a}from"./xml-values.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{GridLayout as p,Image as m,ItemSpec as h}from"@nativescript/core";const g=e;var AdwImageButton=class extends o(p){static GTypeName=`AdwImageButton`;_image;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-image-button`,this.addRow(new h(1,`star`)),this.addColumn(new h(1,`star`));let t=new m;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._renderedSize,t.height=this._renderedSize,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,this.addChild(t),this._image=t,f(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),i(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return n(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this._image.width=e,this._image.height=e,this._render()}_render(){u(this._image,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._applySize()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=t(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(e){this._pixelSize=r(a(e,this._pixelSize)),this._applySize()}get image(){return this._image}};export{AdwImageButton,g as DEFAULT_ICON_BUTTON_ICON_SIZE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{GridLayout as i,ItemSpec as a}from"@nativescript/core";var AdwNavigationPage=class extends r(i){static GTypeName=`AdwNavigationPage`;static builderSlots=e([`child`],`child`);_child=null;_tag=null;_title=``;_canPop=!0;_owner=null;constructor(e){super(),this.className=`adw-navigation-page`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`star`)),t(this,e)}set_child(e){this._child&&this.removeChild(this._child),this._child=e,e&&(i.setColumn(e,0),i.setRow(e,0),this.addChild(e))}get child(){return this._child}_addChildFromBuilder(e,t){this.set_child(t)}get tag(){return this._tag}set tag(e){this._tag=e,this._owner?.setPageTag(this,e)}get title(){return this._title}set title(e){this._title=e??``,this._owner?.setPageTitle(this,this._title)}get canPop(){return this._canPop}set canPop(e){this._canPop=n(e,this._canPop),this._owner?.setPageCanPop(this,this._canPop)}_setOwner(e){this._owner=e}};export{AdwNavigationPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{NsNavigationSplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var o=class AdwNavigationSplitView extends i{static GTypeName=`AdwNavigationSplitView`;constructor(t){super(`adw-navigation-split-view`,`navigation`,new n({onCritical:e=>console.error(e),onDelegate:(e,t)=>{for(let n=this.parent;n;n=n.parent)if(n instanceof AdwNavigationSplitView)return(e===`push`?n.push(t):n.pop()).kind!==`not-found`;return!1}})),this._applyLayout(),e(this,t)}_applyLayout(){if(!this._state.collapsed){let e=r(this._state.sidebarPosition,this.textDirection);this._sidebar&&(this._sidebar.visibility=`visible`,this._sidebar.translateX=0,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth),this._content&&(this._content.visibility=`visible`,this._content.translateX=0,a.setColumn(this._content,e.content),a.setColumnSpan(this._content,1));return}let e=this._state.visiblePane;this._sidebar&&(this._sidebar.visibility=e===`sidebar`?`visible`:`collapse`,this._sidebar.translateX=0,a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=`auto`),this._content&&(this._content.visibility=e===`content`?`visible`:`collapse`,this._content.translateX=0,a.setColumn(this._content,0),a.setColumnSpan(this._content,2))}_transitionSidebar(){if(!this._shouldAnimate()||!this._sidebar||!this._content){this._applyLayout();return}this._cancelPending();for(let e of[this._sidebar,this._content])a.setColumn(e,0),a.setColumnSpan(e,2);this._sidebar.width=`auto`;let e=this._paneWidth(),t=this._state.transition===`push`,n=this._state.visiblePane===`sidebar`?this._sidebar:this._content,r=n===this._sidebar?this._content:this._sidebar,i=t?e:-e,o=t?-e:e;n.visibility=`visible`,n.translateX=i,r.visibility=`visible`,r.translateX=0,this._track(n.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})),this._track(r.animate({translate:{x:o,y:0},duration:200,curve:`easeIn`})).then(()=>this._settleAfterSwap(n,r)).catch(()=>{})}_settleAfterSwap(e,t){(this._state.visiblePane===`sidebar`?this._sidebar:this._content)===e&&(t.visibility=`collapse`,t.translateX=0)}_paneWidth(){let e=this.getActualSize();return e&&e.width>0?e.width:1024}get sidebarTag(){return this._state.sidebarTag}set sidebarTag(e){this._state.setTag(`sidebar`,e)}get contentTag(){return this._state.contentTag}set contentTag(e){this._state.setTag(`content`,e)}push(e){return this._state.push(e)}pop(){return this._state.pop()}get showContent(){return this._state.showContent}set showContent(e){let n=t(e,this.showContent);this._state.showContent=n}};export{o as AdwNavigationSplitView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{AdwNavigationPage as r}from"./adw-navigation-page.js";import{NOTIFY_VISIBLE_PAGE as i,NsNavigationStack as a,POPPED as o,PUSHED as s,REPLACED as c,navigationPageClassName as l}from"./navigation-stack.js";import{describeNavigationDiagnostic as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f}from"@nativescript/core";var AdwNavigationView=class extends n(d){static GTypeName=`AdwNavigationView`;_nav;constructor(t){super(),this.className=`adw-navigation-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`)),this._nav=new a({attachPage:e=>{e.className=l(e.className),d.setColumn(e,0),d.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emitNavigation(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${u(e)}`)}),e(this,t)}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){if(t instanceof r){this.add(t,t.tag,{title:t.title,canPop:t.canPop}),t._setOwner(this);return}this.add(t)}remove(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}push_by_tag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}pop_to_page(e){return this._nav.popToPage(e)}pop_to_tag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replace_with_tags(e){this._nav.replaceWithTags(e)}find_page(e){return this._nav.findPage(e)}get_previous_page(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get_visible_page_tag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(e){let n=t(e,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(e){let n=t(e,this.popOnEscape);this._nav.setPopOnEscape(n)}_emitNavigation(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,i as NOTIFY_VISIBLE_PAGE,o as POPPED,s as PUSHED,c as REPLACED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{NsOverlaySplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var AdwOverlaySplitView=class extends i{static GTypeName=`AdwOverlaySplitView`;_scrim=null;constructor(t){super(`adw-overlay-split-view`,`overlay`,new n),this._applyLayout(),e(this,t)}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(e){let n=t(e,this.pinSidebar);this._state.setPinSidebar(!!n)}_applyLayout(){let e=r(this._state.sidebarPosition),t=this._state.sidebarPosition===`end`;if(!this._state.collapsed){this._detachScrim();let t=this._state.showSidebar;this._sidebar&&(this._sidebar.visibility=t?`visible`:`collapse`,this._sidebar.translateX=0,this._sidebar.opacity=1,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth,this._sidebar.className=this._paneClassName(this._sidebar.className,!1),this._sidebar.horizontalAlignment=`stretch`),this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,t?e.content:0),a.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=t?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0),this._sidebar.visibility=this._state.showSidebar?`visible`:`collapse`,this._sidebar.translateX=this._state.showSidebar?0:this._hiddenOffset(),this._sidebar.opacity=1),this._applyPaneFocus()}_transitionSidebar(){if(!this._state.collapsed||!this._shouldAnimate()){this._applyLayout();return}this._cancelPending(),this._prepareCollapsedStructure(),this._applyPaneFocus(),this._state.showSidebar?this._animateOpen():this._animateClose()}_applyPaneFocus(){this._sidebar&&(this._sidebar.isUserInteractionEnabled=this._state.sidebarFocusable),this._content&&(this._content.isUserInteractionEnabled=this._state.contentFocusable)}_ensureScrim(){if(this._scrim)return this._scrim;let e=new a;return e.className=`adw-overlay-scrim`,e.visibility=`collapse`,e.opacity=0,e.addEventListener(`tap`,()=>this.hideSidebarPane()),this._scrim=e,e}_raiseOverlayChildren(){let e=this._ensureScrim();this._isChild(e)&&this.removeChild(e);let t=this._sidebar;t&&this._isChild(t)&&this.removeChild(t),this.addChild(e),t&&this.addChild(t)}_detachScrim(){this._scrim&&this._isChild(this._scrim)&&this.removeChild(this._scrim)}_prepareCollapsedStructure(){let e=this._state.sidebarPosition===`end`;this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2)),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0))}_animateOpen(){let e=this._scrim;e&&(e.visibility=`visible`,e.opacity=0,this._track(e.animate({opacity:1,duration:200,curve:`easeOut`})));let t=this._sidebar;t&&(t.visibility=`visible`,t.translateX=this._hiddenOffset(),t.opacity=1,this._track(t.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})))}_animateClose(){let e=this._scrim,t=this._sidebar,n=[];e&&n.push(this._track(e.animate({opacity:0,duration:200,curve:`easeIn`}))),t&&n.push(this._track(t.animate({translate:{x:this._hiddenOffset(),y:0},duration:200,curve:`easeIn`}))),Promise.all(n).then(()=>{this._state.showSidebar||(t&&(t.visibility=`collapse`),e&&(e.visibility=`collapse`))}).catch(()=>{})}_hiddenOffset(){let e=this.sidebarWidth;return this._state.sidebarPosition===`end`?e:-e}_paneClassName(e,t){return`${(e??``).split(/\s+/).filter(e=>e&&e!==`adw-overlay-active`&&e!==`adw-split-view-sidebar`).join(` `)} adw-split-view-sidebar${t?` adw-overlay-active`:``}`.trim()}};export{AdwOverlaySplitView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as r,applyPasswordEntryRowState as i}from"./entry-row-view.js";import{AdwEntryRow as a}from"./adw-entry-row.js";import{PasswordEntryRowState as o,PasswordEntryRowState as s}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as c}from"@gjsify/adwaita-icons/status";const l=`notify::revealed`;var AdwPasswordEntryRow=class extends a{static GTypeName=`AdwPasswordEntryRow`;_password=new s(this._state);_peekButton;constructor(t){super(),this._field.className=`adw-entry-field adw-password-field`;let r=new n;r.className=`${r.className} adw-password-peek`.trim(),r.addEventListener(`tap`,()=>this._password.togglePeek()),this.add_suffix(r),this._peekButton=r,this.setIndicatorIcon(c),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:l,object:this,revealed:e.revealed};this.notify(t)}),e(this,t)}get revealed(){return this._password.revealed}set revealed(e){this._password.setRevealed(t(e,!1))}get peeking(){return this._password.revealed}set peeking(e){this._password.setRevealed(t(e,!1))}togglePeek(){return this._password.togglePeek()}get capsLockOn(){return this._password.capsLockOn}setCapsLockOn(e){this._password.setCapsLockOn(e)}get _baseClassName(){return r}_renderPassword(e){i({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,l as NOTIFY_REVEALED,o as PasswordEntryRowState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{AdwImageButton as r}from"./adw-image-button.js";import{searchNsPreferences as i}from"./preferences-search.js";import{GridLayout as a,ItemSpec as o,Label as s,StackLayout as c}from"@nativescript/core";import{windowCloseSymbolic as l}from"@gjsify/adwaita-icons/ui";const u=`closed`;var AdwPreferencesDialog=class extends n(a){static GTypeName=`AdwPreferencesDialog`;_card;_headerBox;_titleLabel;_body;constructor(t){super(),this.className=`adw-preferences-dialog`,this.visibility=`collapse`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`));let n=new a;n.className=`adw-preferences-dialog-card`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,n.addColumn(new o(1,`star`)),n.addRow(new o(1,`auto`)),n.addRow(new o(1,`star`)),a.setColumn(n,0),a.setRow(n,0),this.addChild(n),this._card=n;let i=new a;i.className=`adw-preferences-dialog-header`,i.addColumn(new o(1,`star`)),i.addColumn(new o(1,`auto`)),i.addRow(new o(1,`auto`)),a.setRow(i,0),n.addChild(i),this._headerBox=i;let u=new s;u.className=`adw-preferences-dialog-title`,u.text=`Preferences`,a.setColumn(u,0),i.addChild(u),this._titleLabel=u;let d=new r;d.iconName=l,d.className=`${d.className} adw-preferences-dialog-close`.trim(),d.addEventListener(`tap`,()=>this.close()),a.setColumn(d,1),i.addChild(d);let f=new c;f.orientation=`vertical`,f.className=`adw-preferences-dialog-body`,a.setRow(f,1),n.addChild(f),this._body=f,e(this,t)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??`Preferences`}add(e){this._body.addChild(e)}_addChildFromBuilder(e,t){this.add(t)}remove(e){this._body.removeChild(e)}get searchPages(){let e=[],t=this._body.getChildrenCount();for(let n=0;n<t;n++){let t=this._body.getChildAt(n);typeof t.searchGroups==`function`&&e.push(t)}return e}search(e,t){return i(this.searchPages,e,t)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:u,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(e){t(e,!1)?this.present():this.close()}get body(){return this._body}};export{AdwPreferencesDialog,u as CLOSED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{ScrollView as r,StackLayout as i}from"@nativescript/core";var AdwPreferencesPage=class extends n(r){static GTypeName=`AdwPreferencesPage`;_groups;_title=``;_name=``;_iconName=``;_useUnderline=!1;constructor(t){super(),this.orientation=`vertical`,this.className=`adw-preferences-page`;let n=new i;n.orientation=`vertical`,n.className=`adw-preferences-page-content`,this.content=n,this._groups=n,e(this,t)}get title(){return this._title}set title(e){this._title=e??``}get name(){return this._name}set name(e){this._name=e??``}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,!1)}add(e){this._groups.addChild(e)}remove(e){this._groups.removeChild(e)}_addChildFromBuilder(e,t){this.add(t)}searchGroups(){let e=[],t=this._groups.getChildrenCount();for(let n=0;n<t;n++){let t=this._groups.getChildAt(n);typeof t.searchRows==`function`&&e.push(t)}return e}get groups(){return this._groups}};export{AdwPreferencesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwSidebarSection as i}from"../values/sidebar.js";import{SidebarState as a,sidebarRowClassName as o,sidebarSectionsFromLabels as s}from"./sidebar-model.js";import{GridLayout as c,ItemSpec as l,Label as u,ScrollView as d,StackLayout as f}from"@nativescript/core";const p=`notify::selected`,m=`activated`;var AdwSidebar=class extends n(d){static GTypeName=`AdwSidebar`;_list;_state=new a;_pendingSelected=null;_rows=[];constructor(t){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let n=new f;n.orientation=`vertical`,n.className=`adw-sidebar-list`,this.content=n,this._list=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:p,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)}),e(this,t)}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.Sidebar takes only Adw.SidebarSection children, not \`${t.constructor.name}\`.`);this.setSections([...this._state.sections,t])}setItems(e){this.setSections(s(Array.isArray(e)?e:[]))}setSections(e){for(let t of e)t instanceof i&&t._bindOwner(()=>this.setSections(this._state.sections));if(this._state.setSections(e),this._pendingSelected!==null&&this._pendingSelected<this._state.items.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelected(e)}this._rebuild()}_rebuild(){for(let e of this._rows)this._list.removeChild(e.view);this._rows.length=0;for(let e of this._state.visibleItems){let t=new c;t.className=`adw-sidebar-row`,t.addColumn(new l(1,`star`)),t.addRow(new l(1,`auto`));let n=new u;n.className=`adw-sidebar-row-title`,n.text=e.item.title,n.textWrap=!0,c.setColumn(n,0),t.addChild(n),e.item.visible===!1&&(t.visibility=`collapse`),e.item.enabled===!1&&(t.opacity=.5),t.addEventListener(`tap`,()=>this._activate(e.index)),r(t),this._list.addChild(t),this._rows.push({view:t,index:e.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:m,object:this,index:e,title:this._state.itemAt(e)?.title??``};this.notify(t)}_applySelection(){let e=this._state.selected,t=this._state.selectionVisible;for(let n of this._rows)n.view.className=o(n.index===e,t)}get items(){return this._state.items.map(e=>e.item.title)}set items(e){this.setItems(e)}get sections(){return this._state.sections}set sections(e){this.setSections(e)}get selected(){return this._state.selected}set selected(e){let n=t(e,this.selected);if(this._state.items.length===0){this._pendingSelected=n;return}this._state.setSelected(n)}get selectedItem(){return this._state.selectedItem}get mode(){return this._state.mode}set mode(e){this._state.setMode(e)&&this._applySelection()}get filter(){return this._state.filter}set filter(e){this._state.setFilter(e),this._rebuild()}get isEmpty(){return this._state.isEmpty}};export{m as ACTIVATED,AdwSidebar,p as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{SpinState as r,parseAdjustment as i,snapAdjustmentValue as a}from"@gjsify/adwaita-core";import{GridLayout as o,ItemSpec as s,Label as c,Slider as l,StackLayout as u}from"@nativescript/core";const d=`notify::value`;var AdwSliderRow=class extends n(u){static GTypeName=`AdwSliderRow`;_titleLabel;_valueLabel;_slider;_state=new r;_suppress=!1;constructor(t){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let n=new o;n.className=`adw-slider-header`,n.addRow(new s(1,`auto`)),n.addColumn(new s(1,`star`)),n.addColumn(new s(1,`auto`));let r=new c;r.className=`adw-slider-title`,r.textWrap=!1,o.setColumn(r,0),n.addChild(r);let i=new c;i.className=`adw-slider-value`,i.text=String(this._state.value),o.setColumn(i,1),n.addChild(i);let u=this._state.adjustment,f=new l;f.className=`adw-slider`,f.minValue=u.lower,f.maxValue=u.upper,f.value=u.value,this.addChild(n),this.addChild(f),this._titleLabel=r,this._valueLabel=i,this._slider=f,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:d,object:this,value:e.value};this.notify(t)}else this._sync()}),this._state.subscribeChanged(e=>{this._slider.minValue=e.lower,this._slider.maxValue=e.upper;let t=a(e,this._state.value);t===this._state.value?this._sync():this._state.setValue(t)}),f.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=a(this._state.adjustment,this._slider.value);e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),this._state.setValueInteractive(e)}),e(this,t)}_sync(){this._suppress=!0,this._slider.value=this._state.value,this._suppress=!1,this._valueLabel.text=String(this._state.value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._state.value}set value(e){this._state.setValue(a(this._state.adjustment,t(e,this.value)))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?i(e):e)}get slider(){return this._slider}};export{AdwSliderRow,d as NOTIFY_SLIDER_VALUE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlNumber as r}from"./xml-values.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{SpinState as o,SpinState as s,parseAdjustment as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static GTypeName=`AdwSpinRow`;static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new u;t.orientation=`horizontal`,t.className=`adw-spin-control`;let r=new l;r.className=`adw-spin-value`,r.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let o=new a;o.iconName=f,o.className=`${o.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(r),t.addChild(i),t.addChild(o),this.add_suffix(t),this._minusButton=i,this._plusButton=o,this._valueLabel=r,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),o.addEventListener(`tap`,()=>this._state.increment()),n(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(r(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?c(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,o as SpinState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{resolveSpinnerSize as i,spinnerGeometry as a}from"@gjsify/adwaita-core";import{ActivityIndicator as o,GridLayout as s,ItemSpec as c}from"@nativescript/core";var AdwSpinner=class extends n(s){static GTypeName=`AdwSpinner`;_indicator;_size=r;_spinning=!0;constructor(t){super(),this.className=`adw-spinner`,this.addRow(new c(1,`star`)),this.addColumn(new c(1,`star`));let n=new o;n.className=`adw-spinner-ring`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,this._indicator=n,this.addChild(n),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning(),e(this,t)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=a(this._size,this._size);this._indicator.width=e,this._indicator.height=e}_applySpinning(){let e=this.isLoaded!==!1;this._indicator.busy=this._spinning&&e}get spinning(){return this._spinning}set spinning(e){this._spinning=t(e,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=i(e),this._applySize()}get ringDiameter(){return a(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{assertPopupMenuAssignable as a,refuseMenuString as o}from"./popup-menu.js";import{showMenuPopup as s}from"./popup-menu-view.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{SPLIT_BUTTON_DISABLED_OPACITY as d,SplitButtonState as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";const _=`clicked`,v=`notify::direction`,y=`menuTapped`;var AdwSplitButton=class extends n(p){static GTypeName=`AdwSplitButton`;static emittedSignals=[v];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new f;_actions=null;_showingIcon=!1;_sensitive=!0;constructor(t){super(),this.className=`adw-split-button`,this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`auto`)),this.addRow(new m(1,`auto`));let n=new g;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,p.setColumn(n,0);let a=new h;a.className=`adw-split-button-label`,a.verticalAlignment=`middle`,n.addChild(a);let o=new r;o.className=`${o.className} adw-split-button-action-icon`.trim(),o.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=a,this._actionIcon=o;let s=new p;s.className=`adw-split-button-dropdown`,s.addColumn(new m(1,`star`)),s.addRow(new m(1,`star`)),p.setColumn(s,1);let c=new r;c.className=`${c.className} adw-split-button-chevron`.trim(),c.iconName=l(this._state.direction),c.horizontalAlignment=`center`,c.verticalAlignment=`middle`,s.addChild(c),this.addChild(s),this._dropdownPart=s,this._chevron=c,n.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:_,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),e(this,t)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{s(this._dropdownPart,{model:this._state.menuModel??[],actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:y,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.iconName=n??``:this._actionLabel.text=t??``,a!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(a?this._actionIcon:this._actionLabel),this._showingIcon=a),this._chevron.iconName=l(r),this._dropdownPart.opacity=i?1:d,this.opacity=this._sensitive?1:d}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){c(this._state,e)}get menuModel(){return this._state.menuModel??[]}set menuModel(e){o(e,`AdwSplitButton`),this._state.setMenuModel(e),a(this._state.menuModel??[])}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:v,object:this,value:this.get_direction()})}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(e){let n=t(e,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(e){let n=!!t(e,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,_ as CLICKED,y as MENU_TAPPED,v as NOTIFY_DIRECTION};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{SwitchRowState as n,switchClassName as r}from"./row-state.js";import{AdwActionRow as i}from"./adw-action-row.js";import{Switch as a}from"@nativescript/core";const o=`notify::active`;var AdwSwitchRow=class extends i{static GTypeName=`AdwSwitchRow`;static emittedSignals=[o];_switch;_switchState=new n;constructor(t){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new a;n.className=r(!1),this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>{n.className=r(n.checked),this._apply(this._switchState.setActive(n.checked))}),e(this,t)}get active(){return this._switchState.active}set active(e){this._apply(this._switchState.setActive(t(e,!1)))}get_active(){return this.active}set_active(e){this.active=e}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:o,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,o as NOTIFY_ACTIVE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{tabIconState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(m){static GTypeName=`AdwTabView`;_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(t){super(),this.className=`adw-tab-view`,this.addColumn(new h(1,`star`)),this.addRow(new h(1,`auto`)),this.addRow(new h(1,`star`));let n=new _;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,m.setRow(n,0),this.addChild(n),this._bar=n;let r=new m;r.addColumn(new h(1,`star`)),r.addRow(new h(1,`star`)),m.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),e(this,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 selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(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(e){let n=t(e,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)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}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:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new _;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new g;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(m.setColumn(u,0),m.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=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=p(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(){s(this._state);let e=u(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=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,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,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{activateWidgetAction as t}from"./actions.js";import{withSignals as n}from"./signals.js";import{bannerTitleText as r}from"./chrome.js";import{AdwToast as i,AdwToastQueue as a,DEFAULT_TOAST_TIMEOUT as o,ToastOverlayQueue as s}from"@gjsify/adwaita-core";import{Button as c,GridLayout as l,ItemSpec as u,Label as d}from"@nativescript/core";const f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends n(l){static GTypeName=`AdwToastOverlay`;_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(n){super(),this.className=`adw-toast-overlay`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`star`));let r=new l;r.className=`adw-toast`,r.visibility=`collapse`,r.verticalAlignment=`bottom`,r.horizontalAlignment=`center`,r.addColumn(new u(1,`star`)),r.addColumn(new u(1,`auto`)),r.addRow(new u(1,`auto`)),l.setColumn(r,0),l.setRow(r,0);let i=new d;i.className=`adw-toast-title`,i.textWrap=!0,l.setColumn(i,0),r.addChild(i),this._toastLabel=i;let a=new c;a.className=`adw-toast-button`,a.set(`androidElevation`,0),l.setColumn(a,1),a.addEventListener(`tap`,()=>{let e=this._queue.current;e&&(e.emit(`button-clicked`),e.action_name&&t(this,e.action_name),e.dismiss())}),this._toastButton=a,this.addChild(r),this._toastStrip=r,this._queue=new s({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,n)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),l.setColumn(e,0),l.setRow(e,0),this.insertChild(e,0))}get child(){return this._content}set child(e){this.set_child(e)}add_toast(e){this._queue.add_toast(e)}dismiss_all(){this._queue.dismiss_all()}_renderStrip(e){this._toastLabel.text=r(e.title,e.use_markup),e.button_label?(this._toastButton.text=e.button_label,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get toastShowing(){return this._queue.current!==null}};export{i as AdwToast,AdwToastOverlay,a as AdwToastQueue,o as DEFAULT_TOAST_TIMEOUT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{ToggleGroupState as a,ToggleGroupState as o,keptToggles as s,toggleIndexOfName as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";const d=`notify::selected`;var AdwToggleGroup=class extends n(u){static GTypeName=`AdwToggleGroup`;_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new o;constructor(t){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),e(this,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){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=s(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new u;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new l;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name===``?null:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=c(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_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(e){let n=t(e,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,a as ToggleGroupState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{defaultToolbarViewProps as a,toolbarViewClassNames as o}from"./chrome.js";import{NO_INSETS as s,insetsOwedBy as c,toolbarViewInsetPadding as l,withKeyboard as u}from"./window-insets.js";import{resolveHostInsets as d}from"./host-insets.js";import{observeWindowInsets as f}from"./window-insets-source.js";import{observeSystemBars as p}from"./system-bars-source.js";import{insetsForEdges as m,resolveEdges as h,systemBarsConfig as g}from"./system-bars.js";import{GridLayout as _,ItemSpec as v,StackLayout as y}from"@nativescript/core";const b={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},x=[`topBar`,`bottomBar`,`content`,`top`,`bottom`];var AdwToolbarView=class extends i(_){static GTypeName=`AdwToolbarView`;static builderSlots=e(x,`content`);_topBox;_bottomBox;_content=null;_props=a();_insets=s;_topBarCount=0;_bottomBarCount=0;_bottomBarShown=!1;_detachInsets=null;_detachBars=null;_detachConfig=null;_systemInsets=null;constructor(e){super(),this.className=b.view,this.addColumn(new v(1,`star`)),this.addRow(new v(1,`auto`)),this.addRow(new v(1,`star`)),this.addRow(new v(1,`auto`));let t=new y;t.orientation=`vertical`,t.className=b.topBar,_.setRow(t,0),this.addChild(t),this._topBox=t;let r=new y;r.orientation=`vertical`,r.className=b.bottomBar,_.setRow(r,2),this.addChild(r),this._bottomBox=r,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),r.addEventListener(`layoutChanged`,()=>{this._bottomBarCount>0&&this._hasShownBottomBar()!==this._bottomBarShown&&this._applyInsets(this._insets)}),this.addEventListener(`loaded`,()=>{this._detachInsets??=f(e=>this._applyInsets(e)),this._detachBars??=p(),this._detachConfig??=g.subscribe(()=>this._applyInsets(this._insets))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null,this._detachBars?.(),this._detachBars=null,this._detachConfig?.(),this._detachConfig=null}),n(this,e)}add_top_bar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}add_bottom_bar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}set_content(e){this._content&&=(this.removeChild(this._content),null),e&&(_.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,x,`content`)){case`topBar`:case`top`:this.add_top_bar(n);return;case`bottomBar`:case`bottom`:this.add_bottom_bar(n);return;default:this.set_content(n)}}get content(){return this._content}set content(e){this.set_content(e)}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get systemInsets(){return this._systemInsets}set systemInsets(e){if(typeof e==`string`){let t=/^\s*(true|false)\s*$/i.test(e);this._systemInsets=t?r(e,!0):null}else this._systemInsets=e;this._applyInsets(this._insets)}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(e){let t=r(e,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!t,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(e){let t=r(e,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!t,this._applyBarPlacement()}_applyBarPlacement(){_.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,_.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)}_hasShownBottomBar(){for(let e=0;e<this._bottomBox.getChildrenCount();e++)if(this._bottomBox.getChildAt(e).visibility===`visible`)return!0;return!1}_applyInsets(e){this._insets=e;let t=h(this._systemInsets,g.bars.insets),n=this._hasShownBottomBar(),r=l(m(c(u(e),d(this,e)),t),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0,bottomBarShown:n});this._bottomBarShown=n,this._topBox.paddingTop=r.topBarTop,this._bottomBox.paddingBottom=r.bottomBarBottom,this.paddingTop=r.contentTop,this.paddingBottom=r.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=o({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{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{resolveIdReference as a}from"./id-reference.js";import{AdwViewStack as o,NOTIFY_VISIBLE_CHILD as s}from"./adw-view-stack.js";import{createViewSwitcherBarState as c}from"./view-switcher-model.js";import{buildViewSwitcherButtons as l,viewSwitcherPagesFromStack as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";var AdwViewSwitcherBar=class extends n(d){static GTypeName=`AdwViewSwitcherBar`;static builderReferences=[`stack`];_bar;_nodes=[];_stack=null;_stackId=null;_stackListener=null;_barState=c();constructor(t){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`));let n=new d;n.className=`adw-viewswitcherbar-box`,n.addRow(new f(1,`auto`)),d.setRow(n,0),this.addChild(n),this._bar=n,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._stackId!==null&&(this.stack=a(this,`stack`,this._stackId,o)),this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack()),e(this,t)}set_stack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){if(typeof e==`string`){this._stackId=e,this.isLoaded&&(this.stack=a(this,`stack`,e,o));return}this._stackId=null,this.set_stack(e)}get reveal(){return this._barState.reveal}set reveal(e){let n=t(e,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(s,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(s,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=this._stack?.pageIcons()??[],n=l(u(e).map((e,n)=>({...e,iconName:(t[n]??``).length>0?t[n]:e.iconName})),this._stack?.visibleChildIndex??-1,`narrow`);if(n.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=n.map((e,t)=>(this._bar.addColumn(new f(1,`star`)),this._buildButton(e.pageIndex,t)))}n.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=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,t){let n=new m;n.orientation=`vertical`,n.className=`adw-viewswitcherbar-button`,n.horizontalAlignment=`stretch`;let a=new r;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,n.addChild(a);let o=new p;o.className=`adw-viewswitcherbar-button-label`,o.horizontalAlignment=`center`,o.textAlignment=`center`,n.addChild(o);let s=new p;return s.className=`adw-viewswitcherbar-button-badge`,s.horizontalAlignment=`center`,s.textAlignment=`center`,n.addChild(s),i(n),n.addEventListener(`tap`,()=>{this._stack?.selectNthPage(e)}),d.setColumn(n,t),this._bar.addChild(n),{button:n,icon:a,label:o,badge:s}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`,this.parent?.requestLayout()}};export{AdwViewSwitcherBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{DEFAULT_WRAP_BOX_SPACING as i,normalizeWrapBoxSpacing as a,wrapBoxChildFlex as o,wrapBoxChildMargin as s,wrapBoxFlexStyle as c,wrapBoxSpacingChanges as l}from"./wrap-box-layout.js";import{ADW_WRAP_BOX_DEFAULT_ALIGN as u,ADW_WRAP_BOX_DEFAULT_JUSTIFY as d,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as f,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as p,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as m,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as h,normalizeNaturalLineLength as g,normalizeWrapBoxAlign as _,normalizeWrapBoxJustify as v,normalizeWrapBoxLengthUnit as y,normalizeWrapBoxPackDirection as b,normalizeWrapPolicy as x,resolveWrapBoxChildOrder as S,wrapBoxLengthToPx as C}from"@gjsify/adwaita-core";import{FlexboxLayout as w}from"@nativescript/core";var AdwWrapBox=class extends r(w){static GTypeName=`AdwWrapBox`;_childSpacing=i;_lineSpacing=i;_childSpacingUnit=f;_lineSpacingUnit=f;_align=u;_justify=d;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=m;_packDirection=p;_orientation=`horizontal`;_naturalLineLength=h;_naturalLineLengthUnit=f;constructor(t){super(),this.className=`adw-wrap-box`,this._applyLayout(),e(this,t)}append(e){this.addChild(e)}remove(e){this.removeChild(e)}remove_all(){this.removeChildren()}addChild(e){super.addChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(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=S({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 t=n(e,this._childSpacing);l(this._childSpacing,t)&&(this._childSpacing=a(t),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=y(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let t=n(e,this._lineSpacing);l(this._lineSpacing,t)&&(this._lineSpacing=a(t),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=y(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let t=_(n(e,this.align));t!==this._align&&(this._align=t,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=v(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(e){let n=!!t(e,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(e){let n=!!t(e,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(e){let n=!!t(e,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=x(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=b(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 t=g(n(e,this.naturalLineLength));t!==this._naturalLineLength&&(this._naturalLineLength=t,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=y(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return C(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=c(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=s(C(this._childSpacing,this._childSpacingUnit),C(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=o(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),w.setFlexGrow(r,n.flexGrow),w.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{nativePlatformHost as e}from"../platform-host.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{nativePlatformHost as e}from"../platform-host.js";import{IconTheme as t}from"../namespace/gtk-platform.js";import{GioApplicationBase as n,defineWindowApplicationMembers as r,dispatchAccelerator as i,withGtkApplication as a}from"@gjsify/adwaita-core";import{Application as o,GridLayout as s}from"@nativescript/core";const c={name:`adwaita-nativescript`,requiresWindow:!0,iconTheme:()=>t.get_for_display(null),start(e){return new Promise(t=>{o.run({create(){let n=e();return t(),n??new s}})})},detach(){},exit(){o.android?.foregroundActivity?.finish?.()}};var GioApplication=class extends n{static host=c},GtkApplication=class extends a(GioApplication){static GTypeName=`GtkApplication`},AdwApplication=class extends GtkApplication{static GTypeName=`AdwApplication`};const l=`notify::application`,u=new WeakMap,parentOf=e=>e.parent;function followAccelerators(t,n){u.get(t)?.(),u.delete(t),n!==null&&u.set(t,e.listenKeys(t,e=>i(t,e,parentOf)))}function defineWindowApplication(e){r(e,(e,t)=>{followAccelerators(e,t),e.notify({eventName:l,object:e,value:t})})}export{AdwApplication,GioApplication,GtkApplication,l as NOTIFY_APPLICATION,defineWindowApplication,c as nativeScriptHost};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{gtkPropertyDoor as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{camelProperty as e,gtkPropertyDoor as t}from"./shadowed-properties.js";import{GTK_ALIGN as n,NS_HORIZONTAL_ALIGNMENT as r,NS_VERTICAL_ALIGNMENT as i,gtkAlignRefusal as a}from"./gtk-align.js";import{iconSizeNickOf as o}from"./gtk-icon-size.js";const s={horizontalAlignment:`horizontal`,verticalAlignment:`vertical`},c={iconSize:!0};function settableDoor(e,t){for(let n=e;n!==null;n=Object.getPrototypeOf(n)){let e=Object.getOwnPropertyDescriptor(n,t);if(e!==void 0)return e.set===void 0?e.get===void 0&&e.writable===!0?`data`:null:`accessor`}return null}function nsAlignment(e,t){let o=t===`horizontal`?r:i,s=null;if(typeof e==`number`){if(s=Object.keys(n).find(t=>n[t]===e)??null,s===null)throw TypeError(`${e} is not a Gtk.Align constant. The seven members are ${Object.keys(n).join(`, `)}, holding the values ${[...new Set(Object.values(n))].join(`, `)}.`)}else typeof e==`string`&&Object.hasOwn(n,e)&&(s=e);if(s===null)return e;let c=o[s];if(c!==void 0)return c;throw TypeError(`Gtk.Align '${s}' has no ${t} counterpart in NativeScript: ${a(s)} The ${t} alignments that do are ${Object.keys(o).join(`, `)}.`)}function applyConstructProps(n,r){if(r!=null)for(let[i,a]of Object.entries(r)){let r=e(i),l=t(n,r);if(l.kind===`refused`)throw TypeError(`${n.constructor.name}: ${l.why}`);if(l.kind===`verbs`){a!==void 0&&n[l.set](a);continue}if(settableDoor(n,r)===null)throw TypeError(`${n.constructor.name} has no settable '${r}'. A construct-props bag goes through the declared setters, so a key nothing declares is refused here rather than left as a dead own-property that renders nothing — the silent drop \`xml-values.ts\` exists for one door over.`);if(a===void 0)continue;let u=s[r];n[r]=u===void 0?Object.hasOwn(c,r)?o(a):a:nsAlignment(a,u)}}export{applyConstructProps,nsAlignment};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{GridLayout as a,ItemSpec as o,StackLayout as s}from"@nativescript/core";const c=[`start`,`center`,`end`];var GtkActionBar=class extends i(a){static GTypeName=`GtkActionBar`;static builderSlots=e(c,`start`);_startBox;_endBox;_centerWidget=null;_revealed=!0;constructor(e){super(),this.className=`adw-action-bar`,this.addColumn(new o(1,`star`)),this.addColumn(new o(1,`auto`)),this.addColumn(new o(1,`star`)),this.addRow(new o(1,`auto`));let t=new s;t.orientation=`horizontal`,t.className=`adw-action-bar-start`,t.horizontalAlignment=`left`,a.setColumn(t,0),this.addChild(t),this._startBox=t;let r=new s;r.orientation=`horizontal`,r.className=`adw-action-bar-end`,r.horizontalAlignment=`right`,a.setColumn(r,2),this.addChild(r),this._endBox=r,n(this,e)}pack_start(e){this._startBox.addChild(e)}pack_end(e){this._endBox.insertChild(e,0)}set_center_widget(e){this._centerWidget&&this.removeChild(this._centerWidget),this._centerWidget=e,e&&(e.verticalAlignment=`middle`,a.setColumn(e,1),this.addChild(e))}get centerWidget(){return this._centerWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}_addChildFromBuilder(e,n){switch(t(e,c,`start`)){case`center`:this.set_center_widget(n);return;case`end`:this.pack_end(n);return;default:this.pack_start(n)}}get revealed(){return this._revealed}set revealed(e){this._revealed=r(e,this._revealed),this.visibility=this._revealed?`visible`:`collapse`}};export{GtkActionBar};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{NOTIFY_HEXPAND as r,NOTIFY_VEXPAND as i}from"./widget-layout.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{DEFAULT_BOX_SPACING as o,boxChildTrack as s,boxSpacingChanges as c,boxTrackPlan as l,normalizeBoxSpacing as u,resolveBoxChildOrder as d}from"./box-layout.js";import{normalizeBoxOrientation as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m}from"@nativescript/core";var GtkBox=class extends a{static GTypeName=`GtkBox`;_spacing=o;_orientation=`horizontal`;_homogeneous=!1;_trackKey=``;_followers=new Map;constructor(t){super(),e(this,t)}append(e){this.addChild(e)}prepend(e){this.insertChild(e,0)}remove(e){this.removeChild(e)}addChild(e){super.addChild(e),this._follow(e),this._applyChildren()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._applyChildren(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}get spacing(){return this._spacing}set spacing(e){let t=n(e,this._spacing);c(this._spacing,t)&&(this._spacing=u(t),this._applyChildren(),this.notify({eventName:`notify::spacing`,object:this}))}get orientation(){return this._orientation}set orientation(e){let t=f(e===1?`vertical`:e);t!==this._orientation&&(this._orientation=t,this._applyChildren(),this.notify({eventName:`notify::orientation`,object:this}))}get homogeneous(){return this._homogeneous}set homogeneous(e){let n=t(e,this._homogeneous);n!==this._homogeneous&&(this._homogeneous=n,this._applyChildren())}_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=d({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),!0)}_follow(e){if(this._followers.has(e))return;let follower=()=>this._applyChildren();this._followers.set(e,follower),e.addEventListener(r,follower),e.addEventListener(i,follower)}_unfollow(e){let t=this._followers.get(e);t!==void 0&&(e.removeEventListener(r,t),e.removeEventListener(i,t),this._followers.delete(e))}_applyChildren(){let e=this._orientation===`vertical`,t=this._childViews(),n=l(t.map(t=>{let n=t;return(e?n.vexpand:n.hexpand)===!0}),this._spacing,this._homogeneous),r=`${e?`v`:`h`}${n.map(({unit:e,value:t})=>`${e}${t}`).join(`,`)}`;if(r!==this._trackKey){this._trackKey=r,this.removeColumns(),this.removeRows();let cross=()=>new m(1,`star`),along=e=>{for(let{unit:t,value:r}of n)e(new m(r,t))};e?(this.addColumn(cross()),along(e=>this.addRow(e))):(this.addRow(cross()),along(e=>this.addColumn(e)))}for(let[n,r]of t.entries())p.setColumn(r,e?0:s(n)),p.setRow(r,e?s(n):0)}};export{o as DEFAULT_BOX_SPACING,GtkBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{buttonSlotAfterWrite as f,buttonSlotDetaches as p}from"./button-slot.js";import{labelDisplayText as m}from"@gjsify/adwaita-core";import{GridLayout as h,ItemSpec as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(h){static GTypeName=`GtkButton`;static emittedSignals=[v];static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_tooltipText=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),this.addRow(new g(1,`star`)),this.addColumn(new g(1,`star`)),d(this),this.addEventListener(`tap`,()=>{this.notify({eventName:v,object:this}),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),t(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this._tooltipText}set tooltipText(e){let t=e??``;(this.accessibilityHint??``)===this._tooltipText&&(this.accessibilityHint=t),this._tooltipText=t,i(this,t)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=n(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=f(e,t);p(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=m(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,h.setColumn(e,0),h.setRow(e,0),this.addChild(e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n}from"./xml-values.js";import{GtkImage as r}from"./gtk-image.js";import{classNameWith as i}from"./style-classes.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{attachRowPressFeedback as o}from"./row-press.js";import{resolveIdReference as s}from"./id-reference.js";import{checkActivationFlips as c,checkGroupNeighbours as l,isRadioCheck as u,labelDisplayText as d,setCheckGroup as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h}from"@nativescript/core";import{objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`toggled`,v=`activate`,y=`notify::active`,b=`checked`,x=`inconsistent`;var S=class GtkCheckButton extends a{static GTypeName=`GtkCheckButton`;static emittedSignals=[_,v,y];static builderSlots=e([`child`],`child`);static builderReferences=[`group`];_indicator;_mark;_text;_active=!1;_inconsistent=!1;_label=null;_useUnderline=!1;_child=null;_groupId=null;constructor(e){super(),this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`star`)),this.addRow(new m(1,`auto`));let n=new p;n.className=`adw-check-indicator`,n.addColumn(new m(1,`star`)),n.addRow(new m(1,`star`)),n.verticalAlignment=`middle`,p.setColumn(n,0),p.setRow(n,0);let i=new r;i.iconName=g,i.pixelSize=14,i.iconColor=`#ffffff`,i.horizontalAlignment=`center`,i.verticalAlignment=`middle`,i.visibility=`collapse`,n.addChild(i),this.addChild(n),this._indicator=n,this._mark=i;let a=new h;a.className=`adw-check-label`,a.verticalAlignment=`middle`,a.visibility=`collapse`,p.setColumn(a,1),p.setRow(a,0),this.addChild(a),this._text=a,this.addEventListener(`loaded`,()=>this._resolveGroupId()),o(this),this.addEventListener(`tap`,()=>{c(this,this._active)&&(this._inconsistent=!1,this.active=!this._active,this._restyle(),this.notify({eventName:v,object:this}))}),this._restyle(),t(this,e)}get active(){return this._active}set active(e){let t=n(e,this._active);if(t!==this._active){if(t)for(let e of l(this))e.active=!1;this._active=t,this._restyle(),this.notify({eventName:_,object:this}),this.notify({eventName:y,object:this})}}set group(e){if(typeof e==`string`){this._groupId=e,this.isLoaded&&this.set_group(s(this,`group`,e,GtkCheckButton));return}this._groupId=null,this.set_group(e)}set_group(e){f(this,e),this._restyle(),e?._restyle()}_resolveGroupId(){let e=this._groupId;e!==null&&(this._groupId=null,this.set_group(s(this,`group`,e,GtkCheckButton)))}get inconsistent(){return this._inconsistent}set inconsistent(e){let t=n(e,this._inconsistent);t!==this._inconsistent&&(this._inconsistent=t,this._restyle(),this.notify({eventName:`notify::inconsistent`,object:this}))}get label(){return this._label}set label(e){this._label=e??null,this._paintLabel()}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=!!n(e,this._useUnderline),this._paintLabel()}_paintLabel(){this._text.text=d(this._label??``,!1,this._useUnderline),this._syncContent()}get child(){return this._child}set child(e){let t=e??null;t!==this._child&&(this._child&&this.removeChild(this._child),this._child=t,t&&(p.setColumn(t,1),p.setRow(t,0),this.addChild(t)),this._syncContent())}set_child(e){this.child=e}get_child(){return this._child}get_active(){return this._active}set_active(e){this.active=e}_addChildFromBuilder(e,t){this.child=t}_syncContent(){this._text.visibility=!this._child&&this._label?`visible`:`collapse`}get _ownClass(){return`adw-check-button`}_restyle(){let e=[];this._active&&e.push(b),this._inconsistent&&e.push(x),this.className=i(this._ownClass,[...this.styleClasses,...e]),this._indicator.className=i(`adw-check-indicator`,u(this)?[...e,`radio`]:e),this._mark.visibility=this._active||this._inconsistent?`visible`:`collapse`}};export{v as GTK_CHECK_BUTTON_ACTIVATE,b as GTK_CHECK_BUTTON_CHECKED_CLASS,x as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,_ as GTK_CHECK_BUTTON_TOGGLED,S as GtkCheckButton,y as NOTIFY_CHECK_ACTIVE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlNumber as t}from"./xml-values.js";import{AdwStyledLayoutBase as n}from"./styled-layout-base.js";const r=`Gtk.DrawingArea.set_draw_func is not supported on NativeScript: there is no cairo context to draw into. Render through a NativeScript view (an Image, or @nativescript/canvas) instead.`;var GtkDrawingArea=class extends n{static GTypeName=`GtkDrawingArea`;_contentWidth=0;_contentHeight=0;constructor(t){super(),e(this,t)}get contentWidth(){return this._contentWidth}set contentWidth(e){let n=Math.max(0,Math.trunc(t(e,this._contentWidth)));this._contentWidth=n,this.minWidth=n}get contentHeight(){return this._contentHeight}set contentHeight(e){let n=Math.max(0,Math.trunc(t(e,this._contentHeight)));this._contentHeight=n,this.minHeight=n}set_draw_func(e){throw Error(r)}queue_draw(){}};export{r as DRAWING_AREA_REFUSAL,GtkDrawingArea};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{xmlNumber as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{ComboState as s,normalizeComboOptions as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u,action as d}from"@nativescript/core";import{panDownSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::selected`,m=`notify::selected-item`;var GtkDropDown=class extends i(u){static GTypeName=`GtkDropDown`;static emittedSignals=[p,m];static builderSlots=e([`model`],`model`);_label;_chevron;_state=new s;_chooserTitle=``;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let t=new l;t.className=`adw-drop-down-label`,t.text=``;let r=new a;r.className=`adw-drop-down-chevron`,r.iconName=f,this.addChild(t),this.addChild(r),this._label=t,this._chevron=r,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive)for(let t of[p,m]){let n={eventName:t,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(n)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),n(this,e)}async _openChooser(){if(this._state.count===0)return;let e=this._state.model.map(e=>e.label),t=await d({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){this._state.setModel(c(e))}_addChildFromBuilder(e,n){if(t(e,[`model`],`child`)!==`model`)throw Error(`Gtk.DropDown takes no child widget; <${e}> is placed nowhere.`);this.model=n}get selected(){return this._state.selectedIndex}set selected(e){let t=r(e,this.selected);this._state.setSelectedIndex(t)}get_selected(){return this.selected}set_selected(e){this.selected=e}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.model[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,p as NOTIFY_SELECTED,m as NOTIFY_SELECTED_ITEM};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{ENTRY_ROW_MAX_LENGTH_LIMIT as i,clampEntryText as a,entryTextLength as o}from"@gjsify/adwaita-core";import{GridLayout as s,ItemSpec as c,TextField as l}from"@nativescript/core";const u=`notify::text`,d=`activate`,f=`changed`;var GtkEntry=class extends r(s){static GTypeName=`GtkEntry`;static emittedSignals=[f,u,d];_field;_text=``;_maxLength=0;constructor(t){super(),this.className=`adw-entry`,this.addColumn(new c(1,`star`)),this.addRow(new c(1,`auto`));let n=new l;n.className=`adw-entry-input`,n.set(`backgroundColor`,`transparent`),n.set(`borderWidth`,0),this.addChild(n),this._field=n,n.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),n.addEventListener(`returnPress`,()=>{let e={eventName:d,object:this};this.notify(e)}),e(this,t)}_applyText(e){let t=a(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:u,object:this,text:t,textLength:o(t)};this.notify({eventName:f,object:this}),this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return o(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let t=n(e,this.maxLength);this._maxLength=Number.isFinite(t)?Math.min(i,Math.max(0,Math.trunc(t))):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(e){let n=t(e,this.editable);this._field.editable=!!n}get field(){return this._field}};export{d as ACTIVATE,f as CHANGED,GtkEntry,u as NOTIFY_TEXT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{lengthValue as t}from"./ns-length.js";import{xmlBoolean as n,xmlNumber as r}from"./xml-values.js";import{AdwStyledLayoutBase as i}from"./styled-layout-base.js";import{gridChildAt as a,gridGap as o,gridSpacing as s,gridTrackCounts as c}from"./grid-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=[`colChange`,`rowChange`,`colSpanChange`,`rowSpanChange`];var GtkGrid=class extends i{static GTypeName=`GtkGrid`;_rowSpacing=0;_columnSpacing=0;_rowHomogeneous=!1;_columnHomogeneous=!1;_columnKey=``;_rowKey=``;_gaps=new Map;_followers=new Map;constructor(t){super(),e(this,t)}attach(e,t,n,r=1,i=1){e.column=t,e.row=n,e.columnSpan=r,e.rowSpan=i,this.addChild(e)}remove(e){this.removeChild(e)}get_child_at(e,t){return a(this._placed(),e,t)}addChild(e){super.addChild(e),this._follow(e),this._relayout()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._relayout(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._relayout()}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){let t=s(r(e,NaN),e,this._rowSpacing,`rowSpacing`);t!==this._rowSpacing&&(this._rowSpacing=t,this._relayout())}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){let t=s(r(e,NaN),e,this._columnSpacing,`columnSpacing`);t!==this._columnSpacing&&(this._columnSpacing=t,this._relayout())}get rowHomogeneous(){return this._rowHomogeneous}set rowHomogeneous(e){let t=n(e,this._rowHomogeneous);t!==this._rowHomogeneous&&(this._rowHomogeneous=t,this._relayout())}get columnHomogeneous(){return this._columnHomogeneous}set columnHomogeneous(e){let t=n(e,this._columnHomogeneous);t!==this._columnHomogeneous&&(this._columnHomogeneous=t,this._relayout())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_placementOf(e){return{column:l.getColumn(e),row:l.getRow(e),columnSpan:l.getColumnSpan(e),rowSpan:l.getRowSpan(e)}}_placed(){return this._childViews().map(e=>({child:e,placement:this._placementOf(e)}))}_follow(e){if(this._followers.has(e))return;let follower=()=>this._relayout();this._followers.set(e,follower);for(let t of d)e.addEventListener(t,follower)}_unfollow(e){let t=this._followers.get(e);if(t!==void 0){for(let n of d)e.removeEventListener(n,t);this._followers.delete(e),this._withGap(e,{left:0,top:0}),this._gaps.delete(e)}}_withGap(e,n){let r=this._gaps.get(e)??{left:0,top:0};r.left!==n.left&&(e.marginLeft=(t(e.marginLeft)??0)-r.left+n.left),r.top!==n.top&&(e.marginTop=(t(e.marginTop)??0)-r.top+n.top),this._gaps.set(e,n)}_relayout(){let e=this._placed(),{columns:t,rows:n}=c(e.map(({placement:e})=>e));this._syncTracks(t,n);for(let{child:t,placement:n}of e)this._withGap(t,o(n,this._columnSpacing,this._rowSpacing))}_syncTracks(e,t){let n=`${e}:${this._columnHomogeneous}`,r=`${t}:${this._rowHomogeneous}`;if(n!==this._columnKey){this.removeColumns();for(let t=0;t<e;t++)this.addColumn(new u(1,this._columnHomogeneous?`star`:`auto`));this._columnKey=n}if(r!==this._rowKey){this.removeRows();for(let e=0;e<t;e++)this.addRow(new u(1,this._rowHomogeneous?`star`:`auto`));this._rowKey=r}}};export{GtkGrid};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_PIXEL_SIZE as e,gtkIconSizeNick as t,iconPixelSize as n,storedPixelSize as r}from"./gtk-icon-size.js";import{applyConstructProps as i}from"./construct-props.js";import{xmlNumber as a}from"./xml-values.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{Image as f}from"@nativescript/core";const p=e;var GtkImage=class extends o(f){static GTypeName=`GtkImage`;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this._applySize(),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),i(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return n(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this.width=e,this.height=e,this._render()}_render(){u(this,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._render()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=t(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(e){this._pixelSize=r(a(e,this._pixelSize)),this._applySize()}};export{p as DEFAULT_GTK_IMAGE_SIZE,GtkImage};
|