@gjsify/adwaita-nativescript 0.64.1 → 0.64.2-next.254
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/builder/param-values.js +1 -0
- package/lib/esm/canvas2d/canvas2d-bridge.js +1 -1
- package/lib/esm/capabilities.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/namespace/adw.js +1 -1
- package/lib/esm/namespace/gdk.js +1 -1
- package/lib/esm/namespace/gio.js +1 -1
- package/lib/esm/namespace/glib.js +1 -1
- package/lib/esm/namespace/gobject.js +1 -1
- package/lib/esm/namespace/gtk.js +1 -1
- package/lib/esm/widgets/adw-about-dialog.js +2 -1
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-alert-dialog.js +1 -1
- package/lib/esm/widgets/adw-application-window.js +1 -1
- package/lib/esm/widgets/adw-avatar.js +1 -1
- package/lib/esm/widgets/adw-banner.js +1 -1
- package/lib/esm/widgets/adw-bottom-sheet.js +1 -1
- package/lib/esm/widgets/adw-button-content.js +1 -1
- package/lib/esm/widgets/adw-carousel.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-data-grid.js +1 -1
- package/lib/esm/widgets/adw-dialog.js +1 -1
- package/lib/esm/widgets/adw-entry-row.js +1 -1
- package/lib/esm/widgets/adw-expander-row.js +1 -1
- package/lib/esm/widgets/adw-image-button.js +1 -1
- package/lib/esm/widgets/adw-navigation-page.js +1 -1
- package/lib/esm/widgets/adw-navigation-split-view.js +1 -1
- package/lib/esm/widgets/adw-navigation-view.js +1 -1
- package/lib/esm/widgets/adw-overlay-split-view.js +1 -1
- package/lib/esm/widgets/adw-password-entry-row.js +1 -1
- package/lib/esm/widgets/adw-preferences-dialog.js +1 -1
- package/lib/esm/widgets/adw-preferences-page.js +1 -1
- package/lib/esm/widgets/adw-sidebar.js +1 -1
- package/lib/esm/widgets/adw-slider-row.js +1 -1
- package/lib/esm/widgets/adw-spin-row.js +1 -1
- package/lib/esm/widgets/adw-spinner.js +1 -1
- package/lib/esm/widgets/adw-split-button.js +1 -1
- package/lib/esm/widgets/adw-switch-row.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toast-overlay.js +1 -1
- package/lib/esm/widgets/adw-toggle-group.js +1 -1
- package/lib/esm/widgets/adw-toolbar-view.js +1 -1
- package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
- package/lib/esm/widgets/adw-wrap-box.js +1 -1
- package/lib/esm/widgets/application.js +1 -1
- package/lib/esm/widgets/construct-props.js +1 -1
- package/lib/esm/widgets/gtk-action-bar.js +1 -1
- 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-drawing-area.js +1 -1
- package/lib/esm/widgets/gtk-drop-down.js +1 -1
- package/lib/esm/widgets/gtk-entry.js +1 -1
- package/lib/esm/widgets/gtk-grid.js +1 -1
- package/lib/esm/widgets/gtk-image.js +1 -1
- package/lib/esm/widgets/gtk-label.js +1 -1
- package/lib/esm/widgets/gtk-list-box.js +1 -1
- package/lib/esm/widgets/gtk-menu-button.js +1 -1
- package/lib/esm/widgets/gtk-revealer.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/gtk-text-view.js +1 -1
- package/lib/esm/widgets/gtk-toggle-button.js +1 -1
- package/lib/esm/widgets/gtk-window.js +1 -1
- package/lib/esm/widgets/icon-path.js +1 -1
- package/lib/esm/widgets/icon-render.js +1 -0
- package/lib/esm/widgets/icon-theme.js +1 -1
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/stack-page.js +1 -1
- package/lib/esm/widgets/view-stack-page.js +1 -1
- package/lib/esm/widgets/widget-layout.js +1 -1
- package/lib/esm/widgets/widget-mapping.js +1 -0
- package/lib/types/about-dialog-doors.spec.d.ts +1 -0
- package/lib/types/builder/index.d.ts +4 -0
- package/lib/types/builder/param-values.d.ts +21 -0
- package/lib/types/carousel-doors.spec.d.ts +1 -0
- package/lib/types/gio-resource.spec.d.ts +1 -0
- package/lib/types/gio.spec.d.ts +2 -0
- package/lib/types/icon-resources.spec.d.ts +2 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/types/namespace/adw.d.ts +1 -1
- package/lib/types/namespace/gdk.d.ts +1 -0
- package/lib/types/namespace/gio.d.ts +2 -0
- package/lib/types/namespace/glib.d.ts +2 -1
- package/lib/types/namespace/gtk.d.ts +1 -0
- package/lib/types/param-values.spec.d.ts +1 -0
- package/lib/types/testing/ns-core.d.mts +55 -14
- package/lib/types/widget-map.spec.d.ts +1 -0
- package/lib/types/widgets/adw-about-dialog.d.ts +34 -2
- package/lib/types/widgets/adw-action-row.d.ts +10 -1
- package/lib/types/widgets/adw-alert-dialog.d.ts +37 -13
- package/lib/types/widgets/adw-application-window.d.ts +0 -3
- package/lib/types/widgets/adw-avatar.d.ts +10 -1
- package/lib/types/widgets/adw-banner.d.ts +10 -1
- package/lib/types/widgets/adw-bottom-sheet.d.ts +10 -1
- package/lib/types/widgets/adw-button-content.d.ts +10 -1
- package/lib/types/widgets/adw-carousel.d.ts +24 -3
- package/lib/types/widgets/adw-clamp.d.ts +10 -1
- package/lib/types/widgets/adw-combo-row.d.ts +4 -0
- package/lib/types/widgets/adw-data-grid.d.ts +10 -1
- package/lib/types/widgets/adw-header-bar.d.ts +10 -1
- package/lib/types/widgets/adw-image-button.d.ts +13 -2
- package/lib/types/widgets/adw-navigation-page.d.ts +10 -1
- package/lib/types/widgets/adw-navigation-view.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-dialog.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-group.d.ts +10 -1
- package/lib/types/widgets/adw-preferences-page.d.ts +10 -1
- package/lib/types/widgets/adw-shortcut-label.d.ts +10 -1
- package/lib/types/widgets/adw-sidebar.d.ts +10 -1
- package/lib/types/widgets/adw-slider-row.d.ts +10 -1
- package/lib/types/widgets/adw-spinner.d.ts +10 -1
- package/lib/types/widgets/adw-split-button.d.ts +10 -1
- package/lib/types/widgets/adw-status-page.d.ts +10 -1
- package/lib/types/widgets/adw-switch-row.d.ts +2 -0
- package/lib/types/widgets/adw-tab-view.d.ts +10 -1
- package/lib/types/widgets/adw-toast-overlay.d.ts +21 -17
- package/lib/types/widgets/adw-toggle-group.d.ts +10 -1
- package/lib/types/widgets/adw-toggle.d.ts +10 -1
- package/lib/types/widgets/adw-toolbar-view.d.ts +10 -1
- package/lib/types/widgets/adw-view-stack.d.ts +10 -1
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +10 -1
- package/lib/types/widgets/adw-window-title.d.ts +10 -1
- package/lib/types/widgets/adw-wrap-box.d.ts +10 -1
- package/lib/types/widgets/application.d.ts +2 -1
- package/lib/types/widgets/carousel-indicator-base.d.ts +10 -1
- package/lib/types/widgets/construct-props.d.ts +11 -2
- package/lib/types/widgets/gtk-action-bar.d.ts +10 -1
- package/lib/types/widgets/gtk-button.d.ts +13 -2
- package/lib/types/widgets/gtk-check-button.d.ts +10 -0
- package/lib/types/widgets/gtk-drop-down.d.ts +10 -1
- package/lib/types/widgets/gtk-entry.d.ts +10 -1
- package/lib/types/widgets/gtk-image.d.ts +13 -2
- package/lib/types/widgets/gtk-label.d.ts +10 -1
- package/lib/types/widgets/gtk-popover-menu.d.ts +10 -1
- package/lib/types/widgets/gtk-stack.d.ts +10 -1
- package/lib/types/widgets/gtk-text-view.d.ts +10 -1
- package/lib/types/widgets/gtk-window.d.ts +5 -0
- package/lib/types/widgets/icon-path.d.ts +9 -0
- package/lib/types/widgets/icon-render.d.ts +9 -0
- package/lib/types/widgets/icon-theme.d.ts +43 -40
- package/lib/types/widgets/index.d.ts +4 -4
- package/lib/types/widgets/signals.d.ts +16 -1
- package/lib/types/widgets/split-view-base.d.ts +10 -1
- package/lib/types/widgets/stack-page.d.ts +10 -1
- package/lib/types/widgets/styled-layout-base.d.ts +10 -1
- package/lib/types/widgets/view-stack-page.d.ts +10 -1
- package/lib/types/widgets/view-switcher-base.d.ts +10 -1
- package/lib/types/widgets/widget-layout.d.ts +14 -0
- package/lib/types/widgets/widget-mapping.d.ts +9 -0
- package/package.json +14 -13
- package/src/testing/ns-core.mts +147 -18
- package/src/theme/adwaita.css +13 -2
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{registerTemplateClass as o,templateClassFor as s}from"./template-classes.js";import{gtkPropertyRefusal as c,hasGtkProperty as l,readGtkProperty as u,writeGtkProperty as d}from"../widgets/shadowed-properties.js";import{adw_exports as f}from"../namespace/adw.js";import{gtk_exports as p}from"../namespace/gtk.js";import{createBreakpointDriver as m,menuAssignments as h,parseBreakpointCondition as g}from"@gjsify/adwaita-core";import{assertTreeConstructs as _}from"@gjsify/adwaita-core/conformance";import{propertyOf as v}from"@gjsify/adwaita-core/tags";import{View as y}from"@nativescript/core";const b=[{prefix:`adw`,library:`Adw`,namespace:f},{prefix:`gtk`,library:`Gtk`,namespace:p}];function registerBarrel(e,t,n){let r=b.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?b.push({prefix:e,library:t,namespace:n}):r.namespace=n}const x={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=x[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...b].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 (${b.map(e=>e.prefix).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:s(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 y))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 y||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 y))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={}){refuseSiblings(t,`buildInto`);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,!1,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){_(`adwaita-nativescript`,e,n);let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate,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.`);d(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:o,flags:s}=e,f=`<${r.xmlName}> \`${i}: bind ${a}.${o}\``,p=t.template,m=a===`template`&&p!==void 0?p.instance:t.ids.get(a);if(m===void 0)throw Error(`${f} names no object: nothing in this tree has the id '${a}'.`);if(s.length>0&&p===void 0)throw Error(`${f} carries ${s.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let h=v(o),g=v(i),_=m.constructor.emittedSignals??[],y=`notify::${o}`;if(!l(m,h)||!_.includes(y))throw Error(`${f}: ${m.constructor.name} does not emit '${y}', so the target would follow the source once and never again. It emits: ${_.join(`, `)||`none`}.`);if(!l(n,g)){let e=c(n,g);throw Error(`${f}: the target has no property '${g}'.${e===null?``:` ${e}`}`)}if(p!==void 0){bindThroughEngine(p,{...e,from:m,where:f,notification:y});return}let follow=()=>d(n,g,u(m,h));follow(),m.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`?v(e):e;return new Proxy(e,{get(e,t){let n=typeof t==`string`&&l(e,key(t))?u(e,key(t)):Reflect.get(e,key(t));return typeof n==`function`?n.bind(e):n},set(e,t,n){return typeof t==`string`?(d(e,v(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=n.constructor.emittedSignals??[];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 y))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)}function wireBreakpoints(e,t,n,r,i,a){let o=m(n.map(t=>{if(g(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(!l(n,v(t.property))){let e=c(n,v(t.property));throw Error(`${i}: the target declares no '${v(t.property)}'.`+(e===null?``:` ${e}`))}return{object:n,property:t.property,value:{authored:translated(a,t.value,t.translatable)}}})}}),{read:(e,t)=>({original:u(e,v(t))}),write(e,t,n){let r=n;d(e,v(t),`authored`in r?String(r.authored):r.original)}});i(t,e=>o.evaluate(e))}function buildNode(e,t,n){let r=elementOf(e),i=n??new r.ctor,a=i instanceof y?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=t.ctor.emittedSignals??[],a=e;for(let e of n.signals){let n=e.detail===void 0?e.name:`${e.name}::${e.detail}`;if(typeof a.connect!=`function`||!i.includes(n))throw Error(`<${t.xmlName}> declares no signal '${n}', so the handler '${e.handler}' would never run. It emits: ${i.join(`, `)||`none`}.`);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 S={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 y))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=S[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(S).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 o=c(a,r);return Error(o===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}\`: ${o}`)}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 h(e,r.menus)){let r=v(i);if(!l(n,r))throw unknownProperty(t,e.tag,i,r,i,n);d(n,r,a)}for(let[i,o]of Object.entries(e.props??{})){if(i===`menu-model`)continue;let s=v(i);if(!l(n,s))throw unknownProperty(t,e.tag,i,s,o,n);if(a.includes(s)){r.pending.push({view:n,element:t,prop:s,id:String(o)});continue}d(n,s,String(translated(r.translate,o,e.translatable?.[i])))}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(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}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.`);let i={};for(let[a,o]of h(e,r.menus)){let r=v(a);if(!l(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 s=v(a);if(!l(n,s))throw unknownProperty(t,e.tag,a,s,o,n);i[s]=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,o 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{createBreakpointDriver as g,menuAssignments as _,parseBreakpointCondition as v}from"@gjsify/adwaita-core";import{assertTreeConstructs as y}from"@gjsify/adwaita-core/conformance";import{propertyOf as b}from"@gjsify/adwaita-core/tags";import{View as x}from"@nativescript/core";const S=[{prefix:`adw`,library:`Adw`,namespace:m},{prefix:`gtk`,library:`Gtk`,namespace:h}];function registerBarrel(e,t,n){let r=S.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?S.push({prefix:e,library:t,namespace:n}):r.namespace=n}const C={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=C[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...S].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 (${S.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 x))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 x||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 x))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={}){refuseSiblings(t,`buildInto`);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,!1,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){y(`adwaita-nativescript`,e,n,Object.keys(T));let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate,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=b(d),_=b(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`?b(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,b(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 x))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)}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,b(t.property))){let e=o(n,b(t.property));throw Error(`${i}: the target declares no '${b(t.property)}'.`+(e===null?``:` ${e}`))}let c=translated(a,t.value,t.translatable),l=d(n,b(t.property),c,i);return{object:n,property:t.property,value:{authored:l===null?String(c):l.value}}})}}),{read:(e,t)=>({original:c(e,b(t))}),write(e,t,n){let r=n;l(e,b(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 x?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 w={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 x))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=w[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(w).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=b(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=b(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 T={label:`accessibilityLabel`,description:`accessibilityHint`};function applyAccessibility(e,t,n){for(let[r,i]of Object.entries(t.accessibility??{}))e[T[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=b(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=b(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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{registeredClassOf as e}from"@gjsify/adwaita-core";import{propertyOf as t}from"@gjsify/adwaita-core/tags";function registeredParamSpec(n,r){for(let i=n.constructor;typeof i==`function`;i=Object.getPrototypeOf(i)){let n=e(i)?.properties.find(e=>t(e.name)===r);if(n!==void 0)return n}}const n=/^\s*([+-]?)(?:0[xX]([0-9a-fA-F]+)|(0[0-7]*)|([1-9][0-9]*))/,r=/^\s*([+-]?)(?:(\d+\.?\d*(?:[eE][+-]?\d+)?|\.\d+(?:[eE][+-]?\d+)?)|(inf(?:inity)?)|(nan))/i;function parseBoolean(e){if(e.length===1)return`1yYtT`.includes(e)?!0:`0nNfF`.includes(e)?!1:void 0;let t=e.toLowerCase();if(t===`true`||t===`yes`)return!0;if(t===`false`||t===`no`)return!1}function parseInteger(e){let t=n.exec(e);if(t===null)return;let[,r,i,a,o]=t,s=i===void 0?a===void 0?parseInt(o,10):parseInt(a,8):parseInt(i,16);return r===`-`?-s:s}function parseDouble(e){let t=r.exec(e);if(t===null)return;let[,n,i,a]=t,o=i===void 0?a===void 0?NaN:1/0:Number(i);return n===`-`?-o:o}function valueFromString(e,t){switch(e.kind){case`string`:return t;case`boolean`:return parseBoolean(t);case`int`:return parseInteger(t);case`uint`:{let e=parseInteger(t);return e===void 0||e<0||Object.is(e,-0)?void 0:e}case`double`:return parseDouble(t)}}const i={boolean:`boolean`,string:`string`,int:`integer`,uint:`unsigned integer`,double:`double`};function authoredParamValue(e,t,n,r){let a=registeredParamSpec(e,t);if(a===void 0)return null;let o=String(n),s=valueFromString(a,o);if(s===void 0)throw Error(`${r}: Could not parse ${i[a.kind]} '${o}' for the property '${a.name}', which ${e.constructor.name} registers as a ${a.kind} ParamSpec.`);return{value:s}}export{authoredParamValue,registeredParamSpec,valueFromString};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"../widgets/xml-values.js";import{withGtkWidgetLayout as t}from"../widgets/widget-layout.js";import{registerTemplateClass as n}from"../builder/template-classes.js";import{NsCanvas as r}from"./canvas-subset.js";import{createNativeCanvasDriver as i}from"./native-canvas.js";import{View as a}from"@nativescript/core";var Canvas2DBridge=class extends t(a){static GTypeName=`GjsifyCanvas2DBridge`;driver=i();_canvas=null;_ctx=null;_readyCallbacks=[];_resizeCallbacks=[];_handlers=new Map;_nextHandler=0;_width=-1;_height=-1;_contentWidth=0;_contentHeight=0;createNativeView(){return this.driver.createNativeView(this._context)}initNativeView(){super.initNativeView(),this.driver.attach(this.nativeViewProtected,(e,t)=>this.allocated(e,t))}disposeNativeView(){this.driver.detach(),this._canvas=null,this._ctx=null,this._width=-1,this._height=-1,super.disposeNativeView()}get contentWidth(){return this._contentWidth}set contentWidth(t){this._contentWidth=Math.max(0,Math.trunc(e(t,this._contentWidth))),this.minWidth=this._contentWidth}get contentHeight(){return this._contentHeight}set contentHeight(t){this._contentHeight=Math.max(0,Math.trunc(e(t,this._contentHeight))),this.minHeight=this._contentHeight}get content_width(){return this.contentWidth}set content_width(e){this.contentWidth=e}get content_height(){return this.contentHeight}set content_height(e){this.contentHeight=e}get canvas(){return this._canvas}getContext(e){return this._ctx}onReady(e){if(this._canvas&&this._ctx){e(this._canvas,this._ctx);return}this._readyCallbacks.push(e)}onResize(e){this._resizeCallbacks.push(e)}requestAnimationFrame(e){return globalThis.requestAnimationFrame(e)}installGlobals(){}queue_draw(){this.driver.invalidate()}connect(e,t){if(e!==`resize`)throw Error(`Canvas2DBridge declares no signal '${e}'. It emits: resize.`);let n=++this._nextHandler;return this._handlers.set(n,t),n}disconnect(e){if(!this._handlers.delete(e))throw TypeError(`Canvas2DBridge has no handler with id ${e}.`)}allocated(e,t){if(!this._canvas){this._width=e,this._height=t,this._canvas=new r(e,t,this.driver),this._ctx=this._canvas.getContext(`2d`);let n=this._readyCallbacks;if(this._readyCallbacks=[],this._ctx)for(let e of n)e(this._canvas,this._ctx);return}if(!(this._width===e&&this._height===t)){this._width=e,this._height=t,this._canvas.width=e,this._canvas.height=t,this._canvas.dispatchEvent({type:`resize`});for(let n of Array.from(this._handlers.values()))n(this,e,t);for(let n of this._resizeCallbacks)n(e,t)}}};n(Canvas2DBridge.GTypeName,Canvas2DBridge);export{Canvas2DBridge};
|
package/lib/esm/capabilities.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={layout:`implemented`,strings:`implemented`,responses:`implemented`,page:{refused:`adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch`},extern:`implemented`,signal:`implemented`,bind:`implemented`,breakpoint:`implemented`,"sibling-object":`implemented`};export{e as capabilities};
|
|
1
|
+
const e={layout:`implemented`,accessibility:`implemented`,strings:`implemented`,responses:`implemented`,page:{refused:`adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch`},extern:`implemented`,signal:`implemented`,bind:`implemented`,breakpoint:`implemented`,"sibling-object":`implemented`};export{e as capabilities};
|
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{GTK_ALIGN as r}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as i,GTK_ICON_SIZE_NICKS as a,GTK_ICON_SIZE_PIXELS as o,PIXEL_SIZE_UNSET as s,isGtkIconSizeNick as c}from"./widgets/gtk-icon-size.js";import{applyConstructProps as l,nsAlignment as u}from"./widgets/construct-props.js";import{activateWidgetAction as d,findActionGroup as f,insertActionGroup as p}from"./widgets/actions.js";import{NOTIFY_HEXPAND as m,NOTIFY_VEXPAND as h,withGtkWidgetLayout as g}from"./widgets/widget-layout.js";import{CLOSED as _}from"./widgets/adw-about-dialog.js";import{adwaitaColorScheme as v,isThemeIconColor as y,onAdwaitaColorSchemeChanged as b,setAdwaitaColorScheme as x,themeIconColor as S,toggleAdwaitaColorScheme as C}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as w,DEFAULT_ICON_COLOR as T,DEFAULT_ICON_COLOR_DARK as E,extractIconPaths as D,extractPathData as O}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as k,compiledIconNames as A,iconValueKind as j,isIconAvailable as M,registerIcon as N,registerIcons as P,registeredIconNames as F,resolveIconSource as I,unregisterIcon as L}from"./widgets/icon-theme.js";import{renderSymbolicIcon as R}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as z}from"./widgets/gtk-image.js";import{ACTIVATED as B}from"./widgets/adw-action-row.js";import{AdwAlertResponses as V,NOTIFY_RESPONSE as H}from"./widgets/adw-alert-dialog.js";import{avatarInitials as U}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as W}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as G}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as K,DEFAULT_SPINNER_SIZE as q}from"./widgets/chrome.js";import{BUTTON_CLICKED as J}from"./widgets/adw-banner.js";import{NOTIFY_OPEN as Y}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as X}from"./widgets/row-press.js";import{bottomSheetPanel as Z}from"./widgets/adw-bottom-sheet.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as re}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as ie}from"./widgets/adw-carousel.js";import{ComboState as ae,NOTIFY_SELECTED as oe}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as se,ADW_DIALOG_CLOSE_ATTEMPT as ce}from"./widgets/adw-dialog.js";import{AdwImageButton as le,DEFAULT_ICON_BUTTON_ICON_SIZE as ue}from"./widgets/adw-image-button.js";import{NOTIFY_TEXT as de}from"./widgets/adw-entry-row.js";import{ExpanderState as fe,NOTIFY_EXPANDED as pe}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as me}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as he,NOTIFY_SELECTED as ge}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as _e,NsOverlaySplitViewState as ve,splitViewColumns as ye}from"./widgets/split-view-state.js";import{AdwSplitViewBase as be,NOTIFY_SHOW_SIDEBAR as xe}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as Se}from"./widgets/navigation-stack.js";import{CLOSED as Ce}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as we,SHORTCUT_LABEL_CLASS as Te,SHORTCUT_LABEL_DIMMED_CLASS as Ee,SHORTCUT_LABEL_DISABLED_CLASS as De,SHORTCUT_LABEL_KEYCAP_CLASS as Oe,SHORTCUT_LABEL_KEYS_CLASS as ke,SHORTCUT_LABEL_SIDE_CLASS as Ae,SHORTCUT_LABEL_SPACED_CLASS as je,shortcutLabelDirection as Me,shortcutLabelPlatform as Ne,shortcutLabelRenderPlan as Pe}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Fe}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Q,SpinState as Ie}from"./widgets/adw-spin-row.js";import{CLICKED as Le,MENU_TAPPED as Re}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as ze}from"./widgets/adw-switch-row.js";import{AdwToast as Be,AdwToastQueue as Ve,DEFAULT_TOAST_TIMEOUT as He,TOAST_BUTTON_CLICKED as Ue}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as We,ToggleGroupState as Ge}from"./widgets/adw-toggle-group.js";import{adw_exports as Ke}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as qe,boxChildTrack as Je,boxSpacingChanges as Ye,boxTrackPlan as Xe,normalizeBoxSpacing as Ze}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as Qe,buttonSlotDetaches as $e}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as et,GTK_BUTTON_LABEL_CLASS as tt}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as nt}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as rt,GTK_CHECK_BUTTON_CHECKED_CLASS as it,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as at,GTK_CHECK_BUTTON_TOGGLED as ot,NOTIFY_CHECK_ACTIVE as st}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as ct}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as lt,NOTIFY_TEXT as ut}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as dt,LIST_BOX_ROW_SELECTED as ft}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as pt}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as mt}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as ht,NOTIFY_STACK_VISIBLE_CHILD_NAME as gt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as _t,NOTIFY_TEXT_VIEW_TEXT as vt}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as yt,GTK_TOGGLE_BUTTON_TOGGLED as bt,NOTIFY_TOGGLE_ACTIVE as xt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as St}from"./namespace/gtk.js";import{ENGINE_TARGET as Ct}from"./engine-target.js";import{ADWAITA_SANS_FONT_FAMILY as wt,ADWAITA_SANS_TTF_FILES as Tt,adwaitaFontInstallInstructions as Et,hasAdwaitaSans as Dt}from"./fonts.js";import{AdwSliderRow as Ot,NOTIFY_SLIDER_VALUE as kt}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as At,DATA_GRID_HEADER_ROW_CLASS as jt,DATA_GRID_SECTION_CELL_CLASS as Mt,dataGridCellClass as Nt,dataGridItemSpec as Pt,dataGridRowClass as Ft,dataGridShapeKey as It,dataGridTracksKey as Lt,parseDataGridWidth as Rt}from"./widgets/data-grid-model.js";import{AdwDataGrid as zt,ROW_ACTIVATED as Bt}from"./widgets/adw-data-grid.js";import{ADWAITA_NS_ACCENT_RULES as Vt,adwaitaNsAccentColor as Ht,adwaitaNsAccentCss as Ut}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Wt,clearAdwaitaNsAccent as Gt}from"./widgets/adw-accent.js";import{padForSystemInsets as Kt,padSheetForSystemInsets as qt}from"./widgets/system-insets.js";import{labelDisplayText as Jt,labelMarkupIsUnparseable as Yt,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as Xt}from"./namespace/gio.js";import{gdk_exports as Zt}from"./namespace/gdk.js";import{glib_exports as Qt}from"./namespace/glib.js";import{assertNativeScript as $t,assertNativeScript as en,isAndroid as tn,isIOS as nn,isNativeScript as rn}from"@gjsify/native-platform";function registerAdwaita(){en(),$()}export{_ as ABOUT_CLOSED,B as ACTIVATED,w as ADWAITA_ICON_GRID,Vt as ADWAITA_NS_ACCENT_RULES,wt as ADWAITA_SANS_FONT_FAMILY,Tt as ADWAITA_SANS_TTF_FILES,se as ADW_DIALOG_CLOSED,ce as ADW_DIALOG_CLOSE_ATTEMPT,W as AVATAR_DEFAULT_ICON,Ke as Adw,V as AdwAlertResponses,ee as AdwBreakpoint,zt as AdwDataGrid,le as AdwImageButton,Ot as AdwSliderRow,be as AdwSplitViewBase,Be as AdwToast,Ve as AdwToastQueue,he as AdwViewSwitcherBase,J as BUTTON_CLICKED,Le as CLICKED,ae as ComboState,At as DATA_GRID_HEADER_CELL_CLASS,jt as DATA_GRID_HEADER_ROW_CLASS,Mt as DATA_GRID_SECTION_CELL_CLASS,G as DEFAULT_AVATAR_SIZE,qe as DEFAULT_BOX_SPACING,re as DEFAULT_CAROUSEL_PAGE_WIDTH,K as DEFAULT_CLAMP_MAX_SIZE,z as DEFAULT_GTK_IMAGE_SIZE,ue as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,i as DEFAULT_ICON_PIXEL_SIZE,q as DEFAULT_SPINNER_SIZE,He as DEFAULT_TOAST_TIMEOUT,ct as DRAWING_AREA_REFUSAL,Ct as ENGINE_TARGET,lt as ENTRY_ACTIVATE,fe as ExpanderState,Qt as GLib,r as GTK_ALIGN,et as GTK_BUTTON_CLICKED,tt as GTK_BUTTON_LABEL_CLASS,rt as GTK_CHECK_BUTTON_ACTIVATE,it as GTK_CHECK_BUTTON_CHECKED_CLASS,at as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,ot as GTK_CHECK_BUTTON_TOGGLED,a as GTK_ICON_SIZE_NICKS,o as GTK_ICON_SIZE_PIXELS,yt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,bt as GTK_TOGGLE_BUTTON_TOGGLED,_t as GTK_WRAP_MODES,Zt as Gdk,Xt as Gio,St as Gtk,k as ICON_FALLBACK_NAME,dt as LIST_BOX_ROW_ACTIVATED,ft as LIST_BOX_ROW_SELECTED,pt as MENU_ITEM_ACTIVATED,Re as MENU_TAPPED,ze as NOTIFY_ACTIVE,st as NOTIFY_CHECK_ACTIVE,nt as NOTIFY_DROP_DOWN_SELECTED,ut as NOTIFY_ENTRY_TEXT,pe as NOTIFY_EXPANDED,m as NOTIFY_HEXPAND,Y as NOTIFY_OPEN,ie as NOTIFY_POSITION,H as NOTIFY_RESPONSE,mt as NOTIFY_REVEAL_CHILD,oe as NOTIFY_SELECTED,xe as NOTIFY_SHOW_SIDEBAR,Fe as NOTIFY_SIDEBAR_SELECTED,kt as NOTIFY_SLIDER_VALUE,ht as NOTIFY_STACK_VISIBLE_CHILD,gt as NOTIFY_STACK_VISIBLE_CHILD_NAME,de as NOTIFY_TEXT,vt as NOTIFY_TEXT_VIEW_TEXT,xt as NOTIFY_TOGGLE_ACTIVE,We as NOTIFY_TOGGLE_SELECTED,Q as NOTIFY_VALUE,h as NOTIFY_VEXPAND,ge as NOTIFY_VIEW_SELECTED,me as NOTIFY_VISIBLE_CHILD,Se as NOTIFY_VISIBLE_PAGE,_e as NsNavigationSplitViewState,ve as NsOverlaySplitViewState,s as PIXEL_SIZE_UNSET,Ce as PREFERENCES_CLOSED,Bt as ROW_ACTIVATED,we as SHORTCUT_LABEL_CAP_TEXT_CLASS,Te as SHORTCUT_LABEL_CLASS,Ee as SHORTCUT_LABEL_DIMMED_CLASS,De as SHORTCUT_LABEL_DISABLED_CLASS,Oe as SHORTCUT_LABEL_KEYCAP_CLASS,ke as SHORTCUT_LABEL_KEYS_CLASS,Ae as SHORTCUT_LABEL_SIDE_CLASS,je as SHORTCUT_LABEL_SPACED_CLASS,Ie as SpinState,Ue as TOAST_BUTTON_CLICKED,Ge as ToggleGroupState,d as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,Et as adwaitaFontInstallInstructions,Ht as adwaitaNsAccentColor,Ut as adwaitaNsAccentCss,Wt as applyAdwaitaNsAccent,l as applyConstructProps,$t as assertNativeScript,X as attachRowPressFeedback,U as avatarInitials,Z as bottomSheetPanel,Je as boxChildTrack,Ye as boxSpacingChanges,Xe as boxTrackPlan,Qe as buttonSlotAfterWrite,$e as buttonSlotDetaches,Gt as clearAdwaitaNsAccent,A as compiledIconNames,Nt as dataGridCellClass,Pt as dataGridItemSpec,Ft as dataGridRowClass,It as dataGridShapeKey,Lt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,f as findActionGroup,Dt as hasAdwaitaSans,j as iconValueKind,p as insertActionGroup,tn as isAndroid,c as isGtkIconSizeNick,nn as isIOS,M as isIconAvailable,rn as isNativeScript,y as isThemeIconColor,Jt as labelDisplayText,Yt as labelMarkupIsUnparseable,Ze as normalizeBoxSpacing,u as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,Kt as padForSystemInsets,qt as padSheetForSystemInsets,n as parseBreakpointCondition,Rt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,N as registerIcon,P as registerIcons,F as registeredIconNames,R as renderSymbolicIcon,I as resolveIconSource,x as setAdwaitaColorScheme,Me as shortcutLabelDirection,Ne as shortcutLabelPlatform,Pe as shortcutLabelRenderPlan,ye as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,L as unregisterIcon,g 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{GTK_ALIGN as r}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as i,GTK_ICON_SIZE_NICKS as a,GTK_ICON_SIZE_PIXELS as o,PIXEL_SIZE_UNSET as s,isGtkIconSizeNick as c}from"./widgets/gtk-icon-size.js";import{applyConstructProps as l,nsAlignment as u}from"./widgets/construct-props.js";import{activateWidgetAction as d,findActionGroup as f,insertActionGroup as p}from"./widgets/actions.js";import{NOTIFY_HEXPAND as m,NOTIFY_VEXPAND as h,withGtkWidgetLayout as g}from"./widgets/widget-layout.js";import{CLOSED as _}from"./widgets/adw-about-dialog.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{ACTIVATED as I}from"./widgets/adw-action-row.js";import{AdwAlertResponses as L}from"./widgets/adw-alert-dialog.js";import{avatarInitials as R}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as z}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as B}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as V,DEFAULT_SPINNER_SIZE as H}from"./widgets/chrome.js";import{BUTTON_CLICKED as U}from"./widgets/adw-banner.js";import{NOTIFY_OPEN as W}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as G}from"./widgets/row-press.js";import{bottomSheetPanel as K}from"./widgets/adw-bottom-sheet.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as q}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as J}from"./widgets/adw-carousel.js";import{ComboState as Y,NOTIFY_SELECTED as X}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as Z,ADW_DIALOG_CLOSE_ATTEMPT as re}from"./widgets/adw-dialog.js";import{AdwImageButton as ie,DEFAULT_ICON_BUTTON_ICON_SIZE as ae}from"./widgets/adw-image-button.js";import{NOTIFY_TEXT as oe}from"./widgets/adw-entry-row.js";import{ExpanderState as se,NOTIFY_EXPANDED as ce}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as le}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as ue,NOTIFY_SELECTED as de}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as fe,NsOverlaySplitViewState as pe,splitViewColumns as me}from"./widgets/split-view-state.js";import{AdwSplitViewBase as he,NOTIFY_SHOW_SIDEBAR as ge}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as _e}from"./widgets/navigation-stack.js";import{CLOSED as ve}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ye,SHORTCUT_LABEL_CLASS as be,SHORTCUT_LABEL_DIMMED_CLASS as xe,SHORTCUT_LABEL_DISABLED_CLASS as Se,SHORTCUT_LABEL_KEYCAP_CLASS as Ce,SHORTCUT_LABEL_KEYS_CLASS as we,SHORTCUT_LABEL_SIDE_CLASS as Te,SHORTCUT_LABEL_SPACED_CLASS as Ee,shortcutLabelDirection as De,shortcutLabelPlatform as Oe,shortcutLabelRenderPlan as ke}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Ae}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as je,SpinState as Me}from"./widgets/adw-spin-row.js";import{CLICKED as Ne,MENU_TAPPED as Pe}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Fe}from"./widgets/adw-switch-row.js";import{AdwToast as Q,AdwToastQueue as Ie,DEFAULT_TOAST_TIMEOUT as Le}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as Re,ToggleGroupState as ze}from"./widgets/adw-toggle-group.js";import{adw_exports as Be}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as Ve,boxChildTrack as He,boxSpacingChanges as Ue,boxTrackPlan as We,normalizeBoxSpacing as Ge}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as Ke,buttonSlotDetaches as qe}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as Je,GTK_BUTTON_LABEL_CLASS as Ye}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as Xe}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as Ze,GTK_CHECK_BUTTON_CHECKED_CLASS as Qe,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as $e,GTK_CHECK_BUTTON_TOGGLED as et,NOTIFY_CHECK_ACTIVE as tt}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as nt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as rt,NOTIFY_TEXT as it}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as at,LIST_BOX_ROW_SELECTED as ot}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as st}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as ct}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as lt,NOTIFY_STACK_VISIBLE_CHILD_NAME as ut}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as dt,NOTIFY_TEXT_VIEW_TEXT as ft}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as pt,GTK_TOGGLE_BUTTON_TOGGLED as mt,NOTIFY_TOGGLE_ACTIVE as ht}from"./widgets/gtk-toggle-button.js";import{gtk_exports as gt}from"./namespace/gtk.js";import{ENGINE_TARGET as _t}from"./engine-target.js";import{ADWAITA_SANS_FONT_FAMILY as vt,ADWAITA_SANS_TTF_FILES as yt,adwaitaFontInstallInstructions as bt,hasAdwaitaSans as xt}from"./fonts.js";import{AdwSliderRow as St,NOTIFY_SLIDER_VALUE as Ct}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as wt,DATA_GRID_HEADER_ROW_CLASS as Tt,DATA_GRID_SECTION_CELL_CLASS as Et,dataGridCellClass as Dt,dataGridItemSpec as Ot,dataGridRowClass as kt,dataGridShapeKey as At,dataGridTracksKey as jt,parseDataGridWidth as Mt}from"./widgets/data-grid-model.js";import{AdwDataGrid as Nt,ROW_ACTIVATED as Pt}from"./widgets/adw-data-grid.js";import{ADWAITA_NS_ACCENT_RULES as Ft,adwaitaNsAccentColor as It,adwaitaNsAccentCss as Lt}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Rt,clearAdwaitaNsAccent as zt}from"./widgets/adw-accent.js";import{padForSystemInsets as Bt,padSheetForSystemInsets as Vt}from"./widgets/system-insets.js";import{labelDisplayText as Ht,labelMarkupIsUnparseable as Ut,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as Wt}from"./namespace/gio.js";import{gdk_exports as Gt}from"./namespace/gdk.js";import{glib_exports as Kt}from"./namespace/glib.js";import{assertNativeScript as qt,assertNativeScript as Jt,isAndroid as Yt,isIOS as Xt,isNativeScript as Zt}from"@gjsify/native-platform";function registerAdwaita(){Jt(),$()}export{_ as ABOUT_CLOSED,I as ACTIVATED,w as ADWAITA_ICON_GRID,Ft as ADWAITA_NS_ACCENT_RULES,vt as ADWAITA_SANS_FONT_FAMILY,yt as ADWAITA_SANS_TTF_FILES,Z as ADW_DIALOG_CLOSED,re as ADW_DIALOG_CLOSE_ATTEMPT,z as AVATAR_DEFAULT_ICON,Be as Adw,L as AdwAlertResponses,ee as AdwBreakpoint,Nt as AdwDataGrid,ie as AdwImageButton,St as AdwSliderRow,he as AdwSplitViewBase,Q as AdwToast,Ie as AdwToastQueue,ue as AdwViewSwitcherBase,U as BUTTON_CLICKED,Ne as CLICKED,Y as ComboState,wt as DATA_GRID_HEADER_CELL_CLASS,Tt as DATA_GRID_HEADER_ROW_CLASS,Et as DATA_GRID_SECTION_CELL_CLASS,B as DEFAULT_AVATAR_SIZE,Ve as DEFAULT_BOX_SPACING,q as DEFAULT_CAROUSEL_PAGE_WIDTH,V as DEFAULT_CLAMP_MAX_SIZE,F as DEFAULT_GTK_IMAGE_SIZE,ae as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,i as DEFAULT_ICON_PIXEL_SIZE,H as DEFAULT_SPINNER_SIZE,Le as DEFAULT_TOAST_TIMEOUT,nt as DRAWING_AREA_REFUSAL,_t as ENGINE_TARGET,rt as ENTRY_ACTIVATE,se as ExpanderState,Kt as GLib,r as GTK_ALIGN,Je as GTK_BUTTON_CLICKED,Ye as GTK_BUTTON_LABEL_CLASS,Ze as GTK_CHECK_BUTTON_ACTIVATE,Qe as GTK_CHECK_BUTTON_CHECKED_CLASS,$e as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,et as GTK_CHECK_BUTTON_TOGGLED,a as GTK_ICON_SIZE_NICKS,o as GTK_ICON_SIZE_PIXELS,pt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,mt as GTK_TOGGLE_BUTTON_TOGGLED,dt as GTK_WRAP_MODES,Gt as Gdk,Wt as Gio,gt as Gtk,k as ICON_FALLBACK_NAME,at as LIST_BOX_ROW_ACTIVATED,ot as LIST_BOX_ROW_SELECTED,st as MENU_ITEM_ACTIVATED,Pe as MENU_TAPPED,Fe as NOTIFY_ACTIVE,tt as NOTIFY_CHECK_ACTIVE,Xe as NOTIFY_DROP_DOWN_SELECTED,it as NOTIFY_ENTRY_TEXT,ce as NOTIFY_EXPANDED,m as NOTIFY_HEXPAND,W as NOTIFY_OPEN,J as NOTIFY_POSITION,ct as NOTIFY_REVEAL_CHILD,X as NOTIFY_SELECTED,ge as NOTIFY_SHOW_SIDEBAR,Ae as NOTIFY_SIDEBAR_SELECTED,Ct as NOTIFY_SLIDER_VALUE,lt as NOTIFY_STACK_VISIBLE_CHILD,ut as NOTIFY_STACK_VISIBLE_CHILD_NAME,oe as NOTIFY_TEXT,ft as NOTIFY_TEXT_VIEW_TEXT,ht as NOTIFY_TOGGLE_ACTIVE,Re as NOTIFY_TOGGLE_SELECTED,je as NOTIFY_VALUE,h as NOTIFY_VEXPAND,de as NOTIFY_VIEW_SELECTED,le as NOTIFY_VISIBLE_CHILD,_e as NOTIFY_VISIBLE_PAGE,fe as NsNavigationSplitViewState,pe as NsOverlaySplitViewState,s as PIXEL_SIZE_UNSET,ve as PREFERENCES_CLOSED,Pt as ROW_ACTIVATED,ye as SHORTCUT_LABEL_CAP_TEXT_CLASS,be as SHORTCUT_LABEL_CLASS,xe as SHORTCUT_LABEL_DIMMED_CLASS,Se as SHORTCUT_LABEL_DISABLED_CLASS,Ce as SHORTCUT_LABEL_KEYCAP_CLASS,we as SHORTCUT_LABEL_KEYS_CLASS,Te as SHORTCUT_LABEL_SIDE_CLASS,Ee as SHORTCUT_LABEL_SPACED_CLASS,Me as SpinState,ze as ToggleGroupState,d as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,bt as adwaitaFontInstallInstructions,It as adwaitaNsAccentColor,Lt as adwaitaNsAccentCss,Rt as applyAdwaitaNsAccent,l as applyConstructProps,qt as assertNativeScript,G as attachRowPressFeedback,R as avatarInitials,K as bottomSheetPanel,He as boxChildTrack,Ue as boxSpacingChanges,We as boxTrackPlan,Ke as buttonSlotAfterWrite,qe as buttonSlotDetaches,zt as clearAdwaitaNsAccent,A as compiledIconNames,Dt as dataGridCellClass,Ot as dataGridItemSpec,kt as dataGridRowClass,At as dataGridShapeKey,jt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,f as findActionGroup,xt as hasAdwaitaSans,j as iconValueKind,p as insertActionGroup,Yt as isAndroid,c as isGtkIconSizeNick,Xt as isIOS,M as isIconAvailable,Zt as isNativeScript,y as isThemeIconColor,Ht as labelDisplayText,Ut as labelMarkupIsUnparseable,Ge as normalizeBoxSpacing,u as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,Bt as padForSystemInsets,Vt as padSheetForSystemInsets,n as parseBreakpointCondition,Mt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,P as renderSymbolicIcon,N as resolveIconSource,x as setAdwaitaColorScheme,De as shortcutLabelDirection,Oe as shortcutLabelPlatform,ke as shortcutLabelRenderPlan,me as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,g as withGtkWidgetLayout};
|
package/lib/esm/namespace/adw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as
|
|
1
|
+
import{__exportAll as ee}from"../_virtual/_rolldown/runtime.js";import{AdwAboutDialog as e}from"../widgets/adw-about-dialog.js";import{AdwActionRow as t}from"../widgets/adw-action-row.js";import{AdwAlertDialog as n}from"../widgets/adw-alert-dialog.js";import{AdwApplication as r}from"../widgets/application.js";import{AdwApplicationWindow as i}from"../widgets/adw-application-window.js";import{AdwAvatar as a}from"../widgets/adw-avatar.js";import{AdwBanner as o}from"../widgets/adw-banner.js";import{AdwBin as s}from"../widgets/adw-bin.js";import{AdwBottomSheet as c}from"../widgets/adw-bottom-sheet.js";import{AdwButtonContent as l}from"../widgets/adw-button-content.js";import{AdwButtonRow as u}from"../widgets/adw-button-row.js";import{AdwCarousel as d}from"../widgets/adw-carousel.js";import{AdwCarouselIndicatorDots as f}from"../widgets/adw-carousel-indicator-dots.js";import{AdwCarouselIndicatorLines as p}from"../widgets/adw-carousel-indicator-lines.js";import{AdwClamp as m}from"../widgets/adw-clamp.js";import{AdwComboRow as h}from"../widgets/adw-combo-row.js";import{AdwDialog as g}from"../widgets/adw-dialog.js";import{AdwEntryRow as _}from"../widgets/adw-entry-row.js";import{AdwExpanderRow as v}from"../widgets/adw-expander-row.js";import{AdwWindowTitle as y}from"../widgets/adw-window-title.js";import{AdwHeaderBar as b}from"../widgets/adw-header-bar.js";import{AdwViewStackPage as x}from"../widgets/view-stack-page.js";import{AdwViewStack as S}from"../widgets/adw-view-stack.js";import{AdwInlineViewSwitcher as C}from"../widgets/adw-inline-view-switcher.js";import{AdwNavigationSplitView as w}from"../widgets/adw-navigation-split-view.js";import{AdwNavigationPage as T}from"../widgets/adw-navigation-page.js";import{AdwNavigationView as E}from"../widgets/adw-navigation-view.js";import{AdwOverlaySplitView as D}from"../widgets/adw-overlay-split-view.js";import{AdwPasswordEntryRow as te}from"../widgets/adw-password-entry-row.js";import{AdwPreferencesDialog as O}from"../widgets/adw-preferences-dialog.js";import{AdwPreferencesGroup as k}from"../widgets/adw-preferences-group.js";import{AdwPreferencesPage as A}from"../widgets/adw-preferences-page.js";import{AdwShortcutLabel as j}from"../widgets/adw-shortcut-label.js";import{AdwSidebarItem as M,AdwSidebarSection as N}from"../values/sidebar.js";import{AdwSidebar as P}from"../widgets/adw-sidebar.js";import{AdwSpinRow as F}from"../widgets/adw-spin-row.js";import{AdwSpinner as I}from"../widgets/adw-spinner.js";import{AdwSplitButton as L}from"../widgets/adw-split-button.js";import{AdwStatusPage as R}from"../widgets/adw-status-page.js";import{AdwSwitchRow as z}from"../widgets/adw-switch-row.js";import{AdwTabPage as B}from"../values/tab-page.js";import{AdwTabView as V}from"../widgets/adw-tab-view.js";import{AdwToastOverlay as H}from"../widgets/adw-toast-overlay.js";import{AdwToggle as U}from"../widgets/adw-toggle.js";import{AdwToggleGroup as W}from"../widgets/adw-toggle-group.js";import{AdwToolbarView as G}from"../widgets/adw-toolbar-view.js";import{AdwViewSwitcher as K}from"../widgets/adw-view-switcher.js";import{AdwViewSwitcherBar as q}from"../widgets/adw-view-switcher-bar.js";import{AdwWindow as J}from"../widgets/adw-window.js";import{AdwWrapBox as Y}from"../widgets/adw-wrap-box.js";import{AdwStyleManager as X}from"../widgets/style-manager.js";import{ColorScheme as Z,Toast as Q,ToastPriority as $}from"@gjsify/adwaita-core";var ne=ee({AboutDialog:()=>e,ActionRow:()=>t,AlertDialog:()=>n,Application:()=>r,ApplicationWindow:()=>i,Avatar:()=>a,Banner:()=>o,Bin:()=>s,BottomSheet:()=>c,ButtonContent:()=>l,ButtonRow:()=>u,Carousel:()=>d,CarouselIndicatorDots:()=>f,CarouselIndicatorLines:()=>p,Clamp:()=>m,ColorScheme:()=>Z,ComboRow:()=>h,Dialog:()=>g,EntryRow:()=>_,ExpanderRow:()=>v,HeaderBar:()=>b,InlineViewSwitcher:()=>C,NavigationPage:()=>T,NavigationSplitView:()=>w,NavigationView:()=>E,OverlaySplitView:()=>D,PasswordEntryRow:()=>te,PreferencesDialog:()=>O,PreferencesGroup:()=>k,PreferencesPage:()=>A,ShortcutLabel:()=>j,Sidebar:()=>P,SidebarItem:()=>M,SidebarSection:()=>N,SpinRow:()=>F,Spinner:()=>I,SplitButton:()=>L,StatusPage:()=>R,StyleManager:()=>X,SwitchRow:()=>z,TabPage:()=>B,TabView:()=>V,Toast:()=>Q,ToastOverlay:()=>H,ToastPriority:()=>$,Toggle:()=>U,ToggleGroup:()=>W,ToolbarView:()=>G,ViewStack:()=>S,ViewStackPage:()=>x,ViewSwitcher:()=>K,ViewSwitcherBar:()=>q,Window:()=>J,WindowTitle:()=>y,WrapBox:()=>Y});export{e as AboutDialog,t as ActionRow,n as AlertDialog,r as Application,i as ApplicationWindow,a as Avatar,o as Banner,s as Bin,c as BottomSheet,l as ButtonContent,u as ButtonRow,d as Carousel,f as CarouselIndicatorDots,p as CarouselIndicatorLines,m as Clamp,Z as ColorScheme,h as ComboRow,g as Dialog,_ as EntryRow,v as ExpanderRow,b as HeaderBar,C as InlineViewSwitcher,T as NavigationPage,w as NavigationSplitView,E as NavigationView,D as OverlaySplitView,te as PasswordEntryRow,O as PreferencesDialog,k as PreferencesGroup,A as PreferencesPage,j as ShortcutLabel,P as Sidebar,M as SidebarItem,N as SidebarSection,F as SpinRow,I as Spinner,L as SplitButton,R as StatusPage,X as StyleManager,z as SwitchRow,B as TabPage,V as TabView,Q as Toast,H as ToastOverlay,$ as ToastPriority,U as Toggle,W as ToggleGroup,G as ToolbarView,S as ViewStack,x as ViewStackPage,K as ViewSwitcher,q as ViewSwitcherBar,J as Window,y as WindowTitle,Y as WrapBox,ne as adw_exports};
|
package/lib/esm/namespace/gdk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{nativeClipboardHost as t}from"../clipboard-host.js";import{CURRENT_TIME as n,GDK_KEYS as r,createGdk as i}from"@gjsify/adwaita-core";var a=e({
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{nativeClipboardHost as t}from"../clipboard-host.js";import{CURRENT_TIME as n,GDK_KEYS as r,createGdk as i}from"@gjsify/adwaita-core";var a=e({AppLaunchContext:()=>d,CURRENT_TIME:()=>f,Clipboard:()=>c,ContentFormats:()=>u,ContentProvider:()=>l,Display:()=>s,KEY_Down:()=>T,KEY_Escape:()=>x,KEY_Left:()=>S,KEY_Return:()=>b,KEY_Right:()=>w,KEY_Up:()=>C,KEY_a:()=>m,KEY_d:()=>h,KEY_e:()=>g,KEY_q:()=>_,KEY_s:()=>v,KEY_space:()=>p,KEY_w:()=>y,gdk:()=>o});const o=i(t),s=o.Display,c=o.Clipboard,l=o.ContentProvider,u=o.ContentFormats,d=o.AppLaunchContext,f=n,{KEY_space:p,KEY_a:m,KEY_d:h,KEY_e:g,KEY_q:_,KEY_s:v,KEY_w:y,KEY_Return:b,KEY_Escape:x,KEY_Left:S,KEY_Up:C,KEY_Right:w,KEY_Down:T}=r;export{d as AppLaunchContext,f as CURRENT_TIME,c as Clipboard,u as ContentFormats,l as ContentProvider,s as Display,T as KEY_Down,x as KEY_Escape,S as KEY_Left,b as KEY_Return,w as KEY_Right,C as KEY_Up,m as KEY_a,h as KEY_d,g as KEY_e,_ as KEY_q,v as KEY_s,p as KEY_space,y as KEY_w,o as gdk,a as gdk_exports};
|
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{
|
|
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,GioMenuItem as d,GioOutputStream as f,GioResource as p,IOErrorEnum as m,ResourceError as h,ResourceLookupFlags as g,createAppInfo as _,promisify as v,resources_enumerate_children as y,resources_get_info as b,resources_lookup_data as x,resources_register as S,resources_unregister as C}from"@gjsify/adwaita-core";import{Settings as w}from"@gjsify/app-settings/nativescript";var T=e({AppInfo:()=>E,Application:()=>i,ApplicationFlags:()=>a,File:()=>s,FileCreateFlags:()=>o,FileOutputStream:()=>c,IOErrorEnum:()=>m,ListStore:()=>l,Menu:()=>u,MenuItem:()=>d,OutputStream:()=>f,Resource:()=>p,ResourceError:()=>h,ResourceLookupFlags:()=>g,Settings:()=>w,SimpleAction:()=>t,SimpleActionGroup:()=>n,_promisify:()=>v,resources_enumerate_children:()=>y,resources_get_info:()=>b,resources_lookup_data:()=>x,resources_register:()=>S,resources_unregister:()=>C});const E=_(r);export{E as AppInfo,i as Application,a as ApplicationFlags,s as File,o as FileCreateFlags,c as FileOutputStream,m as IOErrorEnum,l as ListStore,u as Menu,d as MenuItem,f as OutputStream,p as Resource,h as ResourceError,g as ResourceLookupFlags,w as Settings,t as SimpleAction,n as SimpleActionGroup,v as _promisify,T as gio_exports,y as resources_enumerate_children,b as resources_get_info,x as resources_lookup_data,S as resources_register,C as resources_unregister};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GLibBytes as t,GLibError as n,MAXUINT32 as r,buildFilenamev as i,createGLibTimers as a,getCurrentDir as o,getSystemDataDirs as s}from"@gjsify/adwaita-core";var
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GLibBytes as t,GLibError as n,MAXUINT32 as r,buildFilenamev as i,createGLibTimers as a,getCurrentDir as o,getSystemDataDirs as s,uriEscapeString as c}from"@gjsify/adwaita-core";var l=e({Bytes:()=>t,Error:()=>n,MAXUINT32:()=>x,PRIORITY_DEFAULT:()=>f,PRIORITY_DEFAULT_IDLE:()=>m,PRIORITY_HIGH:()=>d,PRIORITY_HIGH_IDLE:()=>p,PRIORITY_LOW:()=>h,SOURCE_CONTINUE:()=>_,SOURCE_REMOVE:()=>g,build_filenamev:()=>S,get_current_dir:()=>C,get_system_data_dirs:()=>w,idle_add:()=>v,source_remove:()=>b,timeout_add:()=>y,uri_escape_string:()=>T});const u=a(),d=u.PRIORITY_HIGH,f=u.PRIORITY_DEFAULT,p=u.PRIORITY_HIGH_IDLE,m=u.PRIORITY_DEFAULT_IDLE,h=u.PRIORITY_LOW,g=u.SOURCE_REMOVE,_=u.SOURCE_CONTINUE,v=u.idle_add,y=u.timeout_add,b=u.source_remove,x=r,S=i,C=o,w=s,T=c;export{t as Bytes,n as Error,x as MAXUINT32,f as PRIORITY_DEFAULT,m as PRIORITY_DEFAULT_IDLE,d as PRIORITY_HIGH,p as PRIORITY_HIGH_IDLE,h as PRIORITY_LOW,_ as SOURCE_CONTINUE,g as SOURCE_REMOVE,S as build_filenamev,C as get_current_dir,w as get_system_data_dirs,l as glib_exports,v as idle_add,b as source_remove,y as timeout_add,T as uri_escape_string};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"../widgets/construct-props.js";import{WIDGET_SIGNALS as t,watchMapping as n}from"../widgets/widget-mapping.js";import{emittedSignalsOf as r}from"../widgets/signals.js";import{registerTemplateClass as i}from"../builder/template-classes.js";import{nativePlatformHost as a}from"../platform-host.js";import{buildInto as o}from"../builder/index.js";import{ENGINE_TARGET as s}from"../engine-target.js";import{gdk as c}from"./gdk.js";import{GObjectObject as l,connectInstance as u,constructRegistered as d,createGObject as f,disconnectInstance as p,emitInstance as m,engineForTarget as h,notifyInstance as g,registeredClassOf as _,widgetControllerMembers as v,widgetDisplayMembers as y}from"@gjsify/adwaita-core";function nearestRegistered(e){for(let t=e;typeof t==`function`;t=Object.getPrototypeOf(t))if(_(t)!==void 0)return t}function declareEmitted(e,t){let n=r(e),i=[...t.properties.map(e=>`notify::${e.name}`),...Object.keys(t.signals)];Object.defineProperty(e,"emittedSignals",{value:[...new Set([...n,...i])],enumerable:!1,configurable:!0,writable:!0})}function spliceLayer(t){let n=Object.getPrototypeOf(t),r=n.prototype.notify;class Registered extends n{constructor(n){if(super(),nearestRegistered(new.target)!==t)return;let r=d(this,n);e(this,r)}}let i={connect(e,t){return u(this,e,t)},disconnect(e){p(this,e)},emit(e,...t){m(this,e,...t)},notify(e){typeof e==`string`?g(this,e):r.call(this,e)}};for(let[e,t]of Object.entries({...y(c),...v(a)}))e in n.prototype||(i[e]=t);for(let[e,t]of Object.entries(i))Object.defineProperty(Registered.prototype,e,{value:t,writable:!0,configurable:!0,enumerable:!1});Object.setPrototypeOf(t,Registered),Object.setPrototypeOf(t.prototype,Registered.prototype)}const{engineName:b,Object:x,registerClass:S,ParamSpec:C,ParamFlags:w,Value:T,TYPE_STRING:E,TYPE_BOOLEAN:D,TYPE_INT:O,TYPE_UINT:k,TYPE_DOUBLE:A,GTypeName:j,GTypeFlags:M,interfaces:N,properties:P,signals:F,requires:I,__gtkTemplate__:L,__gtkCssName__:R,__gtkChildren__:z,__gtkInternalChildren__:B,type_ensure:V,signal_stop_emission_by_name:H}=f({name:`adwaita-nativescript`,dispatch(e,t,n){e.notify({eventName:t,object:e,args:n})},listen(e,r,i){let listener=t=>{i(e,t)},a=t.includes(r)?n(e):void 0;return e.addEventListener(r,listener),()=>{e.removeEventListener(r,listener),a?.()}},createFromTree(e,t,n){let r=o(n,e,{template:t});return{children:[],objects:Object.fromEntries(r)}},attach(e,t){},register(e,t){declareEmitted(e,t),!(e.prototype instanceof l)&&(spliceLayer(e),i(t.typeName,e))}},h(s));export{M as GTypeFlags,j as GTypeName,x as Object,w as ParamFlags,C as ParamSpec,D as TYPE_BOOLEAN,A as TYPE_DOUBLE,O as TYPE_INT,E as TYPE_STRING,k as TYPE_UINT,T as Value,z as __gtkChildren__,R as __gtkCssName__,B as __gtkInternalChildren__,L as __gtkTemplate__,b as engineName,N as interfaces,P as properties,S as registerClass,I as requires,H as signal_stop_emission_by_name,F as signals,V as type_ensure};
|
package/lib/esm/namespace/gtk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.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{GtkApplication as c}from"../widgets/application.js";import{GtkWindow as l}from"../widgets/gtk-window.js";import{ArrowType as u,License as d,PolicyType as f,TextDirection as p,TextExtendSelection as m,TextWindowType as h}from"../widgets/gtk-enums.js";import{GtkActionBar as g}from"../widgets/gtk-action-bar.js";import{GtkBox as _}from"../widgets/gtk-box.js";import{GtkButton as v}from"../widgets/gtk-button.js";import{GtkDropDown as y}from"../widgets/gtk-drop-down.js";import{GtkCheckButton as b}from"../widgets/gtk-check-button.js";import{GtkDrawingArea as x}from"../widgets/gtk-drawing-area.js";import{GtkEntry as S}from"../widgets/gtk-entry.js";import{GtkGrid as C}from"../widgets/gtk-grid.js";import{GtkFrame as w}from"../widgets/gtk-frame.js";import{GtkLabel as T}from"../widgets/gtk-label.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{GtkSeparator as M}from"../widgets/gtk-separator.js";import{GtkStackPage as N}from"../widgets/stack-page.js";import{GtkStack as P}from"../widgets/gtk-stack.js";import{GtkTextView as F}from"../widgets/gtk-text-view.js";import{GtkToggleButton as I}from"../widgets/gtk-toggle-button.js";import{ApplicationInhibitFlags as L,DialogError as R,GtkAdjustment as z,GtkFileDialog as B,GtkFileFilter as V,GtkStringList as H,STYLE_PROVIDER_PRIORITY_APPLICATION as U,STYLE_PROVIDER_PRIORITY_FALLBACK as W,STYLE_PROVIDER_PRIORITY_SETTINGS as G,STYLE_PROVIDER_PRIORITY_THEME as K,STYLE_PROVIDER_PRIORITY_USER as q}from"@gjsify/adwaita-core";var J=e({ActionBar:()=>g,Adjustment:()=>z,Application:()=>c,ApplicationInhibitFlags:()=>L,ArrowType:()=>u,Box:()=>_,Button:()=>v,CheckButton:()=>b,CssProvider:()=>t,DialogError:()=>R,DrawingArea:()=>x,DropDown:()=>y,Entry:()=>S,EventControllerKey:()=>n,FileDialog:()=>B,FileFilter:()=>V,Frame:()=>w,Grid:()=>C,IconTheme:()=>r,Image:()=>s,Label:()=>T,License:()=>d,ListBox:()=>E,MenuButton:()=>D,Overlay:()=>k,PolicyType:()=>f,PopoverMenu:()=>O,Revealer:()=>A,STYLE_PROVIDER_PRIORITY_APPLICATION:()=>U,STYLE_PROVIDER_PRIORITY_FALLBACK:()=>W,STYLE_PROVIDER_PRIORITY_SETTINGS:()=>G,STYLE_PROVIDER_PRIORITY_THEME:()=>K,STYLE_PROVIDER_PRIORITY_USER:()=>q,ScrolledWindow:()=>j,Separator:()=>M,Settings:()=>i,Stack:()=>P,StackPage:()=>N,StringList:()=>H,StyleContext:()=>a,TextDirection:()=>p,TextExtendSelection:()=>m,TextView:()=>F,TextWindowType:()=>h,ToggleButton:()=>I,Window:()=>l,show_uri:()=>o});export{g as ActionBar,z as Adjustment,c as Application,L as ApplicationInhibitFlags,u as ArrowType,_ as Box,v as Button,b as CheckButton,t as CssProvider,R as DialogError,x as DrawingArea,y as DropDown,S as Entry,n as EventControllerKey,B as FileDialog,V as FileFilter,w as Frame,C as Grid,r as IconTheme,s as Image,T as Label,d as License,E as ListBox,D as MenuButton,k as Overlay,f as PolicyType,O as PopoverMenu,A as Revealer,U as STYLE_PROVIDER_PRIORITY_APPLICATION,W as STYLE_PROVIDER_PRIORITY_FALLBACK,G as STYLE_PROVIDER_PRIORITY_SETTINGS,K as STYLE_PROVIDER_PRIORITY_THEME,q as STYLE_PROVIDER_PRIORITY_USER,j as ScrolledWindow,M as Separator,i as Settings,P as Stack,N as StackPage,H as StringList,a as StyleContext,p as TextDirection,m as TextExtendSelection,F as TextView,h as TextWindowType,I as ToggleButton,l as Window,J as gtk_exports,o as show_uri};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{findDialogHost as r}from"./window-state.js";import{ADW_ABOUT_DIALOG_LABELS as i,aboutDialogVisibility as a,refuseNewFromAppdata as o,releaseNotesBuffer as s,stripMnemonic as c}from"@gjsify/adwaita-core";import{Button as l,GridLayout as u,ItemSpec as d,Label as f,ScrollView as p,StackLayout as m}from"@nativescript/core";const h=`closed`;var AdwAboutDialog=class extends n(u){static GTypeName=`AdwAboutDialog`;_card;_iconLabel;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteLabel;_copyrightLabel;_releaseNotesLabel;_linksLabel;_debugInfoLabel;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_copyright=``;_releaseNotes=``;_releaseNotesVersion=``;_debugInfo=``;_links=[];_releaseNotesSegments=[];_host=null;constructor(t){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`));let n=new p;n.orientation=`vertical`,n.verticalAlignment=`middle`,n.horizontalAlignment=`center`,u.setColumn(n,0),u.setRow(n,0);let r=new m;r.orientation=`vertical`,r.className=`adw-about-dialog-card`,n.content=r,this.addChild(n),this._card=r,this._iconLabel=this._addCardLabel(r,`adw-about-dialog-icon`),this._nameLabel=this._addCardLabel(r,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(r,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(r,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(r,`adw-about-dialog-comments`),this._releaseNotesLabel=this._addCardLabel(r,`adw-about-dialog-release-notes`),this._websiteLabel=this._addCardLabel(r,`adw-about-dialog-website`),this._linksLabel=this._addCardLabel(r,`adw-about-dialog-links`),this._copyrightLabel=this._addCardLabel(r,`adw-about-dialog-copyright`),this._debugInfoLabel=this._addCardLabel(r,`adw-about-dialog-debug-info`);let i=new l;i.text=`Close`,i.className=`adw-about-dialog-close`,i.set(`androidElevation`,0),i.addEventListener(`tap`,()=>this.close()),r.addChild(i),this._render(),e(this,t)}_addCardLabel(e,t){let n=new f;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}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()}static new_from_appdata(e,t){o()}_updateReleaseNotes(){this._releaseNotesSegments=s({releaseNotes:this._releaseNotes,releaseNotesVersion:this._releaseNotesVersion,version:this._version},i).segments,this._render()}_render(){let e=a({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website,debugInfo:this._debugInfo,releaseNotes:this._releaseNotes,hasCustomLinks:this._links.length>0}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};show(this._iconLabel,this._applicationIcon,e.appIcon),show(this._nameLabel,this._applicationName,e.appName),show(this._versionLabel,this._version,e.version),show(this._developerLabel,this._developerName,e.developerName),show(this._commentsLabel,this._comments,e.commentsLabel),show(this._websiteLabel,this._website,e.websiteRow),show(this._copyrightLabel,this._copyright,this._copyright.length>0),show(this._releaseNotesLabel,this._releaseNotesSegments.map(e=>e.text).join(``),e.whatsNewRow),show(this._linksLabel,this._links.map(e=>`${c(e.title)}: ${e.url}`).join(`
|
|
2
|
+
`),this._links.length>0),show(this._debugInfoLabel,this._debugInfo,e.troubleshootingRow)}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=r(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:h,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(e){t(e,!1)?this.present():this.close()}};export{AdwAboutDialog,h as CLOSED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
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{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{ActionRowState as a,isViewSensitive as o,rowLabelVisuals as s}from"./row-state.js";import{GtkImage as c}from"./gtk-image.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";const p=`activated`,m=[`prefix`,`suffix`];var AdwActionRow=class extends i(l){static GTypeName=`AdwActionRow`;static builderSlots=e(m,`suffix`);isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new a;_prefix=null;_iconImage=null;_suffix=null;constructor(e){super(),this.className=`adw-row adw-action-row`,this.addColumn(new u(1,`auto`)),this.addColumn(new u(1,`star`)),this.addColumn(new u(1,`auto`)),this.addRow(new u(1,`auto`));let t=new f;t.orientation=`vertical`,t.className=`adw-row-text`,l.setColumn(t,1);let r=new d;r.className=`adw-row-title`,r.textWrap=!0,t.addChild(r);let i=new d;i.className=`adw-row-subtitle`,i.textWrap=!0,t.addChild(i),this.addChild(t),this._textStack=t,this._titleLabel=r,this._subtitleLabel=i,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(),l.setColumn(e,0),this.insertChild(e,0),this._prefix=e}get iconName(){return this._iconImage!==null&&this._prefix===this._iconImage?this._iconImage.iconName:``}set iconName(e){let t=e??``;if(this._iconImage!==null&&this._prefix!==this._iconImage&&(this._iconImage=null),t===``){this._iconImage!==null&&(this.remove(this._iconImage),this._iconImage=null);return}if(this._iconImage===null){if(this._prefix)throw TypeError(`${this.constructor.name}.iconName needs the prefix slot, which add_prefix() already filled.`);this._iconImage=new c,this.add_prefix(this._iconImage)}this._iconImage.iconName=t}get prefix(){return this._prefix}get title(){return this._rowState.title}set title(e){this._rowState.setTitle(e)&&this._applyLabels()}get subtitle(){return this._rowState.subtitle}set subtitle(e){this._rowState.setSubtitle(e)&&this._applyLabels()}add_suffix(e){this._suffix&&this.remove(this._suffix),e.className=`${e.className??``} adw-row-suffix`.trim(),l.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)}get suffix(){return this._suffix}_addChildFromBuilder(e,n){t(e,m,`suffix`)===`prefix`?this.add_prefix(n):this.add_suffix(n)}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,o(e))}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(o(e))}get activatable(){return this._rowState.activatable}set activatable(e){this._rowState.setActivatable(r(e,!1))}activate(){if(!this._rowState.activatable)return;let e={eventName:p,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=s({title:this._rowState.title,subtitle:this._rowState.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}};export{p as ACTIVATED,AdwActionRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{AdwAlertResponses as n,AdwAlertResponses as r}from"@gjsify/adwaita-core";import{Observable as i,action as a,confirm as o}from"@nativescript/core";
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{AdwAlertResponses as n,AdwAlertResponses as r}from"@gjsify/adwaita-core";import{Observable as i,action as a,confirm as o}from"@nativescript/core";var AdwAlertDialog=class extends t(i){static GTypeName=`AdwAlertDialog`;_responses;constructor(t=``,n=``,i){super();let a=typeof t==`string`;this._responses=new r(a?t:``,n),a||(i=t),e(this,i)}get heading(){return this._responses.heading}set heading(e){this._responses.heading=e}get body(){return this._responses.body}set body(e){this._responses.body=e}connect(e,t){return e===`response`?super.connect(e,(e,n)=>t(e,n.args?.[0])):super.connect(e,t)}add_response(e,t,n){this._responses.addResponse(e,t,n)}addResponses(...e){this._responses.addResponses(...e)}has_response(e){return this._responses.hasResponse(e)}get_response_label(e){return this._responses.responses.find(t=>t.id===e)?.label??null}set_response_label(e,t){if(!this._responses.hasResponse(e)){console.warn(`[AdwAlertDialog] Trying to set label on a response with id '${e}', but such a response does not exist`);return}this._responses.addResponse(e,t)}set_response_appearance(e,t){this._responses.setResponseAppearance(e,t)}get_response_appearance(e){return this._responses.getResponseAppearance(e)}set_response_enabled(e,t){this._responses.setResponseEnabled(e,t)}get_response_enabled(e){return this._responses.getResponseEnabled(e)}get defaultResponse(){return this._responses.defaultResponse}set defaultResponse(e){this._responses.defaultResponse=e}get_default_response(){return this._responses.defaultResponse}set_default_response(e){this._responses.defaultResponse=e}get closeResponse(){return this._responses.closeResponse}set closeResponse(e){this._responses.closeResponse=e}get_close_response(){return this._responses.closeResponse}set_close_response(e){this._responses.closeResponse=e}get responses(){return this._responses.responses}present(e){(this._responses.usesActionSheet?this._presentAction():this._presentConfirm()).then(e=>this.emit(`response`,e),e=>console.error(`[AdwAlertDialog] the native dialog failed:`,e))}async _presentConfirm(){let e=this._responses.orderResponses(),t=await o({title:this._responses.heading||void 0,message:this._responses.body||void 0,okButtonText:e.ok?.label,cancelButtonText:e.cancel?.label,neutralButtonText:e.neutral?.label,cancelable:!0});return t===!0?this._responses.resolveById(e.ok?.id):t===!1?this._responses.resolveById(e.cancel?.id):t===void 0?this._responses.resolveById(e.neutral?.id):this._responses.closeResponse}async _presentAction(){let e=await a({title:this._responses.heading||void 0,message:this._responses.body||void 0,cancelButtonText:`Cancel`,actions:this._responses.responses.map(e=>e.label)});return this._responses.resolveLabel(e)}};export{AdwAlertDialog,n as AdwAlertResponses};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwWindowBase as t}from"./window-base.js";import{installActionMap as n}from"@gjsify/adwaita-core";var AdwApplicationWindow=class extends t{static GTypeName=`AdwApplicationWindow`;constructor(t){super(),e(this,t)}};n(AdwApplicationWindow.prototype);export{AdwApplicationWindow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{GtkImage as i}from"./gtk-image.js";import{avatarColor as a,avatarInitials as o}from"./avatar-color.js";import{AVATAR_DEFAULT_ICON as s,avatarViewState as c}from"./avatar-view.js";import{avatarIconSize as l,avatarMaxFontSize as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f,Label as p}from"@nativescript/core";const m=48;var AdwAvatar=class extends r(d){static GTypeName=`AdwAvatar`;_label;_icon;_text=``;_size=48;_showInitials=!1;_iconName=``;constructor(t){super(),this.className=`adw-avatar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let n=new p;n.className=`adw-avatar-label`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,d.setColumn(n,0),d.setRow(n,0),this.addChild(n),this._label=n;let r=new i;r.className=`adw-icon adw-avatar-icon`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,d.setColumn(r,0),d.setRow(r,0),this.addChild(r),this._icon=r,this._applySize(),this._applyColor(),this._applyMode(),e(this,t)}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,u(this._size)))),this._icon.pixelSize=l(this._size)}_applyColor(){let{fill:e,fg:t}=a(this._text);this.set(`backgroundColor`,e),this._label.set(`color`,t),this._icon.iconColor=t}_applyMode(){let e=c({showInitials:this._showInitials,text:this._text,iconName:this._iconName});this._label.visibility=e.label,this._icon.visibility=e.icon,e.icon===`visible`&&(this._icon.iconName=e.iconName)}get text(){return this._text}set text(e){this._text=e??``,this._label.text=o(this._text),this._applyColor(),this._applyMode()}get size(){return this._size}set size(e){let t=n(e,48);this._size=t>0?t:48,this._applySize()}get showInitials(){return this._showInitials}set showInitials(e){this._showInitials=t(e,!1),this._applyMode()}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._applyMode()}};export{s as AVATAR_DEFAULT_ICON,AdwAvatar,m as DEFAULT_AVATAR_SIZE,a as avatarColor,o as avatarInitials};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{bannerButtonClassName as r,bannerTitleText as i,bannerVisibility as a,defaultBannerProps as o}from"./chrome.js";import{bannerButtonText as s,bannerButtonVisible as c,parseBannerButtonStyle as l}from"@gjsify/adwaita-core";import{Button as u,GridLayout as d,ItemSpec as f,Label as p}from"@nativescript/core";const m=`buttonClicked`;var AdwBanner=class extends n(d){static GTypeName=`AdwBanner`;_titleLabel;_button;_hasButton=!1;_props=o();constructor(t){super(),this.className=`adw-banner`,this.addColumn(new f(1,`star`)),this.addColumn(new f(1,`auto`)),this.addRow(new f(1,`auto`));let n=new p;n.className=`adw-banner-title`,n.textWrap=!0,d.setColumn(n,0),this.addChild(n),this._titleLabel=n;let r=new u;r.className=`adw-banner-button`,r.set(`androidElevation`,0),d.setColumn(r,1),this._button=r,r.addEventListener(`tap`,()=>{let e={eventName:m,object:this};this.notify(e)}),this.visibility=a(this._props.revealed),e(this,t)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(e){this._props.useMarkup=t(e,!1),this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=s(t);let n=c(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(e){this._props.buttonStyle=l(e),this._button.className=r(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(e){this._props.revealed=t(e,!1),this.visibility=a(this._props.revealed)}_renderTitle(){this._titleLabel.text=i(this._props.title,this._props.useMarkup)}};export{AdwBanner,m as BUTTON_CLICKED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
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{xmlBoolean as r}from"./xml-values.js";import{withSignals as i}from"./signals.js";import{BOTTOM_BAR_CLASS as a,CLOSE_ATTEMPT as o,DIMMING_CLASS as s,NOTIFY_OPEN as c,SHEET_CLOSE as l,addMarkerClass as u,applyBottomSheetChrome as d,createBottomSheetPresentation as f,removeMarkerClass as p,requestBottomSheetClose as m}from"./bottom-sheet-state.js";import{bottomSheetInsetPadding as h}from"./bottom-sheet-insets.js";import{NestedDragTracker as g,dragOffset as _,dragProgress as v,releaseVelocity as y,settle as b,sheetHeight as x,sheetTravel as S}from"./bottom-sheet-drag.js";import{attachRowPressFeedback as C}from"./row-press.js";import{GridLayout as w,ItemSpec as T,Label as E,ScrollView as D,StackLayout as O}from"@nativescript/core";const k=`notify::modal`,A=new WeakMap;function bottomSheetPanel(e){let t=A.get(e);if(!t)throw Error(`bottomSheetPanel: not an AdwBottomSheet`);return t}const j=`adw-bottom-sheet-content`,M=`adw-bottom-sheet-sheet`,N=[`sheet`,`bottomBar`,`bottom-bar`,`content`];var AdwBottomSheet=class extends i(w){static GTypeName=`AdwBottomSheet`;static emittedSignals=[c,k];static builderSlots=e(N,`content`);_content=null;_dimming;_sheetPanel;_sheetPage;_drag=null;_nested=new g;_scrolls=new Set;_bottomInset=0;_barHeight=0;_bottomBarBin;_sheetChild=null;_bottomBar=null;_state=f();constructor(e){super(),this.className=`adw-bottom-sheet`,this.addColumn(new T(1,`star`)),this.addRow(new T(1,`star`));let t=new w;t.className=s,w.setColumn(t,0),w.setRow(t,0),t.addEventListener(`tap`,()=>this.requestClose(`dimming`)),this.addChild(t),this._dimming=t;let r=new O;r.orientation=`vertical`,r.className=`adw-bottom-sheet-panel`,r.verticalAlignment=`bottom`,w.setColumn(r,0),w.setRow(r,0);let i=new O;i.orientation=`vertical`,i.className=a,i.addEventListener(`tap`,()=>this.requestOpen(`bottom-bar`)),C(i),r.addChild(i);let o=new w;o.className=`adw-bottom-sheet-page`,o.addRow(new T(1,`star`)),r.addChild(o);let l=new E;l.className=`adw-bottom-sheet-handle`,l.horizontalAlignment=`center`,l.isUserInteractionEnabled=!1,l.verticalAlignment=`top`,w.setRow(l,0),o.addChild(l);let u=new O;u.className=`adw-bottom-sheet-grip`,u.verticalAlignment=`top`,u.height=48,u.addEventListener(`tap`,()=>{}),w.setRow(u,0),o.addChild(u),r.addEventListener(`pan`,e=>this._onPan(e)),t.addEventListener(`pan`,e=>this._onPan(e)),this.addChild(r),this._sheetPanel=r,A.set(this,r),this._sheetPage=o,this._bottomBarBin=i,this._paintChrome(),this._applyInsetPadding(),this.addEventListener(`layoutChanged`,()=>{this._syncHeight(),!this._state.open&&!this._drag&&(this._barHeight=this._sheetPanel.getActualSize().height)}),this._state.subscribe(e=>{this._paintChrome(),this._syncHeight();let t={eventName:c,object:this,open:e};this.notify(t)}),n(this,e)}applyBottomInset(e){this._bottomInset=e,this._applyInsetPadding()}_applyInsetPadding(){let e=h(this._bottomInset,{sheetScrolls:this._scrolls.size>0});this._bottomBarBin.paddingBottom=e.bar,this._sheetPage.paddingBottom=e.page;for(let t of this._scrolls){let n=t.content;n&&(n.paddingBottom=e.scrollEnd)}}_paintChrome(){d({dimming:this._dimming,panel:this._sheetPanel,page:this._sheetPage,bottomBar:this._bottomBarBin},this._state.chrome)}_syncHeight(){let e=this._sheetPanel;if(this._drag)return;if(!this._state.open){e.height!==`auto`&&(e.height=`auto`);return}let t=x(this.getActualSize().height);t>0&&e.height!==t&&(e.height=t)}_watchScrolling(e){if(e instanceof D){if(this._scrolls.has(e))return;this._scrolls.add(e),e.addEventListener(`touch`,t=>this._onNestedTouch(e,t)),this._applyInsetPadding();return}let t=e;t.content&&this._watchScrolling(t.content);let n=t.getChildrenCount?.()??0;for(let e=0;e<n;e++)this._watchScrolling(t.getChildAt(e))}_onNestedTouch(e,t){if(!this._state.open&&!this._nested.dragging)return;let n=t.getY()+(this._sheetPanel.translateY||0),r;if(t.action===`down`){if(this._drag)return;this._nested.down(n);return}r=t.action===`move`?this._nested.move(n,e.verticalOffset):this._nested.up(t.action===`cancel`),r.kind===`begin`?this._beginDrag():r.kind===`move`?this._moveDrag(r.dy):r.kind===`end`&&this._endDrag(r.dy,!1)}_onPan(e){this._nested.ignorePan(e.state)||(e.state===1?this._beginDrag():e.state===2?this._moveDrag(e.deltaY):this._endDrag(e.deltaY,e.state===0))}_beginDrag(){if(this._drag)return;let e=this._state.open;if(!e&&!this._bottomBar)return;let t=x(this.getActualSize().height);if(t<=0)return;let n=S(t,this._barHeight),r=this._sheetPanel;this._drag={start:e?`open`:`closed`,height:t,travel:n,samples:[],offset:e?0:n},r.height=t,!e&&(this._dimming.visibility=`visible`,this._dimming.opacity=0,this._bottomBarBin.visibility=`collapse`,this._sheetPage.visibility=`visible`,r.visibility=`visible`,r.translateY=n)}_moveDrag(e){let t=this._drag;t&&(t.samples.push({dy:e,time:Date.now()}),t.offset=_(t.start,e,t.travel),this._sheetPanel.translateY=t.offset,(t.start===`closed`||this._state.modal)&&(this._dimming.opacity=v(t.offset,t.travel)))}_endDrag(e,t){let n=this._drag;if(!n)return;n.samples.push({dy:e,time:Date.now()}),n.offset=_(n.start,e,n.travel);let r=t?n.start:b(n.offset,n.travel,y(n.samples)),i=r===`open`?0:n.travel,done=()=>{this._drag=null,this._sheetPanel.translateY=0,this._dimming.opacity=1,r!==n.start&&(r===`open`?this.requestOpen(`swipe`):this.requestClose(`swipe`)),this._paintChrome(),this._syncHeight()};this._sheetPanel.animate({translate:{x:0,y:i},duration:180,curve:`easeOut`}).then(done,done)}set_content(e){this._content!==e&&(this._content&&(this._content.className=p(this._content.className,j),this.removeChild(this._content)),this._content=e,e&&(e.className=u(e.className,j),w.setColumn(e,0),w.setRow(e,0),this.insertChild(e,0)))}set_sheet(e){this._sheetChild!==e&&(this._sheetChild&&(this._sheetChild.className=p(this._sheetChild.className,M),this._sheetPage.removeChild(this._sheetChild),this._scrolls.clear()),this._sheetChild=e,e&&(e.className=u(e.className,M),w.setRow(e,0),this._sheetPage.insertChild(e,0),this._watchScrolling(e),e.addEventListener(`loaded`,()=>this._watchScrolling(e))),this._applyInsetPadding())}set_bottom_bar(e){this._bottomBar!==e&&(this._bottomBar&&this._bottomBarBin.removeChild(this._bottomBar),this._bottomBar=e,e&&this._bottomBarBin.addChild(e),this._state.setHasBottomBar(e!==null),this._paintChrome())}_addChildFromBuilder(e,n){let r=t(e,N,`content`);r===`sheet`?this.set_sheet(n):r===`bottomBar`||r===`bottom-bar`?this.set_bottom_bar(n):this.set_content(n)}get content(){return this._content}set content(e){this.set_content(e)}get sheet(){return this._sheetChild}set sheet(e){this.set_sheet(e)}get bottomBar(){return this._bottomBar}set bottomBar(e){this.set_bottom_bar(e)}get open(){return this._state.open}set open(e){this._state.setOpen(r(e,!1))}get_modal(){return this._state.modal}set_modal(e){this._state.setModal(r(e,this.get_modal()))&&(this._paintChrome(),this.notify({eventName:k,object:this,value:this.get_modal()}))}get canClose(){return this._state.canClose}set canClose(e){let t=r(e,this.canClose);this._state.setCanClose(t)}get canOpen(){return this._state.canOpen}set canOpen(e){this._state.setCanOpen(r(e,this.canOpen))&&this._paintChrome()}get revealBottomBar(){return this._state.revealBottomBar}set revealBottomBar(e){this._state.setRevealBottomBar(r(e,this.revealBottomBar))&&this._paintChrome()}requestClose(e){let{outcome:t,eventName:n}=m(this._state,e);return n&&this.notify({eventName:n,object:this}),t}requestOpen(e){return this._state.requestOpen(e)}};export{AdwBottomSheet,o as CLOSE_ATTEMPT,k as NOTIFY_MODAL,c as NOTIFY_OPEN,l as SHEET_CLOSE,bottomSheetPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{buttonContentClassName as i,buttonContentEllipsize as a,buttonContentIcon as o,buttonContentIconIsFallback as s,buttonContentLabelText as c,buttonContentLabelVisibility as l,buttonContentRootedParentClassName as u,buttonContentUnrootedParentClassName as d}from"./button-content.js";import{ADW_BUTTON_CONTENT_DEFAULTS as f}from"@gjsify/adwaita-core";import{Label as p,StackLayout as m}from"@nativescript/core";var AdwButtonContent=class extends n(m){static GTypeName=`AdwButtonContent`;_icon;_label;_props={...f};_hostButton=null;constructor(t){super(),this.orientation=`horizontal`,this.className=`adw-button-content`,this.horizontalAlignment=`center`;let n=new r;n.className=`${n.className} adw-button-content-icon`.trim(),n.verticalAlignment=`middle`,n.iconName=o(``),this.addChild(n),this._icon=n;let i=new p;i.className=`adw-button-content-label`,i.verticalAlignment=`middle`,i.visibility=l(``),this.addChild(i),this._label=i,e(this,t)}get hostButton(){return this._hostButton}set hostButton(e){this._hostButton!==e&&(this._hostButton&&(this._hostButton.className=d(this._hostButton.className??``)),this._hostButton=e,e&&(e.className=u(e.className??``)))}get iconName(){return this._props.iconName}set iconName(e){this._props.iconName=e??``,this._icon.iconName=o(this._props.iconName)}get iconIsFallback(){return s(this._props.iconName)}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get label(){return this._props.label}set label(e){this._props.label=e??``,this._renderLabel()}get useUnderline(){return this._props.useUnderline}set useUnderline(e){let n=t(e,this.useUnderline);this._props.useUnderline=!!n,this._renderLabel()}get canShrink(){return this._props.canShrink}set canShrink(e){let n=t(e,this.canShrink);this._props.canShrink=!!n,this.className=i(this.className,this._props.canShrink)}get ellipsize(){return a(this._props.canShrink)}_renderLabel(){this._label.text=c(this._props.label,this._props.useUnderline),this._label.visibility=l(this._props.label)}};export{AdwButtonContent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{withSignals as r}from"./signals.js";import{CarouselScrollSync as i,DEFAULT_CAROUSEL_PAGE_WIDTH as a,carouselNotifyPayload as o,carouselPositionAtOffset as s,carouselScrollOffset as c,createCarouselState as l,normalizeCarouselPageWidth as u}from"./carousel-state.js";import{GridLayout as d,ItemSpec as f,ScrollView as p,StackLayout as m}from"@nativescript/core";const h=`notify::position`,g=`notify::n-pages`,_=`page-changed`;var AdwCarousel=class extends r(d){static GTypeName=`AdwCarousel`;_scroller;_track;_state=l({onScrollTo:e=>this._performScroll(e)});_sync=new i;_views=new Map;_nextPageId=0;_pageWidth=320;_animateScroll=!0;constructor(t){super(),this.className=`adw-carousel`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let n=new p;n.orientation=`horizontal`,n.className=`adw-carousel-scroller`,d.setRow(n,0);let r=new m;r.orientation=`horizontal`,r.className=`adw-carousel-track`,n.content=r,this.addChild(n),this._scroller=n,this._track=r,n.addEventListener(`scroll`,e=>{let t=s(e.scrollX,this._distance());this._sync.apply(this._state,t)}),this._state.subscribe(e=>{let t={eventName:e.reason===`n-pages`?g:h,object:this,...o(e)};this.notify(t)}),this._state.onPageChanged(e=>{let t={eventName:_,object:this,index:e};this.notify(t)}),e(this,t)}append(e){this.insert(e,-1)}_addChildFromBuilder(e,t){this.append(t)}insert(e,t=-1){let n=`page-${this._nextPageId++}`;return e.width=this._pageWidth,e.className=`${e.className??``} adw-carousel-page`.trim(),this._views.set(n,e),this._state.insertPage(n,t)?(this._state.skipReveal(n),this._syncTrack(),!0):(this._views.delete(n),!1)}remove(e){let t=this._idOf(e);return t===null||!this._state.removePage(t)?!1:(this._state.skipReveal(t),this._views.delete(t),this._syncTrack(),!0)}reorder(e,t){let n=this._idOf(e);return n===null||!this._state.reorderPage(n,t)?!1:(this._syncTrack(),!0)}scroll_to(e,t=!0){let n=this._idOf(e);if(n!==null){this._animateScroll=t;try{this._scrollToIndex(this._state.indexOf(n))}finally{this._animateScroll=!0}}}get_nth_page(e){if(!Number.isInteger(e)||e<0||e>=this._state.nPages)return null;let t=this._state.ids[e];return(t===void 0?void 0:this._views.get(t))??null}get_n_pages(){return this._state.nPages}get_position(){return this._state.position}navigate(e){return this._state.navigate(e)}get pages(){let e=[];for(let t=0;t<this._track.getChildrenCount();t++)e.push(this._track.getChildAt(t));return e}get nPages(){return this._state.nPages}get position(){return this._state.position}set position(e){let t=n(e,this.position);if(!Number.isFinite(t))return;let r=this._state.pageAt(t);r>=0&&this._scrollToIndex(r)}get currentPage(){return this._state.pageAt(this._state.position)}get interactive(){return this._state.interactive}set interactive(e){let n=t(e,this.interactive);this._state.setInteractive(n)}get pageWidth(){return this._pageWidth}set pageWidth(e){let t=n(e,this.pageWidth);this._pageWidth=u(t);for(let e of this._views.values())e.width=this._pageWidth}_distance(){return this._state.pageDistance(this._pageWidth)}_scrollToIndex(e){this._state.scrollTo(e,{interactive:!0})}_idOf(e){for(let[t,n]of this._views)if(n===e)return t;return null}_performScroll(e){this._sync.expect(e.position),this._scroller.scrollToHorizontalOffset(c(e.position,this._distance()),this._animateScroll)}_syncTrack(){for(;this._track.getChildrenCount()>0;)this._track.removeChild(this._track.getChildAt(0));for(let e of this._state.ids){let t=this._views.get(e);t&&this._track.addChild(t)}}};export{AdwCarousel,a as DEFAULT_CAROUSEL_PAGE_WIDTH,g as NOTIFY_N_PAGES,h as NOTIFY_POSITION,_ as PAGE_CHANGED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
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{xmlNumber as r}from"./xml-values.js";import{GtkImage as i}from"./gtk-image.js";import{AdwActionRow as a}from"./adw-action-row.js";import{attachRowPressFeedback as o}from"./row-press.js";import{ComboState as s,ComboState as c,normalizeComboOptions as l}from"@gjsify/adwaita-core";import{Label as u,StackLayout as d,action as f}from"@nativescript/core";import{panDownSymbolic as p}from"@gjsify/adwaita-icons/ui";const m=`notify::selected`;var AdwComboRow=class extends a{static GTypeName=`AdwComboRow`;static builderSlots=e([...a.builderSlots,`model`],`suffix`);_valueLabel;_chevron;_state=new c;_pendingSelected=null;constructor(e){super(),this.className=`adw-row adw-action-row adw-combo-row`;let t=new d;t.orientation=`horizontal`,t.className=`adw-combo-suffix`;let r=new u;r.className=`adw-combo-value`,r.text=``;let a=new i;a.className=`adw-combo-chevron`,a.iconColor=`#9a9a9a`,a.pixelSize=16,a.iconName=p,t.addChild(r),t.addChild(a),this.add_suffix(t),this._valueLabel=r,this._chevron=a,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:m,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),this._syncChooser(),n(this,e)}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.model.map(e=>e.label),t=await f({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){if(this._state.setModel(l(e)),this._pendingSelected!==null&&this._pendingSelected<this._state.model.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelectedIndex(e)}}set_model(e){this.model=e??[]}_addChildFromBuilder(e,n){if(t(e,[`model`],`edge`)===`model`){this.model=n;return}super._addChildFromBuilder(e,n)}get selected(){return this._state.selectedIndex}set selected(e){let t=r(e,this.selected);if(this._state.model.length===0){this._pendingSelected=t;return}this._state.setSelectedIndex(t)}get_selected(){return this.selected}set_selected(e){this.selected=e}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,s as ComboState,m as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t}from"./xml-values.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{DATA_GRID_HEADER_CELL_CLASS as i,DATA_GRID_HEADER_ROW_CLASS as a,DATA_GRID_SECTION_CELL_CLASS as o,dataGridCellClass as s,dataGridItemSpec as c,dataGridRowClass as l,dataGridShapeKey as u,dataGridTracksKey as d}from"./data-grid-model.js";import{dataGridCellText as f,dataGridColumnClasses as p,dataGridRowInteractive as m,dataGridTracks as h,normalizeDataGridColumns as g,normalizeDataGridVariant as _}from"@gjsify/adwaita-core";import{GridLayout as v,ItemSpec as y,Label as b,StackLayout as x}from"@nativescript/core";const S=`row-activated`;var AdwDataGrid=class extends n(v){static GTypeName=`AdwDataGrid`;_columns=[];_dataRows=[];_interactive=!1;_header=null;_rowNodes=[];_trackKey=``;_shapeKey=``;constructor(t){super(),this.className=`adw-data-grid`,e(this,t)}get_columns(){return this._columns}set_columns(e){this._columns=g(e),this._render()}get_rows(){return this._dataRows}set_rows(e){this._dataRows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(e){let n=t(e,this.interactive);this._interactive=!!n,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=h(this._columns),t=d(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=c(t);this.addColumn(new y(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=u(e,this._dataRows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new y(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._dataRows.map((t,n)=>(this.addRow(new y(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(e,t,n){let i=new x;v.setRow(i,e),v.setColumn(i,0),v.setColumnSpan(i,t),this.addChild(i),n&&(r(i),i.addEventListener(`tap`,()=>this._activate(e-1)));let a=[];for(let n=0;n<t;n++){let t=new b;t.textWrap=!1,v.setRow(t,e),v.setColumn(t,n),this.addChild(t),a.push(t)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=a,this._columns.forEach((t,n)=>{let r=e.cells[n];r!==void 0&&(r.className=`${p(t).join(` `)} ${i}`,r.text=t.label??t.key,this._showCell(r,1))}),this._dataRows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let r=_(e.variant),i=m(r,e.interactive,this._interactive);if(n.background.className=l(r,i),r===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,r)=>{r===0?(n.className=o,n.text=f(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,v.setColumnSpan(n,1))});return}this._columns.forEach((t,i)=>{let a=n.cells[i];a!==void 0&&(a.className=s(p(t),r),a.text=f(e[t.key]),this._showCell(a,1))})}))}_showCell(e,t){e.visibility=`visible`,v.setColumnSpan(e,t)}_activate(e){let t=this._dataRows[e];if(t===void 0||!m(_(t.variant),t.interactive,this._interactive))return;let n={eventName:S,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,S as ROW_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{xmlBoolean as n,xmlNumber as r}from"./xml-values.js";import{DEFAULT_DIALOG_PRESENTATION_MODE as i,dialogPresentationMode as a,findDialogHost as o,surfaceSize as s}from"./window-state.js";import{AdwSingleChildBase as c}from"./single-child-base.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";const d=`closed`,f=`close-attempt`,p=`adw-dialog`;var AdwDialog=class extends c{static GTypeName=`AdwDialog`;static builderSlots=e([`child`],`child`);_card;_title=``;_contentWidth=-1;_contentHeight=-1;_followsContentSize=!0;_canClose=!0;_presentationMode=i;_host=null;constructor(e){super(),this._restyle(),this.visibility=`collapse`;let n=new l;n.className=`${p}-card`,n.addColumn(new u(1,`star`)),n.addRow(new u(1,`star`)),l.setColumn(n,0),l.setRow(n,0),this.addChild(n),this._card=n,this._layoutCard(),t(this,e)}get _ownClass(){return p}_adopt(e){l.setColumn(e,0),l.setRow(e,0),this._card.addChild(e)}_release(e){this._card.removeChild(e)}get title(){return this._title}set title(e){this._title=e??``,this._card.accessibilityLabel=this._title===``?void 0:this._title}get contentWidth(){return this._contentWidth}set contentWidth(e){this._contentWidth=s(r(e,NaN),e,this._contentWidth,`contentWidth`),this._layoutCard()}get contentHeight(){return this._contentHeight}set contentHeight(e){this._contentHeight=s(r(e,NaN),e,this._contentHeight,`contentHeight`),this._layoutCard()}get followsContentSize(){return this._followsContentSize}set followsContentSize(e){this._followsContentSize=n(e,this._followsContentSize)}get canClose(){return this._canClose}set canClose(e){this._canClose=n(e,this._canClose)}get presentationMode(){return this._presentationMode}set presentationMode(e){this._presentationMode=a(e),this._layoutCard()}get open(){return this.visibility===`visible`}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=o(e??null);if(t===null)throw Error(`${this.constructor.name} has no window to appear in: pass a widget that sits inside an Adw.Window / Adw.ApplicationWindow to present(), or add the dialog to a layout first.`);t._hostDialog(this),this._host=t}this.visibility=`visible`}}close(){if(!this._canClose){this.notify({eventName:f,object:this});return}this.force_close()}force_close(){this.open&&(this.visibility=`collapse`,this._host!==null&&(this._host._unhostDialog(this),this._host=null),this.notify({eventName:d,object:this}))}_layoutCard(){let e=this._card;e.width=this._contentWidth>0?this._contentWidth:`auto`,e.height=this._contentHeight>0?this._contentHeight:`auto`,this._presentationMode===`bottom-sheet`?(e.horizontalAlignment=`stretch`,e.verticalAlignment=`bottom`,e.width=`auto`):(e.horizontalAlignment=`center`,e.verticalAlignment=`middle`)}};export{p as ADW_DIALOG_CLASS,d as ADW_DIALOG_CLOSED,f as ADW_DIALOG_CLOSE_ATTEMPT,AdwDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{GtkImage as r}from"./gtk-image.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as o,NS_ENTRY_ROW_CLASS as s,applyEntryRowState as c}from"./entry-row-view.js";import{ADW_ACCENT_FG_COLOR as l,EntryRowState as u,EntryRowState as d}from"@gjsify/adwaita-core";import{Label as f,StackLayout as p,TextField as m}from"@nativescript/core";import{documentEditSymbolic as h,objectSelectSymbolic as g}from"@gjsify/adwaita-icons/actions";const _=`notify::text`,v=`notify::text-length`,y=`apply`,b=`entry-activated`;var AdwEntryRow=class extends i{static GTypeName=`AdwEntryRow`;isActionRow=!1;_state=new d;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;_lastText=``;_lastLength=0;constructor(t){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,this._managesTitleVisibility=!1;let n=new f;n.className=`adw-row-title adw-entry-empty-title`,n.textWrap=!0,this._textStack.insertChild(n,0),this._emptyTitle=n;let i=new m;i.className=`adw-entry-field`,i.set(`backgroundColor`,`transparent`),i.set(`borderWidth`,0),this._textStack.addChild(i),this._field=i;let s=new p;s.orientation=`horizontal`,s.className=`adw-entry-row-suffixes`,this._suffixes=s;let c=new r;c.className=`gtk-image adw-entry-indicator`,s.addChild(c),this._indicator=c;let u=new a;u.className=`${u.className} adw-entry-apply`.trim(),u.iconName=g,u.iconColor=l,u.addEventListener(`tap`,()=>this.apply()),s.addChild(u),this._applyButton=u;let d=new r;d.className=o,d.iconName=h,s.addChild(d),this._editIcon=d,super.add_suffix(s),this._field.addEventListener(`textChange`,()=>{this._state.setText(this._field.text??``)}),this._field.addEventListener(`focus`,()=>this._state.setEditing(!0)),this._field.addEventListener(`blur`,()=>this._state.setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this._lastText=this._state.text,this._lastLength=this._state.textLength,this._render(this._state.state),this._state.subscribe(e=>this._onStateChanged(e)),e(this,t)}get text(){return this._state.text}set text(e){this._state.setText(e??``)}get textLength(){return this._state.textLength}get maxLength(){return this._state.maxLength}set maxLength(e){let t=n(e,this.maxLength);this._state.setMaxLength(t)}get editable(){return this._state.editable}set editable(e){let n=t(e,this.editable);this._state.setEditable(n)}get showApplyButton(){return this._state.showApplyButton}set showApplyButton(e){let n=t(e,this.showApplyButton);this._state.setShowApplyButton(n)}get activatesDefault(){return this._state.activatesDefault}set activatesDefault(e){let n=t(e,this.activatesDefault);this._state.setActivatesDefault(n)}get editing(){return this._state.editing}add_suffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e),this._slotSuffix=e}remove(e){if(e===this.prefix){super.remove(e);return}this._suffixes.removeChild(e),e===this._slotSuffix&&(this._slotSuffix=null)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._state.setShowIndicator(e)}setIndicatorIcon(e){this._indicator.iconName=e}apply(){this._state.apply(),this.notify({eventName:y,object:this})}_activate(){let e=this._state.activate();if(e.signal===`apply`){this.notify({eventName:y,object:this});return}let t={eventName:b,object:this,activateDefault:e.activateDefault};this.notify(t)}_render(e){c({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return s}_onStateChanged(e){if(this._render(e),e.text!==this._lastText){this._lastText=e.text;let t={eventName:_,object:this,text:e.text};this.notify(t)}if(e.textLength!==this._lastLength){this._lastLength=e.textLength;let t={eventName:v,object:this,textLength:e.textLength};this.notify(t)}}};export{AdwEntryRow,u as EntryRowState,_ as NOTIFY_TEXT,v as NOTIFY_TEXT_LENGTH,y as SIGNAL_APPLY,b as SIGNAL_ENTRY_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{
|
|
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{xmlBoolean as r}from"./xml-values.js";import{GtkImage as i}from"./gtk-image.js";import{AdwActionRow as a}from"./adw-action-row.js";import{ExpanderState as o,ExpanderState as s}from"@gjsify/adwaita-core";import{GridLayout as c,ItemSpec as l,StackLayout as u}from"@nativescript/core";import{panDownSymbolic as d,panUpSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::expanded`,m=[`prefix`,`suffix`],h=[`prefix`];var AdwExpanderRow=class extends a{static GTypeName=`AdwExpanderRow`;static builderSlots=e(h,`row`);isActionRow=!1;_toggle;_disclosure;_state=new s;constructor(e){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new l(1,`auto`));let t=new u;t.orientation=`vertical`,t.className=`adw-expander-disclosure`,t.visibility=`collapse`,c.setRow(t,1),c.setColumn(t,0),c.setColumnSpan(t,3),this.addChild(t),this._disclosure=t;let r=new i;r.iconName=d,r.className=`${r.className} adw-expander-toggle`.trim(),this.add_suffix(r),this._toggle=r,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.iconName=e?f:d;let t={eventName:p,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),r.addEventListener(`tap`,toggleOnTap),n(this,e)}add_row(e){this._disclosure.addChild(e)}remove(e){this._disclosure.removeChild(e)}_addChildFromBuilder(e,n){let r=t(e,m,`row`);r===`row`?this.add_row(n):super._addChildFromBuilder(r,n)}get disclosureRows(){let e=[];for(let t=0;t<this._disclosure.getChildrenCount();t++)e.push(this._disclosure.getChildAt(t));return e}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(r(e,!1))}};export{AdwExpanderRow,o as ExpanderState,p as NOTIFY_EXPANDED};
|