@gjsify/adwaita-nativescript 0.64.13-next.283 → 0.64.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/builder/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/namespace/gio.js +1 -1
- package/lib/esm/namespace/gtk.js +1 -1
- package/lib/esm/widgets/adw-about-dialog.js +3 -3
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-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-row.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-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-group.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-split-button.js +1 -1
- package/lib/esm/widgets/adw-tab-view.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/box-layout.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-icon-size.js +1 -1
- package/lib/esm/widgets/gtk-image.js +1 -1
- package/lib/esm/widgets/gtk-label.js +2 -2
- 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-popover-menu.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/index.js +1 -1
- package/lib/esm/widgets/label-markup-native.android.js +1 -0
- package/lib/esm/widgets/label-markup-native.ios.js +1 -0
- package/lib/esm/widgets/label-markup-native.js +1 -0
- package/lib/esm/widgets/label-markup.js +1 -1
- package/lib/esm/widgets/menu-slot.js +1 -0
- package/lib/esm/widgets/popup-menu-view.js +1 -1
- package/lib/esm/widgets/popup-menu.js +1 -1
- package/lib/esm/widgets/scrolled-window-policy.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/single-child-base.js +1 -1
- package/lib/esm/widgets/single-child-cell.js +1 -0
- package/lib/esm/widgets/stack-page.js +1 -1
- package/lib/esm/widgets/transition-type.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/xml-values.js +1 -1
- package/lib/types/clamped-bin.spec.d.ts +2 -0
- package/lib/types/combo-row-properties.spec.d.ts +2 -0
- package/lib/types/drop-down-properties.spec.d.ts +2 -0
- package/lib/types/entry-properties.spec.d.ts +1 -0
- package/lib/types/index.d.ts +4 -2
- package/lib/types/menu-model-door.spec.d.ts +1 -0
- package/lib/types/namespace/gio.d.ts +1 -1
- package/lib/types/single-child-cell.spec.d.ts +2 -0
- package/lib/types/template-xalign.spec.d.ts +2 -0
- package/lib/types/testing/ns-core.d.mts +35 -2
- package/lib/types/widgets/actions.d.ts +3 -3
- package/lib/types/widgets/adw-combo-row.d.ts +42 -26
- package/lib/types/widgets/adw-split-button.d.ts +17 -7
- package/lib/types/widgets/box-layout.d.ts +37 -0
- package/lib/types/widgets/gtk-box.d.ts +11 -5
- package/lib/types/widgets/gtk-drop-down.d.ts +41 -33
- package/lib/types/widgets/gtk-entry.d.ts +62 -34
- package/lib/types/widgets/gtk-label.d.ts +24 -0
- package/lib/types/widgets/gtk-menu-button.d.ts +22 -13
- package/lib/types/widgets/gtk-popover-menu.d.ts +7 -7
- package/lib/types/widgets/index.d.ts +2 -4
- package/lib/types/widgets/label-markup-native.android.d.ts +5 -0
- package/lib/types/widgets/label-markup-native.d.ts +19 -0
- package/lib/types/widgets/label-markup-native.ios.d.ts +5 -0
- package/lib/types/widgets/label-markup.d.ts +62 -1
- package/lib/types/widgets/menu-slot.d.ts +40 -0
- package/lib/types/widgets/popup-menu-view.d.ts +3 -2
- package/lib/types/widgets/popup-menu.d.ts +8 -6
- package/lib/types/widgets/signals.d.ts +33 -8
- package/lib/types/widgets/single-child-base.d.ts +5 -0
- package/lib/types/widgets/single-child-cell.d.ts +13 -0
- package/lib/types/widgets/xml-values.d.ts +12 -0
- package/package.json +13 -14
- package/src/testing/ns-core.mts +74 -2
- package/src/theme/adwaita.css +24 -11
package/lib/esm/builder/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{capabilities as e}from"../capabilities.js";import{observeWindowSize as t}from"../widgets/breakpoint.js";import{gtypeNameOf as n,gtypeNameOfInstance as r}from"../widgets/gtype-name.js";import{declaredBuilderReferences as i,declaredBuilderSlots as a}from"../widgets/builder-slots.js";import{gtkPropertyRefusal as o,hasGtkProperty as s,readGtkProperty as c,writeGtkProperty as l}from"../widgets/shadowed-properties.js";import{emittedSignalsOf as u}from"../widgets/signals.js";import{authoredParamValue as d}from"./param-values.js";import{registerTemplateClass as f,templateClassFor as p}from"./template-classes.js";import{adw_exports as m}from"../namespace/adw.js";import{gtk_exports as h}from"../namespace/gtk.js";import{createBreakpointDriver as g,menuAssignments as _,parseBreakpointCondition as v,registeredDefaultTranslate as y}from"@gjsify/adwaita-core";import{assertTreeConstructs as b}from"@gjsify/adwaita-core/conformance";import{propertyOf as x}from"@gjsify/adwaita-core/tags";import{View as S}from"@nativescript/core";const C=[{prefix:`adw`,library:`Adw`,namespace:m},{prefix:`gtk`,library:`Gtk`,namespace:h}];function registerBarrel(e,t,n){let r=C.find(t=>t.prefix===e);if(r!==void 0&&r.library!==t)throw Error(`The prefix '${e}' already names \`${r.library}\`; it cannot also name \`${t}\`.`);r===void 0?C.push({prefix:e,library:t,namespace:n}):r.namespace=n}const w={GtkPopoverMenuBar:`Android has no menu-bar surface, and a row of PopupMenus would be a design choice, not GTK's widget (ADR 0097 § 2). Use a GtkMenuButton or a GtkPopoverMenu.`};function elementFor(e){let t=w[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...C].sort((e,t)=>t.library.length-e.library.length);for(let{prefix:t,library:i,namespace:a}of r){if(!e.startsWith(i))continue;let r=e.slice(i.length),o=a[r];if(typeof o!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${r}' — the name \`${e}\` is authored in the shared corpus and this dialect cannot spell it. Give the widget a namespace member (ADR 0034 clause 2), or ledger the block as divergent.`);if(n(o)!==e)throw Error(`'${t}:${r}' resolves to class \`${n(o)}\`, not \`${e}\`. The corpus is authored in GIR class names and ADR 0034 clause 1 says a widget carries that name, so a barrel member bound to another class would build the wrong widget at exit 0.`);return{xmlName:`${t}:${r}`,ctor:o}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${C.map(e=>e.prefix).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:p(e.tag)}:elementFor(e.tag)}function translated(e,t,n){return n===void 0||e===void 0||typeof t!=`string`?t:e(t,n.context)}function build(e,t={}){refuseSiblings(e,`build`);let n=buildTree(e,t).root;if(!(n instanceof S))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return n}function buildDialog(e,t={}){refuseSiblings(e,`buildDialog`);let n=buildTree(e,t).root;if(n instanceof S||typeof n.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return n}function buildWithSiblings(e,t={}){let n=buildTree(e,t,!0);if(!(n.root instanceof S))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return{root:n.root,siblings:n.siblings,objects:n.objects}}function buildInto(e,t,n={}){let r=elementOf(t);if(!(e instanceof r.ctor))throw Error(`\`buildInto\` was handed a ${e.constructor.name}, and the tree's root is \`${t.tag}\`: a template builds into an instance of the class it extends (<${r.xmlName}>).`);return buildTree(t,n,!0,e).objects}function refuseSiblings(e,t){if((e.siblings?.length??0)!==0)throw Error(`\`${e.tag}\` carries ${e.siblings.length} sibling object(s), and \`${t}\` returns one object so they would be built and lost. Use \`buildWithSiblings\`, which hands them back by id.`)}function buildTree(n,r,i=!1,a){b(`adwaita-nativescript`,e,n,Object.keys(E));let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate??y(),values:i?new Map:void 0},s=buildNode(n,o,a),c=new Map;for(let e of n.siblings??[]){if(e.id===void 0)throw Error(`the sibling \`${e.tag}\` has no id, so nothing could ever ask for it: give it one in the .blp.`);c.set(e.id,buildNode(e,o))}for(let{view:e,element:t,prop:n,id:r}of o.pending){let i=o.ids.get(r);if(i===void 0)throw Error(`<${t.xmlName} ${n}="${r}"> names no object: nothing in this tree has the id '${r}', so \`${n}\` would be handed the string instead of the widget it refers to.`);l(e,n,i)}for(let e of o.binds)bindProperty(e,o);for(let e of o.breakpointHosts)bindBreakpoints(e,o);return{root:s,siblings:c,objects:new Map([...o.ids,...o.values??[]])}}function bindProperty(e,t){let{target:n,element:r,property:i,source:a,sourceProperty:d,flags:f}=e,p=`<${r.xmlName}> \`${i}: bind ${a}.${d}\``,m=t.template,h=a===`template`&&m!==void 0?m.instance:t.ids.get(a);if(h===void 0)throw Error(`${p} names no object: nothing in this tree has the id '${a}'.`);if(f.length>0&&m===void 0)throw Error(`${p} carries ${f.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let g=x(d),_=x(i),v=u(h.constructor),y=`notify::${d}`;if(!s(h,g)||!v.includes(y))throw Error(`${p}: ${h.constructor.name} does not emit '${y}', so the target would follow the source once and never again. It emits: ${v.join(`, `)||`none`}.`);if(!s(n,_)){let e=o(n,_);throw Error(`${p}: the target has no property '${_}'.${e===null?``:` ${e}`}`)}if(m!==void 0){bindThroughEngine(m,{...e,from:h,where:p,notification:y});return}let follow=()=>l(n,_,c(h,g));follow(),h.connect(y,follow)}function engineFlags(e,t){for(let n of e)if(n!==`bidirectional`&&n!==`inverted`&&n!==`no-sync-create`)throw Error(`${t} carries the unknown flag '${n}'.`);let n=e.includes(`no-sync-create`)?[]:[`sync-create`];return e.includes(`bidirectional`)&&n.push(`bidirectional`),e.includes(`inverted`)&&n.push(`invert-boolean`),n}function viaProperties(e){let key=e=>typeof e==`string`?x(e):e;return new Proxy(e,{get(e,t){let n=typeof t==`string`&&s(e,key(t))?c(e,key(t)):Reflect.get(e,key(t));return typeof n==`function`?n.bind(e):n},set(e,t,n){return typeof t==`string`?(l(e,x(t),n),!0):Reflect.set(e,t,n)}})}function bindThroughEngine(e,t){let{target:n,from:r,property:i,sourceProperty:a,flags:o,where:s}=t,c=engineFlags(o,s),l=u(n.constructor);if(c.includes(`bidirectional`)&&!l.includes(`notify::${i}`))throw Error(`${s}: bidirectional, but ${n.constructor.name} does not emit 'notify::${i}', so the source would never follow the target back. It emits: ${l.join(`, `)||`none`}.`);e.bind(viaProperties(r),a,viaProperties(n),i,c)}function bindBreakpoints({view:e,element:t,node:n},r){if(!(e instanceof S))throw Error(`<${t.xmlName}> is not a view, so it has no size for a breakpoint to read.`);wireBreakpoints(t.xmlName,e,n.breakpoints??[],r.ids,r.observeSize,r.translate)}function applyBreakpoints(e,n,i,a={}){wireBreakpoints(r(e),e,n,new Map(Object.entries(i)),a.observeSize??t,a.translate??y())}function wireBreakpoints(e,t,n,r,i,a){let u=g(n.map(t=>{if(v(t.condition)===null)throw Error(`<${e}> \`condition ("${t.condition}")\` is not an Adwaita breakpoint condition.`);return{condition:t.condition,setters:t.setters.map(t=>{let n=r.get(t.object),i=`<${e}> breakpoint setter \`${t.object}.${t.property}\``;if(n===void 0)throw Error(`${i} names no object: nothing in this tree has the id '${t.object}'.`);if(!s(n,x(t.property))){let e=o(n,x(t.property));throw Error(`${i}: the target declares no '${x(t.property)}'.`+(e===null?``:` ${e}`))}let c=translated(a,t.value,t.translatable),l=d(n,x(t.property),c,i);return{object:n,property:t.property,value:{authored:l===null?String(c):l.value}}})}}),{read:(e,t)=>({original:c(e,x(t))}),write(e,t,n){let r=n;l(e,x(t),`authored`in r?r.authored:r.original)}});i(t,e=>u.evaluate(e))}function buildNode(e,t,n){let r=elementOf(e),i=n??new r.ctor,a=i instanceof S?buildView(e,r,i,t):buildValue(e,r,i,t);bindSignals(a,r,e,t);for(let[n,i]of Object.entries(e.bindings??{}))t.binds.push({target:a,element:r,property:n,source:i.source,sourceProperty:i.property,flags:i.flags??[]});e.breakpoints!==void 0&&t.breakpointHosts.push({view:a,element:r,node:e});for(let n of e.children??[]){let i=a;if(typeof i._addChildFromBuilder!=`function`)throw Error(`<${r.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);let o=buildNode(n,t);applyLayout(n,o,r,e.tag),i._addChildFromBuilder(builderNameFor(r,e.tag,n),o)}return a}function bindSignals(e,t,n,r){if(n.signals===void 0)return;let i=u(t.ctor),a=e;for(let e of n.signals){let n=e.detail===void 0?e.name:`${e.name}::${e.detail}`;if(typeof a.connect!=`function`||!i.includes(n))throw Error(`<${t.xmlName}> declares no signal '${n}', so the handler '${e.handler}' would never run. It emits: ${i.join(`, `)||`none`}.`);let o=(e.flags??[]).filter(e=>r.template===void 0||e!==`swapped`);if(e.object!==void 0||o.length>0)throw Error(`the handler '${e.handler}' for '${n}' uses ${e.object===void 0?``:`an object `}${(e.flags??[]).join(`, `)}: adwaita-nativescript binds plain handlers only until each of those is verified against GTK.`);if(r.template!==void 0){a.connect(n,r.template.handler(e.handler,{flags:e.flags}));continue}let s=r.scope?.[e.handler];if(typeof s!=`function`)throw Error(`the tree binds the handler '${e.handler}' for '${n}', and the scope ${r.scope===void 0?"was not given (pass `scope`)":`has no such function`}.`);a.connect(n,(...e)=>s.apply(r.scope,e))}}const T={row:`row`,column:`column`,"row-span":`rowSpan`,"column-span":`columnSpan`};function applyLayout(e,t,n,r){if(e.layout!==void 0){if(typeof n.ctor.prototype.attach!=`function`)throw Error(`<${elementOf(e).xmlName}> authored layout (${Object.keys(e.layout).join(`, `)}) under \`${r}\`, which has no \`attach\`: this port's only layout manager is the grid, so the placement would be dropped.`);if(!(t instanceof S))throw Error(`\`${e.tag}\` is not a view, so it has no cell to place.`);for(let[n,r]of Object.entries(e.layout)){let i=T[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(T).join(`, `)}.`);if(typeof r!=`number`||!Number.isInteger(r))throw Error(`layout \`${n}: ${String(r)}\` on \`${e.tag}\` is not a whole number.`);t[i]=r}}}function unknownProperty(e,t,n,r,i,a){let s=o(a,r);return Error(s===null?`<${e.xmlName} ${n}="${String(i)}"> reaches nothing: \`${t}\` declares no '${r}'. NativeScript's builder assigns it anyway, as a dead own-property at exit 0, so the attribute door cannot report this and the tree would render without it.`:`<${e.xmlName} ${n}="${String(i)}"> reaches nothing on \`${t}\`: ${s}`)}function buildView(e,t,n,r){if(e.page!==void 0)throw Error(`<${t.xmlName}> is a page (${JSON.stringify(e.page)}), and adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch.`);if(e.id!==void 0){if(r.ids.has(e.id)||r.values?.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.ids.set(e.id,n),n.id=e.id}let a=i(t.ctor);for(let[i,a]of _(e,r.menus)){let r=x(i);if(!s(n,r))throw unknownProperty(t,e.tag,i,r,i,n);l(n,r,a)}for(let[i,o]of Object.entries(e.props??{})){if(i===`menu-model`)continue;let c=x(i);if(!s(n,c))throw unknownProperty(t,e.tag,i,c,o,n);if(a.includes(c)){r.pending.push({view:n,element:t,prop:c,id:String(o)});continue}let u=translated(r.translate,o,e.translatable?.[i]),f=d(n,c,u,`<${t.xmlName} ${i}="${String(u)}">`);l(n,c,f===null?String(u):f.value)}if(e.styleClasses!==void 0&&e.styleClasses.length>0){if(!(`styleClasses`in n))throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` declares no 'styleClasses', so [${e.styleClasses.join(`, `)}] would be dropped.`);n.styleClasses=e.styleClasses.join(` `)}if(applyAccessibility(n,e,r),e.extensions?.strings!==void 0)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` is a widget, and only a list model holds them, so [${e.extensions.strings.map(e=>e.value).join(`, `)}] would be dropped.`);return applyResponses(n,t,e,r),n}const E={label:`accessibilityLabel`,description:`accessibilityHint`};function applyAccessibility(e,t,n){for(let[r,i]of Object.entries(t.accessibility??{}))e[E[r]]=String(translated(n.translate,i.value,i.translatable))}function buildValue(e,t,n,r){if(e.id!==void 0&&r.values===void 0)throw Error(`<${t.xmlName} id="${e.id}"> reaches nothing: \`${e.tag}\` is not a view, and \`getViewById\` walks views, so code beside the \`.blp\` could never look it up. \`buildWithSiblings\` hands every object back by id.`);if(e.styleClasses!==void 0&&e.styleClasses.length>0)throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` is not a widget, so [${e.styleClasses.join(`, `)}] would be dropped.`);if(e.accessibility!==void 0)throw Error(`<${t.xmlName}> takes no accessibility: \`${e.tag}\` is not a widget, so ${Object.keys(e.accessibility).join(`, `)} would be dropped.`);let i={};for(let[a,o]of _(e,r.menus)){let r=x(a);if(!s(n,r))throw unknownProperty(t,e.tag,a,r,a,n);i[r]=o}for(let[a,o]of Object.entries(e.props??{})){if(a===`menu-model`)continue;let c=x(a);if(!s(n,c))throw unknownProperty(t,e.tag,a,c,o,n);i[c]=translated(r.translate,o,e.translatable?.[a])}let a=e.extensions?.strings;if(a!==void 0){if(typeof n.append!=`function`)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` has no \`append\`, so [${a.map(e=>e.value).join(`, `)}] would be dropped.`);i.strings=a.map(e=>String(translated(r.translate,e.value,e.translatable)))}let o=new t.ctor(i);if(applyResponses(o,t,e,r),e.id!==void 0&&r.values!==void 0){if(r.values.has(e.id)||r.ids.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.values.set(e.id,o)}return o}function applyResponses(e,t,n,r){let i=e,a=n.extensions?.responses;if(a!==void 0){if(typeof i.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${a.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:o,translatable:s}of a)i.add_response(e,String(translated(r.translate,t,s)),{...n===void 0?{}:{appearance:n},...o===void 0?{}:{enabled:o}})}}function builderNameFor(e,t,n){let r=elementOf(n);if(n.slot===void 0)return r.xmlName;let i=n.slot,o=a(e.ctor);if(o===null||!o.includes(i))throw Error(`<${e.xmlName}.${i}> reaches nothing: \`${t}\` declares no such builder slot, so NativeScript would hand <${r.xmlName}> to its fallback placement instead — at exit 0, in a cell the tree never asked for. Known slots: ${o===null||o.length===0?`none`:o.join(`, `)}.`);return i}export{applyBreakpoints,build,buildDialog,buildInto,buildWithSiblings,elementFor,registerBarrel,f as registerTemplateClass};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{capabilities as e}from"../capabilities.js";import{observeWindowSize as t}from"../widgets/breakpoint.js";import{gtypeNameOf as n,gtypeNameOfInstance as r}from"../widgets/gtype-name.js";import{declaredBuilderReferences as i,declaredBuilderSlots as a}from"../widgets/builder-slots.js";import{gtkPropertyRefusal as o,hasGtkProperty as s,readGtkProperty as c,writeGtkProperty as l}from"../widgets/shadowed-properties.js";import{emittedSignalsOf as u}from"../widgets/signals.js";import{authoredParamValue as d}from"./param-values.js";import{registerTemplateClass as f,templateClassFor as p}from"./template-classes.js";import{adw_exports as m}from"../namespace/adw.js";import{gtk_exports as h}from"../namespace/gtk.js";import{buildMenu as g,createBreakpointDriver as _,menuAssignments as v,parseBreakpointCondition as y,registeredDefaultTranslate as b}from"@gjsify/adwaita-core";import{assertTreeConstructs as x}from"@gjsify/adwaita-core/conformance";import{propertyOf as S}from"@gjsify/adwaita-core/tags";import{View as C}from"@nativescript/core";const w=[{prefix:`adw`,library:`Adw`,namespace:m},{prefix:`gtk`,library:`Gtk`,namespace:h}];function registerBarrel(e,t,n){let r=w.find(t=>t.prefix===e);if(r!==void 0&&r.library!==t)throw Error(`The prefix '${e}' already names \`${r.library}\`; it cannot also name \`${t}\`.`);r===void 0?w.push({prefix:e,library:t,namespace:n}):r.namespace=n}const T={GtkPopoverMenuBar:`Android has no menu-bar surface, and a row of PopupMenus would be a design choice, not GTK's widget (ADR 0097 § 2). Use a GtkMenuButton or a GtkPopoverMenu.`};function elementFor(e){let t=T[e];if(t!==void 0)throw Error(`\`${e}\` is refused on this port: ${t}`);let r=[...w].sort((e,t)=>t.library.length-e.library.length);for(let{prefix:t,library:i,namespace:a}of r){if(!e.startsWith(i))continue;let r=e.slice(i.length),o=a[r];if(typeof o!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${r}' — the name \`${e}\` is authored in the shared corpus and this dialect cannot spell it. Give the widget a namespace member (ADR 0034 clause 2), or ledger the block as divergent.`);if(n(o)!==e)throw Error(`'${t}:${r}' resolves to class \`${n(o)}\`, not \`${e}\`. The corpus is authored in GIR class names and ADR 0034 clause 1 says a widget carries that name, so a barrel member bound to another class would build the wrong widget at exit 0.`);return{xmlName:`${t}:${r}`,ctor:o}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${w.map(e=>e.prefix).join(`, `)}).`)}function elementOf(e){return e.extern===!0?{xmlName:`app:${e.tag}`,ctor:p(e.tag)}:elementFor(e.tag)}function translated(e,t,n){return n===void 0||e===void 0||typeof t!=`string`?t:e(t,n.context)}function build(e,t={}){refuseSiblings(e,`build`);let n=buildTree(e,t).root;if(!(n instanceof C))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return n}function buildDialog(e,t={}){refuseSiblings(e,`buildDialog`);let n=buildTree(e,t).root;if(n instanceof C||typeof n.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return n}function buildWithSiblings(e,t={}){let n=buildTree(e,t,!0);if(!(n.root instanceof C))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return{root:n.root,siblings:n.siblings,objects:n.objects}}function buildInto(e,t,n={}){let r=elementOf(t);if(!(e instanceof r.ctor))throw Error(`\`buildInto\` was handed a ${e.constructor.name}, and the tree's root is \`${t.tag}\`: a template builds into an instance of the class it extends (<${r.xmlName}>).`);return buildTree(t,n,!0,e).objects}function refuseSiblings(e,t){if((e.siblings?.length??0)!==0)throw Error(`\`${e.tag}\` carries ${e.siblings.length} sibling object(s), and \`${t}\` returns one object so they would be built and lost. Use \`buildWithSiblings\`, which hands them back by id.`)}function buildTree(n,r,i=!1,a){x(`adwaita-nativescript`,e,n,Object.keys(D));let o={ids:new Map,pending:[],binds:[],breakpointHosts:[],observeSize:r.observeSize??t,menus:n.menus,scope:r.scope,template:r.template,translate:r.translate??b(),values:i?new Map:void 0},s=buildNode(n,o,a),c=new Map;for(let e of n.siblings??[]){if(e.id===void 0)throw Error(`the sibling \`${e.tag}\` has no id, so nothing could ever ask for it: give it one in the .blp.`);c.set(e.id,buildNode(e,o))}for(let{view:e,element:t,prop:n,id:r}of o.pending){let i=o.ids.get(r);if(i===void 0)throw Error(`<${t.xmlName} ${n}="${r}"> names no object: nothing in this tree has the id '${r}', so \`${n}\` would be handed the string instead of the widget it refers to.`);l(e,n,i)}for(let e of o.binds)bindProperty(e,o);for(let e of o.breakpointHosts)bindBreakpoints(e,o);return{root:s,siblings:c,objects:new Map([...o.ids,...o.values??[]])}}function bindProperty(e,t){let{target:n,element:r,property:i,source:a,sourceProperty:d,flags:f}=e,p=`<${r.xmlName}> \`${i}: bind ${a}.${d}\``,m=t.template,h=a===`template`&&m!==void 0?m.instance:t.ids.get(a);if(h===void 0)throw Error(`${p} names no object: nothing in this tree has the id '${a}'.`);if(f.length>0&&m===void 0)throw Error(`${p} carries ${f.join(`, `)}: adwaita-nativescript binds the plain form only until each flag is verified against GObject.`);let g=S(d),_=S(i),v=u(h.constructor),y=`notify::${d}`;if(!s(h,g)||!v.includes(y))throw Error(`${p}: ${h.constructor.name} does not emit '${y}', so the target would follow the source once and never again. It emits: ${v.join(`, `)||`none`}.`);if(!s(n,_)){let e=o(n,_);throw Error(`${p}: the target has no property '${_}'.${e===null?``:` ${e}`}`)}if(m!==void 0){bindThroughEngine(m,{...e,from:h,where:p,notification:y});return}let follow=()=>l(n,_,c(h,g));follow(),h.connect(y,follow)}function engineFlags(e,t){for(let n of e)if(n!==`bidirectional`&&n!==`inverted`&&n!==`no-sync-create`)throw Error(`${t} carries the unknown flag '${n}'.`);let n=e.includes(`no-sync-create`)?[]:[`sync-create`];return e.includes(`bidirectional`)&&n.push(`bidirectional`),e.includes(`inverted`)&&n.push(`invert-boolean`),n}function viaProperties(e){let key=e=>typeof e==`string`?S(e):e;return new Proxy(e,{get(e,t){let n=typeof t==`string`&&s(e,key(t))?c(e,key(t)):Reflect.get(e,key(t));return typeof n==`function`?n.bind(e):n},set(e,t,n){return typeof t==`string`?(l(e,S(t),n),!0):Reflect.set(e,t,n)}})}function bindThroughEngine(e,t){let{target:n,from:r,property:i,sourceProperty:a,flags:o,where:s}=t,c=engineFlags(o,s),l=u(n.constructor);if(c.includes(`bidirectional`)&&!l.includes(`notify::${i}`))throw Error(`${s}: bidirectional, but ${n.constructor.name} does not emit 'notify::${i}', so the source would never follow the target back. It emits: ${l.join(`, `)||`none`}.`);e.bind(viaProperties(r),a,viaProperties(n),i,c)}function bindBreakpoints({view:e,element:t,node:n},r){if(!(e instanceof C))throw Error(`<${t.xmlName}> is not a view, so it has no size for a breakpoint to read.`);wireBreakpoints(t.xmlName,e,n.breakpoints??[],r.ids,r.observeSize,r.translate)}function applyBreakpoints(e,n,i,a={}){wireBreakpoints(r(e),e,n,new Map(Object.entries(i)),a.observeSize??t,a.translate??b())}function wireBreakpoints(e,t,n,r,i,a){let u=_(n.map(t=>{if(y(t.condition)===null)throw Error(`<${e}> \`condition ("${t.condition}")\` is not an Adwaita breakpoint condition.`);return{condition:t.condition,setters:t.setters.map(t=>{let n=r.get(t.object),i=`<${e}> breakpoint setter \`${t.object}.${t.property}\``;if(n===void 0)throw Error(`${i} names no object: nothing in this tree has the id '${t.object}'.`);if(!s(n,S(t.property))){let e=o(n,S(t.property));throw Error(`${i}: the target declares no '${S(t.property)}'.`+(e===null?``:` ${e}`))}let c=translated(a,t.value,t.translatable),l=d(n,S(t.property),c,i);return{object:n,property:t.property,value:{authored:l===null?String(c):l.value}}})}}),{read:(e,t)=>({original:c(e,S(t))}),write(e,t,n){let r=n;l(e,S(t),`authored`in r?r.authored:r.original)}});i(t,e=>u.evaluate(e))}function buildNode(e,t,n){let r=elementOf(e),i=n??new r.ctor,a=i instanceof C?buildView(e,r,i,t):buildValue(e,r,i,t);bindSignals(a,r,e,t);for(let[n,i]of Object.entries(e.bindings??{}))t.binds.push({target:a,element:r,property:n,source:i.source,sourceProperty:i.property,flags:i.flags??[]});e.breakpoints!==void 0&&t.breakpointHosts.push({view:a,element:r,node:e});for(let n of e.children??[]){let i=a;if(typeof i._addChildFromBuilder!=`function`)throw Error(`<${r.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);let o=buildNode(n,t);applyLayout(n,o,r,e.tag),i._addChildFromBuilder(builderNameFor(r,e.tag,n),o)}return a}function bindSignals(e,t,n,r){if(n.signals===void 0)return;let i=u(t.ctor),a=e;for(let e of n.signals){let n=e.detail===void 0?e.name:`${e.name}::${e.detail}`;if(typeof a.connect!=`function`||!i.includes(n))throw Error(`<${t.xmlName}> declares no signal '${n}', so the handler '${e.handler}' would never run. It emits: ${i.join(`, `)||`none`}.`);let o=(e.flags??[]).filter(e=>r.template===void 0||e!==`swapped`);if(e.object!==void 0||o.length>0)throw Error(`the handler '${e.handler}' for '${n}' uses ${e.object===void 0?``:`an object `}${(e.flags??[]).join(`, `)}: adwaita-nativescript binds plain handlers only until each of those is verified against GTK.`);if(r.template!==void 0){a.connect(n,r.template.handler(e.handler,{flags:e.flags}));continue}let s=r.scope?.[e.handler];if(typeof s!=`function`)throw Error(`the tree binds the handler '${e.handler}' for '${n}', and the scope ${r.scope===void 0?"was not given (pass `scope`)":`has no such function`}.`);a.connect(n,(...e)=>s.apply(r.scope,e))}}const E={row:`row`,column:`column`,"row-span":`rowSpan`,"column-span":`columnSpan`};function applyLayout(e,t,n,r){if(e.layout!==void 0){if(typeof n.ctor.prototype.attach!=`function`)throw Error(`<${elementOf(e).xmlName}> authored layout (${Object.keys(e.layout).join(`, `)}) under \`${r}\`, which has no \`attach\`: this port's only layout manager is the grid, so the placement would be dropped.`);if(!(t instanceof C))throw Error(`\`${e.tag}\` is not a view, so it has no cell to place.`);for(let[n,r]of Object.entries(e.layout)){let i=E[n];if(i===void 0)throw Error(`layout \`${n}\` on \`${e.tag}\` reaches nothing: a grid child takes ${Object.keys(E).join(`, `)}.`);if(typeof r!=`number`||!Number.isInteger(r))throw Error(`layout \`${n}: ${String(r)}\` on \`${e.tag}\` is not a whole number.`);t[i]=r}}}function unknownProperty(e,t,n,r,i,a){let s=o(a,r);return Error(s===null?`<${e.xmlName} ${n}="${String(i)}"> reaches nothing: \`${t}\` declares no '${r}'. NativeScript's builder assigns it anyway, as a dead own-property at exit 0, so the attribute door cannot report this and the tree would render without it.`:`<${e.xmlName} ${n}="${String(i)}"> reaches nothing on \`${t}\`: ${s}`)}function buildView(e,t,n,r){if(e.page!==void 0)throw Error(`<${t.xmlName}> is a page (${JSON.stringify(e.page)}), and adwaita-nativescript builds no pages: there is no NS widget yet for Gtk.Notebook, and Gtk.StackPage is not on this branch.`);if(e.id!==void 0){if(r.ids.has(e.id)||r.values?.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.ids.set(e.id,n),n.id=e.id}let a=i(t.ctor);for(let[i,a]of v(e,r.menus)){let r=S(i);if(!s(n,r))throw unknownProperty(t,e.tag,i,r,i,n);l(n,r,g(a))}for(let[i,o]of Object.entries(e.props??{})){if(i===`menu-model`)continue;let c=S(i);if(!s(n,c))throw unknownProperty(t,e.tag,i,c,o,n);if(a.includes(c)){r.pending.push({view:n,element:t,prop:c,id:String(o)});continue}let u=translated(r.translate,o,e.translatable?.[i]),f=d(n,c,u,`<${t.xmlName} ${i}="${String(u)}">`);l(n,c,f===null?String(u):f.value)}if(e.styleClasses!==void 0&&e.styleClasses.length>0){if(!(`styleClasses`in n))throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` declares no 'styleClasses', so [${e.styleClasses.join(`, `)}] would be dropped.`);n.styleClasses=e.styleClasses.join(` `)}if(applyAccessibility(n,e,r),e.extensions?.strings!==void 0)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` is a widget, and only a list model holds them, so [${e.extensions.strings.map(e=>e.value).join(`, `)}] would be dropped.`);return applyResponses(n,t,e,r),n}const D={label:`accessibilityLabel`,description:`accessibilityHint`};function applyAccessibility(e,t,n){for(let[r,i]of Object.entries(t.accessibility??{}))e[D[r]]=String(translated(n.translate,i.value,i.translatable))}function buildValue(e,t,n,r){if(e.id!==void 0&&r.values===void 0)throw Error(`<${t.xmlName} id="${e.id}"> reaches nothing: \`${e.tag}\` is not a view, and \`getViewById\` walks views, so code beside the \`.blp\` could never look it up. \`buildWithSiblings\` hands every object back by id.`);if(e.styleClasses!==void 0&&e.styleClasses.length>0)throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` is not a widget, so [${e.styleClasses.join(`, `)}] would be dropped.`);if(e.accessibility!==void 0)throw Error(`<${t.xmlName}> takes no accessibility: \`${e.tag}\` is not a widget, so ${Object.keys(e.accessibility).join(`, `)} would be dropped.`);let i={};for(let[a,o]of v(e,r.menus)){let r=S(a);if(!s(n,r))throw unknownProperty(t,e.tag,a,r,a,n);i[r]=g(o)}for(let[a,o]of Object.entries(e.props??{})){if(a===`menu-model`)continue;let c=S(a);if(!s(n,c))throw unknownProperty(t,e.tag,a,c,o,n);i[c]=translated(r.translate,o,e.translatable?.[a])}let a=e.extensions?.strings;if(a!==void 0){if(typeof n.append!=`function`)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` has no \`append\`, so [${a.map(e=>e.value).join(`, `)}] would be dropped.`);i.strings=a.map(e=>String(translated(r.translate,e.value,e.translatable)))}let o=new t.ctor(i);if(applyResponses(o,t,e,r),e.id!==void 0&&r.values!==void 0){if(r.values.has(e.id)||r.ids.has(e.id))throw Error(`Two nodes of this tree carry the id '${e.id}'; GtkBuilder refuses a duplicate id.`);r.values.set(e.id,o)}return o}function applyResponses(e,t,n,r){let i=e,a=n.extensions?.responses;if(a!==void 0){if(typeof i.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${a.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:o,translatable:s}of a)i.add_response(e,String(translated(r.translate,t,s)),{...n===void 0?{}:{appearance:n},...o===void 0?{}:{enabled:o}})}}function builderNameFor(e,t,n){let r=elementOf(n);if(n.slot===void 0)return r.xmlName;let i=n.slot,o=a(e.ctor);if(o===null||!o.includes(i))throw Error(`<${e.xmlName}.${i}> reaches nothing: \`${t}\` declares no such builder slot, so NativeScript would hand <${r.xmlName}> to its fallback placement instead — at exit 0, in a cell the tree never asked for. Known slots: ${o===null||o.length===0?`none`:o.join(`, `)}.`);return i}export{applyBreakpoints,build,buildDialog,buildInto,buildWithSiblings,elementFor,registerBarrel,f as registerTemplateClass};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{AdwBreakpoint as ee,addBreakpoints as te,evaluateBreakpointCondition as ne,observeViewSize as e,observeWindowSize as t,parseBreakpointCondition as n}from"./widgets/breakpoint.js";import{ENGINE_TARGET as r}from"./engine-target.js";import{GTK_ALIGN as i}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as a,GTK_ICON_SIZE_NICKS as o,GTK_ICON_SIZE_PIXELS as s,PIXEL_SIZE_UNSET as c,isGtkIconSizeNick as l}from"./widgets/gtk-icon-size.js";import{applyConstructProps as u,nsAlignment as d}from"./widgets/construct-props.js";import{activateWidgetAction as f,findActionGroup as p,insertActionGroup as m}from"./widgets/actions.js";import{NOTIFY_HEXPAND as h,NOTIFY_VEXPAND as g,withGtkWidgetLayout as _}from"./widgets/widget-layout.js";import{adwaitaColorScheme as v,isThemeIconColor as y,onAdwaitaColorSchemeChanged as b,setAdwaitaColorScheme as x,themeIconColor as S,toggleAdwaitaColorScheme as C}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as w,DEFAULT_ICON_COLOR as T,DEFAULT_ICON_COLOR_DARK as E,extractIconPaths as D,extractPathData as O}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as k,compiledIconNames as A,iconValueKind as j,isIconAvailable as M,resolveIconSource as N}from"./widgets/icon-theme.js";import{renderSymbolicIcon as P}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as F}from"./widgets/gtk-image.js";import{CLOSED as I}from"./widgets/adw-about-dialog.js";import{ACTIVATED as L}from"./widgets/adw-action-row.js";import{AdwAlertResponses as R}from"./widgets/adw-alert-dialog.js";import{NOTIFY_OPEN as z}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as B}from"./widgets/row-press.js";import{bottomSheetPanel as V}from"./widgets/adw-bottom-sheet.js";import{avatarInitials as H}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as U}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as W}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as G,DEFAULT_SPINNER_SIZE as K}from"./widgets/chrome.js";import{BUTTON_CLICKED as q}from"./widgets/adw-banner.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as J}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as Y}from"./widgets/adw-carousel.js";import{ComboState as X,NOTIFY_SELECTED as Z}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as re,ADW_DIALOG_CLOSE_ATTEMPT as ie}from"./widgets/adw-dialog.js";import{AdwImageButton as ae,DEFAULT_ICON_BUTTON_ICON_SIZE as oe}from"./widgets/adw-image-button.js";import{NOTIFY_ACTIVATES_DEFAULT as se,NOTIFY_EDITABLE as ce,NOTIFY_MAX_LENGTH as le,NOTIFY_SHOW_APPLY_BUTTON as ue,NOTIFY_TEXT as de,NOTIFY_TEXT_LENGTH as fe,SIGNAL_APPLY as pe,SIGNAL_ENTRY_ACTIVATED as me}from"./widgets/adw-entry-row.js";import{NOTIFY_ENABLE_EXPANSION as he,NOTIFY_EXPANDED as ge,NOTIFY_SHOW_ENABLE_SWITCH as _e,NS_EXPANDER_ARROW_DISABLED_OPACITY as ve}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as ye}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as be,NOTIFY_SELECTED as xe}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as Se,NsOverlaySplitViewState as Ce,splitViewColumns as we}from"./widgets/split-view-state.js";import{AdwSplitViewBase as Te,NOTIFY_SHOW_SIDEBAR as Ee}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as De}from"./widgets/navigation-stack.js";import{CLOSED as Oe}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ke,SHORTCUT_LABEL_CLASS as Ae,SHORTCUT_LABEL_DIMMED_CLASS as je,SHORTCUT_LABEL_DISABLED_CLASS as Me,SHORTCUT_LABEL_KEYCAP_CLASS as Ne,SHORTCUT_LABEL_KEYS_CLASS as Pe,SHORTCUT_LABEL_SIDE_CLASS as Fe,SHORTCUT_LABEL_SPACED_CLASS as Ie,shortcutLabelDirection as Le,shortcutLabelPlatform as Re,shortcutLabelRenderPlan as ze}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Q}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Be,SpinState as Ve}from"./widgets/adw-spin-row.js";import{MENU_TAPPED as He}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Ue}from"./widgets/adw-switch-row.js";import{AdwToast as We,AdwToastQueue as Ge,DEFAULT_TOAST_TIMEOUT as Ke}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as qe,ToggleGroupState as Je}from"./widgets/adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ye,adwaitaNsAccentColor as Xe,adwaitaNsAccentCss as Ze}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Qe,clearAdwaitaNsAccent as $e}from"./widgets/adw-accent.js";import{adw_exports as et}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as tt,boxChildTrack as nt,boxSpacingChanges as rt,boxTrackPlan as it,normalizeBoxSpacing as at}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as ot,buttonSlotDetaches as st}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as ct,GTK_BUTTON_LABEL_CLASS as lt}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ut}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as dt,GTK_CHECK_BUTTON_CHECKED_CLASS as ft,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as pt,GTK_CHECK_BUTTON_TOGGLED as mt,NOTIFY_CHECK_ACTIVE as ht}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as gt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as _t,NOTIFY_TEXT as vt}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as yt,LIST_BOX_ROW_SELECTED as bt}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as xt}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as St}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as Ct,NOTIFY_STACK_VISIBLE_CHILD_NAME as wt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as Tt,NOTIFY_TEXT_VIEW_TEXT as Et}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as Dt,GTK_TOGGLE_BUTTON_TOGGLED as Ot,NOTIFY_TOGGLE_ACTIVE as kt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as At}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as jt,ADWAITA_SANS_TTF_FILES as Mt,adwaitaFontInstallInstructions as Nt,hasAdwaitaSans as Pt}from"./fonts.js";import{AdwSliderRow as Ft,NOTIFY_SLIDER_VALUE as It}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Lt,DATA_GRID_HEADER_ROW_CLASS as Rt,DATA_GRID_SECTION_CELL_CLASS as zt,dataGridCellClass as Bt,dataGridItemSpec as Vt,dataGridRowClass as Ht,dataGridShapeKey as Ut,dataGridTracksKey as Wt,parseDataGridWidth as Gt}from"./widgets/data-grid-model.js";import{AdwDataGrid as Kt,ROW_ACTIVATED as qt}from"./widgets/adw-data-grid.js";import{padForSystemInsets as Jt,padSheetForSystemInsets as Yt}from"./widgets/system-insets.js";import{labelDisplayText as Xt,labelMarkupIsUnparseable as Zt,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as Qt}from"./namespace/gio.js";import{gdk_exports as $t}from"./namespace/gdk.js";import{graphene_exports as en}from"./namespace/graphene.js";import{glib_exports as tn}from"./namespace/glib.js";import{assertNativeScript as nn,assertNativeScript as rn,isAndroid as an,isIOS as on,isNativeScript as sn}from"@gjsify/native-platform";function registerAdwaita(){rn(),$()}export{I as ABOUT_CLOSED,L as ACTIVATED,w as ADWAITA_ICON_GRID,Ye as ADWAITA_NS_ACCENT_RULES,jt as ADWAITA_SANS_FONT_FAMILY,Mt as ADWAITA_SANS_TTF_FILES,re as ADW_DIALOG_CLOSED,ie as ADW_DIALOG_CLOSE_ATTEMPT,U as AVATAR_DEFAULT_ICON,et as Adw,R as AdwAlertResponses,ee as AdwBreakpoint,Kt as AdwDataGrid,ae as AdwImageButton,Ft as AdwSliderRow,Te as AdwSplitViewBase,We as AdwToast,Ge as AdwToastQueue,be as AdwViewSwitcherBase,q as BUTTON_CLICKED,X as ComboState,Lt as DATA_GRID_HEADER_CELL_CLASS,Rt as DATA_GRID_HEADER_ROW_CLASS,zt as DATA_GRID_SECTION_CELL_CLASS,W as DEFAULT_AVATAR_SIZE,tt as DEFAULT_BOX_SPACING,J as DEFAULT_CAROUSEL_PAGE_WIDTH,G as DEFAULT_CLAMP_MAX_SIZE,F as DEFAULT_GTK_IMAGE_SIZE,oe as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,a as DEFAULT_ICON_PIXEL_SIZE,K as DEFAULT_SPINNER_SIZE,Ke as DEFAULT_TOAST_TIMEOUT,gt as DRAWING_AREA_REFUSAL,r as ENGINE_TARGET,_t as ENTRY_ACTIVATE,tn as GLib,i as GTK_ALIGN,ct as GTK_BUTTON_CLICKED,lt as GTK_BUTTON_LABEL_CLASS,dt as GTK_CHECK_BUTTON_ACTIVATE,ft as GTK_CHECK_BUTTON_CHECKED_CLASS,pt as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,mt as GTK_CHECK_BUTTON_TOGGLED,o as GTK_ICON_SIZE_NICKS,s as GTK_ICON_SIZE_PIXELS,Dt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,Ot as GTK_TOGGLE_BUTTON_TOGGLED,Tt as GTK_WRAP_MODES,$t as Gdk,Qt as Gio,en as Graphene,At as Gtk,k as ICON_FALLBACK_NAME,yt as LIST_BOX_ROW_ACTIVATED,bt as LIST_BOX_ROW_SELECTED,xt as MENU_ITEM_ACTIVATED,He as MENU_TAPPED,se as NOTIFY_ACTIVATES_DEFAULT,Ue as NOTIFY_ACTIVE,ht as NOTIFY_CHECK_ACTIVE,ut as NOTIFY_DROP_DOWN_SELECTED,ce as NOTIFY_EDITABLE,he as NOTIFY_ENABLE_EXPANSION,vt as NOTIFY_ENTRY_TEXT,ge as NOTIFY_EXPANDED,h as NOTIFY_HEXPAND,le as NOTIFY_MAX_LENGTH,z as NOTIFY_OPEN,Y as NOTIFY_POSITION,St as NOTIFY_REVEAL_CHILD,Z as NOTIFY_SELECTED,ue as NOTIFY_SHOW_APPLY_BUTTON,_e as NOTIFY_SHOW_ENABLE_SWITCH,Ee as NOTIFY_SHOW_SIDEBAR,Q as NOTIFY_SIDEBAR_SELECTED,It as NOTIFY_SLIDER_VALUE,Ct as NOTIFY_STACK_VISIBLE_CHILD,wt as NOTIFY_STACK_VISIBLE_CHILD_NAME,de as NOTIFY_TEXT,fe as NOTIFY_TEXT_LENGTH,Et as NOTIFY_TEXT_VIEW_TEXT,kt as NOTIFY_TOGGLE_ACTIVE,qe as NOTIFY_TOGGLE_SELECTED,Be as NOTIFY_VALUE,g as NOTIFY_VEXPAND,xe as NOTIFY_VIEW_SELECTED,ye as NOTIFY_VISIBLE_CHILD,De as NOTIFY_VISIBLE_PAGE,ve as NS_EXPANDER_ARROW_DISABLED_OPACITY,Se as NsNavigationSplitViewState,Ce as NsOverlaySplitViewState,c as PIXEL_SIZE_UNSET,Oe as PREFERENCES_CLOSED,qt as ROW_ACTIVATED,ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,Ae as SHORTCUT_LABEL_CLASS,je as SHORTCUT_LABEL_DIMMED_CLASS,Me as SHORTCUT_LABEL_DISABLED_CLASS,Ne as SHORTCUT_LABEL_KEYCAP_CLASS,Pe as SHORTCUT_LABEL_KEYS_CLASS,Fe as SHORTCUT_LABEL_SIDE_CLASS,Ie as SHORTCUT_LABEL_SPACED_CLASS,pe as SIGNAL_APPLY,me as SIGNAL_ENTRY_ACTIVATED,Ve as SpinState,Je as ToggleGroupState,f as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,Nt as adwaitaFontInstallInstructions,Xe as adwaitaNsAccentColor,Ze as adwaitaNsAccentCss,Qe as applyAdwaitaNsAccent,u as applyConstructProps,nn as assertNativeScript,B as attachRowPressFeedback,H as avatarInitials,V as bottomSheetPanel,nt as boxChildTrack,rt as boxSpacingChanges,it as boxTrackPlan,ot as buttonSlotAfterWrite,st as buttonSlotDetaches,$e as clearAdwaitaNsAccent,A as compiledIconNames,Bt as dataGridCellClass,Vt as dataGridItemSpec,Ht as dataGridRowClass,Ut as dataGridShapeKey,Wt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,p as findActionGroup,Pt as hasAdwaitaSans,j as iconValueKind,m as insertActionGroup,an as isAndroid,l as isGtkIconSizeNick,on as isIOS,M as isIconAvailable,sn as isNativeScript,y as isThemeIconColor,Xt as labelDisplayText,Zt as labelMarkupIsUnparseable,at as normalizeBoxSpacing,d as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,Jt as padForSystemInsets,Yt as padSheetForSystemInsets,n as parseBreakpointCondition,Gt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,P as renderSymbolicIcon,N as resolveIconSource,x as setAdwaitaColorScheme,Le as shortcutLabelDirection,Re as shortcutLabelPlatform,ze as shortcutLabelRenderPlan,we as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,_ as withGtkWidgetLayout};
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{AdwBreakpoint as ee,addBreakpoints as te,evaluateBreakpointCondition as ne,observeViewSize as e,observeWindowSize as t,parseBreakpointCondition as n}from"./widgets/breakpoint.js";import{ENGINE_TARGET as r}from"./engine-target.js";import{GTK_ALIGN as i}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as a,GTK_ICON_SIZE_NICKS as o,GTK_ICON_SIZE_PIXELS as s,PIXEL_SIZE_UNSET as c,isGtkIconSizeNick as l}from"./widgets/gtk-icon-size.js";import{applyConstructProps as u,nsAlignment as d}from"./widgets/construct-props.js";import{activateWidgetAction as f,findActionGroup as p,insertActionGroup as m}from"./widgets/actions.js";import{NOTIFY_HEXPAND as h,NOTIFY_VEXPAND as g,withGtkWidgetLayout as _}from"./widgets/widget-layout.js";import{adwaitaColorScheme as v,isThemeIconColor as y,onAdwaitaColorSchemeChanged as b,setAdwaitaColorScheme as x,themeIconColor as S,toggleAdwaitaColorScheme as C}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as w,DEFAULT_ICON_COLOR as T,DEFAULT_ICON_COLOR_DARK as E,extractIconPaths as D,extractPathData as O}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as k,compiledIconNames as A,iconValueKind as j,isIconAvailable as M,resolveIconSource as N}from"./widgets/icon-theme.js";import{renderSymbolicIcon as P}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as F}from"./widgets/gtk-image.js";import{CLOSED as I}from"./widgets/adw-about-dialog.js";import{ACTIVATED as L}from"./widgets/adw-action-row.js";import{AdwAlertResponses as R}from"./widgets/adw-alert-dialog.js";import{NOTIFY_OPEN as z}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as B}from"./widgets/row-press.js";import{bottomSheetPanel as V}from"./widgets/adw-bottom-sheet.js";import{avatarInitials as H}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as U}from"./widgets/avatar-view.js";import{DEFAULT_AVATAR_SIZE as W}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as G,DEFAULT_SPINNER_SIZE as K}from"./widgets/chrome.js";import{BUTTON_CLICKED as q}from"./widgets/adw-banner.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as J}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as Y}from"./widgets/adw-carousel.js";import{ComboState as X,NOTIFY_SELECTED as Z}from"./widgets/adw-combo-row.js";import{ADW_DIALOG_CLOSED as re,ADW_DIALOG_CLOSE_ATTEMPT as ie}from"./widgets/adw-dialog.js";import{AdwImageButton as ae,DEFAULT_ICON_BUTTON_ICON_SIZE as oe}from"./widgets/adw-image-button.js";import{NOTIFY_ACTIVATES_DEFAULT as se,NOTIFY_EDITABLE as ce,NOTIFY_MAX_LENGTH as le,NOTIFY_SHOW_APPLY_BUTTON as ue,NOTIFY_TEXT as de,NOTIFY_TEXT_LENGTH as fe,SIGNAL_APPLY as pe,SIGNAL_ENTRY_ACTIVATED as me}from"./widgets/adw-entry-row.js";import{NOTIFY_ENABLE_EXPANSION as he,NOTIFY_EXPANDED as ge,NOTIFY_SHOW_ENABLE_SWITCH as _e,NS_EXPANDER_ARROW_DISABLED_OPACITY as ve}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as ye}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as be,NOTIFY_SELECTED as xe}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as Se,NsOverlaySplitViewState as Ce,splitViewColumns as we}from"./widgets/split-view-state.js";import{AdwSplitViewBase as Te,NOTIFY_SHOW_SIDEBAR as Ee}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as De}from"./widgets/navigation-stack.js";import{CLOSED as Oe}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ke,SHORTCUT_LABEL_CLASS as Ae,SHORTCUT_LABEL_DIMMED_CLASS as je,SHORTCUT_LABEL_DISABLED_CLASS as Me,SHORTCUT_LABEL_KEYCAP_CLASS as Ne,SHORTCUT_LABEL_KEYS_CLASS as Pe,SHORTCUT_LABEL_SIDE_CLASS as Fe,SHORTCUT_LABEL_SPACED_CLASS as Ie,shortcutLabelDirection as Le,shortcutLabelPlatform as Re,shortcutLabelRenderPlan as ze}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as Be}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Ve,SpinState as He}from"./widgets/adw-spin-row.js";import{MENU_TAPPED as Ue}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Q}from"./widgets/adw-switch-row.js";import{AdwToast as We,AdwToastQueue as Ge,DEFAULT_TOAST_TIMEOUT as Ke}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as qe,ToggleGroupState as Je}from"./widgets/adw-toggle-group.js";import{ADWAITA_NS_ACCENT_RULES as Ye,adwaitaNsAccentColor as Xe,adwaitaNsAccentCss as Ze}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as Qe,clearAdwaitaNsAccent as $e}from"./widgets/adw-accent.js";import{adw_exports as et}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as tt,boxChildTrack as nt,boxSpacingChanges as rt,boxTrackPlan as it,normalizeBoxSpacing as at}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as ot,buttonSlotDetaches as st}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as ct,GTK_BUTTON_LABEL_CLASS as lt}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ut}from"./widgets/gtk-drop-down.js";import{GTK_CHECK_BUTTON_ACTIVATE as dt,GTK_CHECK_BUTTON_CHECKED_CLASS as ft,GTK_CHECK_BUTTON_INCONSISTENT_CLASS as pt,GTK_CHECK_BUTTON_TOGGLED as mt,NOTIFY_CHECK_ACTIVE as ht}from"./widgets/gtk-check-button.js";import{DRAWING_AREA_REFUSAL as gt}from"./widgets/gtk-drawing-area.js";import{ACTIVATE as _t,CHANGED as vt,NOTIFY_EDITABLE as yt,NOTIFY_MAX_LENGTH as bt,NOTIFY_PLACEHOLDER_TEXT as xt,NOTIFY_TEXT as St,NOTIFY_TEXT_LENGTH as Ct}from"./widgets/gtk-entry.js";import{LIST_BOX_ROW_ACTIVATED as wt,LIST_BOX_ROW_SELECTED as Tt}from"./widgets/gtk-list-box.js";import{MENU_ITEM_ACTIVATED as Et}from"./widgets/gtk-menu-button.js";import{NOTIFY_REVEAL_CHILD as Dt}from"./widgets/gtk-revealer.js";import{NOTIFY_STACK_VISIBLE_CHILD as Ot,NOTIFY_STACK_VISIBLE_CHILD_NAME as kt}from"./widgets/gtk-stack.js";import{GTK_WRAP_MODES as At,NOTIFY_TEXT_VIEW_TEXT as jt}from"./widgets/gtk-text-view.js";import{GTK_TOGGLE_BUTTON_CHECKED_CLASS as Mt,GTK_TOGGLE_BUTTON_TOGGLED as Nt,NOTIFY_TOGGLE_ACTIVE as Pt}from"./widgets/gtk-toggle-button.js";import{gtk_exports as Ft}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as It,ADWAITA_SANS_TTF_FILES as Lt,adwaitaFontInstallInstructions as Rt,hasAdwaitaSans as zt}from"./fonts.js";import{AdwSliderRow as Bt,NOTIFY_SLIDER_VALUE as Vt}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Ht,DATA_GRID_HEADER_ROW_CLASS as Ut,DATA_GRID_SECTION_CELL_CLASS as Wt,dataGridCellClass as Gt,dataGridItemSpec as Kt,dataGridRowClass as qt,dataGridShapeKey as Jt,dataGridTracksKey as Yt,parseDataGridWidth as Xt}from"./widgets/data-grid-model.js";import{AdwDataGrid as Zt,ROW_ACTIVATED as Qt}from"./widgets/adw-data-grid.js";import{padForSystemInsets as $t,padSheetForSystemInsets as en}from"./widgets/system-insets.js";import{labelDisplayText as tn,labelMarkupIsUnparseable as nn,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as rn}from"./namespace/gio.js";import{gdk_exports as an}from"./namespace/gdk.js";import{graphene_exports as on}from"./namespace/graphene.js";import{glib_exports as sn}from"./namespace/glib.js";import{buildMenu as cn,menuTree as ln,watchMenuModel as un}from"@gjsify/adwaita-core";import{assertNativeScript as dn,assertNativeScript as fn,isAndroid as pn,isIOS as mn,isNativeScript as hn}from"@gjsify/native-platform";function registerAdwaita(){fn(),$()}export{I as ABOUT_CLOSED,L as ACTIVATED,w as ADWAITA_ICON_GRID,Ye as ADWAITA_NS_ACCENT_RULES,It as ADWAITA_SANS_FONT_FAMILY,Lt as ADWAITA_SANS_TTF_FILES,re as ADW_DIALOG_CLOSED,ie as ADW_DIALOG_CLOSE_ATTEMPT,U as AVATAR_DEFAULT_ICON,et as Adw,R as AdwAlertResponses,ee as AdwBreakpoint,Zt as AdwDataGrid,ae as AdwImageButton,Bt as AdwSliderRow,Te as AdwSplitViewBase,We as AdwToast,Ge as AdwToastQueue,be as AdwViewSwitcherBase,q as BUTTON_CLICKED,X as ComboState,Ht as DATA_GRID_HEADER_CELL_CLASS,Ut as DATA_GRID_HEADER_ROW_CLASS,Wt as DATA_GRID_SECTION_CELL_CLASS,W as DEFAULT_AVATAR_SIZE,tt as DEFAULT_BOX_SPACING,J as DEFAULT_CAROUSEL_PAGE_WIDTH,G as DEFAULT_CLAMP_MAX_SIZE,F as DEFAULT_GTK_IMAGE_SIZE,oe as DEFAULT_ICON_BUTTON_ICON_SIZE,T as DEFAULT_ICON_COLOR,E as DEFAULT_ICON_COLOR_DARK,a as DEFAULT_ICON_PIXEL_SIZE,K as DEFAULT_SPINNER_SIZE,Ke as DEFAULT_TOAST_TIMEOUT,gt as DRAWING_AREA_REFUSAL,r as ENGINE_TARGET,_t as ENTRY_ACTIVATE,vt as ENTRY_CHANGED,sn as GLib,i as GTK_ALIGN,ct as GTK_BUTTON_CLICKED,lt as GTK_BUTTON_LABEL_CLASS,dt as GTK_CHECK_BUTTON_ACTIVATE,ft as GTK_CHECK_BUTTON_CHECKED_CLASS,pt as GTK_CHECK_BUTTON_INCONSISTENT_CLASS,mt as GTK_CHECK_BUTTON_TOGGLED,o as GTK_ICON_SIZE_NICKS,s as GTK_ICON_SIZE_PIXELS,Mt as GTK_TOGGLE_BUTTON_CHECKED_CLASS,Nt as GTK_TOGGLE_BUTTON_TOGGLED,At as GTK_WRAP_MODES,an as Gdk,rn as Gio,on as Graphene,Ft as Gtk,k as ICON_FALLBACK_NAME,wt as LIST_BOX_ROW_ACTIVATED,Tt as LIST_BOX_ROW_SELECTED,Et as MENU_ITEM_ACTIVATED,Ue as MENU_TAPPED,se as NOTIFY_ACTIVATES_DEFAULT,Q as NOTIFY_ACTIVE,ht as NOTIFY_CHECK_ACTIVE,ut as NOTIFY_DROP_DOWN_SELECTED,ce as NOTIFY_EDITABLE,he as NOTIFY_ENABLE_EXPANSION,yt as NOTIFY_ENTRY_EDITABLE,bt as NOTIFY_ENTRY_MAX_LENGTH,St as NOTIFY_ENTRY_TEXT,Ct as NOTIFY_ENTRY_TEXT_LENGTH,ge as NOTIFY_EXPANDED,h as NOTIFY_HEXPAND,le as NOTIFY_MAX_LENGTH,z as NOTIFY_OPEN,xt as NOTIFY_PLACEHOLDER_TEXT,Y as NOTIFY_POSITION,Dt as NOTIFY_REVEAL_CHILD,Z as NOTIFY_SELECTED,ue as NOTIFY_SHOW_APPLY_BUTTON,_e as NOTIFY_SHOW_ENABLE_SWITCH,Ee as NOTIFY_SHOW_SIDEBAR,Be as NOTIFY_SIDEBAR_SELECTED,Vt as NOTIFY_SLIDER_VALUE,Ot as NOTIFY_STACK_VISIBLE_CHILD,kt as NOTIFY_STACK_VISIBLE_CHILD_NAME,de as NOTIFY_TEXT,fe as NOTIFY_TEXT_LENGTH,jt as NOTIFY_TEXT_VIEW_TEXT,Pt as NOTIFY_TOGGLE_ACTIVE,qe as NOTIFY_TOGGLE_SELECTED,Ve as NOTIFY_VALUE,g as NOTIFY_VEXPAND,xe as NOTIFY_VIEW_SELECTED,ye as NOTIFY_VISIBLE_CHILD,De as NOTIFY_VISIBLE_PAGE,ve as NS_EXPANDER_ARROW_DISABLED_OPACITY,Se as NsNavigationSplitViewState,Ce as NsOverlaySplitViewState,c as PIXEL_SIZE_UNSET,Oe as PREFERENCES_CLOSED,Qt as ROW_ACTIVATED,ke as SHORTCUT_LABEL_CAP_TEXT_CLASS,Ae as SHORTCUT_LABEL_CLASS,je as SHORTCUT_LABEL_DIMMED_CLASS,Me as SHORTCUT_LABEL_DISABLED_CLASS,Ne as SHORTCUT_LABEL_KEYCAP_CLASS,Pe as SHORTCUT_LABEL_KEYS_CLASS,Fe as SHORTCUT_LABEL_SIDE_CLASS,Ie as SHORTCUT_LABEL_SPACED_CLASS,pe as SIGNAL_APPLY,me as SIGNAL_ENTRY_ACTIVATED,He as SpinState,Je as ToggleGroupState,f as activateWidgetAction,te as addBreakpoints,v as adwaitaColorScheme,Rt as adwaitaFontInstallInstructions,Xe as adwaitaNsAccentColor,Ze as adwaitaNsAccentCss,Qe as applyAdwaitaNsAccent,u as applyConstructProps,dn as assertNativeScript,B as attachRowPressFeedback,H as avatarInitials,V as bottomSheetPanel,nt as boxChildTrack,rt as boxSpacingChanges,it as boxTrackPlan,cn as buildMenu,ot as buttonSlotAfterWrite,st as buttonSlotDetaches,$e as clearAdwaitaNsAccent,A as compiledIconNames,Gt as dataGridCellClass,Kt as dataGridItemSpec,qt as dataGridRowClass,Jt as dataGridShapeKey,Yt as dataGridTracksKey,ne as evaluateBreakpointCondition,D as extractIconPaths,O as extractPathData,p as findActionGroup,zt as hasAdwaitaSans,j as iconValueKind,m as insertActionGroup,pn as isAndroid,l as isGtkIconSizeNick,mn as isIOS,M as isIconAvailable,hn as isNativeScript,y as isThemeIconColor,tn as labelDisplayText,nn as labelMarkupIsUnparseable,ln as menuTree,at as normalizeBoxSpacing,d as nsAlignment,e as observeViewSize,t as observeWindowSize,b as onAdwaitaColorSchemeChanged,$t as padForSystemInsets,en as padSheetForSystemInsets,n as parseBreakpointCondition,Xt as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,P as renderSymbolicIcon,N as resolveIconSource,x as setAdwaitaColorScheme,Le as shortcutLabelDirection,Re as shortcutLabelPlatform,ze as shortcutLabelRenderPlan,we as splitViewColumns,S as themeIconColor,C as toggleAdwaitaColorScheme,un as watchMenuModel,_ as withGtkWidgetLayout};
|
package/lib/esm/namespace/gio.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{SimpleAction as t,SimpleActionGroup as n}from"../widgets/actions.js";import{nativePlatformHost as r}from"../platform-host.js";import{GioApplication as i}from"../widgets/application.js";import"../file-chooser-host.js";import{ApplicationFlags as a,FileCreateFlags as o,GioFile as s,GioFileOutputStream as c,GioListStore as l,GioMenu as u,
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{SimpleAction as t,SimpleActionGroup as n}from"../widgets/actions.js";import{nativePlatformHost as r}from"../platform-host.js";import{GioApplication as i}from"../widgets/application.js";import"../file-chooser-host.js";import{ApplicationFlags as a,FileCreateFlags as o,GioFile as s,GioFileOutputStream as c,GioListStore as l,GioMenu as u,GioMenuAttributeIter as d,GioMenuItem as f,GioMenuLinkIter as p,GioMenuModel as m,GioOutputStream as h,GioResource as g,IOErrorEnum as _,ListModel as v,MENU_ATTRIBUTE_ACTION as y,MENU_ATTRIBUTE_ACTION_NAMESPACE as b,MENU_ATTRIBUTE_ICON as x,MENU_ATTRIBUTE_LABEL as S,MENU_ATTRIBUTE_TARGET as C,MENU_EXPORTER_MAX_SECTION_SIZE as w,MENU_LINK_SECTION as T,MENU_LINK_SUBMENU as E,ResourceError as D,ResourceLookupFlags as O,createAppInfo as k,promisify as A,resources_enumerate_children as j,resources_get_info as M,resources_lookup_data as N,resources_register as P,resources_unregister as F}from"@gjsify/adwaita-core";import{Settings as I}from"@gjsify/app-settings/nativescript";var L=e({AppInfo:()=>R,Application:()=>i,ApplicationFlags:()=>a,File:()=>s,FileCreateFlags:()=>o,FileOutputStream:()=>c,IOErrorEnum:()=>_,ListModel:()=>v,ListStore:()=>l,MENU_ATTRIBUTE_ACTION:()=>y,MENU_ATTRIBUTE_ACTION_NAMESPACE:()=>b,MENU_ATTRIBUTE_ICON:()=>x,MENU_ATTRIBUTE_LABEL:()=>S,MENU_ATTRIBUTE_TARGET:()=>C,MENU_EXPORTER_MAX_SECTION_SIZE:()=>w,MENU_LINK_SECTION:()=>T,MENU_LINK_SUBMENU:()=>E,Menu:()=>u,MenuAttributeIter:()=>d,MenuItem:()=>f,MenuLinkIter:()=>p,MenuModel:()=>m,OutputStream:()=>h,Resource:()=>g,ResourceError:()=>D,ResourceLookupFlags:()=>O,Settings:()=>I,SimpleAction:()=>t,SimpleActionGroup:()=>n,_promisify:()=>A,resources_enumerate_children:()=>j,resources_get_info:()=>M,resources_lookup_data:()=>N,resources_register:()=>P,resources_unregister:()=>F});const R=k(r);export{R as AppInfo,i as Application,a as ApplicationFlags,s as File,o as FileCreateFlags,c as FileOutputStream,_ as IOErrorEnum,v as ListModel,l as ListStore,y as MENU_ATTRIBUTE_ACTION,b as MENU_ATTRIBUTE_ACTION_NAMESPACE,x as MENU_ATTRIBUTE_ICON,S as MENU_ATTRIBUTE_LABEL,C as MENU_ATTRIBUTE_TARGET,w as MENU_EXPORTER_MAX_SECTION_SIZE,T as MENU_LINK_SECTION,E as MENU_LINK_SUBMENU,u as Menu,d as MenuAttributeIter,f as MenuItem,p as MenuLinkIter,m as MenuModel,h as OutputStream,g as Resource,D as ResourceError,O as ResourceLookupFlags,I as Settings,t as SimpleAction,n as SimpleActionGroup,A as _promisify,L as gio_exports,j as resources_enumerate_children,M as resources_get_info,N as resources_lookup_data,P as resources_register,F as resources_unregister};
|
package/lib/esm/namespace/gtk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{CssProvider as t,EventControllerKey as n,IconTheme as r,Settings as i,StyleContext as a,show_uri as o}from"./gtk-platform.js";import{GtkImage as s}from"../widgets/gtk-image.js";import{
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{CssProvider as t,EventControllerKey as n,IconTheme as r,Settings as i,StyleContext as a,show_uri as o}from"./gtk-platform.js";import{GtkImage as s}from"../widgets/gtk-image.js";import{GtkLabel as c}from"../widgets/gtk-label.js";import{GtkApplication as l}from"../widgets/application.js";import{GtkWindow as u}from"../widgets/gtk-window.js";import{ArrowType as d,License as f,PolicyType as p,TextDirection as m,TextExtendSelection as h,TextWindowType as g}from"../widgets/gtk-enums.js";import{GtkActionBar as _}from"../widgets/gtk-action-bar.js";import{GtkBox as v}from"../widgets/gtk-box.js";import{GtkButton as y}from"../widgets/gtk-button.js";import{GtkDropDown as b}from"../widgets/gtk-drop-down.js";import{GtkCheckButton as x}from"../widgets/gtk-check-button.js";import{GtkDrawingArea as S}from"../widgets/gtk-drawing-area.js";import{GtkEntry as C}from"../widgets/gtk-entry.js";import{GtkGrid as w}from"../widgets/gtk-grid.js";import{GtkFrame as T}from"../widgets/gtk-frame.js";import{GtkListBox as E}from"../widgets/gtk-list-box.js";import{GtkMenuButton as D}from"../widgets/gtk-menu-button.js";import{GtkPopoverMenu as O}from"../widgets/gtk-popover-menu.js";import{GtkOverlay as k}from"../widgets/gtk-overlay.js";import{GtkRevealer as A}from"../widgets/gtk-revealer.js";import{GtkScrolledWindow as j}from"../widgets/gtk-scrolled-window.js";import{GtkApplicationWindow as M}from"../widgets/gtk-application-window.js";import{GtkSeparator as N}from"../widgets/gtk-separator.js";import{GtkStackPage as P}from"../widgets/stack-page.js";import{GtkStack as F}from"../widgets/gtk-stack.js";import{GtkTextView as I}from"../widgets/gtk-text-view.js";import{GtkToggleButton as L}from"../widgets/gtk-toggle-button.js";import{ApplicationInhibitFlags as R,DialogError as z,GtkAdjustment as B,GtkFileDialog as V,GtkFileFilter as H,GtkStringList as U,GtkStringObject as W,STYLE_PROVIDER_PRIORITY_APPLICATION as G,STYLE_PROVIDER_PRIORITY_FALLBACK as K,STYLE_PROVIDER_PRIORITY_SETTINGS as q,STYLE_PROVIDER_PRIORITY_THEME as J,STYLE_PROVIDER_PRIORITY_USER as Y}from"@gjsify/adwaita-core";var X=e({ActionBar:()=>_,Adjustment:()=>B,Application:()=>l,ApplicationInhibitFlags:()=>R,ApplicationWindow:()=>M,ArrowType:()=>d,Box:()=>v,Button:()=>y,CheckButton:()=>x,CssProvider:()=>t,DialogError:()=>z,DrawingArea:()=>S,DropDown:()=>b,Entry:()=>C,EventControllerKey:()=>n,FileDialog:()=>V,FileFilter:()=>H,Frame:()=>T,Grid:()=>w,IconTheme:()=>r,Image:()=>s,Label:()=>c,License:()=>f,ListBox:()=>E,MenuButton:()=>D,Overlay:()=>k,PolicyType:()=>p,PopoverMenu:()=>O,Revealer:()=>A,STYLE_PROVIDER_PRIORITY_APPLICATION:()=>G,STYLE_PROVIDER_PRIORITY_FALLBACK:()=>K,STYLE_PROVIDER_PRIORITY_SETTINGS:()=>q,STYLE_PROVIDER_PRIORITY_THEME:()=>J,STYLE_PROVIDER_PRIORITY_USER:()=>Y,ScrolledWindow:()=>j,Separator:()=>N,Settings:()=>i,Stack:()=>F,StackPage:()=>P,StringList:()=>U,StringObject:()=>W,StyleContext:()=>a,TextDirection:()=>m,TextExtendSelection:()=>h,TextView:()=>I,TextWindowType:()=>g,ToggleButton:()=>L,Window:()=>u,show_uri:()=>o});export{_ as ActionBar,B as Adjustment,l as Application,R as ApplicationInhibitFlags,M as ApplicationWindow,d as ArrowType,v as Box,y as Button,x as CheckButton,t as CssProvider,z as DialogError,S as DrawingArea,b as DropDown,C as Entry,n as EventControllerKey,V as FileDialog,H as FileFilter,T as Frame,w as Grid,r as IconTheme,s as Image,c as Label,f as License,E as ListBox,D as MenuButton,k as Overlay,p as PolicyType,O as PopoverMenu,A as Revealer,G as STYLE_PROVIDER_PRIORITY_APPLICATION,K as STYLE_PROVIDER_PRIORITY_FALLBACK,q as STYLE_PROVIDER_PRIORITY_SETTINGS,J as STYLE_PROVIDER_PRIORITY_THEME,Y as STYLE_PROVIDER_PRIORITY_USER,j as ScrolledWindow,N as Separator,i as Settings,F as Stack,P as StackPage,U as StringList,W as StringObject,a as StyleContext,m as TextDirection,h as TextExtendSelection,I as TextView,g as TextWindowType,L as ToggleButton,u as Window,X as gtk_exports,o as show_uri};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{nativeClipboardHost as i}from"../clipboard-host.js";import{nativePlatformHost as a}from"../platform-host.js";import{GtkImage as o}from"./gtk-image.js";import{applyTemplateXalign as s}from"./gtk-label.js";import{findDialogHost as c}from"./window-state.js";import{ADW_ABOUT_DIALOG_LABELS as l,ADW_LICENSE_DEFAULTS as u,HandledAccumulator as d,aboutDialogVisibility as f,acknowledgementSections as p,createAppInfo as m,creditsSections as h,flatCardShowsWebsite as g,isLicenseType as _,legalMarkupText as v,legalSections as y,legalVisible as b,licenseTypeForNick as x,refuseNewFromAppdata as S,releaseNotesBuffer as C,setLicense as w,setLicenseType as T,stripMnemonic as E}from"@gjsify/adwaita-core";import{Button as D,GridLayout as O,ItemSpec as k,Label as A,ScrollView as j,StackLayout as M}from"@nativescript/core";const N=`closed`,P=`activate-link`,F=m(a);function creditsText(e){return e.map(e=>[...e.title===null?[]:[e.title],...e.people.map(e=>e.name)].join(`
|
|
2
2
|
`)).join(`
|
|
3
3
|
|
|
4
|
-
`)}var AdwAboutDialog=class extends r(
|
|
4
|
+
`)}var AdwAboutDialog=class extends r(O){static GTypeName=`AdwAboutDialog`;_card;_appIcon;_nameLabel;_versionLabel;_developerLabel;_commentsLabel;_websiteButton;_supportButton;_issueButton;_creditsLabel;_acknowledgementsLabel;_legalLabel;_releaseNotesLabel;_linksBox;_debugInfoLabel;_copyButton;_applicationName=``;_applicationIcon=``;_developerName=``;_version=``;_comments=``;_website=``;_supportUrl=``;_issueUrl=``;_copyright=``;_licenseState={...u};_developers=[];_designers=[];_artists=[];_documenters=[];_translatorCredits=``;_releaseNotes=``;_releaseNotesVersion=``;_debugInfo=``;_links=[];_creditSections=[];_acknowledgementSections=[];_legalSections=[];_releaseNotesSegments=[];_host=null;constructor(e){super(),this.className=`adw-about-dialog`,this.visibility=`collapse`,this.addColumn(new k(1,`star`)),this.addRow(new k(1,`star`));let t=new j;t.orientation=`vertical`,t.verticalAlignment=`middle`,t.horizontalAlignment=`center`,O.setColumn(t,0),O.setRow(t,0);let r=new M;r.orientation=`vertical`,r.className=`adw-about-dialog-card`,t.content=r,this.addChild(t),this._card=r;let i=new o;i.className=`adw-icon adw-about-dialog-icon`,i.pixelSize=128,i.horizontalAlignment=`center`,r.addChild(i),this._appIcon=i,this._nameLabel=this._addCardLabel(r,`adw-about-dialog-name`),this._versionLabel=this._addCardLabel(r,`adw-about-dialog-version`),this._developerLabel=this._addCardLabel(r,`adw-about-dialog-developer`),this._commentsLabel=this._addCardLabel(r,`adw-about-dialog-comments`),s(this._commentsLabel,0),this._releaseNotesLabel=this._addCardLabel(r,`adw-about-dialog-release-notes`),this._websiteButton=this._addLinkButton(r,`adw-about-dialog-website`),this._linksBox=new M,this._linksBox.className=`adw-about-dialog-links`,r.addChild(this._linksBox),this._supportButton=this._addLinkButton(r,`adw-about-dialog-support`),this._issueButton=this._addLinkButton(r,`adw-about-dialog-issue`),this._creditsLabel=this._addCardLabel(r,`adw-about-dialog-credits`),this._acknowledgementsLabel=this._addCardLabel(r,`adw-about-dialog-acknowledgements`),this._legalLabel=this._addCardLabel(r,`adw-about-dialog-legal`),this._debugInfoLabel=this._addCardLabel(r,`adw-about-dialog-debug-info`);let a=new D;a.text=E(l.copyText),a.className=`adw-about-dialog-copy`,a.set(`androidElevation`,0),a.addEventListener(`tap`,()=>this._copyDebugInfo()),r.addChild(a),this._copyButton=a;let c=new D;c.text=`Close`,c.className=`adw-about-dialog-close`,c.set(`androidElevation`,0),c.addEventListener(`tap`,()=>this.close()),r.addChild(c),this._render(),n(this,e)}_addCardLabel(e,t){let n=new A;return n.className=t,n.horizontalAlignment=`center`,n.textWrap=!0,e.addChild(n),n}_addLinkButton(e,t){let n=new D;return n.className=`adw-about-dialog-link ${t}`,n.set(`androidElevation`,0),e.addChild(n),n}_activateLink(e){let t=new d;if(this.notify({eventName:P,object:this,uri:e,accumulator:t}),!t.stopped)try{F.launch_default_for_uri(e,null)}catch{}}_setLink(e,t,n,r){e.text=t,e.visibility=r?`visible`:`collapse`;let i=e;i._uriTap&&e.removeEventListener(`tap`,i._uriTap),i._uriTap=()=>this._activateLink(n),e.addEventListener(`tap`,i._uriTap)}get applicationName(){return this._applicationName}set applicationName(e){this._applicationName=e??``,this._render()}get applicationIcon(){return this._applicationIcon}set applicationIcon(e){this._applicationIcon=e??``,this._render()}get version(){return this._version}set version(e){this._version=e??``,this._render()}get developerName(){return this._developerName}set developerName(e){this._developerName=e??``,this._render()}get comments(){return this._comments}set comments(e){this._comments=e??``,this._render()}get website(){return this._website}set website(e){this._website=e??``,this._render()}get supportUrl(){return this._supportUrl}set supportUrl(e){this._supportUrl=e??``,this._render()}get issueUrl(){return this._issueUrl}set issueUrl(e){this._issueUrl=e??``,this._render()}get copyright(){return this._copyright}set copyright(e){this._copyright=e??``,this._render()}get license(){return this._licenseState.license}set license(e){this._licenseState=w(this._licenseState,e??``).state,this._render()}get licenseType(){return this._licenseState.licenseType}set licenseType(e){let n=(typeof e==`string`?x(e.trim()):void 0)??t(e,-1);this._licenseState=T(this._licenseState,n).state,this._render()}get developers(){return this._developers}set developers(e){this._developers=[...e??[]],this._render()}get designers(){return this._designers}set designers(e){this._designers=[...e??[]],this._render()}get artists(){return this._artists}set artists(e){this._artists=[...e??[]],this._render()}get documenters(){return this._documenters}set documenters(e){this._documenters=[...e??[]],this._render()}get translatorCredits(){return this._translatorCredits}set translatorCredits(e){this._translatorCredits=e??``,this._render()}get releaseNotes(){return this._releaseNotes}set releaseNotes(e){this._releaseNotes=e??``,this._updateReleaseNotes()}get releaseNotesVersion(){return this._releaseNotesVersion}set releaseNotesVersion(e){this._releaseNotesVersion=e??``,this._updateReleaseNotes()}get debugInfo(){return this._debugInfo}set debugInfo(e){this._debugInfo=e??``,this._render()}add_link(e,t){this._links.push({title:e,url:t}),this._render()}add_credit_section(e,t){this._creditSections.push({title:e,people:[...t]}),this._render()}add_acknowledgement_section(e,t){this._acknowledgementSections.push({title:e,people:[...t]}),this._render()}add_legal_section(e,t,n,r){_(n)&&(this._legalSections.push({title:e,copyright:t,licenseType:n,license:r}),this._render())}static new_from_appdata(e,t){S()}_updateReleaseNotes(){this._releaseNotesSegments=C({releaseNotes:this._releaseNotes,releaseNotesVersion:this._releaseNotesVersion,version:this._version},l).segments,this._render()}_render(){let e=h({developers:this._developers,designers:this._designers,artists:this._artists,documenters:this._documenters,translatorCredits:this._translatorCredits,creditSections:this._creditSections}),t=p(this._acknowledgementSections),n={copyright:this._copyright,licenseType:this._licenseState.licenseType,license:this._licenseState.license,legalSections:this._legalSections},r=f({applicationName:this._applicationName,applicationIcon:this._applicationIcon,developerName:this._developerName,version:this._version,comments:this._comments,website:this._website,supportUrl:this._supportUrl,issueUrl:this._issueUrl,debugInfo:this._debugInfo,releaseNotes:this._releaseNotes,hasCustomLinks:this._links.length>0,hasCredits:e.length>0,hasLegal:b(n),hasAcknowledgements:t.length>0}),show=(e,t,n)=>{e.text=t,e.visibility=n?`visible`:`collapse`};this._appIcon.iconName=this._applicationIcon,this._appIcon.visibility=r.appIcon?`visible`:`collapse`,show(this._nameLabel,this._applicationName,r.appName),show(this._versionLabel,this._version,r.version),show(this._developerLabel,this._developerName,r.developerName),show(this._commentsLabel,this._comments,r.commentsLabel),this._setLink(this._websiteButton,E(l.websiteRow),this._website,g(r)),this._setLink(this._supportButton,E(l.supportRow),this._supportUrl,r.supportRow),this._setLink(this._issueButton,E(l.issueRow),this._issueUrl,r.issueRow),show(this._creditsLabel,creditsText(e),r.creditsRow),show(this._acknowledgementsLabel,creditsText(t),r.acknowledgementsRow),show(this._legalLabel,y(n).map(e=>[e.title??``,v(e.markup)].filter(e=>e.length>0).join(`
|
|
5
5
|
`)).join(`
|
|
6
6
|
|
|
7
|
-
`),r.legalRow),show(this._releaseNotesLabel,this._releaseNotesSegments.map(e=>e.text).join(``),r.whatsNewRow),this._linksBox.removeChildren();for(let e of this._links){let t=this._addLinkButton(this._linksBox,`adw-about-dialog-links-item`);this._setLink(t,
|
|
7
|
+
`),r.legalRow),show(this._releaseNotesLabel,this._releaseNotesSegments.map(e=>e.text).join(``),r.whatsNewRow),this._linksBox.removeChildren();for(let e of this._links){let t=this._addLinkButton(this._linksBox,`adw-about-dialog-links-item`);this._setLink(t,E(e.title),e.url,!0)}this._linksBox.visibility=this._links.length>0?`visible`:`collapse`,show(this._debugInfoLabel,this._debugInfo,r.troubleshootingRow),this._copyButton.visibility=r.troubleshootingRow?`visible`:`collapse`}_copyDebugInfo(){let e=this._debugInfo;Promise.resolve().then(()=>i.writeText(e)).catch(()=>void 0)}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=c(e??null);if(t===null)throw Error(`${this.constructor.name} has no window to appear in: pass a widget that sits inside an Adw.Window / Adw.ApplicationWindow to present(), or add the dialog to a layout first.`);t._hostDialog(this),this._host=t}this.visibility=`visible`}}close(){this.visibility=`collapse`,this._host!==null&&(this._host._unhostDialog(this),this._host=null);let e={eventName:N,object:this};this.notify(e)}get open(){return this.visibility===`visible`}set open(t){e(t,!1)?this.present():this.close()}};export{P as ACTIVATE_LINK,AdwAboutDialog,N as CLOSED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GtkImage as i}from"./gtk-image.js";import{ActionRowState as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GtkImage as i}from"./gtk-image.js";import{applyTemplateXalign as a}from"./gtk-label.js";import{ActionRowState as o,isViewSensitive as s,rowLabelVisuals as c}from"./row-state.js";import{adwSubtitleWriteNotifies as l}from"@gjsify/adwaita-core";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";const m=`activated`,h=`notify::title`,g=`notify::subtitle`,_=`notify::icon-name`,v=`notify::activatable`,y=[`prefix`,`suffix`];var AdwActionRow=class extends r(u,{GTypeName:`AdwActionRow`,Properties:{title:{kind:`string`,default:``,blurb:`The title of the row`},subtitle:{kind:`string`,default:``,blurb:`The subtitle of the row`,normalize:e=>e==null?``:String(e),changed:(e,t,n)=>l(String(t),n==null?null:String(e))},"icon-name":{kind:`string`,default:``,blurb:`The icon name for this row`},activatable:{kind:`boolean`,default:!1,blurb:`Whether this row can be activated`}}}){static GTypeName=`AdwActionRow`;static builderSlots=e(y,`suffix`);isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new o;_prefix=null;_iconImage=null;_suffix=null;constructor(e){super(),this.className=`adw-row adw-action-row`,this.addColumn(new d(1,`auto`)),this.addColumn(new d(1,`star`)),this.addColumn(new d(1,`auto`)),this.addRow(new d(1,`auto`));let t=new p;t.orientation=`vertical`,t.className=`adw-row-text`,u.setColumn(t,1);let r=new f;r.className=`adw-row-title`,r.textWrap=!0,a(r,0),t.addChild(r);let i=new f;i.className=`adw-row-subtitle`,i.textWrap=!0,a(i,0),t.addChild(i),this.addChild(t),this._textStack=t,this._titleLabel=r,this._subtitleLabel=i,this.connect(h,e=>e._applyLabels()),this.connect(g,e=>e._applyLabels()),this.connect(_,e=>e._applyIconName()),this.connect(v,e=>{e._rowState.setActivatable(e.activatable)}),this._applyLabels(),this.addEventListener(`tap`,()=>this.activate()),n(this,e)}add_prefix(e){this._prefix&&this.remove(this._prefix),e.className=`${e.className??``} adw-row-prefix`.trim(),u.setColumn(e,0),this.insertChild(e,0),this._prefix=e}get prefix(){return this._prefix}add_suffix(e){this._suffix&&this.remove(this._suffix),e.className=`${e.className??``} adw-row-suffix`.trim(),u.setColumn(e,2),this.addChild(e),this._suffix=e}remove(e){if(e===this._prefix)this._prefix=null;else if(e===this._suffix)this._suffix=null;else throw TypeError(`${this.constructor.name}.remove(): the view is neither this row's prefix nor its suffix. add_prefix()/add_suffix() are the only two slots remove() clears.`);this.removeChild(e),e===this._iconImage&&(this._iconImage=null,this.iconName=``)}get suffix(){return this._suffix}_addChildFromBuilder(e,n){t(e,y,`suffix`)===`prefix`?this.add_prefix(n):this.add_suffix(n)}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,s(e))&&e!==null&&(this.activatable=this._rowState.activatable)}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(s(e))&&(this.activatable=this._rowState.activatable)}activate(){if(!this.activatable)return;let e={eventName:m,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=c({title:this.title,subtitle:this.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}_applyIconName(){let e=this.iconName;if(e===``){this._iconImage!==null&&this.remove(this._iconImage);return}this._iconImage===null&&(this._iconImage=new i,this.add_prefix(this._iconImage)),this._iconImage.iconName=e}};export{m as ACTIVATED,AdwActionRow,v as NOTIFY_ACTIVATABLE,_ as NOTIFY_ICON_NAME,g as NOTIFY_SUBTITLE,h as NOTIFY_TITLE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{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(e){super(),this.className=`adw-avatar`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let t=new p;t.className=`adw-avatar-label`,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,d.setColumn(t,0),d.setRow(t,0),this.addChild(t),this._label=t;let r=new 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(),n(this,e)}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,u(this._size)))),this._icon.pixelSize=l(this._size)}_applyColor(){let{fill:e,fg:t}=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 n=t(e,48);this._size=n>0?n:48,this._applySize()}get showInitials(){return this._showInitials}set showInitials(t){this._showInitials=e(t,!1),this._applyMode()}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._applyMode()}};export{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{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{bannerButtonClassName as r,bannerTitleText as i,bannerVisibility as a,defaultBannerProps as o}from"./chrome.js";import{bannerButtonText as s,bannerButtonVisible as c,parseBannerButtonStyle as l}from"@gjsify/adwaita-core";import{Button as u,GridLayout as d,ItemSpec as f,Label as p}from"@nativescript/core";const m=`buttonClicked`;var AdwBanner=class extends n(d){static GTypeName=`AdwBanner`;_titleLabel;_button;_hasButton=!1;_props=o();constructor(e){super(),this.className=`adw-banner`,this.addColumn(new f(1,`star`)),this.addColumn(new f(1,`auto`)),this.addRow(new f(1,`auto`));let n=new p;n.className=`adw-banner-title`,n.textWrap=!0,d.setColumn(n,0),this.addChild(n),this._titleLabel=n;let r=new u;r.className=`adw-banner-button`,r.set(`androidElevation`,0),d.setColumn(r,1),this._button=r,r.addEventListener(`tap`,()=>{let e={eventName:m,object:this};this.notify(e)}),this.visibility=a(this._props.revealed),t(this,e)}get title(){return this._props.title}set title(e){this._props.title=e??``,this._renderTitle()}get useMarkup(){return this._props.useMarkup}set useMarkup(t){this._props.useMarkup=e(t,!1),this._renderTitle()}get buttonLabel(){return this._props.buttonLabel}set buttonLabel(e){let t=e??``;this._props.buttonLabel=t,this._button.text=s(t);let n=c(t);n&&!this._hasButton?(this.addChild(this._button),this._hasButton=!0):!n&&this._hasButton&&(this.removeChild(this._button),this._hasButton=!1)}get buttonStyle(){return this._props.buttonStyle}set buttonStyle(e){this._props.buttonStyle=l(e),this._button.className=r(this._button.className,this._props.buttonStyle)}get revealed(){return this._props.revealed}set revealed(t){this._props.revealed=e(t,!1),this.visibility=a(this._props.revealed)}_renderTitle(){this._titleLabel.text=i(this._props.title,this._props.useMarkup)}};export{AdwBanner,m as BUTTON_CLICKED};
|
|
@@ -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{xmlBoolean as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.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 n=new O;n.orientation=`vertical`,n.className=`adw-bottom-sheet-panel`,n.verticalAlignment=`bottom`,w.setColumn(n,0),w.setRow(n,0);let i=new O;i.orientation=`vertical`,i.className=a,i.addEventListener(`tap`,()=>this.requestOpen(`bottom-bar`)),C(i),n.addChild(i);let o=new w;o.className=`adw-bottom-sheet-page`,o.addRow(new T(1,`star`)),n.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),n.addEventListener(`pan`,e=>this._onPan(e)),t.addEventListener(`pan`,e=>this._onPan(e)),this.addChild(n),this._sheetPanel=n,A.set(this,n),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)}),r(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(n(e,!1))}get_modal(){return this._state.modal}set_modal(e){this._state.setModal(n(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=n(e,this.canClose);this._state.setCanClose(t)}get canOpen(){return this._state.canOpen}set canOpen(e){this._state.setCanOpen(n(e,this.canOpen))&&this._paintChrome()}get revealBottomBar(){return this._state.revealBottomBar}set revealBottomBar(e){this._state.setRevealBottomBar(n(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{applyConstructProps as e}from"./construct-props.js";import{GtkImage as t}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{GtkImage as t}from"./gtk-image.js";import{classNameWith as n,normalizeStyleClasses as r,withCssClass as i,withoutCssClass as a}from"./style-classes.js";import{applyTemplateXalign as o}from"./gtk-label.js";import{ButtonRowState as s,buttonRowIconColor as c,buttonRowIconVisuals as l}from"./row-state.js";import{ACTIVATED as u,AdwActionRow as d}from"./adw-action-row.js";import{attachRowPressFeedback as f}from"./row-press.js";import{adwaitaAccent as p,onAdwaitaAccentChanged as m}from"@gjsify/adwaita-core";import{StackLayout as h}from"@nativescript/core";const g=`adw-row adw-action-row adw-button-row`;var _=class AdwButtonRow extends d{static GTypeName=`AdwButtonRow`;isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new s;_styleClasses=[];constructor(t){super(),this.className=g,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,o(this._titleLabel,.5),this._textStack.removeChild(this._titleLabel);let n=new h;n.orientation=`horizontal`,n.className=`adw-button-row-content`,n.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),this._applyIconColor(),this.addEventListener(`loaded`,()=>{this._applyIconColor(),this._unsubAccent??=m(()=>this._applyIconColor())}),this.addEventListener(`unloaded`,()=>{this._unsubAccent?.(),this._unsubAccent=null}),n.addChild(this._startIcon),n.addChild(this._titleLabel),n.addChild(this._endIcon),this._textStack.addChild(n),this._textStack.horizontalAlignment=`center`,this._contentBox=n,this.activatable=!0,this._applyIcons(),f(this),e(this,t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(r(e))}add_css_class(e){this._setClasses(i(this._styleClasses,e))}remove_css_class(e){this._setClasses(a(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(r([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=n(g,e)}static _makeIcon(e){let n=new t;return n.className=`${n.className} ${e}`.trim(),n.verticalAlignment=`middle`,n}get startIconName(){return this._buttonState.startIconName}set startIconName(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIconName(){return this._buttonState.endIconName}set endIconName(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._pinnedIconColor=e||null,this._applyIconColor()}_applyIconColor(){let e=c(this._pinnedIconColor,p());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=l(this._buttonState.state);this._startIcon.iconName=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.iconName=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{u as ACTIVATED,_ as AdwButtonRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{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(e){super(),this.className=`adw-carousel`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`));let t=new p;t.orientation=`horizontal`,t.className=`adw-carousel-scroller`,d.setRow(t,0);let r=new m;r.orientation=`horizontal`,r.className=`adw-carousel-track`,t.content=r,this.addChild(t),this._scroller=t,this._track=r,t.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)}),n(this,e)}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 n=t(e,this.position);if(!Number.isFinite(n))return;let r=this._state.pageAt(n);r>=0&&this._scrollToIndex(r)}get currentPage(){return this._state.pageAt(this._state.position)}get interactive(){return this._state.interactive}set interactive(t){let n=e(t,this.interactive);this._state.setInteractive(n)}get pageWidth(){return this._pageWidth}set pageWidth(e){let n=t(e,this.pageWidth);this._pageWidth=u(n);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{applyConstructProps as n}from"./construct-props.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{pushDeclared as r,readDeclaredValue as i,withProperties as a}from"./signals.js";import{GtkImage as o}from"./gtk-image.js";import{AdwActionRow as s}from"./adw-action-row.js";import{attachRowPressFeedback as c}from"./row-press.js";import{ADW_COMBO_NO_SELECTION as l,ComboState as u,ComboState as d,GjsifyOptionList as f,ListModel as p,TYPE_OBJECT as m,readModelWrite as h}from"@gjsify/adwaita-core";import{Label as g,StackLayout as _,action as v}from"@nativescript/core";import{panDownSymbolic as y}from"@gjsify/adwaita-icons/ui";const b=`notify::selected`;var AdwComboRow=class extends a(s,{GTypeName:`AdwComboRow`,Properties:{model:{kind:`object`,valueType:p,explicitNotify:!0,blurb:`The model used by the combo row`,normalize:(e,t)=>h(e,t._authored),afterNotify:e=>e._applyModel()},selected:{kind:`int`,default:l,explicitNotify:!0,blurb:`The position of the selected item`,normalize:(e,t)=>{let n=t,r=i(`selected`,`int`,e);return n._state.count===0?(n._pendingSelected=r,n.selected):n._state.hasIndex(r)?r:n.selected},afterNotify:e=>e._applySelected()},"selected-item":{kind:`object`,valueType:m,explicitNotify:!0,blurb:`The selected item`,normalize:(e,t)=>t._state.selectedItem}}}){static GTypeName=`AdwComboRow`;static builderSlots=e([...s.builderSlots,`model`],`suffix`);_valueLabel;_chevron;_state=new d;_authored=f.new(null);_pendingSelected=null;_applyModel(){this._state.setModel(this.model);let e=this._pendingSelected;e!==null&&this._state.hasIndex(e)&&(this._pendingSelected=null,this._state.setSelectedIndex(e))}_applySelected(){this._state.setSelectedIndex(this.selected)}constructor(e){super(),this.className=`adw-row adw-action-row adw-combo-row`;let t=new _;t.orientation=`horizontal`,t.className=`adw-combo-suffix`;let i=new g;i.className=`adw-combo-value`,i.text=``;let a=new o;a.className=`adw-combo-chevron`,a.iconColor=`#9a9a9a`,a.pixelSize=16,a.iconName=y,t.addChild(i),t.addChild(a),this.add_suffix(t),this._valueLabel=i,this._chevron=a,this._state.subscribe(e=>{r(this,`selected`,e.selected),r(this,`selected-item`,this._state.selectedItem),this._valueLabel.text=e.label,this._syncChooser()}),this._state.subscribeNotify(e=>{r(this,e,this._valueOf(e)),this.notify(e)}),this.addEventListener(`tap`,()=>{this._openChooser()}),c(this),this._syncChooser(),n(this,e)}_valueOf(e){return e===`model`?this._state.model:e===`selected`?this._state.selectedIndex:this._state.selectedItem}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.options.map(e=>e.label),t=await v({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get options(){return this._state.options}set_model(e){this.model=e}get_model(){return this.model}_addChildFromBuilder(e,n){if(t(e,[`model`],`edge`)===`model`){this.model=n;return}super._addChildFromBuilder(e,n)}get_selected(){return this.selected}set_selected(e){this.selected=e}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}get_selected_item(){return this.selectedItem}};export{AdwComboRow,u as ComboState,b as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{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(e){super(),this.className=`adw-data-grid`,t(this,e)}get_columns(){return this._columns}set_columns(e){this._columns=g(e),this._render()}get_rows(){return this._dataRows}set_rows(e){this._dataRows=Array.isArray(e)?e.map(e=>({...e})):[],this._render()}get interactive(){return this._interactive}set interactive(t){let n=e(t,this.interactive);this._interactive=!!n,this._paint()}_render(){this._syncColumns(),this._syncNodes(),this._paint()}_syncColumns(){let e=h(this._columns),t=d(e);if(t!==this._trackKey){this._trackKey=t,this.removeColumns();for(let t of e){let e=c(t);this.addColumn(new y(e.value,e.type))}}}_syncNodes(){let e=this._columns.length,t=u(e,this._dataRows.length);if(t!==this._shapeKey){this._shapeKey=t;for(let e of[this._header,...this._rowNodes])if(e!==null){this.removeChild(e.background);for(let t of e.cells)this.removeChild(t)}this._header=null,this._rowNodes=[],this.removeRows(),e!==0&&(this.addRow(new y(1,`auto`)),this._header=this._buildRow(0,e,!1),this._rowNodes=this._dataRows.map((t,n)=>(this.addRow(new y(1,`auto`)),this._buildRow(n+1,e,!0))))}}_buildRow(e,t,n){let i=new x;v.setRow(i,e),v.setColumn(i,0),v.setColumnSpan(i,t),this.addChild(i),n&&(r(i),i.addEventListener(`tap`,()=>this._activate(e-1)));let a=[];for(let n=0;n<t;n++){let t=new b;t.textWrap=!1,v.setRow(t,e),v.setColumn(t,n),this.addChild(t),a.push(t)}return{background:i,cells:a}}_paint(){let e=this._header;e!==null&&(e.background.className=a,this._columns.forEach((t,n)=>{let r=e.cells[n];r!==void 0&&(r.className=`${p(t).join(` `)} ${i}`,r.text=t.label??t.key,this._showCell(r,1))}),this._dataRows.forEach((e,t)=>{let n=this._rowNodes[t];if(n===void 0)return;let r=_(e.variant),i=m(r,e.interactive,this._interactive);if(n.background.className=l(r,i),r===`section`){let t=this._columns[0]?.key??``;n.cells.forEach((n,r)=>{r===0?(n.className=o,n.text=f(e[t]),this._showCell(n,this._columns.length)):(n.text=``,n.visibility=`collapse`,v.setColumnSpan(n,1))});return}this._columns.forEach((t,i)=>{let a=n.cells[i];a!==void 0&&(a.className=s(p(t),r),a.text=f(e[t.key]),this._showCell(a,1))})}))}_showCell(e,t){e.visibility=`visible`,v.setColumnSpan(e,t)}_activate(e){let t=this._dataRows[e];if(t===void 0||!m(_(t.variant),t.interactive,this._interactive))return;let n={eventName:S,object:this,index:e,row:t};this.notify(n)}};export{AdwDataGrid,S as ROW_ACTIVATED};
|
|
@@ -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{xmlBoolean as t,xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{DEFAULT_DIALOG_PRESENTATION_MODE as i,dialogCardLayout as a,dialogPresentationMode as o,findDialogHost as s,surfaceSize as c}from"./window-state.js";import{AdwSingleChildBase as l}from"./single-child-base.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";const f=`closed`,p=`close-attempt`,m=`adw-dialog`;var AdwDialog=class extends l{static GTypeName=`AdwDialog`;static builderSlots=e([`child`],`child`);_card;_title=``;_contentWidth=-1;_contentHeight=-1;_followsContentSize=!0;_canClose=!0;_presentationMode=i;_host=null;_available=null;constructor(e){super(),this._restyle(),this.visibility=`collapse`;let t=new u;t.className=`${m}-card`,t.addColumn(new d(1,`star`)),t.addRow(new d(1,`star`)),u.setColumn(t,0),u.setRow(t,0),this.addChild(t),this._card=t,this._layoutCard(),this.addEventListener(`layoutChanged`,()=>this._measureWindow()),r(this,e)}get _ownClass(){return m}_adopt(e){u.setColumn(e,0),u.setRow(e,0),this._card.addChild(e)}_release(e){this._card.removeChild(e)}get title(){return this._title}set title(e){this._title=e??``,this._card.accessibilityLabel=this._title===``?void 0:this._title}get contentWidth(){return this._contentWidth}set contentWidth(e){this._contentWidth=c(n(e,NaN),e,this._contentWidth,`contentWidth`),this._layoutCard()}get contentHeight(){return this._contentHeight}set contentHeight(e){this._contentHeight=c(n(e,NaN),e,this._contentHeight,`contentHeight`),this._layoutCard()}get followsContentSize(){return this._followsContentSize}set followsContentSize(e){this._followsContentSize=t(e,this._followsContentSize)}get canClose(){return this._canClose}set canClose(e){this._canClose=t(e,this._canClose)}get presentationMode(){return this._presentationMode}set presentationMode(e){this._presentationMode=o(e),this._layoutCard()}get open(){return this.visibility===`visible`}present(e){if(!this.open){if(this.parent===null||this.parent===void 0){let t=s(e??null);if(t===null)throw Error(`${this.constructor.name} has no window to appear in: pass a widget that sits inside an Adw.Window / Adw.ApplicationWindow to present(), or add the dialog to a layout first.`);t._hostDialog(this),this._host=t}this.visibility=`visible`}}close(){if(!this._canClose){this.notify({eventName:p,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:f,object:this}))}_measureWindow(){let e=this.getActualSize?.();if(!e||e.width<=0||e.height<=0)return;let t=this._available;t!==null&&t.width===e.width&&t.height===e.height||(this._available={width:e.width,height:e.height},this._layoutCard())}_layoutCard(){let e=this._card,t=a(this._available,this._presentationMode,this._contentWidth,this._contentHeight);e.width=t.width,e.height=t.height,e.horizontalAlignment=t.sheet?`stretch`:`center`,e.verticalAlignment=t.sheet?`bottom`:`middle`}};export{m as ADW_DIALOG_CLASS,f as ADW_DIALOG_CLOSED,p as ADW_DIALOG_CLOSE_ATTEMPT,AdwDialog};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{readDeclaredValue as t,withProperties as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{readDeclaredValue as t,withProperties as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{applyTemplateXalign as i}from"./gtk-label.js";import{AdwActionRow as a}from"./adw-action-row.js";import{AdwImageButton as o}from"./adw-image-button.js";import{NS_EDIT_ICON_CLASS as s,NS_ENTRY_ROW_CLASS as c,applyEntryRowState as l}from"./entry-row-view.js";import{ADW_ACCENT_FG_COLOR as u,clampEntryMaxLength as d,clampEntryText as f,deriveEntryRowState as p,entryRowLatches as m,entryTextLength as h,resolveEntryRowActivation as g}from"@gjsify/adwaita-core";import{Label as _,StackLayout as v,TextField as y}from"@nativescript/core";import{documentEditSymbolic as b,objectSelectSymbolic as x}from"@gjsify/adwaita-icons/actions";const S=`notify::text`,C=`notify::text-length`,w=`notify::max-length`,T=`notify::editable`,E=`notify::show-apply-button`,D=`notify::activates-default`,O=`apply`,k=`entry-activated`;var AdwEntryRow=class extends n(a,{GTypeName:`AdwEntryRow`,Properties:{text:{kind:`string`,default:``,blurb:`The entry text`,normalize:(e,t)=>f(String(e??``),t.maxLength)},"text-length":{kind:`uint`,default:0,blurb:`The length of the text, in characters`,normalize:(e,t)=>h(t.text)},"max-length":{kind:`int`,default:0,blurb:`The maximum length of the text, in characters`,normalize:e=>d(t(`max-length`,`int`,e))},editable:{kind:`boolean`,default:!0,blurb:`Whether the entry is editable`},"show-apply-button":{kind:`boolean`,default:!1,blurb:`Whether to show the apply button`},"activates-default":{kind:`boolean`,default:!1,blurb:`Whether activating the embedded entry can activate the default widget`}},Signals:{apply:{},"entry-activated":{}}}){static GTypeName=`AdwEntryRow`;isActionRow=!1;_editing=!1;_showIndicator=!1;_textChanged=!1;_field;_emptyTitle;_suffixes;_editIcon;_indicator;_applyButton;_slotSuffix=null;constructor(t){super(),this._titleLabel.className=`adw-row-title adw-entry-title`,i(this._titleLabel,0),this._managesTitleVisibility=!1;let n=new _;n.className=`adw-row-title adw-entry-empty-title`,n.textWrap=!0,i(n,0),this._textStack.insertChild(n,0),this._emptyTitle=n;let a=new y;a.className=`adw-entry-field`,a.set(`backgroundColor`,`transparent`),a.set(`borderWidth`,0),this._textStack.addChild(a),this._field=a;let c=new v;c.orientation=`horizontal`,c.className=`adw-entry-row-suffixes`,this._suffixes=c;let l=new r;l.className=`gtk-image adw-entry-indicator`,c.addChild(l),this._indicator=l;let d=new o;d.className=`${d.className} adw-entry-apply`.trim(),d.iconName=x,d.iconColor=u,d.addEventListener(`tap`,()=>this.apply()),c.addChild(d),this._applyButton=d;let f=new r;f.className=s,f.iconName=b,c.addChild(f),this._editIcon=f,super.add_suffix(c),this._field.addEventListener(`textChange`,()=>{this.text=this._field.text??``}),this._field.addEventListener(`focus`,()=>this._setEditing(!0)),this._field.addEventListener(`blur`,()=>this._setEditing(!1)),this._field.addEventListener(`returnPress`,()=>this._activate()),this.connect(S,e=>e._onTextChanged()),this.connect(w,e=>e._onMaxLengthChanged()),this.connect(T,e=>e._update()),this.connect(E,e=>e._onShowApplyButtonChanged()),this._update(),e(this,t)}get editing(){return this._editing}get textChanged(){return this._textChanged}add_suffix(e){e.className=`${e.className??``} adw-row-suffix`.trim(),this._suffixes.addChild(e),this._slotSuffix=e}remove(e){if(e===this.prefix){super.remove(e);return}this._suffixes.removeChild(e),e===this._slotSuffix&&(this._slotSuffix=null)}get suffix(){return this._slotSuffix}setShowIndicator(e){this._showIndicator=!!e,this._update()}setIndicatorIcon(e){this._indicator.iconName=e}apply(){this._textChanged=!1,this._update(),this.emit(O)}_activate(){if(g(this._textChanged,this.activatesDefault).signal===`apply`){this.apply();return}this.emit(k)}_update(){this._render(p({text:this.text,editing:this._editing,editable:this.editable,showIndicator:this._showIndicator,textChanged:this._textChanged}))}_render(e){l({row:this,emptyTitle:this._emptyTitle,title:this._titleLabel,field:this._field,editIcon:this._editIcon,indicator:this._indicator,applyButton:this._applyButton},e,this._baseClassName)}get _baseClassName(){return c}_setEditing(e){e!==this._editing&&(this._editing=e,this._update())}_onTextChanged(){m(this.showApplyButton,this._editing)&&(this._textChanged=!0),this._update(),this.textLength=h(this.text)}_onMaxLengthChanged(){this.text=f(this.text,this.maxLength)}_onShowApplyButtonChanged(){this.showApplyButton||!this._textChanged||(this._textChanged=!1,this._update())}};export{AdwEntryRow,D as NOTIFY_ACTIVATES_DEFAULT,T as NOTIFY_EDITABLE,w as NOTIFY_MAX_LENGTH,E as NOTIFY_SHOW_APPLY_BUTTON,S as NOTIFY_TEXT,C as NOTIFY_TEXT_LENGTH,O as SIGNAL_APPLY,k as SIGNAL_ENTRY_ACTIVATED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{DEFAULT_ICON_PIXEL_SIZE as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{DEFAULT_ICON_PIXEL_SIZE as t,gtkIconSizeNick as n,iconPixelSize as r,storedPixelSize as i}from"./gtk-icon-size.js";import{applyConstructProps as a}from"./construct-props.js";import{withSignals as o}from"./signals.js";import{onAdwaitaColorSchemeChanged as s,themeIconColor as c}from"./color-scheme.js";import{DEFAULT_ICON_COLOR as l}from"./icon-path.js";import{drawIcon as u,onIconsChanged as d}from"./icon-render.js";import{attachRowPressFeedback as f}from"./row-press.js";import{GridLayout as p,Image as m,ItemSpec as h}from"@nativescript/core";const g=t;var AdwImageButton=class extends o(p){static GTypeName=`AdwImageButton`;_image;_icon=``;_iconColor=c();_explicitColor=!1;_iconSize=`inherit`;_pixelSize=-1;_unsubScheme=null;_unsubIcons=null;constructor(e){super(),this.className=`adw-image-button`,this.addRow(new h(1,`star`)),this.addColumn(new h(1,`star`));let t=new m;t.className=`adw-image-button-icon`,t.stretch=`aspectFit`,t.width=this._renderedSize,t.height=this._renderedSize,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,this.addChild(t),this._image=t,f(this),this.addEventListener(`loaded`,()=>{this._syncThemeColor(),this._unsubScheme??=s(()=>this._syncThemeColor()),this._unsubIcons??=d(()=>this._render())}),this.addEventListener(`unloaded`,()=>{this._unsubScheme?.(),this._unsubScheme=null,this._unsubIcons?.(),this._unsubIcons=null}),a(this,e)}_syncThemeColor(){if(this._explicitColor)return;let e=c();e!==this._iconColor&&(this._iconColor=e,this._render())}get _renderedSize(){return r(this._iconSize,this._pixelSize)}_applySize(){let e=this._renderedSize;this._image.width=e,this._image.height=e,this._render()}_render(){u(this._image,this._icon,this._renderedSize,this._iconColor)}get iconName(){return this._icon}set iconName(e){this._icon=e??``,this._applySize()}get iconColor(){return this._iconColor}set iconColor(e){this._explicitColor=!0,this._iconColor=e||l,this._render()}get iconSize(){return this._iconSize}set iconSize(e){this._iconSize=n(e,this._iconSize),this._applySize()}get pixelSize(){return this._pixelSize}set pixelSize(t){this._pixelSize=i(e(t,this._pixelSize)),this._applySize()}get image(){return this._image}};export{AdwImageButton,g as DEFAULT_ICON_BUTTON_ICON_SIZE};
|
|
@@ -1 +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{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GridLayout as i,ItemSpec as a}from"@nativescript/core";var AdwNavigationPage=class extends r(i){static GTypeName=`AdwNavigationPage`;static builderSlots=e([`child`],`child`);_child=null;_tag=null;_title=``;_canPop=!0;_owner=null;constructor(e){super(),this.className=`adw-navigation-page`,this.addColumn(new a(1,`star`)),this.addRow(new a(1,`star`)),n(this,e)}set_child(e){this._child&&this.removeChild(this._child),this._child=e,e&&(i.setColumn(e,0),i.setRow(e,0),this.addChild(e))}get child(){return this._child}_addChildFromBuilder(e,t){this.set_child(t)}get tag(){return this._tag}set tag(e){this._tag=e,this._owner?.setPageTag(this,e)}get title(){return this._title}set title(e){this._title=e??``,this._owner?.setPageTitle(this,this._title)}get canPop(){return this._canPop}set canPop(e){this._canPop=t(e,this._canPop),this._owner?.setPageCanPop(this,this._canPop)}_setOwner(e){this._owner=e}};export{AdwNavigationPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{NsNavigationSplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var o=class AdwNavigationSplitView extends i{static GTypeName=`AdwNavigationSplitView`;constructor(e){super(`adw-navigation-split-view`,`navigation`,new n({onCritical:e=>console.error(e),onDelegate:(e,t)=>{for(let n=this.parent;n;n=n.parent)if(n instanceof AdwNavigationSplitView)return(e===`push`?n.push(t):n.pop()).kind!==`not-found`;return!1}})),this._applyLayout(),t(this,e)}_applyLayout(){if(!this._state.collapsed){let e=r(this._state.sidebarPosition,this.textDirection);this._sidebar&&(this._sidebar.visibility=`visible`,this._sidebar.translateX=0,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth),this._content&&(this._content.visibility=`visible`,this._content.translateX=0,a.setColumn(this._content,e.content),a.setColumnSpan(this._content,1));return}let e=this._state.visiblePane;this._sidebar&&(this._sidebar.visibility=e===`sidebar`?`visible`:`collapse`,this._sidebar.translateX=0,a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=`auto`),this._content&&(this._content.visibility=e===`content`?`visible`:`collapse`,this._content.translateX=0,a.setColumn(this._content,0),a.setColumnSpan(this._content,2))}_transitionSidebar(){if(!this._shouldAnimate()||!this._sidebar||!this._content){this._applyLayout();return}this._cancelPending();for(let e of[this._sidebar,this._content])a.setColumn(e,0),a.setColumnSpan(e,2);this._sidebar.width=`auto`;let e=this._paneWidth(),t=this._state.transition===`push`,n=this._state.visiblePane===`sidebar`?this._sidebar:this._content,r=n===this._sidebar?this._content:this._sidebar,i=t?e:-e,o=t?-e:e;n.visibility=`visible`,n.translateX=i,r.visibility=`visible`,r.translateX=0,this._track(n.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})),this._track(r.animate({translate:{x:o,y:0},duration:200,curve:`easeIn`})).then(()=>this._settleAfterSwap(n,r)).catch(()=>{})}_settleAfterSwap(e,t){(this._state.visiblePane===`sidebar`?this._sidebar:this._content)===e&&(t.visibility=`collapse`,t.translateX=0)}_paneWidth(){let e=this.getActualSize();return e&&e.width>0?e.width:1024}get sidebarTag(){return this._state.sidebarTag}set sidebarTag(e){this._state.setTag(`sidebar`,e)}get contentTag(){return this._state.contentTag}set contentTag(e){this._state.setTag(`content`,e)}push(e){return this._state.push(e)}pop(){return this._state.pop()}get showContent(){return this._state.showContent}set showContent(t){let n=e(t,this.showContent);this._state.showContent=n}};export{o as AdwNavigationSplitView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{AdwNavigationPage as r}from"./adw-navigation-page.js";import{NOTIFY_VISIBLE_PAGE as i,NsNavigationStack as a,POPPED as o,PUSHED as s,REPLACED as c,navigationPageClassName as l}from"./navigation-stack.js";import{describeNavigationDiagnostic as u}from"@gjsify/adwaita-core";import{GridLayout as d,ItemSpec as f}from"@nativescript/core";var AdwNavigationView=class extends n(d){static GTypeName=`AdwNavigationView`;_nav;constructor(e){super(),this.className=`adw-navigation-view`,this.addColumn(new f(1,`star`)),this.addRow(new f(1,`star`)),this._nav=new a({attachPage:e=>{e.className=l(e.className),d.setColumn(e,0),d.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emitNavigation(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${u(e)}`)}),t(this,e)}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){if(t instanceof r){this.add(t,t.tag,{title:t.title,canPop:t.canPop}),t._setOwner(this);return}this.add(t)}remove(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}push_by_tag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}pop_to_page(e){return this._nav.popToPage(e)}pop_to_tag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replace_with_tags(e){this._nav.replaceWithTags(e)}find_page(e){return this._nav.findPage(e)}get_previous_page(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get_visible_page_tag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(t){let n=e(t,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(t){let n=e(t,this.popOnEscape);this._nav.setPopOnEscape(n)}_emitNavigation(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,i as NOTIFY_VISIBLE_PAGE,o as POPPED,s as PUSHED,c as REPLACED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{NsOverlaySplitViewState as n,splitViewColumns as r}from"./split-view-state.js";import{AdwSplitViewBase as i}from"./split-view-base.js";import{GridLayout as a}from"@nativescript/core";var AdwOverlaySplitView=class extends i{static GTypeName=`AdwOverlaySplitView`;_scrim=null;constructor(e){super(`adw-overlay-split-view`,`overlay`,new n),this._applyLayout(),t(this,e)}get show_sidebar(){return this.showSidebar}set show_sidebar(t){this.showSidebar=e(t,this.showSidebar)}get_show_sidebar(){return this.showSidebar}set_show_sidebar(e){this.showSidebar=e}get pinSidebar(){return this._state.pinSidebar}set pinSidebar(t){let n=e(t,this.pinSidebar);this._state.setPinSidebar(!!n)}_applyLayout(){let e=r(this._state.sidebarPosition),t=this._state.sidebarPosition===`end`;if(!this._state.collapsed){this._detachScrim();let t=this._state.showSidebar;this._sidebar&&(this._sidebar.visibility=t?`visible`:`collapse`,this._sidebar.translateX=0,this._sidebar.opacity=1,a.setColumn(this._sidebar,e.sidebar),a.setColumnSpan(this._sidebar,1),this._sidebar.width=this.sidebarWidth,this._sidebar.className=this._paneClassName(this._sidebar.className,!1),this._sidebar.horizontalAlignment=`stretch`),this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,t?e.content:0),a.setColumnSpan(this._content,t?1:2)),this._applyPaneFocus();return}this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2),this._scrim.visibility=this._state.shieldVisible?`visible`:`collapse`,this._scrim.opacity=+!!this._state.shieldVisible),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=t?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0),this._sidebar.visibility=this._state.showSidebar?`visible`:`collapse`,this._sidebar.translateX=this._state.showSidebar?0:this._hiddenOffset(),this._sidebar.opacity=1),this._applyPaneFocus()}_transitionSidebar(){if(!this._state.collapsed||!this._shouldAnimate()){this._applyLayout();return}this._cancelPending(),this._prepareCollapsedStructure(),this._applyPaneFocus(),this._state.showSidebar?this._animateOpen():this._animateClose()}_applyPaneFocus(){this._sidebar&&(this._sidebar.isUserInteractionEnabled=this._state.sidebarFocusable),this._content&&(this._content.isUserInteractionEnabled=this._state.contentFocusable)}_ensureScrim(){if(this._scrim)return this._scrim;let e=new a;return e.className=`adw-overlay-scrim`,e.visibility=`collapse`,e.opacity=0,e.addEventListener(`tap`,()=>this.hideSidebarPane()),this._scrim=e,e}_raiseOverlayChildren(){let e=this._ensureScrim();this._isChild(e)&&this.removeChild(e);let t=this._sidebar;t&&this._isChild(t)&&this.removeChild(t),this.addChild(e),t&&this.addChild(t)}_detachScrim(){this._scrim&&this._isChild(this._scrim)&&this.removeChild(this._scrim)}_prepareCollapsedStructure(){let e=this._state.sidebarPosition===`end`;this._content&&(this._content.visibility=`visible`,a.setColumn(this._content,0),a.setColumnSpan(this._content,2)),this._raiseOverlayChildren(),this._scrim&&(a.setColumn(this._scrim,0),a.setColumnSpan(this._scrim,2)),this._sidebar&&(a.setColumn(this._sidebar,0),a.setColumnSpan(this._sidebar,2),this._sidebar.width=this.sidebarWidth,this._sidebar.horizontalAlignment=e?`right`:`left`,this._sidebar.className=this._paneClassName(this._sidebar.className,!0))}_animateOpen(){let e=this._scrim;e&&(e.visibility=`visible`,e.opacity=0,this._track(e.animate({opacity:1,duration:200,curve:`easeOut`})));let t=this._sidebar;t&&(t.visibility=`visible`,t.translateX=this._hiddenOffset(),t.opacity=1,this._track(t.animate({translate:{x:0,y:0},duration:200,curve:`easeOut`})))}_animateClose(){let e=this._scrim,t=this._sidebar,n=[];e&&n.push(this._track(e.animate({opacity:0,duration:200,curve:`easeIn`}))),t&&n.push(this._track(t.animate({translate:{x:this._hiddenOffset(),y:0},duration:200,curve:`easeIn`}))),Promise.all(n).then(()=>{this._state.showSidebar||(t&&(t.visibility=`collapse`),e&&(e.visibility=`collapse`))}).catch(()=>{})}_hiddenOffset(){let e=this.sidebarWidth;return this._state.sidebarPosition===`end`?e:-e}_paneClassName(e,t){return`${(e??``).split(/\s+/).filter(e=>e&&e!==`adw-overlay-active`&&e!==`adw-split-view-sidebar`).join(` `)} adw-split-view-sidebar${t?` adw-overlay-active`:``}`.trim()}};export{AdwOverlaySplitView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{AdwImageButton as n}from"./adw-image-button.js";import{NS_PASSWORD_ENTRY_ROW_CLASS as r,applyPasswordEntryRowState as i}from"./entry-row-view.js";import{AdwEntryRow as a}from"./adw-entry-row.js";import{PasswordEntryRowState as o,PasswordEntryRowState as s}from"@gjsify/adwaita-core";import{dialogWarningSymbolic as c}from"@gjsify/adwaita-icons/status";const l=`notify::revealed`;var AdwPasswordEntryRow=class extends a{static GTypeName=`AdwPasswordEntryRow`;_password=new s(this);_peekButton;constructor(e){super(),this._field.className=`adw-entry-field adw-password-field`;let r=new n;r.className=`${r.className} adw-password-peek`.trim(),r.addEventListener(`tap`,()=>this._password.togglePeek()),this.add_suffix(r),this._peekButton=r,this.setIndicatorIcon(c),this._renderPassword(this._password.state),this._password.subscribe(e=>{this._renderPassword(e);let t={eventName:l,object:this,revealed:e.revealed};this.notify(t)}),t(this,e)}get revealed(){return this._password.revealed}set revealed(t){this._password.setRevealed(e(t,!1))}get peeking(){return this._password.revealed}set peeking(t){this._password.setRevealed(e(t,!1))}togglePeek(){return this._password.togglePeek()}get capsLockOn(){return this._password.capsLockOn}setCapsLockOn(e){this._password.setCapsLockOn(e)}get _baseClassName(){return r}_renderPassword(e){i({field:this._field,peekButton:this._peekButton},e)}};export{AdwPasswordEntryRow,l as NOTIFY_REVEALED,o as PasswordEntryRowState};
|