@gjsify/adwaita-nativescript 0.64.12 → 0.64.13

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 (78) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/widgets/adw-about-dialog.js +3 -3
  3. package/lib/esm/widgets/adw-action-row.js +1 -1
  4. package/lib/esm/widgets/adw-avatar.js +1 -1
  5. package/lib/esm/widgets/adw-banner.js +1 -1
  6. package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
  7. package/lib/esm/widgets/adw-carousel.js +1 -1
  8. package/lib/esm/widgets/adw-combo-row.js +1 -1
  9. package/lib/esm/widgets/adw-data-grid.js +1 -1
  10. package/lib/esm/widgets/adw-dialog.js +1 -1
  11. package/lib/esm/widgets/adw-image-button.js +1 -1
  12. package/lib/esm/widgets/adw-navigation-page.js +1 -1
  13. package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
  14. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  15. package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
  16. package/lib/esm/widgets/adw-password-entry-row.js +1 -1
  17. package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
  18. package/lib/esm/widgets/adw-preferences-page.js +1 -1
  19. package/lib/esm/widgets/adw-sidebar.js +1 -1
  20. package/lib/esm/widgets/adw-slider-row.js +1 -1
  21. package/lib/esm/widgets/adw-spin-row.js +1 -1
  22. package/lib/esm/widgets/adw-split-button.js +1 -1
  23. package/lib/esm/widgets/adw-tab-view.js +1 -1
  24. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  25. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  26. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  27. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  28. package/lib/esm/widgets/construct-props.js +1 -1
  29. package/lib/esm/widgets/gtk-action-bar.js +1 -1
  30. package/lib/esm/widgets/gtk-box.js +1 -1
  31. package/lib/esm/widgets/gtk-button.js +1 -1
  32. package/lib/esm/widgets/gtk-check-button.js +1 -1
  33. package/lib/esm/widgets/gtk-drawing-area.js +1 -1
  34. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  35. package/lib/esm/widgets/gtk-entry.js +1 -1
  36. package/lib/esm/widgets/gtk-grid.js +1 -1
  37. package/lib/esm/widgets/gtk-icon-size.js +1 -1
  38. package/lib/esm/widgets/gtk-image.js +1 -1
  39. package/lib/esm/widgets/gtk-label.js +2 -2
  40. package/lib/esm/widgets/gtk-list-box.js +1 -1
  41. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  42. package/lib/esm/widgets/gtk-revealer.js +1 -1
  43. package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
  44. package/lib/esm/widgets/gtk-stack.js +1 -1
  45. package/lib/esm/widgets/gtk-text-view.js +1 -1
  46. package/lib/esm/widgets/gtk-toggle-button.js +1 -1
  47. package/lib/esm/widgets/gtk-window.js +1 -1
  48. package/lib/esm/widgets/label-markup.js +1 -0
  49. package/lib/esm/widgets/scrolled-window-policy.js +1 -1
  50. package/lib/esm/widgets/signals.js +1 -1
  51. package/lib/esm/widgets/single-child-base.js +1 -1
  52. package/lib/esm/widgets/single-child-cell.js +1 -0
  53. package/lib/esm/widgets/stack-page.js +1 -1
  54. package/lib/esm/widgets/transition-type.js +1 -1
  55. package/lib/esm/widgets/view-stack-page.js +1 -1
  56. package/lib/esm/widgets/widget-layout.js +1 -1
  57. package/lib/esm/widgets/xml-values.js +1 -1
  58. package/lib/types/builder/index.d.ts +4 -2
  59. package/lib/types/clamped-bin.spec.d.ts +2 -0
  60. package/lib/types/combo-row-properties.spec.d.ts +2 -0
  61. package/lib/types/default-translate.spec.d.ts +1 -0
  62. package/lib/types/drop-down-properties.spec.d.ts +2 -0
  63. package/lib/types/index.d.ts +1 -1
  64. package/lib/types/label-markup.spec.d.ts +1 -0
  65. package/lib/types/single-child-cell.spec.d.ts +2 -0
  66. package/lib/types/testing/ns-core.d.mts +115 -3
  67. package/lib/types/widgets/adw-banner.d.ts +2 -2
  68. package/lib/types/widgets/adw-combo-row.d.ts +42 -26
  69. package/lib/types/widgets/gtk-drop-down.d.ts +41 -33
  70. package/lib/types/widgets/gtk-label.d.ts +29 -8
  71. package/lib/types/widgets/index.d.ts +1 -2
  72. package/lib/types/widgets/label-markup.d.ts +43 -0
  73. package/lib/types/widgets/signals.d.ts +54 -0
  74. package/lib/types/widgets/single-child-base.d.ts +2 -0
  75. package/lib/types/widgets/single-child-cell.d.ts +8 -0
  76. package/lib/types/widgets/xml-values.d.ts +12 -0
  77. package/package.json +12 -12
  78. package/src/testing/ns-core.mts +231 -3
@@ -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{nsAlignment as i}from"./construct-props.js";import{lengthValue as a}from"./ns-length.js";import{xmlBoolean as o}from"./xml-values.js";import{insertActionGroup as s}from"./actions.js";import{focusView as c,isViewFocused as l}from"../window-source.js";import{applyNativeTooltip as u}from"./native-tooltip.js";import{isMapped as d}from"./widget-mapping.js";import{Point as f}from"@gjsify/adwaita-core";const p=`notify::hexpand`,m=`notify::vexpand`,h=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 g=[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 f];let a=r.getLocationInWindow?.(),o=i.getLocationInWindow?.();return!a||!o?[!1,new f]:[!0,new f({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;if(typeof e==`number`){let n=Object.keys(t).find(n=>t[n]===e);if(n!==void 0)return n}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<=h)return n;throw TypeError(`'${String(e)}' is not a margin: '${t}' takes an integer from 0 to ${h}.`)}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=a(e);return t!==null&&t>0?Math.round(t):-1}const _=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,x=new WeakMap;function expandOf(e){let t=x.get(e);return t===void 0&&(t={h:!1,v:!1},x.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=i(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=i(alignNick(e,`valign`),`vertical`)}get hexpand(){return x.get(this)?.h??!1}set hexpand(e){laidOut(this,`hexpand`);let t=expandOf(this),n=o(e,t.h);n!==t.h&&(t.h=n,this.notify({eventName:p,object:this}))}get vexpand(){return x.get(this)?.v??!1}set vexpand(e){laidOut(this,`vexpand`);let t=expandOf(this),n=o(e,t.v);n!==t.v&&(t.v=n,this.notify({eventName:m,object:this}))}get marginStart(){let e=viewOf(this);return e===null?0:a(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:a(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=o(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=o(e,this.sensitive)}get name(){return _.get(this)??e(this)}set name(e){let t=laidOut(this,`name`),n=_.get(this),r=e??``;r===``?_.delete(this):_.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 d(this)}set_direction(e){if(!g.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){s(this,e,t)}get focusable(){return y.get(this)??!1}set focusable(e){let t=laidOut(this,`focusable`),n=o(e,y.get(this)??!1);y.set(this,n),t.nativeViewProtected?.setFocusable?.(n)}get focusOnClick(){return b.get(this)??!0}set focusOnClick(e){b.set(this,o(e,b.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 c(e),l(e)}get tooltipText(){return v.get(this)??``}set tooltipText(e){let t=laidOut(this,`tooltipText`),n=e??``;(t.accessibilityHint??``)===(v.get(this)??``)&&(t.accessibilityHint=n),v.set(this,n),u(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{p as NOTIFY_HEXPAND,m 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{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 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";function xmlNumber(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`)return t;let n=e.trim();if(n===``)return t;let r=Number(n);return Number.isFinite(r)?r:t}function xmlBoolean(e,t){if(typeof e==`boolean`)return e;if(typeof e!=`string`)return t;let n=e.trim().toLowerCase();return n===`true`?!0:n===`false`?!1:t}export{xmlBoolean,xmlNumber};
1
+ import"../_virtual/_rolldown/runtime.js";function xmlNumber(e,t){if(typeof e==`number`)return Number.isFinite(e)?e:t;if(typeof e!=`string`)return t;let n=e.trim();if(n===``)return t;let r=Number(n);return Number.isFinite(r)?r:t}function gtkBuilderInteger(e){if(typeof e==`number`)return Number.isInteger(e)?e:void 0;if(typeof e!=`string`)return;let t=/^([+-]?)(?:(0[xX][0-9a-fA-F]+)|(0[0-7]+)|([0-9]+))$/.exec(e.trim());if(t===null)return;let n=t[2]===void 0?t[3]===void 0?Number.parseInt(t[4],10):Number.parseInt(t[3],8):Number.parseInt(t[2],16);return t[1]===`-`?-n:n}function xmlBoolean(e,t){if(typeof e==`boolean`)return e;if(typeof e!=`string`)return t;let n=e.trim().toLowerCase();return n===`true`?!0:n===`false`?!1:t}export{gtkBuilderInteger,xmlBoolean,xmlNumber};
@@ -64,8 +64,10 @@ export interface BuildOptions {
64
64
  template?: TemplateScope;
65
65
  /**
66
66
  * Translates a string the `.blp` marked with `_()` or `C_()`, as GtkBuilder does with its
67
- * gettext domain. Called with the authored text and the `C_()` context, if any. Without it a
68
- * marked string stays as authored, which is English: the marking is carried, not acted on.
67
+ * gettext domain. Called with the authored text and the `C_()` context, if any. Without it the
68
+ * translator the platform registered answers (`registerDefaultTranslate` — on Android the real
69
+ * opt-in installs GLib's default-domain gettext, as GtkBuilder uses when no domain is set), and
70
+ * with neither a marked string stays as authored, which is English: carried, not acted on.
69
71
  * Covers properties, the labels of `responses`, `strings [ ]` items and breakpoint setters.
70
72
  */
71
73
  translate?: (text: string, context?: string) => string;
@@ -0,0 +1,2 @@
1
+ export declare const AdwClampedBinNsTest: () => Promise<void>;
2
+ export default AdwClampedBinNsTest;
@@ -0,0 +1,2 @@
1
+ export declare const AdwComboRowPropertiesNsTest: () => Promise<void>;
2
+ export default AdwComboRowPropertiesNsTest;
@@ -0,0 +1 @@
1
+ export declare const AdwDefaultTranslateNsTest: () => Promise<void>;
@@ -0,0 +1,2 @@
1
+ export declare const GtkDropDownPropertiesNsTest: () => Promise<void>;
2
+ export default GtkDropDownPropertiesNsTest;
@@ -1,6 +1,6 @@
1
1
  export { assertNativeScript, isNativeScript, isAndroid, isIOS } from '@gjsify/native-platform';
2
2
  export { NOTIFY_ACTIVE, NOTIFY_TEXT, NOTIFY_TEXT_LENGTH, NOTIFY_MAX_LENGTH, NOTIFY_EDITABLE, NOTIFY_SHOW_APPLY_BUTTON, NOTIFY_ACTIVATES_DEFAULT, SIGNAL_APPLY, SIGNAL_ENTRY_ACTIVATED, ENTRY_ACTIVATE, NOTIFY_ENTRY_TEXT, ComboState, NOTIFY_SELECTED, NOTIFY_DROP_DOWN_SELECTED, SpinState, NOTIFY_VALUE, AdwSliderRow, NOTIFY_SLIDER_VALUE, NOTIFY_EXPANDED, NOTIFY_ENABLE_EXPANSION, NOTIFY_SHOW_ENABLE_SWITCH, NS_EXPANDER_ARROW_DISABLED_OPACITY, AdwImageButton, DEFAULT_ICON_BUTTON_ICON_SIZE, MENU_ITEM_ACTIVATED, DEFAULT_GTK_IMAGE_SIZE, DEFAULT_BOX_SPACING, GTK_BUTTON_CLICKED, GTK_BUTTON_LABEL_CLASS, buttonSlotAfterWrite, buttonSlotDetaches, boxChildTrack, boxTrackPlan, boxSpacingChanges, normalizeBoxSpacing, NOTIFY_REVEAL_CHILD, ADW_DIALOG_CLOSED, ADW_DIALOG_CLOSE_ATTEMPT, LIST_BOX_ROW_ACTIVATED, LIST_BOX_ROW_SELECTED, NOTIFY_HEXPAND, NOTIFY_VEXPAND, withGtkWidgetLayout, NOTIFY_STACK_VISIBLE_CHILD, NOTIFY_STACK_VISIBLE_CHILD_NAME, DRAWING_AREA_REFUSAL, GTK_CHECK_BUTTON_TOGGLED, GTK_CHECK_BUTTON_ACTIVATE, GTK_CHECK_BUTTON_CHECKED_CLASS, GTK_CHECK_BUTTON_INCONSISTENT_CLASS, NOTIFY_CHECK_ACTIVE, GTK_WRAP_MODES, NOTIFY_TEXT_VIEW_TEXT, GTK_TOGGLE_BUTTON_CHECKED_CLASS, GTK_TOGGLE_BUTTON_TOGGLED, NOTIFY_TOGGLE_ACTIVE, labelDisplayText, labelMarkupIsUnparseable, BUTTON_CLICKED, AVATAR_DEFAULT_ICON, DEFAULT_AVATAR_SIZE, avatarInitials, DEFAULT_CLAMP_MAX_SIZE, padForSystemInsets, padSheetForSystemInsets, bottomSheetPanel, AdwDataGrid, ROW_ACTIVATED, dataGridCellClass, dataGridItemSpec, dataGridRowClass, dataGridShapeKey, dataGridTracksKey, parseDataGridWidth, DATA_GRID_HEADER_CELL_CLASS, DATA_GRID_HEADER_ROW_CLASS, DATA_GRID_SECTION_CELL_CLASS, DEFAULT_SPINNER_SIZE, ACTIVATED, MENU_TAPPED, ToggleGroupState, NOTIFY_TOGGLE_SELECTED, applyAdwaitaNsAccent, clearAdwaitaNsAccent, ADWAITA_NS_ACCENT_RULES, adwaitaNsAccentColor, adwaitaNsAccentCss, SHORTCUT_LABEL_CAP_TEXT_CLASS, SHORTCUT_LABEL_CLASS, SHORTCUT_LABEL_DIMMED_CLASS, SHORTCUT_LABEL_DISABLED_CLASS, SHORTCUT_LABEL_KEYCAP_CLASS, SHORTCUT_LABEL_KEYS_CLASS, SHORTCUT_LABEL_SIDE_CLASS, SHORTCUT_LABEL_SPACED_CLASS, shortcutLabelDirection, shortcutLabelPlatform, shortcutLabelRenderPlan, NOTIFY_VISIBLE_CHILD, AdwViewSwitcherBase, NOTIFY_VIEW_SELECTED, DEFAULT_CAROUSEL_PAGE_WIDTH, NOTIFY_POSITION, NOTIFY_VISIBLE_PAGE, AdwSplitViewBase, NOTIFY_SHOW_SIDEBAR, NsNavigationSplitViewState, NsOverlaySplitViewState, splitViewColumns, NOTIFY_SIDEBAR_SELECTED, NOTIFY_OPEN, AdwToast, AdwToastQueue, DEFAULT_TOAST_TIMEOUT, AdwAlertResponses, ABOUT_CLOSED, PREFERENCES_CLOSED, applyConstructProps, nsAlignment, GTK_ALIGN, DEFAULT_ICON_PIXEL_SIZE, GTK_ICON_SIZE_NICKS, GTK_ICON_SIZE_PIXELS, type GtkIconSizeNick, isGtkIconSizeNick, PIXEL_SIZE_UNSET, activateWidgetAction, findActionGroup, insertActionGroup, attachRowPressFeedback, ICON_FALLBACK_NAME, compiledIconNames, iconValueKind, isIconAvailable, resolveIconSource, renderSymbolicIcon, extractIconPaths, extractPathData, ADWAITA_ICON_GRID, DEFAULT_ICON_COLOR, DEFAULT_ICON_COLOR_DARK, adwaitaColorScheme, isThemeIconColor, onAdwaitaColorSchemeChanged, setAdwaitaColorScheme, themeIconColor, toggleAdwaitaColorScheme, AdwBreakpoint, addBreakpoints, evaluateBreakpointCondition, observeViewSize, observeWindowSize, parseBreakpointCondition, registerAdwaitaElements, } from './widgets/index.js';
3
- export type { BoxOrientation, ButtonSlot, ButtonSlotWrite, NotifyEntryTextEventData, AdwComboOption, ComboStateChange, ComboStateListener, NotifySelectedEventData, NotifyDropDownSelectedEventData, NotifyValueEventData, SpinStateChange, SpinStateListener, NotifySliderValueEventData, MenuItemActivatedEventData, MenuTappedEventData, RowActivatedEventData, DataGridItemSpec, NotifyToggleSelectedEventData, ToggleGroupStateChange, ToggleGroupStateListener, AccentRole, AccentRule, ShortcutLabelRenderPlan, ShortcutLabelViewSpec, AdwViewStackPageInfo, NotifyVisibleChildEventData, AdwViewPage, NotifyViewSelectedEventData, NotifyPositionEventData, NotifyVisiblePageEventData, NotifyShowSidebarEventData, NsShowSidebarNotification, NsSplitViewHost, NsSplitViewState, NotifySidebarSelectedEventData, NotifyOpenEventData, AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, ToastScheduler, ToastTimerHandle, AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, OrderedConfirmResponses, ConstructProps, SystemInsetEdges, IconValueKind, SymbolicIconOptions, IconPath, AdwColorScheme, AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './widgets/index.js';
3
+ export type { BoxOrientation, ButtonSlot, ButtonSlotWrite, NotifyEntryTextEventData, AdwComboOption, ComboStateChange, ComboStateListener, NotifyValueEventData, SpinStateChange, SpinStateListener, NotifySliderValueEventData, MenuItemActivatedEventData, MenuTappedEventData, RowActivatedEventData, DataGridItemSpec, NotifyToggleSelectedEventData, ToggleGroupStateChange, ToggleGroupStateListener, AccentRole, AccentRule, ShortcutLabelRenderPlan, ShortcutLabelViewSpec, AdwViewStackPageInfo, NotifyVisibleChildEventData, AdwViewPage, NotifyViewSelectedEventData, NotifyPositionEventData, NotifyVisiblePageEventData, NotifyShowSidebarEventData, NsShowSidebarNotification, NsSplitViewHost, NsSplitViewState, NotifySidebarSelectedEventData, NotifyOpenEventData, AdwToastOptions, AdwToastQueueHandlers, AdwToastQueueOptions, ToastScheduler, ToastTimerHandle, AdwAlertResponse, AdwResponseAppearance, AdwResponseOptions, OrderedConfirmResponses, ConstructProps, SystemInsetEdges, IconValueKind, SymbolicIconOptions, IconPath, AdwColorScheme, AdwBreakpointHandlers, BreakpointBound, BreakpointConditionGroup, BreakpointConditionLeaf, BreakpointConditionNode, BreakpointDimension, BreakpointSize, } from './widgets/index.js';
4
4
  export type { GtkWidgetLayout, GtkWidgetLayoutMembers } from './widgets/widget-layout.js';
5
5
  export * as Adw from './namespace/adw.js';
6
6
  export * as Gtk from './namespace/gtk.js';
@@ -0,0 +1 @@
1
+ export declare const GtkLabelMarkupNsTest: () => Promise<void>;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
@@ -53,10 +53,21 @@ export interface TouchGestureEventData extends EventData {
53
53
  export declare class Style extends Observable {
54
54
  #private;
55
55
  direction?: 'ltr' | 'rtl' | null;
56
+ /** In DIPs, and unset until written: `fontSizeProperty` carries no `defaultValue`. */
57
+ fontSize?: number;
56
58
  readonly viewRef: WeakRef<View>;
57
59
  constructor(view: View);
58
60
  get visibility(): string;
59
61
  set visibility(value: string);
62
+ /**
63
+ * The inline width, in DIPs or as a percentage string, `'auto'` until written — and the
64
+ * `widthChange` a one-child container listens for. A CSS property notifies on the style
65
+ * and not on the view, which is the whole reason this pair lives here.
66
+ */
67
+ get width(): number | string;
68
+ set width(value: number | string);
69
+ get height(): number | string;
70
+ set height(value: number | string);
60
71
  }
61
72
  export declare class View extends Observable {
62
73
  /**
@@ -93,8 +104,21 @@ export declare class View extends Observable {
93
104
  * missing so the first `className` write died inside a constructor.
94
105
  */
95
106
  readonly cssClasses: Set<string>;
96
- width: number | string;
97
- height: number | string;
107
+ /**
108
+ * `'auto'` until written, and HELD ON THE {@link Style} as `widthProperty` /
109
+ * `heightProperty` are (`ui/styling/style-properties.ts` registers both on `Style`;
110
+ * `view-common.ts`'s `get width()` is a one-line forward to `this.style.width`).
111
+ *
112
+ * This double held them as plain fields on the view, which made it STRUCTURALLY BLIND to
113
+ * the one thing a reader needs from them: the notification. `AdwSingleChildBase` learns
114
+ * that a parent settled its width from `widthChange` on the style — on a device the only
115
+ * place it is emitted — and against a field there is no event at all, so a spec would
116
+ * have passed while the widget sat waiting for a message that never came.
117
+ */
118
+ get width(): number | string;
119
+ set width(value: number | string);
120
+ get height(): number | string;
121
+ set height(value: number | string);
98
122
  horizontalAlignment: string;
99
123
  verticalAlignment: string;
100
124
  /**
@@ -280,8 +304,96 @@ export declare class GridLayout extends LayoutBase {
280
304
  static setColumnSpan(view: View, value: number): void;
281
305
  static setRowSpan(view: View, value: number): void;
282
306
  }
307
+ /**
308
+ * A `Span`'s style — NOT a {@link View}'s {@link Style}.
309
+ *
310
+ * `Span extends ViewBase` upstream, so it has none of `View`'s shortcuts and carries only
311
+ * what a span can be given. Every member is unset until written, which is what the font
312
+ * properties answer on a device: `fontSizeProperty` and `fontFamilyProperty` are registered
313
+ * with no `defaultValue` (`ui/styling/style-properties.ts`).
314
+ */
315
+ export declare class SpanStyle extends Observable {
316
+ fontFamily: string | undefined;
317
+ fontSize: number | undefined;
318
+ fontStyle: string | undefined;
319
+ fontWeight: string | undefined;
320
+ textDecoration: string | undefined;
321
+ verticalAlignment: string | undefined;
322
+ }
323
+ /**
324
+ * One styled stretch of a {@link FormattedString}.
325
+ *
326
+ * The font and decoration members are ACCESSORS OVER `style`, as `ui/text-base/span.ts`
327
+ * has them — a double that made them own fields could not report a widget that wrote one
328
+ * and expected the other to see it.
329
+ */
330
+ export declare class Span extends Observable {
331
+ static readonly linkTapEvent = "linkTap";
332
+ readonly _style: SpanStyle;
333
+ get style(): SpanStyle;
334
+ /** NativeScript unescapes the two whitespace spellings a markup file can carry. */
335
+ private _text;
336
+ get text(): string;
337
+ set text(value: string);
338
+ get fontFamily(): string | undefined;
339
+ set fontFamily(value: string | undefined);
340
+ get fontSize(): number | undefined;
341
+ set fontSize(value: number | undefined);
342
+ get fontStyle(): string | undefined;
343
+ set fontStyle(value: string | undefined);
344
+ get fontWeight(): string | undefined;
345
+ set fontWeight(value: string | undefined);
346
+ get textDecoration(): string | undefined;
347
+ set textDecoration(value: string | undefined);
348
+ /**
349
+ * DERIVED, never written — upstream flips it from `addEventListener` /
350
+ * `removeEventListener` through `_setTappable(this.hasListeners(Span.linkTapEvent))`,
351
+ * and `setSpanModifiers` attaches the native `ClickableSpan` only for a tappable span.
352
+ * So subscribing IS what makes a span a link, and this reads the listeners rather than
353
+ * a flag a caller could set without one.
354
+ */
355
+ get tappable(): boolean;
356
+ }
357
+ /**
358
+ * The `ObservableArray<Span>` behind {@link FormattedString.spans}, as the four members
359
+ * that collection really offers.
360
+ *
361
+ * NOT A PLAIN ARRAY, and a double that used one would be the easier lie: `ObservableArray`
362
+ * reads by `getItem(pos)` and has no index access at all, so `spans[0]` is `undefined` on a
363
+ * device. A spec written against an array would pass here and read nothing there.
364
+ */
365
+ export declare class SpanList {
366
+ private readonly _items;
367
+ get length(): number;
368
+ push(span: Span): number;
369
+ /** A negative `pos` counts from the end, as upstream's does. */
370
+ getItem(pos: number): Span;
371
+ [Symbol.iterator](): Generator<Span, void, unknown>;
372
+ }
373
+ /** The rich-text value of a {@link Label} — a FLAT list of spans, no nesting. */
374
+ export declare class FormattedString extends Observable {
375
+ readonly spans: SpanList;
376
+ /** `formatted-string.ts`: the span texts concatenated, nothing between them. */
377
+ toString(): string;
378
+ }
283
379
  export declare class Label extends View {
284
- text: string;
380
+ private _text;
381
+ private _formattedText;
382
+ /**
383
+ * A write is a NO-OP while {@link formattedText} is set, as on a device:
384
+ * `[textProperty.setNative]` returns early when the label carries rich text
385
+ * (`ui/text-base/index.android.ts:192-195`), so the spans are what shows and this
386
+ * property is whatever the spans last said.
387
+ */
388
+ get text(): string;
389
+ set text(value: string);
390
+ /**
391
+ * Unset until something writes it — `formattedTextProperty` carries no `defaultValue`
392
+ * (`ui/text-base/text-base-common.ts:194`), so a label that was never given rich text
393
+ * reads `undefined`, not `null`.
394
+ */
395
+ get formattedText(): FormattedString | null | undefined;
396
+ set formattedText(value: FormattedString | null | undefined);
285
397
  textWrap: boolean;
286
398
  textAlignment: string;
287
399
  textOverflow: string;
@@ -84,8 +84,8 @@ export declare class AdwBanner extends AdwBanner_base {
84
84
  * Whether {@link title} is Pango markup. Defaults to TRUE, as in libadwaita
85
85
  * (:422-425).
86
86
  *
87
- * NS has no inline-markup layer, so markup is reduced to its plain text —
88
- * closer to what GTK paints than the raw tags would be.
87
+ * Markup is reduced to its plain text here — closer to what GTK paints than the raw
88
+ * tags would be, and deliberately not the drawn path `Gtk.Label` takes: see the header.
89
89
  */
90
90
  get useMarkup(): boolean;
91
91
  set useMarkup(value: boolean | string);
@@ -1,4 +1,4 @@
1
- import { Label, type EventData, type View } from '@nativescript/core';
1
+ import { Label, type View } from '@nativescript/core';
2
2
  import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
3
3
  import { AdwActionRow } from './adw-action-row.js';
4
4
  import { GtkImage } from './gtk-image.js';
@@ -7,14 +7,18 @@ export { ComboState } from '@gjsify/adwaita-core';
7
7
  export type { AdwComboOption, ComboStateChange, ComboStateListener } from '@gjsify/adwaita-core';
8
8
  /** Event name emitted when {@link AdwComboRow.selected} changes. Mirrors GObject `notify::selected`. */
9
9
  export declare const NOTIFY_SELECTED = "notify::selected";
10
- /** Payload of the `notify::selected` event. */
11
- export interface NotifySelectedEventData extends EventData {
12
- /** The newly-selected index. */
13
- selected: number;
14
- /** The newly-selected option's `value`. */
15
- value: string;
16
- }
17
- export declare class AdwComboRow extends AdwActionRow {
10
+ declare const AdwComboRow_base: ((abstract new (...args: any[]) => {
11
+ _emit(eventName: string): void;
12
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
13
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
14
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
15
+ notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
16
+ set(name: string, value: unknown): void;
17
+ get(name: string): unknown;
18
+ }) & {
19
+ readonly emittedSignals: readonly string[];
20
+ }) & typeof AdwActionRow;
21
+ export declare class AdwComboRow extends AdwComboRow_base {
18
22
  static readonly GTypeName: string;
19
23
  /**
20
24
  * The action row's edges, plus `model`: `model: Gtk.StringList { strings [ … ] }` in a
@@ -42,7 +46,35 @@ export declare class AdwComboRow extends AdwActionRow {
42
46
  * writes `model:` first — the order GtkBuilder needs too.
43
47
  */
44
48
  private _pendingSelected;
49
+ /** `Adw.ComboRow:model` — the list, by identity. Declared above; the seam installs it. */
50
+ model: ComboWatchableModel | null;
51
+ /**
52
+ * `Adw.ComboRow:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
53
+ * Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
54
+ * per declared property and this row is what writes the derived value.
55
+ */
56
+ selected: number;
57
+ /**
58
+ * `Adw.ComboRow:selected-item` — the model's OWN object at {@link selected}, so the identity
59
+ * comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
60
+ * model. Read-only by derivation (see the declaration).
61
+ */
62
+ selectedItem: unknown;
63
+ /**
64
+ * What a `model` write DOES, once the seam has stored the normalized value.
65
+ *
66
+ * A method on the class and not a body inside the declaration, because the descriptor sits
67
+ * outside the class and reaches the state through a cast — and a reader keyed on
68
+ * `this.<field>` cannot tell `ComboState.setModel` from `ListViewState.setModel` through
69
+ * one (`check-adwaita-collection-reactivity.mjs`). Guessing there would merge two different
70
+ * collections into one comparison, so the call is made where the field's type is declared.
71
+ */
72
+ private _applyModel;
73
+ /** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
74
+ private _applySelected;
45
75
  constructor(props?: ConstructProps<AdwComboRow>);
76
+ /** What the relay pushes for each of the three — the state's reading, never the store's. */
77
+ private _valueOf;
46
78
  /**
47
79
  * `model_changed` (adw-combo-row.c:187-195) — one option or none is not a
48
80
  * choice, so the chevron goes and the row stops being activatable.
@@ -54,13 +86,6 @@ export declare class AdwComboRow extends AdwActionRow {
54
86
  private _syncChooser;
55
87
  /** Open the native action chooser and apply the picked option. */
56
88
  private _openChooser;
57
- /**
58
- * The list model (`Adw.ComboRow:model`) — the OBJECT that was assigned, by identity, as
59
- * `row.model === model` is measured to hold in libadwaita (ADR 0122 § 4). The normalised
60
- * descriptors are {@link options}.
61
- */
62
- get model(): ComboWatchableModel | null;
63
- set model(value: ComboWatchableModel | string | null);
64
89
  /** The held model's items as `{ value, label }` descriptors. */
65
90
  get options(): AdwComboOption[];
66
91
  /** `adw_combo_row_set_model`. */
@@ -73,21 +98,12 @@ export declare class AdwComboRow extends AdwActionRow {
73
98
  * row edge, as on any action row.
74
99
  */
75
100
  _addChildFromBuilder(name: string, child: View): void;
76
- /** The selected option index. Updates the inline value label. */
77
- get selected(): number;
78
- set selected(raw: number | string);
101
+ /** `adw_combo_row_get_selected`. */
79
102
  get_selected(): number;
80
103
  set_selected(position: number): void;
81
104
  /** The selected option's `value`, or `''` when out of range. */
82
105
  get selectedValue(): string;
83
106
  set selectedValue(value: string);
84
- /**
85
- * The selected ITEM (`Adw.ComboRow:selected-item`) — the model's own object at
86
- * {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
87
- * consumer writes holds. `null` for the sentinel and for no model. Read-only, as in
88
- * libadwaita.
89
- */
90
- get selectedItem(): unknown;
91
107
  /** `adw_combo_row_get_selected_item`. */
92
108
  get_selected_item(): unknown;
93
109
  }
@@ -1,24 +1,16 @@
1
- import { Label, StackLayout, type EventData, type View } from '@nativescript/core';
1
+ import { Label, StackLayout, type View } from '@nativescript/core';
2
2
  import type { AdwComboOption, ComboWatchableModel } from '@gjsify/adwaita-core';
3
3
  import { GtkImage } from './gtk-image.js';
4
4
  import { type ConstructProps } from './construct-props.js';
5
- /** Event name emitted when {@link GtkDropDown.selected} changes through a pick. Mirrors GObject `notify::selected`. */
5
+ import { type GObjectNotify } from './signals.js';
6
+ /** Event name emitted when {@link GtkDropDown.selected} changes. Mirrors GObject `notify::selected`. */
6
7
  export declare const NOTIFY_SELECTED = "notify::selected";
7
8
  /** Mirrors GObject `notify::selected-item`; fired right after the one above, on the same change. */
8
9
  export declare const NOTIFY_SELECTED_ITEM = "notify::selected-item";
9
- /** Payload of the `notify::selected` event. */
10
- export interface NotifyDropDownSelectedEventData extends EventData {
11
- /** The newly-selected index. */
12
- selected: number;
13
- /** The newly-selected option's `value`. */
14
- value: string;
15
- /** The newly-selected option's `label` — what the button now shows. */
16
- label: string;
17
- }
18
10
  declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
19
- addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
20
- removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
21
- connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
11
+ addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
12
+ removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
13
+ connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
22
14
  disconnect(handlerId: number): void;
23
15
  emit(eventName: string, ...args: unknown[]): void;
24
16
  get_property(name: string): unknown;
@@ -73,7 +65,7 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
73
65
  set_focus_on_click(focusOnClick: boolean): void;
74
66
  grab_focus(): boolean;
75
67
  _emit(eventName: string): void;
76
- notify<T extends EventData>(data: T): void;
68
+ notify<T extends import("@nativescript/core").EventData>(data: T): void;
77
69
  notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
78
70
  set(name: string, value: unknown): void;
79
71
  get(name: string): unknown;
@@ -82,8 +74,6 @@ declare const GtkDropDown_base: ((abstract new (...args: any[]) => {
82
74
  }) & typeof StackLayout;
83
75
  export declare class GtkDropDown extends GtkDropDown_base {
84
76
  static readonly GTypeName: string;
85
- /** The GTK signals this widget emits through `connect` — read by the shared-tree builder (ADR 0093). */
86
- static readonly emittedSignals: readonly string[];
87
77
  /**
88
78
  * `model` only: `model: Gtk.StringList { strings [ … ] }` in a `.blp` places the list at
89
79
  * the property it sets (ADR 0072). `GtkDropDown` takes no child widget in GTK.
@@ -104,16 +94,43 @@ export declare class GtkDropDown extends GtkDropDown_base {
104
94
  private readonly _authored;
105
95
  /** Title shown atop the substituted `action()` sheet. */
106
96
  private _chooserTitle;
97
+ /**
98
+ * A `selected` written while the widget has no model yet — the twin of
99
+ * {@link AdwComboRow}'s. NativeScript's XML builder assigns every attribute before it adds
100
+ * the children, so `<gtk:DropDown selected="1">` reached this widget before its
101
+ * `<gtk:DropDown.model>` list did and the index was DROPPED; the row has held it since it
102
+ * was written and the drop-down does now too.
103
+ */
104
+ private _pendingSelected;
105
+ /** `Gtk.DropDown:model` — the list, by identity. Declared above; the seam installs it. */
106
+ model: ComboWatchableModel | null;
107
+ /**
108
+ * `Gtk.DropDown:selected` — the selected position, or {@link ADW_COMBO_NO_SELECTION}.
109
+ * Declared above; not `readonly` in TypeScript because the seam installs one accessor pair
110
+ * per declared property and this widget is what writes the derived value.
111
+ */
112
+ selected: number;
113
+ /**
114
+ * `Gtk.DropDown:selected-item` — the model's OWN object at {@link selected}, so the identity
115
+ * comparison a `selected-item` consumer writes holds. `null` for the sentinel and for no
116
+ * model. Read-only by derivation (see the declaration).
117
+ */
118
+ selectedItem: unknown;
119
+ /** GJS's `notify('<prop>')` beside NativeScript's `notify({ eventName })`; see the seam. */
120
+ notify: GObjectNotify;
121
+ /**
122
+ * What a `model` write does, once the seam has stored the normalized value — the twin of
123
+ * `AdwComboRow._applyModel`, which says why the body sits on the class and not in the
124
+ * declaration.
125
+ */
126
+ private _applyModel;
127
+ /** What a `selected` write does: emits `selected` then `selected-item` through the relay. */
128
+ private _applySelected;
107
129
  constructor(props?: ConstructProps<GtkDropDown>);
130
+ /** What the relay pushes for each of the three — the state's reading, never the store's. */
131
+ private _valueOf;
108
132
  /** Open the native chooser and apply the picked option. */
109
133
  private _openChooser;
110
- /**
111
- * The list model (`Gtk.DropDown:model`) — the OBJECT that was assigned, by identity, as
112
- * `dropdown.model === model` is measured to hold in GTK (ADR 0122 § 4). The normalised
113
- * descriptors are {@link options}.
114
- */
115
- get model(): ComboWatchableModel | null;
116
- set model(value: ComboWatchableModel | string | null);
117
134
  /** The held model's items as `{ value, label }` descriptors. */
118
135
  get options(): AdwComboOption[];
119
136
  /** `gtk_drop_down_set_model`. */
@@ -125,9 +142,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
125
142
  * Anything else is refused, as GTK refuses a child widget on a `GtkDropDown`.
126
143
  */
127
144
  _addChildFromBuilder(name: string, child: View): void;
128
- /** The selected option index (`Gtk.DropDown:selected`). */
129
- get selected(): number;
130
- set selected(raw: number | string);
131
145
  /** `gtk_drop_down_get_selected`. */
132
146
  get_selected(): number;
133
147
  /** `gtk_drop_down_set_selected`. */
@@ -135,12 +149,6 @@ export declare class GtkDropDown extends GtkDropDown_base {
135
149
  /** The selected option's `value`, or `''` when out of range. */
136
150
  get selectedValue(): string;
137
151
  set selectedValue(value: string);
138
- /**
139
- * The selected ITEM (`Gtk.DropDown:selected-item`) — the model's own object at
140
- * {@link selected}, read through `get_item`, so the identity comparison a `selected-item`
141
- * consumer writes holds. `null` for the sentinel and for no model. Read-only, as in GTK.
142
- */
143
- get selectedItem(): unknown;
144
152
  /** `gtk_drop_down_get_selected_item`. */
145
153
  get_selected_item(): unknown;
146
154
  /**
@@ -1,10 +1,12 @@
1
- import { Label } from '@nativescript/core';
1
+ import { Label, type EventData } from '@nativescript/core';
2
2
  import { type LabelEllipsizeMode, type LabelJustification } from '@gjsify/adwaita-core';
3
3
  import { type ConstructProps } from './construct-props.js';
4
+ /** Event name emitted when a link in the markup is tapped, before it is opened. */
5
+ export declare const ACTIVATE_LINK = "activate-link";
4
6
  declare const GtkLabel_base: ((abstract new (...args: any[]) => {
5
- addEventListener(eventName: string, callback: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown, once?: boolean): void;
6
- removeEventListener(eventName: string, callback?: (data: import("@nativescript/core").EventData) => void, thisArg?: unknown): void;
7
- connect(eventName: string, callback: (self: /*elided*/ any, data: import("@nativescript/core").EventData) => unknown): number;
7
+ addEventListener(eventName: string, callback: (data: EventData) => void, thisArg?: unknown, once?: boolean): void;
8
+ removeEventListener(eventName: string, callback?: (data: EventData) => void, thisArg?: unknown): void;
9
+ connect(eventName: string, callback: (self: /*elided*/ any, data: EventData) => unknown): number;
8
10
  disconnect(handlerId: number): void;
9
11
  emit(eventName: string, ...args: unknown[]): void;
10
12
  get_property(name: string): unknown;
@@ -59,7 +61,7 @@ declare const GtkLabel_base: ((abstract new (...args: any[]) => {
59
61
  set_focus_on_click(focusOnClick: boolean): void;
60
62
  grab_focus(): boolean;
61
63
  _emit(eventName: string): void;
62
- notify<T extends import("@nativescript/core").EventData>(data: T): void;
64
+ notify<T extends EventData>(data: T): void;
63
65
  notifyPropertyChange(name: string, value: unknown, oldValue?: unknown): void;
64
66
  set(name: string, value: unknown): void;
65
67
  get(name: string): unknown;
@@ -78,6 +80,8 @@ export declare class GtkLabel extends GtkLabel_base {
78
80
  private _xalignWritten;
79
81
  private _justify;
80
82
  private _selectable;
83
+ /** The `<a href>` of the last render — kept so a re-parse inherits `visited` by URI. */
84
+ private _links;
81
85
  constructor(props?: ConstructProps<GtkLabel>);
82
86
  /**
83
87
  * `Gtk.Label:label` — the text, as written, before markup and the mnemonic marker are
@@ -88,9 +92,8 @@ export declare class GtkLabel extends GtkLabel_base {
88
92
  /**
89
93
  * `Gtk.Label:use-markup` — whether {@link label} is Pango markup.
90
94
  *
91
- * TRUE means the markup is REDUCED to its plain text here, not rendered: see the
92
- * header. FALSE, the default, shows the string literally, so a `<` in a sentence stays
93
- * a `<`.
95
+ * TRUE means the markup is DRAWN, as styled `Span`s: see the header. FALSE, the
96
+ * default, shows the string literally, so a `<` in a sentence stays a `<`.
94
97
  */
95
98
  get useMarkup(): boolean;
96
99
  set useMarkup(raw: boolean | string);
@@ -201,5 +204,23 @@ export declare class GtkLabel extends GtkLabel_base {
201
204
  set_css_classes(names: readonly string[]): void;
202
205
  private _setClasses;
203
206
  private _render;
207
+ /**
208
+ * `emit_activate_link` for the link at `index`: the user's handlers under GTK's handled
209
+ * accumulator, then — only if none handled it — the default launch.
210
+ *
211
+ * The link becomes VISITED whenever the emission was handled, INCLUDING by a handler
212
+ * that cancelled the launch (gtklabel.c:2053, `if (handled && !link->visited)`): GTK
213
+ * reads a TRUE as "this link has been followed, my way". `Gtk.LinkButton` differs — it
214
+ * sets `visited` inside its own default handler, which a cancelling handler skips — and
215
+ * the two are not the same rule.
216
+ */
217
+ private _activateLink;
218
+ /**
219
+ * The launcher call, on its own method so a caller (or a spec) can stand in for the
220
+ * app the host would have opened — the same door `Adw.AboutDialog` uses on this
221
+ * surface, because the two must not disagree about what following a link does. A URI
222
+ * the host cannot launch is dropped, as a failed launch is.
223
+ */
224
+ protected launch(uri: string): void;
204
225
  }
205
226
  export {};
@@ -7,9 +7,8 @@ export { AdwPasswordEntryRow } from './adw-password-entry-row.js';
7
7
  export { GtkEntry, ACTIVATE as ENTRY_ACTIVATE, NOTIFY_TEXT as NOTIFY_ENTRY_TEXT } from './gtk-entry.js';
8
8
  export type { NotifyEntryTextEventData } from './gtk-entry.js';
9
9
  export { AdwComboRow, ComboState, NOTIFY_SELECTED } from './adw-combo-row.js';
10
- export type { AdwComboOption, ComboStateChange, ComboStateListener, NotifySelectedEventData } from './adw-combo-row.js';
10
+ export type { AdwComboOption, ComboStateChange, ComboStateListener } from './adw-combo-row.js';
11
11
  export { GtkDropDown, NOTIFY_SELECTED as NOTIFY_DROP_DOWN_SELECTED } from './gtk-drop-down.js';
12
- export type { NotifyDropDownSelectedEventData } from './gtk-drop-down.js';
13
12
  export { AdwSpinRow, NOTIFY_VALUE, SpinState } from './adw-spin-row.js';
14
13
  export type { NotifyValueEventData, SpinStateChange, SpinStateListener } from './adw-spin-row.js';
15
14
  export { AdwSliderRow, NOTIFY_SLIDER_VALUE } from './adw-slider-row.js';
@@ -0,0 +1,43 @@
1
+ import { FormattedString, Span } from '@nativescript/core';
2
+ import { type LabelMarkupRender, type LabelMarkupRun } from '@gjsify/adwaita-core';
3
+ /**
4
+ * One run as one `Span`.
5
+ *
6
+ * The `<span>` attributes are written FIRST and the pango tags after, so a tag wins a
7
+ * collision — the same declared order the web port states, for the same reason: the runs
8
+ * record the tags as booleans and the `<span>`s as a separate stack, so neither renderer can
9
+ * know which element was inner.
10
+ *
11
+ * `mnemonics` is `use-underline`, applied to the run's TEXT and not to the markup string:
12
+ * `gtk_label_set_markup_with_mnemonic` parses first and strips the marker out of the result,
13
+ * so an `_` inside a tag's attributes is not a mnemonic.
14
+ */
15
+ export declare function labelMarkupSpan(run: LabelMarkupRun, mnemonics: boolean, base?: number): Span;
16
+ /**
17
+ * Whether `render` needs the `FormattedString` path at all.
18
+ *
19
+ * A label whose markup is only `<markup>` around plain prose draws IDENTICALLY from
20
+ * `text`, and taking the rich path for it would move every such label onto a different
21
+ * native mechanism (an Android `SpannableStringBuilder` rather than a plain `CharSequence`)
22
+ * for no visible difference. So the predicate is "any run carries style, or there is a
23
+ * link", and a markup label that needs neither keeps the path it has always had.
24
+ *
25
+ * LOCAL TO THIS MODULE on purpose: it is a NativeScript write-path question, and a core
26
+ * helper for it would be a core function no renderer suite drives.
27
+ */
28
+ export declare function labelMarkupNeedsSpans(render: LabelMarkupRender): boolean;
29
+ /**
30
+ * `render` as a `FormattedString`, with every run inside an `<a href>` subscribed to
31
+ * `onLinkTap`.
32
+ *
33
+ * SUBSCRIBING IS WHAT MAKES A SPAN TAPPABLE: `tappable` is derived from
34
+ * `hasListeners(Span.linkTapEvent)` (`Span._setTappable`) and `setSpanModifiers` attaches
35
+ * the native `ClickableSpan` only for a tappable span, so the listener is not an extra on
36
+ * top of the link — it IS the link.
37
+ *
38
+ * A LINK WITH NO TEXT HAS NO SPAN, and cannot: `createSpannableStringBuilder` skips any
39
+ * span whose text is empty (`spanLength > 0`), so an empty `Span` would not reach the
40
+ * native text at all. The web port keeps the empty `<a>`; here the link survives only in
41
+ * the render's `links`, which is what answers `has-tooltip` and the `link` style class.
42
+ */
43
+ export declare function labelMarkupFormattedString(render: LabelMarkupRender, mnemonics: boolean, base: number | undefined, onLinkTap: (index: number) => void): FormattedString;