@gjsify/adwaita-nativescript 0.51.0 → 0.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/builder/index.js +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/namespace/adw.js +1 -1
- package/lib/esm/namespace/gio.js +1 -0
- package/lib/esm/namespace/gtk.js +1 -1
- package/lib/esm/values/sidebar.js +1 -0
- package/lib/esm/values/tab-page.js +1 -0
- package/lib/esm/widgets/adw-action-row.js +1 -1
- package/lib/esm/widgets/adw-alert-dialog.js +1 -1
- package/lib/esm/widgets/adw-avatar.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-indicator-dots.js +1 -0
- package/lib/esm/widgets/adw-carousel-indicator-lines.js +1 -0
- package/lib/esm/widgets/adw-carousel.js +1 -1
- package/lib/esm/widgets/adw-clamp.js +1 -1
- package/lib/esm/widgets/adw-combo-row.js +1 -1
- package/lib/esm/widgets/adw-expander-row.js +1 -1
- package/lib/esm/widgets/adw-header-bar.js +1 -1
- package/lib/esm/widgets/adw-navigation-page.js +1 -0
- package/lib/esm/widgets/adw-navigation-view.js +1 -1
- package/lib/esm/widgets/adw-preferences-group.js +1 -1
- package/lib/esm/widgets/adw-shortcut-label.js +1 -1
- package/lib/esm/widgets/adw-sidebar.js +1 -1
- package/lib/esm/widgets/adw-spin-row.js +1 -1
- package/lib/esm/widgets/adw-status-page.js +1 -1
- package/lib/esm/widgets/adw-tab-view.js +1 -1
- package/lib/esm/widgets/adw-toast-overlay.js +1 -1
- package/lib/esm/widgets/adw-toggle-group.js +1 -1
- package/lib/esm/widgets/adw-toggle.js +1 -0
- package/lib/esm/widgets/adw-toolbar-view.js +1 -1
- package/lib/esm/widgets/adw-view-stack.js +1 -1
- package/lib/esm/widgets/adw-view-switcher-bar.js +1 -1
- package/lib/esm/widgets/bottom-sheet-state.js +1 -1
- package/lib/esm/widgets/box-layout.js +1 -1
- package/lib/esm/widgets/builder-slots.js +1 -1
- package/lib/esm/widgets/carousel-indicator-base.js +1 -0
- package/lib/esm/widgets/carousel-state.js +1 -1
- package/lib/esm/widgets/chrome.js +1 -1
- package/lib/esm/widgets/gtk-action-bar.js +1 -0
- package/lib/esm/widgets/gtk-box.js +1 -1
- package/lib/esm/widgets/gtk-button.js +1 -1
- package/lib/esm/widgets/gtk-drop-down.js +1 -1
- package/lib/esm/widgets/gtk-label.js +1 -1
- package/lib/esm/widgets/gtk-menu-button.js +1 -1
- package/lib/esm/widgets/icon-theme.js +1 -1
- package/lib/esm/widgets/id-reference.js +1 -0
- package/lib/esm/widgets/index.js +1 -1
- package/lib/esm/widgets/signals.js +1 -1
- package/lib/esm/widgets/split-view-base.js +1 -1
- package/lib/esm/widgets/view-stack-page.js +1 -0
- package/lib/esm/widgets/view-switcher-base.js +1 -1
- package/lib/esm/widgets/widget-layout.js +1 -0
- package/lib/types/blueprint-markup.spec.d.ts +4 -0
- package/lib/types/blueprint-trees.spec.d.ts +1 -0
- package/lib/types/builder/index.d.ts +70 -0
- package/lib/types/clamp-child.spec.d.ts +2 -0
- package/lib/types/gallery-blueprints.spec.d.ts +1 -0
- package/lib/types/gtk-value-doors.spec.d.ts +1 -0
- package/lib/types/index.d.ts +2 -1
- package/lib/types/namespace/adw.d.ts +8 -0
- package/lib/types/namespace/gio.d.ts +1 -0
- package/lib/types/namespace/gtk.d.ts +3 -0
- package/lib/types/shared-trees.spec.d.ts +2 -0
- package/lib/types/testing/ns-core.d.mts +340 -0
- package/lib/types/value-lists.spec.d.ts +1 -0
- package/lib/types/values/sidebar.d.ts +46 -0
- package/lib/types/values/tab-page.d.ts +16 -0
- package/lib/types/view-switcher-stack.spec.d.ts +1 -0
- package/lib/types/widgets/adw-about-dialog.d.ts +12 -0
- package/lib/types/widgets/adw-action-row.d.ts +22 -0
- package/lib/types/widgets/adw-alert-dialog.d.ts +18 -1
- package/lib/types/widgets/adw-avatar.d.ts +12 -0
- package/lib/types/widgets/adw-banner.d.ts +12 -0
- package/lib/types/widgets/adw-bottom-sheet.d.ts +77 -6
- package/lib/types/widgets/adw-button-content.d.ts +12 -0
- package/lib/types/widgets/adw-button-row.d.ts +21 -0
- package/lib/types/widgets/adw-carousel-indicator-dots.d.ts +7 -0
- package/lib/types/widgets/adw-carousel-indicator-lines.d.ts +7 -0
- package/lib/types/widgets/adw-carousel.d.ts +31 -15
- package/lib/types/widgets/adw-clamp.d.ts +19 -0
- package/lib/types/widgets/adw-combo-row.d.ts +20 -1
- package/lib/types/widgets/adw-data-grid.d.ts +12 -0
- package/lib/types/widgets/adw-expander-row.d.ts +2 -0
- package/lib/types/widgets/adw-header-bar.d.ts +14 -0
- package/lib/types/widgets/adw-image-button.d.ts +12 -0
- package/lib/types/widgets/adw-navigation-page.d.ts +63 -0
- package/lib/types/widgets/adw-navigation-view.d.ts +18 -5
- package/lib/types/widgets/adw-preferences-dialog.d.ts +12 -0
- package/lib/types/widgets/adw-preferences-group.d.ts +14 -0
- package/lib/types/widgets/adw-preferences-page.d.ts +12 -0
- package/lib/types/widgets/adw-shortcut-label.d.ts +12 -0
- package/lib/types/widgets/adw-sidebar.d.ts +26 -0
- package/lib/types/widgets/adw-slider-row.d.ts +12 -0
- package/lib/types/widgets/adw-spin-row.d.ts +12 -1
- package/lib/types/widgets/adw-spinner.d.ts +12 -0
- package/lib/types/widgets/adw-split-button.d.ts +12 -0
- package/lib/types/widgets/adw-status-page.d.ts +46 -0
- package/lib/types/widgets/adw-tab-view.d.ts +60 -27
- package/lib/types/widgets/adw-toast-overlay.d.ts +20 -0
- package/lib/types/widgets/adw-toggle-group.d.ts +51 -3
- package/lib/types/widgets/adw-toggle.d.ts +41 -0
- package/lib/types/widgets/adw-toolbar-view.d.ts +22 -1
- package/lib/types/widgets/adw-view-stack.d.ts +53 -7
- package/lib/types/widgets/adw-view-switcher-bar.d.ts +19 -2
- package/lib/types/widgets/adw-window-title.d.ts +12 -0
- package/lib/types/widgets/adw-wrap-box.d.ts +12 -0
- package/lib/types/widgets/bottom-sheet-state.d.ts +40 -7
- package/lib/types/widgets/box-layout.d.ts +3 -17
- package/lib/types/widgets/builder-slots.d.ts +48 -0
- package/lib/types/widgets/button-content.d.ts +4 -3
- package/lib/types/widgets/carousel-indicator-base.d.ts +54 -0
- package/lib/types/widgets/carousel-state.d.ts +12 -9
- package/lib/types/widgets/chrome.d.ts +32 -6
- package/lib/types/widgets/construct-props.d.ts +46 -5
- package/lib/types/widgets/gtk-action-bar.d.ts +53 -0
- package/lib/types/widgets/gtk-box.d.ts +12 -0
- package/lib/types/widgets/gtk-button.d.ts +27 -0
- package/lib/types/widgets/gtk-drop-down.d.ts +23 -1
- package/lib/types/widgets/gtk-entry.d.ts +12 -0
- package/lib/types/widgets/gtk-image.d.ts +12 -0
- package/lib/types/widgets/gtk-label.d.ts +47 -1
- package/lib/types/widgets/gtk-menu-button.d.ts +22 -0
- package/lib/types/widgets/id-reference.d.ts +13 -0
- package/lib/types/widgets/index.d.ts +16 -5
- package/lib/types/widgets/signals.d.ts +14 -1
- package/lib/types/widgets/split-view-base.d.ts +26 -2
- package/lib/types/widgets/tab-view-state.d.ts +3 -3
- package/lib/types/widgets/view-stack-page.d.ts +98 -0
- package/lib/types/widgets/view-stack-state.d.ts +7 -3
- package/lib/types/widgets/view-switcher-base.d.ts +62 -0
- package/lib/types/widgets/widget-layout.d.ts +50 -0
- package/package.json +21 -11
- package/src/theme/adwaita.css +122 -1
- package/lib/esm/widgets/label-text.js +0 -1
- package/lib/types/widgets/label-text.d.ts +0 -13
- /package/lib/types/{label-text.spec.d.ts → gio-menu.spec.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{declaredBuilderReferences as e,declaredBuilderSlots as t}from"../widgets/builder-slots.js";import{adw_exports as n}from"../namespace/adw.js";import{gtk_exports as r}from"../namespace/gtk.js";import{propertyOf as i}from"@gjsify/adwaita-core/tags";import{View as a}from"@nativescript/core";const o={adw:n,gtk:r};function elementFor(e){for(let[t,n]of Object.entries(o)){let r=`${t[0].toUpperCase()}${t.slice(1)}`;if(!e.startsWith(r))continue;let i=e.slice(r.length),a=n[i];if(typeof a!=`function`)throw Error(`Module '~/${t}' has no member for element '${t}:${i}' — the name \`${e}\` is authored in the shared corpus and this dialect cannot spell it. Give the widget a namespace member (ADR 0034 clause 2), or ledger the block as divergent.`);if(a.name!==e)throw Error(`'${t}:${i}' resolves to class \`${a.name}\`, not \`${e}\`. The corpus is authored in GIR class names and ADR 0034 clause 1 says a widget carries that name, so a barrel member bound to another class would build the wrong widget at exit 0.`);return{xmlName:`${t}:${i}`,ctor:a}}throw Error(`\`${e}\` starts with no library this dialect has a barrel for (${Object.keys(o).join(`, `)}).`)}function build(e){let t=buildTree(e);if(!(t instanceof a))throw Error(`\`${e.tag}\` is not a widget, so a tree cannot root at it: there is nothing to show.`);return t}function buildDialog(e){let t=buildTree(e);if(t instanceof a||typeof t.present!=`function`)throw Error(`\`${e.tag}\` is not a dialog: it has no \`present()\`, so use \`build\` for it.`);return t}function buildTree(e){let t={ids:new Map,pending:[]},n=buildNode(e,t);for(let{view:e,element:n,prop:r,id:i}of t.pending){let a=t.ids.get(i);if(a===void 0)throw Error(`<${n.xmlName} ${r}="${i}"> names no object: nothing in this tree has the id '${i}', so \`${r}\` would be handed the string instead of the widget it refers to.`);e[r]=a}return n}function buildNode(e,t){let n=elementFor(e.tag),r=new n.ctor,i=r instanceof a?buildView(e,n,r,t):buildValue(e,n,r);for(let r of e.children??[]){let a=i;if(typeof a._addChildFromBuilder!=`function`)throw Error(`<${n.xmlName}> takes no XML child: \`${e.tag}\` has no \`_addChildFromBuilder\`, so the corpus nests a node this element cannot hold.`);a._addChildFromBuilder(builderNameFor(n,e.tag,r),buildNode(r,t))}return i}function unknownProperty(e,t,n,r,i){return Error(`<${e.xmlName} ${n}="${String(i)}"> reaches nothing: \`${t}\` declares no '${r}'. NativeScript's builder assigns it anyway, as a dead own-property at exit 0, so the attribute door cannot report this and the tree would render without it.`)}function buildView(t,n,r,a){if(t.id!==void 0){if(a.ids.has(t.id))throw Error(`Two nodes of this tree carry the id '${t.id}'; GtkBuilder refuses a duplicate id.`);a.ids.set(t.id,r),r.id=t.id}let o=e(n.ctor);for(let[e,s]of Object.entries(t.props??{})){let c=i(e);if(!(c in r))throw unknownProperty(n,t.tag,e,c,s);if(o.includes(c)){a.pending.push({view:r,element:n,prop:c,id:String(s)});continue}r[c]=String(s)}if(t.styleClasses!==void 0&&t.styleClasses.length>0){if(!(`styleClasses`in r))throw Error(`<${n.xmlName}> takes no style classes: \`${t.tag}\` declares no 'styleClasses', so [${t.styleClasses.join(`, `)}] would be dropped.`);r.styleClasses=t.styleClasses.join(` `)}if(t.extensions?.strings!==void 0)throw Error(`<${n.xmlName}> takes no string-list items: \`${t.tag}\` is a widget, and only a list model holds them, so [${t.extensions.strings.map(e=>e.value).join(`, `)}] would be dropped.`);return applyResponses(r,n,t),r}function buildValue(e,t,n){if(e.id!==void 0)throw Error(`<${t.xmlName} id="${e.id}"> reaches nothing: \`${e.tag}\` is not a view, and \`getViewById\` walks views, so code beside the \`.blp\` could never look it up.`);if(e.styleClasses!==void 0&&e.styleClasses.length>0)throw Error(`<${t.xmlName}> takes no style classes: \`${e.tag}\` is not a widget, so [${e.styleClasses.join(`, `)}] would be dropped.`);let r={};for(let[a,o]of Object.entries(e.props??{})){let s=i(a);if(!(s in n))throw unknownProperty(t,e.tag,a,s,o);r[s]=o}let a=e.extensions?.strings;if(a!==void 0){if(typeof n.append!=`function`)throw Error(`<${t.xmlName}> takes no string-list items: \`${e.tag}\` has no \`append\`, so [${a.map(e=>e.value).join(`, `)}] would be dropped.`);r.strings=a.map(e=>e.value)}let o=new t.ctor(r);return applyResponses(o,t,e),o}function applyResponses(e,t,n){let r=e,i=n.extensions?.responses;if(i!==void 0){if(typeof r.add_response!=`function`)throw Error(`<${t.xmlName}> takes no responses: \`${n.tag}\` has no \`add_response\`, so [${i.map(e=>e.id).join(`, `)}] would be dropped.`);for(let{id:e,label:t,appearance:n,enabled:a}of i)r.add_response(e,t,{...n===void 0?{}:{appearance:n},...a===void 0?{}:{enabled:a}})}}function builderNameFor(e,n,r){let i=elementFor(r.tag);if(r.slot===void 0)return i.xmlName;let a=r.slot,o=t(e.ctor);if(o===null||!o.includes(a))throw Error(`<${e.xmlName}.${a}> reaches nothing: \`${n}\` declares no such builder slot, so NativeScript would hand <${i.xmlName}> to its fallback placement instead — at exit 0, in a cell the tree never asked for. Known slots: ${o===null||o.length===0?`none`:o.join(`, `)}.`);return a}export{build,buildDialog,elementFor};
|
package/lib/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"./_virtual/_rolldown/runtime.js";import{GTK_ALIGN as ee}from"./widgets/gtk-align.js";import{DEFAULT_ICON_PIXEL_SIZE as te,GTK_ICON_SIZE_NICKS as ne,GTK_ICON_SIZE_PIXELS as e,PIXEL_SIZE_UNSET as t,isGtkIconSizeNick as n}from"./widgets/gtk-icon-size.js";import{applyConstructProps as r,nsAlignment as i}from"./widgets/construct-props.js";import{CLOSED as a}from"./widgets/adw-about-dialog.js";import{ACTIVATED as o}from"./widgets/adw-action-row.js";import{AdwAlertResponses as s,NOTIFY_RESPONSE as c}from"./widgets/adw-alert-dialog.js";import{avatarInitials as l}from"./widgets/avatar-color.js";import{AVATAR_DEFAULT_ICON as u}from"./widgets/avatar-view.js";import{adwaitaColorScheme as d,isThemeIconColor as f,onAdwaitaColorSchemeChanged as p,setAdwaitaColorScheme as m,themeIconColor as h,toggleAdwaitaColorScheme as g}from"./widgets/color-scheme.js";import{ADWAITA_ICON_GRID as _,DEFAULT_ICON_COLOR as v,DEFAULT_ICON_COLOR_DARK as y,extractIconPaths as b,extractPathData as x}from"./widgets/icon-path.js";import{ICON_FALLBACK_NAME as S,compiledIconNames as C,iconValueKind as w,isIconAvailable as T,registerIcon as E,registeredIconNames as D,resolveIconSource as O,unregisterIcon as k}from"./widgets/icon-theme.js";import{renderSymbolicIcon as A}from"./widgets/icons.js";import{DEFAULT_GTK_IMAGE_SIZE as j}from"./widgets/gtk-image.js";import{DEFAULT_AVATAR_SIZE as M}from"./widgets/adw-avatar.js";import{DEFAULT_CLAMP_MAX_SIZE as N,DEFAULT_SPINNER_SIZE as P}from"./widgets/chrome.js";import{BUTTON_CLICKED as F}from"./widgets/adw-banner.js";import{NOTIFY_OPEN as I}from"./widgets/bottom-sheet-state.js";import{attachRowPressFeedback as L}from"./widgets/row-press.js";import{DEFAULT_CAROUSEL_PAGE_WIDTH as R}from"./widgets/carousel-state.js";import{NOTIFY_POSITION as z}from"./widgets/adw-carousel.js";import{ComboState as B,NOTIFY_SELECTED as V}from"./widgets/adw-combo-row.js";import{AdwImageButton as H,DEFAULT_ICON_BUTTON_ICON_SIZE as U}from"./widgets/adw-image-button.js";import{NOTIFY_TEXT as W}from"./widgets/adw-entry-row.js";import{ExpanderState as G,NOTIFY_EXPANDED as K}from"./widgets/adw-expander-row.js";import{NOTIFY_VISIBLE_CHILD as q}from"./widgets/adw-view-stack.js";import{AdwViewSwitcherBase as J,NOTIFY_SELECTED as Y}from"./widgets/view-switcher-base.js";import{NsNavigationSplitViewState as X,NsOverlaySplitViewState as Z,splitViewColumns as re}from"./widgets/split-view-state.js";import{AdwSplitViewBase as ie,NOTIFY_SHOW_SIDEBAR as ae}from"./widgets/split-view-base.js";import{NOTIFY_VISIBLE_PAGE as oe}from"./widgets/navigation-stack.js";import{CLOSED as se}from"./widgets/adw-preferences-dialog.js";import{SHORTCUT_LABEL_CAP_TEXT_CLASS as ce,SHORTCUT_LABEL_CLASS as le,SHORTCUT_LABEL_DIMMED_CLASS as ue,SHORTCUT_LABEL_DISABLED_CLASS as de,SHORTCUT_LABEL_KEYCAP_CLASS as fe,SHORTCUT_LABEL_KEYS_CLASS as pe,SHORTCUT_LABEL_SIDE_CLASS as me,SHORTCUT_LABEL_SPACED_CLASS as he,shortcutLabelDirection as ge,shortcutLabelPlatform as _e,shortcutLabelRenderPlan as ve}from"./widgets/shortcut-label.js";import{NOTIFY_SELECTED as ye}from"./widgets/adw-sidebar.js";import{NOTIFY_VALUE as Q,SpinState as be}from"./widgets/adw-spin-row.js";import{CLICKED as xe,MENU_TAPPED as Se}from"./widgets/adw-split-button.js";import{NOTIFY_ACTIVE as Ce}from"./widgets/adw-switch-row.js";import{AdwToast as we,AdwToastQueue as Te,DEFAULT_TOAST_TIMEOUT as Ee,TOAST_BUTTON_CLICKED as De}from"./widgets/adw-toast-overlay.js";import{NOTIFY_SELECTED as Oe,ToggleGroupState as ke}from"./widgets/adw-toggle-group.js";import{adw_exports as Ae}from"./namespace/adw.js";import{DEFAULT_BOX_SPACING as je,boxChildMargin as Me,boxSpacingChanges as Ne,normalizeBoxSpacing as Pe}from"./widgets/box-layout.js";import{buttonSlotAfterWrite as Fe,buttonSlotDetaches as Ie}from"./widgets/button-slot.js";import{GTK_BUTTON_CLICKED as Le,GTK_BUTTON_LABEL_CLASS as Re}from"./widgets/gtk-button.js";import{NOTIFY_SELECTED as ze}from"./widgets/gtk-drop-down.js";import{ACTIVATE as Be,NOTIFY_TEXT as Ve}from"./widgets/gtk-entry.js";import{MENU_ITEM_ACTIVATED as He}from"./widgets/gtk-menu-button.js";import{gtk_exports as Ue}from"./namespace/gtk.js";import{ADWAITA_SANS_FONT_FAMILY as We,ADWAITA_SANS_TTF_FILES as Ge,adwaitaFontInstallInstructions as Ke,hasAdwaitaSans as qe}from"./fonts.js";import{AdwSliderRow as Je,NOTIFY_SLIDER_VALUE as Ye}from"./widgets/adw-slider-row.js";import{DATA_GRID_HEADER_CELL_CLASS as Xe,DATA_GRID_HEADER_ROW_CLASS as Ze,DATA_GRID_SECTION_CELL_CLASS as Qe,dataGridCellClass as $e,dataGridItemSpec as et,dataGridRowClass as tt,dataGridShapeKey as nt,dataGridTracksKey as rt,parseDataGridWidth as it}from"./widgets/data-grid-model.js";import{AdwDataGrid as at,ROW_ACTIVATED as ot}from"./widgets/adw-data-grid.js";import{ADWAITA_NS_ACCENT_RULES as st,adwaitaNsAccentColor as ct,adwaitaNsAccentCss as lt}from"./widgets/accent-theme.js";import{applyAdwaitaNsAccent as ut,clearAdwaitaNsAccent as dt}from"./widgets/adw-accent.js";import{AdwBreakpoint as ft,addBreakpoints as pt,evaluateBreakpointCondition as mt,parseBreakpointCondition as ht}from"./widgets/breakpoint.js";import{labelDisplayText as gt,labelMarkupIsUnparseable as _t,registerAdwaitaElements as $}from"./widgets/index.js";import{gio_exports as vt}from"./namespace/gio.js";import{assertNativeScript as yt,assertNativeScript as bt,isAndroid as xt,isIOS as St,isNativeScript as Ct}from"@gjsify/native-platform";function registerAdwaita(){bt(),$()}export{a as ABOUT_CLOSED,o as ACTIVATED,_ as ADWAITA_ICON_GRID,st as ADWAITA_NS_ACCENT_RULES,We as ADWAITA_SANS_FONT_FAMILY,Ge as ADWAITA_SANS_TTF_FILES,u as AVATAR_DEFAULT_ICON,Ae as Adw,s as AdwAlertResponses,ft as AdwBreakpoint,at as AdwDataGrid,H as AdwImageButton,Je as AdwSliderRow,ie as AdwSplitViewBase,we as AdwToast,Te as AdwToastQueue,J as AdwViewSwitcherBase,F as BUTTON_CLICKED,xe as CLICKED,B as ComboState,Xe as DATA_GRID_HEADER_CELL_CLASS,Ze as DATA_GRID_HEADER_ROW_CLASS,Qe as DATA_GRID_SECTION_CELL_CLASS,M as DEFAULT_AVATAR_SIZE,je as DEFAULT_BOX_SPACING,R as DEFAULT_CAROUSEL_PAGE_WIDTH,N as DEFAULT_CLAMP_MAX_SIZE,j as DEFAULT_GTK_IMAGE_SIZE,U as DEFAULT_ICON_BUTTON_ICON_SIZE,v as DEFAULT_ICON_COLOR,y as DEFAULT_ICON_COLOR_DARK,te as DEFAULT_ICON_PIXEL_SIZE,P as DEFAULT_SPINNER_SIZE,Ee as DEFAULT_TOAST_TIMEOUT,Be as ENTRY_ACTIVATE,G as ExpanderState,ee as GTK_ALIGN,Le as GTK_BUTTON_CLICKED,Re as GTK_BUTTON_LABEL_CLASS,ne as GTK_ICON_SIZE_NICKS,e as GTK_ICON_SIZE_PIXELS,vt as Gio,Ue as Gtk,S as ICON_FALLBACK_NAME,He as MENU_ITEM_ACTIVATED,Se as MENU_TAPPED,Ce as NOTIFY_ACTIVE,ze as NOTIFY_DROP_DOWN_SELECTED,Ve as NOTIFY_ENTRY_TEXT,K as NOTIFY_EXPANDED,I as NOTIFY_OPEN,z as NOTIFY_POSITION,c as NOTIFY_RESPONSE,V as NOTIFY_SELECTED,ae as NOTIFY_SHOW_SIDEBAR,ye as NOTIFY_SIDEBAR_SELECTED,Ye as NOTIFY_SLIDER_VALUE,W as NOTIFY_TEXT,Oe as NOTIFY_TOGGLE_SELECTED,Q as NOTIFY_VALUE,Y as NOTIFY_VIEW_SELECTED,q as NOTIFY_VISIBLE_CHILD,oe as NOTIFY_VISIBLE_PAGE,X as NsNavigationSplitViewState,Z as NsOverlaySplitViewState,t as PIXEL_SIZE_UNSET,se as PREFERENCES_CLOSED,ot as ROW_ACTIVATED,ce as SHORTCUT_LABEL_CAP_TEXT_CLASS,le as SHORTCUT_LABEL_CLASS,ue as SHORTCUT_LABEL_DIMMED_CLASS,de as SHORTCUT_LABEL_DISABLED_CLASS,fe as SHORTCUT_LABEL_KEYCAP_CLASS,pe as SHORTCUT_LABEL_KEYS_CLASS,me as SHORTCUT_LABEL_SIDE_CLASS,he as SHORTCUT_LABEL_SPACED_CLASS,be as SpinState,De as TOAST_BUTTON_CLICKED,ke as ToggleGroupState,pt as addBreakpoints,d as adwaitaColorScheme,Ke as adwaitaFontInstallInstructions,ct as adwaitaNsAccentColor,lt as adwaitaNsAccentCss,ut as applyAdwaitaNsAccent,r as applyConstructProps,yt as assertNativeScript,L as attachRowPressFeedback,l as avatarInitials,Me as boxChildMargin,Ne as boxSpacingChanges,Fe as buttonSlotAfterWrite,Ie as buttonSlotDetaches,dt as clearAdwaitaNsAccent,C as compiledIconNames,$e as dataGridCellClass,et as dataGridItemSpec,tt as dataGridRowClass,nt as dataGridShapeKey,rt as dataGridTracksKey,mt as evaluateBreakpointCondition,b as extractIconPaths,x as extractPathData,qe as hasAdwaitaSans,w as iconValueKind,xt as isAndroid,n as isGtkIconSizeNick,St as isIOS,T as isIconAvailable,Ct as isNativeScript,f as isThemeIconColor,gt as labelDisplayText,_t as labelMarkupIsUnparseable,Pe as normalizeBoxSpacing,i as nsAlignment,p as onAdwaitaColorSchemeChanged,ht as parseBreakpointCondition,it as parseDataGridWidth,registerAdwaita,$ as registerAdwaitaElements,E as registerIcon,D as registeredIconNames,A as renderSymbolicIcon,O as resolveIconSource,m as setAdwaitaColorScheme,ge as shortcutLabelDirection,_e as shortcutLabelPlatform,ve as shortcutLabelRenderPlan,re as splitViewColumns,h as themeIconColor,g as toggleAdwaitaColorScheme,k as unregisterIcon};
|
package/lib/esm/namespace/adw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{AdwAboutDialog as t}from"../widgets/adw-about-dialog.js";import{AdwActionRow as n}from"../widgets/adw-action-row.js";import{AdwAlertDialog as r}from"../widgets/adw-alert-dialog.js";import{AdwAvatar as i}from"../widgets/adw-avatar.js";import{AdwBanner as a}from"../widgets/adw-banner.js";import{AdwBottomSheet as o}from"../widgets/adw-bottom-sheet.js";import{AdwButtonContent as s}from"../widgets/adw-button-content.js";import{AdwButtonRow as c}from"../widgets/adw-button-row.js";import{AdwCarousel as l}from"../widgets/adw-carousel.js";import{AdwCarouselIndicatorDots as u}from"../widgets/adw-carousel-indicator-dots.js";import{AdwCarouselIndicatorLines as d}from"../widgets/adw-carousel-indicator-lines.js";import{AdwClamp as f}from"../widgets/adw-clamp.js";import{AdwComboRow as p}from"../widgets/adw-combo-row.js";import{AdwEntryRow as m}from"../widgets/adw-entry-row.js";import{AdwExpanderRow as h}from"../widgets/adw-expander-row.js";import{AdwWindowTitle as g}from"../widgets/adw-window-title.js";import{AdwHeaderBar as _}from"../widgets/adw-header-bar.js";import{AdwViewStackPage as v}from"../widgets/view-stack-page.js";import{AdwViewStack as y}from"../widgets/adw-view-stack.js";import{AdwInlineViewSwitcher as b}from"../widgets/adw-inline-view-switcher.js";import{AdwNavigationSplitView as x}from"../widgets/adw-navigation-split-view.js";import{AdwNavigationPage as S}from"../widgets/adw-navigation-page.js";import{AdwNavigationView as C}from"../widgets/adw-navigation-view.js";import{AdwOverlaySplitView as w}from"../widgets/adw-overlay-split-view.js";import{AdwPasswordEntryRow as T}from"../widgets/adw-password-entry-row.js";import{AdwPreferencesDialog as E}from"../widgets/adw-preferences-dialog.js";import{AdwPreferencesGroup as D}from"../widgets/adw-preferences-group.js";import{AdwPreferencesPage as O}from"../widgets/adw-preferences-page.js";import{AdwShortcutLabel as k}from"../widgets/adw-shortcut-label.js";import{AdwSidebarItem as A,AdwSidebarSection as j}from"../values/sidebar.js";import{AdwSidebar as M}from"../widgets/adw-sidebar.js";import{AdwSpinRow as N}from"../widgets/adw-spin-row.js";import{AdwSpinner as P}from"../widgets/adw-spinner.js";import{AdwSplitButton as F}from"../widgets/adw-split-button.js";import{AdwStatusPage as I}from"../widgets/adw-status-page.js";import{AdwSwitchRow as L}from"../widgets/adw-switch-row.js";import{AdwTabPage as R}from"../values/tab-page.js";import{AdwTabView as z}from"../widgets/adw-tab-view.js";import{AdwToastOverlay as B}from"../widgets/adw-toast-overlay.js";import{AdwToggle as V}from"../widgets/adw-toggle.js";import{AdwToggleGroup as H}from"../widgets/adw-toggle-group.js";import{AdwToolbarView as U}from"../widgets/adw-toolbar-view.js";import{AdwViewSwitcher as W}from"../widgets/adw-view-switcher.js";import{AdwViewSwitcherBar as G}from"../widgets/adw-view-switcher-bar.js";import{AdwWrapBox as K}from"../widgets/adw-wrap-box.js";var q=e({AboutDialog:()=>t,ActionRow:()=>n,AlertDialog:()=>r,Avatar:()=>i,Banner:()=>a,BottomSheet:()=>o,ButtonContent:()=>s,ButtonRow:()=>c,Carousel:()=>l,CarouselIndicatorDots:()=>u,CarouselIndicatorLines:()=>d,Clamp:()=>f,ComboRow:()=>p,EntryRow:()=>m,ExpanderRow:()=>h,HeaderBar:()=>_,InlineViewSwitcher:()=>b,NavigationPage:()=>S,NavigationSplitView:()=>x,NavigationView:()=>C,OverlaySplitView:()=>w,PasswordEntryRow:()=>T,PreferencesDialog:()=>E,PreferencesGroup:()=>D,PreferencesPage:()=>O,ShortcutLabel:()=>k,Sidebar:()=>M,SidebarItem:()=>A,SidebarSection:()=>j,SpinRow:()=>N,Spinner:()=>P,SplitButton:()=>F,StatusPage:()=>I,SwitchRow:()=>L,TabPage:()=>R,TabView:()=>z,ToastOverlay:()=>B,Toggle:()=>V,ToggleGroup:()=>H,ToolbarView:()=>U,ViewStack:()=>y,ViewStackPage:()=>v,ViewSwitcher:()=>W,ViewSwitcherBar:()=>G,WindowTitle:()=>g,WrapBox:()=>K});export{t as AboutDialog,n as ActionRow,r as AlertDialog,i as Avatar,a as Banner,o as BottomSheet,s as ButtonContent,c as ButtonRow,l as Carousel,u as CarouselIndicatorDots,d as CarouselIndicatorLines,f as Clamp,p as ComboRow,m as EntryRow,h as ExpanderRow,_ as HeaderBar,b as InlineViewSwitcher,S as NavigationPage,x as NavigationSplitView,C as NavigationView,w as OverlaySplitView,T as PasswordEntryRow,E as PreferencesDialog,D as PreferencesGroup,O as PreferencesPage,k as ShortcutLabel,M as Sidebar,A as SidebarItem,j as SidebarSection,N as SpinRow,P as Spinner,F as SplitButton,I as StatusPage,L as SwitchRow,R as TabPage,z as TabView,B as ToastOverlay,V as Toggle,H as ToggleGroup,U as ToolbarView,y as ViewStack,v as ViewStackPage,W as ViewSwitcher,G as ViewSwitcherBar,g as WindowTitle,K as WrapBox,q as adw_exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GioMenu as t,GioMenuItem as n}from"@gjsify/adwaita-core";var r=e({Menu:()=>t,MenuItem:()=>n});export{t as Menu,n as MenuItem,r as gio_exports};
|
package/lib/esm/namespace/gtk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GtkImage as t}from"../widgets/gtk-image.js";import{
|
|
1
|
+
import{__exportAll as e}from"../_virtual/_rolldown/runtime.js";import{GtkImage as t}from"../widgets/gtk-image.js";import{GtkActionBar as n}from"../widgets/gtk-action-bar.js";import{GtkBox as r}from"../widgets/gtk-box.js";import{GtkButton as i}from"../widgets/gtk-button.js";import{GtkDropDown as a}from"../widgets/gtk-drop-down.js";import{GtkEntry as o}from"../widgets/gtk-entry.js";import{GtkLabel as s}from"../widgets/gtk-label.js";import{GtkMenuButton as c}from"../widgets/gtk-menu-button.js";import{GtkAdjustment as l,GtkStringList as u}from"@gjsify/adwaita-core";var d=e({ActionBar:()=>n,Adjustment:()=>l,Box:()=>r,Button:()=>i,DropDown:()=>a,Entry:()=>o,Image:()=>t,Label:()=>s,MenuButton:()=>c,StringList:()=>u});export{n as ActionBar,l as Adjustment,r as Box,i as Button,a as DropDown,o as Entry,t as Image,s as Label,c as MenuButton,u as StringList,d as gtk_exports};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"../widgets/xml-values.js";var AdwSidebarItem=class{title;subtitle;iconName;visible;enabled;constructor(t){this.title=t?.title??``,this.subtitle=t?.subtitle??``,this.iconName=t?.iconName??``,this.visible=e(t?.visible,!0),this.enabled=e(t?.enabled,!0)}},AdwSidebarSection=class{title;items=[];_owner=null;constructor(e){this.title=e?.title??``}append(e){this.items.push(e),this._owner?.()}_bindOwner(e){this._owner=e}_addChildFromBuilder(e,t){if(!(t instanceof AdwSidebarItem))throw Error(`Adw.SidebarSection takes only Adw.SidebarItem children, not \`${t.constructor.name}\`.`);this.append(t)}};export{AdwSidebarItem,AdwSidebarSection};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"../widgets/builder-slots.js";var AdwTabPage=class{static builderSlots=e([`child`],`child`);title;child=null;constructor(e){this.title=e?.title??``}_addChildFromBuilder(e,t){this.child=t}};export{AdwTabPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{ActionRowState as a,isViewSensitive as o,rowLabelVisuals as s}from"./row-state.js";import{GridLayout as c,ItemSpec as l,Label as u,StackLayout as d}from"@nativescript/core";const f=`activated`,p=[`prefix`,`suffix`];var AdwActionRow=class extends i(c){static builderSlots=e(p,`suffix`);isActionRow=!0;_textStack;_titleLabel;_subtitleLabel;_rowState=new a;_prefix=null;_suffix=null;constructor(e){super(),this.className=`adw-row adw-action-row`,this.addColumn(new l(1,`auto`)),this.addColumn(new l(1,`star`)),this.addColumn(new l(1,`auto`)),this.addRow(new l(1,`auto`));let t=new d;t.orientation=`vertical`,t.className=`adw-row-text`,c.setColumn(t,1);let n=new u;n.className=`adw-row-title`,n.textWrap=!0,t.addChild(n);let i=new u;i.className=`adw-row-subtitle`,i.textWrap=!0,t.addChild(i),this.addChild(t),this._textStack=t,this._titleLabel=n,this._subtitleLabel=i,this._applyLabels(),this.addEventListener(`tap`,()=>this.activate()),r(this,e)}add_prefix(e){this._prefix&&this.remove(this._prefix),e.className=`${e.className??``} adw-row-prefix`.trim(),c.setColumn(e,0),this.insertChild(e,0),this._prefix=e}get prefix(){return this._prefix}get title(){return this._rowState.title}set title(e){this._rowState.setTitle(e)&&this._applyLabels()}get subtitle(){return this._rowState.subtitle}set subtitle(e){this._rowState.setSubtitle(e)&&this._applyLabels()}add_suffix(e){this._suffix&&this.remove(this._suffix),e.className=`${e.className??``} adw-row-suffix`.trim(),c.setColumn(e,2),this.addChild(e),this._suffix=e}remove(e){if(e===this._prefix)this._prefix=null;else if(e===this._suffix)this._suffix=null;else throw TypeError(`${this.constructor.name}.remove(): the view is neither this row's prefix nor its suffix. add_prefix()/add_suffix() are the only two slots remove() clears.`);this.removeChild(e)}get suffix(){return this._suffix}_addChildFromBuilder(e,n){t(e,p,`suffix`)===`prefix`?this.add_prefix(n):this.add_suffix(n)}get activatableWidget(){return this._rowState.activatableWidget}set activatableWidget(e){this._rowState.setActivatableWidget(e,o(e))}syncActivatableWidgetSensitivity(){let e=this._rowState.activatableWidget;e&&this._rowState.setActivatableWidgetSensitive(o(e))}get activatable(){return this._rowState.activatable}set activatable(e){this._rowState.setActivatable(n(e,!1))}activate(){if(!this._rowState.activatable)return;let e={eventName:f,object:this};this.notify(e)}_managesTitleVisibility=!0;_applyLabels(){let e=s({title:this._rowState.title,subtitle:this._rowState.subtitle});this._titleLabel.text=e.title,this._managesTitleVisibility&&(this._titleLabel.visibility=e.titleVisibility),this._subtitleLabel.text=e.subtitle,this._subtitleLabel.visibility=e.subtitleVisibility}};export{f as ACTIVATED,AdwActionRow};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Observable as n,action as r,confirm as i}from"@nativescript/core";import{AdwAlertResponses as a,AdwAlertResponses as o}from"@gjsify/adwaita-core";const s=`notify::response`;var AdwAlertDialog=class extends t(n){_responses;constructor(t=``,n=``,r){super()
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Observable as n,action as r,confirm as i}from"@nativescript/core";import{AdwAlertResponses as a,AdwAlertResponses as o}from"@gjsify/adwaita-core";const s=`notify::response`;var AdwAlertDialog=class extends t(n){_responses;constructor(t=``,n=``,r){super();let i=typeof t==`string`;this._responses=new o(i?t:``,n),i||(r=t),e(this,r)}get heading(){return this._responses.heading}set heading(e){this._responses.heading=e}get body(){return this._responses.body}set body(e){this._responses.body=e}add_response(e,t,n){this._responses.addResponse(e,t,n)}addResponses(...e){this._responses.addResponses(...e)}set_response_appearance(e,t){this._responses.setResponseAppearance(e,t)}get_response_appearance(e){return this._responses.getResponseAppearance(e)}set_response_enabled(e,t){this._responses.setResponseEnabled(e,t)}get_response_enabled(e){return this._responses.getResponseEnabled(e)}get defaultResponse(){return this._responses.defaultResponse}set defaultResponse(e){this._responses.defaultResponse=e}get closeResponse(){return this._responses.closeResponse}set closeResponse(e){this._responses.closeResponse=e}get responses(){return this._responses.responses}async present(){let e=this._responses.usesActionSheet?await this._presentAction():await this._presentConfirm();return this.notify({eventName:s,object:this,response:e}),e}async _presentConfirm(){let e=this._responses.orderResponses(),t=await i({title:this._responses.heading||void 0,message:this._responses.body||void 0,okButtonText:e.ok?.label,cancelButtonText:e.cancel?.label,neutralButtonText:e.neutral?.label,cancelable:!0});return t===!0?this._responses.resolveById(e.ok?.id):t===!1?this._responses.resolveById(e.cancel?.id):t===void 0?this._responses.resolveById(e.neutral?.id):this._responses.closeResponse}async _presentAction(){let e=await r({title:this._responses.heading||void 0,message:this._responses.body||void 0,cancelButtonText:`Cancel`,actions:this._responses.responses.map(e=>e.label)});return this._responses.resolveLabel(e)}};export{AdwAlertDialog,a as AdwAlertResponses,s as NOTIFY_RESPONSE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{avatarColor as i,avatarInitials as a}from"./avatar-color.js";import{AVATAR_DEFAULT_ICON as o,avatarViewState as s}from"./avatar-view.js";import{GtkImage as c}from"./gtk-image.js";import{GridLayout as l,ItemSpec as u,Label as d}from"@nativescript/core";import{avatarIconSize as f,avatarMaxFontSize as p}from"@gjsify/adwaita-core";const m=48;var AdwAvatar=class extends r(l){_label;_icon;_text=``;_size=48;_showInitials=!1;_iconName=``;constructor(e){super(),this.className=`adw-avatar`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`star`));let t=new d;t.className=`adw-avatar-label`,t.horizontalAlignment=`center`,t.verticalAlignment=`middle`,l.setColumn(t,0),l.setRow(t,0),this.addChild(t),this._label=t;let r=new c;r.className=`adw-icon adw-avatar-icon`,r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,l.setColumn(r,0),l.setRow(r,0),this.addChild(r),this._icon=r,this._applySize(),this._applyColor(),this._applyMode(),n(this,e)}_applySize(){this.width=this._size,this.height=this._size,this.set(`borderRadius`,this._size/2),this._label.set(`fontSize`,Math.round(Math.min(this._size*.4,p(this._size)))),this._icon.pixelSize=f(this._size)}_applyColor(){let{fill:e,fg:t}=i(this._text);this.set(`backgroundColor`,e),this._label.set(`color`,t),this._icon.iconColor=t}_applyMode(){let e=s({showInitials:this._showInitials,text:this._text,iconName:this._iconName});this._label.visibility=e.label,this._icon.visibility=e.icon,e.icon===`visible`&&(this._icon.iconName=e.iconName)}get text(){return this._text}set text(e){this._text=e??``,this._label.text=a(this._text),this._applyColor(),this._applyMode()}get size(){return this._size}set size(e){let n=t(e,48);this._size=n>0?n:48,this._applySize()}get showInitials(){return this._showInitials}set showInitials(t){this._showInitials=e(t,!1),this._applyMode()}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._applyMode()}};export{o as AVATAR_DEFAULT_ICON,AdwAvatar,m as DEFAULT_AVATAR_SIZE,i as avatarColor,a as avatarInitials};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{attachRowPressFeedback as h}from"./row-press.js";import{GridLayout as g,ItemSpec as _,Label as v,StackLayout as y}from"@nativescript/core";const b=`adw-bottom-sheet-content`,x=`adw-bottom-sheet-sheet`,S=[`sheet`,`bottomBar`,`content`];var AdwBottomSheet=class extends i(g){static builderSlots=e(S,`content`);_content=null;_dimming;_sheetPanel;_sheetPage;_bottomBarBin;_sheetChild=null;_bottomBar=null;_state=f();constructor(e){super(),this.className=`adw-bottom-sheet`,this.addColumn(new _(1,`star`)),this.addRow(new _(1,`star`));let t=new g;t.className=s,g.setColumn(t,0),g.setRow(t,0),t.addEventListener(`tap`,()=>this.requestClose(`dimming`)),this.addChild(t),this._dimming=t;let n=new y;n.orientation=`vertical`,n.className=`adw-bottom-sheet-panel`,n.verticalAlignment=`bottom`,g.setColumn(n,0),g.setRow(n,0);let i=new y;i.orientation=`vertical`,i.className=a,i.addEventListener(`tap`,()=>this.requestOpen(`bottom-bar`)),h(i),n.addChild(i);let o=new y;o.orientation=`vertical`,n.addChild(o);let l=new v;l.text=`━`,l.className=`adw-bottom-sheet-handle`,l.horizontalAlignment=`center`,l.isUserInteractionEnabled=!1,o.addChild(l),this.addChild(n),this._sheetPanel=n,this._sheetPage=o,this._bottomBarBin=i,this._paintChrome(),this._state.subscribe(e=>{this._paintChrome();let t={eventName:c,object:this,open:e};this.notify(t)}),r(this,e)}_paintChrome(){d({dimming:this._dimming,panel:this._sheetPanel,page:this._sheetPage,bottomBar:this._bottomBarBin},this._state.chrome)}set_content(e){this._content!==e&&(this._content&&(this._content.className=p(this._content.className,b),this.removeChild(this._content)),this._content=e,e&&(e.className=u(e.className,b),g.setColumn(e,0),g.setRow(e,0),this.insertChild(e,0)))}set_sheet(e){this._sheetChild!==e&&(this._sheetChild&&(this._sheetChild.className=p(this._sheetChild.className,x),this._sheetPage.removeChild(this._sheetChild)),this._sheetChild=e,e&&(e.className=u(e.className,x),this._sheetPage.addChild(e)))}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,S,`content`);r===`sheet`?this.set_sheet(n):r===`bottomBar`?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.modal))&&this._paintChrome()}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,c as NOTIFY_OPEN,l as SHEET_CLOSE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{ButtonRowState as t,buttonRowIconColor as n,buttonRowIconVisuals as r}from"./row-state.js";import{ACTIVATED as i,AdwActionRow as a}from"./adw-action-row.js";import{GtkImage as o}from"./gtk-image.js";import{attachRowPressFeedback as s}from"./row-press.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{ButtonRowState as t,buttonRowIconColor as n,buttonRowIconVisuals as r}from"./row-state.js";import{ACTIVATED as i,AdwActionRow as a}from"./adw-action-row.js";import{GtkImage as o}from"./gtk-image.js";import{attachRowPressFeedback as s}from"./row-press.js";import{classNameWith as c,normalizeStyleClasses as l,withCssClass as u,withoutCssClass as d}from"./style-classes.js";import{StackLayout as f}from"@nativescript/core";import{adwaitaAccent as p,onAdwaitaAccentChanged as m}from"@gjsify/adwaita-core";const h=`adw-row adw-action-row adw-button-row`;var g=class AdwButtonRow extends a{isActionRow=!1;_contentBox;_startIcon;_endIcon;_pinnedIconColor=null;_unsubAccent=null;_buttonState=new t;_styleClasses=[];constructor(t){super(),this.className=h,this._titleLabel.className=`adw-button-row-title`,this._titleLabel.horizontalAlignment=`center`,this._textStack.removeChild(this._titleLabel);let n=new f;n.orientation=`horizontal`,n.className=`adw-button-row-content`,n.horizontalAlignment=`center`,this._startIcon=AdwButtonRow._makeIcon(`adw-button-row-start-icon`),this._endIcon=AdwButtonRow._makeIcon(`adw-button-row-end-icon`),this._applyIconColor(),this.addEventListener(`loaded`,()=>{this._applyIconColor(),this._unsubAccent??=m(()=>this._applyIconColor())}),this.addEventListener(`unloaded`,()=>{this._unsubAccent?.(),this._unsubAccent=null}),n.addChild(this._startIcon),n.addChild(this._titleLabel),n.addChild(this._endIcon),this._textStack.addChild(n),this._textStack.horizontalAlignment=`center`,this._contentBox=n,this.activatable=!0,this._applyIcons(),s(this),e(this,t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(l(e))}add_css_class(e){this._setClasses(u(this._styleClasses,e))}remove_css_class(e){this._setClasses(d(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(l([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=c(h,e)}static _makeIcon(e){let t=new o;return t.className=`${t.className} ${e}`.trim(),t.verticalAlignment=`middle`,t}get startIconName(){return this._buttonState.startIconName}set startIconName(e){this._buttonState.setStartIconName(e)&&this._applyIcons()}get endIconName(){return this._buttonState.endIconName}set endIconName(e){this._buttonState.setEndIconName(e)&&this._applyIcons()}get startIconColor(){return this._startIcon.iconColor}set startIconColor(e){this._pinnedIconColor=e||null,this._applyIconColor()}_applyIconColor(){let e=n(this._pinnedIconColor,p());this._startIcon.iconColor=e,this._endIcon.iconColor=e}_applyIcons(){let e=r(this._buttonState.state);this._startIcon.iconName=e.startIcon,this._startIcon.visibility=e.startIconVisibility,this._endIcon.iconName=e.endIcon,this._endIcon.visibility=e.endIconVisibility}};export{i as ACTIVATED,g as AdwButtonRow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwCarouselIndicatorBase as t}from"./carousel-indicator-base.js";var AdwCarouselIndicatorDots=class extends t{_markerClass=`adw-carousel-dot`;_markerText=`●`;constructor(t){super(`adw-carousel-indicator-dots`),e(this,t)}};export{AdwCarouselIndicatorDots};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{AdwCarouselIndicatorBase as t}from"./carousel-indicator-base.js";var AdwCarouselIndicatorLines=class extends t{_markerClass=`adw-carousel-line`;_markerText=``;constructor(t){super(`adw-carousel-indicator-lines`),e(this,t)}};export{AdwCarouselIndicatorLines};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e,xmlNumber as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{CarouselScrollSync as i,DEFAULT_CAROUSEL_PAGE_WIDTH as a,
|
|
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){_scroller;_track;_state=l({onScrollTo:e=>this._performScroll(e)});_sync=new i;_views=new Map;_nextPageId=0;_pageWidth=320;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){let t=this._idOf(e);t!==null&&this._scrollToIndex(this._state.indexOf(t))}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()),!0)}_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{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{DEFAULT_CLAMP_MAX_SIZE as r,DEFAULT_CLAMP_TIGHTENING_THRESHOLD as i,clampAllocationFor as a,clampChildClassName as o,defaultClampProps as s,normalizeClampProp as c}from"./chrome.js";import{GridLayout as l,ItemSpec as u}from"@nativescript/core";var AdwClamp=class extends n(l){static builderSlots=e([`child`],`child`);_props=s();_child=null;_clampWidth=0;constructor(e){super(),this.className=`adw-clamp`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`)),this.addEventListener(`layoutChanged`,()=>this._allocate()),t(this,e)}set_child(e){this._child&&=(this._child.className=o(this._child.className,null),this.removeChild(this._child),null),e&&(e.horizontalAlignment=`center`,l.setColumn(e,0),l.setRow(e,0),this.addChild(e),this._child=e,this._allocate())}get child(){return this._child}_addChildFromBuilder(e,t){this.set_child(t)}get maximumSize(){return this._props.maximumSize}set maximumSize(e){this._props.maximumSize=c(e,r),this._allocate()}get tighteningThreshold(){return this._props.tighteningThreshold}set tighteningThreshold(e){this._props.tighteningThreshold=c(e,i),this._allocate()}_allocate(){let e=this.getActualSize?.();if(e&&e.width>0&&(this._clampWidth=e.width),!this._child)return;let{width:t,sizeClass:n}=a(this._clampWidth,this._props);this._child.width=t;let r=o(this._child.className,n);this._child.className!==r&&(this._child.className=r)}};export{AdwClamp,r as DEFAULT_CLAMP_MAX_SIZE,i as DEFAULT_CLAMP_TIGHTENING_THRESHOLD};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{attachRowPressFeedback as o}from"./row-press.js";import{Label as s,StackLayout as c,action as l}from"@nativescript/core";import{ComboState as u,ComboState as d,normalizeComboOptions as f}from"@gjsify/adwaita-core";import{panDownSymbolic as p}from"@gjsify/adwaita-icons/ui";const m=`notify::selected`;var AdwComboRow=class extends i{static builderSlots=e([...i.builderSlots,`model`],`suffix`);_valueLabel;_chevron;_state=new d;_pendingSelected=null;constructor(e){super(),this.className=`adw-row adw-action-row adw-combo-row`;let t=new c;t.orientation=`horizontal`,t.className=`adw-combo-suffix`;let n=new s;n.className=`adw-combo-value`,n.text=``;let i=new a;i.className=`adw-combo-chevron`,i.iconColor=`#9a9a9a`,i.pixelSize=16,i.iconName=p,t.addChild(n),t.addChild(i),this.add_suffix(t),this._valueLabel=n,this._chevron=i,this._state.subscribe(e=>{if(this._valueLabel.text=e.label,this._syncChooser(),e.interactive){let t={eventName:m,object:this,selected:e.selected,value:e.value};this.notify(t)}}),this.addEventListener(`tap`,()=>{this._openChooser()}),o(this),this._syncChooser(),r(this,e)}_syncChooser(){this._chevron.visibility=this._state.presentsChooser?`visible`:`collapse`}async _openChooser(){if(!this._state.presentsChooser)return;let e=this._state.model.map(e=>e.label),t=await l({title:this.title||void 0,cancelButtonText:`Cancel`,actions:e});this._state.select(e.indexOf(t))}get model(){return this._state.model}set model(e){if(this._state.setModel(f(e)),this._pendingSelected!==null&&this._pendingSelected<this._state.model.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelectedIndex(e)}}_addChildFromBuilder(e,n){if(t(e,[`model`],`edge`)===`model`){this.model=n;return}super._addChildFromBuilder(e,n)}get selected(){return this._state.selectedIndex}set selected(e){let t=n(e,this.selected);if(this._state.model.length===0){this._pendingSelected=t;return}this._state.setSelectedIndex(t)}get selectedValue(){return this._state.selectedValue}set selectedValue(e){this._state.setSelectedValue(e)}};export{AdwComboRow,u as ComboState,m as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{AdwActionRow as i}from"./adw-action-row.js";import{GtkImage as a}from"./gtk-image.js";import{GridLayout as o,ItemSpec as s,StackLayout as c}from"@nativescript/core";import{ExpanderState as l,ExpanderState as u}from"@gjsify/adwaita-core";import{panDownSymbolic as d,panUpSymbolic as f}from"@gjsify/adwaita-icons/ui";const p=`notify::expanded`,m=[`prefix`,`suffix`],h=[`prefix`];var AdwExpanderRow=class extends i{static builderSlots=e(h,`row`);isActionRow=!1;_toggle;_disclosure;_state=new u;constructor(e){super(),this.className=`adw-row adw-action-row adw-expander-row`,this.addRow(new s(1,`auto`));let t=new c;t.orientation=`vertical`,t.className=`adw-expander-disclosure`,t.visibility=`collapse`,o.setRow(t,1),o.setColumn(t,0),o.setColumnSpan(t,3),this.addChild(t),this._disclosure=t;let n=new a;n.iconName=d,n.className=`${n.className} adw-expander-toggle`.trim(),this.add_suffix(n),this._toggle=n,this._state.subscribe(e=>{this._disclosure.visibility=e?`visible`:`collapse`,this._toggle.iconName=e?f:d;let t={eventName:p,object:this,expanded:e};this.notify(t)});let toggleOnTap=()=>{this._state.toggle()};this._textStack.addEventListener(`tap`,toggleOnTap),n.addEventListener(`tap`,toggleOnTap),r(this,e)}add_row(e){this._disclosure.addChild(e)}remove(e){this._disclosure.removeChild(e)}_addChildFromBuilder(e,n){let r=t(e,m,`row`);r===`row`?this.add_row(n):super._addChildFromBuilder(r,n)}get disclosureRows(){let e=[];for(let t=0;t<this._disclosure.getChildrenCount();t++)e.push(this._disclosure.getChildAt(t));return e}get expanded(){return this._state.expanded}set expanded(e){this._state.setExpanded(n(e,!1))}};export{AdwExpanderRow,l as ExpanderState,p as NOTIFY_EXPANDED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{withSignals as r}from"./signals.js";import{classNameWith as i,normalizeStyleClasses as a}from"./style-classes.js";import{AdwWindowTitle as o}from"./adw-window-title.js";import{GridLayout as s,ItemSpec as c,StackLayout as l}from"@nativescript/core";const u=[`titleWidget`,`startBox`,`endBox`,`title-widget`,`start`,`end`];var AdwHeaderBar=class extends r(s){static builderSlots=e(u,`startBox`);_startBox;_endBox;_titleWidget;_styleClasses=[];constructor(e){super(),this.className=`adw-header-bar`,this.addColumn(new c(1,`auto`)),this.addColumn(new c(1,`star`)),this.addColumn(new c(1,`auto`)),this.addRow(new c(1,`auto`));let t=new l;t.orientation=`horizontal`,t.className=`adw-header-bar-start`,s.setColumn(t,0),this.addChild(t),this._startBox=t;let r=new o;r.horizontalAlignment=`center`,r.verticalAlignment=`middle`,s.setColumn(r,1),this.addChild(r),this._titleWidget=r;let i=new l;i.orientation=`horizontal`,i.className=`adw-header-bar-end`,i.horizontalAlignment=`right`,s.setColumn(i,2),this.addChild(i),this._endBox=i,n(this,e)}get title(){return this._titleWidget instanceof o?this._titleWidget.title:``}set title(e){this._titleWidget instanceof o&&(this._titleWidget.title=e??``)}get subtitle(){return this._titleWidget instanceof o?this._titleWidget.subtitle:``}set subtitle(e){this._titleWidget instanceof o&&(this._titleWidget.subtitle=e??``)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._styleClasses=a(e),this.className=i(`adw-header-bar`,this._styleClasses)}pack_start(e){this._startBox.addChild(e)}pack_end(e){this._endBox.insertChild(e,0)}set_title_widget(e){this._titleWidget&&this.removeChild(this._titleWidget),e.horizontalAlignment=`center`,e.verticalAlignment=`middle`,s.setColumn(e,1),this.addChild(e),this._titleWidget=e}_addChildFromBuilder(e,n){switch(t(e,u,`startBox`)){case`titleWidget`:case`title-widget`:this.set_title_widget(n);return;case`endBox`:case`end`:this.pack_end(n);return;default:this.pack_start(n)}}get titleWidget(){return this._titleWidget}get startBox(){return this._startBox}get endBox(){return this._endBox}};export{AdwHeaderBar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{xmlBoolean as t}from"./xml-values.js";import{applyConstructProps as n}from"./construct-props.js";import{withSignals as r}from"./signals.js";import{GridLayout as i,ItemSpec as a}from"@nativescript/core";var AdwNavigationPage=class extends r(i){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{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{NOTIFY_VISIBLE_PAGE as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{AdwNavigationPage as r}from"./adw-navigation-page.js";import{NOTIFY_VISIBLE_PAGE as i,NsNavigationStack as a,POPPED as o,PUSHED as s,REPLACED as c,navigationPageClassName as l}from"./navigation-stack.js";import{GridLayout as u,ItemSpec as d}from"@nativescript/core";import{describeNavigationDiagnostic as f}from"@gjsify/adwaita-core";var AdwNavigationView=class extends n(u){_nav;constructor(e){super(),this.className=`adw-navigation-view`,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`)),this._nav=new a({attachPage:e=>{e.className=l(e.className),u.setColumn(e,0),u.setRow(e,0),this.addChild(e)},detachPage:e=>this.removeChild(e),setPageVisibility:(e,t)=>{e.visibility=t},emit:e=>this._emitNavigation(e)},{onDiagnostic:e=>console.warn(`[AdwNavigationView] ${f(e)}`)}),t(this,e)}add(e,t=null,n={}){return this._nav.add(e,t,n)}_addChildFromBuilder(e,t){if(t instanceof r){this.add(t,t.tag,{title:t.title,canPop:t.canPop}),t._setOwner(this);return}this.add(t)}remove(e){return this._nav.remove(e)}push(e,t={}){return this._nav.push(e,t)}push_by_tag(e){return this._nav.pushByTag(e)}pop(){return this._nav.pop()}pop_to_page(e){return this._nav.popToPage(e)}pop_to_tag(e){return this._nav.popToTag(e)}replace(e){this._nav.replace(e)}replace_with_tags(e){this._nav.replaceWithTags(e)}find_page(e){return this._nav.findPage(e)}get_previous_page(e){return this._nav.getPreviousPage(e)}setPageTag(e,t){return this._nav.setTag(e,t)}setPageTitle(e,t){return this._nav.setTitle(e,t)}setPageCanPop(e,t){return this._nav.setCanPop(e,t)}canGoBack(){return this._nav.canGoBack()}backButtonTooltip(e){return this._nav.backButtonTooltip(e)}popFromShortcut(){return this._nav.popFromShortcut()}popFromEscape(){return this._nav.popFromEscape()}get visiblePage(){return this._nav.visiblePage}get visiblePageTag(){return this._nav.visiblePageTag}get depth(){return this._nav.depth}get navigationStack(){return this._nav.stack}get pages(){return this._nav.pages}get animateTransitions(){return this._nav.animateTransitions}set animateTransitions(t){let n=e(t,this.animateTransitions);this._nav.setAnimateTransitions(n)}get popOnEscape(){return this._nav.popOnEscape}set popOnEscape(t){let n=e(t,this.popOnEscape);this._nav.setPopOnEscape(n)}_emitNavigation(e){let t={eventName:e.name,object:this,page:e.page,tag:e.tag,depth:e.depth};this.notify(t)}};export{AdwNavigationView,i as NOTIFY_VISIBLE_PAGE,o as POPPED,s as PUSHED,c as REPLACED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{withSignals as r}from"./signals.js";import{PREFERENCES_GROUP_HEADER_CLASS as i,preferencesGroupVisuals as a}from"./preferences-group-state.js";import{GridLayout as o,ItemSpec as s,Label as c,StackLayout as l}from"@nativescript/core";const u=[`headerSuffix`,`header-suffix`];var AdwPreferencesGroup=class extends r(l){static builderSlots=e(u,`row`);_header;_titleLabel;_descriptionLabel;_suffixHost;_listbox;_title=``;_description=``;_headerSuffix=null;constructor(e){super(),this.orientation=`vertical`,this.className=`adw-preferences-group`;let t=new o;t.className=i,t.addColumn(new s(1,`star`)),t.addColumn(new s(1,`auto`)),t.addRow(new s(1,`auto`));let r=new l;r.orientation=`vertical`,r.className=`adw-preferences-group-labels`,r.verticalAlignment=`middle`,o.setColumn(r,0),t.addChild(r);let a=new c;a.className=`adw-preferences-group-title`,a.textWrap=!0,r.addChild(a);let u=new c;u.className=`adw-preferences-group-description`,u.textWrap=!0,r.addChild(u);let d=new l;d.orientation=`horizontal`,d.className=`adw-preferences-group-suffix`,d.verticalAlignment=`middle`,o.setColumn(d,1),t.addChild(d);let f=new l;f.orientation=`vertical`,f.className=`boxed-list adw-preferences-group-listbox`,this.addChild(t),this.addChild(f),this._header=t,this._titleLabel=a,this._descriptionLabel=u,this._suffixHost=d,this._listbox=f,this._applyVisuals(),n(this,e)}get title(){return this._title}set title(e){this._title=e??``,this._titleLabel.text=this._title,this._applyVisuals()}get description(){return this._description}set description(e){this._description=e??``,this._descriptionLabel.text=this._description,this._applyVisuals()}get headerSuffix(){return this._headerSuffix}set headerSuffix(e){e!==this._headerSuffix&&(this._headerSuffix&&this._suffixHost.removeChild(this._headerSuffix),this._headerSuffix=e,this._headerSuffix&&this._suffixHost.addChild(this._headerSuffix),this._applyVisuals())}_addChildFromBuilder(e,n){let r=t(e,u,`row`);if(r===`headerSuffix`||r===`header-suffix`){this.headerSuffix=n;return}this.add(n)}add(e){this._listbox.addChild(e),this._refreshRowEdges(),this._applyVisuals()}remove(e){this._listbox.removeChild(e),this._refreshRowEdges(),this._applyVisuals()}searchRows(){let e=[],t=this._listbox.getChildrenCount();for(let n=0;n<t;n++)e.push(this._listbox.getChildAt(n));return e}_applyVisuals(){let e=a({title:this._title,description:this._description,hasHeaderSuffix:this._headerSuffix!==null,rowCount:this._listbox.getChildrenCount()});this._titleLabel.visibility=e.titleVisibility,this._descriptionLabel.visibility=e.descriptionVisibility,this._header.visibility=e.headerVisibility,this._header.className=e.headerClassName,this._listbox.visibility=e.listboxVisibility}_refreshRowEdges(){let e=this._listbox.getChildrenCount();for(let t=0;t<e;t++){let e=this._listbox.getChildAt(t);e&&this._setFlushTop(e,t===0)}}_setFlushTop(e,t){let n=(e.className??``).replace(/\s*\badw-row-flush-top\b/g,``);e.className=t?`${n} adw-row-flush-top`.trim():n.trim()}get listbox(){return this._listbox}};export{AdwPreferencesGroup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{SHORTCUT_LABEL_CLASS as n,shortcutLabelDirection as r,shortcutLabelPlatform as i,shortcutLabelRenderPlan as a}from"./shortcut-label.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{SHORTCUT_LABEL_CLASS as n,shortcutLabelDirection as r,shortcutLabelPlatform as i,shortcutLabelRenderPlan as a}from"./shortcut-label.js";import{Label as o,StackLayout as s}from"@nativescript/core";import{isIOS as c}from"@gjsify/native-platform";var AdwShortcutLabel=class extends t(s){_accelerator=``;_disabledText=``;constructor(t){super(),this.orientation=`horizontal`,this.className=n,this.verticalAlignment=`middle`,this.accessibilityRole=`text`,this.addEventListener(`loaded`,()=>this._rebuild()),this._rebuild(),e(this,t)}get accelerator(){return this._accelerator}set accelerator(e){this._accelerator=e??``,this._rebuild()}get disabledText(){return this._disabledText}set disabledText(e){this._disabledText=e??``,this._rebuild()}_rebuild(){let e=a(this._accelerator,{disabledText:this._disabledText,direction:r(this.style.direction),platform:i(c)});this.removeChildren();for(let t of e.children)this.addChild(buildView(t));this.accessibilityLabel=e.accessibleLabel,e.error&&console.warn(`[AdwShortcutLabel] failed to parse ${e.error}, part of accelerator '${this._accelerator}'`)}};function buildView(e){if(e.kind===`label`){let t=new o;return t.className=e.className,t.text=e.text,t.verticalAlignment=`middle`,t}let t=new s;t.orientation=`horizontal`,t.className=e.className,t.verticalAlignment=`middle`,e.direction&&(t.style.direction=e.direction);for(let n of e.children)t.addChild(buildView(n));return t}export{AdwShortcutLabel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{SidebarState as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{attachRowPressFeedback as r}from"./row-press.js";import{AdwSidebarSection as i}from"../values/sidebar.js";import{SidebarState as a,sidebarRowClassName as o,sidebarSectionsFromLabels as s}from"./sidebar-model.js";import{GridLayout as c,ItemSpec as l,Label as u,ScrollView as d,StackLayout as f}from"@nativescript/core";const p=`notify::selected`,m=`activated`;var AdwSidebar=class extends n(d){_list;_state=new a;_pendingSelected=null;_rows=[];constructor(e){super(),this.orientation=`vertical`,this.className=`adw-sidebar`;let n=new f;n.orientation=`vertical`,n.className=`adw-sidebar-list`,this.content=n,this._list=n,this._state.subscribe(e=>{this._applySelection();let t={eventName:p,object:this,selected:e.selected,title:e.item?.title??``,previous:e.previous,interactive:e.interactive};this.notify(t)}),t(this,e)}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.Sidebar takes only Adw.SidebarSection children, not \`${t.constructor.name}\`.`);this.setSections([...this._state.sections,t])}setItems(e){this.setSections(s(Array.isArray(e)?e:[]))}setSections(e){for(let t of e)t instanceof i&&t._bindOwner(()=>this.setSections(this._state.sections));if(this._state.setSections(e),this._pendingSelected!==null&&this._pendingSelected<this._state.items.length){let e=this._pendingSelected;this._pendingSelected=null,this._state.setSelected(e)}this._rebuild()}_rebuild(){for(let e of this._rows)this._list.removeChild(e.view);this._rows.length=0;for(let e of this._state.visibleItems){let t=new c;t.className=`adw-sidebar-row`,t.addColumn(new l(1,`star`)),t.addRow(new l(1,`auto`));let n=new u;n.className=`adw-sidebar-row-title`,n.text=e.item.title,n.textWrap=!0,c.setColumn(n,0),t.addChild(n),e.item.visible===!1&&(t.visibility=`collapse`),e.item.enabled===!1&&(t.opacity=.5),t.addEventListener(`tap`,()=>this._activate(e.index)),r(t),this._list.addChild(t),this._rows.push({view:t,index:e.index})}this._applySelection()}_activate(e){if(!this._state.activate(e).activated)return;let t={eventName:m,object:this,index:e,title:this._state.itemAt(e)?.title??``};this.notify(t)}_applySelection(){let e=this._state.selected,t=this._state.selectionVisible;for(let n of this._rows)n.view.className=o(n.index===e,t)}get items(){return this._state.items.map(e=>e.item.title)}set items(e){this.setItems(e)}get sections(){return this._state.sections}set sections(e){this.setSections(e)}get selected(){return this._state.selected}set selected(t){let n=e(t,this.selected);if(this._state.items.length===0){this._pendingSelected=n;return}this._state.setSelected(n)}get selectedItem(){return this._state.selectedItem}get mode(){return this._state.mode}set mode(e){this._state.setMode(e)&&this._applySelection()}get filter(){return this._state.filter}set filter(e){this._state.setFilter(e),this._rebuild()}get isEmpty(){return this._state.isEmpty}};export{m as ACTIVATED,AdwSidebar,p as NOTIFY_SELECTED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e,resolveBuilderSlot as t}from"./builder-slots.js";import{xmlNumber as n}from"./xml-values.js";import{applyConstructProps as r}from"./construct-props.js";import{AdwActionRow as i}from"./adw-action-row.js";import{AdwImageButton as a}from"./adw-image-button.js";import{Label as o,StackLayout as s}from"@nativescript/core";import{SpinState as c,SpinState as l,parseAdjustment as u}from"@gjsify/adwaita-core";import{valueDecreaseSymbolic as d,valueIncreaseSymbolic as f}from"@gjsify/adwaita-icons/actions";const p=`notify::value`;var AdwSpinRow=class extends i{static builderSlots=e([...i.builderSlots,`adjustment`],`suffix`);_minusButton;_plusButton;_valueLabel;_state=new l;constructor(e){super(),this.className=`adw-row adw-action-row adw-spin-row`;let t=new s;t.orientation=`horizontal`,t.className=`adw-spin-control`;let n=new o;n.className=`adw-spin-value`,n.text=String(this._state.value);let i=new a;i.iconName=d,i.className=`${i.className} adw-spin-button adw-spin-minus`.trim();let c=new a;c.iconName=f,c.className=`${c.className} adw-spin-button adw-spin-plus`.trim(),t.addChild(n),t.addChild(i),t.addChild(c),this.add_suffix(t),this._minusButton=i,this._plusButton=c,this._valueLabel=n,this._state.subscribe(e=>{if(this._valueLabel.text=String(e.value),e.interactive){let t={eventName:p,object:this,value:e.value};this.notify(t)}}),i.addEventListener(`tap`,()=>this._state.decrement()),c.addEventListener(`tap`,()=>this._state.increment()),r(this,e)}_addChildFromBuilder(e,n){if(t(e,[`adjustment`],`edge`)===`adjustment`){this.adjustment=n;return}super._addChildFromBuilder(e,n)}get value(){return this._state.value}set value(e){this._state.setValue(n(e,this._state.value))}get adjustment(){return this._state.adjustment}set adjustment(e){this._state.configure(typeof e==`string`?u(e):e)}};export{AdwSpinRow,p as NOTIFY_VALUE,c as SpinState};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{builderSlotsOf as e}from"./builder-slots.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{classNameWith as i,normalizeStyleClasses as a,withCssClass as o,withoutCssClass as s}from"./style-classes.js";import{statusPageIconVisibility as c,statusPageLabelVisibility as l}from"./status-page-content.js";import{GridLayout as u,ItemSpec as d,Label as f,StackLayout as p}from"@nativescript/core";const m=`adw-status-page`;var AdwStatusPage=class extends n(u){static builderSlots=e([`child`],`child`);_stack;_icon;_iconName=``;_iconLabel;_iconGlyph=``;_titleLabel;_descriptionLabel;_child=null;_styleClasses=[];constructor(e){super(),this.className=m,this.addColumn(new d(1,`star`)),this.addRow(new d(1,`star`));let n=new p;n.orientation=`vertical`,n.className=`adw-status-page-content`,n.horizontalAlignment=`center`,n.verticalAlignment=`middle`,u.setColumn(n,0),u.setRow(n,0),this.addChild(n),this._stack=n;let i=new r;i.className=`${i.className} adw-status-page-icon`.trim(),i.horizontalAlignment=`center`,i.iconColor=`#9b9b9b`,i.pixelSize=96,i.visibility=c(this._iconName),this._icon=i;let a=new f;a.className=`adw-status-page-icon-glyph`,a.horizontalAlignment=`center`,a.visibility=c(this._iconGlyph),this._iconLabel=a;let o=new f;o.className=`adw-status-page-title`,o.horizontalAlignment=`center`,o.textWrap=!0,o.visibility=l(o.text),this._titleLabel=o;let s=new f;s.className=`adw-status-page-description`,s.horizontalAlignment=`center`,s.textWrap=!0,s.visibility=l(s.text),this._descriptionLabel=s;for(let e of[i,a,o,s])n.addChild(e);t(this,e)}get iconName(){return this._iconName}set iconName(e){this._iconName=e??``,this._icon.iconName=this._iconName,this._icon.visibility=c(this._iconName),this._iconLabel.visibility=`collapse`}get iconText(){return this._iconGlyph}set iconText(e){this._iconGlyph=e??``,this._iconLabel.text=this._iconGlyph,this._iconLabel.visibility=c(this._iconGlyph),this._icon.visibility=`collapse`}get iconColor(){return this._icon.iconColor}set iconColor(e){this._icon.iconColor=e}get title(){return this._titleLabel.text??``}set title(e){let t=e??``;this._titleLabel.text=t,this._titleLabel.visibility=l(t)}get description(){return this._descriptionLabel.text??``}set description(e){let t=e??``;this._descriptionLabel.text=t,this._descriptionLabel.visibility=l(t)}set_child(e){this._child&&=(this._stack.removeChild(this._child),null),e&&(e.className=`${e.className??``} adw-status-page-child`.trim(),e.horizontalAlignment=`center`,this._stack.addChild(e),this._child=e)}get child(){return this._child}set child(e){this.set_child(e)}_addChildFromBuilder(e,t){this.set_child(t)}get styleClasses(){return[...this._styleClasses]}set styleClasses(e){this._setClasses(a(e))}add_css_class(e){this._setClasses(o(this._styleClasses,e))}remove_css_class(e){this._setClasses(s(this._styleClasses,e))}has_css_class(e){return this._styleClasses.includes((e??``).trim())}get_css_classes(){return[...this._styleClasses]}set_css_classes(e){this._setClasses(a([...e].join(` `)))}_setClasses(e){this._styleClasses=e,this.className=i(m,e)}};export{AdwStatusPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{applyTabViewVisibility as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{AdwImageButton as a}from"./adw-image-button.js";import{AdwTabPage as o}from"../values/tab-page.js";import{applyTabViewVisibility as s,createTabViewState as c,tabBarVisibility as l,tabCloseVisibilities as u,tabLabelText as d,tabViewNotifyPayload as f}from"./tab-view-state.js";import{GridLayout as p,ItemSpec as m,Label as h,StackLayout as g}from"@nativescript/core";import{tabIconState as _}from"@gjsify/adwaita-core";import{windowCloseSymbolic as v}from"@gjsify/adwaita-icons/ui";const pageHandle=e=>typeof e==`string`?e:e.id,y=`notify::selected-page`,b=`pages-changed`,x=`close-page`;var AdwTabView=class extends n(p){_state=c({onClosePage:e=>this._requestClose(e)});_bar;_contentArea;_chips=new Map;_autohide=!1;_defaultIcon=null;_generatedIds=0;closeHandler=null;constructor(e){super(),this.className=`adw-tab-view`,this.addColumn(new m(1,`star`)),this.addRow(new m(1,`auto`)),this.addRow(new m(1,`star`));let n=new g;n.orientation=`horizontal`,n.horizontalAlignment=`stretch`,n.className=`adw-tab-view-bar`,p.setRow(n,0),this.addChild(n),this._bar=n;let r=new p;r.addColumn(new m(1,`star`)),r.addRow(new m(1,`star`)),p.setRow(r,1),this.addChild(r),this._contentArea=r,this._state.subscribePages(e=>this._onPagesChange(e)),this._state.subscribe(e=>{this._applySelection();let t={eventName:y,object:this,...f(e)};this.notify(t)}),t(this,e)}get pages(){return this._state.pages}get nPages(){return this._state.nPages}get nPinnedPages(){return this._state.nPinnedPages}get selectedId(){return this._state.selectedId}get selectedIndex(){return this._state.selectedIndex}get selectedPage(){return this._state.selectedPage}set selectedPage(e){this._state.setSelectedPage(e)}isClosing(e){return this._state.isClosing(e)}set_selected_page(e){return this._state.setSelectedPage(e)}selectNthPage(e){return this._state.selectNthPage(e)}select_previous_page(){return this._state.selectPreviousPage()}select_next_page(){return this._state.selectNextPage()}selectFirstPage(){return this._state.selectFirstPage()}selectLastPage(){return this._state.selectLastPage()}cycleNextPage(){return this._state.cycleNextPage()}cyclePreviousPage(){return this._state.cyclePreviousPage()}add_page(e,t=null){return this._state.addPage(e,t===null?null:pageHandle(t))}insert(e,t){return this._state.insertPage(e,t)}prepend(e){return this._state.prependPage(e)}append(e){return this._state.appendPage(e)}insert_pinned(e,t){return this._state.insertPinnedPage(e,t)}prepend_pinned(e){return this._state.prependPinnedPage(e)}append_pinned(e){return this._state.appendPinnedPage(e)}set_page_pinned(e,t){return this._state.setPagePinned(pageHandle(e),t)}close_page(e){return this._state.closePage(pageHandle(e))}close_page_finish(e,t){return this._state.closePageFinish(pageHandle(e),t)}close_other_pages(e){this._state.closeOtherPages(pageHandle(e))}close_pages_before(e){this._state.closePagesBefore(pageHandle(e))}close_pages_after(e){this._state.closePagesAfter(pageHandle(e))}detachPage(e){return this._state.detachPage(e)}reorder_page(e,t){return this._state.reorderPage(pageHandle(e),t)}reorder_backward(e){return this._state.reorderBackward(pageHandle(e))}reorder_forward(e){return this._state.reorderForward(pageHandle(e))}reorder_first(e){return this._state.reorderFirst(pageHandle(e))}reorder_last(e){return this._state.reorderLast(pageHandle(e))}setPageTitle(e,t){return this._state.setPageTitle(e,t)}setPageIcon(e,t){return this._state.setPageIcon(e,t)}setPageLoading(e,t){return this._state.setPageLoading(e,t)}setPageNeedsAttention(e,t){return this._state.setPageNeedsAttention(e,t)}get diagnostics(){return this._state.diagnostics}get autohide(){return this._autohide}set autohide(t){let n=e(t,this.autohide);this._autohide=!!n,this._applyBarVisibility()}get defaultIcon(){return this._defaultIcon}set defaultIcon(e){this._defaultIcon=e;for(let e of this._state.pages)this._refreshChip(e.id)}_addChildFromBuilder(e,t){if(t instanceof o){if(t.child===null)throw Error(`Adw.TabPage has no child: a tab page is a page around one.`);this._state.appendPage({id:this._nextId(),title:t.title,content:t.child});return}this._state.appendPage({id:this._nextId(),content:t})}setViews(e){for(let e of this._state.pages)this._state.detachPage(e.id);for(let t of e)this._state.appendPage({id:this._nextId(),title:t.title,icon:t.icon??null,content:t.content})}get views(){return this._state.pages.map(e=>({title:e.title,content:e.content,icon:e.icon??void 0}))}set views(e){this.setViews(Array.isArray(e)?e:[])}get tabs(){return this.views}set tabs(e){this.views=e}_onPagesChange(e){switch(e.kind){case`attached`:{let t=this._state.getPage(e.id);t&&this._insertChip(t,e.position);break}case`detached`:{let t=this._chips.get(e.id);t&&this._bar.removeChild(t.button),this._chips.delete(e.id);break}case`reordered`:case`pinned`:{let t=this._chips.get(e.id);t&&(this._bar.removeChild(t.button),this._bar.insertChild(t.button,e.position)),this._refreshChip(e.id);break}case`updated`:this._refreshChip(e.id);break}this._applyBarVisibility(),this._applySelection();let t={eventName:b,object:this,...e};this.notify(t)}_insertChip(e,t){let n=new g;n.orientation=`horizontal`,n.className=`adw-tab-view-tab`,n.verticalAlignment=`middle`;let o=new r;o.className=`${o.className} adw-tab-view-tab-icon`.trim(),o.verticalAlignment=`middle`,n.addChild(o);let s=new r;s.className=`${s.className} adw-tab-view-tab-icon`.trim(),s.verticalAlignment=`middle`,n.addChild(s);let c=new h;c.className=`adw-tab-view-tab-label`,c.verticalAlignment=`middle`,n.addChild(c);let l=new a;l.className=`${l.className} adw-tab-close`.trim(),l.iconName=v,l.pixelSize=12,l.verticalAlignment=`middle`,l.addEventListener(`tap`,()=>this._state.closePage(e.id)),n.addChild(l),i(n),n.addEventListener(`tap`,()=>this._state.setSelectedPage(e.id)),this._bar.insertChild(n,t),this._chips.set(e.id,{button:n,icon:o,indicator:s,label:c,close:l});let u=e.content;u&&(p.setColumn(u,0),p.setRow(u,0),this._contentArea.addChild(u)),this._refreshChip(e.id)}_refreshChip(e){let t=this._state.getPage(e),n=this._chips.get(e);if(!t||!n)return;n.label.text=d(t),n.label.visibility=t.pinned?`collapse`:`visible`;let r=_(t,this._defaultIcon);n.icon.iconName=r.icon??``,n.icon.visibility=r.iconVisible&&r.icon!==null?`visible`:`collapse`,n.indicator.iconName=t.indicatorIcon??``,n.indicator.visibility=r.indicatorVisible?`visible`:`collapse`}_applySelection(){s(this._state);let e=u(this._state),t=this._state.selectedId;this._state.pages.forEach((n,r)=>{let i=this._chips.get(n.id);i&&(i.button.className=n.id===t?`adw-tab-view-tab active`:`adw-tab-view-tab`,i.close.visibility=e[r])})}_applyBarVisibility(){this._bar.visibility=l(this._state,this._autohide)}_requestClose(e){let t={eventName:x,object:this,id:e.id,index:this._state.getPagePosition(e.id)};return this.notify(t),this.closeHandler?this.closeHandler(e):!e.pinned}_nextId(){return this._generatedIds+=1,`tab-${this._generatedIds}`}};export{AdwTabView,x as CLOSE_PAGE,y as NOTIFY_SELECTED_PAGE,b as PAGES_CHANGED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Button as n,GridLayout as r,ItemSpec as i,Label as a}from"@nativescript/core";import{AdwToast as o,AdwToast as s,AdwToastQueue as c,AdwToastQueue as l,DEFAULT_TOAST_TIMEOUT as u}from"@gjsify/adwaita-core";const d=`toastButtonClicked`,f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t(r){_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(t){super(),this.className=`adw-toast-overlay`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let o=new r;o.className=`adw-toast`,o.visibility=`collapse`,o.verticalAlignment=`bottom`,o.horizontalAlignment=`center`,o.addColumn(new i(1,`star`)),o.addColumn(new i(1,`auto`)),o.addRow(new i(1,`auto`)),r.setColumn(o,0),r.setRow(o,0);let s=new a;s.className=`adw-toast-title`,s.textWrap=!0,r.setColumn(s,0),o.addChild(s),this._toastLabel=s;let c=new n;c.className=`adw-toast-button`,c.set(`androidElevation`,0),r.setColumn(c,1),c.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=c,this.addChild(o),this._toastStrip=o,this._queue=new l({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,t)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),r.setColumn(e,0),r.setRow(e,0),this.insertChild(e,0))}add_toast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new s(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get visible(){return this._queue.showing}};export{o as AdwToast,AdwToastOverlay,c as AdwToastQueue,u as DEFAULT_TOAST_TIMEOUT,d as TOAST_BUTTON_CLICKED};
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Button as n,GridLayout as r,ItemSpec as i,Label as a}from"@nativescript/core";import{AdwToast as o,AdwToast as s,AdwToastQueue as c,AdwToastQueue as l,DEFAULT_TOAST_TIMEOUT as u}from"@gjsify/adwaita-core";const d=`toastButtonClicked`,f={schedule:(e,t)=>setTimeout(e,t),cancel:e=>clearTimeout(e)};var AdwToastOverlay=class extends t(r){_content=null;_toastStrip;_toastLabel;_toastButton;_hasButton=!1;_queue;constructor(t){super(),this.className=`adw-toast-overlay`,this.addColumn(new i(1,`star`)),this.addRow(new i(1,`star`));let o=new r;o.className=`adw-toast`,o.visibility=`collapse`,o.verticalAlignment=`bottom`,o.horizontalAlignment=`center`,o.addColumn(new i(1,`star`)),o.addColumn(new i(1,`auto`)),o.addRow(new i(1,`auto`)),r.setColumn(o,0),r.setRow(o,0);let s=new a;s.className=`adw-toast-title`,s.textWrap=!0,r.setColumn(s,0),o.addChild(s),this._toastLabel=s;let c=new n;c.className=`adw-toast-button`,c.set(`androidElevation`,0),r.setColumn(c,1),c.addEventListener(`tap`,()=>{let e={eventName:d,object:this};this.notify(e),this._queue.dismiss()}),this._toastButton=c,this.addChild(o),this._toastStrip=o,this._queue=new l({scheduler:f,onShow:e=>this._renderStrip(e),onHide:()=>{this._toastStrip.visibility=`collapse`}}),e(this,t)}set_child(e){this._content&&this.removeChild(this._content),this._content=e,e&&(e.className=`${e.className??``} adw-toast-overlay-content`.trim(),r.setColumn(e,0),r.setRow(e,0),this.insertChild(e,0))}get child(){return this._content}set child(e){this.set_child(e)}add_toast(e){this._queue.add(e)}showToast(e,t={}){this._queue.add(new s(e??``,t))}dismiss(){this._queue.dismiss()}_renderStrip(e){this._toastLabel.text=e.title,e.hasButton?(this._toastButton.text=e.buttonLabel,this._hasButton||=(this._toastStrip.addChild(this._toastButton),!0)):this._hasButton&&=(this._toastStrip.removeChild(this._toastButton),!1),this._toastStrip.visibility=`visible`}get visible(){return this._queue.showing}};export{o as AdwToast,AdwToastOverlay,c as AdwToastQueue,u as DEFAULT_TOAST_TIMEOUT,d as TOAST_BUTTON_CLICKED};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{Label as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlNumber as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{AdwToggle as i}from"./adw-toggle.js";import{Label as a,StackLayout as o}from"@nativescript/core";import{ToggleGroupState as s,ToggleGroupState as c,keptToggles as l,toggleIndexOfName as u}from"@gjsify/adwaita-core";const d=`notify::selected`;var AdwToggleGroup=class extends n(o){_toggles=[];_pendingActive=null;_pendingActiveName=null;_segments=[];_state=new c;constructor(e){super(),this.orientation=`horizontal`,this.className=`adw-toggle-group`,this.horizontalAlignment=`center`,this._state.subscribe(e=>{this._applySelection();let t={eventName:d,object:this,selected:e.selected,value:e.value};this.notify(t)}),t(this,e)}get options(){return this._toggles.map(e=>e.label)}set options(e){this.setToggles((Array.isArray(e)?e:[]).map(e=>({label:e})))}setToggles(e){this._rebuild(e),this._applyPending(!1)}_rebuild(e){for(let e of this._segments)this.removeChild(e);this._segments.length=0,this._toggles=l(Array.isArray(e)?e:[]),this._toggles.forEach((e,t)=>{let n=new o;if(n.orientation=`horizontal`,n.className=`adw-toggle-button`,n.horizontalAlignment=`center`,e.icon){let t=new r;t.className=`${t.className} adw-toggle-icon`.trim(),t.verticalAlignment=`middle`,t.iconName=e.icon,n.addChild(t)}let i=new a;i.text=e.label,i.className=`adw-toggle-label`,i.verticalAlignment=`middle`,n.addChild(i),n.addEventListener(`tap`,()=>{this._state.setSelected(t)}),this.addChild(n),this._segments.push(n)}),this._state.setLabels(this._toggles.map(e=>e.label)),this._applySelection()}_addChildFromBuilder(e,t){if(!(t instanceof i))throw Error(`Adw.ToggleGroup takes only Adw.Toggle children, not \`${t.constructor.name}\`.`);let n=this._toggles.length;this._rebuild([...this._toggles,{label:t.label,icon:t.iconName??void 0,name:t.name}]),this._toggles.length===n&&console.warn(`[AdwToggleGroup] a toggle named '${t.name}' already exists; this one is not added`),this._applyPending(!0)}_applyPending(e){if(this._pendingActive!==null&&this._pendingActive<this._toggles.length){let e=this._pendingActive;this._pendingActive=null,this._state.setSelected(e)}if(this._pendingActiveName!==null){let t=u(this._toggles.map(e=>e.name),this._pendingActiveName);e||(this._pendingActiveName=null),t!==-1&&this._state.setSelected(t)}}_applySelection(){let e=this._state.selected;this._segments.forEach((t,n)=>{t.className=n===e?`adw-toggle-button active`:`adw-toggle-button`})}get active(){return this._state.selected}set active(t){let n=e(t,this.active);if(n>=this._toggles.length){this._pendingActive=n;return}this._state.setSelected(n)}get activeName(){return this._toggles[this.active]?.name??null}set activeName(e){this._pendingActiveName=e,this._applyPending(!0)}get selectedValue(){return this._state.selectedValue}};export{AdwToggleGroup,d as NOTIFY_SELECTED,s as ToggleGroupState};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{Observable as n}from"@nativescript/core";var AdwToggle=class extends t(n){_name=null;_label=``;_iconName=null;constructor(t){super(),e(this,t)}get name(){return this._name}set name(e){this._name=e}get label(){return this._label}set label(e){this._label=e??``}get iconName(){return this._iconName}set iconName(e){this._iconName=e}};export{AdwToggle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.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{defaultToolbarViewProps as a,toolbarViewClassNames as o}from"./chrome.js";import{NO_INSETS as s,insetsOwedBy as c,toolbarViewInsetPadding as l}from"./window-insets.js";import{resolveHostInsets as u}from"./host-insets.js";import{observeWindowInsets as d}from"./window-insets-source.js";import{GridLayout as f,ItemSpec as p,StackLayout as m}from"@nativescript/core";const h={view:`adw-toolbar-view`,topBar:`adw-toolbar-view-top`,bottomBar:`adw-toolbar-view-bottom`},g=[`topBar`,`bottomBar`,`content`,`top`,`bottom`];var AdwToolbarView=class extends i(f){static builderSlots=e(g,`content`);_topBox;_bottomBox;_content=null;_props=a();_insets=s;_topBarCount=0;_bottomBarCount=0;_detachInsets=null;constructor(e){super(),this.className=h.view,this.addColumn(new p(1,`star`)),this.addRow(new p(1,`auto`)),this.addRow(new p(1,`star`)),this.addRow(new p(1,`auto`));let t=new m;t.orientation=`vertical`,t.className=h.topBar,f.setRow(t,0),this.addChild(t),this._topBox=t;let n=new m;n.orientation=`vertical`,n.className=h.bottomBar,f.setRow(n,2),this.addChild(n),this._bottomBox=n,this.addEventListener(`layoutChanged`,()=>this._syncClasses()),this.addEventListener(`loaded`,()=>{this._detachInsets??=d(e=>this._applyInsets(e))}),this.addEventListener(`unloaded`,()=>{this._detachInsets?.(),this._detachInsets=null}),r(this,e)}add_top_bar(e){this._topBox.addChild(e),this._topBarCount+=1,this._applyInsets(this._insets)}add_bottom_bar(e){this._bottomBox.addChild(e),this._bottomBarCount+=1,this._applyInsets(this._insets)}set_content(e){this._content&&=(this.removeChild(this._content),null),e&&(f.setRow(e,1),this.addChild(e),this._content=e),this._restackBars()}_addChildFromBuilder(e,n){switch(t(e,g,`content`)){case`topBar`:case`top`:this.add_top_bar(n);return;case`bottomBar`:case`bottom`:this.add_bottom_bar(n);return;default:this.set_content(n)}}get content(){return this._content}set content(e){this.set_content(e)}get topBar(){return this._topBox}get bottomBar(){return this._bottomBox}get topBarStyle(){return this._props.topBarStyle}set topBarStyle(e){this._props.topBarStyle=e,this._syncClasses()}get bottomBarStyle(){return this._props.bottomBarStyle}set bottomBarStyle(e){this._props.bottomBarStyle=e,this._syncClasses()}get extendContentToTopEdge(){return this._props.extendContentToTopEdge}set extendContentToTopEdge(e){let t=n(e,this.extendContentToTopEdge);this._props.extendContentToTopEdge=!!t,this._applyBarPlacement()}get extendContentToBottomEdge(){return this._props.extendContentToBottomEdge}set extendContentToBottomEdge(e){let t=n(e,this.extendContentToBottomEdge);this._props.extendContentToBottomEdge=!!t,this._applyBarPlacement()}_applyBarPlacement(){f.setRow(this._topBox,+!!this._props.extendContentToTopEdge),this._topBox.verticalAlignment=this._props.extendContentToTopEdge?`top`:`stretch`,f.setRow(this._bottomBox,this._props.extendContentToBottomEdge?1:2),this._bottomBox.verticalAlignment=this._props.extendContentToBottomEdge?`bottom`:`stretch`,this._restackBars(),this._syncClasses()}_restackBars(){if(!(!this._props.extendContentToTopEdge&&!this._props.extendContentToBottomEdge))for(let e of[this._topBox,this._bottomBox])this.removeChild(e),this.addChild(e)}_applyInsets(e){this._insets=e;let t=l(c(e,u(this,e)),{hasTopBar:this._topBarCount>0,hasBottomBar:this._bottomBarCount>0});this._topBox.paddingTop=t.topBarTop,this._bottomBox.paddingBottom=t.bottomBarBottom,this.paddingTop=t.contentTop,this.paddingBottom=t.contentBottom}_syncClasses(){let e={topBarHeight:this._topBox.getActualSize?.().height??0,bottomBarHeight:this._bottomBox.getActualSize?.().height??0},t=o({view:this.className,topBar:this._topBox.className,bottomBar:this._bottomBox.className},this._props,e);this.className!==t.view&&(this.className=t.view),this._topBox.className!==t.topBar&&(this._topBox.className=t.topBar),this._bottomBox.className!==t.bottomBar&&(this._bottomBox.className=t.bottomBar)}};export{AdwToolbarView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{applyViewStackVisibility as n,createViewStackState as r,viewStackNotifyPayload as i}from"./view-stack-state.js";import{GridLayout as
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{applyConstructProps as e}from"./construct-props.js";import{withSignals as t}from"./signals.js";import{applyViewStackVisibility as n,createViewStackState as r,viewStackNotifyPayload as i}from"./view-stack-state.js";import{AdwViewStackPage as a}from"./view-stack-page.js";import{GridLayout as o,ItemSpec as s}from"@nativescript/core";const c=`notify::visible-child`;var AdwViewStack=class extends t(o){static builderSlots=[];_state=r();constructor(t){super(),this.className=`adw-view-stack`,this.addColumn(new s(1,`star`)),this.addRow(new s(1,`star`)),this._state.subscribe(e=>{n(this._state);let t={eventName:c,object:this,...i(e)};this.notify(t)}),e(this,t)}add(e,t,n,r){let i=this._state.addPage({name:t,title:n,icon:r,content:e});return this._placePage(e),i}_placePage(e){o.setColumn(e,0),o.setRow(e,0),this.addChild(e),n(this._state)}_addChildFromBuilder(e,t){if(!(t instanceof a)){this.add(t,``);return}let n=t.child;if(n===null){t._awaitChild(this);return}t._adoptBy(this),this._state.addPage({name:t.name,title:t.title,icon:t.iconName,content:n,visible:t.visible,badgeNumber:t.badgeNumber,needsAttention:t.needsAttention,useUnderline:t.useUnderline}),this._placePage(n)}add_titled(e,t,n){return this.add(e,t,n)}add_titled_with_icon(e,t,n,r){return this.add(e,t,n,r)}remove(e){let t=typeof e==`string`?e:this._nameOf(e)??``,r=this._state.pages[this._state.indexOfName(t)]?.content;return this._state.removePage(t)?(r&&this.removeChild(r),n(this._state),!0):!1}setPageVisible(e,t){let r=this._state.setPageVisible(e,t);return n(this._state),r}_nameOf(e){for(let t of this._state.pages)if(t.content===e)return t.name;return null}get pages(){return this._state.pages}get visibleChildIndex(){return this._state.visibleIndex}selectNthPage(e){return this._state.setVisibleIndex(e)}get visibleChildName(){return this._state.visibleName}set visibleChildName(e){this._state.setVisibleName(e)}get visibleChild(){return this._state.visiblePage?.content??null}};export{AdwViewStack,c as NOTIFY_VISIBLE_CHILD};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{
|
|
1
|
+
import"../_virtual/_rolldown/runtime.js";import{xmlBoolean as e}from"./xml-values.js";import{applyConstructProps as t}from"./construct-props.js";import{withSignals as n}from"./signals.js";import{GtkImage as r}from"./gtk-image.js";import{attachRowPressFeedback as i}from"./row-press.js";import{resolveIdReference as a}from"./id-reference.js";import{AdwViewStack as o,NOTIFY_VISIBLE_CHILD as s}from"./adw-view-stack.js";import{createViewSwitcherBarState as c}from"./view-switcher-model.js";import{GridLayout as l,ItemSpec as u,Label as d,StackLayout as f}from"@nativescript/core";import{buildViewSwitcherButtons as p,viewSwitcherPagesFromStack as m}from"@gjsify/adwaita-core";var AdwViewSwitcherBar=class extends n(l){static builderReferences=[`stack`];_bar;_nodes=[];_stack=null;_stackId=null;_stackListener=null;_barState=c();constructor(e){super(),this.className=`adw-viewswitcherbar`,this.addColumn(new u(1,`star`)),this.addRow(new u(1,`auto`));let n=new l;n.className=`adw-viewswitcherbar-box`,n.addRow(new u(1,`auto`)),l.setRow(n,0),this.addChild(n),this._bar=n,this._barState.subscribe(()=>this._applyRevealed()),this._applyRevealed(),this.addEventListener(`loaded`,()=>{this._stackId!==null&&(this.stack=a(this,`stack`,this._stackId,o)),this._bindStack(),this._rebuild()}),this.addEventListener(`unloaded`,()=>this._unbindStack()),t(this,e)}set_stack(e){this._unbindStack(),this._stack=e,this._bindStack(),this._rebuild()}get stack(){return this._stack}set stack(e){if(typeof e==`string`){this._stackId=e,this.isLoaded&&(this.stack=a(this,`stack`,e,o));return}this._stackId=null,this.set_stack(e)}get reveal(){return this._barState.reveal}set reveal(t){let n=e(t,this.reveal);this._barState.setReveal(n)}get revealed(){return this._barState.revealed}refresh(){this._rebuild()}_bindStack(){if(!this._stack||this._stackListener)return;let listener=()=>this._rebuild();this._stack.addEventListener(s,listener),this._stackListener=listener}_unbindStack(){!this._stack||!this._stackListener||(this._stack.removeEventListener(s,this._stackListener),this._stackListener=null)}_rebuild(){let e=this._stack?.pages??[];this._barState.setPages(e);let t=p(m(e),this._stack?.visibleChildIndex??-1,`narrow`);if(t.length!==this._nodes.length){for(let e of this._nodes)this._bar.removeChild(e.button);this._nodes=[],this._bar.removeColumns(),this._nodes=t.map((e,t)=>(this._bar.addColumn(new u(1,`star`)),this._buildButton(e.pageIndex,t)))}t.forEach((e,t)=>{let n=this._nodes[t];n&&(n.button.visibility=e.visible?`visible`:`collapse`,n.button.className=e.selected?`adw-viewswitcherbar-button active`:`adw-viewswitcherbar-button`,n.icon.iconName=e.iconName,n.label.text=e.label,n.badge.text=e.badgeLabel,n.badge.visibility=e.badgeLabel.length>0||e.needsAttention?`visible`:`collapse`,n.badge.className=e.badgeLabel.length===0&&e.needsAttention?`adw-viewswitcherbar-button-badge needs-attention`:`adw-viewswitcherbar-button-badge`)}),this._applyRevealed()}_buildButton(e,t){let n=new f;n.orientation=`vertical`,n.className=`adw-viewswitcherbar-button`,n.horizontalAlignment=`stretch`;let a=new r;a.className=`${a.className} adw-viewswitcherbar-button-icon`.trim(),a.horizontalAlignment=`center`,n.addChild(a);let o=new d;o.className=`adw-viewswitcherbar-button-label`,o.horizontalAlignment=`center`,o.textAlignment=`center`,n.addChild(o);let s=new d;return s.className=`adw-viewswitcherbar-button-badge`,s.horizontalAlignment=`center`,s.textAlignment=`center`,n.addChild(s),i(n),n.addEventListener(`tap`,()=>{this._stack?.selectNthPage(e)}),l.setColumn(n,t),this._bar.addChild(n),{button:n,icon:a,label:o,badge:s}}_applyRevealed(){this.visibility=this._barState.revealed?`visible`:`collapse`}};export{AdwViewSwitcherBar};
|