@gjsify/adwaita-nativescript 0.47.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. package/lib/esm/_virtual/_rolldown/runtime.js +1 -1
  2. package/lib/esm/index.js +1 -1
  3. package/lib/esm/namespace/adw.js +1 -0
  4. package/lib/esm/namespace/gtk.js +1 -0
  5. package/lib/esm/widgets/adw-about-dialog.js +1 -1
  6. package/lib/esm/widgets/adw-action-row.js +1 -1
  7. package/lib/esm/widgets/adw-alert-dialog.js +1 -1
  8. package/lib/esm/widgets/adw-avatar.js +1 -1
  9. package/lib/esm/widgets/adw-banner.js +1 -1
  10. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  11. package/lib/esm/widgets/adw-button-content.js +1 -1
  12. package/lib/esm/widgets/adw-button-row.js +1 -1
  13. package/lib/esm/widgets/adw-carousel.js +1 -1
  14. package/lib/esm/widgets/adw-clamp.js +1 -1
  15. package/lib/esm/widgets/adw-combo-row.js +1 -1
  16. package/lib/esm/widgets/adw-data-grid.js +1 -1
  17. package/lib/esm/widgets/adw-entry-row.js +1 -1
  18. package/lib/esm/widgets/adw-expander-row.js +1 -1
  19. package/lib/esm/widgets/adw-header-bar.js +1 -1
  20. package/lib/esm/widgets/adw-image-button.js +1 -1
  21. package/lib/esm/widgets/adw-inline-view-switcher.js +1 -1
  22. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  23. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  24. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  25. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  26. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  27. package/lib/esm/widgets/adw-preferences-group.js +1 -1
  28. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  29. package/lib/esm/widgets/adw-shortcut-label.js +1 -1
  30. package/lib/esm/widgets/adw-sidebar.js +1 -1
  31. package/lib/esm/widgets/adw-slider-row.js +1 -1
  32. package/lib/esm/widgets/adw-spin-row.js +1 -1
  33. package/lib/esm/widgets/adw-spinner.js +1 -1
  34. package/lib/esm/widgets/adw-split-button.js +1 -1
  35. package/lib/esm/widgets/adw-status-page.js +1 -1
  36. package/lib/esm/widgets/adw-switch-row.js +1 -1
  37. package/lib/esm/widgets/adw-tab-view.js +1 -1
  38. package/lib/esm/widgets/adw-toast-overlay.js +1 -1
  39. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  40. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  41. package/lib/esm/widgets/adw-view-stack.js +1 -1
  42. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  43. package/lib/esm/widgets/adw-view-switcher.js +1 -1
  44. package/lib/esm/widgets/adw-window-title.js +1 -1
  45. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  46. package/lib/esm/widgets/avatar-view.js +1 -0
  47. package/lib/esm/widgets/box-layout.js +1 -0
  48. package/lib/esm/widgets/button-content.js +1 -1
  49. package/lib/esm/widgets/button-slot.js +1 -0
  50. package/lib/esm/widgets/construct-props.js +1 -0
  51. package/lib/esm/widgets/entry-row-view.js +1 -1
  52. package/lib/esm/widgets/gtk-align.js +1 -0
  53. package/lib/esm/widgets/gtk-box.js +1 -0
  54. package/lib/esm/widgets/gtk-button.js +1 -1
  55. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  56. package/lib/esm/widgets/gtk-entry.js +1 -1
  57. package/lib/esm/widgets/gtk-image.js +1 -0
  58. package/lib/esm/widgets/gtk-label.js +1 -0
  59. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  60. package/lib/esm/widgets/icon-theme.js +1 -0
  61. package/lib/esm/widgets/index.js +1 -1
  62. package/lib/esm/widgets/label-text.js +1 -0
  63. package/lib/esm/widgets/menu-sheet.js +1 -0
  64. package/lib/esm/widgets/signals.js +1 -0
  65. package/lib/esm/widgets/split-button.js +1 -1
  66. package/lib/esm/widgets/split-view-base.js +1 -1
  67. package/lib/esm/widgets/style-classes.js +1 -0
  68. package/lib/esm/widgets/view-switcher-base.js +1 -1
  69. package/lib/esm/widgets/view-switcher-model.js +1 -1
  70. package/lib/types/avatar.spec.d.ts +2 -0
  71. package/lib/types/box-layout.spec.d.ts +2 -0
  72. package/lib/types/button-slot.spec.d.ts +2 -0
  73. package/lib/types/construct-props.spec.d.ts +2 -0
  74. package/lib/types/icon-theme.spec.d.ts +2 -0
  75. package/lib/types/index.d.ts +4 -3
  76. package/lib/types/label-text.spec.d.ts +2 -0
  77. package/lib/types/namespace/adw.d.ts +38 -0
  78. package/lib/types/namespace/gtk.d.ts +7 -0
  79. package/lib/types/signals.spec.d.ts +2 -0
  80. package/lib/types/style-classes.spec.d.ts +2 -0
  81. package/lib/types/widgets/adw-about-dialog.d.ts +16 -3
  82. package/lib/types/widgets/adw-action-row.d.ts +38 -10
  83. package/lib/types/widgets/adw-alert-dialog.d.ts +30 -13
  84. package/lib/types/widgets/adw-avatar.d.ts +49 -3
  85. package/lib/types/widgets/adw-banner.d.ts +16 -3
  86. package/lib/types/widgets/adw-bottom-sheet.d.ts +32 -16
  87. package/lib/types/widgets/adw-button-content.d.ts +20 -6
  88. package/lib/types/widgets/adw-button-row.d.ts +10 -7
  89. package/lib/types/widgets/adw-carousel.d.ts +19 -7
  90. package/lib/types/widgets/adw-clamp.d.ts +17 -5
  91. package/lib/types/widgets/adw-combo-row.d.ts +8 -7
  92. package/lib/types/widgets/adw-data-grid.d.ts +17 -4
  93. package/lib/types/widgets/adw-entry-row.d.ts +16 -14
  94. package/lib/types/widgets/adw-expander-row.d.ts +21 -10
  95. package/lib/types/widgets/adw-header-bar.d.ts +39 -14
  96. package/lib/types/widgets/adw-image-button.d.ts +22 -5
  97. package/lib/types/widgets/adw-inline-view-switcher.d.ts +2 -1
  98. package/lib/types/widgets/adw-navigation-split-view.d.ts +2 -1
  99. package/lib/types/widgets/adw-navigation-view.d.ts +40 -21
  100. package/lib/types/widgets/adw-overlay-split-view.d.ts +3 -2
  101. package/lib/types/widgets/adw-password-entry-row.d.ts +2 -1
  102. package/lib/types/widgets/adw-preferences-dialog.d.ts +16 -3
  103. package/lib/types/widgets/adw-preferences-group.d.ts +19 -6
  104. package/lib/types/widgets/adw-preferences-page.d.ts +37 -8
  105. package/lib/types/widgets/adw-shortcut-label.d.ts +15 -2
  106. package/lib/types/widgets/adw-sidebar.d.ts +15 -2
  107. package/lib/types/widgets/adw-slider-row.d.ts +30 -19
  108. package/lib/types/widgets/adw-spin-row.d.ts +18 -14
  109. package/lib/types/widgets/adw-spinner.d.ts +14 -2
  110. package/lib/types/widgets/adw-split-button.d.ts +60 -12
  111. package/lib/types/widgets/adw-status-page.d.ts +22 -8
  112. package/lib/types/widgets/adw-switch-row.d.ts +2 -1
  113. package/lib/types/widgets/adw-tab-view.d.ts +34 -8
  114. package/lib/types/widgets/adw-toast-overlay.d.ts +19 -7
  115. package/lib/types/widgets/adw-toggle-group.d.ts +14 -2
  116. package/lib/types/widgets/adw-toolbar-view.d.ts +21 -8
  117. package/lib/types/widgets/adw-view-stack.d.ts +38 -5
  118. package/lib/types/widgets/adw-view-switcher-bar.d.ts +16 -3
  119. package/lib/types/widgets/adw-view-switcher.d.ts +2 -1
  120. package/lib/types/widgets/adw-window-title.d.ts +16 -3
  121. package/lib/types/widgets/adw-wrap-box.d.ts +21 -8
  122. package/lib/types/widgets/avatar-view.d.ts +57 -0
  123. package/lib/types/widgets/bottom-sheet-state.d.ts +1 -1
  124. package/lib/types/widgets/box-layout.d.ts +39 -0
  125. package/lib/types/widgets/button-content.d.ts +4 -4
  126. package/lib/types/widgets/button-slot.d.ts +16 -0
  127. package/lib/types/widgets/construct-props.d.ts +82 -0
  128. package/lib/types/widgets/entry-row-view.d.ts +9 -8
  129. package/lib/types/widgets/gtk-align.d.ts +59 -0
  130. package/lib/types/widgets/gtk-box.d.ts +75 -0
  131. package/lib/types/widgets/gtk-button.d.ts +110 -28
  132. package/lib/types/widgets/gtk-drop-down.d.ts +21 -8
  133. package/lib/types/widgets/gtk-entry.d.ts +15 -2
  134. package/lib/types/widgets/gtk-image.d.ts +42 -0
  135. package/lib/types/widgets/gtk-label.d.ts +82 -0
  136. package/lib/types/widgets/gtk-menu-button.d.ts +29 -18
  137. package/lib/types/widgets/icon-theme.d.ts +77 -0
  138. package/lib/types/widgets/icons.d.ts +3 -1
  139. package/lib/types/widgets/index.d.ts +18 -5
  140. package/lib/types/widgets/label-text.d.ts +13 -0
  141. package/lib/types/widgets/menu-sheet.d.ts +58 -0
  142. package/lib/types/widgets/row-state.d.ts +1 -1
  143. package/lib/types/widgets/signals.d.ts +40 -0
  144. package/lib/types/widgets/split-button.d.ts +2 -21
  145. package/lib/types/widgets/split-view-base.d.ts +18 -6
  146. package/lib/types/widgets/status-page-content.d.ts +1 -1
  147. package/lib/types/widgets/style-classes.d.ts +61 -0
  148. package/lib/types/widgets/view-switcher-base.d.ts +12 -1
  149. package/lib/types/widgets/view-switcher-model.d.ts +3 -12
  150. package/package.json +14 -10
  151. package/src/theme/adwaita.css +66 -8
  152. package/lib/esm/namespace.js +0 -1
  153. package/lib/esm/widgets/adw-icon.js +0 -1
  154. package/lib/types/namespace.d.ts +0 -92
  155. package/lib/types/widgets/adw-icon.d.ts +0 -25
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{DEFAULT_SPINNER_SIZE as t}from"./chrome.js";import{ActivityIndicator as n,GridLayout as r,ItemSpec as i}from"@nativescript/core";import{resolveSpinnerSize as a,spinnerGeometry as o}from"@gjsify/adwaita-core";var AdwSpinner=class extends r{_indicator;_size=t;_spinning=!0;constructor(){super(),this.className=`adw-spinner`,this.addRow(new i(1,`star`)),this.addColumn(new i(1,`star`));let e=new n;e.className=`adw-spinner-ring`,e.horizontalAlignment=`center`,e.verticalAlignment=`center`,this._indicator=e,this.addChild(e),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning()}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=o(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(t){this._spinning=e(t,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=a(e),this._applySize()}get ringDiameter(){return o(this._size,this._size).diameter}};export{AdwSpinner,t as DEFAULT_SPINNER_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{ActivityIndicator as i,GridLayout as a,ItemSpec as o}from"@nativescript/core";import{resolveSpinnerSize as s,spinnerGeometry as c}from"@gjsify/adwaita-core";var AdwSpinner=class extends n(a){_indicator;_size=r;_spinning=!0;constructor(e){super(),this.className=`adw-spinner`,this.addRow(new o(1,`star`)),this.addColumn(new o(1,`star`));let n=new i;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(),t(this,e)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=c(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(t){this._spinning=e(t,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=s(e),this._applySize()}get ringDiameter(){return c(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{MENU_CANCEL_LABEL as r,menuSheetActions as i,resolveMenuChoice as a,setActionIcon as o,splitButtonArrowSvg as s,toMenuEntries as c}from"./split-button.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f,action as p}from"@nativescript/core";import{SPLIT_BUTTON_DISABLED_OPACITY as m,SplitButtonState as h}from"@gjsify/adwaita-core";const g=`clicked`,_=`menuTapped`;var AdwSplitButton=class extends l{_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new h;_showingIcon=!1;_sensitive=!0;constructor(){super(),this.className=`adw-split-button`,this.addColumn(new u(1,`auto`)),this.addColumn(new u(1,`auto`)),this.addRow(new u(1,`auto`));let e=new f;e.orientation=`horizontal`,e.className=`adw-split-button-action`,e.horizontalAlignment=`center`,l.setColumn(e,0);let r=new d;r.className=`adw-split-button-label`,r.verticalAlignment=`middle`,e.addChild(r);let i=new t;i.className=`${i.className} adw-split-button-action-icon`.trim(),i.verticalAlignment=`middle`,this.addChild(e),this._actionPart=e,this._actionLabel=r,this._actionIcon=i;let a=new l;a.className=`adw-split-button-dropdown`,a.addColumn(new u(1,`star`)),a.addRow(new u(1,`star`)),l.setColumn(a,1);let o=new t;o.className=`${o.className} adw-split-button-chevron`.trim(),o.iconName=s(this._state.direction),o.horizontalAlignment=`center`,o.verticalAlignment=`middle`,a.addChild(o),this.addChild(a),this._dropdownPart=a,this._chevron=o,e.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:g,object:this};this.notify(e)}),a.addEventListener(`tap`,()=>{this._openMenu()}),n(e),n(a),this._state.subscribe(()=>this._render()),this._render()}async _openMenu(){if(!this._sensitive||this._state.open||!this._state.dropdownEnabled)return;let e=i(this._state.menuModel??[],r);this._state.toggleMenu();let t=a(e,await p({title:this._state.label||void 0,cancelButtonText:r,actions:e})),n=this._state.activateMenuEntry(t);if(n===null){this._state.closeMenu();return}let o={eventName:_,object:this,item:n.label,index:t,action:n.action};this.notify(o)}_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=s(r),this._dropdownPart.opacity=i?1:m,this.opacity=this._sensitive?1:m}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){o(this._state,e)}get menu(){return this._state.menuModel??[]}set menu(e){this._state.setMenuModel(c(e))}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,g as CLICKED,_ as MENU_TAPPED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.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{MENU_CANCEL_LABEL as a,presentMenuSheet as o,refuseMenuString as s}from"./menu-sheet.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p,action as m}from"@nativescript/core";import{ADW_MENU_SURFACE_NATIVESCRIPT as h,SPLIT_BUTTON_DISABLED_OPACITY as g,SplitButtonState as _,assertMenuRenderable as v}from"@gjsify/adwaita-core";const y=`clicked`,b=`menuTapped`;var AdwSplitButton=class extends n(u){_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new _;_actions=null;_showingIcon=!1;_sensitive=!0;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new d(1,`auto`)),this.addColumn(new d(1,`auto`)),this.addRow(new d(1,`auto`));let n=new p;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,u.setColumn(n,0);let a=new f;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 u;s.className=`adw-split-button-dropdown`,s.addColumn(new d(1,`star`)),s.addRow(new d(1,`star`)),u.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:y,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}async _openMenu(){if(!this._sensitive||this._state.open||!this._state.dropdownEnabled)return;this._state.toggleMenu();let e=await o(m,this._state.menuModel??[],{title:this._state.label??void 0,actions:this._actions??void 0,cancelLabel:a}),t=e===null?null:this._state.activateMenuItem(e);if(t===null||e===null){this._state.closeMenu();return}let n={eventName:b,object:this,item:t.label,id:t.id??t.label,path:e,action:t.action};this.notify(n)}_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:g,this.opacity=this._sensitive?1:g}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){s(e,`AdwSplitButton`),this._state.setMenuModel(e),v(this._state.menuModel??[],h)}get actions(){return this._actions}set actions(e){this._actions=e??null}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,y as CLICKED,b as MENU_TAPPED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwIcon as e}from"./adw-icon.js";import{statusPageIconVisibility as t,statusPageLabelVisibility as n}from"./status-page-content.js";import{GridLayout as r,ItemSpec as i,Label as a,StackLayout as o}from"@nativescript/core";var AdwStatusPage=class extends r{_stack;_icon;_iconSvg=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;constructor(){super(),this.className=`adw-status-page`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let s=new o;s.orientation=`vertical`,s.className=`adw-status-page-content`,s.horizontalAlignment=`center`,s.verticalAlignment=`middle`,r.setColumn(s,0),r.setRow(s,0),this.addChild(s),this._stack=s;let c=new e;c.className=`${c.className} adw-status-page-icon`.trim(),c.horizontalAlignment=`center`,c.iconColor=`#9b9b9b`,c.iconSize=96,c.visibility=t(this._iconSvg),this._icon=c;let l=new a;l.className=`adw-status-page-icon-glyph`,l.horizontalAlignment=`center`,l.visibility=t(this._iconGlyph),this._iconLabel=l;let u=new a;u.className=`adw-status-page-title`,u.horizontalAlignment=`center`,u.textWrap=!0,u.visibility=n(u.text),this._titleLabel=u;let d=new a;d.className=`adw-status-page-description`,d.horizontalAlignment=`center`,d.textWrap=!0,d.visibility=n(d.text),this._descriptionLabel=d;for(let e of[c,l,u,d])s.addChild(e)}get iconName(){return this._iconSvg}set iconName(e){this._iconSvg=e??``,this._icon.iconName=this._iconSvg,this._icon.visibility=t(this._iconSvg),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=t(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=n(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=n(t)}setChild(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}_addChildFromBuilder(e,t){this.setChild(t)}};export{AdwStatusPage};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{GtkImage as n}from"./gtk-image.js";import{statusPageIconVisibility as r,statusPageLabelVisibility as i}from"./status-page-content.js";import{GridLayout as a,ItemSpec as o,Label as s,StackLayout as c}from"@nativescript/core";var AdwStatusPage=class extends t(a){_stack;_icon;_iconName=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;constructor(t){super(),this.className=`adw-status-page`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`));let l=new c;l.orientation=`vertical`,l.className=`adw-status-page-content`,l.horizontalAlignment=`center`,l.verticalAlignment=`middle`,a.setColumn(l,0),a.setRow(l,0),this.addChild(l),this._stack=l;let u=new n;u.className=`${u.className} adw-status-page-icon`.trim(),u.horizontalAlignment=`center`,u.iconColor=`#9b9b9b`,u.iconSize=96,u.visibility=r(this._iconName),this._icon=u;let d=new s;d.className=`adw-status-page-icon-glyph`,d.horizontalAlignment=`center`,d.visibility=r(this._iconGlyph),this._iconLabel=d;let f=new s;f.className=`adw-status-page-title`,f.horizontalAlignment=`center`,f.textWrap=!0,f.visibility=i(f.text),this._titleLabel=f;let p=new s;p.className=`adw-status-page-description`,p.horizontalAlignment=`center`,p.textWrap=!0,p.visibility=i(p.text),this._descriptionLabel=p;for(let e of[u,d,f,p])l.addChild(e);e(this,t)}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._icon.iconName=this._iconName,this._icon.visibility=r(this._iconName),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=r(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=i(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=i(t)}set_child(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}_addChildFromBuilder(e,t){this.set_child(t)}};export{AdwStatusPage};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{SwitchRowState as t}from"./row-state.js";import{AdwActionRow as n}from"./adw-action-row.js";import{Switch as r}from"@nativescript/core";const i=`notify::active`;var AdwSwitchRow=class extends n{_switch;_switchState=new t;constructor(){super(),this.className=`adw-row adw-action-row adw-switch-row`;let e=new r;e.className=`adw-switch`,this.setSuffix(e),this._switch=e,this.activatableWidget=e,this.activatable=!0,e.addEventListener(`checkedChange`,()=>this._apply(this._switchState.setActive(e.checked)))}get active(){return this._switchState.active}set active(t){this._apply(this._switchState.setActive(e(t,!1)))}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:i,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,i as NOTIFY_ACTIVE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{SwitchRowState as n}from"./row-state.js";import{AdwActionRow as r}from"./adw-action-row.js";import{Switch as i}from"@nativescript/core";const a=`notify::active`;var AdwSwitchRow=class extends r{_switch;_switchState=new n;constructor(e){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new i;n.className=`adw-switch`,this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>this._apply(this._switchState.setActive(n.checked))),t(this,e)}get active(){return this._switchState.active}set active(t){this._apply(this._switchState.setActive(e(t,!1)))}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:a,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,a as NOTIFY_ACTIVE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{AdwIcon as n}from"./adw-icon.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwImageButton as i}from"./adw-image-button.js";import{applyTabViewVisibility as a,createTabViewState as o,tabBarVisibility as s,tabCloseVisibilities as c,tabLabelText as l,tabViewNotifyPayload as u}from"./tab-view-state.js";import{GridLayout as d,ItemSpec as f,Label as p,StackLayout as m}from"@nativescript/core";import{tabIconState as h}from"@gjsify/adwaita-core";import{windowCloseSymbolic as g}from"@gjsify/adwaita-icons/ui";const _=`notify::selected-page`,v=`pages-changed`,y=`close-page`;var AdwTabView=class extends d{_state=o({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(){super(),this.className=`adw-tab-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`)),this.addRow(new f(1,`star`));let e=new m;e.orientation=`horizontal`,e.horizontalAlignment=`stretch`,e.className=`adw-tab-view-bar`,d.setRow(e,0),this.addChild(e),this._bar=e;let t=new d;t.addColumn(new f(1,`star`)),t.addRow(new f(1,`star`)),d.setRow(t,1),this.addChild(t),this._contentArea=t,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:_,object:this,...u(e)};this.notify(t)})}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selected(){return this._state.selectedIndex}set selected(e){let n=t(e,this.selected);this._state.selectNthPage(n)}isClosing(e){return this._state.isClosing(e)}setSelectedPage(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}selectPreviousPage(){return this._state.selectPreviousPage()}selectNextPage(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}addPage(e,t=null){return this._state.addPage(e,t)}insertPage(e,t){return this._state.insertPage(e,t)}prependPage(e){return this._state.prependPage(e)}appendPage(e){return this._state.appendPage(e)}insertPinnedPage(e,t){return this._state.insertPinnedPage(e,t)}prependPinnedPage(e){return this._state.prependPinnedPage(e)}appendPinnedPage(e){return this._state.appendPinnedPage(e)}setPagePinned(e,t){return this._state.setPagePinned(e,t)}closePage(e){return this._state.closePage(e)}closePageFinish(e,t){return this._state.closePageFinish(e,t)}closeOtherPages(e){this._state.closeOtherPages(e)}closePagesBefore(e){this._state.closePagesBefore(e)}closePagesAfter(e){this._state.closePagesAfter(e)}detachPage(e){return this._state.detachPage(e)}reorderPage(e,t){return this._state.reorderPage(e,t)}reorderBackward(e){return this._state.reorderBackward(e)}reorderForward(e){return this._state.reorderForward(e)}reorderFirst(e){return this._state.reorderFirst(e)}reorderLast(e){return this._state.reorderLast(e)}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:v,object:this,...e};this.notify(t)}_insertChip(e,t){let a=new m;a.orientation=`horizontal`,a.className=`adw-tab-view-tab`,a.verticalAlignment=`middle`;let o=new n;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,a.addChild(o);let s=new n;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,a.addChild(s);let c=new p;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,a.addChild(c);let l=new i;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=g,l.iconSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),a.addChild(l),r(a),a.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(a,t),this._chips.set(e.id,{button:a,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(d.setColumn(u,0),d.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=l(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=h(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){a(this._state);let e=c(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=s(this._state,this._autohide)}_requestClose(e){let t={eventName:y,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,y as CLOSE_PAGE,_ as NOTIFY_SELECTED_PAGE,v as PAGES_CHANGED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.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{applyTabViewVisibility as o,createTabViewState as s,tabBarVisibility as c,tabCloseVisibilities as l,tabLabelText as u,tabViewNotifyPayload as d}from"./tab-view-state.js";import{GridLayout as f,ItemSpec as p,Label as m,StackLayout as h}from"@nativescript/core";import{tabIconState as g}from"@gjsify/adwaita-core";import{windowCloseSymbolic as _}from"@gjsify/adwaita-icons/ui";const v=`notify::selected-page`,y=`pages-changed`,b=`close-page`;var AdwTabView=class extends n(f){_state=s({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(e){super(),this.className=`adw-tab-view`,this.addColumn(new p(1,`star`)),this.addRow(new p(1,`auto`)),this.addRow(new p(1,`star`));let n=new h;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,f.setRow(n,0),this.addChild(n),this._bar=n;let r=new f;r.addColumn(new p(1,`star`)),r.addRow(new p(1,`star`)),f.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:v,object:this,...d(e)};this.notify(t)}),t(this,e)}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()}addPage(e,t=null){return this._state.addPage(e,t)}insertPage(e,t){return this._state.insertPage(e,t)}prependPage(e){return this._state.prependPage(e)}appendPage(e){return this._state.appendPage(e)}insertPinnedPage(e,t){return this._state.insertPinnedPage(e,t)}prependPinnedPage(e){return this._state.prependPinnedPage(e)}appendPinnedPage(e){return this._state.appendPinnedPage(e)}setPagePinned(e,t){return this._state.setPagePinned(e,t)}closePage(e){return this._state.closePage(e)}closePageFinish(e,t){return this._state.closePageFinish(e,t)}closeOtherPages(e){this._state.closeOtherPages(e)}closePagesBefore(e){this._state.closePagesBefore(e)}closePagesAfter(e){this._state.closePagesAfter(e)}detachPage(e){return this._state.detachPage(e)}reorderPage(e,t){return this._state.reorderPage(e,t)}reorderBackward(e){return this._state.reorderBackward(e)}reorderForward(e){return this._state.reorderForward(e)}reorderFirst(e){return this._state.reorderFirst(e)}reorderLast(e){return this._state.reorderLast(e)}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:y,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new h;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 m;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=_,l.iconSize=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&&(f.setColumn(u,0),f.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=u(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=g(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(){o(this._state);let e=l(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=c(this._state,this._autohide)}_requestClose(e){let t={eventName:b,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,b as CLOSE_PAGE,v as NOTIFY_SELECTED_PAGE,y as PAGES_CHANGED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{Button as e,GridLayout as t,ItemSpec as n,Label as r}from"@nativescript/core";import{AdwToast as i,AdwToast as a,AdwToastQueue as o,AdwToastQueue as s,DEFAULT_TOAST_TIMEOUT as c}from"@gjsify/adwaita-core";const l=`toastButtonClicked`,u={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t{_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(){super(),this.className=`adw-toast-overlay`,this.addColumn(new n(1,`star`)),this.addRow(new n(1,`star`));let i=new t;i.className=`adw-toast`,i.visibility=`collapse`,i.verticalAlignment=`bottom`,i.horizontalAlignment=`center`,i.addColumn(new n(1,`star`)),i.addColumn(new n(1,`auto`)),i.addRow(new n(1,`auto`)),t.setColumn(i,0),t.setRow(i,0);let a=new r;a.className=`adw-toast-title`,a.textWrap=!0,t.setColumn(a,0),i.addChild(a),this._toastLabel=a;let o=new e;o.className=`adw-toast-button`,o.set(`androidElevation`,0),t.setColumn(o,1),o.addEventListener(`tap`,()=>{let e={eventName:l,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=o,this.addChild(i),this._toastStrip=i,this._queue=new s({scheduler:u,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}})}setContent(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),t.setColumn(e,0),t.setRow(e,0),this.insertChild(e,0))}addToast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new a(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get visible(){return this._queue.showing}};export{i as AdwToast,AdwToastOverlay,o as AdwToastQueue,c as DEFAULT_TOAST_TIMEOUT,l as TOAST_BUTTON_CLICKED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Button as n,GridLayout as r,ItemSpec as i,Label as a}from"@nativescript/core";import{AdwToast as o,AdwToast as s,AdwToastQueue as c,AdwToastQueue as l,DEFAULT_TOAST_TIMEOUT as u}from"@gjsify/adwaita-core";const d=`toastButtonClicked`,f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t(r){_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(t){super(),this.className=`adw-toast-overlay`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let o=new r;o.className=`adw-toast`,o.visibility=`collapse`,o.verticalAlignment=`bottom`,o.horizontalAlignment=`center`,o.addColumn(new i(1,`star`)),o.addColumn(new i(1,`auto`)),o.addRow(new i(1,`auto`)),r.setColumn(o,0),r.setRow(o,0);let s=new a;s.className=`adw-toast-title`,s.textWrap=!0,r.setColumn(s,0),o.addChild(s),this._toastLabel=s;let c=new n;c.className=`adw-toast-button`,c.set(`androidElevation`,0),r.setColumn(c,1),c.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=c,this.addChild(o),this._toastStrip=o,this._queue=new l({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,t)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),r.setColumn(e,0),r.setRow(e,0),this.insertChild(e,0))}add_toast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new s(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get visible(){return this._queue.showing}};export{o as AdwToast,AdwToastOverlay,c as AdwToastQueue,u as DEFAULT_TOAST_TIMEOUT,d as TOAST_BUTTON_CLICKED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{Label as n,StackLayout as r}from"@nativescript/core";import{ToggleGroupState as i,ToggleGroupState as a}from"@gjsify/adwaita-core";const o=`notify::selected`;var AdwToggleGroup=class extends r{_toggles=[];_segments=[];_state=new a;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:o,object:this,selected:e.selected,value:e.value};this.notify(t)})}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=Array.isArray(e)?e:[],this._toggles.forEach((e,i)=>{let a=new r;if(a.orientation=`horizontal`,a.className=`adw-toggle-button`,a.horizontalAlignment=`center`,e.icon){let n=new t;n.className=`${n.className} adw-toggle-icon`.trim(),n.verticalAlignment=`middle`,n.iconName=e.icon,a.addChild(n)}let o=new n;o.text=e.label,o.className=`adw-toggle-label`,o.verticalAlignment=`middle`,a.addChild(o),a.addEventListener(`tap`,()=>{this._state.setSelected(i)}),this.addChild(a),this._segments.push(a)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);this._state.setSelected(n)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,o as NOTIFY_SELECTED,i as ToggleGroupState};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{Label as i,StackLayout as a}from"@nativescript/core";import{ToggleGroupState as o,ToggleGroupState as s}from"@gjsify/adwaita-core";const c=`notify::selected`;var AdwToggleGroup=class extends n(a){_toggles=[];_segments=[];_state=new s;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:c,object:this,selected:e.selected,value:e.value};this.notify(t)}),t(this,e)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=Array.isArray(e)?e:[],this._toggles.forEach((e,t)=>{let n=new a;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 o=new i;o.text=e.label,o.className=`adw-toggle-label`,o.verticalAlignment=`middle`,n.addChild(o),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()}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);this._state.setSelected(n)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,c as NOTIFY_SELECTED,o as ToggleGroupState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{resolveBuilderSlot as t}from"./builder-slots.js";import{defaultToolbarViewProps as n,toolbarViewClassNames as r}from"./chrome.js";import{NO_INSETS as i,insetsOwedBy as a,toolbarViewInsetPadding as o}from"./window-insets.js";import{resolveHostInsets as s}from"./host-insets.js";import{observeWindowInsets as c}from"./window-insets-source.js";import{GridLayout as l,ItemSpec as u,StackLayout as d}from"@nativescript/core";const f={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},p=[`topBar`,`bottomBar`,`content`];var AdwToolbarView=class extends l{_topBox;_bottomBox;_content=null;_props=n();_insets=i;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(){super(),this.className=f.view,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`)),this.addRow(new u(1,`auto`));let e=new d;e.orientation=`vertical`,e.className=f.topBar,l.setRow(e,0),this.addChild(e),this._topBox=e;let t=new d;t.orientation=`vertical`,t.className=f.bottomBar,l.setRow(t,2),this.addChild(t),this._bottomBox=t,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=c(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null})}addTopBar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}addBottomBar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}setContent(e){this._content&&=(this.removeChild(this._content),null),e&&(l.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,p,`content`)){case`topBar`:this.addTopBar(n);return;case`bottomBar`:this.addBottomBar(n);return;default:this.setContent(n)}}get content(){return this._content}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(t){let n=e(t,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!n,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(t){let n=e(t,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!n,this._applyBarPlacement()}_applyBarPlacement(){l.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,l.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_applyInsets(e){this._insets=e;let t=o(a(e,s(this,e)),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=r({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==t.view&&(this.className=t.view),this._topBox.className!==t.topBar&&(this._topBox.className=t.topBar),this._bottomBox.className!==t.bottomBar&&(this._bottomBox.className=t.bottomBar)}};export{AdwToolbarView};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{resolveBuilderSlot as r}from"./builder-slots.js";import{defaultToolbarViewProps as i,toolbarViewClassNames as a}from"./chrome.js";import{NO_INSETS as o,insetsOwedBy as s,toolbarViewInsetPadding as c}from"./window-insets.js";import{resolveHostInsets as l}from"./host-insets.js";import{observeWindowInsets as u}from"./window-insets-source.js";import{GridLayout as d,ItemSpec as f,StackLayout as p}from"@nativescript/core";const m={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},h=[`topBar`,`bottomBar`,`content`];var AdwToolbarView=class extends n(d){_topBox;_bottomBox;_content=null;_props=i();_insets=o;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(e){super(),this.className=m.view,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`auto`)),this.addRow(new f(1,`star`)),this.addRow(new f(1,`auto`));let n=new p;n.orientation=`vertical`,n.className=m.topBar,d.setRow(n,0),this.addChild(n),this._topBox=n;let r=new p;r.orientation=`vertical`,r.className=m.bottomBar,d.setRow(r,2),this.addChild(r),this._bottomBox=r,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=u(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null}),t(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&&(d.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,t){switch(r(e,h,`content`)){case`topBar`:this.add_top_bar(t);return;case`bottomBar`:this.add_bottom_bar(t);return;default:this.set_content(t)}}get content(){return this._content}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(t){let n=e(t,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!n,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(t){let n=e(t,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!n,this._applyBarPlacement()}_applyBarPlacement(){d.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,d.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_applyInsets(e){this._insets=e;let t=c(s(e,l(this,e)),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=a({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{xmlNumber as e}from"./xml-values.js";import{applyViewStackVisibility as t,createViewStackState as n,viewStackNotifyPayload as r}from"./view-stack-state.js";import{GridLayout as i,ItemSpec as a}from"@nativescript/core";const o=`notify::visible-child`;var AdwViewStack=class extends i{_state=n();constructor(){super(),this.className=`adw-view-stack`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`star`)),this._state.subscribe(e=>{t(this._state);let n={eventName:o,object:this,...r(e)};this.notify(n)})}add(e,n,r,a){let o=this._state.addPage({name:n,title:r,icon:a,content:e});return i.setColumn(e,0),i.setRow(e,0),this.addChild(e),t(this._state),o}addTitled(e,t,n){return this.add(e,t,n)}removePage(e){let n=this._state.pages[this._state.indexOfName(e)]?.content;return this._state.removePage(e)?(n&&this.removeChild(n),t(this._state),!0):!1}setPageVisible(e,n){let r=this._state.setPageVisible(e,n);return t(this._state),r}get pages(){return this._state.pages}get visibleChildIndex(){return this._state.visibleIndex}set visibleChildIndex(t){let n=e(t,this.visibleChildIndex);this._state.setVisibleIndex(n)}get visibleChildName(){return this._state.visibleName}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}};export{AdwViewStack,o as NOTIFY_VISIBLE_CHILD};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{applyViewStackVisibility as n,createViewStackState as r,viewStackNotifyPayload as i}from"./view-stack-state.js";import{GridLayout as a,ItemSpec as o}from"@nativescript/core";const s=`notify::visible-child`;var AdwViewStack=class extends t(a){_state=r();constructor(t){super(),this.className=`adw-view-stack`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`)),this._state.subscribe(e=>{n(this._state);let t={eventName:s,object:this,...i(e)};this.notify(t)}),e(this,t)}add(e,t,r,i){let o=this._state.addPage({name:t,title:r,icon:i,content:e});return a.setColumn(e,0),a.setRow(e,0),this.addChild(e),n(this._state),o}add_titled(e,t,n){return this.add(e,t,n)}removePage(e){let t=this._state.pages[this._state.indexOfName(e)]?.content;return this._state.removePage(e)?(t&&this.removeChild(t),n(this._state),!0):!1}setPageVisible(e,t){let r=this._state.setPageVisible(e,t);return n(this._state),r}get pages(){return this._state.pages}get visibleChildIndex(){return this._state.visibleIndex}selectNthPage(e){return this._state.setVisibleIndex(e)}get visibleChildName(){return this._state.visibleName}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}};export{AdwViewStack,s as NOTIFY_VISIBLE_CHILD};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{NOTIFY_VISIBLE_CHILD as r}from"./adw-view-stack.js";import{createViewSwitcherBarState as i,nsIconSvg as a}from"./view-switcher-model.js";import{GridLayout as o,ItemSpec as s,Label as c,StackLayout as l}from"@nativescript/core";import{buildViewSwitcherButtons as u,viewSwitcherPagesFromStack as d}from"@gjsify/adwaita-core";var AdwViewSwitcherBar=class extends o{_bar;_nodes=[];_stack=null;_stackListener=null;_barState=i();constructor(){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`auto`));let e=new o;e.className=`adw-viewswitcherbar-box`,e.addRow(new s(1,`auto`)),o.setRow(e,0),this.addChild(e),this._bar=e,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack())}setStack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){this.setStack(e)}get reveal(){return this._barState.reveal}set reveal(t){let n=e(t,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(r,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(r,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=u(d(e),this._stack?.visibleChildIndex??-1,`narrow`);if(t.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=t.map((e,t)=>(this._bar.addColumn(new s(1,`star`)),this._buildButton(e.pageIndex,t)))}t.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.iconName=a(e.iconName),n.label.text=e.label,n.badge.text=e.badgeLabel,n.badge.visibility=e.badgeLabel.length>0||e.needsAttention?`visible`:`collapse`,n.badge.className=e.badgeLabel.length===0&&e.needsAttention?`adw-viewswitcherbar-button-badge needs-attention`:`adw-viewswitcherbar-button-badge`)}),this._applyRevealed()}_buildButton(e,r){let i=new l;i.orientation=`vertical`,i.className=`adw-viewswitcherbar-button`,i.horizontalAlignment=`stretch`;let a=new t;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,i.addChild(a);let s=new c;s.className=`adw-viewswitcherbar-button-label`,s.horizontalAlignment=`center`,s.textAlignment=`center`,i.addChild(s);let u=new c;return u.className=`adw-viewswitcherbar-button-badge`,u.horizontalAlignment=`center`,u.textAlignment=`center`,i.addChild(u),n(i),i.addEventListener(`tap`,()=>{this._stack&&(this._stack.visibleChildIndex=e)}),o.setColumn(i,r),this._bar.addChild(i),{button:i,icon:a,label:s,badge:u}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`}};export{AdwViewSwitcherBar};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.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{NOTIFY_VISIBLE_CHILD as a}from"./adw-view-stack.js";import{createViewSwitcherBarState as o}from"./view-switcher-model.js";import{GridLayout as s,ItemSpec as c,Label as l,StackLayout as u}from"@nativescript/core";import{buildViewSwitcherButtons as d,viewSwitcherPagesFromStack as f}from"@gjsify/adwaita-core";var AdwViewSwitcherBar=class extends n(s){_bar;_nodes=[];_stack=null;_stackListener=null;_barState=o();constructor(e){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new c(1,`star`)),this.addRow(new c(1,`auto`));let n=new s;n.className=`adw-viewswitcherbar-box`,n.addRow(new c(1,`auto`)),s.setRow(n,0),this.addChild(n),this._bar=n,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack()),t(this,e)}set_stack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){this.set_stack(e)}get reveal(){return this._barState.reveal}set reveal(t){let n=e(t,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(a,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(a,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=d(f(e),this._stack?.visibleChildIndex??-1,`narrow`);if(t.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=t.map((e,t)=>(this._bar.addColumn(new c(1,`star`)),this._buildButton(e.pageIndex,t)))}t.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.iconName=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 u;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 l;o.className=`adw-viewswitcherbar-button-label`,o.horizontalAlignment=`center`,o.textAlignment=`center`,n.addChild(o);let c=new l;return c.className=`adw-viewswitcherbar-button-badge`,c.horizontalAlignment=`center`,c.textAlignment=`center`,n.addChild(c),i(n),n.addEventListener(`tap`,()=>{this._stack?.selectNthPage(e)}),s.setColumn(n,t),this._bar.addChild(n),{button:n,icon:a,label:o,badge:c}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`}};export{AdwViewSwitcherBar};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwViewSwitcherBase as e}from"./view-switcher-base.js";var AdwViewSwitcher=class extends e{constructor(){super(`adw-view-switcher`),this._initClasses()}get barClass(){return`adw-view-switcher-bar`}get buttonClass(){return`adw-view-switcher-button`}};export{AdwViewSwitcher};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwViewSwitcherBase as t}from"./view-switcher-base.js";var AdwViewSwitcher=class extends t{constructor(t){super(`adw-view-switcher`),this._initClasses(),e(this,t)}get barClass(){return`adw-view-switcher-bar`}get buttonClass(){return`adw-view-switcher-button`}};export{AdwViewSwitcher};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{WindowTitleState as e,toLabelVisuals as t}from"./row-state.js";import{Label as n,StackLayout as r}from"@nativescript/core";const i=`notify::title`,a=`notify::subtitle`;var AdwWindowTitle=class extends r{_titleLabel;_subtitleLabel;_state=new e;constructor(){super(),this.orientation=`vertical`,this.className=`adw-window-title`,this.horizontalAlignment=`center`;let e=new n;e.className=`adw-window-title-title`,e.horizontalAlignment=`center`,this.addChild(e),this._titleLabel=e;let t=new n;t.className=`adw-window-title-subtitle`,t.horizontalAlignment=`center`,this.addChild(t),this._subtitleLabel=t,this._apply()}get title(){return this._state.title}set title(e){this._state.setTitle(e)&&(this._apply(),this._notify(i))}get subtitle(){return this._state.subtitle}set subtitle(e){this._state.setSubtitle(e)&&(this._apply(),this._notify(a))}_apply(){let e=t(this._state.state);this._titleLabel.text=e.title,this._titleLabel.visibility=e.titleVisibility,this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}_notify(e){let t={eventName:e,object:this};this.notify(t)}};export{AdwWindowTitle,a as NOTIFY_SUBTITLE,i as NOTIFY_TITLE};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{WindowTitleState as n,toLabelVisuals as r}from"./row-state.js";import{Label as i,StackLayout as a}from"@nativescript/core";const o=`notify::title`,s=`notify::subtitle`;var AdwWindowTitle=class extends t(a){_titleLabel;_subtitleLabel;_state=new n;constructor(t){super(),this.orientation=`vertical`,this.className=`adw-window-title`,this.horizontalAlignment=`center`;let n=new i;n.className=`adw-window-title-title`,n.horizontalAlignment=`center`,this.addChild(n),this._titleLabel=n;let r=new i;r.className=`adw-window-title-subtitle`,r.horizontalAlignment=`center`,this.addChild(r),this._subtitleLabel=r,this._apply(),e(this,t)}get title(){return this._state.title}set title(e){this._state.setTitle(e)&&(this._apply(),this._notify(o))}get subtitle(){return this._state.subtitle}set subtitle(e){this._state.setSubtitle(e)&&(this._apply(),this._notify(s))}_apply(){let e=r(this._state.state);this._titleLabel.text=e.title,this._titleLabel.visibility=e.titleVisibility,this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}_notify(e){let t={eventName:e,object:this};this.notify(t)}};export{AdwWindowTitle,s as NOTIFY_SUBTITLE,o as NOTIFY_TITLE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{DEFAULT_WRAP_BOX_SPACING as n,normalizeWrapBoxSpacing as r,wrapBoxChildFlex as i,wrapBoxChildMargin as a,wrapBoxFlexStyle as o,wrapBoxSpacingChanges as s}from"./wrap-box-layout.js";import{FlexboxLayout as c}from"@nativescript/core";import{ADW_WRAP_BOX_DEFAULT_ALIGN as l,ADW_WRAP_BOX_DEFAULT_JUSTIFY as u,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as d,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as f,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as p,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as m,normalizeNaturalLineLength as h,normalizeWrapBoxAlign as g,normalizeWrapBoxJustify as _,normalizeWrapBoxLengthUnit as v,normalizeWrapBoxPackDirection as y,normalizeWrapPolicy as b,resolveWrapBoxChildOrder as x,wrapBoxLengthToPx as S}from"@gjsify/adwaita-core";var AdwWrapBox=class extends c{_childSpacing=n;_lineSpacing=n;_childSpacingUnit=d;_lineSpacingUnit=d;_align=l;_justify=u;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=p;_packDirection=f;_orientation=`horizontal`;_naturalLineLength=m;_naturalLineLengthUnit=d;constructor(){super(),this.className=`adw-wrap-box`,this._applyLayout()}add(e){this.addChild(e)}remove(e){this.removeChild(e)}removeAll(){this.removeChildren()}addChild(e){super.addChild(e),this._applyChildren()}insertChildAfter(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorderChildAfter(e,t=null){return this._applyOrder(`reorder-after`,e,t)}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=x({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),this._applyChildren(),!0)}get childSpacing(){return this._childSpacing}set childSpacing(e){let n=t(e,this._childSpacing);s(this._childSpacing,n)&&(this._childSpacing=r(n),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=v(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let n=t(e,this._lineSpacing);s(this._lineSpacing,n)&&(this._lineSpacing=r(n),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=v(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let n=g(t(e,this.align));n!==this._align&&(this._align=n,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=_(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(t){let n=!!e(t,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(t){let n=!!e(t,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(t){let n=!!e(t,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=b(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=y(e);t!==this._packDirection&&(this._packDirection=t,this._applyLayout(),this._notify(`pack-direction`))}get orientation(){return this._orientation}set orientation(e){let t=e===`vertical`?`vertical`:`horizontal`;t!==this._orientation&&(this._orientation=t,this._applyLayout(),this._notify(`orientation`))}get naturalLineLength(){return this._naturalLineLength}set naturalLineLength(e){let n=h(t(e,this.naturalLineLength));n!==this._naturalLineLength&&(this._naturalLineLength=n,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=v(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return S(this._naturalLineLength,this._naturalLineLengthUnit)}_notify(e){this.notify({eventName:`notify::${e}`,object:this})}_flexInput(){return{orientation:this._orientation,packDirection:this._packDirection,wrapReverse:this._wrapReverse,justify:this._justify,justifyLastLine:this._justifyLastLine,align:this._align,lineHomogeneous:this._lineHomogeneous,wrapPolicy:this._wrapPolicy}}_applyLayout(){let e=o(this._flexInput());this.flexDirection=e.flexDirection,this.flexWrap=e.flexWrap,this.justifyContent=e.justifyContent,this.alignContent=e.alignContent,this.alignItems=`stretch`,this._applyChildren()}_applyChildren(){let e=a(S(this._childSpacing,this._childSpacingUnit),S(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=i(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),c.setFlexGrow(r,n.flexGrow),c.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.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{FlexboxLayout as u}from"@nativescript/core";import{ADW_WRAP_BOX_DEFAULT_ALIGN as d,ADW_WRAP_BOX_DEFAULT_JUSTIFY as f,ADW_WRAP_BOX_DEFAULT_LENGTH_UNIT as p,ADW_WRAP_BOX_DEFAULT_PACK_DIRECTION as m,ADW_WRAP_BOX_DEFAULT_WRAP_POLICY as h,ADW_WRAP_BOX_NATURAL_LINE_LENGTH_UNSET as g,normalizeNaturalLineLength as _,normalizeWrapBoxAlign as v,normalizeWrapBoxJustify as y,normalizeWrapBoxLengthUnit as b,normalizeWrapBoxPackDirection as x,normalizeWrapPolicy as S,resolveWrapBoxChildOrder as C,wrapBoxLengthToPx as w}from"@gjsify/adwaita-core";var AdwWrapBox=class extends r(u){_childSpacing=i;_lineSpacing=i;_childSpacingUnit=p;_lineSpacingUnit=p;_align=d;_justify=f;_justifyLastLine=!1;_lineHomogeneous=!1;_wrapReverse=!1;_wrapPolicy=h;_packDirection=m;_orientation=`horizontal`;_naturalLineLength=g;_naturalLineLengthUnit=p;constructor(e){super(),this.className=`adw-wrap-box`,this._applyLayout(),n(this,e)}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=C({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),this._applyChildren(),!0)}get childSpacing(){return this._childSpacing}set childSpacing(e){let n=t(e,this._childSpacing);l(this._childSpacing,n)&&(this._childSpacing=a(n),this._applyChildren(),this._notify(`child-spacing`))}get childSpacingUnit(){return this._childSpacingUnit}set childSpacingUnit(e){let t=b(e);t!==this._childSpacingUnit&&(this._childSpacingUnit=t,this._applyChildren(),this._notify(`child-spacing-unit`))}get lineSpacing(){return this._lineSpacing}set lineSpacing(e){let n=t(e,this._lineSpacing);l(this._lineSpacing,n)&&(this._lineSpacing=a(n),this._applyChildren(),this._notify(`line-spacing`))}get lineSpacingUnit(){return this._lineSpacingUnit}set lineSpacingUnit(e){let t=b(e);t!==this._lineSpacingUnit&&(this._lineSpacingUnit=t,this._applyChildren(),this._notify(`line-spacing-unit`))}get align(){return this._align}set align(e){let n=v(t(e,this.align));n!==this._align&&(this._align=n,this._applyLayout(),this._notify(`align`))}get justify(){return this._justify}set justify(e){let t=y(e);t!==this._justify&&(this._justify=t,this._applyLayout(),this._notify(`justify`))}get justifyLastLine(){return this._justifyLastLine}set justifyLastLine(t){let n=!!e(t,this.justifyLastLine);n!==this._justifyLastLine&&(this._justifyLastLine=n,this._applyLayout(),this._notify(`justify-last-line`))}get lineHomogeneous(){return this._lineHomogeneous}set lineHomogeneous(t){let n=!!e(t,this.lineHomogeneous);n!==this._lineHomogeneous&&(this._lineHomogeneous=n,this._applyLayout(),this._notify(`line-homogeneous`))}get wrapReverse(){return this._wrapReverse}set wrapReverse(t){let n=!!e(t,this.wrapReverse);n!==this._wrapReverse&&(this._wrapReverse=n,this._applyLayout(),this._notify(`wrap-reverse`))}get wrapPolicy(){return this._wrapPolicy}set wrapPolicy(e){let t=S(e);t!==this._wrapPolicy&&(this._wrapPolicy=t,this._applyLayout(),this._notify(`wrap-policy`))}get packDirection(){return this._packDirection}set packDirection(e){let t=x(e);t!==this._packDirection&&(this._packDirection=t,this._applyLayout(),this._notify(`pack-direction`))}get orientation(){return this._orientation}set orientation(e){let t=e===`vertical`?`vertical`:`horizontal`;t!==this._orientation&&(this._orientation=t,this._applyLayout(),this._notify(`orientation`))}get naturalLineLength(){return this._naturalLineLength}set naturalLineLength(e){let n=_(t(e,this.naturalLineLength));n!==this._naturalLineLength&&(this._naturalLineLength=n,this._notify(`natural-line-length`))}get naturalLineLengthUnit(){return this._naturalLineLengthUnit}set naturalLineLengthUnit(e){let t=b(e);t!==this._naturalLineLengthUnit&&(this._naturalLineLengthUnit=t,this._notify(`natural-line-length-unit`))}get naturalLineLengthPx(){return w(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(w(this._childSpacing,this._childSpacingUnit),w(this._lineSpacing,this._lineSpacingUnit)),t=this._childViews(),n=o(this._flexInput(),t.length);for(let r of t)r.set(`margin`,e),u.setFlexGrow(r,n.flexGrow),u.setFlexShrink(r,n.flexShrink)}};export{AdwWrapBox};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{nsVisibility as e}from"./row-state.js";import{avatarMode as t}from"@gjsify/adwaita-core";const n=`avatar-default-symbolic`;function avatarIcon(e){return e||n}function avatarVisibilities(t){return{label:e(t===`initials`),icon:e(t===`icon`)}}function avatarViewState(e){let n=t({hasCustomImage:!1,showInitials:e.showInitials,text:e.text});return{mode:n,...avatarVisibilities(n),iconName:avatarIcon(e.iconName)}}export{n as AVATAR_DEFAULT_ICON,avatarIcon,avatarViewState,avatarVisibilities};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{resolveWrapBoxChildOrder as e}from"@gjsify/adwaita-core";const t=0;function normalizeBoxSpacing(e){let t=typeof e==`number`?e:Number.parseFloat(String(e));return Number.isFinite(t)&&t>0?t:0}function boxSpacingChanges(e,t){return normalizeBoxSpacing(t)!==normalizeBoxSpacing(e)}function boxChildMargin(e,t,n){let r=e<=0?0:normalizeBoxSpacing(t);return n===`vertical`?`${r} 0 0 0`:`0 0 0 ${r}`}export{t as DEFAULT_BOX_SPACING,boxChildMargin,boxSpacingChanges,normalizeBoxSpacing,e as resolveBoxChildOrder};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{replaceClasses as e}from"./chrome.js";import{BUTTON_CONTENT_STYLE_CLASS as t,buttonContentEllipsize as n,buttonContentIconIsEmpty as r,buttonContentLabelText as i,buttonContentLabelVisible as a}from"@gjsify/adwaita-core";import{imageMissingSymbolic as o}from"@gjsify/adwaita-icons/status";const s=`can-shrink`,c=[s];function buttonContentIconSvg(e){return r(e)?o:e}function buttonContentIconIsFallback(e){return r(e)}function buttonContentRootedParentClassName(n){return e(n,[t],[t])}function buttonContentUnrootedParentClassName(n){return e(n,[t],[])}function buttonContentLabelVisibility(e){return a(e)?`visible`:`collapse`}function buttonContentClassName(t,n){return e(t,c,n?[s]:[])}export{s as BUTTON_CONTENT_CAN_SHRINK_CLASS,t as BUTTON_CONTENT_STYLE_CLASS,buttonContentClassName,n as buttonContentEllipsize,buttonContentIconIsFallback,buttonContentIconSvg,i as buttonContentLabelText,buttonContentLabelVisibility,a as buttonContentLabelVisible,buttonContentRootedParentClassName,buttonContentUnrootedParentClassName};
1
+ import"../_virtual/_rolldown/runtime.js";import{ICON_FALLBACK_NAME as e}from"./icon-theme.js";import{replaceClasses as t}from"./chrome.js";import{BUTTON_CONTENT_STYLE_CLASS as n,buttonContentEllipsize as r,buttonContentIconIsEmpty as i,buttonContentLabelText as a,buttonContentLabelVisible as o}from"@gjsify/adwaita-core";const s=`can-shrink`,c=[s];function buttonContentIcon(t){return i(t)?e:t}function buttonContentIconIsFallback(e){return i(e)}function buttonContentRootedParentClassName(e){return t(e,[n],[n])}function buttonContentUnrootedParentClassName(e){return t(e,[n],[])}function buttonContentLabelVisibility(e){return o(e)?`visible`:`collapse`}function buttonContentClassName(e,n){return t(e,c,n?[s]:[])}export{s as BUTTON_CONTENT_CAN_SHRINK_CLASS,n as BUTTON_CONTENT_STYLE_CLASS,buttonContentClassName,r as buttonContentEllipsize,buttonContentIcon,buttonContentIconIsFallback,a as buttonContentLabelText,buttonContentLabelVisibility,o as buttonContentLabelVisible,buttonContentRootedParentClassName,buttonContentUnrootedParentClassName};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";function buttonSlotAfterWrite(e,t){return e===`child`?t==null?`empty`:`child`:e}function buttonSlotDetaches(e,t){return e!==t&&e!==`empty`}export{buttonSlotAfterWrite,buttonSlotDetaches};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{GTK_ALIGN as e,NS_HORIZONTAL_ALIGNMENT as t,NS_VERTICAL_ALIGNMENT as n,gtkAlignRefusal as r}from"./gtk-align.js";const i={horizontalAlignment:`horizontal`,verticalAlignment:`vertical`};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(i,a){let o=a===`horizontal`?t:n,s=null;if(typeof i==`number`){if(s=Object.keys(e).find(t=>e[t]===i)??null,s===null)throw TypeError(`${i} is not a Gtk.Align constant. The seven members are ${Object.keys(e).join(`, `)}, holding the values ${[...new Set(Object.values(e))].join(`, `)}.`)}else typeof i==`string`&&Object.hasOwn(e,i)&&(s=i);if(s===null)return i;let c=o[s];if(c!==void 0)return c;throw TypeError(`Gtk.Align '${s}' has no ${a} counterpart in NativeScript: ${r(s)} The ${a} alignments that do are ${Object.keys(o).join(`, `)}.`)}function applyConstructProps(e,t){if(t!=null)for(let[n,r]of Object.entries(t)){if(settableDoor(e,n)===null)throw TypeError(`${e.constructor.name} has no settable '${n}'. 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(r===void 0)continue;let t=i[n];e[n]=t===void 0?r:nsAlignment(r,t)}}export{applyConstructProps,nsAlignment};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{viewConcealSymbolic as e,viewRevealSymbolic as t}from"@gjsify/adwaita-icons/actions";const n=`adw-row adw-action-row adw-entry-row`,r=`${n} adw-password-entry-row`,i=`adw-icon adw-entry-edit`,a=`adw-insensitive`,o=.3;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,n){e.row.className=entryRowClassName(n,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?i:`${i} ${a}`,e.editIcon.opacity=t.editIconSensitive?1:o,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function peekIconSvg(n){return n===`view-conceal-symbolic`?e:t}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.iconName=peekIconSvg(t.peekIconName)}export{i as NS_EDIT_ICON_CLASS,n as NS_ENTRY_ROW_CLASS,a as NS_INSENSITIVE_CLASS,o as NS_INSENSITIVE_OPACITY,r as NS_PASSWORD_ENTRY_ROW_CLASS,applyEntryRowState,applyPasswordEntryRowState,entryRowClassName,nsVisibility,peekIconSvg};
1
+ import"../_virtual/_rolldown/runtime.js";const e=`adw-row adw-action-row adw-entry-row`,t=`${e} adw-password-entry-row`,n=`gtk-image adw-entry-edit`,r=`adw-insensitive`,i=.3;function nsVisibility(e){return e?`visible`:`collapse`}function entryRowClassName(e,t){let n=e;return t.editing&&(n+=` focused`),t.empty&&(n+=` empty`),n}function applyEntryRowState(e,t,a){e.row.className=entryRowClassName(a,t),e.field.text!==t.text&&(e.field.text=t.text),e.field.editable=t.editable,e.emptyTitle.visibility=nsVisibility(t.emptyTarget===0),e.title.visibility=nsVisibility(t.emptyTarget===1),e.editIcon.visibility=nsVisibility(t.editIconVisible),e.editIcon.className=t.editIconSensitive?n:`${n} ${r}`,e.editIcon.opacity=t.editIconSensitive?1:i,e.indicator.visibility=nsVisibility(t.indicatorVisible),e.applyButton.visibility=nsVisibility(t.applyButtonVisible)}function applyPasswordEntryRowState(e,t){e.field.secure=!t.revealed,e.peekButton.iconName=t.peekIconName}export{n as NS_EDIT_ICON_CLASS,e as NS_ENTRY_ROW_CLASS,r as NS_INSENSITIVE_CLASS,i as NS_INSENSITIVE_OPACITY,t as NS_PASSWORD_ENTRY_ROW_CLASS,applyEntryRowState,applyPasswordEntryRowState,entryRowClassName,nsVisibility};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";const e=[`fill`,`start`,`end`,`center`,`baseline-fill`,`baseline`,`baseline-center`],t={baseline:`baseline-fill`},n=(()=>{let n={},r=0;for(let i of e){let e=t[i];if(e!==void 0&&e in n){n[i]=n[e];continue}n[i]=r,r+=1}return n})(),r={fill:`stretch`,start:`start`,end:`end`,center:`center`},i={fill:`stretch`,start:`top`,end:`bottom`,center:`middle`},a={"baseline-fill":`NativeScript aligns boxes, not text baselines — no layout in @nativescript/core reads a baseline, and there is no property to route this to.`,baseline:`the deprecated alias of baseline-fill, refused for the same reason and by the same absence.`,"baseline-center":`baseline alignment again, and NativeScript has no way to centre on a baseline it does not measure.`};function gtkAlignRefusal(e){return a[e]??`it is not a member this surface maps.`}export{n as GTK_ALIGN,t as GTK_ALIGN_ALIASES,e as GTK_ALIGN_NICKS,a as GTK_ALIGN_REFUSALS,r as NS_HORIZONTAL_ALIGNMENT,i as NS_VERTICAL_ALIGNMENT,gtkAlignRefusal};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{classNameWith as r,normalizeStyleClasses as i,withCssClass as a,withoutCssClass as o}from"./style-classes.js";import{DEFAULT_BOX_SPACING as s,boxChildMargin as c,boxSpacingChanges as l,normalizeBoxSpacing as u,resolveBoxChildOrder as d}from"./box-layout.js";import{StackLayout as f}from"@nativescript/core";var GtkBox=class extends n(f){_spacing=0;_styleClasses=[];constructor(e){super(),this.addEventListener(`orientationChange`,()=>this._applyChildren()),t(this,e)}append(e){this.addChild(e)}prepend(e){this.insertChild(e,0),this._applyChildren()}remove(e){this.removeChild(e),this._applyChildren()}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)}get spacing(){return this._spacing}set spacing(t){let n=e(t,this._spacing);l(this._spacing,n)&&(this._spacing=u(n),this._applyChildren(),this.notify({eventName:`notify::spacing`,object:this}))}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(i(e))}add_css_class(e){this._setClasses(a(this._styleClasses,e))}remove_css_class(e){this._setClasses(o(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(i([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this.className=r(``,this._styleClasses)}_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)),this._applyChildren(),!0)}_applyChildren(){let e=this.orientation??`vertical`,t=this._childViews();for(let[n,r]of t.entries())r.set(`margin`,c(n,this._spacing,e))}};export{s as DEFAULT_BOX_SPACING,GtkBox};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{Button as e}from"@nativescript/core";import{ADW_BUTTON_STYLE_CLASSES as t,buttonStyleClass as n}from"@gjsify/adwaita-core";var GtkButton=class extends e{_variant=`default`;constructor(){super(),this.className=`adw-button`,this.set(`androidElevation`,0)}get variant(){return this._variant}set variant(e){this._variant=e;let t=e==="default"?null:n(e);this.className=t?`adw-button ${t}`:`adw-button`}static get variantClasses(){return t}};export{GtkButton};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.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{buttonSlotAfterWrite as a,buttonSlotDetaches as o}from"./button-slot.js";import{labelDisplayText as s}from"./label-text.js";import{classNameWith as c,normalizeStyleClasses as l,withCssClass as u,withoutCssClass as d}from"./style-classes.js";import{GridLayout as f,ItemSpec as p,Label as m}from"@nativescript/core";const h=`clicked`,g=`adw-button-label`;var GtkButton=class extends n(f){_styleClasses=[];_label=``;_iconName=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=c(`adw-button`,this._styleClasses),this.addRow(new p(1,`star`)),this.addColumn(new p(1,`star`)),i(this),this.addEventListener(`tap`,()=>{this.notify({eventName:h,object:this})}),t(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}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(t){this._useUnderline=e(t,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(l(e))}add_css_class(e){this._setClasses(u(this._styleClasses,e))}remove_css_class(e){this._setClasses(d(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(l([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this.className=c(`adw-button`,this._styleClasses)}_fill(e,t){let n=a(e,t);if(o(this._slot,n)&&this._detach(),this._slot=n,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 m?this._content:this._adopt(new m);e.className=g,e.text=s(this._label,!1,this._useUnderline);return}let i=this._content instanceof r?this._content:this._adopt(new r);i.iconName=this._iconName}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,f.setColumn(e,0),f.setRow(e,0),this.addChild(e),this._content=e,e}};export{h as GTK_BUTTON_CLICKED,g as GTK_BUTTON_LABEL_CLASS,GtkButton};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{Label as r,StackLayout as i,action as a}from"@nativescript/core";import{ComboState as o}from"@gjsify/adwaita-core";import{panDownSymbolic as s}from"@gjsify/adwaita-icons/ui";const c=`notify::selected`;var GtkDropDown=class extends i{_label;_chevron;_state=new o;_chooserTitle=``;constructor(){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let e=new r;e.className=`adw-drop-down-label`,e.text=``;let i=new t;i.className=`adw-drop-down-chevron`,i.iconName=s,this.addChild(e),this.addChild(i),this._label=e,this._chevron=i,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive){let t={eventName:c,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),n(this)}async _openChooser(){if(this._state.count===0)return;let e=this._state.options.map(e=>e.label),t=await a({title:this._chooserTitle||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set options(e){this._state.setOptions(e)}get selected(){return this._state.selectedIndex}set selected(t){let n=e(t,this.selected);this._state.setSelectedIndex(n)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.options[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,c as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.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{Label as a,StackLayout as o,action as s}from"@nativescript/core";import{ComboState as c,normalizeComboOptions as l}from"@gjsify/adwaita-core";import{panDownSymbolic as u}from"@gjsify/adwaita-icons/ui";const d=`notify::selected`;var GtkDropDown=class extends n(o){_label;_chevron;_state=new c;_chooserTitle=``;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-drop-down`;let n=new a;n.className=`adw-drop-down-label`,n.text=``;let o=new r;o.className=`adw-drop-down-chevron`,o.iconName=u,this.addChild(n),this.addChild(o),this._label=n,this._chevron=o,this._state.subscribe(e=>{if(this._label.text=e.label,e.interactive){let t={eventName:d,object:this,selected:e.selected,value:e.value,label:e.label};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),i(this),t(this,e)}async _openChooser(){if(this._state.count===0)return;let e=this._state.model.map(e=>e.label),t=await s({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(l(e))}get selected(){return this._state.selectedIndex}set selected(t){let n=e(t,this.selected);this._state.setSelectedIndex(n)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get selectedItem(){return this._state.model[this._state.selectedIndex]??null}get chooserTitle(){return this._chooserTitle}set chooserTitle(e){this._chooserTitle=e??``}};export{GtkDropDown,d as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{GridLayout as n,ItemSpec as r,TextField as i}from"@nativescript/core";import{ENTRY_ROW_MAX_LENGTH_LIMIT as a,clampEntryText as o,entryTextLength as s}from"@gjsify/adwaita-core";const c=`notify::text`,l=`activate`;var GtkEntry=class extends n{_field;_text=``;_maxLength=0;constructor(){super(),this.className=`adw-entry`,this.addColumn(new r(1,`star`)),this.addRow(new r(1,`auto`));let e=new i;e.className=`adw-entry-input`,e.set(`backgroundColor`,`transparent`),e.set(`borderWidth`,0),this.addChild(e),this._field=e,e.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),e.addEventListener(`returnPress`,()=>{let e={eventName:l,object:this};this.notify(e)})}_applyText(e){let t=o(e,this._maxLength);if(this._field.text!==t&&(this._field.text=t),t===this._text)return;this._text=t;let n={eventName:c,object:this,text:t,textLength:s(t)};this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return s(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let n=t(e,this.maxLength);this._maxLength=Number.isFinite(n)?Math.min(a,Math.max(0,Math.trunc(n))):0,this._applyText(this._text)}get placeholderText(){return this._field.hint??``}set placeholderText(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(t){let n=e(t,this.editable);this._field.editable=!!n}get field(){return this._field}};export{l as ACTIVATE,GtkEntry,c as NOTIFY_TEXT};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GridLayout as i,ItemSpec as a,TextField as o}from"@nativescript/core";import{ENTRY_ROW_MAX_LENGTH_LIMIT as s,clampEntryText as c,entryTextLength as l}from"@gjsify/adwaita-core";const u=`notify::text`,d=`activate`;var GtkEntry=class extends r(i){_field;_text=``;_maxLength=0;constructor(e){super(),this.className=`adw-entry`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`auto`));let t=new o;t.className=`adw-entry-input`,t.set(`backgroundColor`,`transparent`),t.set(`borderWidth`,0),this.addChild(t),this._field=t,t.addEventListener(`textChange`,()=>this._applyText(this._field.text??``)),t.addEventListener(`returnPress`,()=>{let e={eventName:d,object:this};this.notify(e)}),n(this,e)}_applyText(e){let t=c(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:l(t)};this.notify(n)}get text(){return this._text}set text(e){this._applyText(e??``)}get textLength(){return l(this._text)}get maxLength(){return this._maxLength}set maxLength(e){let n=t(e,this.maxLength);this._maxLength=Number.isFinite(n)?Math.min(s,Math.max(0,Math.trunc(n))):0,this._applyText(this._text)}get placeholderText(){return this._field.hint??``}set placeholderText(e){this._field.hint=e??``}get editable(){return this._field.editable}set editable(t){let n=e(t,this.editable);this._field.editable=!!n}get field(){return this._field}};export{d as ACTIVATE,GtkEntry,u as NOTIFY_TEXT};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{onAdwaitaColorSchemeChanged as r,themeIconColor as i}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as a}from"./icon-path.js";import{resolveIconSource as o}from"./icon-theme.js";import{renderSymbolicIcon as s}from"./icons.js";import{Image as c}from"@nativescript/core";const l=16;var GtkImage=class extends n(c){_icon=``;_iconColor=i();_explicitColor=!1;_iconSize=16;_unsubScheme=null;constructor(e){super(),this.className=`adw-icon`,this.stretch=`aspectFit`,this.width=this._iconSize,this.height=this._iconSize,this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=r(()=>this._syncThemeColor())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null}),t(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=i();e!==this._iconColor&&(this._iconColor=e,this._render())}_render(){let e=o(this._icon);if(!e)return;let t=s(e,{size:this._iconSize,color:this._iconColor});t&&(this.imageSource=t)}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||a,this._render()}get iconSize(){return this._iconSize}set iconSize(t){let n=e(t,this.iconSize);this._iconSize=Number.isFinite(n)&&n>0?n:16,this.width=this._iconSize,this.height=this._iconSize,this._render()}};export{l as DEFAULT_GTK_IMAGE_SIZE,GtkImage};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{labelDisplayText as r}from"./label-text.js";import{classNameWith as i,normalizeStyleClasses as a,withCssClass as o,withoutCssClass as s}from"./style-classes.js";import{Label as c}from"@nativescript/core";var GtkLabel=class extends n(c){_label=``;_useMarkup=!1;_useUnderline=!1;_styleClasses=[];constructor(e){super(),t(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._render()}get useMarkup(){return this._useMarkup}set useMarkup(t){this._useMarkup=e(t,this._useMarkup),this._render()}get useUnderline(){return this._useUnderline}set useUnderline(t){this._useUnderline=e(t,this._useUnderline),this._render()}get wrap(){return this.textWrap}set wrap(t){this.textWrap=e(t,this.textWrap)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(a(e))}set_markup(e){this._label=e??``,this._useMarkup=!0,this._render()}get_text(){return this.text??``}add_css_class(e){this._setClasses(o(this._styleClasses,e))}remove_css_class(e){this._setClasses(s(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(a([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this.className=i(``,this._styleClasses)}_render(){this.text=r(this._label,this._useMarkup,this._useUnderline)}};export{GtkLabel};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwImageButton as e}from"./adw-image-button.js";import{action as t}from"@nativescript/core";const n=`menuItemActivated`;var GtkMenuButton=class extends e{_items=[];_menuTitle=``;constructor(){super(),this.className=`${this.className} adw-menu-button`.trim(),this.addEventListener(`tap`,()=>{this._openMenu()})}get menuItems(){return this._items}set menuItems(e){this._items=Array.isArray(e)?e:[]}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}async _openMenu(){if(this._items.length===0)return;let e=this._items.map(e=>e.label),r=await t({title:this._menuTitle||void 0,cancelButtonText:`Cancel`,actions:e}),i=e.indexOf(r);if(i<0)return;let a=this._items[i],o={eventName:n,object:this,id:a.id??a.label,label:a.label,index:i};this.notify(o)}};export{GtkMenuButton,n as MENU_ITEM_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwImageButton as t}from"./adw-image-button.js";import{MENU_CANCEL_LABEL as n,presentMenuSheet as r,refuseMenuString as i}from"./menu-sheet.js";import{action as a}from"@nativescript/core";import{ADW_MENU_SURFACE_NATIVESCRIPT as o,assertMenuRenderable as s,menuItemAt as c,normalizeMenuModel as l}from"@gjsify/adwaita-core";const u=`menuItemActivated`;var GtkMenuButton=class extends t{_model=[];_actions=null;_menuTitle=``;constructor(t){super(),this.className=`${this.className} adw-menu-button`.trim(),this.addEventListener(`tap`,()=>{this._openMenu()}),e(this,t)}get menuModel(){return this._model}set menuModel(e){i(e,`GtkMenuButton`);let t=l(e);s(t,o),this._model=t}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}async _openMenu(){if(this._model.length===0)return;let e=await r(a,this._model,{title:this._menuTitle,actions:this._actions??void 0,cancelLabel:n});if(e===null)return;let t=c(this._model,e);if(t===null)return;let i={eventName:u,object:this,id:t.id??t.label,label:t.label,path:e,action:t.action};this.notify(i)}};export{GtkMenuButton,u as MENU_ITEM_ACTIVATED};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{normalizeIconName as e}from"@gjsify/adwaita-core";import{contactNewSymbolic as t,documentEditSymbolic as n,documentOpenSymbolic as r,documentSaveSymbolic as i,goNextSymbolic as a,listAddSymbolic as o,listRemoveSymbolic as s,mailReplySenderSymbolic as c,mailSendSymbolic as l,openMenuSymbolic as u,sendToSymbolic as d,systemSearchSymbolic as f,viewConcealSymbolic as p,viewGridSymbolic as m,viewListSymbolic as h,viewMoreSymbolic as g,viewPagedSymbolic as _,viewRevealSymbolic as v}from"@gjsify/adwaita-icons/actions";import{preferencesSystemSymbolic as y}from"@gjsify/adwaita-icons/categories";import{cameraPhotoSymbolic as b,networkWirelessSymbolic as x}from"@gjsify/adwaita-icons/devices";import{emblemSystemSymbolic as S}from"@gjsify/adwaita-icons/legacy";import{folderDocumentsSymbolic as C,folderDownloadSymbolic as w,folderMusicSymbolic as T,folderSymbolic as E,userTrashSymbolic as D}from"@gjsify/adwaita-icons/places";import{avatarDefaultSymbolic as O,imageMissingSymbolic as k,mailUnreadSymbolic as A,starredSymbolic as j}from"@gjsify/adwaita-icons/status";const M=`image-missing`,N={"avatar-default":O,"camera-photo":b,"contact-new":t,"document-edit":n,"document-open":r,"document-save":i,"emblem-system":S,folder:E,"folder-documents":C,"folder-download":w,"folder-music":T,"go-next":a,"image-missing":k,"list-add":o,"list-remove":s,"mail-reply-sender":c,"mail-send":l,"mail-unread":A,"network-wireless":x,"open-menu":u,"preferences-system":y,"send-to":d,starred:j,"system-search":f,"user-trash":D,"view-conceal":p,"view-grid":m,"view-list":h,"view-more":g,"view-paged":_,"view-reveal":v},P=new Map;function iconValueKind(e){let t=e??``;return t===``?`empty`:t.trimStart().startsWith(`<`)?`source`:`name`}function isIconAvailable(t){let n=e(t);return n!==``&&(P.has(n)||Object.hasOwn(N,n))}function compiledIconNames(){return Object.keys(N).sort()}function registeredIconNames(){return[...P.keys()].sort()}function registerIcon(t,n){let r=e(t);if(r===``)throw TypeError(`registerIcon: ${JSON.stringify(t)} is not usable as an icon name — it has to be a single CSS token ([A-Za-z0-9_-]+) once an optional \`-symbolic\` suffix is removed.`);if(iconValueKind(n)!==`source`||!/<svg[\s>]/.test(n))throw TypeError(`registerIcon: the glyph for ${JSON.stringify(r)} has to be Adwaita symbolic SVG SOURCE (what @gjsify/adwaita-icons exports) — a document whose root element is \`<svg>\`.`);P.set(r,n)}function unregisterIcon(t){return P.delete(e(t))}function resolveIconSource(t){let n=t??``;switch(iconValueKind(n)){case`empty`:return``;case`source`:return n;default:{let t=e(n);return P.get(t)??N[t]??k}}}export{M as ICON_FALLBACK_NAME,compiledIconNames,iconValueKind,isIconAvailable,registerIcon,registeredIconNames,resolveIconSource,unregisterIcon};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{AdwPreferencesPage as e}from"./adw-preferences-page.js";import{AdwPreferencesGroup as t}from"./adw-preferences-group.js";import{ACTIVATED as n,AdwActionRow as r}from"./adw-action-row.js";import{AdwSwitchRow as i,NOTIFY_ACTIVE as ee}from"./adw-switch-row.js";import{adwaitaColorScheme as te,isThemeIconColor as ne,onAdwaitaColorSchemeChanged as re,setAdwaitaColorScheme as ie,themeIconColor as ae,toggleAdwaitaColorScheme as oe}from"./color-scheme.js";import{ADWAITA_ICON_GRID as se,DEFAULT_ICON_COLOR as ce,DEFAULT_ICON_COLOR_DARK as le,extractIconPaths as ue,extractPathData as de}from"./icon-path.js";import{renderSymbolicIcon as a}from"./icons.js";import{AdwIcon as o,DEFAULT_ADW_ICON_SIZE as s}from"./adw-icon.js";import{attachRowPressFeedback as c}from"./row-press.js";import{AdwImageButton as l,DEFAULT_ICON_BUTTON_ICON_SIZE as fe}from"./adw-image-button.js";import{AdwEntryRow as u,NOTIFY_TEXT as pe}from"./adw-entry-row.js";import{AdwPasswordEntryRow as d}from"./adw-password-entry-row.js";import{ACTIVATE as me,GtkEntry as f,NOTIFY_TEXT as he}from"./gtk-entry.js";import{AdwComboRow as p,ComboState as ge,NOTIFY_SELECTED as _e}from"./adw-combo-row.js";import{GtkDropDown as m,NOTIFY_SELECTED as ve}from"./gtk-drop-down.js";import{AdwSpinRow as h,NOTIFY_VALUE as ye,SpinState as be}from"./adw-spin-row.js";import{AdwSliderRow as g,NOTIFY_SLIDER_VALUE as xe}from"./adw-slider-row.js";import{AdwExpanderRow as _,ExpanderState as Se,NOTIFY_EXPANDED as Ce}from"./adw-expander-row.js";import{GtkButton as v}from"./gtk-button.js";import{GtkMenuButton as y,MENU_ITEM_ACTIVATED as we}from"./gtk-menu-button.js";import{DEFAULT_CLAMP_MAX_SIZE as Te,DEFAULT_SPINNER_SIZE as Ee}from"./chrome.js";import{AdwBanner as b,BUTTON_CLICKED as x}from"./adw-banner.js";import{avatarInitials as S}from"./avatar-color.js";import{AdwAvatar as C,DEFAULT_AVATAR_SIZE as w}from"./adw-avatar.js";import{AdwWindowTitle as T}from"./adw-window-title.js";import{AdwClamp as E}from"./adw-clamp.js";import{AdwHeaderBar as D}from"./adw-header-bar.js";import{AdwToolbarView as O}from"./adw-toolbar-view.js";import{AdwWrapBox as k}from"./adw-wrap-box.js";import{DATA_GRID_HEADER_CELL_CLASS as De,DATA_GRID_HEADER_ROW_CLASS as Oe,DATA_GRID_SECTION_CELL_CLASS as ke,dataGridCellClass as Ae,dataGridItemSpec as je,dataGridRowClass as Me,dataGridShapeKey as Ne,dataGridTracksKey as Pe,parseDataGridWidth as Fe}from"./data-grid-model.js";import{AdwDataGrid as A,ROW_ACTIVATED as Ie}from"./adw-data-grid.js";import{AdwSpinner as j}from"./adw-spinner.js";import{AdwStatusPage as M}from"./adw-status-page.js";import{AdwButtonRow as N}from"./adw-button-row.js";import{AdwButtonContent as P}from"./adw-button-content.js";import{AdwSplitButton as F,CLICKED as Le,MENU_TAPPED as Re}from"./adw-split-button.js";import{AdwToggleGroup as I,NOTIFY_SELECTED as ze,ToggleGroupState as Be}from"./adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ve,adwaitaNsAccentColor as He,adwaitaNsAccentCss as Ue}from"./accent-theme.js";import{applyAdwaitaNsAccent as We,clearAdwaitaNsAccent as Ge}from"./adw-accent.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as Ke,SHORTCUT_LABEL_CLASS as qe,SHORTCUT_LABEL_DIMMED_CLASS as Je,SHORTCUT_LABEL_DISABLED_CLASS as Ye,SHORTCUT_LABEL_KEYCAP_CLASS as Xe,SHORTCUT_LABEL_KEYS_CLASS as L,SHORTCUT_LABEL_SIDE_CLASS as Ze,SHORTCUT_LABEL_SPACED_CLASS as Qe,shortcutLabelDirection as $e,shortcutLabelPlatform as et,shortcutLabelRenderPlan as tt}from"./shortcut-label.js";import{AdwShortcutLabel as R}from"./adw-shortcut-label.js";import{AdwViewStack as z,NOTIFY_VISIBLE_CHILD as nt}from"./adw-view-stack.js";import{AdwViewSwitcherBase as rt,NOTIFY_SELECTED as it}from"./view-switcher-base.js";import{AdwViewSwitcher as B}from"./adw-view-switcher.js";import{AdwViewSwitcherBar as V}from"./adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as H}from"./adw-inline-view-switcher.js";import{applyTabViewVisibility as at,createTabViewState as ot,tabBarVisibility as st,tabCloseVisibilities as ct,tabLabelText as lt,tabPageVisibilities as ut,tabTooltipText as dt,tabViewNotifyPayload as ft}from"./tab-view-state.js";import{AdwTabView as U,CLOSE_PAGE as pt,NOTIFY_SELECTED_PAGE as mt,PAGES_CHANGED as ht}from"./adw-tab-view.js";import{CarouselScrollSync as gt,DEFAULT_CAROUSEL_PAGE_WIDTH as _t,applyCarouselDots as vt,carouselDotClasses as yt,carouselNotifyPayload as bt,carouselPositionAtOffset as xt,carouselScrollOffset as St,createCarouselState as Ct,normalizeCarouselPageWidth as wt}from"./carousel-state.js";import{AdwCarousel as W,NOTIFY_N_PAGES as Tt,NOTIFY_POSITION as Et,PAGE_CHANGED as Dt}from"./adw-carousel.js";import{NOTIFY_VISIBLE_PAGE as Ot}from"./navigation-stack.js";import{AdwNavigationView as G}from"./adw-navigation-view.js";import{NsNavigationSplitViewState as kt,NsOverlaySplitViewState as At,splitViewColumns as jt}from"./split-view-state.js";import{AdwSplitViewBase as Mt,NOTIFY_SHOW_SIDEBAR as Nt}from"./split-view-base.js";import{AdwNavigationSplitView as K}from"./adw-navigation-split-view.js";import{AdwOverlaySplitView as q}from"./adw-overlay-split-view.js";import{AdwSidebar as J,NOTIFY_SELECTED as Pt}from"./adw-sidebar.js";import{CLOSE_ATTEMPT as Ft,NOTIFY_OPEN as It,SHEET_CLOSE as Lt}from"./bottom-sheet-state.js";import{AdwBottomSheet as Y}from"./adw-bottom-sheet.js";import{AdwToast as Rt,AdwToastOverlay as X,AdwToastQueue as zt,DEFAULT_TOAST_TIMEOUT as Bt,TOAST_BUTTON_CLICKED as Vt}from"./adw-toast-overlay.js";import{AdwAlertDialog as Ht,AdwAlertResponses as Ut,NOTIFY_RESPONSE as Wt}from"./adw-alert-dialog.js";import{AdwAboutDialog as Z,CLOSED as Gt}from"./adw-about-dialog.js";import{AdwPreferencesDialog as Q,CLOSED as Kt}from"./adw-preferences-dialog.js";import{AdwBreakpoint as qt,addBreakpoints as Jt,evaluateBreakpointCondition as Yt,parseBreakpointCondition as Xt}from"./breakpoint.js";const Zt={AdwPreferencesPage:e,AdwPreferencesGroup:t,AdwActionRow:r,AdwSwitchRow:i,AdwEntryRow:u,AdwPasswordEntryRow:d,GtkEntry:f,AdwComboRow:p,GtkDropDown:m,AdwSpinRow:h,AdwSliderRow:g,AdwExpanderRow:_,GtkButton:v,AdwImageButton:l,GtkMenuButton:y,AdwIcon:o,AdwBanner:b,AdwAvatar:C,AdwWindowTitle:T,AdwClamp:E,AdwHeaderBar:D,AdwToolbarView:O,AdwWrapBox:k,AdwDataGrid:A,AdwSpinner:j,AdwStatusPage:M,AdwButtonRow:N,AdwButtonContent:P,AdwSplitButton:F,AdwToggleGroup:I,AdwShortcutLabel:R,AdwViewStack:z,AdwViewSwitcher:B,AdwViewSwitcherBar:V,AdwInlineViewSwitcher:H,AdwTabView:U,AdwCarousel:W,AdwNavigationView:G,AdwNavigationSplitView:K,AdwOverlaySplitView:q,AdwSidebar:J,AdwBottomSheet:Y,AdwToastOverlay:X,AdwAboutDialog:Z,AdwPreferencesDialog:Q};let $=!1;function registerAdwaitaElements(){if(!$&&typeof registerElement==`function`){for(let[e,t]of Object.entries(Zt))registerElement(e,()=>t);$=!0}}export{Gt as ABOUT_CLOSED,n as ACTIVATED,se as ADWAITA_ICON_GRID,Ve as ADWAITA_NS_ACCENT_RULES,Z as AdwAboutDialog,r as AdwActionRow,Ht as AdwAlertDialog,Ut as AdwAlertResponses,C as AdwAvatar,b as AdwBanner,Y as AdwBottomSheet,qt as AdwBreakpoint,P as AdwButtonContent,N as AdwButtonRow,W as AdwCarousel,E as AdwClamp,p as AdwComboRow,A as AdwDataGrid,u as AdwEntryRow,_ as AdwExpanderRow,D as AdwHeaderBar,o as AdwIcon,l as AdwImageButton,H as AdwInlineViewSwitcher,K as AdwNavigationSplitView,G as AdwNavigationView,q as AdwOverlaySplitView,d as AdwPasswordEntryRow,Q as AdwPreferencesDialog,t as AdwPreferencesGroup,e as AdwPreferencesPage,R as AdwShortcutLabel,J as AdwSidebar,g as AdwSliderRow,h as AdwSpinRow,j as AdwSpinner,F as AdwSplitButton,Mt as AdwSplitViewBase,M as AdwStatusPage,i as AdwSwitchRow,U as AdwTabView,Rt as AdwToast,X as AdwToastOverlay,zt as AdwToastQueue,I as AdwToggleGroup,O as AdwToolbarView,z as AdwViewStack,B as AdwViewSwitcher,V as AdwViewSwitcherBar,rt as AdwViewSwitcherBase,T as AdwWindowTitle,k as AdwWrapBox,x as BUTTON_CLICKED,Le as CLICKED,Ft as CLOSE_ATTEMPT,pt as CLOSE_PAGE,gt as CarouselScrollSync,ge as ComboState,De as DATA_GRID_HEADER_CELL_CLASS,Oe as DATA_GRID_HEADER_ROW_CLASS,ke as DATA_GRID_SECTION_CELL_CLASS,s as DEFAULT_ADW_ICON_SIZE,w as DEFAULT_AVATAR_SIZE,_t as DEFAULT_CAROUSEL_PAGE_WIDTH,Te as DEFAULT_CLAMP_MAX_SIZE,fe as DEFAULT_ICON_BUTTON_ICON_SIZE,ce as DEFAULT_ICON_COLOR,le as DEFAULT_ICON_COLOR_DARK,Ee as DEFAULT_SPINNER_SIZE,Bt as DEFAULT_TOAST_TIMEOUT,me as ENTRY_ACTIVATE,Se as ExpanderState,v as GtkButton,m as GtkDropDown,f as GtkEntry,y as GtkMenuButton,we as MENU_ITEM_ACTIVATED,Re as MENU_TAPPED,ee as NOTIFY_ACTIVE,ve as NOTIFY_DROP_DOWN_SELECTED,he as NOTIFY_ENTRY_TEXT,Ce as NOTIFY_EXPANDED,Tt as NOTIFY_N_PAGES,It as NOTIFY_OPEN,Et as NOTIFY_POSITION,Wt as NOTIFY_RESPONSE,_e as NOTIFY_SELECTED,mt as NOTIFY_SELECTED_PAGE,Nt as NOTIFY_SHOW_SIDEBAR,Pt as NOTIFY_SIDEBAR_SELECTED,xe as NOTIFY_SLIDER_VALUE,pe as NOTIFY_TEXT,ze as NOTIFY_TOGGLE_SELECTED,ye as NOTIFY_VALUE,it as NOTIFY_VIEW_SELECTED,nt as NOTIFY_VISIBLE_CHILD,Ot as NOTIFY_VISIBLE_PAGE,kt as NsNavigationSplitViewState,At as NsOverlaySplitViewState,ht as PAGES_CHANGED,Dt as PAGE_CHANGED,Kt as PREFERENCES_CLOSED,Ie as ROW_ACTIVATED,Lt as SHEET_CLOSE,Ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,qe as SHORTCUT_LABEL_CLASS,Je as SHORTCUT_LABEL_DIMMED_CLASS,Ye as SHORTCUT_LABEL_DISABLED_CLASS,Xe as SHORTCUT_LABEL_KEYCAP_CLASS,L as SHORTCUT_LABEL_KEYS_CLASS,Ze as SHORTCUT_LABEL_SIDE_CLASS,Qe as SHORTCUT_LABEL_SPACED_CLASS,be as SpinState,Vt as TOAST_BUTTON_CLICKED,Be as ToggleGroupState,Jt as addBreakpoints,te as adwaitaColorScheme,He as adwaitaNsAccentColor,Ue as adwaitaNsAccentCss,We as applyAdwaitaNsAccent,vt as applyCarouselDots,at as applyTabViewVisibility,c as attachRowPressFeedback,S as avatarInitials,yt as carouselDotClasses,bt as carouselNotifyPayload,xt as carouselPositionAtOffset,St as carouselScrollOffset,Ge as clearAdwaitaNsAccent,Ct as createCarouselState,ot as createTabViewState,Ae as dataGridCellClass,je as dataGridItemSpec,Me as dataGridRowClass,Ne as dataGridShapeKey,Pe as dataGridTracksKey,Yt as evaluateBreakpointCondition,ue as extractIconPaths,de as extractPathData,ne as isThemeIconColor,wt as normalizeCarouselPageWidth,re as onAdwaitaColorSchemeChanged,Xt as parseBreakpointCondition,Fe as parseDataGridWidth,registerAdwaitaElements,a as renderSymbolicIcon,ie as setAdwaitaColorScheme,$e as shortcutLabelDirection,et as shortcutLabelPlatform,tt as shortcutLabelRenderPlan,jt as splitViewColumns,st as tabBarVisibility,ct as tabCloseVisibilities,lt as tabLabelText,ut as tabPageVisibilities,dt as tabTooltipText,ft as tabViewNotifyPayload,ae as themeIconColor,oe as toggleAdwaitaColorScheme};
1
+ import"../_virtual/_rolldown/runtime.js";import{GTK_ALIGN as e}from"./gtk-align.js";import{applyConstructProps as t,nsAlignment as ee}from"./construct-props.js";import{AdwPreferencesPage as n}from"./adw-preferences-page.js";import{AdwPreferencesGroup as r}from"./adw-preferences-group.js";import{ACTIVATED as te,AdwActionRow as i}from"./adw-action-row.js";import{AdwSwitchRow as a,NOTIFY_ACTIVE as ne}from"./adw-switch-row.js";import{adwaitaColorScheme as re,isThemeIconColor as ie,onAdwaitaColorSchemeChanged as ae,setAdwaitaColorScheme as oe,themeIconColor as se,toggleAdwaitaColorScheme as ce}from"./color-scheme.js";import{ADWAITA_ICON_GRID as le,DEFAULT_ICON_COLOR as ue,DEFAULT_ICON_COLOR_DARK as de,extractIconPaths as fe,extractPathData as pe}from"./icon-path.js";import{ICON_FALLBACK_NAME as me,compiledIconNames as he,iconValueKind as ge,isIconAvailable as _e,registerIcon as ve,registeredIconNames as ye,resolveIconSource as be,unregisterIcon as xe}from"./icon-theme.js";import{renderSymbolicIcon as Se}from"./icons.js";import{DEFAULT_GTK_IMAGE_SIZE as Ce,GtkImage as o}from"./gtk-image.js";import{attachRowPressFeedback as we}from"./row-press.js";import{AdwImageButton as s,DEFAULT_ICON_BUTTON_ICON_SIZE as Te}from"./adw-image-button.js";import{AdwEntryRow as c,NOTIFY_TEXT as Ee}from"./adw-entry-row.js";import{AdwPasswordEntryRow as l}from"./adw-password-entry-row.js";import{ACTIVATE as De,GtkEntry as u,NOTIFY_TEXT as Oe}from"./gtk-entry.js";import{AdwComboRow as d,ComboState as ke,NOTIFY_SELECTED as Ae}from"./adw-combo-row.js";import{GtkDropDown as f,NOTIFY_SELECTED as je}from"./gtk-drop-down.js";import{AdwSpinRow as p,NOTIFY_VALUE as Me,SpinState as Ne}from"./adw-spin-row.js";import{AdwSliderRow as m,NOTIFY_SLIDER_VALUE as Pe}from"./adw-slider-row.js";import{AdwExpanderRow as h,ExpanderState as Fe,NOTIFY_EXPANDED as g}from"./adw-expander-row.js";import{buttonSlotAfterWrite as _,buttonSlotDetaches as v}from"./button-slot.js";import{labelDisplayText as Ie,labelMarkupIsUnparseable as Le}from"./label-text.js";import{GTK_BUTTON_CLICKED as Re,GTK_BUTTON_LABEL_CLASS as ze,GtkButton as y}from"./gtk-button.js";import{DEFAULT_BOX_SPACING as Be,boxChildMargin as Ve,boxSpacingChanges as He,normalizeBoxSpacing as Ue}from"./box-layout.js";import{GtkBox as b}from"./gtk-box.js";import{GtkLabel as x}from"./gtk-label.js";import{MENU_CANCEL_LABEL as We,menuSheetActions as Ge,menuSheetRows as Ke,presentMenuSheet as qe,resolveMenuChoice as Je}from"./menu-sheet.js";import{GtkMenuButton as S,MENU_ITEM_ACTIVATED as Ye}from"./gtk-menu-button.js";import{DEFAULT_CLAMP_MAX_SIZE as Xe,DEFAULT_SPINNER_SIZE as Ze}from"./chrome.js";import{AdwBanner as C,BUTTON_CLICKED as Qe}from"./adw-banner.js";import{avatarInitials as $e}from"./avatar-color.js";import{AVATAR_DEFAULT_ICON as et}from"./avatar-view.js";import{AdwAvatar as w,DEFAULT_AVATAR_SIZE as tt}from"./adw-avatar.js";import{AdwWindowTitle as T}from"./adw-window-title.js";import{AdwClamp as E}from"./adw-clamp.js";import{AdwHeaderBar as D}from"./adw-header-bar.js";import{AdwToolbarView as O}from"./adw-toolbar-view.js";import{AdwWrapBox as k}from"./adw-wrap-box.js";import{DATA_GRID_HEADER_CELL_CLASS as nt,DATA_GRID_HEADER_ROW_CLASS as rt,DATA_GRID_SECTION_CELL_CLASS as it,dataGridCellClass as at,dataGridItemSpec as ot,dataGridRowClass as st,dataGridShapeKey as ct,dataGridTracksKey as lt,parseDataGridWidth as ut}from"./data-grid-model.js";import{AdwDataGrid as A,ROW_ACTIVATED as dt}from"./adw-data-grid.js";import{AdwSpinner as j}from"./adw-spinner.js";import{AdwStatusPage as M}from"./adw-status-page.js";import{AdwButtonRow as N}from"./adw-button-row.js";import{AdwButtonContent as P}from"./adw-button-content.js";import{AdwSplitButton as F,CLICKED as ft,MENU_TAPPED as pt}from"./adw-split-button.js";import{AdwToggleGroup as I,NOTIFY_SELECTED as mt,ToggleGroupState as L}from"./adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as ht,adwaitaNsAccentColor as gt,adwaitaNsAccentCss as _t}from"./accent-theme.js";import{applyAdwaitaNsAccent as vt,clearAdwaitaNsAccent as yt}from"./adw-accent.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as bt,SHORTCUT_LABEL_CLASS as xt,SHORTCUT_LABEL_DIMMED_CLASS as St,SHORTCUT_LABEL_DISABLED_CLASS as Ct,SHORTCUT_LABEL_KEYCAP_CLASS as wt,SHORTCUT_LABEL_KEYS_CLASS as Tt,SHORTCUT_LABEL_SIDE_CLASS as Et,SHORTCUT_LABEL_SPACED_CLASS as Dt,shortcutLabelDirection as Ot,shortcutLabelPlatform as kt,shortcutLabelRenderPlan as At}from"./shortcut-label.js";import{AdwShortcutLabel as R}from"./adw-shortcut-label.js";import{AdwViewStack as z,NOTIFY_VISIBLE_CHILD as jt}from"./adw-view-stack.js";import{AdwViewSwitcherBase as Mt,NOTIFY_SELECTED as Nt}from"./view-switcher-base.js";import{AdwViewSwitcher as B}from"./adw-view-switcher.js";import{AdwViewSwitcherBar as V}from"./adw-view-switcher-bar.js";import{AdwInlineViewSwitcher as H}from"./adw-inline-view-switcher.js";import{applyTabViewVisibility as Pt,createTabViewState as Ft,tabBarVisibility as It,tabCloseVisibilities as Lt,tabLabelText as Rt,tabPageVisibilities as zt,tabTooltipText as Bt,tabViewNotifyPayload as Vt}from"./tab-view-state.js";import{AdwTabView as U,CLOSE_PAGE as Ht,NOTIFY_SELECTED_PAGE as Ut,PAGES_CHANGED as Wt}from"./adw-tab-view.js";import{CarouselScrollSync as Gt,DEFAULT_CAROUSEL_PAGE_WIDTH as Kt,applyCarouselDots as qt,carouselDotClasses as Jt,carouselNotifyPayload as Yt,carouselPositionAtOffset as Xt,carouselScrollOffset as Zt,createCarouselState as Qt,normalizeCarouselPageWidth as $t}from"./carousel-state.js";import{AdwCarousel as W,NOTIFY_N_PAGES as en,NOTIFY_POSITION as tn,PAGE_CHANGED as nn}from"./adw-carousel.js";import{NOTIFY_VISIBLE_PAGE as rn}from"./navigation-stack.js";import{AdwNavigationView as G}from"./adw-navigation-view.js";import{NsNavigationSplitViewState as an,NsOverlaySplitViewState as on,splitViewColumns as sn}from"./split-view-state.js";import{AdwSplitViewBase as cn,NOTIFY_SHOW_SIDEBAR as ln}from"./split-view-base.js";import{AdwNavigationSplitView as K}from"./adw-navigation-split-view.js";import{AdwOverlaySplitView as q}from"./adw-overlay-split-view.js";import{AdwSidebar as J,NOTIFY_SELECTED as un}from"./adw-sidebar.js";import{CLOSE_ATTEMPT as dn,NOTIFY_OPEN as fn,SHEET_CLOSE as pn}from"./bottom-sheet-state.js";import{AdwBottomSheet as Y}from"./adw-bottom-sheet.js";import{AdwToast as mn,AdwToastOverlay as X,AdwToastQueue as hn,DEFAULT_TOAST_TIMEOUT as gn,TOAST_BUTTON_CLICKED as _n}from"./adw-toast-overlay.js";import{AdwAlertDialog as vn,AdwAlertResponses as yn,NOTIFY_RESPONSE as bn}from"./adw-alert-dialog.js";import{AdwAboutDialog as Z,CLOSED as xn}from"./adw-about-dialog.js";import{AdwPreferencesDialog as Q,CLOSED as Sn}from"./adw-preferences-dialog.js";import{AdwBreakpoint as Cn,addBreakpoints as wn,evaluateBreakpointCondition as Tn,parseBreakpointCondition as En}from"./breakpoint.js";const Dn={AdwPreferencesPage:n,AdwPreferencesGroup:r,AdwActionRow:i,AdwSwitchRow:a,AdwEntryRow:c,AdwPasswordEntryRow:l,GtkEntry:u,AdwComboRow:d,GtkDropDown:f,AdwSpinRow:p,AdwSliderRow:m,AdwExpanderRow:h,GtkButton:y,GtkBox:b,GtkLabel:x,AdwImageButton:s,GtkMenuButton:S,GtkImage:o,AdwBanner:C,AdwAvatar:w,AdwWindowTitle:T,AdwClamp:E,AdwHeaderBar:D,AdwToolbarView:O,AdwWrapBox:k,AdwDataGrid:A,AdwSpinner:j,AdwStatusPage:M,AdwButtonRow:N,AdwButtonContent:P,AdwSplitButton:F,AdwToggleGroup:I,AdwShortcutLabel:R,AdwViewStack:z,AdwViewSwitcher:B,AdwViewSwitcherBar:V,AdwInlineViewSwitcher:H,AdwTabView:U,AdwCarousel:W,AdwNavigationView:G,AdwNavigationSplitView:K,AdwOverlaySplitView:q,AdwSidebar:J,AdwBottomSheet:Y,AdwToastOverlay:X,AdwAboutDialog:Z,AdwPreferencesDialog:Q};let $=!1;function registerAdwaitaElements(){if(!$&&typeof registerElement==`function`){for(let[e,t]of Object.entries(Dn))registerElement(e,()=>t);$=!0}}export{xn as ABOUT_CLOSED,te as ACTIVATED,le as ADWAITA_ICON_GRID,ht as ADWAITA_NS_ACCENT_RULES,et as AVATAR_DEFAULT_ICON,Z as AdwAboutDialog,i as AdwActionRow,vn as AdwAlertDialog,yn as AdwAlertResponses,w as AdwAvatar,C as AdwBanner,Y as AdwBottomSheet,Cn as AdwBreakpoint,P as AdwButtonContent,N as AdwButtonRow,W as AdwCarousel,E as AdwClamp,d as AdwComboRow,A as AdwDataGrid,c as AdwEntryRow,h as AdwExpanderRow,D as AdwHeaderBar,s as AdwImageButton,H as AdwInlineViewSwitcher,K as AdwNavigationSplitView,G as AdwNavigationView,q as AdwOverlaySplitView,l as AdwPasswordEntryRow,Q as AdwPreferencesDialog,r as AdwPreferencesGroup,n as AdwPreferencesPage,R as AdwShortcutLabel,J as AdwSidebar,m as AdwSliderRow,p as AdwSpinRow,j as AdwSpinner,F as AdwSplitButton,cn as AdwSplitViewBase,M as AdwStatusPage,a as AdwSwitchRow,U as AdwTabView,mn as AdwToast,X as AdwToastOverlay,hn as AdwToastQueue,I as AdwToggleGroup,O as AdwToolbarView,z as AdwViewStack,B as AdwViewSwitcher,V as AdwViewSwitcherBar,Mt as AdwViewSwitcherBase,T as AdwWindowTitle,k as AdwWrapBox,Qe as BUTTON_CLICKED,ft as CLICKED,dn as CLOSE_ATTEMPT,Ht as CLOSE_PAGE,Gt as CarouselScrollSync,ke as ComboState,nt as DATA_GRID_HEADER_CELL_CLASS,rt as DATA_GRID_HEADER_ROW_CLASS,it as DATA_GRID_SECTION_CELL_CLASS,tt as DEFAULT_AVATAR_SIZE,Be as DEFAULT_BOX_SPACING,Kt as DEFAULT_CAROUSEL_PAGE_WIDTH,Xe as DEFAULT_CLAMP_MAX_SIZE,Ce as DEFAULT_GTK_IMAGE_SIZE,Te as DEFAULT_ICON_BUTTON_ICON_SIZE,ue as DEFAULT_ICON_COLOR,de as DEFAULT_ICON_COLOR_DARK,Ze as DEFAULT_SPINNER_SIZE,gn as DEFAULT_TOAST_TIMEOUT,De as ENTRY_ACTIVATE,Fe as ExpanderState,e as GTK_ALIGN,Re as GTK_BUTTON_CLICKED,ze as GTK_BUTTON_LABEL_CLASS,b as GtkBox,y as GtkButton,f as GtkDropDown,u as GtkEntry,o as GtkImage,x as GtkLabel,S as GtkMenuButton,me as ICON_FALLBACK_NAME,We as MENU_CANCEL_LABEL,Ye as MENU_ITEM_ACTIVATED,pt as MENU_TAPPED,ne as NOTIFY_ACTIVE,je as NOTIFY_DROP_DOWN_SELECTED,Oe as NOTIFY_ENTRY_TEXT,g as NOTIFY_EXPANDED,en as NOTIFY_N_PAGES,fn as NOTIFY_OPEN,tn as NOTIFY_POSITION,bn as NOTIFY_RESPONSE,Ae as NOTIFY_SELECTED,Ut as NOTIFY_SELECTED_PAGE,ln as NOTIFY_SHOW_SIDEBAR,un as NOTIFY_SIDEBAR_SELECTED,Pe as NOTIFY_SLIDER_VALUE,Ee as NOTIFY_TEXT,mt as NOTIFY_TOGGLE_SELECTED,Me as NOTIFY_VALUE,Nt as NOTIFY_VIEW_SELECTED,jt as NOTIFY_VISIBLE_CHILD,rn as NOTIFY_VISIBLE_PAGE,an as NsNavigationSplitViewState,on as NsOverlaySplitViewState,Wt as PAGES_CHANGED,nn as PAGE_CHANGED,Sn as PREFERENCES_CLOSED,dt as ROW_ACTIVATED,pn as SHEET_CLOSE,bt as SHORTCUT_LABEL_CAP_TEXT_CLASS,xt as SHORTCUT_LABEL_CLASS,St as SHORTCUT_LABEL_DIMMED_CLASS,Ct as SHORTCUT_LABEL_DISABLED_CLASS,wt as SHORTCUT_LABEL_KEYCAP_CLASS,Tt as SHORTCUT_LABEL_KEYS_CLASS,Et as SHORTCUT_LABEL_SIDE_CLASS,Dt as SHORTCUT_LABEL_SPACED_CLASS,Ne as SpinState,_n as TOAST_BUTTON_CLICKED,L as ToggleGroupState,wn as addBreakpoints,re as adwaitaColorScheme,gt as adwaitaNsAccentColor,_t as adwaitaNsAccentCss,vt as applyAdwaitaNsAccent,qt as applyCarouselDots,t as applyConstructProps,Pt as applyTabViewVisibility,we as attachRowPressFeedback,$e as avatarInitials,Ve as boxChildMargin,He as boxSpacingChanges,_ as buttonSlotAfterWrite,v as buttonSlotDetaches,Jt as carouselDotClasses,Yt as carouselNotifyPayload,Xt as carouselPositionAtOffset,Zt as carouselScrollOffset,yt as clearAdwaitaNsAccent,he as compiledIconNames,Qt as createCarouselState,Ft as createTabViewState,at as dataGridCellClass,ot as dataGridItemSpec,st as dataGridRowClass,ct as dataGridShapeKey,lt as dataGridTracksKey,Tn as evaluateBreakpointCondition,fe as extractIconPaths,pe as extractPathData,ge as iconValueKind,_e as isIconAvailable,ie as isThemeIconColor,Ie as labelDisplayText,Le as labelMarkupIsUnparseable,Ge as menuSheetActions,Ke as menuSheetRows,Ue as normalizeBoxSpacing,$t as normalizeCarouselPageWidth,ee as nsAlignment,ae as onAdwaitaColorSchemeChanged,En as parseBreakpointCondition,ut as parseDataGridWidth,qe as presentMenuSheet,registerAdwaitaElements,ve as registerIcon,ye as registeredIconNames,Se as renderSymbolicIcon,be as resolveIconSource,Je as resolveMenuChoice,oe as setAdwaitaColorScheme,Ot as shortcutLabelDirection,kt as shortcutLabelPlatform,At as shortcutLabelRenderPlan,sn as splitViewColumns,It as tabBarVisibility,Lt as tabCloseVisibilities,Rt as tabLabelText,zt as tabPageVisibilities,Bt as tabTooltipText,Vt as tabViewNotifyPayload,se as themeIconColor,ce as toggleAdwaitaColorScheme,xe as unregisterIcon};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{stripMarkup as e,stripMnemonic as t}from"@gjsify/adwaita-core";function labelDisplayText(n,r,i){let a=n??``,o=r?e(a)??a:a;return i?t(o):o}function labelMarkupIsUnparseable(t,n){return n&&e(t??``)===null}export{labelDisplayText,labelMarkupIsUnparseable};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{flattenMenu as e,menuNodeAt as t,resolveMenuItemState as n}from"@gjsify/adwaita-core";const r=`Cancel`;function menuSheetRows(n,i=[],a,o=r){let s=i.length===0?null:t(n,i),c=s!==null&&s.kind!==`item`?s.items:n,l=new Set([o]),u=[];for(let t of e(c,i)){let e=sheetLabel(t,a);if(e===null)continue;let n=e;for(;l.has(n);)n+=`​`;l.add(n),u.push({action:n,path:t.path,submenu:t.node.kind===`submenu`})}return u}function sheetLabel(e,t){if(e.node.kind===`submenu`)return`${e.node.label} ›`;let r=n(e.node,t);return!r.visible||!r.sensitive?null:r.toggled?`✓ ${e.node.label}`:e.node.label}const menuSheetActions=e=>e.map(e=>e.action);function resolveMenuChoice(e,t){return typeof t==`string`?e.find(e=>e.action===t)??null:null}async function presentMenuSheet(e,n,r={}){let i=r.cancelLabel??`Cancel`,a=[],o=r.title;for(;;){let s=menuSheetRows(n,a,r.actions,i);if(s.length===0)return null;let c=resolveMenuChoice(s,await e({title:o!==void 0&&o.length>0?o:void 0,cancelButtonText:i,actions:menuSheetActions(s)}));if(c===null)return null;if(!c.submenu)return c.path;a=c.path;let l=t(n,a);o=l!==null&&l.kind===`submenu`?l.label:void 0}}function refuseMenuString(e,t){if(typeof e==`string`)throw TypeError(`${t}.menuModel takes a menu model, not the string ${JSON.stringify(e.slice(0,40))}. NativeScript's XML Builder writes an attribute straight onto the property, so a menuModel="…" in a view file arrives here as text — which this port deliberately does not parse (ADR 0042). Assign the model from code, or keep this menu on a surface whose attribute door is open.`)}export{r as MENU_CANCEL_LABEL,menuSheetActions,menuSheetRows,presentMenuSheet,refuseMenuString,resolveMenuChoice};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";const e=new WeakMap;let t=1;function withSignals(n){class WithSignals extends n{connect(n,r){let listener=e=>r(this,e),i=t++,a=e.get(this);return a===void 0&&(a=new Map,e.set(this,a)),a.set(i,{eventName:n,listener}),this.addEventListener(n,listener),i}disconnect(t){let n=e.get(this)?.get(t);if(n===void 0)throw TypeError(`${this.constructor.name} has no handler with id ${t}. connect() hands out each id once and disconnect() takes it once; a second disconnect, or an id another widget returned, is refused here rather than left as a silent no-op.`);this.removeEventListener(n.eventName,n.listener),e.get(this)?.delete(t)}}return WithSignals}export{withSignals};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{splitButtonArrowIcon as e}from"@gjsify/adwaita-core";import{openMenuSymbolic as t}from"@gjsify/adwaita-icons/actions";import{panDownSymbolic as n,panEndSymbolic as r,panStartSymbolic as i,panUpSymbolic as a}from"@gjsify/adwaita-icons/ui";const o=`Cancel`,s={"open-menu-symbolic":t,"pan-down-symbolic":n,"pan-up-symbolic":a,"pan-start-symbolic":i,"pan-end-symbolic":r};function toMenuEntries(e){if(!Array.isArray(e))return[];let t=[];for(let n of e)typeof n==`string`?t.push({label:n}):typeof n==`object`&&n&&typeof n.label==`string`&&t.push({...n});return t}function menuSheetActions(e,t=o){let n=new Set([t]),r=[];for(let t of e){let e=t.label;for(;n.has(e);)e+=`​`;n.add(e),r.push(e)}return r}function resolveMenuChoice(e,t){return typeof t==`string`?e.indexOf(t):-1}function splitButtonArrowSvg(t){return s[e(t)]}function setActionIcon(e,t){let n=t??``;n.length>0?e.setIconName(n):e.mode===`icon`&&e.setChild(null)}export{s as ARROW_SVGS,o as MENU_CANCEL_LABEL,menuSheetActions,resolveMenuChoice,setActionIcon,splitButtonArrowSvg,toMenuEntries};
1
+ import"../_virtual/_rolldown/runtime.js";import{splitButtonArrowIcon as e}from"@gjsify/adwaita-core";import{openMenuSymbolic as t}from"@gjsify/adwaita-icons/actions";import{panDownSymbolic as n,panEndSymbolic as r,panStartSymbolic as i,panUpSymbolic as a}from"@gjsify/adwaita-icons/ui";const o={"open-menu-symbolic":t,"pan-down-symbolic":n,"pan-up-symbolic":a,"pan-start-symbolic":i,"pan-end-symbolic":r};function splitButtonArrowSvg(t){return o[e(t)]}function setActionIcon(e,t){let n=t??``;n.length>0?e.setIconName(n):e.mode===`icon`&&e.setChild(null)}export{o as ARROW_SVGS,setActionIcon,splitButtonArrowSvg};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{resolveBuilderSlot as n}from"./builder-slots.js";import{appliesDerivedSidebarWidth as r,defaultSidebarWidthProps as i,normalizeWidthFraction as a,normalizeWidthProp as o,sidebarWidthFor as s}from"./split-view-width.js";import{splitViewColumns as c}from"./split-view-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=`notify::show-sidebar`,f=[`sidebar`,`content`];var AdwSplitViewBase=class extends l{_widthRule;_state;_sidebar=null;_content=null;_widthProps=i();_measuredWidth=0;_sidebarWidthOverride=null;constructor(e,t,n){super(),this._widthRule=t,this._state=n,this.className=e,this.addRow(new u(1,`star`)),this._state.bind({applyLayout:()=>this._applyLayout(),transitionSidebar:()=>this._transitionSidebar(),notifyShowSidebar:e=>this._emitShowSidebar(e)}),this.addEventListener(`layoutChanged`,()=>this._applySidebarWidth()),this._syncColumns()}_syncColumns(){this.removeColumns(),c(this._state.sidebarPosition,this.textDirection).sidebar===0?(this.addColumn(new u(1,`auto`)),this.addColumn(new u(1,`star`))):(this.addColumn(new u(1,`star`)),this.addColumn(new u(1,`auto`)))}_syncSidebarSide(e=this._sidebar){if(!e)return;let t=c(this._state.sidebarPosition,this.textDirection).sidebar===0,n=(e.className??``).split(` `).filter(e=>e&&e!==`adw-sidebar-at-visual-start`&&e!==`adw-sidebar-at-visual-end`);n.push(t?`adw-sidebar-at-visual-start`:`adw-sidebar-at-visual-end`),e.className=n.join(` `)}get textDirection(){return this.style?.direction===`rtl`?`rtl`:`ltr`}_emitShowSidebar(e){let t={eventName:d,object:this,showSidebar:e.showSidebar,collapsed:e.collapsed};this.notify(t)}_transitionSidebar(){this._applyLayout()}_pending=[];_shouldAnimate(){return typeof(this._sidebar??this._content??this).animate==`function`&&this.isLoaded===!0}_track(e){return this._pending.push(e),e}_cancelPending(){for(let e of this._pending)try{e.cancel()}catch{}this._pending=[]}_isChild(e){for(let t=0;t<this.getChildrenCount();t++)if(this.getChildAt(t)===e)return!0;return!1}setSidebar(e){this._sidebar&&this.removeChild(this._sidebar),this._sidebar=e,e&&(e.className=`${e.className??``} adw-split-view-sidebar`.trim(),this._syncSidebarSide(e),e.width=this.sidebarWidth,this.addChild(e)),this._state.setPaneMounted(`sidebar`,e!==null),this._applyLayout()}setContent(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-split-view-content`.trim(),this.addChild(e)),this._state.setPaneMounted(`content`,e!==null),this._applyLayout()}_addChildFromBuilder(e,t){n(e,f,`content`)===`sidebar`?this.setSidebar(t):this.setContent(t)}showSidebarPane(){this.showSidebar=!0}hideSidebarPane(){this.showSidebar=!1}get collapsed(){return this._state.collapsed}set collapsed(t){let n=e(t,this.collapsed);this._state.setCollapsed(!!n)}get showSidebar(){return this._state.showSidebar}set showSidebar(t){let n=e(t,this.showSidebar);this._state.setShowSidebar(!!n)}get sidebarWidth(){return this._sidebarWidthOverride??s(this._measuredWidth,this._widthProps,this._widthRule,{collapsed:this._state.collapsed})}set sidebarWidth(e){let n=t(e,this.sidebarWidth);this._sidebarWidthOverride=Number.isFinite(n)&&n>0?n:null,this._applySidebarWidth()}get minSidebarWidth(){return this._widthProps.minSidebarWidth}set minSidebarWidth(e){let n=t(e,this.minSidebarWidth);this._widthProps.minSidebarWidth=o(n,i().minSidebarWidth),this._applySidebarWidth()}get maxSidebarWidth(){return this._widthProps.maxSidebarWidth}set maxSidebarWidth(e){let n=t(e,this.maxSidebarWidth);this._widthProps.maxSidebarWidth=o(n,i().maxSidebarWidth),this._applySidebarWidth()}get sidebarWidthFraction(){return this._widthProps.sidebarWidthFraction}set sidebarWidthFraction(e){let n=t(e,this.sidebarWidthFraction);this._widthProps.sidebarWidthFraction=a(n),this._applySidebarWidth()}_applySidebarWidth(){let e=this.getActualSize?.();e&&e.width>0&&(this._measuredWidth=e.width),this._sidebar&&r(this._state.collapsed,this._widthRule)&&(this._sidebar.width=this.sidebarWidth)}get sidebarPosition(){return this._state.sidebarPosition}set sidebarPosition(e){this._state.setSidebarPosition(e===`end`?`end`:`start`)&&(this._syncColumns(),this._syncSidebarSide(),this._applyLayout())}get sidebar(){return this._sidebar}get content(){return this._content}};export{AdwSplitViewBase,d as NOTIFY_SHOW_SIDEBAR};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{resolveBuilderSlot as r}from"./builder-slots.js";import{appliesDerivedSidebarWidth as i,defaultSidebarWidthProps as a,normalizeWidthFraction as o,normalizeWidthProp as s,sidebarWidthFor as c}from"./split-view-width.js";import{splitViewColumns as l}from"./split-view-state.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";const f=`notify::show-sidebar`,p=[`sidebar`,`content`];var AdwSplitViewBase=class extends n(u){_widthRule;_state;_sidebar=null;_content=null;_widthProps=a();_splitWidth=0;_sidebarWidthOverride=null;constructor(e,t,n){super(),this._widthRule=t,this._state=n,this.className=e,this.addRow(new d(1,`star`)),this._state.bind({applyLayout:()=>this._applyLayout(),transitionSidebar:()=>this._transitionSidebar(),notifyShowSidebar:e=>this._emitShowSidebar(e)}),this.addEventListener(`layoutChanged`,()=>this._applySidebarWidth()),this._syncColumns()}_syncColumns(){this.removeColumns(),l(this._state.sidebarPosition,this.textDirection).sidebar===0?(this.addColumn(new d(1,`auto`)),this.addColumn(new d(1,`star`))):(this.addColumn(new d(1,`star`)),this.addColumn(new d(1,`auto`)))}_syncSidebarSide(e=this._sidebar){if(!e)return;let t=l(this._state.sidebarPosition,this.textDirection).sidebar===0,n=(e.className??``).split(` `).filter(e=>e&&e!==`adw-sidebar-at-visual-start`&&e!==`adw-sidebar-at-visual-end`);n.push(t?`adw-sidebar-at-visual-start`:`adw-sidebar-at-visual-end`),e.className=n.join(` `)}get textDirection(){return this.style?.direction===`rtl`?`rtl`:`ltr`}_emitShowSidebar(e){let t={eventName:f,object:this,showSidebar:e.showSidebar,collapsed:e.collapsed};this.notify(t)}_transitionSidebar(){this._applyLayout()}_pending=[];_shouldAnimate(){return typeof(this._sidebar??this._content??this).animate==`function`&&this.isLoaded===!0}_track(e){return this._pending.push(e),e}_cancelPending(){for(let e of this._pending)try{e.cancel()}catch{}this._pending=[]}_isChild(e){for(let t=0;t<this.getChildrenCount();t++)if(this.getChildAt(t)===e)return!0;return!1}set_sidebar(e){this._sidebar&&this.removeChild(this._sidebar),this._sidebar=e,e&&(e.className=`${e.className??``} adw-split-view-sidebar`.trim(),this._syncSidebarSide(e),e.width=this.sidebarWidth,this.addChild(e)),this._state.setPaneMounted(`sidebar`,e!==null),this._applyLayout()}set_content(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-split-view-content`.trim(),this.addChild(e)),this._state.setPaneMounted(`content`,e!==null),this._applyLayout()}_addChildFromBuilder(e,t){r(e,p,`content`)===`sidebar`?this.set_sidebar(t):this.set_content(t)}showSidebarPane(){this.showSidebar=!0}hideSidebarPane(){this.showSidebar=!1}get collapsed(){return this._state.collapsed}set collapsed(t){let n=e(t,this.collapsed);this._state.setCollapsed(!!n)}get showSidebar(){return this._state.showSidebar}set showSidebar(t){let n=e(t,this.showSidebar);this._state.setShowSidebar(!!n)}get sidebarWidth(){return this._sidebarWidthOverride??c(this._splitWidth,this._widthProps,this._widthRule,{collapsed:this._state.collapsed})}set sidebarWidth(e){let n=t(e,this.sidebarWidth);this._sidebarWidthOverride=Number.isFinite(n)&&n>0?n:null,this._applySidebarWidth()}get minSidebarWidth(){return this._widthProps.minSidebarWidth}set minSidebarWidth(e){let n=t(e,this.minSidebarWidth);this._widthProps.minSidebarWidth=s(n,a().minSidebarWidth),this._applySidebarWidth()}get maxSidebarWidth(){return this._widthProps.maxSidebarWidth}set maxSidebarWidth(e){let n=t(e,this.maxSidebarWidth);this._widthProps.maxSidebarWidth=s(n,a().maxSidebarWidth),this._applySidebarWidth()}get sidebarWidthFraction(){return this._widthProps.sidebarWidthFraction}set sidebarWidthFraction(e){let n=t(e,this.sidebarWidthFraction);this._widthProps.sidebarWidthFraction=o(n),this._applySidebarWidth()}_applySidebarWidth(){let e=this.getActualSize?.();e&&e.width>0&&(this._splitWidth=e.width),this._sidebar&&i(this._state.collapsed,this._widthRule)&&(this._sidebar.width=this.sidebarWidth)}get sidebarPosition(){return this._state.sidebarPosition}set sidebarPosition(e){this._state.setSidebarPosition(e===`end`?`end`:`start`)&&(this._syncColumns(),this._syncSidebarSide(),this._applyLayout())}get sidebar(){return this._sidebar}get content(){return this._content}};export{AdwSplitViewBase,f as NOTIFY_SHOW_SIDEBAR};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";function normalizeStyleClasses(e){if(e==null)return[];let t=new Set;for(let n of e.split(/\s+/))n&&t.add(n);return[...t]}function classNameWith(e,t){return[e,...t].filter(e=>e!==``).join(` `)}function withCssClass(e,t){let n=(t??``).trim();return n===``||e.includes(n)?[...e]:[...e,n]}function withoutCssClass(e,t){let n=(t??``).trim();return e.filter(e=>e!==n)}export{classNameWith,normalizeStyleClasses,withCssClass,withoutCssClass};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{AdwIcon as t}from"./adw-icon.js";import{attachRowPressFeedback as n}from"./row-press.js";import{applyViewSwitcherVisibility as r,createViewSwitcherState as i,nsIconSvg as a,switcherButtonVisible as o,viewSwitcherNotifyPayload as s,viewSwitcherPageSpecs as c}from"./view-switcher-model.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{buildViewSwitcherButtons as p}from"@gjsify/adwaita-core";const m=`notify::selected`;var AdwViewSwitcherBase=class extends l{_bar;_policy=`narrow`;_contentArea;_pages=[];_state=i();_nodes=[];get policy(){return this._policy}get switcherPolicy(){return this._policy}set switcherPolicy(e){let t=e===`wide`?`wide`:`narrow`;t!==this._policy&&(this._policy=t,this._applySelection(),this.notify({eventName:`notify::policy`,object:this}))}get buttonDisplayMode(){return`both`}constructor(e){super(),this.className=e,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`));let t=new l;t.horizontalAlignment=`stretch`,t.addRow(new u(1,`auto`)),l.setRow(t,0),this.addChild(t),this._bar=t;let n=new l;n.addColumn(new u(1,`star`)),n.addRow(new u(1,`star`)),l.setRow(n,1),this.addChild(n),this._contentArea=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:m,object:this,...s(e)};this.notify(t)})}_initClasses(){this._bar.className=this.barClass}setViews(e){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns();for(let e of this._pages)this._contentArea.removeChild(e.content);this._pages.length=0,this._pages.push(...e);for(let[e,t]of this._pages.entries())this._nodes.push(this._buildButton(e)),l.setColumn(t.content,0),l.setRow(t.content,0),this._contentArea.addChild(t.content);this._state.setPages(c(this._pages)),this._applySelection()}_buildButton(e){let r=new f;r.orientation=`horizontal`,r.className=this.buttonClass,r.horizontalAlignment=`center`;let i=new t;i.className=`${i.className} ${this.buttonClass}-icon`.trim(),i.verticalAlignment=`middle`,r.addChild(i);let a=new d;a.className=`${this.buttonClass}-label`,a.verticalAlignment=`middle`,r.addChild(a);let o=new d;return o.className=`${this.buttonClass}-badge`,o.verticalAlignment=`middle`,r.addChild(o),n(r),r.addEventListener(`tap`,()=>{this._state.setSelected(e)}),this._bar.addColumn(new u(1,`star`)),l.setColumn(r,e),l.setRow(r,0),this._bar.addChild(r),{button:r,icon:i,label:a,badge:o}}get switcherKind(){return`switcher`}_applySelection(){r(this._pages,this._state.selected);let e=this.buttonDisplayMode!==`labels`,t=this.buttonDisplayMode!==`icons`;p(this._state.pages,this._state.selected,this.policy).forEach((n,r)=>{let i=this._nodes[r];if(!i)return;let s=this._state.pages[r]?.visible??!1;i.button.visibility=o(this.switcherKind,n.visible,s)?`visible`:`collapse`,i.button.orientation=n.orientation===`horizontal`?`horizontal`:`vertical`,i.button.className=n.selected?`${this.buttonClass} active`:this.buttonClass,i.icon.iconName=a(n.iconName),i.icon.visibility=e?`visible`:`collapse`,i.label.text=n.label,i.label.visibility=t?`visible`:`collapse`,i.badge.text=n.badgeLabel,i.badge.visibility=n.badgeLabel.length>0||n.needsAttention?`visible`:`collapse`,n.badgeLabel.length===0&&n.needsAttention?i.badge.className=`${this.buttonClass}-badge needs-attention`:i.badge.className=`${this.buttonClass}-badge`,i.button.accessibilityLabel=n.description||n.label})}get views(){return this._pages}set views(e){this.setViews(Array.isArray(e)?e:[])}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);this._state.setSelected(n)}get selectedName(){return this._state.selectedName}setPageVisible(e,t){let n=this._state.setPageVisible(e,t);return this._applySelection(),n}};export{AdwViewSwitcherBase,m as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{withSignals as t}from"./signals.js";import{GtkImage as n}from"./gtk-image.js";import{attachRowPressFeedback as r}from"./row-press.js";import{applyViewSwitcherVisibility as i,createViewSwitcherState as a,switcherButtonVisible as o,viewSwitcherNotifyPayload as s,viewSwitcherPageSpecs as c}from"./view-switcher-model.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{buildViewSwitcherButtons as p}from"@gjsify/adwaita-core";const m=`notify::selected`;var AdwViewSwitcherBase=class extends t(l){_bar;_policy=`narrow`;_contentArea;_pages=[];_state=a();_nodes=[];get policy(){return this._policy}get switcherPolicy(){return this._policy}set switcherPolicy(e){let t=e===`wide`?`wide`:`narrow`;t!==this._policy&&(this._policy=t,this._applySelection(),this.notify({eventName:`notify::policy`,object:this}))}get buttonDisplayMode(){return`both`}constructor(e){super(),this.className=e,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addRow(new u(1,`star`));let t=new l;t.horizontalAlignment=`stretch`,t.addRow(new u(1,`auto`)),l.setRow(t,0),this.addChild(t),this._bar=t;let n=new l;n.addColumn(new u(1,`star`)),n.addRow(new u(1,`star`)),l.setRow(n,1),this.addChild(n),this._contentArea=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:m,object:this,...s(e)};this.notify(t)})}_initClasses(){this._bar.className=this.barClass}setViews(e){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns();for(let e of this._pages)this._contentArea.removeChild(e.content);this._pages.length=0,this._pages.push(...e);for(let[e,t]of this._pages.entries())this._nodes.push(this._buildButton(e)),l.setColumn(t.content,0),l.setRow(t.content,0),this._contentArea.addChild(t.content);this._state.setPages(c(this._pages)),this._applySelection()}_buildButton(e){let t=new f;t.orientation=`horizontal`,t.className=this.buttonClass,t.horizontalAlignment=`center`;let i=new n;i.className=`${i.className} ${this.buttonClass}-icon`.trim(),i.verticalAlignment=`middle`,t.addChild(i);let a=new d;a.className=`${this.buttonClass}-label`,a.verticalAlignment=`middle`,t.addChild(a);let o=new d;return o.className=`${this.buttonClass}-badge`,o.verticalAlignment=`middle`,t.addChild(o),r(t),t.addEventListener(`tap`,()=>{this._state.setSelected(e)}),this._bar.addColumn(new u(1,`star`)),l.setColumn(t,e),l.setRow(t,0),this._bar.addChild(t),{button:t,icon:i,label:a,badge:o}}get switcherKind(){return`switcher`}_applySelection(){i(this._pages,this._state.selected);let e=this.buttonDisplayMode!==`labels`,t=this.buttonDisplayMode!==`icons`;p(this._state.pages,this._state.selected,this.policy).forEach((n,r)=>{let i=this._nodes[r];if(!i)return;let a=this._state.pages[r]?.visible??!1;i.button.visibility=o(this.switcherKind,n.visible,a)?`visible`:`collapse`,i.button.orientation=n.orientation===`horizontal`?`horizontal`:`vertical`,i.button.className=n.selected?`${this.buttonClass} active`:this.buttonClass,i.icon.iconName=n.iconName,i.icon.visibility=e?`visible`:`collapse`,i.label.text=n.label,i.label.visibility=t?`visible`:`collapse`,i.badge.text=n.badgeLabel,i.badge.visibility=n.badgeLabel.length>0||n.needsAttention?`visible`:`collapse`,n.badgeLabel.length===0&&n.needsAttention?i.badge.className=`${this.buttonClass}-badge needs-attention`:i.badge.className=`${this.buttonClass}-badge`,i.button.accessibilityLabel=n.description||n.label})}get views(){return this._pages}set views(e){this.setViews(Array.isArray(e)?e:[])}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);this._state.setSelected(n)}get selectedName(){return this._state.selectedName}setPageVisible(e,t){let n=this._state.setPageVisible(e,t);return this._applySelection(),n}};export{AdwViewSwitcherBase,m as NOTIFY_SELECTED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{VIEW_SWITCHER_FALLBACK_ICON as e,ViewSwitcherBarState as t,ViewSwitcherState as n}from"@gjsify/adwaita-core";import{imageMissingSymbolic as r}from"@gjsify/adwaita-icons/status";function createViewSwitcherState(){return new n}function createViewSwitcherBarState(){return new t}function viewSwitcherPageSpec(e,t){return{name:e.name??String(t),title:e.title??null,iconName:e.icon??null,visible:e.visible??!0,useUnderline:e.useUnderline??!1,badgeNumber:e.badgeNumber??0,needsAttention:e.needsAttention??!1}}function viewSwitcherPageSpecs(e){return e.map((e,t)=>viewSwitcherPageSpec(e,t))}function nsIconSvg(t){return t===e?r:t}function pageVisibilities(e,t){return e.map((e,n)=>n===t?`visible`:`collapse`)}function applyViewSwitcherVisibility(e,t){let n=pageVisibilities(e,t);e.forEach((e,t)=>{e.content.visibility=n[t]})}function switcherButtonVisible(e,t,n){return e===`inline`?n:t}function viewSwitcherNotifyPayload(e){return{selected:e.selected,name:e.name,title:e.title,interactive:e.interactive}}export{applyViewSwitcherVisibility,createViewSwitcherBarState,createViewSwitcherState,nsIconSvg,pageVisibilities,switcherButtonVisible,viewSwitcherNotifyPayload,viewSwitcherPageSpec,viewSwitcherPageSpecs};
1
+ import"../_virtual/_rolldown/runtime.js";import{ViewSwitcherBarState as e,ViewSwitcherState as t}from"@gjsify/adwaita-core";function createViewSwitcherState(){return new t}function createViewSwitcherBarState(){return new e}function viewSwitcherPageSpec(e,t){return{name:e.name??String(t),title:e.title??null,iconName:e.icon??null,visible:e.visible??!0,useUnderline:e.useUnderline??!1,badgeNumber:e.badgeNumber??0,needsAttention:e.needsAttention??!1}}function viewSwitcherPageSpecs(e){return e.map((e,t)=>viewSwitcherPageSpec(e,t))}function pageVisibilities(e,t){return e.map((e,n)=>n===t?`visible`:`collapse`)}function applyViewSwitcherVisibility(e,t){let n=pageVisibilities(e,t);e.forEach((e,t)=>{e.content.visibility=n[t]})}function switcherButtonVisible(e,t,n){return e===`inline`?n:t}function viewSwitcherNotifyPayload(e){return{selected:e.selected,name:e.name,title:e.title,interactive:e.interactive}}export{applyViewSwitcherVisibility,createViewSwitcherBarState,createViewSwitcherState,pageVisibilities,switcherButtonVisible,viewSwitcherNotifyPayload,viewSwitcherPageSpec,viewSwitcherPageSpecs};
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;