@gjsify/adwaita-nativescript 0.64.13 → 0.64.15-next.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/builder/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/name-selector.js +1 -0
- package/lib/esm/namespace/gio.js +1 -1
- package/lib/esm/namespace/gtk.js +1 -1
- package/lib/esm/platform-host.js +1 -1
- package/lib/esm/widgets/adw-about-dialog.js +3 -3
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-button-row.js +1 -1
- package/lib/esm/widgets/adw-entry-row.js +1 -1
- package/lib/esm/widgets/adw-image-button.js +1 -1
- package/lib/esm/widgets/adw-preferences-group.js +1 -1
- package/lib/esm/widgets/adw-split-button.js +1 -1
- package/lib/esm/widgets/bin-layout.js +1 -0
- package/lib/esm/widgets/box-layout.js +1 -1
- package/lib/esm/widgets/css-names.js +1 -0
- package/lib/esm/widgets/gtk-box.js +1 -1
- package/lib/esm/widgets/gtk-button.js +1 -1
- package/lib/esm/widgets/gtk-check-button.js +1 -1
- package/lib/esm/widgets/gtk-entry.js +1 -1
- package/lib/esm/widgets/gtk-label.js +2 -2
- package/lib/esm/widgets/gtk-menu-button.js +1 -1
- package/lib/esm/widgets/gtk-popover-menu.js +1 -1
- package/lib/esm/widgets/gtk-scrolled-window.js +1 -1
- package/lib/esm/widgets/gtk-stack.js +1 -1
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/label-markup-native.android.js +1 -0
- package/lib/esm/widgets/label-markup-native.ios.js +1 -0
- package/lib/esm/widgets/label-markup-native.js +1 -0
- package/lib/esm/widgets/label-markup.js +1 -1
- package/lib/esm/widgets/menu-slot.js +1 -0
- package/lib/esm/widgets/popup-menu-view.js +1 -1
- package/lib/esm/widgets/popup-menu.js +1 -1
- package/lib/esm/widgets/scrolled-window-policy.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/single-child-base.js +1 -1
- package/lib/esm/widgets/single-child-cell.js +1 -1
- package/lib/esm/widgets/widget-layout.js +1 -1
- package/lib/types/button-bin.spec.d.ts +2 -0
- package/lib/types/css-names.spec.d.ts +1 -0
- package/lib/types/entry-properties.spec.d.ts +1 -0
- package/lib/types/index.d.ts +4 -2
- package/lib/types/menu-button-properties.spec.d.ts +2 -0
- package/lib/types/menu-model-door.spec.d.ts +1 -0
- package/lib/types/menu-model-route-d.node-gi.spec.d.ts +2 -0
- package/lib/types/name-selector.d.ts +20 -0
- package/lib/types/name-selector.spec.d.ts +2 -0
- package/lib/types/namespace/gio.d.ts +1 -1
- package/lib/types/template-xalign.spec.d.ts +2 -0
- package/lib/types/testing/ns-core.d.mts +30 -0
- package/lib/types/widgets/actions.d.ts +3 -3
- package/lib/types/widgets/adw-about-dialog.d.ts +2 -0
- package/lib/types/widgets/adw-action-row.d.ts +2 -0
- package/lib/types/widgets/adw-alert-dialog.d.ts +2 -0
- package/lib/types/widgets/adw-avatar.d.ts +2 -0
- package/lib/types/widgets/adw-banner.d.ts +2 -0
- package/lib/types/widgets/adw-bottom-sheet.d.ts +2 -0
- package/lib/types/widgets/adw-button-content.d.ts +2 -0
- package/lib/types/widgets/adw-carousel.d.ts +2 -0
- package/lib/types/widgets/adw-clamp.d.ts +2 -0
- package/lib/types/widgets/adw-data-grid.d.ts +2 -0
- package/lib/types/widgets/adw-header-bar.d.ts +2 -0
- package/lib/types/widgets/adw-image-button.d.ts +4 -2
- package/lib/types/widgets/adw-navigation-page.d.ts +2 -0
- package/lib/types/widgets/adw-navigation-view.d.ts +2 -0
- package/lib/types/widgets/adw-preferences-group.d.ts +2 -0
- package/lib/types/widgets/adw-preferences-page.d.ts +2 -0
- package/lib/types/widgets/adw-shortcut-label.d.ts +2 -0
- package/lib/types/widgets/adw-sidebar.d.ts +2 -0
- package/lib/types/widgets/adw-slider-row.d.ts +2 -0
- package/lib/types/widgets/adw-spinner.d.ts +2 -0
- package/lib/types/widgets/adw-split-button.d.ts +49 -24
- package/lib/types/widgets/adw-status-page.d.ts +2 -0
- package/lib/types/widgets/adw-tab-view.d.ts +2 -0
- package/lib/types/widgets/adw-toast-overlay.d.ts +2 -0
- package/lib/types/widgets/adw-toggle-group.d.ts +2 -0
- package/lib/types/widgets/adw-toggle.d.ts +2 -0
- package/lib/types/widgets/adw-toolbar-view.d.ts +2 -0
- package/lib/types/widgets/adw-view-stack.d.ts +2 -0
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +2 -0
- package/lib/types/widgets/adw-window-title.d.ts +2 -0
- package/lib/types/widgets/adw-wrap-box.d.ts +2 -0
- package/lib/types/widgets/bin-layout.d.ts +12 -0
- package/lib/types/widgets/box-layout.d.ts +37 -0
- package/lib/types/widgets/carousel-indicator-base.d.ts +2 -0
- package/lib/types/widgets/css-names.d.ts +9 -0
- package/lib/types/widgets/gtk-action-bar.d.ts +2 -0
- package/lib/types/widgets/gtk-box.d.ts +11 -5
- package/lib/types/widgets/gtk-button.d.ts +8 -5
- package/lib/types/widgets/gtk-drop-down.d.ts +2 -0
- package/lib/types/widgets/gtk-entry.d.ts +64 -34
- package/lib/types/widgets/gtk-image.d.ts +2 -0
- package/lib/types/widgets/gtk-label.d.ts +26 -0
- package/lib/types/widgets/gtk-menu-button.d.ts +33 -18
- package/lib/types/widgets/gtk-popover-menu.d.ts +9 -7
- package/lib/types/widgets/gtk-scrolled-window.d.ts +9 -0
- package/lib/types/widgets/gtk-stack.d.ts +2 -0
- package/lib/types/widgets/gtk-text-view.d.ts +2 -0
- package/lib/types/widgets/index.d.ts +1 -2
- package/lib/types/widgets/label-markup-native.android.d.ts +5 -0
- package/lib/types/widgets/label-markup-native.d.ts +19 -0
- package/lib/types/widgets/label-markup-native.ios.d.ts +5 -0
- package/lib/types/widgets/label-markup.d.ts +62 -1
- package/lib/types/widgets/menu-slot.d.ts +51 -0
- package/lib/types/widgets/popup-menu-view.d.ts +3 -2
- package/lib/types/widgets/popup-menu.d.ts +8 -6
- package/lib/types/widgets/scrolled-window-policy.d.ts +4 -2
- package/lib/types/widgets/signals.d.ts +2 -0
- package/lib/types/widgets/single-child-base.d.ts +3 -0
- package/lib/types/widgets/single-child-cell.d.ts +10 -5
- package/lib/types/widgets/split-view-base.d.ts +2 -0
- package/lib/types/widgets/stack-page.d.ts +2 -0
- package/lib/types/widgets/styled-layout-base.d.ts +2 -0
- package/lib/types/widgets/view-stack-page.d.ts +2 -0
- package/lib/types/widgets/view-switcher-base.d.ts +2 -0
- package/lib/types/widgets/widget-layout.d.ts +2 -0
- package/package.json +20 -15
- package/src/testing/ns-core.mts +58 -0
- package/src/theme/adwaita.css +24 -11
package/lib/esm/builder/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{capabilities as e}from"../capabilities.js";import{observeWindowSize as t}from"../widgets/breakpoint.js";import{gtypeNameOf as n,gtypeNameOfInstance as r}from"../widgets/gtype-name.js";import{declaredBuilderReferences as i,declaredBuilderSlots as a}from"../widgets/builder-slots.js";import{gtkPropertyRefusal as o,hasGtkProperty as s,readGtkProperty as c,writeGtkProperty as l}from"../widgets/shadowed-properties.js";import{emittedSignalsOf as u}from"../widgets/signals.js";import{authoredParamValue as d}from"./param-values.js";import{registerTemplateClass as f,templateClassFor as p}from"./template-classes.js";import{adw_exports as m}from"../namespace/adw.js";import{gtk_exports as h}from"../namespace/gtk.js";import{createBreakpointDriver as g,menuAssignments as _,parseBreakpointCondition as v,registeredDefaultTranslate as y}from"@gjsify/adwaita-core";import{assertTreeConstructs as b}from"@gjsify/adwaita-core/conformance";import{propertyOf as x}from"@gjsify/adwaita-core/tags";import{View as S}from"@nativescript/core";const C=[{prefix:`adw`,library:`Adw`,namespace:m},{prefix:`gtk`,library:`Gtk`,namespace:h}];function registerBarrel(e,t,n){let r=C.find(t=>t.prefix===e);if(r!==void 0&&r.library!==t)throw Error(`The prefix '${e}' already names \`${r.library}\`; it cannot also name \`${t}\`.`);r===void 0?C.push({prefix:e,library:t,namespace:n}):r.namespace=n}const w={GtkPopoverMenuBar:`Android has no menu-bar surface, and a row of PopupMenus would be a design choice, not GTK's widget (ADR 0097 § 2). Use a GtkMenuButton or a GtkPopoverMenu.`};function elementFor(e){let t=w[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...C].sort((e,t)=>t.library.length-e.library.length);for(let{prefix:t,library:i,namespace:a}of r){if(!e.startsWith(i))continue;let r=e.slice(i.length),o=a[r];if(typeof o!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${r}' — 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(n(o)!==e)throw Error(`'${t}:${r}' resolves to class \`${n(o)}\`, 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}:${r}`,ctor:o}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${C.map(e=>e.prefix).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:p(e.tag)}:elementFor(e.tag)}function translated(e,t,n){return n===void 0||e===void 0||typeof t!=`string`?t:e(t,n.context)}function build(e,t={}){refuseSiblings(e,`build`);let n=buildTree(e,t).root;if(!(n instanceof S))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={}){refuseSiblings(e,`buildDialog`);let n=buildTree(e,t).root;if(n instanceof S||typeof n.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return n}function buildWithSiblings(e,t={}){let n=buildTree(e,t,!0);if(!(n.root instanceof S))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return{root:n.root,siblings:n.siblings,objects:n.objects}}function buildInto(e,t,n={}){let r=elementOf(t);if(!(e instanceof r.ctor))throw Error(`\`buildInto\` was handed a ${e.constructor.name}, and the tree's root is \`${t.tag}\`: a template builds into an instance of the class it extends (<${r.xmlName}>).`);return buildTree(t,n,!0,e).objects}function refuseSiblings(e,t){if((e.siblings?.length??0)!==0)throw Error(`\`${e.tag}\` carries ${e.siblings.length} sibling object(s), and \`${t}\` returns one object so they would be built and lost. Use \`buildWithSiblings\`, which hands them back by id.`)}function buildTree(n,r,i=!1,a){b(`adwaita-nativescript`,e,n,Object.keys(E));let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate??y(),values:i?new Map:void 0},s=buildNode(n,o,a),c=new Map;for(let e of n.siblings??[]){if(e.id===void 0)throw Error(`the sibling \`${e.tag}\` has no id, so nothing could ever ask for it: give it one in the .blp.`);c.set(e.id,buildNode(e,o))}for(let{view:e,element:t,prop:n,id:r}of o.pending){let i=o.ids.get(r);if(i===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.`);l(e,n,i)}for(let e of o.binds)bindProperty(e,o);for(let e of o.breakpointHosts)bindBreakpoints(e,o);return{root:s,siblings:c,objects:new Map([...o.ids,...o.values??[]])}}function bindProperty(e,t){let{target:n,element:r,property:i,source:a,sourceProperty:d,flags:f}=e,p=`<${r.xmlName}> \`${i}: bind ${a}.${d}\``,m=t.template,h=a===`template`&&m!==void 0?m.instance:t.ids.get(a);if(h===void 0)throw Error(`${p} names no object: nothing in this tree has the id '${a}'.`);if(f.length>0&&m===void 0)throw Error(`${p} carries ${f.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let g=x(d),_=x(i),v=u(h.constructor),y=`notify::${d}`;if(!s(h,g)||!v.includes(y))throw Error(`${p}: ${h.constructor.name} does not emit '${y}', so the target would follow the source once and never again. It emits: ${v.join(`, `)||`none`}.`);if(!s(n,_)){let e=o(n,_);throw Error(`${p}: the target has no property '${_}'.${e===null?``:` ${e}`}`)}if(m!==void 0){bindThroughEngine(m,{...e,from:h,where:p,notification:y});return}let follow=()=>l(n,_,c(h,g));follow(),h.connect(y,follow)}function engineFlags(e,t){for(let n of e)if(n!==`bidirectional`&&n!==`inverted`&&n!==`no-sync-create`)throw Error(`${t} carries the unknown flag '${n}'.`);let n=e.includes(`no-sync-create`)?[]:[`sync-create`];return e.includes(`bidirectional`)&&n.push(`bidirectional`),e.includes(`inverted`)&&n.push(`invert-boolean`),n}function viaProperties(e){let key=e=>typeof e==`string`?x(e):e;return new Proxy(e,{get(e,t){let n=typeof t==`string`&&s(e,key(t))?c(e,key(t)):Reflect.get(e,key(t));return typeof n==`function`?n.bind(e):n},set(e,t,n){return typeof t==`string`?(l(e,x(t),n),!0):Reflect.set(e,t,n)}})}function bindThroughEngine(e,t){let{target:n,from:r,property:i,sourceProperty:a,flags:o,where:s}=t,c=engineFlags(o,s),l=u(n.constructor);if(c.includes(`bidirectional`)&&!l.includes(`notify::${i}`))throw Error(`${s}: bidirectional, but ${n.constructor.name} does not emit 'notify::${i}', so the source would never follow the target back. It emits: ${l.join(`, `)||`none`}.`);e.bind(viaProperties(r),a,viaProperties(n),i,c)}function bindBreakpoints({view:e,element:t,node:n},r){if(!(e instanceof S))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,r.translate)}function applyBreakpoints(e,n,i,a={}){wireBreakpoints(r(e),e,n,new Map(Object.entries(i)),a.observeSize??t,a.translate??y())}function wireBreakpoints(e,t,n,r,i,a){let u=g(n.map(t=>{if(v(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(!s(n,x(t.property))){let e=o(n,x(t.property));throw Error(`${i}: the target declares no '${x(t.property)}'.`+(e===null?``:` ${e}`))}let c=translated(a,t.value,t.translatable),l=d(n,x(t.property),c,i);return{object:n,property:t.property,value:{authored:l===null?String(c):l.value}}})}}),{read:(e,t)=>({original:c(e,x(t))}),write(e,t,n){let r=n;l(e,x(t),`authored`in r?r.authored:r.original)}});i(t,e=>u.evaluate(e))}function buildNode(e,t,n){let r=elementOf(e),i=n??new r.ctor,a=i instanceof S?buildView(e,r,i,t):buildValue(e,r,i,t);bindSignals(a,r,e,t);for(let[n,i]of Object.entries(e.bindings??{}))t.binds.push({target:a,element:r,property:n,source:i.source,sourceProperty:i.property,flags:i.flags??[]});e.breakpoints!==void 0&&t.breakpointHosts.push({view:a,element:r,node:e});for(let n of e.children??[]){let i=a;if(typeof i._addChildFromBuilder!=`function`)throw Error(`<${r.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);let o=buildNode(n,t);applyLayout(n,o,r,e.tag),i._addChildFromBuilder(builderNameFor(r,e.tag,n),o)}return a}function bindSignals(e,t,n,r){if(n.signals===void 0)return;let i=u(t.ctor),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`}.`);let o=(e.flags??[]).filter(e=>r.template===void 0||e!==`swapped`);if(e.object!==void 0||o.length>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.`);if(r.template!==void 0){a.connect(n,r.template.handler(e.handler,{flags:e.flags}));continue}let s=r.scope?.[e.handler];if(typeof s!=`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)=>s.apply(r.scope,e))}}const T={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 S))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=T[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(T).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,a){let s=o(a,r);return Error(s===null?`<${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.`:`<${e.xmlName} ${n}="${String(i)}"> reaches nothing on \`${t}\`: ${s}`)}function buildView(e,t,n,r){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(r.ids.has(e.id)||r.values?.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.ids.set(e.id,n),n.id=e.id}let a=i(t.ctor);for(let[i,a]of _(e,r.menus)){let r=x(i);if(!s(n,r))throw unknownProperty(t,e.tag,i,r,i,n);l(n,r,a)}for(let[i,o]of Object.entries(e.props??{})){if(i===`menu-model`)continue;let c=x(i);if(!s(n,c))throw unknownProperty(t,e.tag,i,c,o,n);if(a.includes(c)){r.pending.push({view:n,element:t,prop:c,id:String(o)});continue}let u=translated(r.translate,o,e.translatable?.[i]),f=d(n,c,u,`<${t.xmlName} ${i}="${String(u)}">`);l(n,c,f===null?String(u):f.value)}if(e.styleClasses!==void 0&&e.styleClasses.length>0){if(!(`styleClasses`in n))throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` declares no 'styleClasses', so [${e.styleClasses.join(`, `)}] would be dropped.`);n.styleClasses=e.styleClasses.join(` `)}if(applyAccessibility(n,e,r),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(n,t,e,r),n}const E={label:`accessibilityLabel`,description:`accessibilityHint`};function applyAccessibility(e,t,n){for(let[r,i]of Object.entries(t.accessibility??{}))e[E[r]]=String(translated(n.translate,i.value,i.translatable))}function buildValue(e,t,n,r){if(e.id!==void 0&&r.values===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. \`buildWithSiblings\` hands every object back by id.`);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.`);if(e.accessibility!==void 0)throw Error(`<${t.xmlName}> takes no accessibility: \`${e.tag}\` is not a widget, so ${Object.keys(e.accessibility).join(`, `)} would be dropped.`);let i={};for(let[a,o]of _(e,r.menus)){let r=x(a);if(!s(n,r))throw unknownProperty(t,e.tag,a,r,a,n);i[r]=o}for(let[a,o]of Object.entries(e.props??{})){if(a===`menu-model`)continue;let c=x(a);if(!s(n,c))throw unknownProperty(t,e.tag,a,c,o,n);i[c]=translated(r.translate,o,e.translatable?.[a])}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.`);i.strings=a.map(e=>String(translated(r.translate,e.value,e.translatable)))}let o=new t.ctor(i);if(applyResponses(o,t,e,r),e.id!==void 0&&r.values!==void 0){if(r.values.has(e.id)||r.ids.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.values.set(e.id,o)}return o}function applyResponses(e,t,n,r){let i=e,a=n.extensions?.responses;if(a!==void 0){if(typeof i.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${a.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:o,translatable:s}of a)i.add_response(e,String(translated(r.translate,t,s)),{...n===void 0?{}:{appearance:n},...o===void 0?{}:{enabled:o}})}}function builderNameFor(e,t,n){let r=elementOf(n);if(n.slot===void 0)return r.xmlName;let i=n.slot,o=a(e.ctor);if(o===null||!o.includes(i))throw Error(`<${e.xmlName}.${i}> reaches nothing: \`${t}\` declares no such builder slot, so NativeScript would hand <${r.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 i}export{applyBreakpoints,build,buildDialog,buildInto,buildWithSiblings,elementFor,registerBarrel,f as registerTemplateClass};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{capabilities as e}from"../capabilities.js";import{observeWindowSize as t}from"../widgets/breakpoint.js";import{gtypeNameOf as n,gtypeNameOfInstance as r}from"../widgets/gtype-name.js";import{declaredBuilderReferences as i,declaredBuilderSlots as a}from"../widgets/builder-slots.js";import{gtkPropertyRefusal as o,hasGtkProperty as s,readGtkProperty as c,writeGtkProperty as l}from"../widgets/shadowed-properties.js";import{emittedSignalsOf as u}from"../widgets/signals.js";import{authoredParamValue as d}from"./param-values.js";import{registerTemplateClass as f,templateClassFor as p}from"./template-classes.js";import{adw_exports as m}from"../namespace/adw.js";import{gtk_exports as h}from"../namespace/gtk.js";import{buildMenu as g,createBreakpointDriver as _,menuAssignments as v,parseBreakpointCondition as y,registeredDefaultTranslate as b}from"@gjsify/adwaita-core";import{assertTreeConstructs as x}from"@gjsify/adwaita-core/conformance";import{propertyOf as S}from"@gjsify/adwaita-core/tags";import{View as C}from"@nativescript/core";const w=[{prefix:`adw`,library:`Adw`,namespace:m},{prefix:`gtk`,library:`Gtk`,namespace:h}];function registerBarrel(e,t,n){let r=w.find(t=>t.prefix===e);if(r!==void 0&&r.library!==t)throw Error(`The prefix '${e}' already names \`${r.library}\`; it cannot also name \`${t}\`.`);r===void 0?w.push({prefix:e,library:t,namespace:n}):r.namespace=n}const T={GtkPopoverMenuBar:`Android has no menu-bar surface, and a row of PopupMenus would be a design choice, not GTK's widget (ADR 0097 § 2). Use a GtkMenuButton or a GtkPopoverMenu.`};function elementFor(e){let t=T[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...w].sort((e,t)=>t.library.length-e.library.length);for(let{prefix:t,library:i,namespace:a}of r){if(!e.startsWith(i))continue;let r=e.slice(i.length),o=a[r];if(typeof o!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${r}' — 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(n(o)!==e)throw Error(`'${t}:${r}' resolves to class \`${n(o)}\`, 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}:${r}`,ctor:o}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${w.map(e=>e.prefix).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:p(e.tag)}:elementFor(e.tag)}function translated(e,t,n){return n===void 0||e===void 0||typeof t!=`string`?t:e(t,n.context)}function build(e,t={}){refuseSiblings(e,`build`);let n=buildTree(e,t).root;if(!(n instanceof C))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={}){refuseSiblings(e,`buildDialog`);let n=buildTree(e,t).root;if(n instanceof C||typeof n.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return n}function buildWithSiblings(e,t={}){let n=buildTree(e,t,!0);if(!(n.root instanceof C))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return{root:n.root,siblings:n.siblings,objects:n.objects}}function buildInto(e,t,n={}){let r=elementOf(t);if(!(e instanceof r.ctor))throw Error(`\`buildInto\` was handed a ${e.constructor.name}, and the tree's root is \`${t.tag}\`: a template builds into an instance of the class it extends (<${r.xmlName}>).`);return buildTree(t,n,!0,e).objects}function refuseSiblings(e,t){if((e.siblings?.length??0)!==0)throw Error(`\`${e.tag}\` carries ${e.siblings.length} sibling object(s), and \`${t}\` returns one object so they would be built and lost. Use \`buildWithSiblings\`, which hands them back by id.`)}function buildTree(n,r,i=!1,a){x(`adwaita-nativescript`,e,n,Object.keys(D));let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate??b(),values:i?new Map:void 0},s=buildNode(n,o,a),c=new Map;for(let e of n.siblings??[]){if(e.id===void 0)throw Error(`the sibling \`${e.tag}\` has no id, so nothing could ever ask for it: give it one in the .blp.`);c.set(e.id,buildNode(e,o))}for(let{view:e,element:t,prop:n,id:r}of o.pending){let i=o.ids.get(r);if(i===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.`);l(e,n,i)}for(let e of o.binds)bindProperty(e,o);for(let e of o.breakpointHosts)bindBreakpoints(e,o);return{root:s,siblings:c,objects:new Map([...o.ids,...o.values??[]])}}function bindProperty(e,t){let{target:n,element:r,property:i,source:a,sourceProperty:d,flags:f}=e,p=`<${r.xmlName}> \`${i}: bind ${a}.${d}\``,m=t.template,h=a===`template`&&m!==void 0?m.instance:t.ids.get(a);if(h===void 0)throw Error(`${p} names no object: nothing in this tree has the id '${a}'.`);if(f.length>0&&m===void 0)throw Error(`${p} carries ${f.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let g=S(d),_=S(i),v=u(h.constructor),y=`notify::${d}`;if(!s(h,g)||!v.includes(y))throw Error(`${p}: ${h.constructor.name} does not emit '${y}', so the target would follow the source once and never again. It emits: ${v.join(`, `)||`none`}.`);if(!s(n,_)){let e=o(n,_);throw Error(`${p}: the target has no property '${_}'.${e===null?``:` ${e}`}`)}if(m!==void 0){bindThroughEngine(m,{...e,from:h,where:p,notification:y});return}let follow=()=>l(n,_,c(h,g));follow(),h.connect(y,follow)}function engineFlags(e,t){for(let n of e)if(n!==`bidirectional`&&n!==`inverted`&&n!==`no-sync-create`)throw Error(`${t} carries the unknown flag '${n}'.`);let n=e.includes(`no-sync-create`)?[]:[`sync-create`];return e.includes(`bidirectional`)&&n.push(`bidirectional`),e.includes(`inverted`)&&n.push(`invert-boolean`),n}function viaProperties(e){let key=e=>typeof e==`string`?S(e):e;return new Proxy(e,{get(e,t){let n=typeof t==`string`&&s(e,key(t))?c(e,key(t)):Reflect.get(e,key(t));return typeof n==`function`?n.bind(e):n},set(e,t,n){return typeof t==`string`?(l(e,S(t),n),!0):Reflect.set(e,t,n)}})}function bindThroughEngine(e,t){let{target:n,from:r,property:i,sourceProperty:a,flags:o,where:s}=t,c=engineFlags(o,s),l=u(n.constructor);if(c.includes(`bidirectional`)&&!l.includes(`notify::${i}`))throw Error(`${s}: bidirectional, but ${n.constructor.name} does not emit 'notify::${i}', so the source would never follow the target back. It emits: ${l.join(`, `)||`none`}.`);e.bind(viaProperties(r),a,viaProperties(n),i,c)}function bindBreakpoints({view:e,element:t,node:n},r){if(!(e instanceof C))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,r.translate)}function applyBreakpoints(e,n,i,a={}){wireBreakpoints(r(e),e,n,new Map(Object.entries(i)),a.observeSize??t,a.translate??b())}function wireBreakpoints(e,t,n,r,i,a){let u=_(n.map(t=>{if(y(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(!s(n,S(t.property))){let e=o(n,S(t.property));throw Error(`${i}: the target declares no '${S(t.property)}'.`+(e===null?``:` ${e}`))}let c=translated(a,t.value,t.translatable),l=d(n,S(t.property),c,i);return{object:n,property:t.property,value:{authored:l===null?String(c):l.value}}})}}),{read:(e,t)=>({original:c(e,S(t))}),write(e,t,n){let r=n;l(e,S(t),`authored`in r?r.authored:r.original)}});i(t,e=>u.evaluate(e))}function buildNode(e,t,n){let r=elementOf(e),i=n??new r.ctor,a=i instanceof C?buildView(e,r,i,t):buildValue(e,r,i,t);bindSignals(a,r,e,t);for(let[n,i]of Object.entries(e.bindings??{}))t.binds.push({target:a,element:r,property:n,source:i.source,sourceProperty:i.property,flags:i.flags??[]});e.breakpoints!==void 0&&t.breakpointHosts.push({view:a,element:r,node:e});for(let n of e.children??[]){let i=a;if(typeof i._addChildFromBuilder!=`function`)throw Error(`<${r.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);let o=buildNode(n,t);applyLayout(n,o,r,e.tag),i._addChildFromBuilder(builderNameFor(r,e.tag,n),o)}return a}function bindSignals(e,t,n,r){if(n.signals===void 0)return;let i=u(t.ctor),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`}.`);let o=(e.flags??[]).filter(e=>r.template===void 0||e!==`swapped`);if(e.object!==void 0||o.length>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.`);if(r.template!==void 0){a.connect(n,r.template.handler(e.handler,{flags:e.flags}));continue}let s=r.scope?.[e.handler];if(typeof s!=`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)=>s.apply(r.scope,e))}}const E={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 C))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=E[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(E).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,a){let s=o(a,r);return Error(s===null?`<${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.`:`<${e.xmlName} ${n}="${String(i)}"> reaches nothing on \`${t}\`: ${s}`)}function buildView(e,t,n,r){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(r.ids.has(e.id)||r.values?.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.ids.set(e.id,n),n.id=e.id}let a=i(t.ctor);for(let[i,a]of v(e,r.menus)){let r=S(i);if(!s(n,r))throw unknownProperty(t,e.tag,i,r,i,n);l(n,r,g(a))}for(let[i,o]of Object.entries(e.props??{})){if(i===`menu-model`)continue;let c=S(i);if(!s(n,c))throw unknownProperty(t,e.tag,i,c,o,n);if(a.includes(c)){r.pending.push({view:n,element:t,prop:c,id:String(o)});continue}let u=translated(r.translate,o,e.translatable?.[i]),f=d(n,c,u,`<${t.xmlName} ${i}="${String(u)}">`);l(n,c,f===null?String(u):f.value)}if(e.styleClasses!==void 0&&e.styleClasses.length>0){if(!(`styleClasses`in n))throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` declares no 'styleClasses', so [${e.styleClasses.join(`, `)}] would be dropped.`);n.styleClasses=e.styleClasses.join(` `)}if(applyAccessibility(n,e,r),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(n,t,e,r),n}const D={label:`accessibilityLabel`,description:`accessibilityHint`};function applyAccessibility(e,t,n){for(let[r,i]of Object.entries(t.accessibility??{}))e[D[r]]=String(translated(n.translate,i.value,i.translatable))}function buildValue(e,t,n,r){if(e.id!==void 0&&r.values===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. \`buildWithSiblings\` hands every object back by id.`);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.`);if(e.accessibility!==void 0)throw Error(`<${t.xmlName}> takes no accessibility: \`${e.tag}\` is not a widget, so ${Object.keys(e.accessibility).join(`, `)} would be dropped.`);let i={};for(let[a,o]of v(e,r.menus)){let r=S(a);if(!s(n,r))throw unknownProperty(t,e.tag,a,r,a,n);i[r]=g(o)}for(let[a,o]of Object.entries(e.props??{})){if(a===`menu-model`)continue;let c=S(a);if(!s(n,c))throw unknownProperty(t,e.tag,a,c,o,n);i[c]=translated(r.translate,o,e.translatable?.[a])}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.`);i.strings=a.map(e=>String(translated(r.translate,e.value,e.translatable)))}let o=new t.ctor(i);if(applyResponses(o,t,e,r),e.id!==void 0&&r.values!==void 0){if(r.values.has(e.id)||r.ids.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.values.set(e.id,o)}return o}function applyResponses(e,t,n,r){let i=e,a=n.extensions?.responses;if(a!==void 0){if(typeof i.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${a.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:o,translatable:s}of a)i.add_response(e,String(translated(r.translate,t,s)),{...n===void 0?{}:{appearance:n},...o===void 0?{}:{enabled:o}})}}function builderNameFor(e,t,n){let r=elementOf(n);if(n.slot===void 0)return r.xmlName;let i=n.slot,o=a(e.ctor);if(o===null||!o.includes(i))throw Error(`<${e.xmlName}.${i}> reaches nothing: \`${t}\` declares no such builder slot, so NativeScript would hand <${r.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 i}export{applyBreakpoints,build,buildDialog,buildInto,buildWithSiblings,elementFor,registerBarrel,f as registerTemplateClass};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{AdwBreakpoint as ee,addBreakpoints as te,evaluateBreakpointCondition as ne,observeViewSize as e,observeWindowSize as t,parseBreakpointCondition as n}from"./widgets/breakpoint.js";import{ENGINE_TARGET as r}from"./engine-target.js";import{GTK_ALIGN as i}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as a,GTK_ICON_SIZE_NICKS as o,GTK_ICON_SIZE_PIXELS as s,PIXEL_SIZE_UNSET as c,isGtkIconSizeNick as l}from"./widgets/gtk-icon-size.js";import{applyConstructProps as u,nsAlignment as d}from"./widgets/construct-props.js";import{activateWidgetAction as f,findActionGroup as p,insertActionGroup as m}from"./widgets/actions.js";import{NOTIFY_HEXPAND as h,NOTIFY_VEXPAND as g,withGtkWidgetLayout as _}from"./widgets/widget-layout.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,resolveIconSource as N}from"./widgets/icon-theme.js";import{renderSymbolicIcon as P}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as F}from"./widgets/gtk-image.js";import{CLOSED as I}from"./widgets/adw-about-dialog.js";import{ACTIVATED as L}from"./widgets/adw-action-row.js";import{AdwAlertResponses as R}from"./widgets/adw-alert-dialog.js";import{NOTIFY_OPEN as z}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as B}from"./widgets/row-press.js";import{bottomSheetPanel as V}from"./widgets/adw-bottom-sheet.js";import{avatarInitials as H}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as U}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as W}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as G,DEFAULT_SPINNER_SIZE as K}from"./widgets/chrome.js";import{BUTTON_CLICKED as q}from"./widgets/adw-banner.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as J}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as Y}from"./widgets/adw-carousel.js";import{ComboState as X,NOTIFY_SELECTED as Z}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as re,ADW_DIALOG_CLOSE_ATTEMPT as ie}from"./widgets/adw-dialog.js";import{AdwImageButton as ae,DEFAULT_ICON_BUTTON_ICON_SIZE as oe}from"./widgets/adw-image-button.js";import{NOTIFY_ACTIVATES_DEFAULT as se,NOTIFY_EDITABLE as ce,NOTIFY_MAX_LENGTH as le,NOTIFY_SHOW_APPLY_BUTTON as ue,NOTIFY_TEXT as de,NOTIFY_TEXT_LENGTH as fe,SIGNAL_APPLY as pe,SIGNAL_ENTRY_ACTIVATED as me}from"./widgets/adw-entry-row.js";import{NOTIFY_ENABLE_EXPANSION as he,NOTIFY_EXPANDED as ge,NOTIFY_SHOW_ENABLE_SWITCH as _e,NS_EXPANDER_ARROW_DISABLED_OPACITY as ve}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as ye}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as be,NOTIFY_SELECTED as xe}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as Se,NsOverlaySplitViewState as Ce,splitViewColumns as we}from"./widgets/split-view-state.js";import{AdwSplitViewBase as Te,NOTIFY_SHOW_SIDEBAR as Ee}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as De}from"./widgets/navigation-stack.js";import{CLOSED as Oe}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ke,SHORTCUT_LABEL_CLASS as Ae,SHORTCUT_LABEL_DIMMED_CLASS as je,SHORTCUT_LABEL_DISABLED_CLASS as Me,SHORTCUT_LABEL_KEYCAP_CLASS as Ne,SHORTCUT_LABEL_KEYS_CLASS as Pe,SHORTCUT_LABEL_SIDE_CLASS as Fe,SHORTCUT_LABEL_SPACED_CLASS as Ie,shortcutLabelDirection as Le,shortcutLabelPlatform as Re,shortcutLabelRenderPlan as ze}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Q}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Be,SpinState as Ve}from"./widgets/adw-spin-row.js";import{MENU_TAPPED as He}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Ue}from"./widgets/adw-switch-row.js";import{AdwToast as We,AdwToastQueue as Ge,DEFAULT_TOAST_TIMEOUT as Ke}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as qe,ToggleGroupState as Je}from"./widgets/adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ye,adwaitaNsAccentColor as Xe,adwaitaNsAccentCss as Ze}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Qe,clearAdwaitaNsAccent as $e}from"./widgets/adw-accent.js";import{adw_exports as et}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as tt,boxChildTrack as nt,boxSpacingChanges as rt,boxTrackPlan as it,normalizeBoxSpacing as at}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as ot,buttonSlotDetaches as st}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as ct,GTK_BUTTON_LABEL_CLASS as lt}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ut}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as dt,GTK_CHECK_BUTTON_CHECKED_CLASS as ft,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as pt,GTK_CHECK_BUTTON_TOGGLED as mt,NOTIFY_CHECK_ACTIVE as ht}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as gt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as _t,NOTIFY_TEXT as vt}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as yt,LIST_BOX_ROW_SELECTED as bt}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as xt}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 wt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as Tt,NOTIFY_TEXT_VIEW_TEXT as Et}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as Dt,GTK_TOGGLE_BUTTON_TOGGLED as Ot,NOTIFY_TOGGLE_ACTIVE as kt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as At}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as jt,ADWAITA_SANS_TTF_FILES as Mt,adwaitaFontInstallInstructions as Nt,hasAdwaitaSans as Pt}from"./fonts.js";import{AdwSliderRow as Ft,NOTIFY_SLIDER_VALUE as It}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Lt,DATA_GRID_HEADER_ROW_CLASS as Rt,DATA_GRID_SECTION_CELL_CLASS as zt,dataGridCellClass as Bt,dataGridItemSpec as Vt,dataGridRowClass as Ht,dataGridShapeKey as Ut,dataGridTracksKey as Wt,parseDataGridWidth as Gt}from"./widgets/data-grid-model.js";import{AdwDataGrid as Kt,ROW_ACTIVATED as qt}from"./widgets/adw-data-grid.js";import{padForSystemInsets as Jt,padSheetForSystemInsets as Yt}from"./widgets/system-insets.js";import{labelDisplayText as Xt,labelMarkupIsUnparseable as Zt,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as Qt}from"./namespace/gio.js";import{gdk_exports as $t}from"./namespace/gdk.js";import{graphene_exports as en}from"./namespace/graphene.js";import{glib_exports as tn}from"./namespace/glib.js";import{assertNativeScript as nn,assertNativeScript as rn,isAndroid as an,isIOS as on,isNativeScript as sn}from"@gjsify/native-platform";function registerAdwaita(){rn(),$()}export{I as ABOUT_CLOSED,L as ACTIVATED,w as ADWAITA_ICON_GRID,Ye as ADWAITA_NS_ACCENT_RULES,jt as ADWAITA_SANS_FONT_FAMILY,Mt as ADWAITA_SANS_TTF_FILES,re as ADW_DIALOG_CLOSED,ie as ADW_DIALOG_CLOSE_ATTEMPT,U as AVATAR_DEFAULT_ICON,et as Adw,R as AdwAlertResponses,ee as AdwBreakpoint,Kt as AdwDataGrid,ae as AdwImageButton,Ft as AdwSliderRow,Te as AdwSplitViewBase,We as AdwToast,Ge as AdwToastQueue,be as AdwViewSwitcherBase,q as BUTTON_CLICKED,X as ComboState,Lt as DATA_GRID_HEADER_CELL_CLASS,Rt as DATA_GRID_HEADER_ROW_CLASS,zt as DATA_GRID_SECTION_CELL_CLASS,W as DEFAULT_AVATAR_SIZE,tt as DEFAULT_BOX_SPACING,J as DEFAULT_CAROUSEL_PAGE_WIDTH,G as DEFAULT_CLAMP_MAX_SIZE,F as DEFAULT_GTK_IMAGE_SIZE,oe as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,a as DEFAULT_ICON_PIXEL_SIZE,K as DEFAULT_SPINNER_SIZE,Ke as DEFAULT_TOAST_TIMEOUT,gt as DRAWING_AREA_REFUSAL,r as ENGINE_TARGET,_t as ENTRY_ACTIVATE,tn as GLib,i as GTK_ALIGN,ct as GTK_BUTTON_CLICKED,lt as GTK_BUTTON_LABEL_CLASS,dt as GTK_CHECK_BUTTON_ACTIVATE,ft as GTK_CHECK_BUTTON_CHECKED_CLASS,pt as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,mt as GTK_CHECK_BUTTON_TOGGLED,o as GTK_ICON_SIZE_NICKS,s as GTK_ICON_SIZE_PIXELS,Dt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,Ot as GTK_TOGGLE_BUTTON_TOGGLED,Tt as GTK_WRAP_MODES,$t as Gdk,Qt as Gio,en as Graphene,At as Gtk,k as ICON_FALLBACK_NAME,yt as LIST_BOX_ROW_ACTIVATED,bt as LIST_BOX_ROW_SELECTED,xt as MENU_ITEM_ACTIVATED,He as MENU_TAPPED,se as NOTIFY_ACTIVATES_DEFAULT,Ue as NOTIFY_ACTIVE,ht as NOTIFY_CHECK_ACTIVE,ut as NOTIFY_DROP_DOWN_SELECTED,ce as NOTIFY_EDITABLE,he as NOTIFY_ENABLE_EXPANSION,vt as NOTIFY_ENTRY_TEXT,ge as NOTIFY_EXPANDED,h as NOTIFY_HEXPAND,le as NOTIFY_MAX_LENGTH,z as NOTIFY_OPEN,Y as NOTIFY_POSITION,St as NOTIFY_REVEAL_CHILD,Z as NOTIFY_SELECTED,ue as NOTIFY_SHOW_APPLY_BUTTON,_e as NOTIFY_SHOW_ENABLE_SWITCH,Ee as NOTIFY_SHOW_SIDEBAR,Q as NOTIFY_SIDEBAR_SELECTED,It as NOTIFY_SLIDER_VALUE,Ct as NOTIFY_STACK_VISIBLE_CHILD,wt as NOTIFY_STACK_VISIBLE_CHILD_NAME,de as NOTIFY_TEXT,fe as NOTIFY_TEXT_LENGTH,Et as NOTIFY_TEXT_VIEW_TEXT,kt as NOTIFY_TOGGLE_ACTIVE,qe as NOTIFY_TOGGLE_SELECTED,Be as NOTIFY_VALUE,g as NOTIFY_VEXPAND,xe as NOTIFY_VIEW_SELECTED,ye as NOTIFY_VISIBLE_CHILD,De as NOTIFY_VISIBLE_PAGE,ve as NS_EXPANDER_ARROW_DISABLED_OPACITY,Se as NsNavigationSplitViewState,Ce as NsOverlaySplitViewState,c as PIXEL_SIZE_UNSET,Oe as PREFERENCES_CLOSED,qt as ROW_ACTIVATED,ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,Ae as SHORTCUT_LABEL_CLASS,je as SHORTCUT_LABEL_DIMMED_CLASS,Me as SHORTCUT_LABEL_DISABLED_CLASS,Ne as SHORTCUT_LABEL_KEYCAP_CLASS,Pe as SHORTCUT_LABEL_KEYS_CLASS,Fe as SHORTCUT_LABEL_SIDE_CLASS,Ie as SHORTCUT_LABEL_SPACED_CLASS,pe as SIGNAL_APPLY,me as SIGNAL_ENTRY_ACTIVATED,Ve as SpinState,Je as ToggleGroupState,f as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,Nt as adwaitaFontInstallInstructions,Xe as adwaitaNsAccentColor,Ze as adwaitaNsAccentCss,Qe as applyAdwaitaNsAccent,u as applyConstructProps,nn as assertNativeScript,B as attachRowPressFeedback,H as avatarInitials,V as bottomSheetPanel,nt as boxChildTrack,rt as boxSpacingChanges,it as boxTrackPlan,ot as buttonSlotAfterWrite,st as buttonSlotDetaches,$e as clearAdwaitaNsAccent,A as compiledIconNames,Bt as dataGridCellClass,Vt as dataGridItemSpec,Ht as dataGridRowClass,Ut as dataGridShapeKey,Wt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,p as findActionGroup,Pt as hasAdwaitaSans,j as iconValueKind,m as insertActionGroup,an as isAndroid,l as isGtkIconSizeNick,on as isIOS,M as isIconAvailable,sn as isNativeScript,y as isThemeIconColor,Xt as labelDisplayText,Zt as labelMarkupIsUnparseable,at as normalizeBoxSpacing,d as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,Jt as padForSystemInsets,Yt as padSheetForSystemInsets,n as parseBreakpointCondition,Gt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,P as renderSymbolicIcon,N as resolveIconSource,x as setAdwaitaColorScheme,Le as shortcutLabelDirection,Re as shortcutLabelPlatform,ze as shortcutLabelRenderPlan,we as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,_ as withGtkWidgetLayout};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{AdwBreakpoint as ee,addBreakpoints as te,evaluateBreakpointCondition as ne,observeViewSize as e,observeWindowSize as t,parseBreakpointCondition as n}from"./widgets/breakpoint.js";import{ENGINE_TARGET as r}from"./engine-target.js";import{GTK_ALIGN as i}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as a,GTK_ICON_SIZE_NICKS as o,GTK_ICON_SIZE_PIXELS as s,PIXEL_SIZE_UNSET as c,isGtkIconSizeNick as l}from"./widgets/gtk-icon-size.js";import{applyConstructProps as u,nsAlignment as d}from"./widgets/construct-props.js";import{activateWidgetAction as f,findActionGroup as p,insertActionGroup as m}from"./widgets/actions.js";import{NOTIFY_HEXPAND as h,NOTIFY_VEXPAND as g,withGtkWidgetLayout as _}from"./widgets/widget-layout.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,resolveIconSource as N}from"./widgets/icon-theme.js";import{renderSymbolicIcon as P}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as F}from"./widgets/gtk-image.js";import{CLOSED as I}from"./widgets/adw-about-dialog.js";import{ACTIVATED as L}from"./widgets/adw-action-row.js";import{AdwAlertResponses as R}from"./widgets/adw-alert-dialog.js";import{NOTIFY_OPEN as z}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as B}from"./widgets/row-press.js";import{bottomSheetPanel as V}from"./widgets/adw-bottom-sheet.js";import{avatarInitials as H}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as U}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as W}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as G,DEFAULT_SPINNER_SIZE as K}from"./widgets/chrome.js";import{BUTTON_CLICKED as q}from"./widgets/adw-banner.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as J}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as Y}from"./widgets/adw-carousel.js";import{ComboState as X,NOTIFY_SELECTED as Z}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as re,ADW_DIALOG_CLOSE_ATTEMPT as ie}from"./widgets/adw-dialog.js";import{AdwImageButton as ae,DEFAULT_ICON_BUTTON_ICON_SIZE as oe}from"./widgets/adw-image-button.js";import{NOTIFY_ACTIVATES_DEFAULT as se,NOTIFY_EDITABLE as ce,NOTIFY_MAX_LENGTH as le,NOTIFY_SHOW_APPLY_BUTTON as ue,NOTIFY_TEXT as de,NOTIFY_TEXT_LENGTH as fe,SIGNAL_APPLY as pe,SIGNAL_ENTRY_ACTIVATED as me}from"./widgets/adw-entry-row.js";import{NOTIFY_ENABLE_EXPANSION as he,NOTIFY_EXPANDED as ge,NOTIFY_SHOW_ENABLE_SWITCH as _e,NS_EXPANDER_ARROW_DISABLED_OPACITY as ve}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as ye}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as be,NOTIFY_SELECTED as xe}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as Se,NsOverlaySplitViewState as Ce,splitViewColumns as we}from"./widgets/split-view-state.js";import{AdwSplitViewBase as Te,NOTIFY_SHOW_SIDEBAR as Ee}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as De}from"./widgets/navigation-stack.js";import{CLOSED as Oe}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ke,SHORTCUT_LABEL_CLASS as Ae,SHORTCUT_LABEL_DIMMED_CLASS as je,SHORTCUT_LABEL_DISABLED_CLASS as Me,SHORTCUT_LABEL_KEYCAP_CLASS as Ne,SHORTCUT_LABEL_KEYS_CLASS as Pe,SHORTCUT_LABEL_SIDE_CLASS as Fe,SHORTCUT_LABEL_SPACED_CLASS as Ie,shortcutLabelDirection as Le,shortcutLabelPlatform as Re,shortcutLabelRenderPlan as ze}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Be}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Ve,SpinState as He}from"./widgets/adw-spin-row.js";import{MENU_TAPPED as Ue}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Q}from"./widgets/adw-switch-row.js";import{AdwToast as We,AdwToastQueue as Ge,DEFAULT_TOAST_TIMEOUT as Ke}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as qe,ToggleGroupState as Je}from"./widgets/adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ye,adwaitaNsAccentColor as Xe,adwaitaNsAccentCss as Ze}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Qe,clearAdwaitaNsAccent as $e}from"./widgets/adw-accent.js";import{adw_exports as et}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as tt,boxChildTrack as nt,boxSpacingChanges as rt,boxTrackPlan as it,normalizeBoxSpacing as at}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as ot,buttonSlotDetaches as st}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as ct,GTK_BUTTON_LABEL_CLASS as lt}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ut}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as dt,GTK_CHECK_BUTTON_CHECKED_CLASS as ft,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as pt,GTK_CHECK_BUTTON_TOGGLED as mt,NOTIFY_CHECK_ACTIVE as ht}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as gt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as _t,CHANGED as vt,NOTIFY_EDITABLE as yt,NOTIFY_MAX_LENGTH as bt,NOTIFY_PLACEHOLDER_TEXT as xt,NOTIFY_TEXT as St,NOTIFY_TEXT_LENGTH as Ct}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as wt,LIST_BOX_ROW_SELECTED as Tt}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as Et}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as Dt}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as Ot,NOTIFY_STACK_VISIBLE_CHILD_NAME as kt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as At,NOTIFY_TEXT_VIEW_TEXT as jt}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as Mt,GTK_TOGGLE_BUTTON_TOGGLED as Nt,NOTIFY_TOGGLE_ACTIVE as Pt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as Ft}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as It,ADWAITA_SANS_TTF_FILES as Lt,adwaitaFontInstallInstructions as Rt,hasAdwaitaSans as zt}from"./fonts.js";import{AdwSliderRow as Bt,NOTIFY_SLIDER_VALUE as Vt}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Ht,DATA_GRID_HEADER_ROW_CLASS as Ut,DATA_GRID_SECTION_CELL_CLASS as Wt,dataGridCellClass as Gt,dataGridItemSpec as Kt,dataGridRowClass as qt,dataGridShapeKey as Jt,dataGridTracksKey as Yt,parseDataGridWidth as Xt}from"./widgets/data-grid-model.js";import{AdwDataGrid as Zt,ROW_ACTIVATED as Qt}from"./widgets/adw-data-grid.js";import{padForSystemInsets as $t,padSheetForSystemInsets as en}from"./widgets/system-insets.js";import{labelDisplayText as tn,labelMarkupIsUnparseable as nn,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as rn}from"./namespace/gio.js";import{gdk_exports as an}from"./namespace/gdk.js";import{graphene_exports as on}from"./namespace/graphene.js";import{glib_exports as sn}from"./namespace/glib.js";import{buildMenu as cn,menuTree as ln,watchMenuModel as un}from"@gjsify/adwaita-core";import{assertNativeScript as dn,assertNativeScript as fn,isAndroid as pn,isIOS as mn,isNativeScript as hn}from"@gjsify/native-platform";function registerAdwaita(){fn(),$()}export{I as ABOUT_CLOSED,L as ACTIVATED,w as ADWAITA_ICON_GRID,Ye as ADWAITA_NS_ACCENT_RULES,It as ADWAITA_SANS_FONT_FAMILY,Lt as ADWAITA_SANS_TTF_FILES,re as ADW_DIALOG_CLOSED,ie as ADW_DIALOG_CLOSE_ATTEMPT,U as AVATAR_DEFAULT_ICON,et as Adw,R as AdwAlertResponses,ee as AdwBreakpoint,Zt as AdwDataGrid,ae as AdwImageButton,Bt as AdwSliderRow,Te as AdwSplitViewBase,We as AdwToast,Ge as AdwToastQueue,be as AdwViewSwitcherBase,q as BUTTON_CLICKED,X as ComboState,Ht as DATA_GRID_HEADER_CELL_CLASS,Ut as DATA_GRID_HEADER_ROW_CLASS,Wt as DATA_GRID_SECTION_CELL_CLASS,W as DEFAULT_AVATAR_SIZE,tt as DEFAULT_BOX_SPACING,J as DEFAULT_CAROUSEL_PAGE_WIDTH,G as DEFAULT_CLAMP_MAX_SIZE,F as DEFAULT_GTK_IMAGE_SIZE,oe as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,a as DEFAULT_ICON_PIXEL_SIZE,K as DEFAULT_SPINNER_SIZE,Ke as DEFAULT_TOAST_TIMEOUT,gt as DRAWING_AREA_REFUSAL,r as ENGINE_TARGET,_t as ENTRY_ACTIVATE,vt as ENTRY_CHANGED,sn as GLib,i as GTK_ALIGN,ct as GTK_BUTTON_CLICKED,lt as GTK_BUTTON_LABEL_CLASS,dt as GTK_CHECK_BUTTON_ACTIVATE,ft as GTK_CHECK_BUTTON_CHECKED_CLASS,pt as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,mt as GTK_CHECK_BUTTON_TOGGLED,o as GTK_ICON_SIZE_NICKS,s as GTK_ICON_SIZE_PIXELS,Mt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,Nt as GTK_TOGGLE_BUTTON_TOGGLED,At as GTK_WRAP_MODES,an as Gdk,rn as Gio,on as Graphene,Ft as Gtk,k as ICON_FALLBACK_NAME,wt as LIST_BOX_ROW_ACTIVATED,Tt as LIST_BOX_ROW_SELECTED,Et as MENU_ITEM_ACTIVATED,Ue as MENU_TAPPED,se as NOTIFY_ACTIVATES_DEFAULT,Q as NOTIFY_ACTIVE,ht as NOTIFY_CHECK_ACTIVE,ut as NOTIFY_DROP_DOWN_SELECTED,ce as NOTIFY_EDITABLE,he as NOTIFY_ENABLE_EXPANSION,yt as NOTIFY_ENTRY_EDITABLE,bt as NOTIFY_ENTRY_MAX_LENGTH,St as NOTIFY_ENTRY_TEXT,Ct as NOTIFY_ENTRY_TEXT_LENGTH,ge as NOTIFY_EXPANDED,h as NOTIFY_HEXPAND,le as NOTIFY_MAX_LENGTH,z as NOTIFY_OPEN,xt as NOTIFY_PLACEHOLDER_TEXT,Y as NOTIFY_POSITION,Dt as NOTIFY_REVEAL_CHILD,Z as NOTIFY_SELECTED,ue as NOTIFY_SHOW_APPLY_BUTTON,_e as NOTIFY_SHOW_ENABLE_SWITCH,Ee as NOTIFY_SHOW_SIDEBAR,Be as NOTIFY_SIDEBAR_SELECTED,Vt as NOTIFY_SLIDER_VALUE,Ot as NOTIFY_STACK_VISIBLE_CHILD,kt as NOTIFY_STACK_VISIBLE_CHILD_NAME,de as NOTIFY_TEXT,fe as NOTIFY_TEXT_LENGTH,jt as NOTIFY_TEXT_VIEW_TEXT,Pt as NOTIFY_TOGGLE_ACTIVE,qe as NOTIFY_TOGGLE_SELECTED,Ve as NOTIFY_VALUE,g as NOTIFY_VEXPAND,xe as NOTIFY_VIEW_SELECTED,ye as NOTIFY_VISIBLE_CHILD,De as NOTIFY_VISIBLE_PAGE,ve as NS_EXPANDER_ARROW_DISABLED_OPACITY,Se as NsNavigationSplitViewState,Ce as NsOverlaySplitViewState,c as PIXEL_SIZE_UNSET,Oe as PREFERENCES_CLOSED,Qt as ROW_ACTIVATED,ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,Ae as SHORTCUT_LABEL_CLASS,je as SHORTCUT_LABEL_DIMMED_CLASS,Me as SHORTCUT_LABEL_DISABLED_CLASS,Ne as SHORTCUT_LABEL_KEYCAP_CLASS,Pe as SHORTCUT_LABEL_KEYS_CLASS,Fe as SHORTCUT_LABEL_SIDE_CLASS,Ie as SHORTCUT_LABEL_SPACED_CLASS,pe as SIGNAL_APPLY,me as SIGNAL_ENTRY_ACTIVATED,He as SpinState,Je as ToggleGroupState,f as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,Rt as adwaitaFontInstallInstructions,Xe as adwaitaNsAccentColor,Ze as adwaitaNsAccentCss,Qe as applyAdwaitaNsAccent,u as applyConstructProps,dn as assertNativeScript,B as attachRowPressFeedback,H as avatarInitials,V as bottomSheetPanel,nt as boxChildTrack,rt as boxSpacingChanges,it as boxTrackPlan,cn as buildMenu,ot as buttonSlotAfterWrite,st as buttonSlotDetaches,$e as clearAdwaitaNsAccent,A as compiledIconNames,Gt as dataGridCellClass,Kt as dataGridItemSpec,qt as dataGridRowClass,Jt as dataGridShapeKey,Yt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,p as findActionGroup,zt as hasAdwaitaSans,j as iconValueKind,m as insertActionGroup,pn as isAndroid,l as isGtkIconSizeNick,mn as isIOS,M as isIconAvailable,hn as isNativeScript,y as isThemeIconColor,tn as labelDisplayText,nn as labelMarkupIsUnparseable,ln as menuTree,at as normalizeBoxSpacing,d as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,$t as padForSystemInsets,en as padSheetForSystemInsets,n as parseBreakpointCondition,Xt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,P as renderSymbolicIcon,N as resolveIconSource,x as setAdwaitaColorScheme,Le as shortcutLabelDirection,Re as shortcutLabelPlatform,ze as shortcutLabelRenderPlan,we as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,un as watchMenuModel,_ as withGtkWidgetLayout};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";const e=Symbol.for(`gjsify.adwaita-nativescript.name-selector`);function installNameSelector(t){let n=t.prototype;if(Object.hasOwn(n,e))return!1;let r=n.match;return Object.defineProperty(n,e,{value:!0}),n.match=function(e){if(r.call(this,e))return!0;let t=e?.name;return typeof t==`string`&&t===this.id},n.lookupSort=function(e,t){e.sortAsUniversal(t??this)},!0}let t;function provideIdSelector(e){t=e}function installProvidedNameSelector(){t!==void 0&&installNameSelector(t())}export{installNameSelector,installProvidedNameSelector,provideIdSelector};
|
package/lib/esm/namespace/gio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{SimpleAction as t,SimpleActionGroup as n}from"../widgets/actions.js";import{nativePlatformHost as r}from"../platform-host.js";import{GioApplication as i}from"../widgets/application.js";import"../file-chooser-host.js";import{ApplicationFlags as a,FileCreateFlags as o,GioFile as s,GioFileOutputStream as c,GioListStore as l,GioMenu as u,
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{SimpleAction as t,SimpleActionGroup as n}from"../widgets/actions.js";import{nativePlatformHost as r}from"../platform-host.js";import{GioApplication as i}from"../widgets/application.js";import"../file-chooser-host.js";import{ApplicationFlags as a,FileCreateFlags as o,GioFile as s,GioFileOutputStream as c,GioListStore as l,GioMenu as u,GioMenuAttributeIter as d,GioMenuItem as f,GioMenuLinkIter as p,GioMenuModel as m,GioOutputStream as h,GioResource as g,IOErrorEnum as _,ListModel as v,MENU_ATTRIBUTE_ACTION as y,MENU_ATTRIBUTE_ACTION_NAMESPACE as b,MENU_ATTRIBUTE_ICON as x,MENU_ATTRIBUTE_LABEL as S,MENU_ATTRIBUTE_TARGET as C,MENU_EXPORTER_MAX_SECTION_SIZE as w,MENU_LINK_SECTION as T,MENU_LINK_SUBMENU as E,ResourceError as D,ResourceLookupFlags as O,createAppInfo as k,promisify as A,resources_enumerate_children as j,resources_get_info as M,resources_lookup_data as N,resources_register as P,resources_unregister as F}from"@gjsify/adwaita-core";import{Settings as I}from"@gjsify/app-settings/nativescript";var L=e({AppInfo:()=>R,Application:()=>i,ApplicationFlags:()=>a,File:()=>s,FileCreateFlags:()=>o,FileOutputStream:()=>c,IOErrorEnum:()=>_,ListModel:()=>v,ListStore:()=>l,MENU_ATTRIBUTE_ACTION:()=>y,MENU_ATTRIBUTE_ACTION_NAMESPACE:()=>b,MENU_ATTRIBUTE_ICON:()=>x,MENU_ATTRIBUTE_LABEL:()=>S,MENU_ATTRIBUTE_TARGET:()=>C,MENU_EXPORTER_MAX_SECTION_SIZE:()=>w,MENU_LINK_SECTION:()=>T,MENU_LINK_SUBMENU:()=>E,Menu:()=>u,MenuAttributeIter:()=>d,MenuItem:()=>f,MenuLinkIter:()=>p,MenuModel:()=>m,OutputStream:()=>h,Resource:()=>g,ResourceError:()=>D,ResourceLookupFlags:()=>O,Settings:()=>I,SimpleAction:()=>t,SimpleActionGroup:()=>n,_promisify:()=>A,resources_enumerate_children:()=>j,resources_get_info:()=>M,resources_lookup_data:()=>N,resources_register:()=>P,resources_unregister:()=>F});const R=k(r);export{R as AppInfo,i as Application,a as ApplicationFlags,s as File,o as FileCreateFlags,c as FileOutputStream,_ as IOErrorEnum,v as ListModel,l as ListStore,y as MENU_ATTRIBUTE_ACTION,b as MENU_ATTRIBUTE_ACTION_NAMESPACE,x as MENU_ATTRIBUTE_ICON,S as MENU_ATTRIBUTE_LABEL,C as MENU_ATTRIBUTE_TARGET,w as MENU_EXPORTER_MAX_SECTION_SIZE,T as MENU_LINK_SECTION,E as MENU_LINK_SUBMENU,u as Menu,d as MenuAttributeIter,f as MenuItem,p as MenuLinkIter,m as MenuModel,h as OutputStream,g as Resource,D as ResourceError,O as ResourceLookupFlags,I as Settings,t as SimpleAction,n as SimpleActionGroup,A as _promisify,L as gio_exports,j as resources_enumerate_children,M as resources_get_info,N as resources_lookup_data,P as resources_register,F as resources_unregister};
|
package/lib/esm/namespace/gtk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{CssProvider as t,EventControllerKey as n,IconTheme as r,Settings as i,StyleContext as a,show_uri as o}from"./gtk-platform.js";import{GtkImage as s}from"../widgets/gtk-image.js";import{
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{CssProvider as t,EventControllerKey as n,IconTheme as r,Settings as i,StyleContext as a,show_uri as o}from"./gtk-platform.js";import{GtkImage as s}from"../widgets/gtk-image.js";import{GtkLabel as c}from"../widgets/gtk-label.js";import{GtkApplication as l}from"../widgets/application.js";import{GtkWindow as u}from"../widgets/gtk-window.js";import{ArrowType as d,License as f,PolicyType as p,TextDirection as m,TextExtendSelection as h,TextWindowType as g}from"../widgets/gtk-enums.js";import{GtkActionBar as _}from"../widgets/gtk-action-bar.js";import{GtkBox as v}from"../widgets/gtk-box.js";import{GtkButton as y}from"../widgets/gtk-button.js";import{GtkDropDown as b}from"../widgets/gtk-drop-down.js";import{GtkCheckButton as x}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 w}from"../widgets/gtk-grid.js";import{GtkFrame as T}from"../widgets/gtk-frame.js";import{GtkListBox as E}from"../widgets/gtk-list-box.js";import{GtkMenuButton as D}from"../widgets/gtk-menu-button.js";import{GtkPopoverMenu as O}from"../widgets/gtk-popover-menu.js";import{GtkOverlay as k}from"../widgets/gtk-overlay.js";import{GtkRevealer as A}from"../widgets/gtk-revealer.js";import{GtkScrolledWindow as j}from"../widgets/gtk-scrolled-window.js";import{GtkApplicationWindow as M}from"../widgets/gtk-application-window.js";import{GtkSeparator as N}from"../widgets/gtk-separator.js";import{GtkStackPage as P}from"../widgets/stack-page.js";import{GtkStack as F}from"../widgets/gtk-stack.js";import{GtkTextView as I}from"../widgets/gtk-text-view.js";import{GtkToggleButton as L}from"../widgets/gtk-toggle-button.js";import{ApplicationInhibitFlags as R,DialogError as z,GtkAdjustment as B,GtkFileDialog as V,GtkFileFilter as H,GtkStringList as U,GtkStringObject as W,STYLE_PROVIDER_PRIORITY_APPLICATION as G,STYLE_PROVIDER_PRIORITY_FALLBACK as K,STYLE_PROVIDER_PRIORITY_SETTINGS as q,STYLE_PROVIDER_PRIORITY_THEME as J,STYLE_PROVIDER_PRIORITY_USER as Y}from"@gjsify/adwaita-core";var X=e({ActionBar:()=>_,Adjustment:()=>B,Application:()=>l,ApplicationInhibitFlags:()=>R,ApplicationWindow:()=>M,ArrowType:()=>d,Box:()=>v,Button:()=>y,CheckButton:()=>x,CssProvider:()=>t,DialogError:()=>z,DrawingArea:()=>S,DropDown:()=>b,Entry:()=>C,EventControllerKey:()=>n,FileDialog:()=>V,FileFilter:()=>H,Frame:()=>T,Grid:()=>w,IconTheme:()=>r,Image:()=>s,Label:()=>c,License:()=>f,ListBox:()=>E,MenuButton:()=>D,Overlay:()=>k,PolicyType:()=>p,PopoverMenu:()=>O,Revealer:()=>A,STYLE_PROVIDER_PRIORITY_APPLICATION:()=>G,STYLE_PROVIDER_PRIORITY_FALLBACK:()=>K,STYLE_PROVIDER_PRIORITY_SETTINGS:()=>q,STYLE_PROVIDER_PRIORITY_THEME:()=>J,STYLE_PROVIDER_PRIORITY_USER:()=>Y,ScrolledWindow:()=>j,Separator:()=>N,Settings:()=>i,Stack:()=>F,StackPage:()=>P,StringList:()=>U,StringObject:()=>W,StyleContext:()=>a,TextDirection:()=>m,TextExtendSelection:()=>h,TextView:()=>I,TextWindowType:()=>g,ToggleButton:()=>L,Window:()=>u,show_uri:()=>o});export{_ as ActionBar,B as Adjustment,l as Application,R as ApplicationInhibitFlags,M as ApplicationWindow,d as ArrowType,v as Box,y as Button,x as CheckButton,t as CssProvider,z as DialogError,S as DrawingArea,b as DropDown,C as Entry,n as EventControllerKey,V as FileDialog,H as FileFilter,T as Frame,w as Grid,r as IconTheme,s as Image,c as Label,f as License,E as ListBox,D as MenuButton,k as Overlay,p as PolicyType,O as PopoverMenu,A as Revealer,G as STYLE_PROVIDER_PRIORITY_APPLICATION,K as STYLE_PROVIDER_PRIORITY_FALLBACK,q as STYLE_PROVIDER_PRIORITY_SETTINGS,J as STYLE_PROVIDER_PRIORITY_THEME,Y as STYLE_PROVIDER_PRIORITY_USER,j as ScrolledWindow,N as Separator,i as Settings,F as Stack,P as StackPage,U as StringList,W as StringObject,a as StyleContext,m as TextDirection,h as TextExtendSelection,I as TextView,g as TextWindowType,L as ToggleButton,u as Window,X as gtk_exports,o as show_uri};
|
package/lib/esm/platform-host.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{listenPlatformKeys as
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{provideIdSelector as e}from"./name-selector.js";import{listenPlatformKeys as t,openPlatformUri as n}from"./platform-source.js";import{Application as r,CSSHelper as i}from"@nativescript/core";e(()=>i.createSelector(`#x`).constructor);const a=new Map,o={setStyles(e){for(let{owner:t,css:n}of e)a.get(t)!==n&&(a.set(t,n),n&&r.addCss(n))},openUri:e=>n(e),fontName:()=>null,listenKeys:(e,n)=>t(e,(e,t,r,i)=>n({key:e,keycode:t,state:r,pressed:i}))};export{o as nativePlatformHost};
|
|
@@ -1,7 +1,7 @@
|
|
|
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{nativeClipboardHost as i}from"../clipboard-host.js";import{nativePlatformHost as a}from"../platform-host.js";import{GtkImage as o}from"./gtk-image.js";import{
|
|
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{nativeClipboardHost as i}from"../clipboard-host.js";import{nativePlatformHost as a}from"../platform-host.js";import{GtkImage as o}from"./gtk-image.js";import{applyTemplateXalign as s}from"./gtk-label.js";import{findDialogHost as c}from"./window-state.js";import{ADW_ABOUT_DIALOG_LABELS as l,ADW_LICENSE_DEFAULTS as u,HandledAccumulator as d,aboutDialogVisibility as f,acknowledgementSections as p,createAppInfo as m,creditsSections as h,flatCardShowsWebsite as g,isLicenseType as _,legalMarkupText as v,legalSections as y,legalVisible as b,licenseTypeForNick as x,refuseNewFromAppdata as S,releaseNotesBuffer as C,setLicense as w,setLicenseType as T,stripMnemonic as E}from"@gjsify/adwaita-core";import{Button as D,GridLayout as O,ItemSpec as k,Label as A,ScrollView as j,StackLayout as M}from"@nativescript/core";const N=`closed`,P=`activate-link`,F=m(a);function creditsText(e){return e.map(e=>[...e.title===null?[]:[e.title],...e.people.map(e=>e.name)].join(`
|
|
2
2
|
`)).join(`
|
|
3
3
|
|
|
4
|
-
`)}var AdwAboutDialog=class extends r(
|
|
4
|
+
`)}var AdwAboutDialog=class extends r(O){static GTypeName=`AdwAboutDialog`;_card;_appIcon;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteButton;_supportButton;_issueButton;_creditsLabel;_acknowledgementsLabel;_legalLabel;_releaseNotesLabel;_linksBox;_debugInfoLabel;_copyButton;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_supportUrl=``;_issueUrl=``;_copyright=``;_licenseState={...u};_developers=[];_designers=[];_artists=[];_documenters=[];_translatorCredits=``;_releaseNotes=``;_releaseNotesVersion=``;_debugInfo=``;_links=[];_creditSections=[];_acknowledgementSections=[];_legalSections=[];_releaseNotesSegments=[];_host=null;constructor(e){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new k(1,`star`)),this.addRow(new k(1,`star`));let t=new j;t.orientation=`vertical`,t.verticalAlignment=`middle`,t.horizontalAlignment=`center`,O.setColumn(t,0),O.setRow(t,0);let r=new M;r.orientation=`vertical`,r.className=`adw-about-dialog-card`,t.content=r,this.addChild(t),this._card=r;let i=new o;i.className=`adw-icon adw-about-dialog-icon`,i.pixelSize=128,i.horizontalAlignment=`center`,r.addChild(i),this._appIcon=i,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`),s(this._commentsLabel,0),this._releaseNotesLabel=this._addCardLabel(r,`adw-about-dialog-release-notes`),this._websiteButton=this._addLinkButton(r,`adw-about-dialog-website`),this._linksBox=new M,this._linksBox.className=`adw-about-dialog-links`,r.addChild(this._linksBox),this._supportButton=this._addLinkButton(r,`adw-about-dialog-support`),this._issueButton=this._addLinkButton(r,`adw-about-dialog-issue`),this._creditsLabel=this._addCardLabel(r,`adw-about-dialog-credits`),this._acknowledgementsLabel=this._addCardLabel(r,`adw-about-dialog-acknowledgements`),this._legalLabel=this._addCardLabel(r,`adw-about-dialog-legal`),this._debugInfoLabel=this._addCardLabel(r,`adw-about-dialog-debug-info`);let a=new D;a.text=E(l.copyText),a.className=`adw-about-dialog-copy`,a.set(`androidElevation`,0),a.addEventListener(`tap`,()=>this._copyDebugInfo()),r.addChild(a),this._copyButton=a;let c=new D;c.text=`Close`,c.className=`adw-about-dialog-close`,c.set(`androidElevation`,0),c.addEventListener(`tap`,()=>this.close()),r.addChild(c),this._render(),n(this,e)}_addCardLabel(e,t){let n=new A;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}_addLinkButton(e,t){let n=new D;return n.className=`adw-about-dialog-link ${t}`,n.set(`androidElevation`,0),e.addChild(n),n}_activateLink(e){let t=new d;if(this.notify({eventName:P,object:this,uri:e,accumulator:t}),!t.stopped)try{F.launch_default_for_uri(e,null)}catch{}}_setLink(e,t,n,r){e.text=t,e.visibility=r?`visible`:`collapse`;let i=e;i._uriTap&&e.removeEventListener(`tap`,i._uriTap),i._uriTap=()=>this._activateLink(n),e.addEventListener(`tap`,i._uriTap)}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 supportUrl(){return this._supportUrl}set supportUrl(e){this._supportUrl=e??``,this._render()}get issueUrl(){return this._issueUrl}set issueUrl(e){this._issueUrl=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}get license(){return this._licenseState.license}set license(e){this._licenseState=w(this._licenseState,e??``).state,this._render()}get licenseType(){return this._licenseState.licenseType}set licenseType(e){let n=(typeof e==`string`?x(e.trim()):void 0)??t(e,-1);this._licenseState=T(this._licenseState,n).state,this._render()}get developers(){return this._developers}set developers(e){this._developers=[...e??[]],this._render()}get designers(){return this._designers}set designers(e){this._designers=[...e??[]],this._render()}get artists(){return this._artists}set artists(e){this._artists=[...e??[]],this._render()}get documenters(){return this._documenters}set documenters(e){this._documenters=[...e??[]],this._render()}get translatorCredits(){return this._translatorCredits}set translatorCredits(e){this._translatorCredits=e??``,this._render()}get releaseNotes(){return this._releaseNotes}set releaseNotes(e){this._releaseNotes=e??``,this._updateReleaseNotes()}get releaseNotesVersion(){return this._releaseNotesVersion}set releaseNotesVersion(e){this._releaseNotesVersion=e??``,this._updateReleaseNotes()}get debugInfo(){return this._debugInfo}set debugInfo(e){this._debugInfo=e??``,this._render()}add_link(e,t){this._links.push({title:e,url:t}),this._render()}add_credit_section(e,t){this._creditSections.push({title:e,people:[...t]}),this._render()}add_acknowledgement_section(e,t){this._acknowledgementSections.push({title:e,people:[...t]}),this._render()}add_legal_section(e,t,n,r){_(n)&&(this._legalSections.push({title:e,copyright:t,licenseType:n,license:r}),this._render())}static new_from_appdata(e,t){S()}_updateReleaseNotes(){this._releaseNotesSegments=C({releaseNotes:this._releaseNotes,releaseNotesVersion:this._releaseNotesVersion,version:this._version},l).segments,this._render()}_render(){let e=h({developers:this._developers,designers:this._designers,artists:this._artists,documenters:this._documenters,translatorCredits:this._translatorCredits,creditSections:this._creditSections}),t=p(this._acknowledgementSections),n={copyright:this._copyright,licenseType:this._licenseState.licenseType,license:this._licenseState.license,legalSections:this._legalSections},r=f({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website,supportUrl:this._supportUrl,issueUrl:this._issueUrl,debugInfo:this._debugInfo,releaseNotes:this._releaseNotes,hasCustomLinks:this._links.length>0,hasCredits:e.length>0,hasLegal:b(n),hasAcknowledgements:t.length>0}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};this._appIcon.iconName=this._applicationIcon,this._appIcon.visibility=r.appIcon?`visible`:`collapse`,show(this._nameLabel,this._applicationName,r.appName),show(this._versionLabel,this._version,r.version),show(this._developerLabel,this._developerName,r.developerName),show(this._commentsLabel,this._comments,r.commentsLabel),this._setLink(this._websiteButton,E(l.websiteRow),this._website,g(r)),this._setLink(this._supportButton,E(l.supportRow),this._supportUrl,r.supportRow),this._setLink(this._issueButton,E(l.issueRow),this._issueUrl,r.issueRow),show(this._creditsLabel,creditsText(e),r.creditsRow),show(this._acknowledgementsLabel,creditsText(t),r.acknowledgementsRow),show(this._legalLabel,y(n).map(e=>[e.title??``,v(e.markup)].filter(e=>e.length>0).join(`
|
|
5
5
|
`)).join(`
|
|
6
6
|
|
|
7
|
-
`),r.legalRow),show(this._releaseNotesLabel,this._releaseNotesSegments.map(e=>e.text).join(``),r.whatsNewRow),this._linksBox.removeChildren();for(let e of this._links){let t=this._addLinkButton(this._linksBox,`adw-about-dialog-links-item`);this._setLink(t,
|
|
7
|
+
`),r.legalRow),show(this._releaseNotesLabel,this._releaseNotesSegments.map(e=>e.text).join(``),r.whatsNewRow),this._linksBox.removeChildren();for(let e of this._links){let t=this._addLinkButton(this._linksBox,`adw-about-dialog-links-item`);this._setLink(t,E(e.title),e.url,!0)}this._linksBox.visibility=this._links.length>0?`visible`:`collapse`,show(this._debugInfoLabel,this._debugInfo,r.troubleshootingRow),this._copyButton.visibility=r.troubleshootingRow?`visible`:`collapse`}_copyDebugInfo(){let e=this._debugInfo;Promise.resolve().then(()=>i.writeText(e)).catch(()=>void 0)}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=c(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(){this.visibility=`collapse`,this._host!==null&&(this._host._unhostDialog(this),this._host=null);let e={eventName:N,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}};export{P as ACTIVATE_LINK,AdwAboutDialog,N as CLOSED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GtkImage as i}from"./gtk-image.js";import{ActionRowState as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GtkImage as i}from"./gtk-image.js";import{applyTemplateXalign as a}from"./gtk-label.js";import{ActionRowState as o,isViewSensitive as s,rowLabelVisuals as c}from"./row-state.js";import{adwSubtitleWriteNotifies as l}from"@gjsify/adwaita-core";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";const m=`activated`,h=`notify::title`,g=`notify::subtitle`,_=`notify::icon-name`,v=`notify::activatable`,y=[`prefix`,`suffix`];var AdwActionRow=class extends r(u,{GTypeName:`AdwActionRow`,Properties:{title:{kind:`string`,default:``,blurb:`The title of the row`},subtitle:{kind:`string`,default:``,blurb:`The subtitle of the row`,normalize:e=>e==null?``:String(e),changed:(e,t,n)=>l(String(t),n==null?null:String(e))},"icon-name":{kind:`string`,default:``,blurb:`The icon name for this row`},activatable:{kind:`boolean`,default:!1,blurb:`Whether this row can be activated`}}}){static GTypeName=`AdwActionRow`;static builderSlots=e(y,`suffix`);isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new o;_prefix=null;_iconImage=null;_suffix=null;constructor(e){super(),this.className=`adw-row adw-action-row`,this.addColumn(new d(1,`auto`)),this.addColumn(new d(1,`star`)),this.addColumn(new d(1,`auto`)),this.addRow(new d(1,`auto`));let t=new p;t.orientation=`vertical`,t.className=`adw-row-text`,u.setColumn(t,1);let r=new f;r.className=`adw-row-title`,r.textWrap=!0,a(r,0),t.addChild(r);let i=new f;i.className=`adw-row-subtitle`,i.textWrap=!0,a(i,0),t.addChild(i),this.addChild(t),this._textStack=t,this._titleLabel=r,this._subtitleLabel=i,this.connect(h,e=>e._applyLabels()),this.connect(g,e=>e._applyLabels()),this.connect(_,e=>e._applyIconName()),this.connect(v,e=>{e._rowState.setActivatable(e.activatable)}),this._applyLabels(),this.addEventListener(`tap`,()=>this.activate()),n(this,e)}add_prefix(e){this._prefix&&this.remove(this._prefix),e.className=`${e.className??``} adw-row-prefix`.trim(),u.setColumn(e,0),this.insertChild(e,0),this._prefix=e}get prefix(){return this._prefix}add_suffix(e){this._suffix&&this.remove(this._suffix),e.className=`${e.className??``} adw-row-suffix`.trim(),u.setColumn(e,2),this.addChild(e),this._suffix=e}remove(e){if(e===this._prefix)this._prefix=null;else if(e===this._suffix)this._suffix=null;else throw TypeError(`${this.constructor.name}.remove(): the view is neither this row's prefix nor its suffix. add_prefix()/add_suffix() are the only two slots remove() clears.`);this.removeChild(e),e===this._iconImage&&(this._iconImage=null,this.iconName=``)}get suffix(){return this._suffix}_addChildFromBuilder(e,n){t(e,y,`suffix`)===`prefix`?this.add_prefix(n):this.add_suffix(n)}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,s(e))&&e!==null&&(this.activatable=this._rowState.activatable)}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(s(e))&&(this.activatable=this._rowState.activatable)}activate(){if(!this.activatable)return;let e={eventName:m,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=c({title:this.title,subtitle:this.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}_applyIconName(){let e=this.iconName;if(e===``){this._iconImage!==null&&this.remove(this._iconImage);return}this._iconImage===null&&(this._iconImage=new i,this.add_prefix(this._iconImage)),this._iconImage.iconName=e}};export{m as ACTIVATED,AdwActionRow,v as NOTIFY_ACTIVATABLE,_ as NOTIFY_ICON_NAME,g as NOTIFY_SUBTITLE,h as NOTIFY_TITLE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{GtkImage as t}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{GtkImage as t}from"./gtk-image.js";import{classNameWith as n,normalizeStyleClasses as r,withCssClass as i,withoutCssClass as a}from"./style-classes.js";import{applyTemplateXalign as o}from"./gtk-label.js";import{ButtonRowState as s,buttonRowIconColor as c,buttonRowIconVisuals as l}from"./row-state.js";import{ACTIVATED as u,AdwActionRow as d}from"./adw-action-row.js";import{attachRowPressFeedback as f}from"./row-press.js";import{adwaitaAccent as p,onAdwaitaAccentChanged as m}from"@gjsify/adwaita-core";import{StackLayout as h}from"@nativescript/core";const g=`adw-row adw-action-row adw-button-row`;var _=class AdwButtonRow extends d{static GTypeName=`AdwButtonRow`;isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new s;_styleClasses=[];constructor(t){super(),this.className=g,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,o(this._titleLabel,.5),this._textStack.removeChild(this._titleLabel);let n=new h;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(),f(this),e(this,t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(r(e))}add_css_class(e){this._setClasses(i(this._styleClasses,e))}remove_css_class(e){this._setClasses(a(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(r([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=n(g,e)}static _makeIcon(e){let n=new t;return n.className=`${n.className} ${e}`.trim(),n.verticalAlignment=`middle`,n}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=c(this._pinnedIconColor,p());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=l(this._buttonState.state);this._startIcon.iconName=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.iconName=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{u as ACTIVATED,_ as AdwButtonRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{readDeclaredValue as t,withProperties as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{readDeclaredValue as t,withProperties as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{applyTemplateXalign as i}from"./gtk-label.js";import{AdwActionRow as a}from"./adw-action-row.js";import{AdwImageButton as o}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as s,NS_ENTRY_ROW_CLASS as c,applyEntryRowState as l}from"./entry-row-view.js";import{ADW_ACCENT_FG_COLOR as u,clampEntryMaxLength as d,clampEntryText as f,deriveEntryRowState as p,entryRowLatches as m,entryTextLength as h,resolveEntryRowActivation as g}from"@gjsify/adwaita-core";import{Label as _,StackLayout as v,TextField as y}from"@nativescript/core";import{documentEditSymbolic as b,objectSelectSymbolic as x}from"@gjsify/adwaita-icons/actions";const S=`notify::text`,C=`notify::text-length`,w=`notify::max-length`,T=`notify::editable`,E=`notify::show-apply-button`,D=`notify::activates-default`,O=`apply`,k=`entry-activated`;var AdwEntryRow=class extends n(a,{GTypeName:`AdwEntryRow`,Properties:{text:{kind:`string`,default:``,blurb:`The entry text`,normalize:(e,t)=>f(String(e??``),t.maxLength)},"text-length":{kind:`uint`,default:0,blurb:`The length of the text, in characters`,normalize:(e,t)=>h(t.text)},"max-length":{kind:`int`,default:0,blurb:`The maximum length of the text, in characters`,normalize:e=>d(t(`max-length`,`int`,e))},editable:{kind:`boolean`,default:!0,blurb:`Whether the entry is editable`},"show-apply-button":{kind:`boolean`,default:!1,blurb:`Whether to show the apply button`},"activates-default":{kind:`boolean`,default:!1,blurb:`Whether activating the embedded entry can activate the default widget`}},Signals:{apply:{},"entry-activated":{}}}){static GTypeName=`AdwEntryRow`;isActionRow=!1;_editing=!1;_showIndicator=!1;_textChanged=!1;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;constructor(t){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,i(this._titleLabel,0),this._managesTitleVisibility=!1;let n=new _;n.className=`adw-row-title adw-entry-empty-title`,n.textWrap=!0,i(n,0),this._textStack.insertChild(n,0),this._emptyTitle=n;let a=new y;a.className=`adw-entry-field`,a.set(`backgroundColor`,`transparent`),a.set(`borderWidth`,0),this._textStack.addChild(a),this._field=a;let c=new v;c.orientation=`horizontal`,c.className=`adw-entry-row-suffixes`,this._suffixes=c;let l=new r;l.className=`gtk-image adw-entry-indicator`,c.addChild(l),this._indicator=l;let d=new o;d.className=`${d.className} adw-entry-apply`.trim(),d.iconName=x,d.iconColor=u,d.addEventListener(`tap`,()=>this.apply()),c.addChild(d),this._applyButton=d;let f=new r;f.className=s,f.iconName=b,c.addChild(f),this._editIcon=f,super.add_suffix(c),this._field.addEventListener(`textChange`,()=>{this.text=this._field.text??``}),this._field.addEventListener(`focus`,()=>this._setEditing(!0)),this._field.addEventListener(`blur`,()=>this._setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this.connect(S,e=>e._onTextChanged()),this.connect(w,e=>e._onMaxLengthChanged()),this.connect(T,e=>e._update()),this.connect(E,e=>e._onShowApplyButtonChanged()),this._update(),e(this,t)}get editing(){return this._editing}get textChanged(){return this._textChanged}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._showIndicator=!!e,this._update()}setIndicatorIcon(e){this._indicator.iconName=e}apply(){this._textChanged=!1,this._update(),this.emit(O)}_activate(){if(g(this._textChanged,this.activatesDefault).signal===`apply`){this.apply();return}this.emit(k)}_update(){this._render(p({text:this.text,editing:this._editing,editable:this.editable,showIndicator:this._showIndicator,textChanged:this._textChanged}))}_render(e){l({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 c}_setEditing(e){e!==this._editing&&(this._editing=e,this._update())}_onTextChanged(){m(this.showApplyButton,this._editing)&&(this._textChanged=!0),this._update(),this.textLength=h(this.text)}_onMaxLengthChanged(){this.text=f(this.text,this.maxLength)}_onShowApplyButtonChanged(){this.showApplyButton||!this._textChanged||(this._textChanged=!1,this._update())}};export{AdwEntryRow,D as NOTIFY_ACTIVATES_DEFAULT,T as NOTIFY_EDITABLE,w as NOTIFY_MAX_LENGTH,E as NOTIFY_SHOW_APPLY_BUTTON,S as NOTIFY_TEXT,C as NOTIFY_TEXT_LENGTH,O as SIGNAL_APPLY,k as SIGNAL_ENTRY_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{adoptIntoBin as p}from"./bin-layout.js";import{DockLayout as m,Image as h}from"@nativescript/core";const g=t;var AdwImageButton=class extends o(m){static GTypeName=`AdwImageButton`;_image;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-image-button`;let t=new h;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._renderedSize,t.height=this._renderedSize,this._image=p(this,t),f(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),a(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return r(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this._image.width=e,this._image.height=e,this._render()}_render(){u(this._image,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._applySize()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=n(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(t){this._pixelSize=i(e(t,this._pixelSize)),this._applySize()}get image(){return this._image}};export{AdwImageButton,g as DEFAULT_ICON_BUTTON_ICON_SIZE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{StyleClassList as i}from"./style-classes.js";import{PREFERENCES_GROUP_HEADER_CLASS as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{StyleClassList as i}from"./style-classes.js";import{applyTemplateXalign as a}from"./gtk-label.js";import{PREFERENCES_GROUP_HEADER_CLASS as o,preferencesGroupVisuals as s}from"./preferences-group-state.js";import{GridLayout as c,ItemSpec as l,Label as u,StackLayout as d}from"@nativescript/core";const f=[`headerSuffix`,`header-suffix`];var AdwPreferencesGroup=class extends r(d){static GTypeName=`AdwPreferencesGroup`;static builderSlots=e(f,`row`);_header;_titleLabel;_descriptionLabel;_suffixHost;_listbox;_title=``;_description=``;_headerSuffix=null;_classList=new i(`adw-preferences-group`);constructor(e){super(),this.orientation=`vertical`,this._restyle();let t=new c;t.className=o,t.addColumn(new l(1,`star`)),t.addColumn(new l(1,`auto`)),t.addRow(new l(1,`auto`));let r=new d;r.orientation=`vertical`,r.className=`adw-preferences-group-labels`,r.verticalAlignment=`middle`,c.setColumn(r,0),t.addChild(r);let i=new u;i.className=`adw-preferences-group-title`,i.textWrap=!0,a(i,0),r.addChild(i);let s=new u;s.className=`adw-preferences-group-description`,s.textWrap=!0,a(s,0),r.addChild(s);let f=new d;f.orientation=`horizontal`,f.className=`adw-preferences-group-suffix`,f.verticalAlignment=`middle`,c.setColumn(f,1),t.addChild(f);let p=new d;p.orientation=`vertical`,p.className=`boxed-list adw-preferences-group-listbox`,this.addChild(t),this.addChild(p),this._header=t,this._titleLabel=i,this._descriptionLabel=s,this._suffixHost=f,this._listbox=p,this._applyVisuals(),n(this,e)}get title(){return this._title}set title(e){this._title=e??``,this._titleLabel.text=this._title,this._applyVisuals()}get description(){return this._description}set description(e){this._description=e??``,this._descriptionLabel.text=this._description,this._applyVisuals()}get headerSuffix(){return this._headerSuffix}set headerSuffix(e){e!==this._headerSuffix&&(this._headerSuffix&&this._suffixHost.removeChild(this._headerSuffix),this._headerSuffix=e,this._headerSuffix&&this._suffixHost.addChild(this._headerSuffix),this._applyVisuals())}_addChildFromBuilder(e,n){let r=t(e,f,`row`);if(r===`headerSuffix`||r===`header-suffix`){this.headerSuffix=n;return}this.add(n)}add(e){this._listbox.addChild(e),this._refreshRowEdges(),this._applyVisuals()}remove(e){this._listbox.removeChild(e),this._refreshRowEdges(),this._applyVisuals()}searchRows(){let e=[],t=this._listbox.getChildrenCount();for(let n=0;n<t;n++)e.push(this._listbox.getChildAt(n));return e}_applyVisuals(){let e=s({title:this._title,description:this._description,hasHeaderSuffix:this._headerSuffix!==null,rowCount:this._listbox.getChildrenCount()});this._titleLabel.visibility=e.titleVisibility,this._descriptionLabel.visibility=e.descriptionVisibility,this._header.visibility=e.headerVisibility,this._header.className=e.headerClassName,this._listbox.visibility=e.listboxVisibility}_refreshRowEdges(){let e=this._listbox.getChildrenCount();for(let t=0;t<e;t++){let e=this._listbox.getChildAt(t);e&&this._setFlushTop(e,t===0)}}_setFlushTop(e,t){let n=(e.className??``).replace(/\s*\badw-row-flush-top\b/g,``);e.className=t?`${n} adw-row-flush-top`.trim():n.trim()}get listbox(){return this._listbox}get styleClasses(){return this._classList.classes}set styleClasses(e){this._classList.replace(e),this._restyle()}add_css_class(e){this._classList.add(e),this._restyle()}remove_css_class(e){this._classList.remove(e),this._restyle()}has_css_class(e){return this._classList.has(e)}get_css_classes(){return this._classList.classes}set_css_classes(e){this._classList.replaceAll(e),this._restyle()}_restyle(){this.className=this._classList.className}};export{AdwPreferencesGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{buttonContentClassName as a,buttonContentLabelText as o}from"./button-content.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{buttonContentClassName as a,buttonContentLabelText as o}from"./button-content.js";import{MenuSlot as s}from"./menu-slot.js";import{showMenuPopup as c}from"./popup-menu-view.js";import{splitButtonArrowSvg as l}from"./split-button.js";import{ArrowType as u}from"./gtk-enums.js";import{GioMenuModel as d,SPLIT_BUTTON_DISABLED_OPACITY as f,SplitButtonState as p}from"@gjsify/adwaita-core";import{GridLayout as m,ItemSpec as h,Label as g,StackLayout as _}from"@nativescript/core";const v=`notify::direction`,y=`menuTapped`,clearOtherSlot=(e,t)=>{if(!(e._contentGate||e[t]===null)){e._contentGate=!0;try{e[t]=null}finally{e._contentGate=!1}}};var AdwSplitButton=class extends n(m,{GTypeName:`AdwSplitButton`,Signals:{clicked:{},activate:{}},Properties:{label:{kind:`string`,default:null,blurb:`The label to show in the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.label:String(e)},afterNotify:e=>clearOtherSlot(e,`iconName`)},"icon-name":{kind:`string`,default:null,blurb:`The name of the icon used to automatically populate the button`,normalize:(e,t)=>{let n=t;return n._contentGate?null:e==null?n.iconName:String(e)===``?null:String(e)},changed:(e,t,n)=>e!==t||n===``,afterNotify:e=>clearOtherSlot(e,`label`)},"use-underline":{kind:`boolean`,default:!1,blurb:`Whether an underline in the text indicates a mnemonic`},"can-shrink":{kind:`boolean`,default:!1,blurb:`Whether the button can be smaller than the natural size of its contents`},"dropdown-tooltip":{kind:`string`,default:``,blurb:`The tooltip of the dropdown button`},"menu-model":{kind:`object`,valueType:d.$gtype,explicitNotify:!0,blurb:`The menu model from which the popup will be created`,normalize:(e,t)=>t._slot.read(e),afterNotify:e=>{e._applyMenuModel(),e.notify(`menu-model`)}}}}){static GTypeName=`AdwSplitButton`;static emittedSignals=[v];_actionPart;_actionLabel;_actionIcon;_dropdownPart;_chevron;_state=new p;_slot=new s(`AdwSplitButton`,()=>void 0);_actions=null;_showingIcon=!1;_sensitive=!0;_contentGate=!1;constructor(e){super(),this.className=`adw-split-button`,this.addColumn(new h(1,`auto`)),this.addColumn(new h(1,`auto`)),this.addRow(new h(1,`auto`));let n=new _;n.orientation=`horizontal`,n.className=`adw-split-button-action`,n.horizontalAlignment=`center`,m.setColumn(n,0);let o=new g;o.className=`adw-split-button-label`,o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-split-button-action-icon`.trim(),s.verticalAlignment=`middle`,this.addChild(n),this._actionPart=n,this._actionLabel=o,this._actionIcon=s;let c=new m;c.className=`adw-split-button-dropdown`,c.addColumn(new h(1,`star`)),c.addRow(new h(1,`star`)),m.setColumn(c,1);let u=new r;u.className=`${u.className} adw-split-button-chevron`.trim(),u.iconName=l(this._state.direction),u.horizontalAlignment=`center`,u.verticalAlignment=`middle`,c.addChild(u),this.addChild(c),this._dropdownPart=c,this._chevron=u,n.addEventListener(`tap`,()=>this._click()),this.connect(`activate`,e=>e._click()),c.addEventListener(`tap`,()=>{this._openMenu()}),i(n),i(c),this.connect(`notify::label`,e=>e._renderContent()),this.connect(`notify::icon-name`,e=>e._renderContent()),this.connect(`notify::use-underline`,e=>e._renderContent()),this.connect(`notify::can-shrink`,e=>{e._actionLabel.className=a(e._actionLabel.className,e.canShrink)}),this._state.subscribe(()=>this._render()),this._render(),t(this,e)}_applyMenuModel(){this._slot.adopt(this.menuModel),this._state.setMenuModel(this.menuModel)}_openMenu(){if(!(!this._sensitive||this._state.open||!this._state.dropdownEnabled)){this._state.toggleMenu();try{c(this._dropdownPart,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n=this._state.activateMenuItem(t);if(n===null)return;let r={eventName:y,object:this,item:n.label,id:n.id??n.label,path:t,action:n.action};this.notify(r)},onDismiss:()=>this._state.closeMenu()})}catch(e){throw this._state.closeMenu(),e}}}_click(){this._sensitive&&this.emit(`clicked`)}_renderContent(){let e=this.iconName!==null;e?this._actionIcon.iconName=this.iconName??``:this._actionLabel.text=o(this.label??``,this.useUnderline),e!==this._showingIcon&&(this._actionPart.removeChild(this._showingIcon?this._actionIcon:this._actionLabel),this._actionPart.addChild(e?this._actionIcon:this._actionLabel),this._showingIcon=e)}_render(){let{direction:e,dropdownEnabled:t}=this._state;this._chevron.iconName=l(e),this._dropdownPart.opacity=t?1:f,this.opacity=this._sensitive?1:f}get actions(){return this._actions}set actions(e){this._actions=e??null}get_direction(){return u[this._state.direction.toUpperCase()]}set_direction(e){let t=e,n=typeof t==`number`?t:/^\d+$/.test(String(t))?Number(t):u[String(t).toUpperCase()],r=Object.keys(u).find(e=>u[e]===n)?.toLowerCase();if(r===void 0)throw TypeError(`${String(t)} is not a valid value for enum argument direction (Gtk.ArrowType)`);this._state.setDirection(r)&&this.notify({eventName:v,object:this,value:this.get_direction()})}get sensitive(){return this._sensitive}set sensitive(t){let n=!!e(t,this._sensitive);n!==this._sensitive&&(this._sensitive=n,this._render())}get actionButton(){return this._actionPart}};export{AdwSplitButton,y as MENU_TAPPED,v as NOTIFY_DIRECTION};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";function adoptIntoBin(e,t){return e.stretchLastChild=!0,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,e.addChild(t),t}export{adoptIntoBin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_BOX_SPACING as e,normalizeBoxSpacing as t,resolveWrapBoxChildOrder as n}from"@gjsify/adwaita-core";function boxSpacingChanges(e,n){return t(n)!==t(e)}function boxTrackPlan(e,n,r){let i=t(n),a=[];for(let[t,n]of e.entries())t>0&&a.push({unit:`pixel`,value:i}),a.push({unit:r||n?`star`:`auto`,value:1});return a}function boxChildTrack(e){return e*2}export{e as DEFAULT_BOX_SPACING,boxChildTrack,boxSpacingChanges,boxTrackPlan,t as normalizeBoxSpacing,n as resolveBoxChildOrder};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_BOX_SPACING as e,normalizeBoxSpacing as t,resolveWrapBoxChildOrder as n}from"@gjsify/adwaita-core";function boxSpacingChanges(e,n){return t(n)!==t(e)}function boxTrackPlan(e,n,r){let i=t(n),a=[];for(let[t,n]of e.entries())t>0&&a.push({unit:`pixel`,value:i}),a.push({unit:r||n?`star`:`auto`,value:1});return a}function boxChildTrack(e){return e*2}function boxTrackDiff(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r].unit===t[r].unit&&e[r].value===t[r].value;)r+=1;return{keep:r,add:t.slice(r)}}function boxPlacementStart(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e[r]===t[r];)r+=1;return r}export{e as DEFAULT_BOX_SPACING,boxChildTrack,boxPlacementStart,boxSpacingChanges,boxTrackDiff,boxTrackPlan,t as normalizeBoxSpacing,n as resolveBoxChildOrder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";const e={AdwAboutDialog:`dialog`,AdwActionRow:`row`,AdwAlertDialog:`dialog`,AdwApplicationWindow:`window`,AdwAvatar:`widget`,AdwBanner:`banner`,AdwBin:`widget`,AdwBottomSheet:`bottom-sheet`,AdwButtonContent:`buttoncontent`,AdwButtonRow:`row`,AdwCarouselIndicatorDots:`carouselindicatordots`,AdwCarouselIndicatorLines:`carouselindicatorlines`,AdwCarousel:`carousel`,AdwClamp:`clamp`,AdwComboRow:`row`,AdwDialog:`dialog`,AdwEntryRow:`row`,AdwExpanderRow:`row`,AdwHeaderBar:`headerbar`,AdwInlineViewSwitcher:`inline-view-switcher`,AdwNavigationPage:`navigation-view-page`,AdwNavigationSplitView:`navigation-split-view`,AdwNavigationView:`navigation-view`,AdwOverlaySplitView:`overlay-split-view`,AdwPasswordEntryRow:`row`,AdwPreferencesGroup:`preferencesgroup`,AdwPreferencesPage:`preferencespage`,AdwShortcutLabel:`shortcut-label`,AdwSidebar:`sidebar`,AdwSpinner:`image`,AdwSpinRow:`row`,AdwSplitButton:`splitbutton`,AdwStatusPage:`statuspage`,AdwSwitchRow:`row`,AdwTabView:`tabview`,AdwToastOverlay:`toastoverlay`,AdwToggleGroup:`toggle-group`,AdwToolbarView:`toolbarview`,AdwViewStack:`stack`,AdwViewSwitcherBar:`viewswitcherbar`,AdwViewSwitcher:`viewswitcher`,AdwWindowTitle:`windowtitle`,AdwWindow:`window`,AdwWrapBox:`wrap-box`,GtkActionBar:`actionbar`,GtkBox:`box`,GtkButton:`button`,GtkCheckButton:`checkbutton`,GtkDrawingArea:`widget`,GtkDropDown:`dropdown`,GtkEntry:`entry`,GtkFrame:`frame`,GtkGrid:`grid`,GtkImage:`image`,GtkLabel:`label`,GtkListBox:`list`,GtkMenuButton:`menubutton`,GtkOverlay:`overlay`,GtkPopoverMenu:`popover`,GtkRevealer:`revealer`,GtkScrolledWindow:`scrolledwindow`,GtkSeparator:`separator`,GtkStack:`stack`,GtkTextView:`textview`,GtkToggleButton:`button`,GtkWindow:`window`};function nsTypeSelector(e){return e.replace(`-`,``).toLowerCase()}function cssTypeOf(t){for(let n=t;typeof n==`function`&&n!==Function.prototype;n=Object.getPrototypeOf(n)){let t=n;if(!Object.hasOwn(t,`GTypeName`)||typeof t.GTypeName!=`string`)continue;let r=e[t.GTypeName];if(r!==void 0)return nsTypeSelector(r)}}export{e as GTK_CSS_NAMES,cssTypeOf,nsTypeSelector};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{NOTIFY_HEXPAND as r,NOTIFY_VEXPAND as i}from"./widget-layout.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{DEFAULT_BOX_SPACING as o,boxChildTrack as s,
|
|
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{NOTIFY_HEXPAND as r,NOTIFY_VEXPAND as i}from"./widget-layout.js";import{AdwStyledLayoutBase as a}from"./styled-layout-base.js";import{DEFAULT_BOX_SPACING as o,boxChildTrack as s,boxPlacementStart as c,boxSpacingChanges as l,boxTrackDiff as u,boxTrackPlan as d,normalizeBoxSpacing as f,resolveBoxChildOrder as p}from"./box-layout.js";import{normalizeBoxOrientation as m}from"@gjsify/adwaita-core";import{GridLayout as h,ItemSpec as g}from"@nativescript/core";var GtkBox=class extends a{static GTypeName=`GtkBox`;_spacing=o;_orientation=`horizontal`;_homogeneous=!1;_tracks=[];_tracksVertical=null;_specs=[];_placed=[];_followers=new Map;constructor(e){super(),n(this,e)}append(e){this.addChild(e)}prepend(e){this.insertChild(e,0)}remove(e){this.removeChild(e)}addChild(e){super.addChild(e),this._follow(e),this._applyChildren()}insertChild(e,t){let n=super.insertChild(e,t);return this._follow(e),this._applyChildren(),n}removeChild(e){this._unfollow(e),super.removeChild(e),this._applyChildren()}insert_child_after(e,t=null){return this._applyOrder(`insert-after`,e,t)}reorder_child_after(e,t=null){return this._applyOrder(`reorder-after`,e,t)}get spacing(){return this._spacing}set spacing(e){let n=t(e,this._spacing);l(this._spacing,n)&&(this._spacing=f(n),this._applyChildren(),this.notify({eventName:`notify::spacing`,object:this}))}get orientation(){return this._orientation}set orientation(e){let t=m(e===1?`vertical`:e);t!==this._orientation&&(this._orientation=t,this._applyChildren(),this.notify({eventName:`notify::orientation`,object:this}))}get homogeneous(){return this._homogeneous}set homogeneous(t){let n=e(t,this._homogeneous);n!==this._homogeneous&&(this._homogeneous=n,this._applyChildren())}_childViews(){let e=[];for(let t=0;t<this.getChildrenCount();t++)e.push(this.getChildAt(t));return e}_applyOrder(e,t,n){let r=this._childViews(),i=p({children:r,child:t,sibling:n,op:e});return i===null?!1:(r.includes(t)&&this.removeChild(t),this.insertChild(t,i.indexOf(t)),!0)}_follow(e){if(this._followers.has(e))return;let follower=()=>this._applyChildren();this._followers.set(e,follower),e.addEventListener(r,follower),e.addEventListener(i,follower)}_unfollow(e){let t=this._followers.get(e);t!==void 0&&(e.removeEventListener(r,t),e.removeEventListener(i,t),this._followers.delete(e))}_applyChildren(){let e=this._orientation===`vertical`,t=this._childViews(),n=d(t.map(t=>{let n=t;return(e?n.vexpand:n.hexpand)===!0}),this._spacing,this._homogeneous);e!==this._tracksVertical&&(this.removeColumns(),this.removeRows(),e?this.addColumn(new g(1,`star`)):this.addRow(new g(1,`star`)),this._tracksVertical=e,this._tracks=[],this._specs.length=0,this._placed=[]);let{keep:r,add:i}=u(this._tracks,n);if(r<this._tracks.length||i.length>0){for(;this._specs.length>r;){let t=this._specs.pop();e?this.removeRow(t):this.removeColumn(t)}for(let{unit:t,value:n}of i){let r=new g(n,t);this._specs.push(r),e?this.addRow(r):this.addColumn(r)}this._tracks=n}for(let n=c(this._placed,t);n<t.length;n+=1){let r=t[n];h.setColumn(r,e?0:s(n)),h.setRow(r,e?s(n):0)}this._placed=t}};export{o as DEFAULT_BOX_SPACING,GtkBox};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{activateWidgetAction as r}from"./actions.js";import{applyNativeTooltip as i}from"./native-tooltip.js";import{withSignals as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{classNameWith as s,normalizeStyleClasses as c,withCssClass as l,withoutCssClass as u}from"./style-classes.js";import{attachRowPressFeedback as d}from"./row-press.js";import{adoptIntoBin as f}from"./bin-layout.js";import{buttonSlotAfterWrite as p,buttonSlotDetaches as m}from"./button-slot.js";import{labelDisplayText as h}from"@gjsify/adwaita-core";import{DockLayout as g,Label as _}from"@nativescript/core";const v=`clicked`,y=`image-button`,b=`adw-button-label`;var GtkButton=class extends a(g,{GTypeName:`GtkButton`,Signals:{clicked:{}}}){static GTypeName=`GtkButton`;static builderSlots=e([`child`],`child`);_styleClasses=[];_label=``;_iconName=``;_tooltipText=``;_useUnderline=!1;_slot=`empty`;_content=null;constructor(e){super(),this.className=s(`adw-button`,this._styleClasses),d(this),this.addEventListener(`tap`,()=>{this.emit(v),this.actionName&&r(this,this.actionName)}),this.addEventListener(`loaded`,()=>{i(this,this.tooltipText),this._pinIconColor()}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._fill(`label`,this._label)}actionName=null;get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._fill(`icon`,this._iconName)}get tooltipText(){return this._tooltipText}set tooltipText(e){let t=e??``;(this.accessibilityHint??``)===this._tooltipText&&(this.accessibilityHint=t),this._tooltipText=t,i(this,t)}get child(){return this._slot===`child`?this._content:null}set child(e){this._fill(`child`,e??null)}set_child(e){this.child=e}get_child(){return this.child}_addChildFromBuilder(e,t){this.child=t}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=t(e,this._useUnderline),this._slot===`label`&&this._fill(`label`,this._label)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(c(e))}add_css_class(e){this._setClasses(l(this._styleClasses,e))}remove_css_class(e){this._setClasses(u(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(c([...e].join(` `)))}_setClasses(e){this._styleClasses=[...e],this._restyle()}_restyle(){this.className=s(`adw-button`,[...this._styleClasses,...this._stateClasses()]),this._pinIconColor()}_stateClasses(){return this._slot===`icon`?[y]:[]}_fill(e,t){let n=p(e,t);m(this._slot,n)&&this._detach();let r=this._slot===`icon`;if(this._slot=n,r!==(n===`icon`)&&this._restyle(),n===`empty`){this._detach();return}if(n===`child`){let e=t;if(this._content===e)return;this._detach(),this._adopt(e);let n=e;`hostButton`in n&&(n.hostButton=this);return}if(n===`label`){let e=this._content instanceof _?this._content:this._adopt(new _);e.className=b,e.text=h(this._label,!1,this._useUnderline);return}let i=this._content instanceof o?this._content:this._adopt(new o);i.iconName=this._iconName,this._pinIconColor()}_pinIconColor(){this._content instanceof o&&(this._styleClasses.some(e=>e===`osd`||e===`suggested-action`)||this._inOsdContainer())&&(this._content.iconColor=`#ffffff`)}_inOsdContainer(){for(let e=this.parent;e;e=e.parent)if((e.className??``).split(/\s+/).includes(`osd`))return!0;return!1}_detach(){this._content&&this.removeChild(this._content),this._content=null}_adopt(e){return f(this,e),this._content=e,e}};export{v as GTK_BUTTON_CLICKED,y as GTK_BUTTON_IMAGE_CLASS,b as GTK_BUTTON_LABEL_CLASS,GtkButton};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{GtkImage as r}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{GtkImage as r}from"./gtk-image.js";import{classNameWith as i}from"./style-classes.js";import{attachRowPressFeedback as a}from"./row-press.js";import{AdwStyledLayoutBase as o}from"./styled-layout-base.js";import{resolveIdReference as s}from"./id-reference.js";import{checkActivationFlips as c,checkGroupNeighbours as l,isRadioCheck as u,labelDisplayText as d,setCheckGroup as f}from"@gjsify/adwaita-core";import{GridLayout as p,ItemSpec as m,Label as h}from"@nativescript/core";import{objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`toggled`,v=`activate`,y=`notify::active`,b=`checked`,x=`inconsistent`;var S=class GtkCheckButton extends o{static GTypeName=`GtkCheckButton`;static emittedSignals=[_,v,y];static builderSlots=e([`child`],`child`);static builderReferences=[`group`];_indicator;_mark;_text;_active=!1;_inconsistent=!1;_label=null;_useUnderline=!1;_child=null;_groupId=null;_contentUnit=`auto`;constructor(e){super(),this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,`auto`)),this.addRow(new m(1,`auto`));let t=new p;t.className=`adw-check-indicator`,t.addColumn(new m(1,`star`)),t.addRow(new m(1,`star`)),t.verticalAlignment=`middle`,p.setColumn(t,0),p.setRow(t,0);let i=new r;i.iconName=g,i.pixelSize=14,i.iconColor=`#ffffff`,i.horizontalAlignment=`center`,i.verticalAlignment=`middle`,i.visibility=`collapse`,t.addChild(i),this.addChild(t),this._indicator=t,this._mark=i;let o=new h;o.className=`adw-check-label`,o.verticalAlignment=`middle`,o.visibility=`collapse`,p.setColumn(o,1),p.setRow(o,0),this.addChild(o),this._text=o,this.addEventListener(`loaded`,()=>this._resolveGroupId()),a(this),this.addEventListener(`tap`,()=>{c(this,this._active)&&(this._inconsistent=!1,this.active=!this._active,this._restyle(),this.notify({eventName:v,object:this}))}),this._restyle(),n(this,e)}get active(){return this._active}set active(e){let n=t(e,this._active);if(n!==this._active){if(n)for(let e of l(this))e.active=!1;this._active=n,this._restyle(),this.notify({eventName:_,object:this}),this.notify({eventName:y,object:this})}}set group(e){if(typeof e==`string`){this._groupId=e,this.isLoaded&&this.set_group(s(this,`group`,e,GtkCheckButton));return}this._groupId=null,this.set_group(e)}set_group(e){f(this,e),this._restyle(),e?._restyle()}_resolveGroupId(){let e=this._groupId;e!==null&&(this._groupId=null,this.set_group(s(this,`group`,e,GtkCheckButton)))}get inconsistent(){return this._inconsistent}set inconsistent(e){let n=t(e,this._inconsistent);n!==this._inconsistent&&(this._inconsistent=n,this._restyle(),this.notify({eventName:`notify::inconsistent`,object:this}))}get label(){return this._label}set label(e){this._label=e??null,this._paintLabel()}get useUnderline(){return this._useUnderline}set useUnderline(e){this._useUnderline=!!t(e,this._useUnderline),this._paintLabel()}_paintLabel(){this._text.text=d(this._label??``,!1,this._useUnderline),this._syncContent()}get child(){return this._child}set child(e){let t=e??null;t!==this._child&&(this._child&&this.removeChild(this._child),this._child=t,t&&(p.setColumn(t,1),p.setRow(t,0),this.addChild(t)),this._syncContent())}set_child(e){this.child=e}get_child(){return this._child}get_active(){return this._active}set_active(e){this.active=e}_addChildFromBuilder(e,t){this.child=t}_syncContent(){let e=!!this._child||!!this._label;this._text.visibility=!this._child&&this._label?`visible`:`collapse`;let t=e?`star`:`auto`;t!==this._contentUnit&&(this._contentUnit=t,this.removeColumns(),this.addColumn(new m(1,`auto`)),this.addColumn(new m(1,t)))}get _ownClass(){return`adw-check-button`}_restyle(){let e=[];this._active&&e.push(b),this._inconsistent&&e.push(x),this.className=i(this._ownClass,[...this.styleClasses,...e]),this._indicator.className=i(`adw-check-indicator`,u(this)?[...e,`radio`]:e),this._mark.visibility=this._active||this._inconsistent?`visible`:`collapse`}};export{v as GTK_CHECK_BUTTON_ACTIVATE,b as GTK_CHECK_BUTTON_CHECKED_CLASS,x as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,_ as GTK_CHECK_BUTTON_TOGGLED,S as GtkCheckButton,y as NOTIFY_CHECK_ACTIVE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{readDeclaredValue as t,withSignals as n}from"./signals.js";import{clampEntryMaxLength as r,clampEntryText as i,entryTextLength as a}from"@gjsify/adwaita-core";import{GridLayout as o,ItemSpec as s,TextField as c}from"@nativescript/core";const l=`notify::text`,u=`notify::text-length`,d=`notify::max-length`,f=`notify::placeholder-text`,p=`notify::editable`,m=`activate`,h=`changed`;var GtkEntry=class extends n(o,{GTypeName:`GtkEntry`,Properties:{text:{kind:`string`,default:``,explicitNotify:!0,blurb:`The contents of the entry`,normalize:(e,t)=>e==null?t.text:i(String(e),t.maxLength),afterNotify:e=>e._applyText()},"text-length":{kind:`uint`,default:0,blurb:`Number of characters in the text`,normalize:(e,t)=>a(t.text)},"max-length":{kind:`int`,default:0,explicitNotify:!0,blurb:`Maximum number of characters for this entry`,normalize:e=>r(t(`max-length`,`int`,e)),afterNotify:e=>e._applyMaxLength()},"placeholder-text":{kind:`string`,default:``,blurb:`Show text in the entry when it is empty and unfocused`,normalize:e=>e==null?``:String(e),changed:()=>!0,afterNotify:e=>e._applyPlaceholderText()},editable:{kind:`boolean`,default:!0,blurb:`Whether the entry contents can be edited`,afterNotify:e=>e._applyEditable()}},Signals:{changed:{},activate:{}}}){static GTypeName=`GtkEntry`;_field;_typing=!1;constructor(t){super(),this.className=`adw-entry`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`auto`));let n=new c;n.className=`adw-entry-input`,n.set(`backgroundColor`,`transparent`),n.set(`borderWidth`,0),this.addChild(n),this._field=n,n.addEventListener(`textChange`,()=>{let e=this._typing;this._typing=!0;try{this.text=this._field.text??``}finally{this._typing=e}}),n.addEventListener(`returnPress`,()=>this.emit(m)),e(this,t)}_applyText(){let e=this._typing,t=this.text;this._field.text!==t&&(this._field.text=t),e?(this.notify(`text`),this.emit(h)):(this.emit(h),this.notify(`text`)),this.textLength=a(t)}_applyMaxLength(){let e=this.text;this.text=e,this.notify(`max-length`)}_applyPlaceholderText(){this._field.hint=this.placeholderText}_applyEditable(){this._field.editable=this.editable}get_text(){return this.text}set_text(e){this.text=e}get_max_length(){return this.maxLength}set_max_length(e){this.maxLength=e}get field(){return this._field}};export{m as ACTIVATE,h as CHANGED,GtkEntry,p as NOTIFY_EDITABLE,d as NOTIFY_MAX_LENGTH,f as NOTIFY_PLACEHOLDER_TEXT,l as NOTIFY_TEXT,u as NOTIFY_TEXT_LENGTH};
|
|
@@ -1,2 +1,2 @@
|
|
|
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{androidApiLevel as r}from"./native-tooltip.js";import{withSignals as i}from"./signals.js";import{nativePlatformHost as a}from"../platform-host.js";import{classNameWith as o,normalizeStyleClasses as s,withCssClass as c,withoutCssClass as l}from"./style-classes.js";import{labelMarkupFormattedString as u,labelMarkupNeedsSpans as d}from"./label-markup.js";import{
|
|
2
|
-
`),
|
|
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{androidApiLevel as r}from"./native-tooltip.js";import{withSignals as i}from"./signals.js";import{nativePlatformHost as a}from"../platform-host.js";import{classNameWith as o,normalizeStyleClasses as s,withCssClass as c,withoutCssClass as l}from"./style-classes.js";import{labelMarkupFormattedString as u,labelMarkupNeedsSpans as d}from"./label-markup.js";import{labelMarkupDrawNative as f,labelMarkupHoldNative as p}from"./label-markup-native.js";import{DEFAULT_LABEL_LINES as m,DEFAULT_LABEL_XALIGN as h,HandledAccumulator as g,LABEL_JUSTIFICATIONS as _,createAppInfo as v,labelActivateLink as y,labelDisplayText as b,labelEffectiveLines as x,labelEllipsizeOverflowValue as S,labelHasLinks as C,labelLinkVisited as w,labelMarkupRender as T,normalizeLabelEllipsize as E,normalizeLabelLines as D,normalizeLabelXalign as O}from"@gjsify/adwaita-core";import{Label as k}from"@nativescript/core";const A=`activate-link`,j=v(a),M=new Map([[0,`start`],[.5,`center`],[1,`end`]]),N={left:`start`,right:`end`,center:`center`,fill:`start`};function physical(e,t){return e===`center`?`center`:e===`start`===t?`right`:`left`}function applyTemplateXalign(e,t){e.textAlignment=t===0?`initial`:`center`}var GtkLabel=class extends i(k){static GTypeName=`GtkLabel`;_label=``;_useMarkup=!1;_useUnderline=!1;_ellipsize=`none`;_lines=-1;_styleClasses=[];_xalign=h;_xalignWritten=!1;_justify=`left`;_selectable=!1;_links=[];constructor(e){super(),this.addEventListener(`loaded`,()=>{this._applySelectable(),this._applyJustificationMode()}),this._applyAlignment({}),n(this,e)}get label(){return this._label}set label(e){this._label=e??``,this._render()}get useMarkup(){return this._useMarkup}set useMarkup(t){this._useMarkup=e(t,this._useMarkup),this._render()}get useUnderline(){return this._useUnderline}set useUnderline(t){this._useUnderline=e(t,this._useUnderline),this._render()}get wrap(){return this.textWrap}set wrap(t){let n=e(t,this.textWrap);this._applyAlignment({wrap:n}),this.textWrap=n}get ellipsize(){return this._ellipsize}set ellipsize(e){this._ellipsize=E(e),this.textOverflow=S(this._ellipsize),this._applyLines()}get lines(){return this._lines}set lines(e){this._lines=D(t(e,m)),this._applyLines()}get selectable(){return this._selectable}set selectable(t){this._selectable=e(t,this._selectable),this._applySelectable()}_applySelectable(){this.nativeViewProtected?.setTextIsSelectable?.(this._selectable)}_applyLines(){this.maxLines=x(this._lines,this._ellipsize)??0}get justify(){return this._justify}set justify(e){let n=_.includes(e)?e:_[t(e,-1)];if(n===void 0)throw TypeError(`'${String(e)}' is not a Gtk.Justification, so it cannot be 'justify'. The members are ${_.join(`, `)}, or their values 0 to 3.`);this._applyAlignment({justify:n})}get xalign(){return this._xalign}set xalign(e){let n=O(t(e,h));if(!M.has(n))throw TypeError(`Gtk.Label xalign ${n} has no NativeScript counterpart: textAlignment places text at the start, the centre or the end, so only 0, 0.5 and 1 render as written. Snapping it would show a different label than GTK does with no sign of the difference.`);this._applyAlignment({xalign:n})}_applyAlignment(e){let t=e.xalign??this._xalign,n=e.xalign!==void 0||this._xalignWritten,r=e.justify??this._justify,i=e.text??this.text??``,a=(e.wrap??this.textWrap)||i.includes(`
|
|
2
|
+
`),o=N[r],s=M.get(t),c;if(s===o||!a||r===`left`)c=s;else if(!n)c=o;else throw TypeError(`Gtk.Label justify ${r} beside xalign ${t} has no NativeScript counterpart on a label that can show several lines: GTK places the text block at its ${s} and aligns the lines inside it to their ${o}, and textAlignment is one alignment for both. An xalign on the justify edge, or a label without wrap and newline, renders exactly.`);e.xalign!==void 0&&(this._xalign=e.xalign,this._xalignWritten=!0),e.justify!==void 0&&(this._justify=e.justify);let l=physical(c,this.style?.direction===`rtl`);this.textAlignment=r===`fill`&&l===`left`?`justify`:l,this._applyJustificationMode()}_applyJustificationMode(){this.textAlignment===`justify`||r()<26||this.nativeViewProtected?.setJustificationMode?.(+(this._justify===`fill`))}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(s(e))}get_label(){return this.label}set_label(e){this.label=e}set_markup(e){this._label=e??``,this._useMarkup=!0,this._render()}get_text(){return this.text??``}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(``,this._styleClasses)}_render(){let e=this._useMarkup?T(this._label,this._links):null;this._links=e?.links??[];let t=b(this._label,this._useMarkup,this._useUnderline);this._applyAlignment({text:t});let n=C(this._links);if(n!==this._styleClasses.includes(`link`)&&this._setClasses(n?c(this._styleClasses,`link`):l(this._styleClasses,`link`)),e!==null&&d(e)){if(p(this,{render:e,mnemonics:this._useUnderline,onLinkTap:e=>this._activateLink(e)})){this.formattedText!==null&&this.formattedText!==void 0&&(this.formattedText=null),this.text=t;return}this.text=t,this.formattedText=u(e,this._useUnderline,this.style.fontSize,e=>this._activateLink(e));return}p(this,null),this.formattedText!==null&&this.formattedText!==void 0&&(this.formattedText=null),this.text=t}_setNativeText(e=!1){f(this,e)||super._setNativeText(e)}_activateLink(e){let t=this._links[e];t!==void 0&&y(t.href,{rooted:this.isLoaded,emit:()=>{let e=new g;return this.notify({eventName:A,object:this,uri:t.href,accumulator:e}),e.stopped},launch:e=>this.launch(e)})&&(this._links=w(this._links,e))}launch(e){try{j.launch_default_for_uri(e,null)}catch{}}};export{A as ACTIVATE_LINK,GtkLabel,applyTemplateXalign};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{classNameWith as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withProperties as n}from"./signals.js";import{classNameWith as r,normalizeStyleClasses as i,withCssClass as a,withoutCssClass as o}from"./style-classes.js";import{AdwImageButton as s}from"./adw-image-button.js";import{MenuSlot as c}from"./menu-slot.js";import{showMenuPopup as l}from"./popup-menu-view.js";import{GioMenuModel as u}from"@gjsify/adwaita-core";const d=`menuItemActivated`;var GtkMenuButton=class extends n(s,{GTypeName:`GtkMenuButton`,Properties:{"menu-model":{kind:`object`,valueType:u.$gtype,blurb:`The model from which the popup is created`,normalize:(e,t)=>t._slot.read(e),changed:()=>!0,afterNotify:e=>{let t=e;t._slot.adopt(t.menuModel)}}}}){static GTypeName=`GtkMenuButton`;_slot=new c(`GtkMenuButton`,()=>void 0);_actions=null;_menuTitle=``;_primary=!1;_baseClassName;_styleClasses=[];constructor(e){super(),this._baseClassName=`${this.className} adw-menu-button`.trim(),this.className=this._baseClassName,this.addEventListener(`tap`,()=>this._openMenu()),t(this,e)}get_menu_model(){return this.menuModel}set_menu_model(e){this.menuModel=e}get actions(){return this._actions}set actions(e){this._actions=e??null}get menuTitle(){return this._menuTitle}set menuTitle(e){this._menuTitle=e??``}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(i(e))}get primary(){return this._primary}set primary(t){this._primary=e(t,this._primary)}add_css_class(e){this._setClasses(a(this._styleClasses,e))}remove_css_class(e){this._setClasses(o(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(i([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=r(this._baseClassName,e)}_openMenu(){this._slot.isEmpty||l(this,{tree:this._slot.tree,actions:this._actions,onActivated:(e,t)=>{let n={eventName:d,object:this,id:e.id??e.label,label:e.label,path:t,action:e.action};this.notify(n)}})}};export{GtkMenuButton,d as MENU_ITEM_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{MenuSlot as n}from"./menu-slot.js";import{showMenuPopup as r}from"./popup-menu-view.js";import{Observable as i}from"@nativescript/core";const a=`closed`,unsupported=(e,t)=>Error(`Gtk.PopoverMenu.${e} is not supported: ${t} (ADR 0097 § 2).`);var GtkPopoverMenu=class extends t(i){static GTypeName=`GtkPopoverMenu`;_slot=new n(`GtkPopoverMenu`,()=>void 0);_actions=null;_parent=null;_open=null;constructor(t){super(),e(this,t)}get menuModel(){return this._slot.model}set menuModel(e){let t=this._slot.model;this._slot.write(e),this.notifyPropertyChange(`menuModel`,this._slot.model,t)}set_menu_model(e){this.menuModel=e}get_menu_model(){return this._slot.model}get actions(){return this._actions}set actions(e){this._actions=e??null}get parent(){return this._parent}set parent(e){e!==this._parent&&(this.popdown(),this._parent=e??null)}set_parent(e){this.parent=e}unparent(){this.parent=null}popup(){if(this._parent===null)throw unsupported(`popup()`,`a PopupMenu is anchored at a view, so call set_parent(widget) first`);if(this._open!==null||this._slot.isEmpty)return;let e=r(this._parent,{tree:this._slot.tree,actions:this._actions,onDismiss:()=>{this._open!==null&&(this._open=null,this.notify({eventName:a,object:this}))}});this._open=e}popdown(){this._open?.dismiss()}get hasArrow(){return!0}set hasArrow(e){if(e!==!0)throw unsupported(`has_arrow = false`,`a PopupMenu has no arrow to hide`)}get autohide(){return!0}set autohide(e){if(e!==!0)throw unsupported(`autohide = false`,`a PopupMenu always closes on an outside tap`)}get position(){return`bottom`}set position(e){if(e!==`bottom`&&e!==3)throw unsupported(`position = ${String(e)}`,`a PopupMenu opens where Android places it`)}get flags(){return`nested`}set flags(e){if(e!==`nested`)throw unsupported(`flags = ${String(e)}`,`only nested submenus exist`)}get pointingTo(){throw unsupported(`pointing_to`,`a PopupMenu is anchored at the whole parent view`)}set pointingTo(e){throw unsupported(`pointing_to`,`a PopupMenu is anchored at the whole parent view`)}get_pointing_to(){throw unsupported(`get_pointing_to()`,`a PopupMenu is anchored at the whole parent view`)}set_pointing_to(e){throw unsupported(`set_pointing_to()`,`a PopupMenu is anchored at the whole parent view`)}add_child(e,t){throw unsupported(`add_child()`,`a PopupMenu row is a title, not a widget`)}remove_child(e){throw unsupported(`remove_child()`,`a PopupMenu row is a title, not a widget`)}};export{a as CLOSED,GtkPopoverMenu};
|