@gjsify/adwaita-nativescript 0.53.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/lib/esm/builder/index.js +1 -1
  2. package/lib/esm/builder/template-classes.js +1 -0
  3. package/lib/esm/capabilities.js +1 -0
  4. package/lib/esm/index.js +1 -1
  5. package/lib/esm/namespace/adw.js +1 -1
  6. package/lib/esm/namespace/gtk.js +1 -1
  7. package/lib/esm/widgets/accent-theme.js +1 -1
  8. package/lib/esm/widgets/adw-about-dialog.js +1 -1
  9. package/lib/esm/widgets/adw-accent.js +1 -1
  10. package/lib/esm/widgets/adw-alert-dialog.js +1 -1
  11. package/lib/esm/widgets/adw-application-window.js +1 -0
  12. package/lib/esm/widgets/adw-avatar.js +1 -1
  13. package/lib/esm/widgets/adw-banner.js +1 -1
  14. package/lib/esm/widgets/adw-bin.js +1 -0
  15. package/lib/esm/widgets/adw-button-content.js +1 -1
  16. package/lib/esm/widgets/adw-button-row.js +1 -1
  17. package/lib/esm/widgets/adw-combo-row.js +1 -1
  18. package/lib/esm/widgets/adw-data-grid.js +1 -1
  19. package/lib/esm/widgets/adw-dialog.js +1 -0
  20. package/lib/esm/widgets/adw-entry-row.js +1 -1
  21. package/lib/esm/widgets/adw-expander-row.js +1 -1
  22. package/lib/esm/widgets/adw-navigation-view.js +1 -1
  23. package/lib/esm/widgets/adw-slider-row.js +1 -1
  24. package/lib/esm/widgets/adw-spin-row.js +1 -1
  25. package/lib/esm/widgets/adw-spinner.js +1 -1
  26. package/lib/esm/widgets/adw-split-button.js +1 -1
  27. package/lib/esm/widgets/adw-status-page.js +1 -1
  28. package/lib/esm/widgets/adw-switch-row.js +1 -1
  29. package/lib/esm/widgets/adw-tab-view.js +1 -1
  30. package/lib/esm/widgets/adw-toast-overlay.js +1 -1
  31. package/lib/esm/widgets/adw-toggle-group.js +1 -1
  32. package/lib/esm/widgets/adw-toolbar-view.js +1 -1
  33. package/lib/esm/widgets/adw-view-stack.js +1 -1
  34. package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
  35. package/lib/esm/widgets/adw-window.js +1 -0
  36. package/lib/esm/widgets/adw-wrap-box.js +1 -1
  37. package/lib/esm/widgets/box-layout.js +1 -1
  38. package/lib/esm/widgets/breakpoint.js +1 -1
  39. package/lib/esm/widgets/grid-state.js +1 -0
  40. package/lib/esm/widgets/gtk-box.js +1 -1
  41. package/lib/esm/widgets/gtk-button.js +1 -1
  42. package/lib/esm/widgets/gtk-check-button.js +1 -0
  43. package/lib/esm/widgets/gtk-drawing-area.js +1 -0
  44. package/lib/esm/widgets/gtk-drop-down.js +1 -1
  45. package/lib/esm/widgets/gtk-entry.js +1 -1
  46. package/lib/esm/widgets/gtk-frame.js +1 -0
  47. package/lib/esm/widgets/gtk-grid.js +1 -0
  48. package/lib/esm/widgets/gtk-label.js +1 -1
  49. package/lib/esm/widgets/gtk-list-box.js +1 -0
  50. package/lib/esm/widgets/gtk-menu-button.js +1 -1
  51. package/lib/esm/widgets/gtk-overlay.js +1 -0
  52. package/lib/esm/widgets/gtk-revealer.js +1 -0
  53. package/lib/esm/widgets/gtk-scrolled-window.js +1 -0
  54. package/lib/esm/widgets/gtk-separator.js +1 -0
  55. package/lib/esm/widgets/gtk-stack.js +1 -0
  56. package/lib/esm/widgets/gtk-text-view.js +1 -0
  57. package/lib/esm/widgets/gtk-toggle-button.js +1 -0
  58. package/lib/esm/widgets/host-insets.android.js +1 -1
  59. package/lib/esm/widgets/icon-path.js +1 -1
  60. package/lib/esm/widgets/icon-theme.js +1 -1
  61. package/lib/esm/widgets/index.js +1 -1
  62. package/lib/esm/widgets/list-box-state.js +1 -0
  63. package/lib/esm/widgets/ns-length.js +1 -0
  64. package/lib/esm/widgets/revealer-state.js +1 -0
  65. package/lib/esm/widgets/row-state.js +1 -1
  66. package/lib/esm/widgets/scrolled-window-policy.js +1 -0
  67. package/lib/esm/widgets/single-child-base.js +1 -0
  68. package/lib/esm/widgets/stack-page.js +1 -0
  69. package/lib/esm/widgets/style-classes.js +1 -1
  70. package/lib/esm/widgets/styled-layout-base.js +1 -0
  71. package/lib/esm/widgets/system-bars-source.android.js +1 -0
  72. package/lib/esm/widgets/system-bars-source.ios.js +1 -0
  73. package/lib/esm/widgets/system-bars-source.js +1 -0
  74. package/lib/esm/widgets/system-bars.js +1 -0
  75. package/lib/esm/widgets/transition-type.js +1 -0
  76. package/lib/esm/widgets/view-switcher-base.js +1 -1
  77. package/lib/esm/widgets/widget-layout.js +1 -1
  78. package/lib/esm/widgets/window-base.js +1 -0
  79. package/lib/esm/widgets/window-state.js +1 -0
  80. package/lib/types/builder/index.d.ts +20 -3
  81. package/lib/types/builder/template-classes.d.ts +13 -0
  82. package/lib/types/capabilities.d.ts +2 -0
  83. package/lib/types/construct-vectors.spec.d.ts +1 -0
  84. package/lib/types/containers.spec.d.ts +2 -0
  85. package/lib/types/grid-layout.spec.d.ts +1 -0
  86. package/lib/types/grid-state.spec.d.ts +2 -0
  87. package/lib/types/gtk-box.spec.d.ts +1 -0
  88. package/lib/types/gtk-controls.spec.d.ts +1 -0
  89. package/lib/types/gtk-grid.spec.d.ts +1 -0
  90. package/lib/types/gtk-list-box.spec.d.ts +1 -0
  91. package/lib/types/gtk-stack.spec.d.ts +2 -0
  92. package/lib/types/gtk-toggle-button.spec.d.ts +2 -0
  93. package/lib/types/index.d.ts +1 -1
  94. package/lib/types/list-box-state.spec.d.ts +2 -0
  95. package/lib/types/namespace/adw.d.ts +4 -0
  96. package/lib/types/namespace/gtk.d.ts +13 -0
  97. package/lib/types/ns-length.spec.d.ts +2 -0
  98. package/lib/types/revealer-state.spec.d.ts +2 -0
  99. package/lib/types/scrolled-window-policy.spec.d.ts +2 -0
  100. package/lib/types/system-bars.spec.d.ts +2 -0
  101. package/lib/types/testing/ns-core.d.mts +44 -0
  102. package/lib/types/transition-type.spec.d.ts +2 -0
  103. package/lib/types/widget-base.spec.d.ts +1 -0
  104. package/lib/types/widgets/adw-about-dialog.d.ts +10 -0
  105. package/lib/types/widgets/adw-action-row.d.ts +10 -0
  106. package/lib/types/widgets/adw-alert-dialog.d.ts +10 -0
  107. package/lib/types/widgets/adw-application-window.d.ts +5 -0
  108. package/lib/types/widgets/adw-avatar.d.ts +10 -0
  109. package/lib/types/widgets/adw-banner.d.ts +10 -0
  110. package/lib/types/widgets/adw-bin.d.ts +7 -0
  111. package/lib/types/widgets/adw-bottom-sheet.d.ts +10 -0
  112. package/lib/types/widgets/adw-button-content.d.ts +10 -0
  113. package/lib/types/widgets/adw-carousel.d.ts +10 -0
  114. package/lib/types/widgets/adw-clamp.d.ts +10 -0
  115. package/lib/types/widgets/adw-data-grid.d.ts +10 -0
  116. package/lib/types/widgets/adw-dialog.d.ts +62 -0
  117. package/lib/types/widgets/adw-header-bar.d.ts +10 -0
  118. package/lib/types/widgets/adw-image-button.d.ts +10 -0
  119. package/lib/types/widgets/adw-navigation-page.d.ts +10 -0
  120. package/lib/types/widgets/adw-navigation-view.d.ts +10 -0
  121. package/lib/types/widgets/adw-preferences-dialog.d.ts +10 -0
  122. package/lib/types/widgets/adw-preferences-group.d.ts +10 -0
  123. package/lib/types/widgets/adw-preferences-page.d.ts +10 -0
  124. package/lib/types/widgets/adw-shortcut-label.d.ts +10 -0
  125. package/lib/types/widgets/adw-sidebar.d.ts +10 -0
  126. package/lib/types/widgets/adw-slider-row.d.ts +10 -0
  127. package/lib/types/widgets/adw-spinner.d.ts +10 -0
  128. package/lib/types/widgets/adw-split-button.d.ts +10 -0
  129. package/lib/types/widgets/adw-status-page.d.ts +10 -0
  130. package/lib/types/widgets/adw-tab-view.d.ts +10 -0
  131. package/lib/types/widgets/adw-toast-overlay.d.ts +16 -2
  132. package/lib/types/widgets/adw-toggle-group.d.ts +10 -0
  133. package/lib/types/widgets/adw-toggle.d.ts +10 -0
  134. package/lib/types/widgets/adw-toolbar-view.d.ts +21 -0
  135. package/lib/types/widgets/adw-view-stack.d.ts +23 -0
  136. package/lib/types/widgets/adw-view-switcher-bar.d.ts +10 -0
  137. package/lib/types/widgets/adw-window-title.d.ts +10 -0
  138. package/lib/types/widgets/adw-window.d.ts +5 -0
  139. package/lib/types/widgets/adw-wrap-box.d.ts +10 -0
  140. package/lib/types/widgets/box-layout.d.ts +19 -5
  141. package/lib/types/widgets/breakpoint.d.ts +7 -1
  142. package/lib/types/widgets/carousel-indicator-base.d.ts +10 -0
  143. package/lib/types/widgets/grid-state.d.ts +34 -0
  144. package/lib/types/widgets/gtk-action-bar.d.ts +10 -0
  145. package/lib/types/widgets/gtk-box.d.ts +27 -52
  146. package/lib/types/widgets/gtk-button.d.ts +20 -0
  147. package/lib/types/widgets/gtk-check-button.d.ts +51 -0
  148. package/lib/types/widgets/gtk-drawing-area.d.ts +19 -0
  149. package/lib/types/widgets/gtk-drop-down.d.ts +10 -0
  150. package/lib/types/widgets/gtk-entry.d.ts +10 -0
  151. package/lib/types/widgets/gtk-frame.d.ts +25 -0
  152. package/lib/types/widgets/gtk-grid.d.ts +57 -0
  153. package/lib/types/widgets/gtk-image.d.ts +10 -0
  154. package/lib/types/widgets/gtk-label.d.ts +10 -0
  155. package/lib/types/widgets/gtk-list-box.d.ts +73 -0
  156. package/lib/types/widgets/gtk-overlay.d.ts +17 -0
  157. package/lib/types/widgets/gtk-revealer.d.ts +30 -0
  158. package/lib/types/widgets/gtk-scrolled-window.d.ts +25 -0
  159. package/lib/types/widgets/gtk-separator.d.ts +11 -0
  160. package/lib/types/widgets/gtk-stack.d.ts +124 -0
  161. package/lib/types/widgets/gtk-text-view.d.ts +63 -0
  162. package/lib/types/widgets/gtk-toggle-button.d.ts +33 -0
  163. package/lib/types/widgets/index.d.ts +40 -2
  164. package/lib/types/widgets/list-box-state.d.ts +19 -0
  165. package/lib/types/widgets/ns-length.d.ts +10 -0
  166. package/lib/types/widgets/revealer-state.d.ts +7 -0
  167. package/lib/types/widgets/row-state.d.ts +6 -0
  168. package/lib/types/widgets/scrolled-window-policy.d.ts +17 -0
  169. package/lib/types/widgets/signals.d.ts +10 -0
  170. package/lib/types/widgets/single-child-base.d.ts +22 -0
  171. package/lib/types/widgets/split-view-base.d.ts +10 -0
  172. package/lib/types/widgets/stack-page.d.ts +93 -0
  173. package/lib/types/widgets/style-classes.d.ts +28 -0
  174. package/lib/types/widgets/styled-layout-base.d.ts +63 -0
  175. package/lib/types/widgets/system-bars-source.android.d.ts +2 -0
  176. package/lib/types/widgets/system-bars-source.d.ts +2 -0
  177. package/lib/types/widgets/system-bars-source.ios.d.ts +2 -0
  178. package/lib/types/widgets/system-bars.d.ts +71 -0
  179. package/lib/types/widgets/transition-type.d.ts +13 -0
  180. package/lib/types/widgets/view-stack-page.d.ts +10 -0
  181. package/lib/types/widgets/view-switcher-base.d.ts +10 -0
  182. package/lib/types/widgets/widget-layout.d.ts +23 -0
  183. package/lib/types/widgets/window-base.d.ts +41 -0
  184. package/lib/types/widgets/window-state.d.ts +37 -0
  185. package/lib/types/window-roots.spec.d.ts +1 -0
  186. package/lib/types/window-state.spec.d.ts +2 -0
  187. package/package.json +13 -9
  188. package/src/theme/adwaita.css +273 -40
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{declaredBuilderReferences as e,declaredBuilderSlots as t}from"../widgets/builder-slots.js";import{adw_exports as n}from"../namespace/adw.js";import{gtk_exports as r}from"../namespace/gtk.js";import{propertyOf as i}from"@gjsify/adwaita-core/tags";import{View as a}from"@nativescript/core";const o={adw:n,gtk:r};function elementFor(e){for(let[t,n]of Object.entries(o)){let r=`${t[0].toUpperCase()}${t.slice(1)}`;if(!e.startsWith(r))continue;let i=e.slice(r.length),a=n[i];if(typeof a!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${i}' — the name \`${e}\` is authored in the shared corpus and this dialect cannot spell it. Give the widget a namespace member (ADR 0034 clause 2), or ledger the block as divergent.`);if(a.name!==e)throw Error(`'${t}:${i}' resolves to class \`${a.name}\`, not \`${e}\`. The corpus is authored in GIR class names and ADR 0034 clause 1 says a widget carries that name, so a barrel member bound to another class would build the wrong widget at exit 0.`);return{xmlName:`${t}:${i}`,ctor:a}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${Object.keys(o).join(`, `)}).`)}function build(e){let t=buildTree(e);if(!(t instanceof a))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return t}function buildDialog(e){let t=buildTree(e);if(t instanceof a||typeof t.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return t}function buildTree(e){let t={ids:new Map,pending:[]},n=buildNode(e,t);for(let{view:e,element:n,prop:r,id:i}of t.pending){let a=t.ids.get(i);if(a===void 0)throw Error(`<${n.xmlName} ${r}="${i}"> names no object: nothing in this tree has the id '${i}', so \`${r}\` would be handed the string instead of the widget it refers to.`);e[r]=a}return n}function buildNode(e,t){let n=elementFor(e.tag),r=new n.ctor,i=r instanceof a?buildView(e,n,r,t):buildValue(e,n,r);for(let r of e.children??[]){let a=i;if(typeof a._addChildFromBuilder!=`function`)throw Error(`<${n.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);a._addChildFromBuilder(builderNameFor(n,e.tag,r),buildNode(r,t))}return i}function unknownProperty(e,t,n,r,i){return Error(`<${e.xmlName} ${n}="${String(i)}"> reaches nothing: \`${t}\` declares no '${r}'. NativeScript's builder assigns it anyway, as a dead own-property at exit 0, so the attribute door cannot report this and the tree would render without it.`)}function buildView(t,n,r,a){if(t.id!==void 0){if(a.ids.has(t.id))throw Error(`Two nodes of this tree carry the id '${t.id}'; GtkBuilder refuses a duplicate id.`);a.ids.set(t.id,r),r.id=t.id}let o=e(n.ctor);for(let[e,s]of Object.entries(t.props??{})){let c=i(e);if(!(c in r))throw unknownProperty(n,t.tag,e,c,s);if(o.includes(c)){a.pending.push({view:r,element:n,prop:c,id:String(s)});continue}r[c]=String(s)}if(t.styleClasses!==void 0&&t.styleClasses.length>0){if(!(`styleClasses`in r))throw Error(`<${n.xmlName}> takes no style classes: \`${t.tag}\` declares no 'styleClasses', so [${t.styleClasses.join(`, `)}] would be dropped.`);r.styleClasses=t.styleClasses.join(` `)}if(t.extensions?.strings!==void 0)throw Error(`<${n.xmlName}> takes no string-list items: \`${t.tag}\` is a widget, and only a list model holds them, so [${t.extensions.strings.map(e=>e.value).join(`, `)}] would be dropped.`);return applyResponses(r,n,t),r}function buildValue(e,t,n){if(e.id!==void 0)throw Error(`<${t.xmlName} id="${e.id}"> reaches nothing: \`${e.tag}\` is not a view, and \`getViewById\` walks views, so code beside the \`.blp\` could never look it up.`);if(e.styleClasses!==void 0&&e.styleClasses.length>0)throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` is not a widget, so [${e.styleClasses.join(`, `)}] would be dropped.`);let r={};for(let[a,o]of Object.entries(e.props??{})){let s=i(a);if(!(s in n))throw unknownProperty(t,e.tag,a,s,o);r[s]=o}let a=e.extensions?.strings;if(a!==void 0){if(typeof n.append!=`function`)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` has no \`append\`, so [${a.map(e=>e.value).join(`, `)}] would be dropped.`);r.strings=a.map(e=>e.value)}let o=new t.ctor(r);return applyResponses(o,t,e),o}function applyResponses(e,t,n){let r=e,i=n.extensions?.responses;if(i!==void 0){if(typeof r.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${i.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:a}of i)r.add_response(e,t,{...n===void 0?{}:{appearance:n},...a===void 0?{}:{enabled:a}})}}function builderNameFor(e,n,r){let i=elementFor(r.tag);if(r.slot===void 0)return i.xmlName;let a=r.slot,o=t(e.ctor);if(o===null||!o.includes(a))throw Error(`<${e.xmlName}.${a}> reaches nothing: \`${n}\` declares no such builder slot, so NativeScript would hand <${i.xmlName}> to its fallback placement instead — at exit 0, in a cell the tree never asked for. Known slots: ${o===null||o.length===0?`none`:o.join(`, `)}.`);return a}export{build,buildDialog,elementFor};
1
+ import"../_virtual/_rolldown/runtime.js";import{capabilities as e}from"../capabilities.js";import{observeViewSize as t}from"../widgets/breakpoint.js";import{declaredBuilderReferences as n,declaredBuilderSlots as r}from"../widgets/builder-slots.js";import{registerTemplateClass as i,templateClassFor as a}from"./template-classes.js";import{adw_exports as o}from"../namespace/adw.js";import{gtk_exports as s}from"../namespace/gtk.js";import{createBreakpointDriver as c,parseBreakpointCondition as l}from"@gjsify/adwaita-core";import{assertTreeConstructs as u}from"@gjsify/adwaita-core/conformance";import{propertyOf as d}from"@gjsify/adwaita-core/tags";import{View as f}from"@nativescript/core";const p={adw:o,gtk:s};function elementFor(e){for(let[t,n]of Object.entries(p)){let r=`${t[0].toUpperCase()}${t.slice(1)}`;if(!e.startsWith(r))continue;let i=e.slice(r.length),a=n[i];if(typeof a!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${i}' — the name \`${e}\` is authored in the shared corpus and this dialect cannot spell it. Give the widget a namespace member (ADR 0034 clause 2), or ledger the block as divergent.`);if(a.name!==e)throw Error(`'${t}:${i}' resolves to class \`${a.name}\`, not \`${e}\`. The corpus is authored in GIR class names and ADR 0034 clause 1 says a widget carries that name, so a barrel member bound to another class would build the wrong widget at exit 0.`);return{xmlName:`${t}:${i}`,ctor:a}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${Object.keys(p).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:a(e.tag)}:elementFor(e.tag)}function build(e,t={}){let n=buildTree(e,t);if(!(n instanceof f))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return n}function buildDialog(e,t={}){let n=buildTree(e,t);if(n instanceof f||typeof n.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return n}function buildTree(n,r){u(`adwaita-nativescript`,e,n);let i={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,scope:r.scope},a=buildNode(n,i);for(let{view:e,element:t,prop:n,id:r}of i.pending){let a=i.ids.get(r);if(a===void 0)throw Error(`<${t.xmlName} ${n}="${r}"> names no object: nothing in this tree has the id '${r}', so \`${n}\` would be handed the string instead of the widget it refers to.`);e[n]=a}for(let e of i.binds)bindProperty(e,i);for(let e of i.breakpointHosts)bindBreakpoints(e,i);return a}function bindProperty(e,t){let{target:n,element:r,property:i,source:a,sourceProperty:o,flags:s}=e,c=`<${r.xmlName}> \`${i}: bind ${a}.${o}\``,l=t.ids.get(a);if(l===void 0)throw Error(`${c} names no object: nothing in this tree has the id '${a}'.`);if(s.length>0)throw Error(`${c} carries ${s.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let u=d(o),f=d(i),p=l.constructor.emittedSignals??[],m=`notify::${o}`;if(!(u in l)||!p.includes(m))throw Error(`${c}: ${l.constructor.name} does not emit '${m}', so the target would follow the source once and never again. It emits: ${p.join(`, `)||`none`}.`);if(!(f in n))throw Error(`${c}: the target has no property '${f}'.`);let follow=()=>{n[f]=l[u]};follow(),l.connect(m,follow)}function bindBreakpoints({view:e,element:t,node:n},r){if(!(e instanceof f))throw Error(`<${t.xmlName}> is not a view, so it has no size for a breakpoint to read.`);wireBreakpoints(t.xmlName,e,n.breakpoints??[],r.ids,r.observeSize)}function applyBreakpoints(e,n,r,i={}){wireBreakpoints(e.constructor.name,e,n,new Map(Object.entries(r)),i.observeSize??t)}function wireBreakpoints(e,t,n,r,i){let a=c(n.map(t=>{if(l(t.condition)===null)throw Error(`<${e}> \`condition ("${t.condition}")\` is not an Adwaita breakpoint condition.`);return{condition:t.condition,setters:t.setters.map(t=>{let n=r.get(t.object),i=`<${e}> breakpoint setter \`${t.object}.${t.property}\``;if(n===void 0)throw Error(`${i} names no object: nothing in this tree has the id '${t.object}'.`);if(!(d(t.property)in n))throw Error(`${i}: the target declares no '${d(t.property)}'.`);return{object:n,property:t.property,value:{authored:t.value}}})}}),{read:(e,t)=>({original:e[d(t)]}),write(e,t,n){let r=n;e[d(t)]=`authored`in r?String(r.authored):r.original}});i(t,e=>a.evaluate(e))}function buildNode(e,t){let n=elementOf(e),r=new n.ctor,i=r instanceof f?buildView(e,n,r,t):buildValue(e,n,r);bindSignals(i,n,e,t);for(let[r,a]of Object.entries(e.bindings??{}))t.binds.push({target:i,element:n,property:r,source:a.source,sourceProperty:a.property,flags:a.flags??[]});e.breakpoints!==void 0&&t.breakpointHosts.push({view:i,element:n,node:e});for(let r of e.children??[]){let a=i;if(typeof a._addChildFromBuilder!=`function`)throw Error(`<${n.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);let o=buildNode(r,t);applyLayout(r,o,n,e.tag),a._addChildFromBuilder(builderNameFor(n,e.tag,r),o)}return i}function bindSignals(e,t,n,r){if(n.signals===void 0)return;let i=t.ctor.emittedSignals??[],a=e;for(let e of n.signals){let n=e.detail===void 0?e.name:`${e.name}::${e.detail}`;if(typeof a.connect!=`function`||!i.includes(n))throw Error(`<${t.xmlName}> declares no signal '${n}', so the handler '${e.handler}' would never run. It emits: ${i.join(`, `)||`none`}.`);if(e.object!==void 0||(e.flags?.length??0)>0)throw Error(`the handler '${e.handler}' for '${n}' uses ${e.object===void 0?``:`an object `}${(e.flags??[]).join(`, `)}: adwaita-nativescript binds plain handlers only until each of those is verified against GTK.`);let o=r.scope?.[e.handler];if(typeof o!=`function`)throw Error(`the tree binds the handler '${e.handler}' for '${n}', and the scope ${r.scope===void 0?"was not given (pass `scope`)":`has no such function`}.`);a.connect(n,(...e)=>o.apply(r.scope,e))}}const m={row:`row`,column:`column`,"row-span":`rowSpan`,"column-span":`columnSpan`};function applyLayout(e,t,n,r){if(e.layout!==void 0){if(typeof n.ctor.prototype.attach!=`function`)throw Error(`<${elementOf(e).xmlName}> authored layout (${Object.keys(e.layout).join(`, `)}) under \`${r}\`, which has no \`attach\`: this port's only layout manager is the grid, so the placement would be dropped.`);if(!(t instanceof f))throw Error(`\`${e.tag}\` is not a view, so it has no cell to place.`);for(let[n,r]of Object.entries(e.layout)){let i=m[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(m).join(`, `)}.`);if(typeof r!=`number`||!Number.isInteger(r))throw Error(`layout \`${n}: ${String(r)}\` on \`${e.tag}\` is not a whole number.`);t[i]=r}}}function unknownProperty(e,t,n,r,i){return Error(`<${e.xmlName} ${n}="${String(i)}"> reaches nothing: \`${t}\` declares no '${r}'. NativeScript's builder assigns it anyway, as a dead own-property at exit 0, so the attribute door cannot report this and the tree would render without it.`)}function buildView(e,t,r,i){if(e.page!==void 0)throw Error(`<${t.xmlName}> is a page (${JSON.stringify(e.page)}), and adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch.`);if(e.id!==void 0){if(i.ids.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);i.ids.set(e.id,r),r.id=e.id}let a=n(t.ctor);for(let[n,o]of Object.entries(e.props??{})){let s=d(n);if(!(s in r))throw unknownProperty(t,e.tag,n,s,o);if(a.includes(s)){i.pending.push({view:r,element:t,prop:s,id:String(o)});continue}r[s]=String(o)}if(e.styleClasses!==void 0&&e.styleClasses.length>0){if(!(`styleClasses`in r))throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` declares no 'styleClasses', so [${e.styleClasses.join(`, `)}] would be dropped.`);r.styleClasses=e.styleClasses.join(` `)}if(e.extensions?.strings!==void 0)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` is a widget, and only a list model holds them, so [${e.extensions.strings.map(e=>e.value).join(`, `)}] would be dropped.`);return applyResponses(r,t,e),r}function buildValue(e,t,n){if(e.id!==void 0)throw Error(`<${t.xmlName} id="${e.id}"> reaches nothing: \`${e.tag}\` is not a view, and \`getViewById\` walks views, so code beside the \`.blp\` could never look it up.`);if(e.styleClasses!==void 0&&e.styleClasses.length>0)throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` is not a widget, so [${e.styleClasses.join(`, `)}] would be dropped.`);let r={};for(let[i,a]of Object.entries(e.props??{})){let o=d(i);if(!(o in n))throw unknownProperty(t,e.tag,i,o,a);r[o]=a}let i=e.extensions?.strings;if(i!==void 0){if(typeof n.append!=`function`)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` has no \`append\`, so [${i.map(e=>e.value).join(`, `)}] would be dropped.`);r.strings=i.map(e=>e.value)}let a=new t.ctor(r);return applyResponses(a,t,e),a}function applyResponses(e,t,n){let r=e,i=n.extensions?.responses;if(i!==void 0){if(typeof r.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${i.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:a}of i)r.add_response(e,t,{...n===void 0?{}:{appearance:n},...a===void 0?{}:{enabled:a}})}}function builderNameFor(e,t,n){let i=elementOf(n);if(n.slot===void 0)return i.xmlName;let a=n.slot,o=r(e.ctor);if(o===null||!o.includes(a))throw Error(`<${e.xmlName}.${a}> reaches nothing: \`${t}\` declares no such builder slot, so NativeScript would hand <${i.xmlName}> to its fallback placement instead — at exit 0, in a cell the tree never asked for. Known slots: ${o===null||o.length===0?`none`:o.join(`, `)}.`);return a}export{applyBreakpoints,build,buildDialog,elementFor,i as registerTemplateClass};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";const e=new Map;function registerTemplateClass(t,n){let r=e.get(t);if(r!==void 0&&r!==n)throw Error(`the template class '${t}' is already registered as another class.`);e.set(t,n)}function templateClassFor(t){let n=e.get(t);if(n===void 0)throw Error(`the tree uses the class '$${t}', which no registerTemplateClass() call registered: adwaita-nativescript cannot build a class it does not know.`);return n}export{registerTemplateClass,templateClassFor};
@@ -0,0 +1 @@
1
+ const e={layout:`implemented`,strings:`implemented`,responses:`implemented`,page:{refused:`adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch`},extern:`implemented`,signal:`implemented`,bind:`implemented`,breakpoint:`implemented`};export{e as capabilities};
package/lib/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.js";import{GTK_ALIGN as ee}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as te,GTK_ICON_SIZE_NICKS as ne,GTK_ICON_SIZE_PIXELS as e,PIXEL_SIZE_UNSET as t,isGtkIconSizeNick as n}from"./widgets/gtk-icon-size.js";import{applyConstructProps as r,nsAlignment as i}from"./widgets/construct-props.js";import{CLOSED as a}from"./widgets/adw-about-dialog.js";import{ACTIVATED as o}from"./widgets/adw-action-row.js";import{AdwAlertResponses as s,NOTIFY_RESPONSE as c}from"./widgets/adw-alert-dialog.js";import{avatarInitials as l}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as u}from"./widgets/avatar-view.js";import{adwaitaColorScheme as d,isThemeIconColor as f,onAdwaitaColorSchemeChanged as p,setAdwaitaColorScheme as m,themeIconColor as h,toggleAdwaitaColorScheme as g}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as _,DEFAULT_ICON_COLOR as v,DEFAULT_ICON_COLOR_DARK as y,extractIconPaths as b,extractPathData as x}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as S,compiledIconNames as C,iconValueKind as w,isIconAvailable as T,registerIcon as E,registeredIconNames as D,resolveIconSource as O,unregisterIcon as k}from"./widgets/icon-theme.js";import{renderSymbolicIcon as A}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as j}from"./widgets/gtk-image.js";import{DEFAULT_AVATAR_SIZE as M}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as N,DEFAULT_SPINNER_SIZE as P}from"./widgets/chrome.js";import{BUTTON_CLICKED as F}from"./widgets/adw-banner.js";import{NOTIFY_OPEN as I}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as L}from"./widgets/row-press.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as R}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as z}from"./widgets/adw-carousel.js";import{ComboState as B,NOTIFY_SELECTED as V}from"./widgets/adw-combo-row.js";import{AdwImageButton as H,DEFAULT_ICON_BUTTON_ICON_SIZE as U}from"./widgets/adw-image-button.js";import{NOTIFY_TEXT as W}from"./widgets/adw-entry-row.js";import{ExpanderState as G,NOTIFY_EXPANDED as K}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as q}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as J,NOTIFY_SELECTED as Y}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as X,NsOverlaySplitViewState as Z,splitViewColumns as re}from"./widgets/split-view-state.js";import{AdwSplitViewBase as ie,NOTIFY_SHOW_SIDEBAR as ae}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as oe}from"./widgets/navigation-stack.js";import{CLOSED as se}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ce,SHORTCUT_LABEL_CLASS as le,SHORTCUT_LABEL_DIMMED_CLASS as ue,SHORTCUT_LABEL_DISABLED_CLASS as de,SHORTCUT_LABEL_KEYCAP_CLASS as fe,SHORTCUT_LABEL_KEYS_CLASS as pe,SHORTCUT_LABEL_SIDE_CLASS as me,SHORTCUT_LABEL_SPACED_CLASS as he,shortcutLabelDirection as ge,shortcutLabelPlatform as _e,shortcutLabelRenderPlan as ve}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as ye}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Q,SpinState as be}from"./widgets/adw-spin-row.js";import{CLICKED as xe,MENU_TAPPED as Se}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Ce}from"./widgets/adw-switch-row.js";import{AdwToast as we,AdwToastQueue as Te,DEFAULT_TOAST_TIMEOUT as Ee,TOAST_BUTTON_CLICKED as De}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as Oe,ToggleGroupState as ke}from"./widgets/adw-toggle-group.js";import{adw_exports as Ae}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as je,boxChildMargin as Me,boxSpacingChanges as Ne,normalizeBoxSpacing as Pe}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as Fe,buttonSlotDetaches as Ie}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as Le,GTK_BUTTON_LABEL_CLASS as Re}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ze}from"./widgets/gtk-drop-down.js";import{ACTIVATE as Be,NOTIFY_TEXT as Ve}from"./widgets/gtk-entry.js";import{MENU_ITEM_ACTIVATED as He}from"./widgets/gtk-menu-button.js";import{gtk_exports as Ue}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as We,ADWAITA_SANS_TTF_FILES as Ge,adwaitaFontInstallInstructions as Ke,hasAdwaitaSans as qe}from"./fonts.js";import{AdwSliderRow as Je,NOTIFY_SLIDER_VALUE as Ye}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Xe,DATA_GRID_HEADER_ROW_CLASS as Ze,DATA_GRID_SECTION_CELL_CLASS as Qe,dataGridCellClass as $e,dataGridItemSpec as et,dataGridRowClass as tt,dataGridShapeKey as nt,dataGridTracksKey as rt,parseDataGridWidth as it}from"./widgets/data-grid-model.js";import{AdwDataGrid as at,ROW_ACTIVATED as ot}from"./widgets/adw-data-grid.js";import{ADWAITA_NS_ACCENT_RULES as st,adwaitaNsAccentColor as ct,adwaitaNsAccentCss as lt}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as ut,clearAdwaitaNsAccent as dt}from"./widgets/adw-accent.js";import{AdwBreakpoint as ft,addBreakpoints as pt,evaluateBreakpointCondition as mt,parseBreakpointCondition as ht}from"./widgets/breakpoint.js";import{labelDisplayText as gt,labelMarkupIsUnparseable as _t,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as vt}from"./namespace/gio.js";import{assertNativeScript as yt,assertNativeScript as bt,isAndroid as xt,isIOS as St,isNativeScript as Ct}from"@gjsify/native-platform";function registerAdwaita(){bt(),$()}export{a as ABOUT_CLOSED,o as ACTIVATED,_ as ADWAITA_ICON_GRID,st as ADWAITA_NS_ACCENT_RULES,We as ADWAITA_SANS_FONT_FAMILY,Ge as ADWAITA_SANS_TTF_FILES,u as AVATAR_DEFAULT_ICON,Ae as Adw,s as AdwAlertResponses,ft as AdwBreakpoint,at as AdwDataGrid,H as AdwImageButton,Je as AdwSliderRow,ie as AdwSplitViewBase,we as AdwToast,Te as AdwToastQueue,J as AdwViewSwitcherBase,F as BUTTON_CLICKED,xe as CLICKED,B as ComboState,Xe as DATA_GRID_HEADER_CELL_CLASS,Ze as DATA_GRID_HEADER_ROW_CLASS,Qe as DATA_GRID_SECTION_CELL_CLASS,M as DEFAULT_AVATAR_SIZE,je as DEFAULT_BOX_SPACING,R as DEFAULT_CAROUSEL_PAGE_WIDTH,N as DEFAULT_CLAMP_MAX_SIZE,j as DEFAULT_GTK_IMAGE_SIZE,U as DEFAULT_ICON_BUTTON_ICON_SIZE,v as DEFAULT_ICON_COLOR,y as DEFAULT_ICON_COLOR_DARK,te as DEFAULT_ICON_PIXEL_SIZE,P as DEFAULT_SPINNER_SIZE,Ee as DEFAULT_TOAST_TIMEOUT,Be as ENTRY_ACTIVATE,G as ExpanderState,ee as GTK_ALIGN,Le as GTK_BUTTON_CLICKED,Re as GTK_BUTTON_LABEL_CLASS,ne as GTK_ICON_SIZE_NICKS,e as GTK_ICON_SIZE_PIXELS,vt as Gio,Ue as Gtk,S as ICON_FALLBACK_NAME,He as MENU_ITEM_ACTIVATED,Se as MENU_TAPPED,Ce as NOTIFY_ACTIVE,ze as NOTIFY_DROP_DOWN_SELECTED,Ve as NOTIFY_ENTRY_TEXT,K as NOTIFY_EXPANDED,I as NOTIFY_OPEN,z as NOTIFY_POSITION,c as NOTIFY_RESPONSE,V as NOTIFY_SELECTED,ae as NOTIFY_SHOW_SIDEBAR,ye as NOTIFY_SIDEBAR_SELECTED,Ye as NOTIFY_SLIDER_VALUE,W as NOTIFY_TEXT,Oe as NOTIFY_TOGGLE_SELECTED,Q as NOTIFY_VALUE,Y as NOTIFY_VIEW_SELECTED,q as NOTIFY_VISIBLE_CHILD,oe as NOTIFY_VISIBLE_PAGE,X as NsNavigationSplitViewState,Z as NsOverlaySplitViewState,t as PIXEL_SIZE_UNSET,se as PREFERENCES_CLOSED,ot as ROW_ACTIVATED,ce as SHORTCUT_LABEL_CAP_TEXT_CLASS,le as SHORTCUT_LABEL_CLASS,ue as SHORTCUT_LABEL_DIMMED_CLASS,de as SHORTCUT_LABEL_DISABLED_CLASS,fe as SHORTCUT_LABEL_KEYCAP_CLASS,pe as SHORTCUT_LABEL_KEYS_CLASS,me as SHORTCUT_LABEL_SIDE_CLASS,he as SHORTCUT_LABEL_SPACED_CLASS,be as SpinState,De as TOAST_BUTTON_CLICKED,ke as ToggleGroupState,pt as addBreakpoints,d as adwaitaColorScheme,Ke as adwaitaFontInstallInstructions,ct as adwaitaNsAccentColor,lt as adwaitaNsAccentCss,ut as applyAdwaitaNsAccent,r as applyConstructProps,yt as assertNativeScript,L as attachRowPressFeedback,l as avatarInitials,Me as boxChildMargin,Ne as boxSpacingChanges,Fe as buttonSlotAfterWrite,Ie as buttonSlotDetaches,dt as clearAdwaitaNsAccent,C as compiledIconNames,$e as dataGridCellClass,et as dataGridItemSpec,tt as dataGridRowClass,nt as dataGridShapeKey,rt as dataGridTracksKey,mt as evaluateBreakpointCondition,b as extractIconPaths,x as extractPathData,qe as hasAdwaitaSans,w as iconValueKind,xt as isAndroid,n as isGtkIconSizeNick,St as isIOS,T as isIconAvailable,Ct as isNativeScript,f as isThemeIconColor,gt as labelDisplayText,_t as labelMarkupIsUnparseable,Pe as normalizeBoxSpacing,i as nsAlignment,p as onAdwaitaColorSchemeChanged,ht as parseBreakpointCondition,it as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,E as registerIcon,D as registeredIconNames,A as renderSymbolicIcon,O as resolveIconSource,m as setAdwaitaColorScheme,ge as shortcutLabelDirection,_e as shortcutLabelPlatform,ve as shortcutLabelRenderPlan,re as splitViewColumns,h as themeIconColor,g as toggleAdwaitaColorScheme,k as unregisterIcon};
1
+ import"./_virtual/_rolldown/runtime.js";import{AdwBreakpoint as ee,addBreakpoints as te,evaluateBreakpointCondition as ne,observeViewSize as e,parseBreakpointCondition as t}from"./widgets/breakpoint.js";import{GTK_ALIGN as n}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as r,GTK_ICON_SIZE_NICKS as i,GTK_ICON_SIZE_PIXELS as a,PIXEL_SIZE_UNSET as o,isGtkIconSizeNick as s}from"./widgets/gtk-icon-size.js";import{applyConstructProps as c,nsAlignment as l}from"./widgets/construct-props.js";import{NOTIFY_HEXPAND as u,NOTIFY_VEXPAND as d}from"./widgets/widget-layout.js";import{CLOSED as f}from"./widgets/adw-about-dialog.js";import{ACTIVATED as p}from"./widgets/adw-action-row.js";import{AdwAlertResponses as m,NOTIFY_RESPONSE as h}from"./widgets/adw-alert-dialog.js";import{avatarInitials as g}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as _}from"./widgets/avatar-view.js";import{adwaitaColorScheme as v,isThemeIconColor as y,onAdwaitaColorSchemeChanged as b,setAdwaitaColorScheme as x,themeIconColor as S,toggleAdwaitaColorScheme as C}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as w,DEFAULT_ICON_COLOR as T,DEFAULT_ICON_COLOR_DARK as E,extractIconPaths as D,extractPathData as O}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as k,compiledIconNames as A,iconValueKind as j,isIconAvailable as M,registerIcon as N,registeredIconNames as P,resolveIconSource as F,unregisterIcon as I}from"./widgets/icon-theme.js";import{renderSymbolicIcon as L}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as R}from"./widgets/gtk-image.js";import{DEFAULT_AVATAR_SIZE as z}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as B,DEFAULT_SPINNER_SIZE as V}from"./widgets/chrome.js";import{BUTTON_CLICKED as H}from"./widgets/adw-banner.js";import{NOTIFY_OPEN as U}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as W}from"./widgets/row-press.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as G}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as K}from"./widgets/adw-carousel.js";import{ComboState as q,NOTIFY_SELECTED as J}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as Y,ADW_DIALOG_CLOSE_ATTEMPT as X}from"./widgets/adw-dialog.js";import{AdwImageButton as Z,DEFAULT_ICON_BUTTON_ICON_SIZE as re}from"./widgets/adw-image-button.js";import{NOTIFY_TEXT as ie}from"./widgets/adw-entry-row.js";import{ExpanderState as ae,NOTIFY_EXPANDED as oe}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as se}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as ce,NOTIFY_SELECTED as le}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as ue,NsOverlaySplitViewState as de,splitViewColumns as fe}from"./widgets/split-view-state.js";import{AdwSplitViewBase as pe,NOTIFY_SHOW_SIDEBAR as me}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as he}from"./widgets/navigation-stack.js";import{CLOSED as ge}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as _e,SHORTCUT_LABEL_CLASS as ve,SHORTCUT_LABEL_DIMMED_CLASS as ye,SHORTCUT_LABEL_DISABLED_CLASS as be,SHORTCUT_LABEL_KEYCAP_CLASS as xe,SHORTCUT_LABEL_KEYS_CLASS as Se,SHORTCUT_LABEL_SIDE_CLASS as Ce,SHORTCUT_LABEL_SPACED_CLASS as we,shortcutLabelDirection as Te,shortcutLabelPlatform as Ee,shortcutLabelRenderPlan as De}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Oe}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as ke,SpinState as Ae}from"./widgets/adw-spin-row.js";import{CLICKED as je,MENU_TAPPED as Q}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Me}from"./widgets/adw-switch-row.js";import{AdwToast as Ne,AdwToastQueue as Pe,DEFAULT_TOAST_TIMEOUT as Fe,TOAST_BUTTON_CLICKED as Ie}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as Le,ToggleGroupState as Re}from"./widgets/adw-toggle-group.js";import{adw_exports as ze}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as Be,boxChildTrack as Ve,boxSpacingChanges as He,boxTrackPlan as Ue,normalizeBoxSpacing as We}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as Ge,buttonSlotDetaches as Ke}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as qe,GTK_BUTTON_LABEL_CLASS as Je}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as Ye}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as Xe,GTK_CHECK_BUTTON_CHECKED_CLASS as Ze,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as Qe,GTK_CHECK_BUTTON_TOGGLED as $e,NOTIFY_CHECK_ACTIVE as et}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as tt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as nt,NOTIFY_TEXT as rt}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as it,LIST_BOX_ROW_SELECTED as at}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as ot}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as st}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as ct,NOTIFY_STACK_VISIBLE_CHILD_NAME as lt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as ut,NOTIFY_TEXT_VIEW_TEXT as dt}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as ft,GTK_TOGGLE_BUTTON_TOGGLED as pt,NOTIFY_TOGGLE_ACTIVE as mt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as ht}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as gt,ADWAITA_SANS_TTF_FILES as _t,adwaitaFontInstallInstructions as vt,hasAdwaitaSans as yt}from"./fonts.js";import{AdwSliderRow as bt,NOTIFY_SLIDER_VALUE as xt}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as St,DATA_GRID_HEADER_ROW_CLASS as Ct,DATA_GRID_SECTION_CELL_CLASS as wt,dataGridCellClass as Tt,dataGridItemSpec as Et,dataGridRowClass as Dt,dataGridShapeKey as Ot,dataGridTracksKey as kt,parseDataGridWidth as At}from"./widgets/data-grid-model.js";import{AdwDataGrid as jt,ROW_ACTIVATED as Mt}from"./widgets/adw-data-grid.js";import{ADWAITA_NS_ACCENT_RULES as Nt,adwaitaNsAccentColor as Pt,adwaitaNsAccentCss as Ft}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as It,clearAdwaitaNsAccent as Lt}from"./widgets/adw-accent.js";import{labelDisplayText as Rt,labelMarkupIsUnparseable as zt,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as Bt}from"./namespace/gio.js";import{assertNativeScript as Vt,assertNativeScript as Ht,isAndroid as Ut,isIOS as Wt,isNativeScript as Gt}from"@gjsify/native-platform";function registerAdwaita(){Ht(),$()}export{f as ABOUT_CLOSED,p as ACTIVATED,w as ADWAITA_ICON_GRID,Nt as ADWAITA_NS_ACCENT_RULES,gt as ADWAITA_SANS_FONT_FAMILY,_t as ADWAITA_SANS_TTF_FILES,Y as ADW_DIALOG_CLOSED,X as ADW_DIALOG_CLOSE_ATTEMPT,_ as AVATAR_DEFAULT_ICON,ze as Adw,m as AdwAlertResponses,ee as AdwBreakpoint,jt as AdwDataGrid,Z as AdwImageButton,bt as AdwSliderRow,pe as AdwSplitViewBase,Ne as AdwToast,Pe as AdwToastQueue,ce as AdwViewSwitcherBase,H as BUTTON_CLICKED,je as CLICKED,q as ComboState,St as DATA_GRID_HEADER_CELL_CLASS,Ct as DATA_GRID_HEADER_ROW_CLASS,wt as DATA_GRID_SECTION_CELL_CLASS,z as DEFAULT_AVATAR_SIZE,Be as DEFAULT_BOX_SPACING,G as DEFAULT_CAROUSEL_PAGE_WIDTH,B as DEFAULT_CLAMP_MAX_SIZE,R as DEFAULT_GTK_IMAGE_SIZE,re as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,r as DEFAULT_ICON_PIXEL_SIZE,V as DEFAULT_SPINNER_SIZE,Fe as DEFAULT_TOAST_TIMEOUT,tt as DRAWING_AREA_REFUSAL,nt as ENTRY_ACTIVATE,ae as ExpanderState,n as GTK_ALIGN,qe as GTK_BUTTON_CLICKED,Je as GTK_BUTTON_LABEL_CLASS,Xe as GTK_CHECK_BUTTON_ACTIVATE,Ze as GTK_CHECK_BUTTON_CHECKED_CLASS,Qe as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,$e as GTK_CHECK_BUTTON_TOGGLED,i as GTK_ICON_SIZE_NICKS,a as GTK_ICON_SIZE_PIXELS,ft as GTK_TOGGLE_BUTTON_CHECKED_CLASS,pt as GTK_TOGGLE_BUTTON_TOGGLED,ut as GTK_WRAP_MODES,Bt as Gio,ht as Gtk,k as ICON_FALLBACK_NAME,it as LIST_BOX_ROW_ACTIVATED,at as LIST_BOX_ROW_SELECTED,ot as MENU_ITEM_ACTIVATED,Q as MENU_TAPPED,Me as NOTIFY_ACTIVE,et as NOTIFY_CHECK_ACTIVE,Ye as NOTIFY_DROP_DOWN_SELECTED,rt as NOTIFY_ENTRY_TEXT,oe as NOTIFY_EXPANDED,u as NOTIFY_HEXPAND,U as NOTIFY_OPEN,K as NOTIFY_POSITION,h as NOTIFY_RESPONSE,st as NOTIFY_REVEAL_CHILD,J as NOTIFY_SELECTED,me as NOTIFY_SHOW_SIDEBAR,Oe as NOTIFY_SIDEBAR_SELECTED,xt as NOTIFY_SLIDER_VALUE,ct as NOTIFY_STACK_VISIBLE_CHILD,lt as NOTIFY_STACK_VISIBLE_CHILD_NAME,ie as NOTIFY_TEXT,dt as NOTIFY_TEXT_VIEW_TEXT,mt as NOTIFY_TOGGLE_ACTIVE,Le as NOTIFY_TOGGLE_SELECTED,ke as NOTIFY_VALUE,d as NOTIFY_VEXPAND,le as NOTIFY_VIEW_SELECTED,se as NOTIFY_VISIBLE_CHILD,he as NOTIFY_VISIBLE_PAGE,ue as NsNavigationSplitViewState,de as NsOverlaySplitViewState,o as PIXEL_SIZE_UNSET,ge as PREFERENCES_CLOSED,Mt as ROW_ACTIVATED,_e as SHORTCUT_LABEL_CAP_TEXT_CLASS,ve as SHORTCUT_LABEL_CLASS,ye as SHORTCUT_LABEL_DIMMED_CLASS,be as SHORTCUT_LABEL_DISABLED_CLASS,xe as SHORTCUT_LABEL_KEYCAP_CLASS,Se as SHORTCUT_LABEL_KEYS_CLASS,Ce as SHORTCUT_LABEL_SIDE_CLASS,we as SHORTCUT_LABEL_SPACED_CLASS,Ae as SpinState,Ie as TOAST_BUTTON_CLICKED,Re as ToggleGroupState,te as addBreakpoints,v as adwaitaColorScheme,vt as adwaitaFontInstallInstructions,Pt as adwaitaNsAccentColor,Ft as adwaitaNsAccentCss,It as applyAdwaitaNsAccent,c as applyConstructProps,Vt as assertNativeScript,W as attachRowPressFeedback,g as avatarInitials,Ve as boxChildTrack,He as boxSpacingChanges,Ue as boxTrackPlan,Ge as buttonSlotAfterWrite,Ke as buttonSlotDetaches,Lt as clearAdwaitaNsAccent,A as compiledIconNames,Tt as dataGridCellClass,Et as dataGridItemSpec,Dt as dataGridRowClass,Ot as dataGridShapeKey,kt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,yt as hasAdwaitaSans,j as iconValueKind,Ut as isAndroid,s as isGtkIconSizeNick,Wt as isIOS,M as isIconAvailable,Gt as isNativeScript,y as isThemeIconColor,Rt as labelDisplayText,zt as labelMarkupIsUnparseable,We as normalizeBoxSpacing,l as nsAlignment,e as observeViewSize,b as onAdwaitaColorSchemeChanged,t as parseBreakpointCondition,At as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,N as registerIcon,P as registeredIconNames,L as renderSymbolicIcon,F as resolveIconSource,x as setAdwaitaColorScheme,Te as shortcutLabelDirection,Ee as shortcutLabelPlatform,De as shortcutLabelRenderPlan,fe as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,I as unregisterIcon};
@@ -1 +1 @@
1
- import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{AdwAboutDialog as t}from"../widgets/adw-about-dialog.js";import{AdwActionRow as n}from"../widgets/adw-action-row.js";import{AdwAlertDialog as r}from"../widgets/adw-alert-dialog.js";import{AdwAvatar as i}from"../widgets/adw-avatar.js";import{AdwBanner as a}from"../widgets/adw-banner.js";import{AdwBottomSheet as o}from"../widgets/adw-bottom-sheet.js";import{AdwButtonContent as s}from"../widgets/adw-button-content.js";import{AdwButtonRow as c}from"../widgets/adw-button-row.js";import{AdwCarousel as l}from"../widgets/adw-carousel.js";import{AdwCarouselIndicatorDots as u}from"../widgets/adw-carousel-indicator-dots.js";import{AdwCarouselIndicatorLines as d}from"../widgets/adw-carousel-indicator-lines.js";import{AdwClamp as f}from"../widgets/adw-clamp.js";import{AdwComboRow as p}from"../widgets/adw-combo-row.js";import{AdwEntryRow as m}from"../widgets/adw-entry-row.js";import{AdwExpanderRow as h}from"../widgets/adw-expander-row.js";import{AdwWindowTitle as g}from"../widgets/adw-window-title.js";import{AdwHeaderBar as _}from"../widgets/adw-header-bar.js";import{AdwViewStackPage as v}from"../widgets/view-stack-page.js";import{AdwViewStack as y}from"../widgets/adw-view-stack.js";import{AdwInlineViewSwitcher as b}from"../widgets/adw-inline-view-switcher.js";import{AdwNavigationSplitView as x}from"../widgets/adw-navigation-split-view.js";import{AdwNavigationPage as S}from"../widgets/adw-navigation-page.js";import{AdwNavigationView as C}from"../widgets/adw-navigation-view.js";import{AdwOverlaySplitView as w}from"../widgets/adw-overlay-split-view.js";import{AdwPasswordEntryRow as T}from"../widgets/adw-password-entry-row.js";import{AdwPreferencesDialog as E}from"../widgets/adw-preferences-dialog.js";import{AdwPreferencesGroup as D}from"../widgets/adw-preferences-group.js";import{AdwPreferencesPage as O}from"../widgets/adw-preferences-page.js";import{AdwShortcutLabel as k}from"../widgets/adw-shortcut-label.js";import{AdwSidebarItem as A,AdwSidebarSection as j}from"../values/sidebar.js";import{AdwSidebar as M}from"../widgets/adw-sidebar.js";import{AdwSpinRow as N}from"../widgets/adw-spin-row.js";import{AdwSpinner as P}from"../widgets/adw-spinner.js";import{AdwSplitButton as F}from"../widgets/adw-split-button.js";import{AdwStatusPage as I}from"../widgets/adw-status-page.js";import{AdwSwitchRow as L}from"../widgets/adw-switch-row.js";import{AdwTabPage as R}from"../values/tab-page.js";import{AdwTabView as z}from"../widgets/adw-tab-view.js";import{AdwToastOverlay as B}from"../widgets/adw-toast-overlay.js";import{AdwToggle as V}from"../widgets/adw-toggle.js";import{AdwToggleGroup as H}from"../widgets/adw-toggle-group.js";import{AdwToolbarView as U}from"../widgets/adw-toolbar-view.js";import{AdwViewSwitcher as W}from"../widgets/adw-view-switcher.js";import{AdwViewSwitcherBar as G}from"../widgets/adw-view-switcher-bar.js";import{AdwWrapBox as K}from"../widgets/adw-wrap-box.js";var q=e({AboutDialog:()=>t,ActionRow:()=>n,AlertDialog:()=>r,Avatar:()=>i,Banner:()=>a,BottomSheet:()=>o,ButtonContent:()=>s,ButtonRow:()=>c,Carousel:()=>l,CarouselIndicatorDots:()=>u,CarouselIndicatorLines:()=>d,Clamp:()=>f,ComboRow:()=>p,EntryRow:()=>m,ExpanderRow:()=>h,HeaderBar:()=>_,InlineViewSwitcher:()=>b,NavigationPage:()=>S,NavigationSplitView:()=>x,NavigationView:()=>C,OverlaySplitView:()=>w,PasswordEntryRow:()=>T,PreferencesDialog:()=>E,PreferencesGroup:()=>D,PreferencesPage:()=>O,ShortcutLabel:()=>k,Sidebar:()=>M,SidebarItem:()=>A,SidebarSection:()=>j,SpinRow:()=>N,Spinner:()=>P,SplitButton:()=>F,StatusPage:()=>I,SwitchRow:()=>L,TabPage:()=>R,TabView:()=>z,ToastOverlay:()=>B,Toggle:()=>V,ToggleGroup:()=>H,ToolbarView:()=>U,ViewStack:()=>y,ViewStackPage:()=>v,ViewSwitcher:()=>W,ViewSwitcherBar:()=>G,WindowTitle:()=>g,WrapBox:()=>K});export{t as AboutDialog,n as ActionRow,r as AlertDialog,i as Avatar,a as Banner,o as BottomSheet,s as ButtonContent,c as ButtonRow,l as Carousel,u as CarouselIndicatorDots,d as CarouselIndicatorLines,f as Clamp,p as ComboRow,m as EntryRow,h as ExpanderRow,_ as HeaderBar,b as InlineViewSwitcher,S as NavigationPage,x as NavigationSplitView,C as NavigationView,w as OverlaySplitView,T as PasswordEntryRow,E as PreferencesDialog,D as PreferencesGroup,O as PreferencesPage,k as ShortcutLabel,M as Sidebar,A as SidebarItem,j as SidebarSection,N as SpinRow,P as Spinner,F as SplitButton,I as StatusPage,L as SwitchRow,R as TabPage,z as TabView,B as ToastOverlay,V as Toggle,H as ToggleGroup,U as ToolbarView,y as ViewStack,v as ViewStackPage,W as ViewSwitcher,G as ViewSwitcherBar,g as WindowTitle,K as WrapBox,q as adw_exports};
1
+ import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{AdwAboutDialog as t}from"../widgets/adw-about-dialog.js";import{AdwActionRow as n}from"../widgets/adw-action-row.js";import{AdwAlertDialog as r}from"../widgets/adw-alert-dialog.js";import{AdwApplicationWindow as i}from"../widgets/adw-application-window.js";import{AdwAvatar as a}from"../widgets/adw-avatar.js";import{AdwBanner as o}from"../widgets/adw-banner.js";import{AdwBin as s}from"../widgets/adw-bin.js";import{AdwBottomSheet as c}from"../widgets/adw-bottom-sheet.js";import{AdwButtonContent as l}from"../widgets/adw-button-content.js";import{AdwButtonRow as u}from"../widgets/adw-button-row.js";import{AdwCarousel as d}from"../widgets/adw-carousel.js";import{AdwCarouselIndicatorDots as f}from"../widgets/adw-carousel-indicator-dots.js";import{AdwCarouselIndicatorLines as p}from"../widgets/adw-carousel-indicator-lines.js";import{AdwClamp as m}from"../widgets/adw-clamp.js";import{AdwComboRow as h}from"../widgets/adw-combo-row.js";import{AdwDialog as g}from"../widgets/adw-dialog.js";import{AdwEntryRow as _}from"../widgets/adw-entry-row.js";import{AdwExpanderRow as v}from"../widgets/adw-expander-row.js";import{AdwWindowTitle as y}from"../widgets/adw-window-title.js";import{AdwHeaderBar as b}from"../widgets/adw-header-bar.js";import{AdwViewStackPage as x}from"../widgets/view-stack-page.js";import{AdwViewStack as S}from"../widgets/adw-view-stack.js";import{AdwInlineViewSwitcher as C}from"../widgets/adw-inline-view-switcher.js";import{AdwNavigationSplitView as w}from"../widgets/adw-navigation-split-view.js";import{AdwNavigationPage as T}from"../widgets/adw-navigation-page.js";import{AdwNavigationView as E}from"../widgets/adw-navigation-view.js";import{AdwOverlaySplitView as D}from"../widgets/adw-overlay-split-view.js";import{AdwPasswordEntryRow as O}from"../widgets/adw-password-entry-row.js";import{AdwPreferencesDialog as k}from"../widgets/adw-preferences-dialog.js";import{AdwPreferencesGroup as A}from"../widgets/adw-preferences-group.js";import{AdwPreferencesPage as j}from"../widgets/adw-preferences-page.js";import{AdwShortcutLabel as M}from"../widgets/adw-shortcut-label.js";import{AdwSidebarItem as N,AdwSidebarSection as P}from"../values/sidebar.js";import{AdwSidebar as F}from"../widgets/adw-sidebar.js";import{AdwSpinRow as I}from"../widgets/adw-spin-row.js";import{AdwSpinner as L}from"../widgets/adw-spinner.js";import{AdwSplitButton as R}from"../widgets/adw-split-button.js";import{AdwStatusPage as z}from"../widgets/adw-status-page.js";import{AdwSwitchRow as B}from"../widgets/adw-switch-row.js";import{AdwTabPage as V}from"../values/tab-page.js";import{AdwTabView as H}from"../widgets/adw-tab-view.js";import{AdwToastOverlay as U}from"../widgets/adw-toast-overlay.js";import{AdwToggle as W}from"../widgets/adw-toggle.js";import{AdwToggleGroup as G}from"../widgets/adw-toggle-group.js";import{AdwToolbarView as K}from"../widgets/adw-toolbar-view.js";import{AdwViewSwitcher as q}from"../widgets/adw-view-switcher.js";import{AdwViewSwitcherBar as J}from"../widgets/adw-view-switcher-bar.js";import{AdwWindow as Y}from"../widgets/adw-window.js";import{AdwWrapBox as X}from"../widgets/adw-wrap-box.js";var Z=e({AboutDialog:()=>t,ActionRow:()=>n,AlertDialog:()=>r,ApplicationWindow:()=>i,Avatar:()=>a,Banner:()=>o,Bin:()=>s,BottomSheet:()=>c,ButtonContent:()=>l,ButtonRow:()=>u,Carousel:()=>d,CarouselIndicatorDots:()=>f,CarouselIndicatorLines:()=>p,Clamp:()=>m,ComboRow:()=>h,Dialog:()=>g,EntryRow:()=>_,ExpanderRow:()=>v,HeaderBar:()=>b,InlineViewSwitcher:()=>C,NavigationPage:()=>T,NavigationSplitView:()=>w,NavigationView:()=>E,OverlaySplitView:()=>D,PasswordEntryRow:()=>O,PreferencesDialog:()=>k,PreferencesGroup:()=>A,PreferencesPage:()=>j,ShortcutLabel:()=>M,Sidebar:()=>F,SidebarItem:()=>N,SidebarSection:()=>P,SpinRow:()=>I,Spinner:()=>L,SplitButton:()=>R,StatusPage:()=>z,SwitchRow:()=>B,TabPage:()=>V,TabView:()=>H,ToastOverlay:()=>U,Toggle:()=>W,ToggleGroup:()=>G,ToolbarView:()=>K,ViewStack:()=>S,ViewStackPage:()=>x,ViewSwitcher:()=>q,ViewSwitcherBar:()=>J,Window:()=>Y,WindowTitle:()=>y,WrapBox:()=>X});export{t as AboutDialog,n as ActionRow,r as AlertDialog,i as ApplicationWindow,a as Avatar,o as Banner,s as Bin,c as BottomSheet,l as ButtonContent,u as ButtonRow,d as Carousel,f as CarouselIndicatorDots,p as CarouselIndicatorLines,m as Clamp,h as ComboRow,g as Dialog,_ as EntryRow,v as ExpanderRow,b as HeaderBar,C as InlineViewSwitcher,T as NavigationPage,w as NavigationSplitView,E as NavigationView,D as OverlaySplitView,O as PasswordEntryRow,k as PreferencesDialog,A as PreferencesGroup,j as PreferencesPage,M as ShortcutLabel,F as Sidebar,N as SidebarItem,P as SidebarSection,I as SpinRow,L as Spinner,R as SplitButton,z as StatusPage,B as SwitchRow,V as TabPage,H as TabView,U as ToastOverlay,W as Toggle,G as ToggleGroup,K as ToolbarView,S as ViewStack,x as ViewStackPage,q as ViewSwitcher,J as ViewSwitcherBar,Y as Window,y as WindowTitle,X as WrapBox,Z as adw_exports};
@@ -1 +1 @@
1
- import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GtkImage as t}from"../widgets/gtk-image.js";import{GtkActionBar as n}from"../widgets/gtk-action-bar.js";import{GtkBox as r}from"../widgets/gtk-box.js";import{GtkButton as i}from"../widgets/gtk-button.js";import{GtkDropDown as a}from"../widgets/gtk-drop-down.js";import{GtkEntry as o}from"../widgets/gtk-entry.js";import{GtkLabel as s}from"../widgets/gtk-label.js";import{GtkMenuButton as c}from"../widgets/gtk-menu-button.js";import{GtkAdjustment as l,GtkStringList as u}from"@gjsify/adwaita-core";var d=e({ActionBar:()=>n,Adjustment:()=>l,Box:()=>r,Button:()=>i,DropDown:()=>a,Entry:()=>o,Image:()=>t,Label:()=>s,MenuButton:()=>c,StringList:()=>u});export{n as ActionBar,l as Adjustment,r as Box,i as Button,a as DropDown,o as Entry,t as Image,s as Label,c as MenuButton,u as StringList,d as gtk_exports};
1
+ import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GtkImage as t}from"../widgets/gtk-image.js";import{GtkActionBar as n}from"../widgets/gtk-action-bar.js";import{GtkBox as r}from"../widgets/gtk-box.js";import{GtkButton as i}from"../widgets/gtk-button.js";import{GtkDropDown as a}from"../widgets/gtk-drop-down.js";import{GtkCheckButton as o}from"../widgets/gtk-check-button.js";import{GtkDrawingArea as s}from"../widgets/gtk-drawing-area.js";import{GtkEntry as c}from"../widgets/gtk-entry.js";import{GtkGrid as l}from"../widgets/gtk-grid.js";import{GtkFrame as u}from"../widgets/gtk-frame.js";import{GtkLabel as d}from"../widgets/gtk-label.js";import{GtkListBox as f}from"../widgets/gtk-list-box.js";import{GtkMenuButton as p}from"../widgets/gtk-menu-button.js";import{GtkOverlay as m}from"../widgets/gtk-overlay.js";import{GtkRevealer as h}from"../widgets/gtk-revealer.js";import{GtkScrolledWindow as g}from"../widgets/gtk-scrolled-window.js";import{GtkSeparator as _}from"../widgets/gtk-separator.js";import{GtkStackPage as v}from"../widgets/stack-page.js";import{GtkStack as y}from"../widgets/gtk-stack.js";import{GtkTextView as b}from"../widgets/gtk-text-view.js";import{GtkToggleButton as x}from"../widgets/gtk-toggle-button.js";import{GtkAdjustment as S,GtkStringList as C}from"@gjsify/adwaita-core";var w=e({ActionBar:()=>n,Adjustment:()=>S,Box:()=>r,Button:()=>i,CheckButton:()=>o,DrawingArea:()=>s,DropDown:()=>a,Entry:()=>c,Frame:()=>u,Grid:()=>l,Image:()=>t,Label:()=>d,ListBox:()=>f,MenuButton:()=>p,Overlay:()=>m,Revealer:()=>h,ScrolledWindow:()=>g,Separator:()=>_,Stack:()=>y,StackPage:()=>v,StringList:()=>C,TextView:()=>b,ToggleButton:()=>x});export{n as ActionBar,S as Adjustment,r as Box,i as Button,o as CheckButton,s as DrawingArea,a as DropDown,c as Entry,u as Frame,l as Grid,t as Image,d as Label,f as ListBox,p as MenuButton,m as Overlay,h as Revealer,g as ScrolledWindow,_ as Separator,y as Stack,v as StackPage,C as StringList,b as TextView,x as ToggleButton,w as gtk_exports};
@@ -1,2 +1,2 @@
1
- import"../_virtual/_rolldown/runtime.js";import{adwaitaAccentBgColor as e,adwaitaAccentColor as t}from"@gjsify/adwaita-core";const n=[{selector:`.adw-switch`,property:`color`,role:`fill`},{selector:`.adw-slider`,property:`color`,role:`fill`},{selector:`.adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.adw-banner-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-avatar`,property:`background-color`,role:`fill`},{selector:`.adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label`,property:`color`,role:`fill`},{selector:`.adw-viewswitcherbar-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-button-row`,property:`color`,role:`fill`},{selector:`.adw-button-row-title`,property:`color`,role:`fill`},{selector:`.adw-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-inline-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-carousel-dot.active`,property:`color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply`,property:`background-color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.ns-dark .adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-avatar`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-switch`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-viewswitcherbar-button.active .adw-viewswitcherbar-button-label`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-button-row-title, .ns-dark .adw-button-row-start-icon`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-carousel-dot.active`,property:`color`,role:`standalone-dark`}];function adwaitaNsAccentColor(n,r){return r===`fill`?e(n):t(n,r===`standalone-dark`)}function adwaitaNsAccentCss(e){return n.map(t=>`${t.selector} { ${t.property}: ${adwaitaNsAccentColor(e,t.role)}; }`).join(`
1
+ import"../_virtual/_rolldown/runtime.js";import{adwaitaAccentBgColor as e,adwaitaAccentColor as t}from"@gjsify/adwaita-core";const n=[{selector:`.adw-switch`,property:`color`,role:`fill`},{selector:`.adw-slider`,property:`color`,role:`fill`},{selector:`.adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.adw-button.suggested-action.checked`,property:`background-color`,role:`shade`},{selector:`.adw-banner-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.adw-avatar`,property:`background-color`,role:`fill`},{selector:`.adw-viewswitcherbar-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-check-indicator.checked, .adw-check-indicator.inconsistent`,property:`background-color`,role:`fill`},{selector:`.adw-button-row`,property:`color`,role:`fill`},{selector:`.adw-button-row-title`,property:`color`,role:`fill`},{selector:`.adw-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-inline-view-switcher-button-badge`,property:`background-color`,role:`fill`},{selector:`.adw-carousel-dot.active`,property:`color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply`,property:`background-color`,role:`fill`},{selector:`.adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-check-indicator.checked, .ns-dark .adw-check-indicator.inconsistent`,property:`background-color`,role:`fill`},{selector:`.ns-dark .adw-button.suggested-action`,property:`background-color`,role:`fill`},{selector:`.ns-dark .adw-button.suggested-action:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-button.suggested-action.checked`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-avatar`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-image-button.adw-entry-apply:highlighted`,property:`background-color`,role:`shade`},{selector:`.ns-dark .adw-switch`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-button-row-title, .ns-dark .adw-button-row-start-icon`,property:`color`,role:`standalone-dark`},{selector:`.ns-dark .adw-carousel-dot.active`,property:`color`,role:`standalone-dark`}];function adwaitaNsAccentColor(n,r){return r===`fill`?e(n):t(n,r===`standalone-dark`)}function adwaitaNsAccentCss(e){return n.map(t=>`${t.selector} { ${t.property}: ${adwaitaNsAccentColor(e,t.role)}; }`).join(`
2
2
  `)}export{n as ADWAITA_NS_ACCENT_RULES,adwaitaNsAccentColor,adwaitaNsAccentCss};
@@ -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{Button as r,GridLayout as i,ItemSpec as a,Label as o,ScrollView as s,StackLayout as c}from"@nativescript/core";import{aboutDialogVisibility as l}from"@gjsify/adwaita-core";const u=`closed`;var AdwAboutDialog=class extends n(i){_card;_iconLabel;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteLabel;_copyrightLabel;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_copyright=``;constructor(e){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`star`));let n=new s;n.orientation=`vertical`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,i.setColumn(n,0),i.setRow(n,0);let o=new c;o.orientation=`vertical`,o.className=`adw-about-dialog-card`,n.content=o,this.addChild(n),this._card=o,this._iconLabel=this._addCardLabel(o,`adw-about-dialog-icon`),this._nameLabel=this._addCardLabel(o,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(o,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(o,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(o,`adw-about-dialog-comments`),this._websiteLabel=this._addCardLabel(o,`adw-about-dialog-website`),this._copyrightLabel=this._addCardLabel(o,`adw-about-dialog-copyright`);let l=new r;l.text=`Close`,l.className=`adw-about-dialog-close`,l.set(`androidElevation`,0),l.addEventListener(`tap`,()=>this.close()),o.addChild(l),this._render(),t(this,e)}_addCardLabel(e,t){let n=new o;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}_render(){let e=l({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};show(this._iconLabel,this._applicationIcon,e.appIcon),show(this._nameLabel,this._applicationName,e.appName),show(this._versionLabel,this._version,e.version),show(this._developerLabel,this._developerName,e.developerName),show(this._commentsLabel,this._comments,e.commentsLabel),show(this._websiteLabel,this._website,e.websiteRow),show(this._copyrightLabel,this._copyright,this._copyright.length>0)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:u,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}};export{AdwAboutDialog,u as CLOSED};
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{aboutDialogVisibility as r}from"@gjsify/adwaita-core";import{Button as i,GridLayout as a,ItemSpec as o,Label as s,ScrollView as c,StackLayout as l}from"@nativescript/core";const u=`closed`;var AdwAboutDialog=class extends n(a){_card;_iconLabel;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteLabel;_copyrightLabel;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_copyright=``;constructor(e){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new o(1,`star`)),this.addRow(new o(1,`star`));let n=new c;n.orientation=`vertical`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,a.setColumn(n,0),a.setRow(n,0);let r=new l;r.orientation=`vertical`,r.className=`adw-about-dialog-card`,n.content=r,this.addChild(n),this._card=r,this._iconLabel=this._addCardLabel(r,`adw-about-dialog-icon`),this._nameLabel=this._addCardLabel(r,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(r,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(r,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(r,`adw-about-dialog-comments`),this._websiteLabel=this._addCardLabel(r,`adw-about-dialog-website`),this._copyrightLabel=this._addCardLabel(r,`adw-about-dialog-copyright`);let s=new i;s.text=`Close`,s.className=`adw-about-dialog-close`,s.set(`androidElevation`,0),s.addEventListener(`tap`,()=>this.close()),r.addChild(s),this._render(),t(this,e)}_addCardLabel(e,t){let n=new s;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}_render(){let e=r({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};show(this._iconLabel,this._applicationIcon,e.appIcon),show(this._nameLabel,this._applicationName,e.appName),show(this._versionLabel,this._version,e.version),show(this._developerLabel,this._developerName,e.developerName),show(this._commentsLabel,this._comments,e.commentsLabel),show(this._websiteLabel,this._website,e.websiteRow),show(this._copyrightLabel,this._copyright,this._copyright.length>0)}present(){this.visibility=`visible`}close(){this.visibility=`collapse`;let e={eventName:u,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}};export{AdwAboutDialog,u as CLOSED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{adwaitaNsAccentCss as e}from"./accent-theme.js";import{Application as t}from"@nativescript/core";import{ADW_DEFAULT_ACCENT_COLOR as n,setAdwaitaAccent as r}from"@gjsify/adwaita-core";function applyAdwaitaNsAccent(n){r(n),t.addCss(e(n))}function clearAdwaitaNsAccent(){r(n),t.addCss(e(n))}export{applyAdwaitaNsAccent,clearAdwaitaNsAccent};
1
+ import"../_virtual/_rolldown/runtime.js";import{adwaitaNsAccentCss as e}from"./accent-theme.js";import{ADW_DEFAULT_ACCENT_COLOR as t,setAdwaitaAccent as n}from"@gjsify/adwaita-core";import{Application as r}from"@nativescript/core";function applyAdwaitaNsAccent(t){n(t),r.addCss(e(t))}function clearAdwaitaNsAccent(){n(t),r.addCss(e(t))}export{applyAdwaitaNsAccent,clearAdwaitaNsAccent};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Observable as n,action as r,confirm as i}from"@nativescript/core";import{AdwAlertResponses as a,AdwAlertResponses as o}from"@gjsify/adwaita-core";const s=`notify::response`;var AdwAlertDialog=class extends t(n){_responses;constructor(t=``,n=``,r){super();let i=typeof t==`string`;this._responses=new o(i?t:``,n),i||(r=t),e(this,r)}get heading(){return this._responses.heading}set heading(e){this._responses.heading=e}get body(){return this._responses.body}set body(e){this._responses.body=e}add_response(e,t,n){this._responses.addResponse(e,t,n)}addResponses(...e){this._responses.addResponses(...e)}set_response_appearance(e,t){this._responses.setResponseAppearance(e,t)}get_response_appearance(e){return this._responses.getResponseAppearance(e)}set_response_enabled(e,t){this._responses.setResponseEnabled(e,t)}get_response_enabled(e){return this._responses.getResponseEnabled(e)}get defaultResponse(){return this._responses.defaultResponse}set defaultResponse(e){this._responses.defaultResponse=e}get closeResponse(){return this._responses.closeResponse}set closeResponse(e){this._responses.closeResponse=e}get responses(){return this._responses.responses}async present(){let e=this._responses.usesActionSheet?await this._presentAction():await this._presentConfirm();return this.notify({eventName:s,object:this,response:e}),e}async _presentConfirm(){let e=this._responses.orderResponses(),t=await i({title:this._responses.heading||void 0,message:this._responses.body||void 0,okButtonText:e.ok?.label,cancelButtonText:e.cancel?.label,neutralButtonText:e.neutral?.label,cancelable:!0});return t===!0?this._responses.resolveById(e.ok?.id):t===!1?this._responses.resolveById(e.cancel?.id):t===void 0?this._responses.resolveById(e.neutral?.id):this._responses.closeResponse}async _presentAction(){let e=await r({title:this._responses.heading||void 0,message:this._responses.body||void 0,cancelButtonText:`Cancel`,actions:this._responses.responses.map(e=>e.label)});return this._responses.resolveLabel(e)}};export{AdwAlertDialog,a as AdwAlertResponses,s as NOTIFY_RESPONSE};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{AdwAlertResponses as n,AdwAlertResponses as r}from"@gjsify/adwaita-core";import{Observable as i,action as a,confirm as o}from"@nativescript/core";const s=`notify::response`;var AdwAlertDialog=class extends t(i){_responses;constructor(t=``,n=``,i){super();let a=typeof t==`string`;this._responses=new r(a?t:``,n),a||(i=t),e(this,i)}get heading(){return this._responses.heading}set heading(e){this._responses.heading=e}get body(){return this._responses.body}set body(e){this._responses.body=e}add_response(e,t,n){this._responses.addResponse(e,t,n)}addResponses(...e){this._responses.addResponses(...e)}set_response_appearance(e,t){this._responses.setResponseAppearance(e,t)}get_response_appearance(e){return this._responses.getResponseAppearance(e)}set_response_enabled(e,t){this._responses.setResponseEnabled(e,t)}get_response_enabled(e){return this._responses.getResponseEnabled(e)}get defaultResponse(){return this._responses.defaultResponse}set defaultResponse(e){this._responses.defaultResponse=e}get closeResponse(){return this._responses.closeResponse}set closeResponse(e){this._responses.closeResponse=e}get responses(){return this._responses.responses}async present(){let e=this._responses.usesActionSheet?await this._presentAction():await this._presentConfirm();return this.notify({eventName:s,object:this,response:e}),e}async _presentConfirm(){let e=this._responses.orderResponses(),t=await o({title:this._responses.heading||void 0,message:this._responses.body||void 0,okButtonText:e.ok?.label,cancelButtonText:e.cancel?.label,neutralButtonText:e.neutral?.label,cancelable:!0});return t===!0?this._responses.resolveById(e.ok?.id):t===!1?this._responses.resolveById(e.cancel?.id):t===void 0?this._responses.resolveById(e.neutral?.id):this._responses.closeResponse}async _presentAction(){let e=await a({title:this._responses.heading||void 0,message:this._responses.body||void 0,cancelButtonText:`Cancel`,actions:this._responses.responses.map(e=>e.label)});return this._responses.resolveLabel(e)}};export{AdwAlertDialog,n as AdwAlertResponses,s as NOTIFY_RESPONSE};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwWindowBase as t}from"./window-base.js";var AdwApplicationWindow=class extends t{constructor(t){super(),e(this,t)}};export{AdwApplicationWindow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{avatarColor as i,avatarInitials as a}from"./avatar-color.js";import{AVATAR_DEFAULT_ICON as o,avatarViewState as s}from"./avatar-view.js";import{GtkImage as c}from"./gtk-image.js";import{GridLayout as l,ItemSpec as u,Label as d}from"@nativescript/core";import{avatarIconSize as f,avatarMaxFontSize as p}from"@gjsify/adwaita-core";const m=48;var AdwAvatar=class extends r(l){_label;_icon;_text=``;_size=48;_showInitials=!1;_iconName=``;constructor(e){super(),this.className=`adw-avatar`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`star`));let t=new d;t.className=`adw-avatar-label`,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,l.setColumn(t,0),l.setRow(t,0),this.addChild(t),this._label=t;let r=new c;r.className=`adw-icon adw-avatar-icon`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,l.setColumn(r,0),l.setRow(r,0),this.addChild(r),this._icon=r,this._applySize(),this._applyColor(),this._applyMode(),n(this,e)}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,p(this._size)))),this._icon.pixelSize=f(this._size)}_applyColor(){let{fill:e,fg:t}=i(this._text);this.set(`backgroundColor`,e),this._label.set(`color`,t),this._icon.iconColor=t}_applyMode(){let e=s({showInitials:this._showInitials,text:this._text,iconName:this._iconName});this._label.visibility=e.label,this._icon.visibility=e.icon,e.icon===`visible`&&(this._icon.iconName=e.iconName)}get text(){return this._text}set text(e){this._text=e??``,this._label.text=a(this._text),this._applyColor(),this._applyMode()}get size(){return this._size}set size(e){let n=t(e,48);this._size=n>0?n:48,this._applySize()}get showInitials(){return this._showInitials}set showInitials(t){this._showInitials=e(t,!1),this._applyMode()}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._applyMode()}};export{o as AVATAR_DEFAULT_ICON,AdwAvatar,m as DEFAULT_AVATAR_SIZE,i as avatarColor,a as avatarInitials};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{avatarColor as i,avatarInitials as a}from"./avatar-color.js";import{AVATAR_DEFAULT_ICON as o,avatarViewState as s}from"./avatar-view.js";import{GtkImage as c}from"./gtk-image.js";import{avatarIconSize as l,avatarMaxFontSize as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f,Label as p}from"@nativescript/core";const m=48;var AdwAvatar=class extends r(d){_label;_icon;_text=``;_size=48;_showInitials=!1;_iconName=``;constructor(e){super(),this.className=`adw-avatar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let t=new p;t.className=`adw-avatar-label`,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,d.setColumn(t,0),d.setRow(t,0),this.addChild(t),this._label=t;let r=new c;r.className=`adw-icon adw-avatar-icon`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,d.setColumn(r,0),d.setRow(r,0),this.addChild(r),this._icon=r,this._applySize(),this._applyColor(),this._applyMode(),n(this,e)}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,u(this._size)))),this._icon.pixelSize=l(this._size)}_applyColor(){let{fill:e,fg:t}=i(this._text);this.set(`backgroundColor`,e),this._label.set(`color`,t),this._icon.iconColor=t}_applyMode(){let e=s({showInitials:this._showInitials,text:this._text,iconName:this._iconName});this._label.visibility=e.label,this._icon.visibility=e.icon,e.icon===`visible`&&(this._icon.iconName=e.iconName)}get text(){return this._text}set text(e){this._text=e??``,this._label.text=a(this._text),this._applyColor(),this._applyMode()}get size(){return this._size}set size(e){let n=t(e,48);this._size=n>0?n:48,this._applySize()}get showInitials(){return this._showInitials}set showInitials(t){this._showInitials=e(t,!1),this._applyMode()}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._applyMode()}};export{o as AVATAR_DEFAULT_ICON,AdwAvatar,m as DEFAULT_AVATAR_SIZE,i as avatarColor,a as avatarInitials};
@@ -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{bannerButtonClassName as r,bannerTitleText as i,bannerVisibility as a,defaultBannerProps as o}from"./chrome.js";import{Button as s,GridLayout as c,ItemSpec as l,Label as u}from"@nativescript/core";import{bannerButtonText as d,bannerButtonVisible as f,parseBannerButtonStyle as p}from"@gjsify/adwaita-core";const m=`buttonClicked`;var AdwBanner=class extends n(c){_titleLabel;_button;_hasButton=!1;_props=o();constructor(e){super(),this.className=`adw-banner`,this.addColumn(new l(1,`star`)),this.addColumn(new l(1,`auto`)),this.addRow(new l(1,`auto`));let n=new u;n.className=`adw-banner-title`,n.textWrap=!0,c.setColumn(n,0),this.addChild(n),this._titleLabel=n;let r=new s;r.className=`adw-banner-button`,r.set(`androidElevation`,0),c.setColumn(r,1),this._button=r,r.addEventListener(`tap`,()=>{let e={eventName:m,object:this};this.notify(e)}),this.visibility=a(this._props.revealed),t(this,e)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(t){this._props.useMarkup=e(t,!1),this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=d(t);let n=f(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(e){this._props.buttonStyle=p(e),this._button.className=r(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(t){this._props.revealed=e(t,!1),this.visibility=a(this._props.revealed)}_renderTitle(){this._titleLabel.text=i(this._props.title,this._props.useMarkup)}};export{AdwBanner,m as BUTTON_CLICKED};
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{bannerButtonClassName as r,bannerTitleText as i,bannerVisibility as a,defaultBannerProps as o}from"./chrome.js";import{bannerButtonText as s,bannerButtonVisible as c,parseBannerButtonStyle as l}from"@gjsify/adwaita-core";import{Button as u,GridLayout as d,ItemSpec as f,Label as p}from"@nativescript/core";const m=`buttonClicked`;var AdwBanner=class extends n(d){_titleLabel;_button;_hasButton=!1;_props=o();constructor(e){super(),this.className=`adw-banner`,this.addColumn(new f(1,`star`)),this.addColumn(new f(1,`auto`)),this.addRow(new f(1,`auto`));let n=new p;n.className=`adw-banner-title`,n.textWrap=!0,d.setColumn(n,0),this.addChild(n),this._titleLabel=n;let r=new u;r.className=`adw-banner-button`,r.set(`androidElevation`,0),d.setColumn(r,1),this._button=r,r.addEventListener(`tap`,()=>{let e={eventName:m,object:this};this.notify(e)}),this.visibility=a(this._props.revealed),t(this,e)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(t){this._props.useMarkup=e(t,!1),this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=s(t);let n=c(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(e){this._props.buttonStyle=l(e),this._button.className=r(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(t){this._props.revealed=e(t,!1),this.visibility=a(this._props.revealed)}_renderTitle(){this._titleLabel.text=i(this._props.title,this._props.useMarkup)}};export{AdwBanner,m as BUTTON_CLICKED};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{AdwSingleChildBase as n}from"./single-child-base.js";var AdwBin=class extends n{static builderSlots=e([`child`],`child`);constructor(e){super(),t(this,e)}};export{AdwBin};
@@ -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{buttonContentClassName as i,buttonContentEllipsize as a,buttonContentIcon as o,buttonContentIconIsFallback as s,buttonContentLabelText as c,buttonContentLabelVisibility as l,buttonContentRootedParentClassName as u,buttonContentUnrootedParentClassName as d}from"./button-content.js";import{Label as f,StackLayout as p}from"@nativescript/core";import{ADW_BUTTON_CONTENT_DEFAULTS as m}from"@gjsify/adwaita-core";var AdwButtonContent=class extends n(p){_icon;_label;_props={...m};_hostButton=null;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let n=new r;n.className=`${n.className} adw-button-content-icon`.trim(),n.verticalAlignment=`middle`,n.iconName=o(``),this.addChild(n),this._icon=n;let i=new f;i.className=`adw-button-content-label`,i.verticalAlignment=`middle`,i.visibility=l(``),this.addChild(i),this._label=i,t(this,e)}get hostButton(){return this._hostButton}set hostButton(e){this._hostButton!==e&&(this._hostButton&&(this._hostButton.className=d(this._hostButton.className??``)),this._hostButton=e,e&&(e.className=u(e.className??``)))}get iconName(){return this._props.iconName}set iconName(e){this._props.iconName=e??``,this._icon.iconName=o(this._props.iconName)}get iconIsFallback(){return s(this._props.iconName)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._props.label}set label(e){this._props.label=e??``,this._renderLabel()}get useUnderline(){return this._props.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._props.useUnderline=!!n,this._renderLabel()}get canShrink(){return this._props.canShrink}set canShrink(t){let n=e(t,this.canShrink);this._props.canShrink=!!n,this.className=i(this.className,this._props.canShrink)}get ellipsize(){return a(this._props.canShrink)}_renderLabel(){this._label.text=c(this._props.label,this._props.useUnderline),this._label.visibility=l(this._props.label)}};export{AdwButtonContent};
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{buttonContentClassName as i,buttonContentEllipsize as a,buttonContentIcon as o,buttonContentIconIsFallback as s,buttonContentLabelText as c,buttonContentLabelVisibility as l,buttonContentRootedParentClassName as u,buttonContentUnrootedParentClassName as d}from"./button-content.js";import{ADW_BUTTON_CONTENT_DEFAULTS as f}from"@gjsify/adwaita-core";import{Label as p,StackLayout as m}from"@nativescript/core";var AdwButtonContent=class extends n(m){_icon;_label;_props={...f};_hostButton=null;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let n=new r;n.className=`${n.className} adw-button-content-icon`.trim(),n.verticalAlignment=`middle`,n.iconName=o(``),this.addChild(n),this._icon=n;let i=new p;i.className=`adw-button-content-label`,i.verticalAlignment=`middle`,i.visibility=l(``),this.addChild(i),this._label=i,t(this,e)}get hostButton(){return this._hostButton}set hostButton(e){this._hostButton!==e&&(this._hostButton&&(this._hostButton.className=d(this._hostButton.className??``)),this._hostButton=e,e&&(e.className=u(e.className??``)))}get iconName(){return this._props.iconName}set iconName(e){this._props.iconName=e??``,this._icon.iconName=o(this._props.iconName)}get iconIsFallback(){return s(this._props.iconName)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._props.label}set label(e){this._props.label=e??``,this._renderLabel()}get useUnderline(){return this._props.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._props.useUnderline=!!n,this._renderLabel()}get canShrink(){return this._props.canShrink}set canShrink(t){let n=e(t,this.canShrink);this._props.canShrink=!!n,this.className=i(this.className,this._props.canShrink)}get ellipsize(){return a(this._props.canShrink)}_renderLabel(){this._label.text=c(this._props.label,this._props.useUnderline),this._label.visibility=l(this._props.label)}};export{AdwButtonContent};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{ButtonRowState as t,buttonRowIconColor as n,buttonRowIconVisuals as r}from"./row-state.js";import{ACTIVATED as i,AdwActionRow as a}from"./adw-action-row.js";import{GtkImage as o}from"./gtk-image.js";import{attachRowPressFeedback as s}from"./row-press.js";import{classNameWith as c,normalizeStyleClasses as l,withCssClass as u,withoutCssClass as d}from"./style-classes.js";import{StackLayout as f}from"@nativescript/core";import{adwaitaAccent as p,onAdwaitaAccentChanged as m}from"@gjsify/adwaita-core";const h=`adw-row adw-action-row adw-button-row`;var g=class AdwButtonRow extends a{isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new t;_styleClasses=[];constructor(t){super(),this.className=h,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let n=new f;n.orientation=`horizontal`,n.className=`adw-button-row-content`,n.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),this._applyIconColor(),this.addEventListener(`loaded`,()=>{this._applyIconColor(),this._unsubAccent??=m(()=>this._applyIconColor())}),this.addEventListener(`unloaded`,()=>{this._unsubAccent?.(),this._unsubAccent=null}),n.addChild(this._startIcon),n.addChild(this._titleLabel),n.addChild(this._endIcon),this._textStack.addChild(n),this._textStack.horizontalAlignment=`center`,this._contentBox=n,this.activatable=!0,this._applyIcons(),s(this),e(this,t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(l(e))}add_css_class(e){this._setClasses(u(this._styleClasses,e))}remove_css_class(e){this._setClasses(d(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(l([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=c(h,e)}static _makeIcon(e){let t=new o;return t.className=`${t.className} ${e}`.trim(),t.verticalAlignment=`middle`,t}get startIconName(){return this._buttonState.startIconName}set startIconName(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIconName(){return this._buttonState.endIconName}set endIconName(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._pinnedIconColor=e||null,this._applyIconColor()}_applyIconColor(){let e=n(this._pinnedIconColor,p());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=r(this._buttonState.state);this._startIcon.iconName=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.iconName=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{i as ACTIVATED,g as AdwButtonRow};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{ButtonRowState as t,buttonRowIconColor as n,buttonRowIconVisuals as r}from"./row-state.js";import{ACTIVATED as i,AdwActionRow as a}from"./adw-action-row.js";import{classNameWith as o,normalizeStyleClasses as s,withCssClass as c,withoutCssClass as l}from"./style-classes.js";import{GtkImage as u}from"./gtk-image.js";import{attachRowPressFeedback as d}from"./row-press.js";import{adwaitaAccent as f,onAdwaitaAccentChanged as p}from"@gjsify/adwaita-core";import{StackLayout as m}from"@nativescript/core";const h=`adw-row adw-action-row adw-button-row`;var g=class AdwButtonRow extends a{isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new t;_styleClasses=[];constructor(t){super(),this.className=h,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let n=new m;n.orientation=`horizontal`,n.className=`adw-button-row-content`,n.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),this._applyIconColor(),this.addEventListener(`loaded`,()=>{this._applyIconColor(),this._unsubAccent??=p(()=>this._applyIconColor())}),this.addEventListener(`unloaded`,()=>{this._unsubAccent?.(),this._unsubAccent=null}),n.addChild(this._startIcon),n.addChild(this._titleLabel),n.addChild(this._endIcon),this._textStack.addChild(n),this._textStack.horizontalAlignment=`center`,this._contentBox=n,this.activatable=!0,this._applyIcons(),d(this),e(this,t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(s(e))}add_css_class(e){this._setClasses(c(this._styleClasses,e))}remove_css_class(e){this._setClasses(l(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(s([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=o(h,e)}static _makeIcon(e){let t=new u;return t.className=`${t.className} ${e}`.trim(),t.verticalAlignment=`middle`,t}get startIconName(){return this._buttonState.startIconName}set startIconName(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIconName(){return this._buttonState.endIconName}set endIconName(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._pinnedIconColor=e||null,this._applyIconColor()}_applyIconColor(){let e=n(this._pinnedIconColor,f());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=r(this._buttonState.state);this._startIcon.iconName=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.iconName=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{i as ACTIVATED,g as AdwButtonRow};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{Label as s,StackLayout as c,action as l}from"@nativescript/core";import{ComboState as u,ComboState as d,normalizeComboOptions as f}from"@gjsify/adwaita-core";import{panDownSymbolic as p}from"@gjsify/adwaita-icons/ui";const m=`notify::selected`;var AdwComboRow=class extends i{static builderSlots=e([...i.builderSlots,`model`],`suffix`);_valueLabel;_chevron;_state=new d;_pendingSelected=null;constructor(e){super(),this.className=`adw-row adw-action-row adw-combo-row`;let t=new c;t.orientation=`horizontal`,t.className=`adw-combo-suffix`;let n=new s;n.className=`adw-combo-value`,n.text=``;let i=new a;i.className=`adw-combo-chevron`,i.iconColor=`#9a9a9a`,i.pixelSize=16,i.iconName=p,t.addChild(n),t.addChild(i),this.add_suffix(t),this._valueLabel=n,this._chevron=i,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:m,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),this._syncChooser(),r(this,e)}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.model.map(e=>e.label),t=await l({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){if(this._state.setModel(f(e)),this._pendingSelected!==null&&this._pendingSelected<this._state.model.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelectedIndex(e)}}_addChildFromBuilder(e,n){if(t(e,[`model`],`edge`)===`model`){this.model=n;return}super._addChildFromBuilder(e,n)}get selected(){return this._state.selectedIndex}set selected(e){let t=n(e,this.selected);if(this._state.model.length===0){this._pendingSelected=t;return}this._state.setSelectedIndex(t)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,u as ComboState,m as NOTIFY_SELECTED};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{ComboState as s,ComboState as c,normalizeComboOptions as l}from"@gjsify/adwaita-core";import{Label as u,StackLayout as d,action as f}from"@nativescript/core";import{panDownSymbolic as p}from"@gjsify/adwaita-icons/ui";const m=`notify::selected`;var AdwComboRow=class extends i{static builderSlots=e([...i.builderSlots,`model`],`suffix`);_valueLabel;_chevron;_state=new c;_pendingSelected=null;constructor(e){super(),this.className=`adw-row adw-action-row adw-combo-row`;let t=new d;t.orientation=`horizontal`,t.className=`adw-combo-suffix`;let n=new u;n.className=`adw-combo-value`,n.text=``;let i=new a;i.className=`adw-combo-chevron`,i.iconColor=`#9a9a9a`,i.pixelSize=16,i.iconName=p,t.addChild(n),t.addChild(i),this.add_suffix(t),this._valueLabel=n,this._chevron=i,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:m,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),this._syncChooser(),r(this,e)}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.model.map(e=>e.label),t=await f({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){if(this._state.setModel(l(e)),this._pendingSelected!==null&&this._pendingSelected<this._state.model.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelectedIndex(e)}}_addChildFromBuilder(e,n){if(t(e,[`model`],`edge`)===`model`){this.model=n;return}super._addChildFromBuilder(e,n)}get selected(){return this._state.selectedIndex}set selected(e){let t=n(e,this.selected);if(this._state.model.length===0){this._pendingSelected=t;return}this._state.setSelectedIndex(t)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,s as ComboState,m as NOTIFY_SELECTED};
@@ -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{attachRowPressFeedback as r}from"./row-press.js";import{DATA_GRID_HEADER_CELL_CLASS as i,DATA_GRID_HEADER_ROW_CLASS as a,DATA_GRID_SECTION_CELL_CLASS as o,dataGridCellClass as s,dataGridItemSpec as c,dataGridRowClass as l,dataGridShapeKey as u,dataGridTracksKey as d}from"./data-grid-model.js";import{GridLayout as f,ItemSpec as p,Label as m,StackLayout as h}from"@nativescript/core";import{dataGridCellText as g,dataGridColumnClasses as _,dataGridRowInteractive as v,dataGridTracks as y,normalizeDataGridColumns as b,normalizeDataGridVariant as x}from"@gjsify/adwaita-core";const S=`row-activated`;var AdwDataGrid=class extends n(f){_columns=[];_dataRows=[];_interactive=!1;_header=null;_rowNodes=[];_trackKey=``;_shapeKey=``;constructor(e){super(),this.className=`adw-data-grid`,t(this,e)}get columns(){return this._columns}set columns(e){this._columns=b(e),this._render()}get rows(){return this._dataRows}set rows(e){this._dataRows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(t){let n=e(t,this.interactive);this._interactive=!!n,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=y(this._columns),t=d(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=c(t);this.addColumn(new p(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=u(e,this._dataRows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new p(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._dataRows.map((t,n)=>(this.addRow(new p(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(e,t,n){let i=new h;f.setRow(i,e),f.setColumn(i,0),f.setColumnSpan(i,t),this.addChild(i),n&&(r(i),i.addEventListener(`tap`,()=>this._activate(e-1)));let a=[];for(let n=0;n<t;n++){let t=new m;t.textWrap=!1,f.setRow(t,e),f.setColumn(t,n),this.addChild(t),a.push(t)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=a,this._columns.forEach((t,n)=>{let r=e.cells[n];r!==void 0&&(r.className=`${_(t).join(` `)} ${i}`,r.text=t.label??t.key,this._showCell(r,1))}),this._dataRows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let r=x(e.variant),i=v(r,e.interactive,this._interactive);if(n.background.className=l(r,i),r===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,r)=>{r===0?(n.className=o,n.text=g(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,f.setColumnSpan(n,1))});return}this._columns.forEach((t,i)=>{let a=n.cells[i];a!==void 0&&(a.className=s(_(t),r),a.text=g(e[t.key]),this._showCell(a,1))})}))}_showCell(e,t){e.visibility=`visible`,f.setColumnSpan(e,t)}_activate(e){let t=this._dataRows[e];if(t===void 0||!v(x(t.variant),t.interactive,this._interactive))return;let n={eventName:S,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,S as ROW_ACTIVATED};
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{attachRowPressFeedback as r}from"./row-press.js";import{DATA_GRID_HEADER_CELL_CLASS as i,DATA_GRID_HEADER_ROW_CLASS as a,DATA_GRID_SECTION_CELL_CLASS as o,dataGridCellClass as s,dataGridItemSpec as c,dataGridRowClass as l,dataGridShapeKey as u,dataGridTracksKey as d}from"./data-grid-model.js";import{dataGridCellText as f,dataGridColumnClasses as p,dataGridRowInteractive as m,dataGridTracks as h,normalizeDataGridColumns as g,normalizeDataGridVariant as _}from"@gjsify/adwaita-core";import{GridLayout as v,ItemSpec as y,Label as b,StackLayout as x}from"@nativescript/core";const S=`row-activated`;var AdwDataGrid=class extends n(v){_columns=[];_dataRows=[];_interactive=!1;_header=null;_rowNodes=[];_trackKey=``;_shapeKey=``;constructor(e){super(),this.className=`adw-data-grid`,t(this,e)}get columns(){return this._columns}set columns(e){this._columns=g(e),this._render()}get rows(){return this._dataRows}set rows(e){this._dataRows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(t){let n=e(t,this.interactive);this._interactive=!!n,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=h(this._columns),t=d(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=c(t);this.addColumn(new y(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=u(e,this._dataRows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new y(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._dataRows.map((t,n)=>(this.addRow(new y(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(e,t,n){let i=new x;v.setRow(i,e),v.setColumn(i,0),v.setColumnSpan(i,t),this.addChild(i),n&&(r(i),i.addEventListener(`tap`,()=>this._activate(e-1)));let a=[];for(let n=0;n<t;n++){let t=new b;t.textWrap=!1,v.setRow(t,e),v.setColumn(t,n),this.addChild(t),a.push(t)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=a,this._columns.forEach((t,n)=>{let r=e.cells[n];r!==void 0&&(r.className=`${p(t).join(` `)} ${i}`,r.text=t.label??t.key,this._showCell(r,1))}),this._dataRows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let r=_(e.variant),i=m(r,e.interactive,this._interactive);if(n.background.className=l(r,i),r===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,r)=>{r===0?(n.className=o,n.text=f(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,v.setColumnSpan(n,1))});return}this._columns.forEach((t,i)=>{let a=n.cells[i];a!==void 0&&(a.className=s(p(t),r),a.text=f(e[t.key]),this._showCell(a,1))})}))}_showCell(e,t){e.visibility=`visible`,v.setColumnSpan(e,t)}_activate(e){let t=this._dataRows[e];if(t===void 0||!m(_(t.variant),t.interactive,this._interactive))return;let n={eventName:S,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,S as ROW_ACTIVATED};
@@ -0,0 +1 @@
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwSingleChildBase as i}from"./single-child-base.js";import{DEFAULT_DIALOG_PRESENTATION_MODE as a,dialogPresentationMode as o,findDialogHost as s,surfaceSize as c}from"./window-state.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=`closed`,f=`close-attempt`,p=`adw-dialog`;var AdwDialog=class extends i{static builderSlots=e([`child`],`child`);_card;_title=``;_contentWidth=-1;_contentHeight=-1;_followsContentSize=!0;_canClose=!0;_presentationMode=a;_host=null;constructor(e){super(),this._restyle(),this.visibility=`collapse`;let t=new l;t.className=`${p}-card`,t.addColumn(new u(1,`star`)),t.addRow(new u(1,`star`)),l.setColumn(t,0),l.setRow(t,0),this.addChild(t),this._card=t,this._layoutCard(),r(this,e)}get _ownClass(){return p}_adopt(e){l.setColumn(e,0),l.setRow(e,0),this._card.addChild(e)}_release(e){this._card.removeChild(e)}get title(){return this._title}set title(e){this._title=e??``,this._card.accessibilityLabel=this._title===``?void 0:this._title}get contentWidth(){return this._contentWidth}set contentWidth(e){this._contentWidth=c(n(e,NaN),e,this._contentWidth,`contentWidth`),this._layoutCard()}get contentHeight(){return this._contentHeight}set contentHeight(e){this._contentHeight=c(n(e,NaN),e,this._contentHeight,`contentHeight`),this._layoutCard()}get followsContentSize(){return this._followsContentSize}set followsContentSize(e){this._followsContentSize=t(e,this._followsContentSize)}get canClose(){return this._canClose}set canClose(e){this._canClose=t(e,this._canClose)}get presentationMode(){return this._presentationMode}set presentationMode(e){this._presentationMode=o(e),this._layoutCard()}get open(){return this.visibility===`visible`}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=s(e??null);if(t===null)throw Error(`${this.constructor.name} has no window to appear in: pass a widget that sits inside an Adw.Window / Adw.ApplicationWindow to present(), or add the dialog to a layout first.`);t._hostDialog(this),this._host=t}this.visibility=`visible`}}close(){if(!this._canClose){this.notify({eventName:f,object:this});return}this.force_close()}force_close(){this.open&&(this.visibility=`collapse`,this._host!==null&&(this._host._unhostDialog(this),this._host=null),this.notify({eventName:d,object:this}))}_layoutCard(){let e=this._card;e.width=this._contentWidth>0?this._contentWidth:`auto`,e.height=this._contentHeight>0?this._contentHeight:`auto`,this._presentationMode===`bottom-sheet`?(e.horizontalAlignment=`stretch`,e.verticalAlignment=`bottom`,e.width=`auto`):(e.horizontalAlignment=`center`,e.verticalAlignment=`middle`)}};export{p as ADW_DIALOG_CLASS,d as ADW_DIALOG_CLOSED,f as ADW_DIALOG_CLOSE_ATTEMPT,AdwDialog};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{AdwActionRow as r}from"./adw-action-row.js";import{GtkImage as i}from"./gtk-image.js";import{AdwImageButton as a}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as o,NS_ENTRY_ROW_CLASS as s,applyEntryRowState as c}from"./entry-row-view.js";import{Label as l,StackLayout as u,TextField as d}from"@nativescript/core";import{ADW_ACCENT_FG_COLOR as f,EntryRowState as p,EntryRowState as m}from"@gjsify/adwaita-core";import{documentEditSymbolic as h,objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`notify::text`,v=`notify::text-length`,y=`apply`,b=`entry-activated`;var AdwEntryRow=class extends r{isActionRow=!1;_state=new m;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(e){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let t=new l;t.className=`adw-row-title adw-entry-empty-title`,t.textWrap=!0,this._textStack.insertChild(t,0),this._emptyTitle=t;let r=new d;r.className=`adw-entry-field`,r.set(`backgroundColor`,`transparent`),r.set(`borderWidth`,0),this._textStack.addChild(r),this._field=r;let s=new u;s.orientation=`horizontal`,s.className=`adw-entry-row-suffixes`,this._suffixes=s;let c=new i;c.className=`gtk-image adw-entry-indicator`,s.addChild(c),this._indicator=c;let p=new a;p.className=`${p.className} adw-entry-apply`.trim(),p.iconName=g,p.iconColor=f,p.addEventListener(`tap`,()=>this.apply()),s.addChild(p),this._applyButton=p;let m=new i;m.className=o,m.iconName=h,s.addChild(m),this._editIcon=m,super.add_suffix(s),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e)),n(this,e)}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){let n=t(e,this.maxLength);this._state.setMaxLength(n)}get editable(){return this._state.editable}set editable(t){let n=e(t,this.editable);this._state.setEditable(n)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(t){let n=e(t,this.showApplyButton);this._state.setShowApplyButton(n)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(t){let n=e(t,this.activatesDefault);this._state.setActivatesDefault(n)}get editing(){return this._state.editing}add_suffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e),this._slotSuffix=e}remove(e){if(e===this.prefix){super.remove(e);return}this._suffixes.removeChild(e),e===this._slotSuffix&&(this._slotSuffix=null)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.iconName=e}apply(){this._state.apply(),this.notify({eventName:y,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:y,object:this});return}let t={eventName:b,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){c({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return s}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:_,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:v,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,p as EntryRowState,_ as NOTIFY_TEXT,v as NOTIFY_TEXT_LENGTH,y as SIGNAL_APPLY,b as SIGNAL_ENTRY_ACTIVATED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{AdwActionRow as r}from"./adw-action-row.js";import{GtkImage as i}from"./gtk-image.js";import{AdwImageButton as a}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as o,NS_ENTRY_ROW_CLASS as s,applyEntryRowState as c}from"./entry-row-view.js";import{ADW_ACCENT_FG_COLOR as l,EntryRowState as u,EntryRowState as d}from"@gjsify/adwaita-core";import{Label as f,StackLayout as p,TextField as m}from"@nativescript/core";import{documentEditSymbolic as h,objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`notify::text`,v=`notify::text-length`,y=`apply`,b=`entry-activated`;var AdwEntryRow=class extends r{isActionRow=!1;_state=new d;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(e){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let t=new f;t.className=`adw-row-title adw-entry-empty-title`,t.textWrap=!0,this._textStack.insertChild(t,0),this._emptyTitle=t;let r=new m;r.className=`adw-entry-field`,r.set(`backgroundColor`,`transparent`),r.set(`borderWidth`,0),this._textStack.addChild(r),this._field=r;let s=new p;s.orientation=`horizontal`,s.className=`adw-entry-row-suffixes`,this._suffixes=s;let c=new i;c.className=`gtk-image adw-entry-indicator`,s.addChild(c),this._indicator=c;let u=new a;u.className=`${u.className} adw-entry-apply`.trim(),u.iconName=g,u.iconColor=l,u.addEventListener(`tap`,()=>this.apply()),s.addChild(u),this._applyButton=u;let d=new i;d.className=o,d.iconName=h,s.addChild(d),this._editIcon=d,super.add_suffix(s),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e)),n(this,e)}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){let n=t(e,this.maxLength);this._state.setMaxLength(n)}get editable(){return this._state.editable}set editable(t){let n=e(t,this.editable);this._state.setEditable(n)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(t){let n=e(t,this.showApplyButton);this._state.setShowApplyButton(n)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(t){let n=e(t,this.activatesDefault);this._state.setActivatesDefault(n)}get editing(){return this._state.editing}add_suffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e),this._slotSuffix=e}remove(e){if(e===this.prefix){super.remove(e);return}this._suffixes.removeChild(e),e===this._slotSuffix&&(this._slotSuffix=null)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.iconName=e}apply(){this._state.apply(),this.notify({eventName:y,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:y,object:this});return}let t={eventName:b,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){c({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return s}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:_,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:v,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,u as EntryRowState,_ as NOTIFY_TEXT,v as NOTIFY_TEXT_LENGTH,y as SIGNAL_APPLY,b as SIGNAL_ENTRY_ACTIVATED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlBoolean as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{GridLayout as o,ItemSpec as s,StackLayout as c}from"@nativescript/core";import{ExpanderState as l,ExpanderState as u}from"@gjsify/adwaita-core";import{panDownSymbolic as d,panUpSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::expanded`,m=[`prefix`,`suffix`],h=[`prefix`];var AdwExpanderRow=class extends i{static builderSlots=e(h,`row`);isActionRow=!1;_toggle;_disclosure;_state=new u;constructor(e){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new s(1,`auto`));let t=new c;t.orientation=`vertical`,t.className=`adw-expander-disclosure`,t.visibility=`collapse`,o.setRow(t,1),o.setColumn(t,0),o.setColumnSpan(t,3),this.addChild(t),this._disclosure=t;let n=new a;n.iconName=d,n.className=`${n.className} adw-expander-toggle`.trim(),this.add_suffix(n),this._toggle=n,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.iconName=e?f:d;let t={eventName:p,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),n.addEventListener(`tap`,toggleOnTap),r(this,e)}add_row(e){this._disclosure.addChild(e)}remove(e){this._disclosure.removeChild(e)}_addChildFromBuilder(e,n){let r=t(e,m,`row`);r===`row`?this.add_row(n):super._addChildFromBuilder(r,n)}get disclosureRows(){let e=[];for(let t=0;t<this._disclosure.getChildrenCount();t++)e.push(this._disclosure.getChildAt(t));return e}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(n(e,!1))}};export{AdwExpanderRow,l as ExpanderState,p as NOTIFY_EXPANDED};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlBoolean as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{ExpanderState as o,ExpanderState as s}from"@gjsify/adwaita-core";import{GridLayout as c,ItemSpec as l,StackLayout as u}from"@nativescript/core";import{panDownSymbolic as d,panUpSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::expanded`,m=[`prefix`,`suffix`],h=[`prefix`];var AdwExpanderRow=class extends i{static builderSlots=e(h,`row`);isActionRow=!1;_toggle;_disclosure;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new l(1,`auto`));let t=new u;t.orientation=`vertical`,t.className=`adw-expander-disclosure`,t.visibility=`collapse`,c.setRow(t,1),c.setColumn(t,0),c.setColumnSpan(t,3),this.addChild(t),this._disclosure=t;let n=new a;n.iconName=d,n.className=`${n.className} adw-expander-toggle`.trim(),this.add_suffix(n),this._toggle=n,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.iconName=e?f:d;let t={eventName:p,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),n.addEventListener(`tap`,toggleOnTap),r(this,e)}add_row(e){this._disclosure.addChild(e)}remove(e){this._disclosure.removeChild(e)}_addChildFromBuilder(e,n){let r=t(e,m,`row`);r===`row`?this.add_row(n):super._addChildFromBuilder(r,n)}get disclosureRows(){let e=[];for(let t=0;t<this._disclosure.getChildrenCount();t++)e.push(this._disclosure.getChildAt(t));return e}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(n(e,!1))}};export{AdwExpanderRow,o as ExpanderState,p as NOTIFY_EXPANDED};
@@ -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{AdwNavigationPage as r}from"./adw-navigation-page.js";import{NOTIFY_VISIBLE_PAGE as i,NsNavigationStack as a,POPPED as o,PUSHED as s,REPLACED as c,navigationPageClassName as l}from"./navigation-stack.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";import{describeNavigationDiagnostic as f}from"@gjsify/adwaita-core";var AdwNavigationView=class extends n(u){_nav;constructor(e){super(),this.className=`adw-navigation-view`,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`)),this._nav=new a({attachPage:e=>{e.className=l(e.className),u.setColumn(e,0),u.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emitNavigation(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${f(e)}`)}),t(this,e)}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){if(t instanceof r){this.add(t,t.tag,{title:t.title,canPop:t.canPop}),t._setOwner(this);return}this.add(t)}remove(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}push_by_tag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}pop_to_page(e){return this._nav.popToPage(e)}pop_to_tag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replace_with_tags(e){this._nav.replaceWithTags(e)}find_page(e){return this._nav.findPage(e)}get_previous_page(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(t){let n=e(t,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(t){let n=e(t,this.popOnEscape);this._nav.setPopOnEscape(n)}_emitNavigation(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,i as NOTIFY_VISIBLE_PAGE,o as POPPED,s as PUSHED,c as REPLACED};
1
+ 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{AdwNavigationPage as r}from"./adw-navigation-page.js";import{NOTIFY_VISIBLE_PAGE as i,NsNavigationStack as a,POPPED as o,PUSHED as s,REPLACED as c,navigationPageClassName as l}from"./navigation-stack.js";import{describeNavigationDiagnostic as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f}from"@nativescript/core";var AdwNavigationView=class extends n(d){_nav;constructor(e){super(),this.className=`adw-navigation-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`)),this._nav=new a({attachPage:e=>{e.className=l(e.className),d.setColumn(e,0),d.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emitNavigation(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${u(e)}`)}),t(this,e)}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){if(t instanceof r){this.add(t,t.tag,{title:t.title,canPop:t.canPop}),t._setOwner(this);return}this.add(t)}remove(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}push_by_tag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}pop_to_page(e){return this._nav.popToPage(e)}pop_to_tag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replace_with_tags(e){this._nav.replaceWithTags(e)}find_page(e){return this._nav.findPage(e)}get_previous_page(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(t){let n=e(t,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(t){let n=e(t,this.popOnEscape);this._nav.setPopOnEscape(n)}_emitNavigation(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,i as NOTIFY_VISIBLE_PAGE,o as POPPED,s as PUSHED,c as REPLACED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GridLayout as r,ItemSpec as i,Label as a,Slider as o,StackLayout as s}from"@nativescript/core";import{SpinState as c,parseAdjustment as l,snapAdjustmentValue as u}from"@gjsify/adwaita-core";const d=`notify::value`;var AdwSliderRow=class extends n(s){_titleLabel;_valueLabel;_slider;_state=new c;_suppress=!1;constructor(e){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let n=new r;n.className=`adw-slider-header`,n.addRow(new i(1,`auto`)),n.addColumn(new i(1,`star`)),n.addColumn(new i(1,`auto`));let s=new a;s.className=`adw-slider-title`,s.textWrap=!1,r.setColumn(s,0),n.addChild(s);let c=new a;c.className=`adw-slider-value`,c.text=String(this._state.value),r.setColumn(c,1),n.addChild(c);let l=this._state.adjustment,f=new o;f.className=`adw-slider`,f.minValue=l.lower,f.maxValue=l.upper,f.value=l.value,this.addChild(n),this.addChild(f),this._titleLabel=s,this._valueLabel=c,this._slider=f,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:d,object:this,value:e.value};this.notify(t)}else this._sync()}),this._state.subscribeChanged(e=>{this._slider.minValue=e.lower,this._slider.maxValue=e.upper;let t=u(e,this._state.value);t===this._state.value?this._sync():this._state.setValue(t)}),f.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=u(this._state.adjustment,this._slider.value);e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),this._state.setValueInteractive(e)}),t(this,e)}_sync(){this._suppress=!0,this._slider.value=this._state.value,this._suppress=!1,this._valueLabel.text=String(this._state.value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._state.value}set value(t){this._state.setValue(u(this._state.adjustment,e(t,this.value)))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?l(e):e)}get slider(){return this._slider}};export{AdwSliderRow,d as NOTIFY_SLIDER_VALUE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{SpinState as r,parseAdjustment as i,snapAdjustmentValue as a}from"@gjsify/adwaita-core";import{GridLayout as o,ItemSpec as s,Label as c,Slider as l,StackLayout as u}from"@nativescript/core";const d=`notify::value`;var AdwSliderRow=class extends n(u){_titleLabel;_valueLabel;_slider;_state=new r;_suppress=!1;constructor(e){super(),this.orientation=`vertical`,this.className=`adw-slider-row`;let n=new o;n.className=`adw-slider-header`,n.addRow(new s(1,`auto`)),n.addColumn(new s(1,`star`)),n.addColumn(new s(1,`auto`));let r=new c;r.className=`adw-slider-title`,r.textWrap=!1,o.setColumn(r,0),n.addChild(r);let i=new c;i.className=`adw-slider-value`,i.text=String(this._state.value),o.setColumn(i,1),n.addChild(i);let u=this._state.adjustment,f=new l;f.className=`adw-slider`,f.minValue=u.lower,f.maxValue=u.upper,f.value=u.value,this.addChild(n),this.addChild(f),this._titleLabel=r,this._valueLabel=i,this._slider=f,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:d,object:this,value:e.value};this.notify(t)}else this._sync()}),this._state.subscribeChanged(e=>{this._slider.minValue=e.lower,this._slider.maxValue=e.upper;let t=a(e,this._state.value);t===this._state.value?this._sync():this._state.setValue(t)}),f.addEventListener(`valueChange`,()=>{if(this._suppress)return;let e=a(this._state.adjustment,this._slider.value);e!==this._slider.value&&(this._suppress=!0,this._slider.value=e,this._suppress=!1),this._state.setValueInteractive(e)}),t(this,e)}_sync(){this._suppress=!0,this._slider.value=this._state.value,this._suppress=!1,this._valueLabel.text=String(this._state.value)}get title(){return this._titleLabel.text??``}set title(e){this._titleLabel.text=e??``}get value(){return this._state.value}set value(t){this._state.setValue(a(this._state.adjustment,e(t,this.value)))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?i(e):e)}get slider(){return this._slider}};export{AdwSliderRow,d as NOTIFY_SLIDER_VALUE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{Label as o,StackLayout as s}from"@nativescript/core";import{SpinState as c,SpinState as l,parseAdjustment as u}from"@gjsify/adwaita-core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new l;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new s;t.orientation=`horizontal`,t.className=`adw-spin-control`;let n=new o;n.className=`adw-spin-value`,n.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let c=new a;c.iconName=f,c.className=`${c.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(n),t.addChild(i),t.addChild(c),this.add_suffix(t),this._minusButton=i,this._plusButton=c,this._valueLabel=n,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),c.addEventListener(`tap`,()=>this._state.increment()),r(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(n(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?u(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,c as SpinState};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{SpinState as o,SpinState as s,parseAdjustment as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new u;t.orientation=`horizontal`,t.className=`adw-spin-control`;let n=new l;n.className=`adw-spin-value`,n.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let o=new a;o.iconName=f,o.className=`${o.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(n),t.addChild(i),t.addChild(o),this.add_suffix(t),this._minusButton=i,this._plusButton=o,this._valueLabel=n,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),o.addEventListener(`tap`,()=>this._state.increment()),r(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(n(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?c(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,o as SpinState};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{ActivityIndicator as i,GridLayout as a,ItemSpec as o}from"@nativescript/core";import{resolveSpinnerSize as s,spinnerGeometry as c}from"@gjsify/adwaita-core";var AdwSpinner=class extends n(a){_indicator;_size=r;_spinning=!0;constructor(e){super(),this.className=`adw-spinner`,this.addRow(new o(1,`star`)),this.addColumn(new o(1,`star`));let n=new i;n.className=`adw-spinner-ring`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,this._indicator=n,this.addChild(n),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning(),t(this,e)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=c(this._size,this._size);this._indicator.width=e,this._indicator.height=e}_applySpinning(){let e=this.isLoaded!==!1;this._indicator.busy=this._spinning&&e}get spinning(){return this._spinning}set spinning(t){this._spinning=e(t,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=s(e),this._applySize()}get ringDiameter(){return c(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{DEFAULT_SPINNER_SIZE as r}from"./chrome.js";import{resolveSpinnerSize as i,spinnerGeometry as a}from"@gjsify/adwaita-core";import{ActivityIndicator as o,GridLayout as s,ItemSpec as c}from"@nativescript/core";var AdwSpinner=class extends n(s){_indicator;_size=r;_spinning=!0;constructor(e){super(),this.className=`adw-spinner`,this.addRow(new c(1,`star`)),this.addColumn(new c(1,`star`));let n=new o;n.className=`adw-spinner-ring`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,this._indicator=n,this.addChild(n),this.accessibilityRole=`progressbar`,this.accessibilityState=`busy`,this.addEventListener(`loaded`,()=>this._applySpinning()),this.addEventListener(`unloaded`,()=>{this._indicator.busy=!1}),this._applySize(),this._applySpinning(),t(this,e)}_applySize(){this.width=this._size,this.height=this._size;let{diameter:e}=a(this._size,this._size);this._indicator.width=e,this._indicator.height=e}_applySpinning(){let e=this.isLoaded!==!1;this._indicator.busy=this._spinning&&e}get spinning(){return this._spinning}set spinning(t){this._spinning=e(t,!1),this._applySpinning()}get size(){return this._size}set size(e){this._size=i(e),this._applySize()}get ringDiameter(){return a(this._size,this._size).diameter}};export{AdwSpinner,r as DEFAULT_SPINNER_SIZE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{MENU_CANCEL_LABEL as a,presentMenuSheet as o,refuseMenuString as s}from"./menu-sheet.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p,action as m}from"@nativescript/core";import{ADW_MENU_SURFACE_NATIVESCRIPT as h,SPLIT_BUTTON_DISABLED_OPACITY as g,SplitButtonState as _,assertMenuRenderable as v}from"@gjsify/adwaita-core";const y=`clicked`,b=`menuTapped`;var AdwSplitButton=class extends n(u){_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new _;_actions=null;_showingIcon=!1;_sensitive=!0;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new d(1,`auto`)),this.addColumn(new d(1,`auto`)),this.addRow(new d(1,`auto`));let n=new p;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,u.setColumn(n,0);let a=new f;a.className=`adw-split-button-label`,a.verticalAlignment=`middle`,n.addChild(a);let o=new r;o.className=`${o.className} adw-split-button-action-icon`.trim(),o.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=a,this._actionIcon=o;let s=new u;s.className=`adw-split-button-dropdown`,s.addColumn(new d(1,`star`)),s.addRow(new d(1,`star`)),u.setColumn(s,1);let c=new r;c.className=`${c.className} adw-split-button-chevron`.trim(),c.iconName=l(this._state.direction),c.horizontalAlignment=`center`,c.verticalAlignment=`middle`,s.addChild(c),this.addChild(s),this._dropdownPart=s,this._chevron=c,n.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:y,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}async _openMenu(){if(!this._sensitive||this._state.open||!this._state.dropdownEnabled)return;this._state.toggleMenu();let e=await o(m,this._state.menuModel??[],{title:this._state.label??void 0,actions:this._actions??void 0,cancelLabel:a}),t=e===null?null:this._state.activateMenuItem(e);if(t===null||e===null){this._state.closeMenu();return}let n={eventName:b,object:this,item:t.label,id:t.id??t.label,path:e,action:t.action};this.notify(n)}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.iconName=n??``:this._actionLabel.text=t??``,a!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(a?this._actionIcon:this._actionLabel),this._showingIcon=a),this._chevron.iconName=l(r),this._dropdownPart.opacity=i?1:g,this.opacity=this._sensitive?1:g}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){c(this._state,e)}get menuModel(){return this._state.menuModel??[]}set menuModel(e){s(e,`AdwSplitButton`),this._state.setMenuModel(e),v(this._state.menuModel??[],h)}get actions(){return this._actions}set actions(e){this._actions=e??null}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,y as CLICKED,b as MENU_TAPPED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{MENU_CANCEL_LABEL as a,presentMenuSheet as o,refuseMenuString as s}from"./menu-sheet.js";import{setActionIcon as c,splitButtonArrowSvg as l}from"./split-button.js";import{ADW_MENU_SURFACE_NATIVESCRIPT as u,SPLIT_BUTTON_DISABLED_OPACITY as d,SplitButtonState as f,assertMenuRenderable as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _,action as v}from"@nativescript/core";const y=`clicked`,b=`menuTapped`;var AdwSplitButton=class extends n(m){_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new f;_actions=null;_showingIcon=!1;_sensitive=!0;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 a=new g;a.className=`adw-split-button-label`,a.verticalAlignment=`middle`,n.addChild(a);let o=new r;o.className=`${o.className} adw-split-button-action-icon`.trim(),o.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=a,this._actionIcon=o;let s=new m;s.className=`adw-split-button-dropdown`,s.addColumn(new h(1,`star`)),s.addRow(new h(1,`star`)),m.setColumn(s,1);let c=new r;c.className=`${c.className} adw-split-button-chevron`.trim(),c.iconName=l(this._state.direction),c.horizontalAlignment=`center`,c.verticalAlignment=`middle`,s.addChild(c),this.addChild(s),this._dropdownPart=s,this._chevron=c,n.addEventListener(`tap`,()=>{if(!this._sensitive)return;let e={eventName:y,object:this};this.notify(e)}),s.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(s),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}async _openMenu(){if(!this._sensitive||this._state.open||!this._state.dropdownEnabled)return;this._state.toggleMenu();let e=await o(v,this._state.menuModel??[],{title:this._state.label??void 0,actions:this._actions??void 0,cancelLabel:a}),t=e===null?null:this._state.activateMenuItem(e);if(t===null||e===null){this._state.closeMenu();return}let n={eventName:b,object:this,item:t.label,id:t.id??t.label,path:e,action:t.action};this.notify(n)}_render(){let{mode:e,label:t,iconName:n,direction:r,dropdownEnabled:i}=this._state,a=e===`icon`;a?this._actionIcon.iconName=n??``:this._actionLabel.text=t??``,a!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(a?this._actionIcon:this._actionLabel),this._showingIcon=a),this._chevron.iconName=l(r),this._dropdownPart.opacity=i?1:d,this.opacity=this._sensitive?1:d}get label(){return this._state.label??``}set label(e){this._state.setLabel(e??``)}get iconName(){return this._state.iconName??``}set iconName(e){c(this._state,e)}get menuModel(){return this._state.menuModel??[]}set menuModel(e){s(e,`AdwSplitButton`),this._state.setMenuModel(e),p(this._state.menuModel??[],u)}get actions(){return this._actions}set actions(e){this._actions=e??null}get direction(){return this._state.direction}set direction(e){this._state.setDirection(e)}get dropdownTooltip(){return this._state.dropdownTooltip}set dropdownTooltip(e){this._state.setDropdownTooltip(e??``)}get useUnderline(){return this._state.useUnderline}set useUnderline(t){let n=e(t,this.useUnderline);this._state.setUseUnderline(!!n)}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,y as CLICKED,b as MENU_TAPPED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.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{classNameWith as i,normalizeStyleClasses as a,withCssClass as o,withoutCssClass as s}from"./style-classes.js";import{statusPageIconVisibility as c,statusPageLabelVisibility as l}from"./status-page-content.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";const m=`adw-status-page`;var AdwStatusPage=class extends n(u){static builderSlots=e([`child`],`child`);_stack;_icon;_iconName=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;_styleClasses=[];constructor(e){super(),this.className=m,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`));let n=new p;n.orientation=`vertical`,n.className=`adw-status-page-content`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,u.setColumn(n,0),u.setRow(n,0),this.addChild(n),this._stack=n;let i=new r;i.className=`${i.className} adw-status-page-icon`.trim(),i.horizontalAlignment=`center`,i.iconColor=`#9b9b9b`,i.pixelSize=96,i.visibility=c(this._iconName),this._icon=i;let a=new f;a.className=`adw-status-page-icon-glyph`,a.horizontalAlignment=`center`,a.visibility=c(this._iconGlyph),this._iconLabel=a;let o=new f;o.className=`adw-status-page-title`,o.horizontalAlignment=`center`,o.textWrap=!0,o.visibility=l(o.text),this._titleLabel=o;let s=new f;s.className=`adw-status-page-description`,s.horizontalAlignment=`center`,s.textWrap=!0,s.visibility=l(s.text),this._descriptionLabel=s;for(let e of[i,a,o,s])n.addChild(e);t(this,e)}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._icon.iconName=this._iconName,this._icon.visibility=c(this._iconName),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=c(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=l(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=l(t)}set_child(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}set child(e){this.set_child(e)}_addChildFromBuilder(e,t){this.set_child(t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(a(e))}add_css_class(e){this._setClasses(o(this._styleClasses,e))}remove_css_class(e){this._setClasses(s(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(a([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=i(m,e)}};export{AdwStatusPage};
1
+ import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{classNameWith as r,normalizeStyleClasses as i,withCssClass as a,withoutCssClass as o}from"./style-classes.js";import{GtkImage as s}from"./gtk-image.js";import{statusPageIconVisibility as c,statusPageLabelVisibility as l}from"./status-page-content.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";const m=`adw-status-page`;var AdwStatusPage=class extends n(u){static builderSlots=e([`child`],`child`);_stack;_icon;_iconName=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;_styleClasses=[];constructor(e){super(),this.className=m,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`));let n=new p;n.orientation=`vertical`,n.className=`adw-status-page-content`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,u.setColumn(n,0),u.setRow(n,0),this.addChild(n),this._stack=n;let r=new s;r.className=`${r.className} adw-status-page-icon`.trim(),r.horizontalAlignment=`center`,r.iconColor=`#9b9b9b`,r.pixelSize=128,r.visibility=c(this._iconName),this._icon=r;let i=new f;i.className=`adw-status-page-icon-glyph`,i.horizontalAlignment=`center`,i.visibility=c(this._iconGlyph),this._iconLabel=i;let a=new f;a.className=`adw-status-page-title`,a.horizontalAlignment=`center`,a.textWrap=!0,a.visibility=l(a.text),this._titleLabel=a;let o=new f;o.className=`adw-status-page-description`,o.horizontalAlignment=`center`,o.textWrap=!0,o.visibility=l(o.text),this._descriptionLabel=o;for(let e of[r,i,a,o])n.addChild(e);t(this,e)}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._icon.iconName=this._iconName,this._icon.visibility=c(this._iconName),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=c(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=l(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=l(t)}set_child(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}set child(e){this.set_child(e)}_addChildFromBuilder(e,t){this.set_child(t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(i(e))}add_css_class(e){this._setClasses(a(this._styleClasses,e))}remove_css_class(e){this._setClasses(o(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(i([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=r(m,e)}};export{AdwStatusPage};
@@ -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{SwitchRowState as n}from"./row-state.js";import{AdwActionRow as r}from"./adw-action-row.js";import{Switch as i}from"@nativescript/core";const a=`notify::active`;var AdwSwitchRow=class extends r{_switch;_switchState=new n;constructor(e){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new i;n.className=`adw-switch`,this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>this._apply(this._switchState.setActive(n.checked))),t(this,e)}get active(){return this._switchState.active}set active(t){this._apply(this._switchState.setActive(e(t,!1)))}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:a,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,a as NOTIFY_ACTIVE};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{SwitchRowState as n,switchClassName as r}from"./row-state.js";import{AdwActionRow as i}from"./adw-action-row.js";import{Switch as a}from"@nativescript/core";const o=`notify::active`;var AdwSwitchRow=class extends i{_switch;_switchState=new n;constructor(e){super(),this.className=`adw-row adw-action-row adw-switch-row`;let n=new a;n.className=r(!1),this.add_suffix(n),this._switch=n,this.activatableWidget=n,this.activatable=!0,n.addEventListener(`checkedChange`,()=>{n.className=r(n.checked),this._apply(this._switchState.setActive(n.checked))}),t(this,e)}get active(){return this._switchState.active}set active(t){this._apply(this._switchState.setActive(e(t,!1)))}activate(){this.activatable&&(this._apply(this._switchState.activate()),super.activate())}_apply(e){if(!e)return;this._switch.checked=this._switchState.active;let t={eventName:o,object:this,active:this._switchState.active};this.notify(t)}};export{AdwSwitchRow,o as NOTIFY_ACTIVE};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";import{tabIconState as _}from"@gjsify/adwaita-core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(p){_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(e){super(),this.className=`adw-tab-view`,this.addColumn(new m(1,`star`)),this.addRow(new m(1,`auto`)),this.addRow(new m(1,`star`));let n=new g;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,p.setRow(n,0),this.addChild(n),this._bar=n;let r=new p;r.addColumn(new m(1,`star`)),r.addRow(new m(1,`star`)),p.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),t(this,e)}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(e))}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new g;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new h;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(p.setColumn(u,0),p.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=_(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){s(this._state);let e=u(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{tabIconState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(m){_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(e){super(),this.className=`adw-tab-view`,this.addColumn(new h(1,`star`)),this.addRow(new h(1,`auto`)),this.addRow(new h(1,`star`));let n=new _;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,m.setRow(n,0),this.addChild(n),this._bar=n;let r=new m;r.addColumn(new h(1,`star`)),r.addRow(new h(1,`star`)),m.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),t(this,e)}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(e))}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new _;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new g;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(m.setColumn(u,0),m.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=p(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){s(this._state);let e=u(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Button as n,GridLayout as r,ItemSpec as i,Label as a}from"@nativescript/core";import{AdwToast as o,AdwToast as s,AdwToastQueue as c,AdwToastQueue as l,DEFAULT_TOAST_TIMEOUT as u}from"@gjsify/adwaita-core";const d=`toastButtonClicked`,f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t(r){_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(t){super(),this.className=`adw-toast-overlay`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let o=new r;o.className=`adw-toast`,o.visibility=`collapse`,o.verticalAlignment=`bottom`,o.horizontalAlignment=`center`,o.addColumn(new i(1,`star`)),o.addColumn(new i(1,`auto`)),o.addRow(new i(1,`auto`)),r.setColumn(o,0),r.setRow(o,0);let s=new a;s.className=`adw-toast-title`,s.textWrap=!0,r.setColumn(s,0),o.addChild(s),this._toastLabel=s;let c=new n;c.className=`adw-toast-button`,c.set(`androidElevation`,0),r.setColumn(c,1),c.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=c,this.addChild(o),this._toastStrip=o,this._queue=new l({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,t)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),r.setColumn(e,0),r.setRow(e,0),this.insertChild(e,0))}get child(){return this._content}set child(e){this.set_child(e)}add_toast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new s(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get visible(){return this._queue.showing}};export{o as AdwToast,AdwToastOverlay,c as AdwToastQueue,u as DEFAULT_TOAST_TIMEOUT,d as TOAST_BUTTON_CLICKED};
1
+ import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{AdwToast as n,AdwToast as r,AdwToastQueue as i,AdwToastQueue as a,DEFAULT_TOAST_TIMEOUT as o}from"@gjsify/adwaita-core";import{Button as s,GridLayout as c,ItemSpec as l,Label as u}from"@nativescript/core";const d=`toastButtonClicked`,f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t(c){_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(t){super(),this.className=`adw-toast-overlay`,this.addColumn(new l(1,`star`)),this.addRow(new l(1,`star`));let n=new c;n.className=`adw-toast`,n.visibility=`collapse`,n.verticalAlignment=`bottom`,n.horizontalAlignment=`center`,n.addColumn(new l(1,`star`)),n.addColumn(new l(1,`auto`)),n.addRow(new l(1,`auto`)),c.setColumn(n,0),c.setRow(n,0);let r=new u;r.className=`adw-toast-title`,r.textWrap=!0,c.setColumn(r,0),n.addChild(r),this._toastLabel=r;let i=new s;i.className=`adw-toast-button`,i.set(`androidElevation`,0),c.setColumn(i,1),i.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=i,this.addChild(n),this._toastStrip=n,this._queue=new a({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,t)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),c.setColumn(e,0),c.setRow(e,0),this.insertChild(e,0))}get child(){return this._content}set child(e){this.set_child(e)}add_toast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new r(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get toastShowing(){return this._queue.showing}};export{n as AdwToast,AdwToastOverlay,i as AdwToastQueue,o as DEFAULT_TOAST_TIMEOUT,d as TOAST_BUTTON_CLICKED};
@@ -1 +1 @@
1
- import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{Label as a,StackLayout as o}from"@nativescript/core";import{ToggleGroupState as s,ToggleGroupState as c,keptToggles as l,toggleIndexOfName as u}from"@gjsify/adwaita-core";const d=`notify::selected`;var AdwToggleGroup=class extends n(o){_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new c;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),t(this,e)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=l(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new o;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new a;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=u(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,s as ToggleGroupState};
1
+ import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{ToggleGroupState as a,ToggleGroupState as o,keptToggles as s,toggleIndexOfName as c}from"@gjsify/adwaita-core";import{Label as l,StackLayout as u}from"@nativescript/core";const d=`notify::selected`;var AdwToggleGroup=class extends n(u){_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new o;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),t(this,e)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=s(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new u;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new l;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=c(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,a as ToggleGroupState};