@gjsify/adwaita-nativescript 0.64.14 → 0.64.15

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 (77) hide show
  1. package/lib/esm/name-selector.js +1 -0
  2. package/lib/esm/platform-host.js +1 -1
  3. package/lib/esm/widgets/adw-image-button.js +1 -1
  4. package/lib/esm/widgets/adw-split-button.js +1 -1
  5. package/lib/esm/widgets/bin-layout.js +1 -0
  6. package/lib/esm/widgets/css-names.js +1 -0
  7. package/lib/esm/widgets/gtk-button.js +1 -1
  8. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  9. package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
  10. package/lib/esm/widgets/menu-slot.js +1 -1
  11. package/lib/esm/widgets/scrolled-window-policy.js +1 -1
  12. package/lib/esm/widgets/signals.js +1 -1
  13. package/lib/esm/widgets/widget-layout.js +1 -1
  14. package/lib/types/button-bin.spec.d.ts +2 -0
  15. package/lib/types/css-length.spec.d.ts +2 -0
  16. package/lib/types/css-names.spec.d.ts +1 -0
  17. package/lib/types/menu-button-properties.spec.d.ts +2 -0
  18. package/lib/types/menu-model-route-d.node-gi.spec.d.ts +2 -0
  19. package/lib/types/name-selector.d.ts +20 -0
  20. package/lib/types/name-selector.spec.d.ts +2 -0
  21. package/lib/types/testing/ns-core.d.mts +19 -0
  22. package/lib/types/widgets/adw-about-dialog.d.ts +2 -0
  23. package/lib/types/widgets/adw-action-row.d.ts +2 -0
  24. package/lib/types/widgets/adw-alert-dialog.d.ts +2 -0
  25. package/lib/types/widgets/adw-avatar.d.ts +2 -0
  26. package/lib/types/widgets/adw-banner.d.ts +2 -0
  27. package/lib/types/widgets/adw-bottom-sheet.d.ts +2 -0
  28. package/lib/types/widgets/adw-button-content.d.ts +2 -0
  29. package/lib/types/widgets/adw-carousel.d.ts +2 -0
  30. package/lib/types/widgets/adw-clamp.d.ts +2 -0
  31. package/lib/types/widgets/adw-data-grid.d.ts +2 -0
  32. package/lib/types/widgets/adw-header-bar.d.ts +2 -0
  33. package/lib/types/widgets/adw-image-button.d.ts +4 -2
  34. package/lib/types/widgets/adw-navigation-page.d.ts +2 -0
  35. package/lib/types/widgets/adw-navigation-view.d.ts +2 -0
  36. package/lib/types/widgets/adw-preferences-group.d.ts +2 -0
  37. package/lib/types/widgets/adw-preferences-page.d.ts +2 -0
  38. package/lib/types/widgets/adw-shortcut-label.d.ts +2 -0
  39. package/lib/types/widgets/adw-sidebar.d.ts +2 -0
  40. package/lib/types/widgets/adw-slider-row.d.ts +2 -0
  41. package/lib/types/widgets/adw-spinner.d.ts +2 -0
  42. package/lib/types/widgets/adw-split-button.d.ts +42 -27
  43. package/lib/types/widgets/adw-status-page.d.ts +2 -0
  44. package/lib/types/widgets/adw-tab-view.d.ts +2 -0
  45. package/lib/types/widgets/adw-toast-overlay.d.ts +2 -0
  46. package/lib/types/widgets/adw-toggle-group.d.ts +2 -0
  47. package/lib/types/widgets/adw-toggle.d.ts +2 -0
  48. package/lib/types/widgets/adw-toolbar-view.d.ts +2 -0
  49. package/lib/types/widgets/adw-view-stack.d.ts +2 -0
  50. package/lib/types/widgets/adw-view-switcher-bar.d.ts +2 -0
  51. package/lib/types/widgets/adw-window-title.d.ts +2 -0
  52. package/lib/types/widgets/adw-wrap-box.d.ts +2 -0
  53. package/lib/types/widgets/bin-layout.d.ts +12 -0
  54. package/lib/types/widgets/carousel-indicator-base.d.ts +2 -0
  55. package/lib/types/widgets/css-names.d.ts +9 -0
  56. package/lib/types/widgets/gtk-action-bar.d.ts +2 -0
  57. package/lib/types/widgets/gtk-button.d.ts +8 -5
  58. package/lib/types/widgets/gtk-drop-down.d.ts +2 -0
  59. package/lib/types/widgets/gtk-entry.d.ts +2 -0
  60. package/lib/types/widgets/gtk-image.d.ts +2 -0
  61. package/lib/types/widgets/gtk-label.d.ts +2 -0
  62. package/lib/types/widgets/gtk-menu-button.d.ts +26 -20
  63. package/lib/types/widgets/gtk-popover-menu.d.ts +2 -0
  64. package/lib/types/widgets/gtk-scrolled-window.d.ts +9 -0
  65. package/lib/types/widgets/gtk-stack.d.ts +2 -0
  66. package/lib/types/widgets/gtk-text-view.d.ts +2 -0
  67. package/lib/types/widgets/menu-slot.d.ts +15 -4
  68. package/lib/types/widgets/scrolled-window-policy.d.ts +4 -2
  69. package/lib/types/widgets/signals.d.ts +2 -0
  70. package/lib/types/widgets/split-view-base.d.ts +2 -0
  71. package/lib/types/widgets/stack-page.d.ts +2 -0
  72. package/lib/types/widgets/styled-layout-base.d.ts +2 -0
  73. package/lib/types/widgets/view-stack-page.d.ts +2 -0
  74. package/lib/types/widgets/view-switcher-base.d.ts +2 -0
  75. package/lib/types/widgets/widget-layout.d.ts +2 -0
  76. package/package.json +18 -14
  77. package/src/testing/ns-core.mts +39 -0
@@ -0,0 +1 @@
1
+ import"./_virtual/_rolldown/runtime.js";const e=Symbol.for(`gjsify.adwaita-nativescript.name-selector`);function installNameSelector(t){let n=t.prototype;if(Object.hasOwn(n,e))return!1;let r=n.match;return Object.defineProperty(n,e,{value:!0}),n.match=function(e){if(r.call(this,e))return!0;let t=e?.name;return typeof t==`string`&&t===this.id},n.lookupSort=function(e,t){e.sortAsUniversal(t??this)},!0}let t;function provideIdSelector(e){t=e}function installProvidedNameSelector(){t!==void 0&&installNameSelector(t())}export{installNameSelector,installProvidedNameSelector,provideIdSelector};
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.js";import{listenPlatformKeys as e,openPlatformUri as t}from"./platform-source.js";import{Application as n}from"@nativescript/core";const r=new Map,i={setStyles(e){for(let{owner:t,css:i}of e)r.get(t)!==i&&(r.set(t,i),i&&n.addCss(i))},openUri:e=>t(e),fontName:()=>null,listenKeys:(t,n)=>e(t,(e,t,r,i)=>n({key:e,keycode:t,state:r,pressed:i}))};export{i as nativePlatformHost};
1
+ import"./_virtual/_rolldown/runtime.js";import{provideIdSelector as e}from"./name-selector.js";import{listenPlatformKeys as t,openPlatformUri as n}from"./platform-source.js";import{Application as r,CSSHelper as i}from"@nativescript/core";import{cssPxToDip as a}from"@gjsify/adwaita-core/css-length";e(()=>i.createSelector(`#x`).constructor);const o=new Map,s={setStyles(e){for(let{owner:t,css:n}of e)o.get(t)!==n&&(o.set(t,n),n&&r.addCss(a(n)))},openUri:e=>n(e),fontName:()=>null,listenKeys:(e,n)=>t(e,(e,t,r,i)=>n({key:e,keycode:t,state:r,pressed:i}))};export{s as nativePlatformHost};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{GridLayout as p,Image as m,ItemSpec as h}from"@nativescript/core";const g=t;var AdwImageButton=class extends o(p){static GTypeName=`AdwImageButton`;_image;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-image-button`,this.addRow(new h(1,`star`)),this.addColumn(new h(1,`star`));let t=new m;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._renderedSize,t.height=this._renderedSize,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,this.addChild(t),this._image=t,f(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),a(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return r(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this._image.width=e,this._image.height=e,this._render()}_render(){u(this._image,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._applySize()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=n(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(t){this._pixelSize=i(e(t,this._pixelSize)),this._applySize()}get image(){return this._image}};export{AdwImageButton,g as DEFAULT_ICON_BUTTON_ICON_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{adoptIntoBin as p}from"./bin-layout.js";import{DockLayout as m,Image as h}from"@nativescript/core";const g=t;var AdwImageButton=class extends o(m){static GTypeName=`AdwImageButton`;_image;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-image-button`;let t=new h;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._renderedSize,t.height=this._renderedSize,this._image=p(this,t),f(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),a(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return r(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this._image.width=e,this._image.height=e,this._render()}_render(){u(this._image,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._applySize()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=n(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(t){this._pixelSize=i(e(t,this._pixelSize)),this._applySize()}get image(){return this._image}};export{AdwImageButton,g as DEFAULT_ICON_BUTTON_ICON_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{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{buttonContentClassName as a,buttonContentLabelText as o}from"./button-content.js";import{MenuSlot as s}from"./menu-slot.js";import{showMenuPopup as c}from"./popup-menu-view.js";import{splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{SPLIT_BUTTON_DISABLED_OPACITY as d,SplitButtonState as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";const _=`notify::direction`,v=`menuTapped`,clearOtherSlot=(e,t)=>{if(!(e._contentGate||e[t]===null)){e._contentGate=!0;try{e[t]=null}finally{e._contentGate=!1}}};var AdwSplitButton=class extends n(p,{GTypeName:`AdwSplitButton`,Signals:{clicked:{},activate:{}},Properties:{label:{kind:`string`,default:null,blurb:`The label to show in the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.label:String(e)},afterNotify:e=>clearOtherSlot(e,`iconName`)},"icon-name":{kind:`string`,default:null,blurb:`The name of the icon used to automatically populate the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.iconName:String(e)===``?null:String(e)},changed:(e,t,n)=>e!==t||n===``,afterNotify:e=>clearOtherSlot(e,`label`)},"use-underline":{kind:`boolean`,default:!1,blurb:`Whether an underline in the text indicates a mnemonic`},"can-shrink":{kind:`boolean`,default:!1,blurb:`Whether the button can be smaller than the natural size of its contents`},"dropdown-tooltip":{kind:`string`,default:``,blurb:`The tooltip of the dropdown button`}}}){static GTypeName=`AdwSplitButton`;static emittedSignals=[_];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new f;_slot=new s(`AdwSplitButton`,()=>void 0);_actions=null;_showingIcon=!1;_sensitive=!0;_contentGate=!1;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`auto`)),this.addRow(new m(1,`auto`));let n=new g;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,p.setColumn(n,0);let o=new h;o.className=`adw-split-button-label`,o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-split-button-action-icon`.trim(),s.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=o,this._actionIcon=s;let c=new p;c.className=`adw-split-button-dropdown`,c.addColumn(new m(1,`star`)),c.addRow(new m(1,`star`)),p.setColumn(c,1);let u=new r;u.className=`${u.className} adw-split-button-chevron`.trim(),u.iconName=l(this._state.direction),u.horizontalAlignment=`center`,u.verticalAlignment=`middle`,c.addChild(u),this.addChild(c),this._dropdownPart=c,this._chevron=u,n.addEventListener(`tap`,()=>this._click()),this.connect(`activate`,e=>e._click()),c.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(c),this.connect(`notify::label`,e=>e._renderContent()),this.connect(`notify::icon-name`,e=>e._renderContent()),this.connect(`notify::use-underline`,e=>e._renderContent()),this.connect(`notify::can-shrink`,e=>{e._actionLabel.className=a(e._actionLabel.className,e.canShrink)}),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{c(this._dropdownPart,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:v,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_click(){this._sensitive&&this.emit(`clicked`)}_renderContent(){let e=this.iconName!==null;e?this._actionIcon.iconName=this.iconName??``:this._actionLabel.text=o(this.label??``,this.useUnderline),e!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(e?this._actionIcon:this._actionLabel),this._showingIcon=e)}_render(){let{direction:e,dropdownEnabled:t}=this._state;this._chevron.iconName=l(e),this._dropdownPart.opacity=t?1:d,this.opacity=this._sensitive?1:d}get menuModel(){return this._slot.model}set menuModel(e){let t=this._slot.model;this._slot.write(e),this._state.setMenuModel(this._slot.model)&&this.notifyPropertyChange(`menuModel`,this._slot.model,t)}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:_,object:this,value:this.get_direction()})}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,v as MENU_TAPPED,_ as NOTIFY_DIRECTION};
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{buttonContentClassName as a,buttonContentLabelText as o}from"./button-content.js";import{MenuSlot as s}from"./menu-slot.js";import{showMenuPopup as c}from"./popup-menu-view.js";import{splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{GioMenuModel as d,SPLIT_BUTTON_DISABLED_OPACITY as f,SplitButtonState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";const v=`notify::direction`,y=`menuTapped`,clearOtherSlot=(e,t)=>{if(!(e._contentGate||e[t]===null)){e._contentGate=!0;try{e[t]=null}finally{e._contentGate=!1}}};var AdwSplitButton=class extends n(m,{GTypeName:`AdwSplitButton`,Signals:{clicked:{},activate:{}},Properties:{label:{kind:`string`,default:null,blurb:`The label to show in the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.label:String(e)},afterNotify:e=>clearOtherSlot(e,`iconName`)},"icon-name":{kind:`string`,default:null,blurb:`The name of the icon used to automatically populate the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.iconName:String(e)===``?null:String(e)},changed:(e,t,n)=>e!==t||n===``,afterNotify:e=>clearOtherSlot(e,`label`)},"use-underline":{kind:`boolean`,default:!1,blurb:`Whether an underline in the text indicates a mnemonic`},"can-shrink":{kind:`boolean`,default:!1,blurb:`Whether the button can be smaller than the natural size of its contents`},"dropdown-tooltip":{kind:`string`,default:``,blurb:`The tooltip of the dropdown button`},"menu-model":{kind:`object`,valueType:d.$gtype,explicitNotify:!0,blurb:`The menu model from which the popup will be created`,normalize:(e,t)=>t._slot.read(e),afterNotify:e=>{e._applyMenuModel(),e.notify(`menu-model`)}}}}){static GTypeName=`AdwSplitButton`;static emittedSignals=[v];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new p;_slot=new s(`AdwSplitButton`,()=>void 0);_actions=null;_showingIcon=!1;_sensitive=!0;_contentGate=!1;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new h(1,`auto`)),this.addColumn(new h(1,`auto`)),this.addRow(new h(1,`auto`));let n=new _;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,m.setColumn(n,0);let o=new g;o.className=`adw-split-button-label`,o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-split-button-action-icon`.trim(),s.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=o,this._actionIcon=s;let c=new m;c.className=`adw-split-button-dropdown`,c.addColumn(new h(1,`star`)),c.addRow(new h(1,`star`)),m.setColumn(c,1);let u=new r;u.className=`${u.className} adw-split-button-chevron`.trim(),u.iconName=l(this._state.direction),u.horizontalAlignment=`center`,u.verticalAlignment=`middle`,c.addChild(u),this.addChild(c),this._dropdownPart=c,this._chevron=u,n.addEventListener(`tap`,()=>this._click()),this.connect(`activate`,e=>e._click()),c.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(c),this.connect(`notify::label`,e=>e._renderContent()),this.connect(`notify::icon-name`,e=>e._renderContent()),this.connect(`notify::use-underline`,e=>e._renderContent()),this.connect(`notify::can-shrink`,e=>{e._actionLabel.className=a(e._actionLabel.className,e.canShrink)}),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}_applyMenuModel(){this._slot.adopt(this.menuModel),this._state.setMenuModel(this.menuModel)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{c(this._dropdownPart,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:y,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_click(){this._sensitive&&this.emit(`clicked`)}_renderContent(){let e=this.iconName!==null;e?this._actionIcon.iconName=this.iconName??``:this._actionLabel.text=o(this.label??``,this.useUnderline),e!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(e?this._actionIcon:this._actionLabel),this._showingIcon=e)}_render(){let{direction:e,dropdownEnabled:t}=this._state;this._chevron.iconName=l(e),this._dropdownPart.opacity=t?1:f,this.opacity=this._sensitive?1:f}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:v,object:this,value:this.get_direction()})}get 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 MENU_TAPPED,v as NOTIFY_DIRECTION};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";function adoptIntoBin(e,t){return e.stretchLastChild=!0,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,e.addChild(t),t}export{adoptIntoBin};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";const e={AdwAboutDialog:`dialog`,AdwActionRow:`row`,AdwAlertDialog:`dialog`,AdwApplicationWindow:`window`,AdwAvatar:`widget`,AdwBanner:`banner`,AdwBin:`widget`,AdwBottomSheet:`bottom-sheet`,AdwButtonContent:`buttoncontent`,AdwButtonRow:`row`,AdwCarouselIndicatorDots:`carouselindicatordots`,AdwCarouselIndicatorLines:`carouselindicatorlines`,AdwCarousel:`carousel`,AdwClamp:`clamp`,AdwComboRow:`row`,AdwDialog:`dialog`,AdwEntryRow:`row`,AdwExpanderRow:`row`,AdwHeaderBar:`headerbar`,AdwInlineViewSwitcher:`inline-view-switcher`,AdwNavigationPage:`navigation-view-page`,AdwNavigationSplitView:`navigation-split-view`,AdwNavigationView:`navigation-view`,AdwOverlaySplitView:`overlay-split-view`,AdwPasswordEntryRow:`row`,AdwPreferencesGroup:`preferencesgroup`,AdwPreferencesPage:`preferencespage`,AdwShortcutLabel:`shortcut-label`,AdwSidebar:`sidebar`,AdwSpinner:`image`,AdwSpinRow:`row`,AdwSplitButton:`splitbutton`,AdwStatusPage:`statuspage`,AdwSwitchRow:`row`,AdwTabView:`tabview`,AdwToastOverlay:`toastoverlay`,AdwToggleGroup:`toggle-group`,AdwToolbarView:`toolbarview`,AdwViewStack:`stack`,AdwViewSwitcherBar:`viewswitcherbar`,AdwViewSwitcher:`viewswitcher`,AdwWindowTitle:`windowtitle`,AdwWindow:`window`,AdwWrapBox:`wrap-box`,GtkActionBar:`actionbar`,GtkBox:`box`,GtkButton:`button`,GtkCheckButton:`checkbutton`,GtkDrawingArea:`widget`,GtkDropDown:`dropdown`,GtkEntry:`entry`,GtkFrame:`frame`,GtkGrid:`grid`,GtkImage:`image`,GtkLabel:`label`,GtkListBox:`list`,GtkMenuButton:`menubutton`,GtkOverlay:`overlay`,GtkPopoverMenu:`popover`,GtkRevealer:`revealer`,GtkScrolledWindow:`scrolledwindow`,GtkSeparator:`separator`,GtkStack:`stack`,GtkTextView:`textview`,GtkToggleButton:`button`,GtkWindow:`window`};function nsTypeSelector(e){return e.replace(`-`,``).toLowerCase()}function cssTypeOf(t){for(let n=t;typeof n==`function`&&n!==Function.prototype;n=Object.getPrototypeOf(n)){let t=n;if(!Object.hasOwn(t,`GTypeName`)||typeof t.GTypeName!=`string`)continue;let r=e[t.GTypeName];if(r!==void 0)return nsTypeSelector(r)}}export{e as GTK_CSS_NAMES,cssTypeOf,nsTypeSelector};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{buttonSlotAfterWrite as f,buttonSlotDetaches as p}from"./button-slot.js";import{labelDisplayText as m}from"@gjsify/adwaita-core";import{GridLayout as h,ItemSpec as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(h,{GTypeName:`GtkButton`,Signals:{clicked:{}}}){static GTypeName=`GtkButton`;static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_tooltipText=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),this.addRow(new g(1,`star`)),this.addColumn(new g(1,`star`)),d(this),this.addEventListener(`tap`,()=>{this.emit(v),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this._tooltipText}set tooltipText(e){let t=e??``;(this.accessibilityHint??``)===this._tooltipText&&(this.accessibilityHint=t),this._tooltipText=t,i(this,t)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=f(e,t);p(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=m(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,h.setColumn(e,0),h.setRow(e,0),this.addChild(e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{adoptIntoBin as f}from"./bin-layout.js";import{buttonSlotAfterWrite as p,buttonSlotDetaches as m}from"./button-slot.js";import{labelDisplayText as h}from"@gjsify/adwaita-core";import{DockLayout as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(g,{GTypeName:`GtkButton`,Signals:{clicked:{}}}){static GTypeName=`GtkButton`;static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_tooltipText=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),d(this),this.addEventListener(`tap`,()=>{this.emit(v),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this._tooltipText}set tooltipText(e){let t=e??``;(this.accessibilityHint??``)===this._tooltipText&&(this.accessibilityHint=t),this._tooltipText=t,i(this,t)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=p(e,t);m(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=h(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return f(this,e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{classNameWith as n,normalizeStyleClasses as r,withCssClass as i,withoutCssClass as a}from"./style-classes.js";import{AdwImageButton as o}from"./adw-image-button.js";import{MenuSlot as s}from"./menu-slot.js";import{showMenuPopup as c}from"./popup-menu-view.js";const l=`menuItemActivated`;var GtkMenuButton=class extends o{static GTypeName=`GtkMenuButton`;_slot=new s(`GtkMenuButton`,()=>void 0);_actions=null;_menuTitle=``;_primary=!1;_baseClassName;_styleClasses=[];constructor(e){super(),this._baseClassName=`${this.className} adw-menu-button`.trim(),this.className=this._baseClassName,this.addEventListener(`tap`,()=>this._openMenu()),t(this,e)}get menuModel(){return this._slot.model}set menuModel(e){let t=this._slot.model;this._slot.write(e),this.notifyPropertyChange(`menuModel`,this._slot.model,t)}get menu_model(){return this.menuModel}set menu_model(e){this.menuModel=e}get_menu_model(){return this.menuModel}set_menu_model(e){this.menuModel=e}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(r(e))}get primary(){return this._primary}set primary(t){this._primary=e(t,this._primary)}add_css_class(e){this._setClasses(i(this._styleClasses,e))}remove_css_class(e){this._setClasses(a(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(r([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=n(this._baseClassName,e)}_openMenu(){this._slot.isEmpty||c(this,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n={eventName:l,object:this,id:e.id??e.label,label:e.label,path:t,action:e.action};this.notify(n)}})}};export{GtkMenuButton,l as MENU_ITEM_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withProperties as n}from"./signals.js";import{classNameWith as r,normalizeStyleClasses as i,withCssClass as a,withoutCssClass as o}from"./style-classes.js";import{AdwImageButton as s}from"./adw-image-button.js";import{MenuSlot as c}from"./menu-slot.js";import{showMenuPopup as l}from"./popup-menu-view.js";import{GioMenuModel as u}from"@gjsify/adwaita-core";const d=`menuItemActivated`;var GtkMenuButton=class extends n(s,{GTypeName:`GtkMenuButton`,Properties:{"menu-model":{kind:`object`,valueType:u.$gtype,blurb:`The model from which the popup is created`,normalize:(e,t)=>t._slot.read(e),changed:()=>!0,afterNotify:e=>{let t=e;t._slot.adopt(t.menuModel)}}}}){static GTypeName=`GtkMenuButton`;_slot=new c(`GtkMenuButton`,()=>void 0);_actions=null;_menuTitle=``;_primary=!1;_baseClassName;_styleClasses=[];constructor(e){super(),this._baseClassName=`${this.className} adw-menu-button`.trim(),this.className=this._baseClassName,this.addEventListener(`tap`,()=>this._openMenu()),t(this,e)}get_menu_model(){return this.menuModel}set_menu_model(e){this.menuModel=e}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(i(e))}get primary(){return this._primary}set primary(t){this._primary=e(t,this._primary)}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._baseClassName,e)}_openMenu(){this._slot.isEmpty||l(this,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n={eventName:d,object:this,id:e.id??e.label,label:e.label,path:t,action:e.action};this.notify(n)}})}};export{GtkMenuButton,d as MENU_ITEM_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{AdwSingleChildBase as r}from"./single-child-base.js";import{DEFAULT_SCROLLBAR_POLICY as i,GTK_POLICY_TYPES as a,normalizePolicy as o,scrollOrientationFor as s}from"./scrolled-window-policy.js";import{GtkAdjustment as c}from"@gjsify/adwaita-core";import{ContentView as l,GridLayout as u,ScrollView as d}from"@nativescript/core";var GtkScrolledWindow=class extends r{static GTypeName=`GtkScrolledWindow`;static builderSlots=e([`child`],`child`);_scroll=new d;_viewport=new l;_hscrollbarPolicy=i;_vscrollbarPolicy=i;_hasFrame=!1;_hadjustment=null;_vadjustment=null;_listening=!1;_syncing=!1;constructor(e){super(),u.setColumn(this._scroll,0),u.setRow(this._scroll,0),this._scroll.content=this._viewport,this.addChild(this._scroll),this._applyOrientation(),n(this,e)}get hscrollbarPolicy(){return this._hscrollbarPolicy}set hscrollbarPolicy(e){this._hscrollbarPolicy=o(e,`hscrollbar-policy`),this._applyOrientation()}get vscrollbarPolicy(){return this._vscrollbarPolicy}set vscrollbarPolicy(e){this._vscrollbarPolicy=o(e,`vscrollbar-policy`),this._applyOrientation()}get_policy(){return[a.indexOf(this._hscrollbarPolicy),a.indexOf(this._vscrollbarPolicy)]}set_policy(e,t){for(let[n,r]of[[e,`hscrollbar_policy`],[t,`vscrollbar_policy`]])if(!Number.isInteger(n)||a[n]===void 0)throw TypeError(`${n} is not a valid value for enum argument ${r}`);this.hscrollbarPolicy=a[e],this.vscrollbarPolicy=a[t]}get hadjustment(){return this._hadjustment??=this._track(`horizontal`,new c)}get vadjustment(){return this._vadjustment??=this._track(`vertical`,new c)}get_hadjustment(){return this.hadjustment}get_vadjustment(){return this.vadjustment}set_hadjustment(e){this._hadjustment=this._track(`horizontal`,e)}set_vadjustment(e){this._vadjustment=this._track(`vertical`,e)}_track(e,t){return this._listening||(this._listening=!0,this._scroll.addEventListener(`scroll`,this._syncAdjustments),this._scroll.addEventListener(`layoutChanged`,this._syncAdjustments),this._viewport.addEventListener(`layoutChanged`,this._syncAdjustments)),t.connect(`value-changed`,()=>{let n=e===`horizontal`?this._hadjustment:this._vadjustment;this._syncing||n!==t||(e===`horizontal`?this._scroll.scrollToHorizontalOffset(t.value,!1):this._scroll.scrollToVerticalOffset(t.value,!1))}),this._syncAxis(e,t),t}_syncAdjustments=()=>{this._hadjustment&&this._syncAxis(`horizontal`,this._hadjustment),this._vadjustment&&this._syncAxis(`vertical`,this._vadjustment)};_syncAxis(e,t){let n=e===`vertical`,r=this._scroll.getActualSize(),i=this._viewport.getActualSize(),a=n?r.height:r.width,o=Math.max(n?i.height:i.width,a),s=n?this._scroll.verticalOffset:this._scroll.horizontalOffset;this._syncing=!0;try{t.configure(s,0,o,a*.1,a*.9,a)}finally{this._syncing=!1}}get hasFrame(){return this._hasFrame}set hasFrame(e){this._hasFrame=t(e,this._hasFrame)}_adopt(e){this._viewport.content=e}_release(e){this._viewport.content===e&&(this._viewport.content=null)}_applyOrientation(){let e=s(this._hscrollbarPolicy,this._vscrollbarPolicy);this._scroll.orientation=e}};export{GtkScrolledWindow};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{AdwSingleChildBase as r}from"./single-child-base.js";import{DEFAULT_SCROLLBAR_POLICY as i,GTK_POLICY_TYPES as a,normalizePolicy as o,scrollOrientationFor as s,scrollsBothAxes as c}from"./scrolled-window-policy.js";import{GtkAdjustment as l}from"@gjsify/adwaita-core";import{ContentView as u,GridLayout as d,ScrollView as f}from"@nativescript/core";var GtkScrolledWindow=class extends r{static GTypeName=`GtkScrolledWindow`;static builderSlots=e([`child`],`child`);_scroll=new f;_viewport=new u;_hscroll=new f;_hbox=new u;_nested=!1;_hscrollbarPolicy=i;_vscrollbarPolicy=i;_hasFrame=!1;_hadjustment=null;_vadjustment=null;_listening=!1;_syncing=!1;constructor(e){super(),d.setColumn(this._scroll,0),d.setRow(this._scroll,0),this._scroll.content=this._viewport,this._hscroll.orientation=`horizontal`,this._hscroll.content=this._hbox,this.addChild(this._scroll),this._applyOrientation(),n(this,e)}get hscrollbarPolicy(){return this._hscrollbarPolicy}set hscrollbarPolicy(e){this._hscrollbarPolicy=o(e,`hscrollbar-policy`),this._applyOrientation()}get vscrollbarPolicy(){return this._vscrollbarPolicy}set vscrollbarPolicy(e){this._vscrollbarPolicy=o(e,`vscrollbar-policy`),this._applyOrientation()}get_policy(){return[a.indexOf(this._hscrollbarPolicy),a.indexOf(this._vscrollbarPolicy)]}set_policy(e,t){for(let[n,r]of[[e,`hscrollbar_policy`],[t,`vscrollbar_policy`]])if(!Number.isInteger(n)||a[n]===void 0)throw TypeError(`${n} is not a valid value for enum argument ${r}`);this.hscrollbarPolicy=a[e],this.vscrollbarPolicy=a[t]}get hadjustment(){return this._hadjustment??=this._track(`horizontal`,new l)}get vadjustment(){return this._vadjustment??=this._track(`vertical`,new l)}get_hadjustment(){return this.hadjustment}get_vadjustment(){return this.vadjustment}set_hadjustment(e){this._hadjustment=this._track(`horizontal`,e)}set_vadjustment(e){this._vadjustment=this._track(`vertical`,e)}_track(e,t){return this._listening||(this._listening=!0,this._scroll.addEventListener(`scroll`,this._syncAdjustments),this._hscroll.addEventListener(`scroll`,this._syncAdjustments),this._scroll.addEventListener(`layoutChanged`,this._syncAdjustments),this._viewport.addEventListener(`layoutChanged`,this._syncAdjustments)),t.connect(`value-changed`,()=>{let n=e===`horizontal`?this._hadjustment:this._vadjustment;this._syncing||n!==t||(e===`horizontal`?this._horizontalScroller.scrollToHorizontalOffset(t.value,!1):this._scroll.scrollToVerticalOffset(t.value,!1))}),this._syncAxis(e,t),t}_syncAdjustments=()=>{this._hadjustment&&this._syncAxis(`horizontal`,this._hadjustment),this._vadjustment&&this._syncAxis(`vertical`,this._vadjustment)};_syncAxis(e,t){let n=e===`vertical`,r=this._horizontalScroller,i=(n?this._scroll:r).getActualSize(),a=(n||!this._nested?this._viewport:this._hbox).getActualSize(),o=n?i.height:i.width,s=Math.max(n?a.height:a.width,o),c=n?this._scroll.verticalOffset:r.horizontalOffset;this._syncing=!0;try{t.configure(c,0,s,o*.1,o*.9,o)}finally{this._syncing=!1}}get hasFrame(){return this._hasFrame}set hasFrame(e){this._hasFrame=t(e,this._hasFrame)}get _horizontalScroller(){return this._nested?this._hscroll:this._scroll}get _holder(){return this._nested?this._hbox:this._viewport}_adopt(e){this._holder.content=e}_release(e){this._holder.content===e&&(this._holder.content=null)}_applyOrientation(){this._scroll.orientation=s(this._hscrollbarPolicy,this._vscrollbarPolicy);let e=c(this._hscrollbarPolicy,this._vscrollbarPolicy);if(e===this._nested&&this._viewport.content!==null)return;let t=this.child;this._holder.content=null,this._nested=e,this._viewport.content=e?this._hscroll:null,this._holder.content=t}};export{GtkScrolledWindow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{assertPopupMenuAssignable as e,refuseMenuString as t}from"./popup-menu.js";import{GjsifyMenu as n,menuTree as r,readMenuModelWrite as i,watchMenuModel as a}from"@gjsify/adwaita-core";var MenuSlot=class{widget;onItemsChanged;_authored=new n;_model=null;_tree=[];_unwatch=null;constructor(e,t){this.widget=e,this.onItemsChanged=t}get model(){return this._model}get tree(){return this._tree}get isEmpty(){return this._tree.length===0}write(n){t(n,this.widget);let a=i(n,this._authored);a!==null&&e(r(a)),this._adopt(a)}_adopt(e){this._unwatch?.(),this._unwatch=null,this._model=e,this._tree=e===null?[]:r(e),e!==null&&(this._unwatch=a(e,()=>{this._adopt(this._model),this.onItemsChanged()}))}};export{MenuSlot};
1
+ import"../_virtual/_rolldown/runtime.js";import{assertPopupMenuAssignable as e,refuseMenuString as t}from"./popup-menu.js";import{GjsifyMenu as n,menuTree as r,readMenuModelWrite as i,watchMenuModel as a}from"@gjsify/adwaita-core";var MenuSlot=class{widget;onItemsChanged;_authored=new n;_model=null;_tree=[];_unwatch=null;constructor(e,t){this.widget=e,this.onItemsChanged=t}get model(){return this._model}get tree(){return this._tree}get isEmpty(){return this._tree.length===0}read(n){t(n,this.widget);let a=i(n,this._authored);return a!==null&&e(r(a)),a}write(e){this.adopt(this.read(e))}adopt(e){this._unwatch?.(),this._unwatch=null,this._model=e,this._tree=e===null?[]:r(e),e!==null&&(this._unwatch=a(e,()=>{this.adopt(this._model),this.onItemsChanged()}))}};export{MenuSlot};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{gtkBuilderInteger as e}from"./xml-values.js";const t=[`always`,`automatic`,`never`,`external`],n=`automatic`;function normalizePolicy(n,r){let i=e(n);if(i!==void 0&&t[i]!==void 0)return t[i];if(typeof n==`string`){let e=n.trim(),r=t.find(t=>t===e);if(r!==void 0)return r}throw TypeError(`'${String(n)}' is not a Gtk.PolicyType, so it cannot be '${r}'. The members are ${t.join(`, `)}.`)}function policyScrolls(e){return e!==`never`}function scrollOrientationFor(e,t){return policyScrolls(e)&&!policyScrolls(t)?`horizontal`:`vertical`}export{n as DEFAULT_SCROLLBAR_POLICY,t as GTK_POLICY_TYPES,normalizePolicy,policyScrolls,scrollOrientationFor};
1
+ import"../_virtual/_rolldown/runtime.js";import{gtkBuilderInteger as e}from"./xml-values.js";const t=[`always`,`automatic`,`never`,`external`],n=`automatic`;function normalizePolicy(n,r){let i=e(n);if(i!==void 0&&t[i]!==void 0)return t[i];if(typeof n==`string`){let e=n.trim(),r=t.find(t=>t===e);if(r!==void 0)return r}throw TypeError(`'${String(n)}' is not a Gtk.PolicyType, so it cannot be '${r}'. The members are ${t.join(`, `)}.`)}function policyScrolls(e){return e!==`never`}function scrollOrientationFor(e,t){return policyScrolls(e)&&!policyScrolls(t)?`horizontal`:`vertical`}function scrollsBothAxes(e,t){return policyScrolls(e)&&policyScrolls(t)}export{n as DEFAULT_SCROLLBAR_POLICY,t as GTK_POLICY_TYPES,normalizePolicy,policyScrolls,scrollOrientationFor,scrollsBothAxes};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{ENGINE_TARGET as e}from"../engine-target.js";import{camelProperty as t,readGtkProperty as n,writeGtkProperty as r}from"./shadowed-properties.js";import{WIDGET_SIGNALS as i,watchMapping as a}from"./widget-mapping.js";import{withGtkWidgetLayout as o}from"./widget-layout.js";import{engineForTarget as s}from"@gjsify/adwaita-core";function coerceDeclared(e,t,n,r){return t.normalize===void 0?readDeclaredValue(e,t.kind,n):t.normalize(n,r)}function isDeclaredChange(e,t,n,r,i){return e.changed===void 0?n!==t:e.changed(t,n,r,i)}function readDeclaredValue(e,t,n){if(typeof n!=`string`||t===`string`)return n;let r=n.trim();if(t===`object`)throw TypeError(`Property '${e}' holds an object; '${n}' is a string.`);if(t===`boolean`){let t=r.toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1;throw TypeError(`Property '${e}' is a boolean; '${n}' is neither 'true' nor 'false'.`)}let i=r===``?NaN:Number(r);if(!Number.isFinite(i))throw TypeError(`Property '${e}' is a number; '${n}' is not one.`);return i}const c=new WeakMap;let l=1;const u=1073741824,d=new WeakMap,f=new WeakMap;function unknownHandler(e,t){return TypeError(`${e.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.`)}const p=new WeakMap;function pureConnect(e,t,n){let r=l++,o=c.get(e);o===void 0&&(o=new Map,c.set(e,o));let s=i.includes(t)?a(e):void 0;return o.set(r,{eventName:t,listener:n,unwatch:s}),e.addEventListener(t,n),r}function pureDisconnect(e,t){let n=c.get(e)?.get(t);if(n===void 0)throw unknownHandler(e,t);e.removeEventListener(n.eventName,n.listener),n.unwatch?.(),c.get(e)?.delete(t)}function declaredConnect(e,t,n,r){let i=l++,a=p.get(e);return a===void 0&&p.set(e,a=new Map),a.set(i,{key:t,eventName:n,callback:r}),i}function declaredDisconnect(e,t){return p.get(e)?.delete(t)===!0}function emitDeclared(e,t,n){let r=p.get(e);if(r===void 0)return;let i=t.startsWith(`notify::`),a=[...r];for(let[o,s]of a){if(s.key!==t||r.get(o)!==s)continue;let a=i?{eventName:s.eventName,object:e}:{eventName:s.eventName,object:e,args:n};try{s.callback(e,a)}catch(t){console.error(`[${e.constructor.name}] unhandled exception in a '${s.eventName}' handler:`,t)}}}function refuseDeclaredEvent(e,t,n){let r=giKeyOf(resolvedFor(e.constructor),t);if(r===null)return;let i=r.startsWith(`notify::`),a=i?`a declared property's notification`:`a declared signal`,o=n===`notify`?i?`write the property, or emit it with notify('${r.slice(8)}')`:`emit it with emit('${r}', …)`:`subscribe with connect('${t}', (self, data) => …), whose id disconnect() takes`;throw TypeError(`${e.constructor.name}.${n}('${t}'): '${r}' is ${a} and GObject owns it — ${o}. On Android the emission belongs to the GObject and no NativeScript listener can see it, so ${n} would work off-device and be silent on it.`)}function spellingsOf(e){return[...new Set([e,e.replace(/-/g,`_`),t(e)])]}function emittedSignalsOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n))t.unshift(n);let n=new Set;for(let e of t)if(Object.hasOwn(e,`emittedSignals`))for(let t of e.emittedSignals)n.add(t);return[...n]}const m=new WeakMap,h=new WeakSet,g=new WeakSet,_=new WeakMap;function declarationsOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=m.get(n);e!==void 0&&t.unshift(e)}return t}function resolvedFor(e){let t=_.get(e);if(t!==void 0)return t;let n=new Map,r=new Set,i=new Set,a={canonicalOf:n,seamOwned:r,declaredSignals:i,routeD:!1,giConnect:void 0,giDisconnect:void 0,giEmit:void 0},o=a;for(let t of declarationsOf(e)){for(let[e,r]of t.canonicalOf)n.set(e,r);for(let e of t.seamOwned)r.add(e);for(let e of t.declaredSignals)i.add(e);t.routeD&&(o.routeD=!0),t.giConnect!==void 0&&(o.giConnect=t.giConnect),t.giDisconnect!==void 0&&(o.giDisconnect=t.giDisconnect),t.giEmit!==void 0&&(o.giEmit=t.giEmit)}return _.set(e,a),a}function giKeyOf(e,t){if(e.declaredSignals.has(t))return t;if(!t.startsWith(`notify::`))return null;let n=e.canonicalOf.get(t.slice(8));return n===void 0?null:`notify::${n}`}function declare(e,t,n){let r=new Map,i=new Set;for(let[e,n]of Object.entries(t?.Properties??{})){for(let t of spellingsOf(e))r.set(t,e);isSeamOwned(n)&&i.add(e)}let a={meta:t,klass:e,prototype:e.prototype,canonicalOf:r,seamOwned:i,declaredSignals:new Set(Object.keys(t?.Signals??{})),routers:n,realized:!1,routeD:!1};return m.set(e,a),a}function declaredEmissionsOf(e){return[...Object.keys(e?.Signals??{}),...Object.keys(e?.Properties??{}).map(e=>`notify::${e}`)]}function realizeChain(e){if(!h.has(e)){h.add(e);for(let t of declarationsOf(e))realize(t)}}function realize(t){if(t.realized||(t.realized=!0,t.meta===void 0))return;let n=s(e);if(n?.supportsForeignParentClasses===!0){registerRouteD(t,n.registerForeignClass.bind(n));return}installPureJsProperties(t)}function registerRouteD(e,t){let{meta:n,prototype:r,routers:i}=e;if(i!==void 0&&(delete r.connect,delete r.disconnect,delete r.emit,delete r.notify),t(e.klass,n),wrapRouteDAccessors(e),i!==void 0){if(e.giConnect=r.connect,e.giDisconnect=r.disconnect,e.giEmit=r.emit,e.giConnect===void 0||e.giDisconnect===void 0||e.giEmit===void 0)throw Error(`Registering '${n.GTypeName}' over its NativeScript base installed no connect/disconnect/emit, so the widget would answer neither GObject nor this port. ADR 0105 refuses a silent fallback here: the subset is reachable only by calling usePureJsGObjectEngine() from '@gjsify/adwaita-core' before the port loads.`);for(let[e,t]of Object.entries(i))Object.defineProperty(r,e,{configurable:!0,writable:!0,enumerable:!1,value:t});refuseDeclaredNotifyPayload(r,r.notify)}e.routeD=!0}function refuseDeclaredNotifyPayload(e,t){let n=function notify(e,...n){if(typeof e==`object`&&e){let{eventName:t}=e;typeof t==`string`&&refuseDeclaredEvent(this,t,`notify`)}return t.call(this,e,...n)};g.add(n),Object.defineProperty(e,"notify",{configurable:!0,writable:!0,enumerable:!1,value:n})}function isSeamOwned(e){return e.kind===`object`||e.explicitNotify===!0}function seamOwnedDescriptor(e,t,n){let r=defaultValueOf(t);return{configurable:!0,enumerable:!1,get(){let t=valuesOf(this);return t.has(e)||t.set(e,r),t.get(e)},set(i){let a=coerceDeclared(e,t,i,this),o=valuesOf(this);isDeclaredChange(t,a,o.has(e)?o.get(e):r,i,this)&&(o.set(e,a),t.explicitNotify!==!0&&n(this,e),t.afterNotify?.(this))}}}function notifyThrough(e,t){e.notify(t)}function wrapRouteDAccessors(e){let{meta:t,prototype:n}=e;for(let[e,r]of Object.entries(t.Properties??{})){let i=r.changed!==void 0||r.afterNotify!==void 0,a=isSeamOwned(r);if(!(!a&&!i&&r.kind===`string`&&r.normalize===void 0))for(let o of spellingsOf(e)){let s=Object.getOwnPropertyDescriptor(n,o);if(s?.set===void 0||s.get===void 0)throw Error(`Registering '${t.GTypeName}' installed no accessor for '${o}', so a string from XML would reach the GObject uncoerced. The host chain probably owns that name (see the class's \$foreignSkipped); rename the property.`);if(a){Object.defineProperty(n,o,seamOwnedDescriptor(e,r,notifyThrough));continue}let{get:c,set:l}=s;Object.defineProperty(n,o,{...s,set(t){let n=coerceDeclared(e,r,t,this);if(!i){l.call(this,n);return}let a=c.call(this);l.call(this,n);let o=c.call(this)!==a,s=r.changed===void 0?o:r.changed(n,a,t,this);s&&!o&&notifyThrough(this,e),s&&r.afterNotify?.(this)}})}}}function installPureJsProperties(e){let{meta:t,prototype:n}=e;for(let[e,r]of Object.entries(t.Properties??{})){let t=seamOwnedDescriptor(e,r,emitPureNotify);for(let r of spellingsOf(e))r in n||Object.defineProperty(n,r,t)}installPureNotify(e)}function emitPureNotify(e,t){emitDeclared(e,`notify::${t}`,[])}function installPureNotify(e){let{prototype:t}=e,n=t.notify;if(g.has(n))return;let r=function notify(e,...t){if(typeof e!=`string`){if(typeof e==`object`&&e){let{eventName:t}=e;typeof t==`string`&&refuseDeclaredEvent(this,t,`notify`)}return n.call(this,e,...t)}let{canonicalOf:r}=resolvedFor(this.constructor),i=r.get(e);if(i===void 0)throw TypeError(`${this.constructor.name} has no property '${e}' to notify. The declared ones are ${[...r.keys()].join(`, `)||`(none)`}; a NativeScript event is notified with its payload object, not with a name.`);emitDeclared(this,`notify::${i}`,[])};g.add(r),Object.defineProperty(t,"notify",{configurable:!0,writable:!0,enumerable:!1,value:r})}function withSignals(e,a){class WithSignals extends o(e){static emittedSignals=[...i,...declaredEmissionsOf(a)];constructor(...e){super(...e),realizeChain(new.target)}addEventListener(e,t,n,r){refuseDeclaredEvent(this,e,`addEventListener`),super.addEventListener(e,t,n,r)}removeEventListener(e,t,n){refuseDeclaredEvent(this,e,`removeEventListener`),super.removeEventListener(e,t,n)}connect(e,t){let n=resolvedFor(this.constructor),r=giKeyOf(n,e);if(n.routeD&&r!==null){let i=r.startsWith(`notify::`),a=n.giConnect.call(this,r,(n,...r)=>{let a=n;return t(n,i?{eventName:e,object:a}:{eventName:e,object:a,args:r})}),o=d.get(this);return o===void 0&&d.set(this,o=new Set),o.add(a),u+a}if(r!==null)return declaredConnect(this,r,e,t);let listener=e=>{let n=e.accumulator;if(n===void 0){t(this,e);return}n.stopped||n.collect(t(this,e))};return pureConnect(this,e,listener)}disconnect(e){if(e>=u){let t=e-u;if(d.get(this)?.delete(t)!==!0)throw unknownHandler(this,e);resolvedFor(this.constructor).giDisconnect.call(this,t);return}declaredDisconnect(this,e)||pureDisconnect(this,e)}emit(e,...t){let n=resolvedFor(this.constructor),r=giKeyOf(n,e);if(r!==null){n.routeD?n.giEmit.call(this,r,...t):emitDeclared(this,r,t);return}throw Error(`No signal '${e}' on object '${this.constructor.name}'. emit() is GObject's and takes a declared signal or a declared property's notify::<prop>; to dispatch a NativeScript event use notify({ eventName: '${e}', object: this }).`)}get_property(e){return n(this,t(e))}set_property(e,n){r(this,t(e),n)}}return declare(WithSignals,a,{connect:WithSignals.prototype.connect,disconnect:WithSignals.prototype.disconnect,emit:WithSignals.prototype.emit}),WithSignals}function withProperties(e,t){class WithProperties extends e{static emittedSignals=declaredEmissionsOf(t)}return declare(WithProperties,t,void 0),WithProperties}function pushDeclared(e,t,n){let{canonicalOf:r,seamOwned:i}=resolvedFor(e.constructor),a=r.get(t);if(a===void 0||!i.has(a))throw TypeError(`${e.constructor.name} cannot push '${t}': only a property the seam owns on both legs can be moved without notifying — declare it as object-kind or with explicitNotify. The pushable ones are ${[...i].join(`, `)||`(none)`}.`);valuesOf(e).set(a,n)}function valuesOf(e){let t=f.get(e);return t===void 0&&f.set(e,t=new Map),t}function defaultValueOf(e){return e.kind===`object`?null:e.default===void 0?e.kind===`string`?``:e.kind===`boolean`?!1:0:e.default}export{emittedSignalsOf,pushDeclared,readDeclaredValue,withProperties,withSignals};
1
+ import"../_virtual/_rolldown/runtime.js";import{ENGINE_TARGET as e}from"../engine-target.js";import{camelProperty as t,readGtkProperty as n,writeGtkProperty as r}from"./shadowed-properties.js";import{WIDGET_SIGNALS as i,watchMapping as a}from"./widget-mapping.js";import{withGtkWidgetLayout as o}from"./widget-layout.js";import{engineForTarget as s}from"@gjsify/adwaita-core";function coerceDeclared(e,t,n,r){return t.normalize===void 0?readDeclaredValue(e,t.kind,n):t.normalize(n,r)}function isDeclaredChange(e,t,n,r,i){return e.changed===void 0?n!==t:e.changed(t,n,r,i)}function readDeclaredValue(e,t,n){if(typeof n!=`string`||t===`string`)return n;let r=n.trim();if(t===`object`)throw TypeError(`Property '${e}' holds an object; '${n}' is a string.`);if(t===`boolean`){let t=r.toLowerCase();if(t===`true`)return!0;if(t===`false`)return!1;throw TypeError(`Property '${e}' is a boolean; '${n}' is neither 'true' nor 'false'.`)}let i=r===``?NaN:Number(r);if(!Number.isFinite(i))throw TypeError(`Property '${e}' is a number; '${n}' is not one.`);return i}const c=new WeakMap;let l=1;const u=1073741824,d=new WeakMap,f=new WeakMap;function unknownHandler(e,t){return TypeError(`${e.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.`)}const p=new WeakMap;function pureConnect(e,t,n){let r=l++,o=c.get(e);o===void 0&&(o=new Map,c.set(e,o));let s=i.includes(t)?a(e):void 0;return o.set(r,{eventName:t,listener:n,unwatch:s}),e.addEventListener(t,n),r}function pureDisconnect(e,t){let n=c.get(e)?.get(t);if(n===void 0)throw unknownHandler(e,t);e.removeEventListener(n.eventName,n.listener),n.unwatch?.(),c.get(e)?.delete(t)}function declaredConnect(e,t,n,r){let i=l++,a=p.get(e);return a===void 0&&p.set(e,a=new Map),a.set(i,{key:t,eventName:n,callback:r}),i}function declaredDisconnect(e,t){return p.get(e)?.delete(t)===!0}function emitDeclared(e,t,n){let r=p.get(e);if(r===void 0)return;let i=t.startsWith(`notify::`),a=[...r];for(let[o,s]of a){if(s.key!==t||r.get(o)!==s)continue;let a=i?{eventName:s.eventName,object:e}:{eventName:s.eventName,object:e,args:n};try{s.callback(e,a)}catch(t){console.error(`[${e.constructor.name}] unhandled exception in a '${s.eventName}' handler:`,t)}}}function refuseDeclaredEvent(e,t,n){let r=giKeyOf(resolvedFor(e.constructor),t);if(r===null)return;let i=r.startsWith(`notify::`),a=i?`a declared property's notification`:`a declared signal`,o=n===`notify`?i?`write the property, or emit it with notify('${r.slice(8)}')`:`emit it with emit('${r}', …)`:`subscribe with connect('${t}', (self, data) => …), whose id disconnect() takes`;throw TypeError(`${e.constructor.name}.${n}('${t}'): '${r}' is ${a} and GObject owns it — ${o}. On Android the emission belongs to the GObject and no NativeScript listener can see it, so ${n} would work off-device and be silent on it.`)}function spellingsOf(e){return[...new Set([e,e.replace(/-/g,`_`),t(e)])]}function emittedSignalsOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n))t.unshift(n);let n=new Set;for(let e of t)if(Object.hasOwn(e,`emittedSignals`))for(let t of e.emittedSignals)n.add(t);return[...n]}const m=[`connect`,`disconnect`,`emit`],h=new WeakMap,g=new WeakSet,_=new WeakSet,v=new WeakMap;function declarationsOf(e){let t=[];for(let n=e;typeof n==`function`;n=Object.getPrototypeOf(n)){let e=h.get(n);e!==void 0&&t.unshift(e)}return t}function resolvedFor(e){let t=v.get(e);if(t!==void 0)return t;let n=new Map,r=new Set,i=new Set,a={canonicalOf:n,seamOwned:r,declaredSignals:i,routeD:!1,giConnect:void 0,giDisconnect:void 0,giEmit:void 0},o=a;for(let t of declarationsOf(e)){for(let[e,r]of t.canonicalOf)n.set(e,r);for(let e of t.seamOwned)r.add(e);for(let e of t.declaredSignals)i.add(e);t.routeD&&(o.routeD=!0),t.giConnect!==void 0&&(o.giConnect=t.giConnect),t.giDisconnect!==void 0&&(o.giDisconnect=t.giDisconnect),t.giEmit!==void 0&&(o.giEmit=t.giEmit)}return v.set(e,a),a}function giKeyOf(e,t){if(e.declaredSignals.has(t))return t;if(!t.startsWith(`notify::`))return null;let n=e.canonicalOf.get(t.slice(8));return n===void 0?null:`notify::${n}`}function declare(e,t,n){let r=new Map,i=new Set;for(let[e,n]of Object.entries(t?.Properties??{})){for(let t of spellingsOf(e))r.set(t,e);isSeamOwned(n)&&i.add(e)}let a={meta:t,klass:e,prototype:e.prototype,canonicalOf:r,seamOwned:i,declaredSignals:new Set(Object.keys(t?.Signals??{})),routers:n,realized:!1,routeD:!1};return h.set(e,a),a}function declaredEmissionsOf(e){return[...Object.keys(e?.Signals??{}),...Object.keys(e?.Properties??{}).map(e=>`notify::${e}`)]}function realizeChain(e){if(!g.has(e)){g.add(e);for(let t of declarationsOf(e))realize(t)}}function realize(t){if(t.realized||(t.realized=!0,t.meta===void 0))return;let n=s(e);if(n?.supportsForeignParentClasses===!0){registerRouteD(t,n.registerForeignClass.bind(n));return}installPureJsProperties(t)}function registerRouteD(e,t){let{meta:n,prototype:r,routers:i}=e,a=i===void 0?borrowChainVerbs(e):void 0;if(i!==void 0&&(delete r.connect,delete r.disconnect,delete r.emit,delete r.notify),t(e.klass,n),wrapRouteDAccessors(e),i!==void 0){captureGiVerbs(e);for(let[e,t]of Object.entries(i))Object.defineProperty(r,e,{configurable:!0,writable:!0,enumerable:!1,value:t});refuseDeclaredNotifyPayload(r,r.notify)}else if(a!==void 0){captureGiVerbs(e);for(let e of m)delete r[e];for(let{owner:e,name:t,descriptor:n}of a)Object.defineProperty(e,t,n);refuseDeclaredNotifyPayload(r,r.notify)}e.routeD=!0}function captureGiVerbs(e){let{meta:t,prototype:n}=e;if(e.giConnect=n.connect,e.giDisconnect=n.disconnect,e.giEmit=n.emit,e.giConnect===void 0||e.giDisconnect===void 0||e.giEmit===void 0)throw Error(`Registering '${t.GTypeName}' over its NativeScript base installed no connect/disconnect/emit, so the widget would answer neither GObject nor this port. ADR 0105 refuses a silent fallback here: the subset is reachable only by calling usePureJsGObjectEngine() from '@gjsify/adwaita-core' before the port loads.`)}function borrowChainVerbs(e){for(let t of declarationsOf(e.klass))if(t!==e&&t.giConnect!==void 0)return;let t=[];for(let n of m){let r=e.prototype;for(;r!==null;){let i=Object.getOwnPropertyDescriptor(r,n);if(i===void 0){r=Object.getPrototypeOf(r);continue}if(i.configurable!==!0)throw Error(`Registering '${e.meta.GTypeName}' needs node-gi to install '${n}' on its own prototype, but the '${n}' it inherits cannot be taken off for the registration. Declare the properties on the class that owns it instead.`);t.push({owner:r,name:n,descriptor:i}),delete r[n];break}}return t}function refuseDeclaredNotifyPayload(e,t){let n=function notify(e,...n){if(typeof e==`object`&&e){let{eventName:t}=e;typeof t==`string`&&refuseDeclaredEvent(this,t,`notify`)}return t.call(this,e,...n)};_.add(n),Object.defineProperty(e,"notify",{configurable:!0,writable:!0,enumerable:!1,value:n})}function isSeamOwned(e){return e.kind===`object`||e.explicitNotify===!0}function seamOwnedDescriptor(e,t,n){let r=defaultValueOf(t);return{configurable:!0,enumerable:!1,get(){let t=valuesOf(this);return t.has(e)||t.set(e,r),t.get(e)},set(i){let a=coerceDeclared(e,t,i,this),o=valuesOf(this);isDeclaredChange(t,a,o.has(e)?o.get(e):r,i,this)&&(o.set(e,a),t.explicitNotify!==!0&&n(this,e),t.afterNotify?.(this))}}}function notifyThrough(e,t){e.notify(t)}function wrapRouteDAccessors(e){let{meta:t,prototype:n}=e;for(let[e,r]of Object.entries(t.Properties??{})){let i=r.changed!==void 0||r.afterNotify!==void 0,a=isSeamOwned(r);if(!(!a&&!i&&r.kind===`string`&&r.normalize===void 0))for(let o of spellingsOf(e)){let s=Object.getOwnPropertyDescriptor(n,o);if(s?.set===void 0||s.get===void 0)throw Error(`Registering '${t.GTypeName}' installed no accessor for '${o}', so a string from XML would reach the GObject uncoerced. The host chain probably owns that name (see the class's \$foreignSkipped); rename the property.`);if(a){Object.defineProperty(n,o,seamOwnedDescriptor(e,r,notifyThrough));continue}let{get:c,set:l}=s;Object.defineProperty(n,o,{...s,set(t){let n=coerceDeclared(e,r,t,this);if(!i){l.call(this,n);return}let a=c.call(this);l.call(this,n);let o=c.call(this)!==a,s=r.changed===void 0?o:r.changed(n,a,t,this);s&&!o&&notifyThrough(this,e),s&&r.afterNotify?.(this)}})}}}function installPureJsProperties(e){let{meta:t,prototype:n}=e;for(let[e,r]of Object.entries(t.Properties??{})){let t=seamOwnedDescriptor(e,r,emitPureNotify);for(let r of spellingsOf(e))r in n||Object.defineProperty(n,r,t)}installPureNotify(e)}function emitPureNotify(e,t){emitDeclared(e,`notify::${t}`,[])}function installPureNotify(e){let{prototype:t}=e,n=t.notify;if(_.has(n))return;let r=function notify(e,...t){if(typeof e!=`string`){if(typeof e==`object`&&e){let{eventName:t}=e;typeof t==`string`&&refuseDeclaredEvent(this,t,`notify`)}return n.call(this,e,...t)}let{canonicalOf:r}=resolvedFor(this.constructor),i=r.get(e);if(i===void 0)throw TypeError(`${this.constructor.name} has no property '${e}' to notify. The declared ones are ${[...r.keys()].join(`, `)||`(none)`}; a NativeScript event is notified with its payload object, not with a name.`);emitDeclared(this,`notify::${i}`,[])};_.add(r),Object.defineProperty(t,"notify",{configurable:!0,writable:!0,enumerable:!1,value:r})}function withSignals(e,a){class WithSignals extends o(e){static emittedSignals=[...i,...declaredEmissionsOf(a)];constructor(...e){super(...e),realizeChain(new.target)}addEventListener(e,t,n,r){refuseDeclaredEvent(this,e,`addEventListener`),super.addEventListener(e,t,n,r)}removeEventListener(e,t,n){refuseDeclaredEvent(this,e,`removeEventListener`),super.removeEventListener(e,t,n)}connect(e,t){let n=resolvedFor(this.constructor),r=giKeyOf(n,e);if(n.routeD&&r!==null){let i=r.startsWith(`notify::`),a=n.giConnect.call(this,r,(n,...r)=>{let a=n;return t(n,i?{eventName:e,object:a}:{eventName:e,object:a,args:r})}),o=d.get(this);return o===void 0&&d.set(this,o=new Set),o.add(a),u+a}if(r!==null)return declaredConnect(this,r,e,t);let listener=e=>{let n=e.accumulator;if(n===void 0){t(this,e);return}n.stopped||n.collect(t(this,e))};return pureConnect(this,e,listener)}disconnect(e){if(e>=u){let t=e-u;if(d.get(this)?.delete(t)!==!0)throw unknownHandler(this,e);resolvedFor(this.constructor).giDisconnect.call(this,t);return}declaredDisconnect(this,e)||pureDisconnect(this,e)}emit(e,...t){let n=resolvedFor(this.constructor),r=giKeyOf(n,e);if(r!==null){n.routeD?n.giEmit.call(this,r,...t):emitDeclared(this,r,t);return}throw Error(`No signal '${e}' on object '${this.constructor.name}'. emit() is GObject's and takes a declared signal or a declared property's notify::<prop>; to dispatch a NativeScript event use notify({ eventName: '${e}', object: this }).`)}get_property(e){return n(this,t(e))}set_property(e,n){r(this,t(e),n)}}return declare(WithSignals,a,{connect:WithSignals.prototype.connect,disconnect:WithSignals.prototype.disconnect,emit:WithSignals.prototype.emit}),WithSignals}function withProperties(e,t){class WithProperties extends e{static emittedSignals=declaredEmissionsOf(t)}return declare(WithProperties,t,void 0),WithProperties}function pushDeclared(e,t,n){let{canonicalOf:r,seamOwned:i}=resolvedFor(e.constructor),a=r.get(t);if(a===void 0||!i.has(a))throw TypeError(`${e.constructor.name} cannot push '${t}': only a property the seam owns on both legs can be moved without notifying — declare it as object-kind or with explicitNotify. The pushable ones are ${[...i].join(`, `)||`(none)`}.`);valuesOf(e).set(a,n)}function valuesOf(e){let t=f.get(e);return t===void 0&&f.set(e,t=new Map),t}function defaultValueOf(e){return e.kind===`object`?null:e.default===void 0?e.kind===`string`?``:e.kind===`boolean`?!1:0:e.default}export{emittedSignalsOf,pushDeclared,readDeclaredValue,withProperties,withSignals};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{gtypeNameOfInstance as e}from"./gtype-name.js";import{GTK_ALIGN as t,NS_HORIZONTAL_ALIGNMENT as n,NS_VERTICAL_ALIGNMENT as r}from"./gtk-align.js";import{gtkBuilderInteger as i,xmlBoolean as a}from"./xml-values.js";import{nsAlignment as o}from"./construct-props.js";import{lengthValue as s}from"./ns-length.js";import{insertActionGroup as c}from"./actions.js";import{focusView as l,isViewFocused as u}from"../window-source.js";import{applyNativeTooltip as d}from"./native-tooltip.js";import{isMapped as f}from"./widget-mapping.js";import{Point as p}from"@gjsify/adwaita-core";const m=`notify::hexpand`,h=`notify::vexpand`,g=32767;function laidOut(e,t){let n=viewOf(e);if(n!==null)return n;throw TypeError(`${e.constructor.name} is not laid out by a parent, so it has no '${t}'. The GtkWidget layout properties reach views only; this class extends Observable.`)}function viewOf(e){return`horizontalAlignment`in e?e:null}const _=[0,1,2];function isWidget(e){return typeof e.get_first_child==`function`}function childrenOf(e){let t=[];return e.eachChildView?.(e=>(isWidget(e)?t.push(e):t.push(...childrenOf(e)),!0)),t}function parentOf(e){let t=e.parent??null;for(;t!==null&&!isWidget(t);)t=t.parent??null;return t}function topOf(e){let t=e;for(;t.parent;)t=t.parent;return t}function computePointOf(e,t,n){let r=e,i=t;if(topOf(r)!==topOf(i))return[!1,new p];let a=r.getLocationInWindow?.(),o=i.getLocationInWindow?.();return!a||!o?[!1,new p]:[!0,new p({x:n.x+(a.x-o.x),y:n.y+(a.y-o.y)})]}function siblingOf(e,t){let n=parentOf(e);if(n===null)return null;let r=childrenOf(n);return r[r.indexOf(e)+t]??null}function alignNick(e,n){if(typeof e==`string`&&Object.hasOwn(t,e))return e;let r=i(e);if(r!==void 0){let e=Object.keys(t).find(e=>t[e]===r);if(e!==void 0)return e}throw TypeError(`'${String(e)}' is not a Gtk.Align, so it cannot be '${n}'. The members are ${Object.keys(t).join(`, `)}; NativeScript's own alignment words go to ${n===`halign`?`horizontalAlignment`:`verticalAlignment`}.`)}function readAlign(e,t,n){for(let[n,r]of Object.entries(t))if(r===e)return n;return n!==null&&e===`left`?n?`end`:`start`:n!==null&&e===`right`?n?`start`:`end`:`fill`}function marginOf(e,t){let n=typeof e==`string`&&e.trim()!==``?Number(e):e;if(typeof n==`number`&&Number.isInteger(n)&&n>=0&&n<=g)return n;throw TypeError(`'${String(e)}' is not a margin: '${t}' takes an integer from 0 to ${g}.`)}function sizeRequestOf(e,t){let n=typeof e==`string`&&e.trim()!==``?Number(e):e;if(typeof n==`number`&&Number.isInteger(n)&&n>=-1&&n<=2147483647)return n;throw TypeError(`'${String(e)}' is not a size request: '${t}' takes an integer from -1 (unset) upward.`)}function readSizeRequest(e){let t=s(e);return t!==null&&t>0?Math.round(t):-1}const v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap,S=new WeakMap;function expandOf(e){let t=S.get(e);return t===void 0&&(t={h:!1,v:!1},S.set(e,t)),t}function withGtkWidgetLayout(t){class WithGtkWidgetLayout extends t{get halign(){let e=viewOf(this);return e===null?`fill`:readAlign(e.horizontalAlignment,n,e.style?.direction===`rtl`)}set halign(e){let t=laidOut(this,`halign`);t.horizontalAlignment=o(alignNick(e,`halign`),`horizontal`)}get valign(){let e=viewOf(this);return e===null?`fill`:readAlign(e.verticalAlignment,r,null)}set valign(e){let t=laidOut(this,`valign`);t.verticalAlignment=o(alignNick(e,`valign`),`vertical`)}get hexpand(){return S.get(this)?.h??!1}set hexpand(e){laidOut(this,`hexpand`);let t=expandOf(this),n=a(e,t.h);n!==t.h&&(t.h=n,this.notify({eventName:m,object:this}))}get vexpand(){return S.get(this)?.v??!1}set vexpand(e){laidOut(this,`vexpand`);let t=expandOf(this),n=a(e,t.v);n!==t.v&&(t.v=n,this.notify({eventName:h,object:this}))}get marginStart(){let e=viewOf(this);return e===null?0:s(e.style?.direction===`rtl`?e.marginRight:e.marginLeft)??0}set marginStart(e){let t=laidOut(this,`marginStart`),n=marginOf(e,`marginStart`);t.style?.direction===`rtl`?t.marginRight=n:t.marginLeft=n}get marginEnd(){let e=viewOf(this);return e===null?0:s(e.style?.direction===`rtl`?e.marginLeft:e.marginRight)??0}set marginEnd(e){let t=laidOut(this,`marginEnd`),n=marginOf(e,`marginEnd`);t.style?.direction===`rtl`?t.marginLeft=n:t.marginRight=n}get visible(){let e=viewOf(this);return e===null?!0:e.visibility===`visible`}set visible(e){let t=laidOut(this,`visible`);t.visibility=a(e,this.visible)?`visible`:`collapse`}get sensitive(){let e=viewOf(this);return e===null?!0:e.isEnabled!==!1}set sensitive(e){let t=laidOut(this,`sensitive`);t.isEnabled=a(e,this.sensitive)}get name(){return v.get(this)??e(this)}set name(e){let t=laidOut(this,`name`),n=v.get(this),r=e??``;r===``?v.delete(this):v.set(this,r),(t.id===void 0||t.id===n)&&(t.id=r===``?void 0:r)}get_visible(){return this.visible}set_visible(e){this.visible=e}get_mapped(){return f(this)}set_direction(e){if(!_.includes(e))throw TypeError(`${e} is not a valid value for enum argument dir`);let t=this.style;t!==void 0&&(t.direction=e===0?``:e===2?`rtl`:`ltr`)}get_direction(){return this.style?.direction===`rtl`?2:1}get_first_child(){return childrenOf(this)[0]??null}get_last_child(){return childrenOf(this).at(-1)??null}get_next_sibling(){return siblingOf(this,1)}get_prev_sibling(){return siblingOf(this,-1)}get_parent(){return parentOf(this)}get_width(){return Math.round(this.getActualSize?.().width??0)}get_height(){return Math.round(this.getActualSize?.().height??0)}compute_point(e,t){return computePointOf(this,e,t)}insert_action_group(e,t){c(this,e,t)}get focusable(){return b.get(this)??!1}set focusable(e){let t=laidOut(this,`focusable`),n=a(e,b.get(this)??!1);b.set(this,n),t.nativeViewProtected?.setFocusable?.(n)}get focusOnClick(){return x.get(this)??!0}set focusOnClick(e){x.set(this,a(e,x.get(this)??!0))}get_focus_on_click(){return this.focusOnClick}set_focus_on_click(e){this.focusOnClick=e}grab_focus(){let e=laidOut(this,`grab_focus`);return l(e),u(e)}get tooltipText(){return y.get(this)??``}set tooltipText(e){let t=laidOut(this,`tooltipText`),n=e??``;(t.accessibilityHint??``)===(y.get(this)??``)&&(t.accessibilityHint=n),y.set(this,n),d(this,n)}get tooltip_text(){return this.tooltipText}set tooltip_text(e){this.tooltipText=e}get_tooltip_text(){return this.tooltipText}set_tooltip_text(e){this.tooltipText=e}get widthRequest(){let e=viewOf(this);return e===null?-1:readSizeRequest(e.minWidth)}set widthRequest(e){let t=laidOut(this,`widthRequest`);t.minWidth=Math.max(0,sizeRequestOf(e,`widthRequest`))}get heightRequest(){let e=viewOf(this);return e===null?-1:readSizeRequest(e.minHeight)}set heightRequest(e){let t=laidOut(this,`heightRequest`);t.minHeight=Math.max(0,sizeRequestOf(e,`heightRequest`))}}return WithGtkWidgetLayout}export{m as NOTIFY_HEXPAND,h as NOTIFY_VEXPAND,withGtkWidgetLayout};
1
+ import"../_virtual/_rolldown/runtime.js";import{gtypeNameOfInstance as e}from"./gtype-name.js";import{GTK_ALIGN as t,NS_HORIZONTAL_ALIGNMENT as n,NS_VERTICAL_ALIGNMENT as r}from"./gtk-align.js";import{cssTypeOf as i}from"./css-names.js";import{installProvidedNameSelector as a}from"../name-selector.js";import{gtkBuilderInteger as o,xmlBoolean as s}from"./xml-values.js";import{nsAlignment as c}from"./construct-props.js";import{lengthValue as l}from"./ns-length.js";import{insertActionGroup as u}from"./actions.js";import{focusView as d,isViewFocused as f}from"../window-source.js";import{applyNativeTooltip as p}from"./native-tooltip.js";import{isMapped as m}from"./widget-mapping.js";import{Point as h}from"@gjsify/adwaita-core";const g=`notify::hexpand`,_=`notify::vexpand`,v=32767;function laidOut(e,t){let n=viewOf(e);if(n!==null)return n;throw TypeError(`${e.constructor.name} is not laid out by a parent, so it has no '${t}'. The GtkWidget layout properties reach views only; this class extends Observable.`)}function viewOf(e){return`horizontalAlignment`in e?e:null}const y=[0,1,2];function isWidget(e){return typeof e.get_first_child==`function`}function childrenOf(e){let t=[];return e.eachChildView?.(e=>(isWidget(e)?t.push(e):t.push(...childrenOf(e)),!0)),t}function parentOf(e){let t=e.parent??null;for(;t!==null&&!isWidget(t);)t=t.parent??null;return t}function topOf(e){let t=e;for(;t.parent;)t=t.parent;return t}function computePointOf(e,t,n){let r=e,i=t;if(topOf(r)!==topOf(i))return[!1,new h];let a=r.getLocationInWindow?.(),o=i.getLocationInWindow?.();return!a||!o?[!1,new h]:[!0,new h({x:n.x+(a.x-o.x),y:n.y+(a.y-o.y)})]}function siblingOf(e,t){let n=parentOf(e);if(n===null)return null;let r=childrenOf(n);return r[r.indexOf(e)+t]??null}function alignNick(e,n){if(typeof e==`string`&&Object.hasOwn(t,e))return e;let r=o(e);if(r!==void 0){let e=Object.keys(t).find(e=>t[e]===r);if(e!==void 0)return e}throw TypeError(`'${String(e)}' is not a Gtk.Align, so it cannot be '${n}'. The members are ${Object.keys(t).join(`, `)}; NativeScript's own alignment words go to ${n===`halign`?`horizontalAlignment`:`verticalAlignment`}.`)}function readAlign(e,t,n){for(let[n,r]of Object.entries(t))if(r===e)return n;return n!==null&&e===`left`?n?`end`:`start`:n!==null&&e===`right`?n?`start`:`end`:`fill`}function marginOf(e,t){let n=typeof e==`string`&&e.trim()!==``?Number(e):e;if(typeof n==`number`&&Number.isInteger(n)&&n>=0&&n<=v)return n;throw TypeError(`'${String(e)}' is not a margin: '${t}' takes an integer from 0 to ${v}.`)}function sizeRequestOf(e,t){let n=typeof e==`string`&&e.trim()!==``?Number(e):e;if(typeof n==`number`&&Number.isInteger(n)&&n>=-1&&n<=2147483647)return n;throw TypeError(`'${String(e)}' is not a size request: '${t}' takes an integer from -1 (unset) upward.`)}function readSizeRequest(e){let t=l(e);return t!==null&&t>0?Math.round(t):-1}const b=new WeakMap,x=new WeakMap,S=new WeakMap,C=new WeakMap,w=new WeakMap;function expandOf(e){let t=w.get(e);return t===void 0&&(t={h:!1,v:!1},w.set(e,t)),t}function withGtkWidgetLayout(t){class WithGtkWidgetLayout extends t{get cssType(){return i(this.constructor)??Reflect.get(t.prototype,`cssType`,this)}set cssType(e){}get halign(){let e=viewOf(this);return e===null?`fill`:readAlign(e.horizontalAlignment,n,e.style?.direction===`rtl`)}set halign(e){let t=laidOut(this,`halign`);t.horizontalAlignment=c(alignNick(e,`halign`),`horizontal`)}get valign(){let e=viewOf(this);return e===null?`fill`:readAlign(e.verticalAlignment,r,null)}set valign(e){let t=laidOut(this,`valign`);t.verticalAlignment=c(alignNick(e,`valign`),`vertical`)}get hexpand(){return w.get(this)?.h??!1}set hexpand(e){laidOut(this,`hexpand`);let t=expandOf(this),n=s(e,t.h);n!==t.h&&(t.h=n,this.notify({eventName:g,object:this}))}get vexpand(){return w.get(this)?.v??!1}set vexpand(e){laidOut(this,`vexpand`);let t=expandOf(this),n=s(e,t.v);n!==t.v&&(t.v=n,this.notify({eventName:_,object:this}))}get marginStart(){let e=viewOf(this);return e===null?0:l(e.style?.direction===`rtl`?e.marginRight:e.marginLeft)??0}set marginStart(e){let t=laidOut(this,`marginStart`),n=marginOf(e,`marginStart`);t.style?.direction===`rtl`?t.marginRight=n:t.marginLeft=n}get marginEnd(){let e=viewOf(this);return e===null?0:l(e.style?.direction===`rtl`?e.marginLeft:e.marginRight)??0}set marginEnd(e){let t=laidOut(this,`marginEnd`),n=marginOf(e,`marginEnd`);t.style?.direction===`rtl`?t.marginLeft=n:t.marginRight=n}get visible(){let e=viewOf(this);return e===null?!0:e.visibility===`visible`}set visible(e){let t=laidOut(this,`visible`);t.visibility=s(e,this.visible)?`visible`:`collapse`}get sensitive(){let e=viewOf(this);return e===null?!0:e.isEnabled!==!1}set sensitive(e){let t=laidOut(this,`sensitive`);t.isEnabled=s(e,this.sensitive)}get name(){return b.get(this)??e(this)}set name(e){let t=laidOut(this,`name`);a();let n=b.get(this),r=e??``;r===``?b.delete(this):b.set(this,r),(t.id===void 0||t.id===n)&&(t.id=r===``?void 0:r)}get_visible(){return this.visible}set_visible(e){this.visible=e}get_mapped(){return m(this)}set_direction(e){if(!y.includes(e))throw TypeError(`${e} is not a valid value for enum argument dir`);let t=this.style;t!==void 0&&(t.direction=e===0?``:e===2?`rtl`:`ltr`)}get_direction(){return this.style?.direction===`rtl`?2:1}get_first_child(){return childrenOf(this)[0]??null}get_last_child(){return childrenOf(this).at(-1)??null}get_next_sibling(){return siblingOf(this,1)}get_prev_sibling(){return siblingOf(this,-1)}get_parent(){return parentOf(this)}get_width(){return Math.round(this.getActualSize?.().width??0)}get_height(){return Math.round(this.getActualSize?.().height??0)}compute_point(e,t){return computePointOf(this,e,t)}insert_action_group(e,t){u(this,e,t)}get focusable(){return S.get(this)??!1}set focusable(e){let t=laidOut(this,`focusable`),n=s(e,S.get(this)??!1);S.set(this,n),t.nativeViewProtected?.setFocusable?.(n)}get focusOnClick(){return C.get(this)??!0}set focusOnClick(e){C.set(this,s(e,C.get(this)??!0))}get_focus_on_click(){return this.focusOnClick}set_focus_on_click(e){this.focusOnClick=e}grab_focus(){let e=laidOut(this,`grab_focus`);return d(e),f(e)}get tooltipText(){return x.get(this)??``}set tooltipText(e){let t=laidOut(this,`tooltipText`),n=e??``;(t.accessibilityHint??``)===(x.get(this)??``)&&(t.accessibilityHint=n),x.set(this,n),p(this,n)}get tooltip_text(){return this.tooltipText}set tooltip_text(e){this.tooltipText=e}get_tooltip_text(){return this.tooltipText}set_tooltip_text(e){this.tooltipText=e}get widthRequest(){let e=viewOf(this);return e===null?-1:readSizeRequest(e.minWidth)}set widthRequest(e){let t=laidOut(this,`widthRequest`);t.minWidth=Math.max(0,sizeRequestOf(e,`widthRequest`))}get heightRequest(){let e=viewOf(this);return e===null?-1:readSizeRequest(e.minHeight)}set heightRequest(e){let t=laidOut(this,`heightRequest`);t.minHeight=Math.max(0,sizeRequestOf(e,`heightRequest`))}}return WithGtkWidgetLayout}export{g as NOTIFY_HEXPAND,_ as NOTIFY_VEXPAND,withGtkWidgetLayout};
@@ -0,0 +1,2 @@
1
+ export declare const GtkButtonBinNsTest: () => Promise<void>;
2
+ export default GtkButtonBinNsTest;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export declare const AdwCssNamesNsTest: () => Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const GtkMenuButtonPropertiesNsTest: () => Promise<void>;
2
+ export default GtkMenuButtonPropertiesNsTest;
@@ -0,0 +1,2 @@
1
+ export declare const MenuModelRouteDNodeGiTest: () => Promise<void>;
2
+ export default MenuModelRouteDNodeGiTest;
@@ -0,0 +1,20 @@
1
+ /** The slice of NativeScript's `IdSelector` the patch touches (`ui/styling/css-selector`). */
2
+ export interface IdSelectorClass {
3
+ prototype: {
4
+ id: string;
5
+ match(node: unknown): boolean;
6
+ lookupSort(sorter: {
7
+ sortAsUniversal(selector: unknown): void;
8
+ }, base?: unknown): void;
9
+ };
10
+ }
11
+ /** Returns `true` when it patched, `false` when this class already carries the patch. */
12
+ export declare function installNameSelector(IdSelector: IdSelectorClass): boolean;
13
+ /**
14
+ * Where the real class comes from. `platform-host.ts` — the part of the port that already imports
15
+ * `@nativescript/core` for real — registers it, so this module and `widget-layout.ts` stay
16
+ * loadable where there is no NativeScript (the node test entry).
17
+ */
18
+ export declare function provideIdSelector(get: () => IdSelectorClass): void;
19
+ /** `installNameSelector` on the registered class; a no-op until `platform-host.ts` has loaded. */
20
+ export declare function installProvidedNameSelector(): void;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -104,6 +104,12 @@ export declare class View extends Observable {
104
104
  * missing so the first `className` write died inside a constructor.
105
105
  */
106
106
  readonly cssClasses: Set<string>;
107
+ /**
108
+ * The real `View.cssType` derives `typeName.toLowerCase()` on first read and keeps it in
109
+ * `_cssType`; a subclass accessor wins over both, which is what a port widget relies on.
110
+ */
111
+ get cssType(): string | undefined;
112
+ set cssType(_value: string | undefined);
107
113
  /**
108
114
  * `'auto'` until written, and HELD ON THE {@link Style} as `widthProperty` /
109
115
  * `heightProperty` are (`ui/styling/style-properties.ts` registers both on `Style`;
@@ -272,6 +278,16 @@ export declare class LayoutBase extends View {
272
278
  export declare class StackLayout extends LayoutBase {
273
279
  orientation: 'horizontal' | 'vertical';
274
280
  }
281
+ /**
282
+ * Upstream's `DockLayout`, of which only `stretchLastChild` is state a spec can read — the
283
+ * docking itself is `onLayout`'s arithmetic on a real allocation and happens nowhere off a
284
+ * device. `true` is the platform default (`ui/layouts/dock-layout/dock-layout-common`), and a
285
+ * double that started at `false` would let `widgets/bin-layout.ts` rely on a default it does
286
+ * not have.
287
+ */
288
+ export declare class DockLayout extends LayoutBase {
289
+ stretchLastChild: boolean;
290
+ }
275
291
  export type GridUnitType = 'auto' | 'star' | 'pixel';
276
292
  export declare class ItemSpec {
277
293
  readonly value: number;
@@ -585,4 +601,7 @@ export declare const ApplicationSettings: {
585
601
  setString(key: string, value: string): void;
586
602
  setNumber(key: string, value: number): void;
587
603
  };
604
+ export declare const CSSHelper: {
605
+ createSelector: (selector: string) => object;
606
+ };
588
607
  export {};
@@ -14,6 +14,8 @@ declare const AdwAboutDialog_base: ((abstract new (...args: any[]) => {
14
14
  emit(eventName: string, ...args: unknown[]): void;
15
15
  get_property(name: string): unknown;
16
16
  set_property(name: string, value: unknown): void;
17
+ get cssType(): string | undefined;
18
+ set cssType(value: string | undefined);
17
19
  get halign(): string;
18
20
  set halign(value: string | number);
19
21
  get valign(): string;
@@ -21,6 +21,8 @@ declare const AdwActionRow_base: ((abstract new (...args: any[]) => {
21
21
  emit(eventName: string, ...args: unknown[]): void;
22
22
  get_property(name: string): unknown;
23
23
  set_property(name: string, value: unknown): void;
24
+ get cssType(): string | undefined;
25
+ set cssType(value: string | undefined);
24
26
  get halign(): string;
25
27
  set halign(value: string | number);
26
28
  get valign(): string;
@@ -12,6 +12,8 @@ declare const AdwAlertDialog_base: ((abstract new (...args: any[]) => {
12
12
  emit(eventName: string, ...args: unknown[]): void;
13
13
  get_property(name: string): unknown;
14
14
  set_property(name: string, value: unknown): void;
15
+ get cssType(): string | undefined;
16
+ set cssType(value: string | undefined);
15
17
  get halign(): string;
16
18
  set halign(value: string | number);
17
19
  get valign(): string;
@@ -15,6 +15,8 @@ declare const AdwAvatar_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwBanner_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -22,6 +22,8 @@ declare const AdwBottomSheet_base: ((abstract new (...args: any[]) => {
22
22
  emit(eventName: string, ...args: unknown[]): void;
23
23
  get_property(name: string): unknown;
24
24
  set_property(name: string, value: unknown): void;
25
+ get cssType(): string | undefined;
26
+ set cssType(value: string | undefined);
25
27
  get halign(): string;
26
28
  set halign(value: string | number);
27
29
  get valign(): string;
@@ -18,6 +18,8 @@ declare const AdwButtonContent_base: ((abstract new (...args: any[]) => {
18
18
  emit(eventName: string, ...args: unknown[]): void;
19
19
  get_property(name: string): unknown;
20
20
  set_property(name: string, value: unknown): void;
21
+ get cssType(): string | undefined;
22
+ set cssType(value: string | undefined);
21
23
  get halign(): string;
22
24
  set halign(value: string | number);
23
25
  get valign(): string;
@@ -25,6 +25,8 @@ declare const AdwCarousel_base: ((abstract new (...args: any[]) => {
25
25
  emit(eventName: string, ...args: unknown[]): void;
26
26
  get_property(name: string): unknown;
27
27
  set_property(name: string, value: unknown): void;
28
+ get cssType(): string | undefined;
29
+ set cssType(value: string | undefined);
28
30
  get halign(): string;
29
31
  set halign(value: string | number);
30
32
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwClamp_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -17,6 +17,8 @@ declare const AdwDataGrid_base: ((abstract new (...args: any[]) => {
17
17
  emit(eventName: string, ...args: unknown[]): void;
18
18
  get_property(name: string): unknown;
19
19
  set_property(name: string, value: unknown): void;
20
+ get cssType(): string | undefined;
21
+ set cssType(value: string | undefined);
20
22
  get halign(): string;
21
23
  set halign(value: string | number);
22
24
  get valign(): string;
@@ -9,6 +9,8 @@ declare const AdwHeaderBar_base: ((abstract new (...args: any[]) => {
9
9
  emit(eventName: string, ...args: unknown[]): void;
10
10
  get_property(name: string): unknown;
11
11
  set_property(name: string, value: unknown): void;
12
+ get cssType(): string | undefined;
13
+ set cssType(value: string | undefined);
12
14
  get halign(): string;
13
15
  set halign(value: string | number);
14
16
  get valign(): string;
@@ -1,4 +1,4 @@
1
- import { GridLayout, Image } from '@nativescript/core';
1
+ import { DockLayout, Image } from '@nativescript/core';
2
2
  import { type GtkIconSizeNick } from './gtk-icon-size.js';
3
3
  import { type ConstructProps } from './construct-props.js';
4
4
  /**
@@ -19,6 +19,8 @@ declare const AdwImageButton_base: ((abstract new (...args: any[]) => {
19
19
  emit(eventName: string, ...args: unknown[]): void;
20
20
  get_property(name: string): unknown;
21
21
  set_property(name: string, value: unknown): void;
22
+ get cssType(): string | undefined;
23
+ set cssType(value: string | undefined);
22
24
  get halign(): string;
23
25
  set halign(value: string | number);
24
26
  get valign(): string;
@@ -75,7 +77,7 @@ declare const AdwImageButton_base: ((abstract new (...args: any[]) => {
75
77
  get(name: string): unknown;
76
78
  }) & {
77
79
  readonly emittedSignals: readonly string[];
78
- }) & typeof GridLayout;
80
+ }) & typeof DockLayout;
79
81
  export declare class AdwImageButton extends AdwImageButton_base {
80
82
  static readonly GTypeName: string;
81
83
  /** The centered icon image. */
@@ -15,6 +15,8 @@ declare const AdwNavigationPage_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;
@@ -22,6 +22,8 @@ declare const AdwNavigationView_base: ((abstract new (...args: any[]) => {
22
22
  emit(eventName: string, ...args: unknown[]): void;
23
23
  get_property(name: string): unknown;
24
24
  set_property(name: string, value: unknown): void;
25
+ get cssType(): string | undefined;
26
+ set cssType(value: string | undefined);
25
27
  get halign(): string;
26
28
  set halign(value: string | number);
27
29
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwPreferencesGroup_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -11,6 +11,8 @@ declare const AdwPreferencesPage_base: ((abstract new (...args: any[]) => {
11
11
  emit(eventName: string, ...args: unknown[]): void;
12
12
  get_property(name: string): unknown;
13
13
  set_property(name: string, value: unknown): void;
14
+ get cssType(): string | undefined;
15
+ set cssType(value: string | undefined);
14
16
  get halign(): string;
15
17
  set halign(value: string | number);
16
18
  get valign(): string;
@@ -8,6 +8,8 @@ declare const AdwShortcutLabel_base: ((abstract new (...args: any[]) => {
8
8
  emit(eventName: string, ...args: unknown[]): void;
9
9
  get_property(name: string): unknown;
10
10
  set_property(name: string, value: unknown): void;
11
+ get cssType(): string | undefined;
12
+ set cssType(value: string | undefined);
11
13
  get halign(): string;
12
14
  set halign(value: string | number);
13
15
  get valign(): string;
@@ -34,6 +34,8 @@ declare const AdwSidebar_base: ((abstract new (...args: any[]) => {
34
34
  emit(eventName: string, ...args: unknown[]): void;
35
35
  get_property(name: string): unknown;
36
36
  set_property(name: string, value: unknown): void;
37
+ get cssType(): string | undefined;
38
+ set cssType(value: string | undefined);
37
39
  get halign(): string;
38
40
  set halign(value: string | number);
39
41
  get valign(): string;
@@ -16,6 +16,8 @@ declare const AdwSliderRow_base: ((abstract new (...args: any[]) => {
16
16
  emit(eventName: string, ...args: unknown[]): void;
17
17
  get_property(name: string): unknown;
18
18
  set_property(name: string, value: unknown): void;
19
+ get cssType(): string | undefined;
20
+ set cssType(value: string | undefined);
19
21
  get halign(): string;
20
22
  set halign(value: string | number);
21
23
  get valign(): string;
@@ -15,6 +15,8 @@ declare const AdwSpinner_base: ((abstract new (...args: any[]) => {
15
15
  emit(eventName: string, ...args: unknown[]): void;
16
16
  get_property(name: string): unknown;
17
17
  set_property(name: string, value: unknown): void;
18
+ get cssType(): string | undefined;
19
+ set cssType(value: string | undefined);
18
20
  get halign(): string;
19
21
  set halign(value: string | number);
20
22
  get valign(): string;