@gjsify/adwaita-nativescript 0.64.1-next.243 → 0.64.1-next.244

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.
@@ -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{surfaceSize as r}from"./window-state.js";import{windowHost as i}from"../window-host.js";import{AdwSingleChildBase as a}from"./single-child-base.js";import{CloseRequestState as o,HandledAccumulator as s,WindowMemberState as c}from"@gjsify/adwaita-core";const l=`notify::is-active`,u=`notify::maximized`,d=`notify::focus-widget`,f=`close-request`;var p=class GtkWindow extends a{static GTypeName=`GtkWindow`;_title=``;_defaultWidth=0;_defaultHeight=0;_members=new c(e=>{let t=e===`is-active`?l:u;this.notify({eventName:t,object:this,value:e===`is-active`?this.isActive:this.maximized})},{maximized:!0});_closeRequest=new o;_unwatchForeground=null;_unwatchBack=null;constructor(e){super(),n(this,e)}onLoaded(){super.onLoaded();let e=i();this._unwatchForeground?.(),this._unwatchForeground=e.watchForeground(e=>this._members.reportActive(e)),this._members.reportActive(e.isForeground()),this._unwatchBack?.(),this._unwatchBack=this._isToplevel()?e.watchBack(()=>this._handleBack()):null}onUnloaded(){this._unwatchForeground?.(),this._unwatchForeground=null,this._unwatchBack?.(),this._unwatchBack=null,this._members.reportActive(!1),super.onUnloaded()}get isActive(){return this._members.active}is_active(){return this.isActive}get maximized(){return this._members.maximized}set maximized(t){e(t,!0)?this.maximize():this.unmaximize()}is_maximized(){return this.maximized}maximize(){}unmaximize(){throw Error(`GtkWindow.unmaximize is not supported on NativeScript: the window is the whole screen and the platform has no un-maximized state to go back to.`)}present(){}get focusWidget(){return this.get_focus()}get_focus(){let e=i();return findView(this,t=>e.isFocused(t))}set_focus(e){let t=i();if(e===null){let e=this.get_focus();e!==null&&t.clearFocus(e);return}if(findView(this,t=>t===e)===null)throw Error(`GtkWindow.set_focus: the widget is not a descendant of this window.`);t.requestFocus(e)}close(){let e=i();if(this.isLoaded&&!e.canFinish)throw Error(`GtkWindow.close is not supported on this platform: iOS has no public API to close the root window. Android finishes the foreground activity.`);this._requestClose()}_requestClose(){let e=i();this._closeRequest.close({realized:this.isLoaded,hideOnClose:!1,emit:()=>{let e=new s;return this.notify({eventName:f,object:this,accumulator:e}),e.stopped},hide:()=>{},destroy:()=>e.finish()})}_handleBack(){return this._consumeBack()||popInnermostNavigation(this)||this._requestClose(),!0}_consumeBack(){return!1}_isToplevel(){for(let e=this.parent;e;e=e.parent)if(e instanceof GtkWindow)return!1;return!0}connect(e,t){if(e===`notify::focus-widget`)throw Error(`GtkWindow notify::focus-widget is not supported on NativeScript: focus the user moves is not observable here. Read get_focus() when you need it.`);return super.connect(e,t)}get title(){return this._title}set title(e){this._title=e??``}get defaultWidth(){return this._defaultWidth}set defaultWidth(e){this._defaultWidth=r(t(e,NaN),e,this._defaultWidth,`defaultWidth`)}get defaultHeight(){return this._defaultHeight}set defaultHeight(e){this._defaultHeight=r(t(e,NaN),e,this._defaultHeight,`defaultHeight`)}};function findView(e,t){let n=null;return e.eachChildView(e=>t(e)?(n=e,!1):(n=findView(e,t),n===null)),n}const popsOnBack=e=>typeof e.popFromShortcut==`function`;function popInnermostNavigation(e){let t=!1;return e.eachChildView(e=>e.visibility===`visible`&&(popInnermostNavigation(e)||popsOnBack(e)&&e.isLoaded&&e.popFromShortcut()===`stop`)?(t=!0,!1):!0),t}export{f as CLOSE_REQUEST,p as GtkWindow,d as NOTIFY_FOCUS_WIDGET,l as NOTIFY_IS_ACTIVE,u as NOTIFY_MAXIMIZED};
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{surfaceSize as r}from"./window-state.js";import{windowHost as i}from"../window-host.js";import{AdwSingleChildBase as a}from"./single-child-base.js";import{CloseRequestState as o,HandledAccumulator as s,WindowMemberState as c}from"@gjsify/adwaita-core";const l=`notify::is-active`,u=`notify::maximized`,d=`notify::focus-widget`,f=`close-request`;var p=class GtkWindow extends a{static GTypeName=`GtkWindow`;_title=``;_defaultWidth=0;_defaultHeight=0;_members=new c(e=>{let t=e===`is-active`?l:u;this.notify({eventName:t,object:this,value:e===`is-active`?this.isActive:this.maximized})},{maximized:!0});_closeRequest=new o;_unwatchForeground=null;_unwatchBack=null;constructor(e){super(),n(this,e)}onLoaded(){super.onLoaded();let e=i();this._unwatchForeground?.(),this._unwatchForeground=e.watchForeground(e=>this._members.reportActive(e)),this._members.reportActive(e.isForeground()),this._unwatchBack?.(),this._unwatchBack=this._isToplevel()?e.watchBack(()=>this._handleBack()):null}onUnloaded(){this._unwatchForeground?.(),this._unwatchForeground=null,this._unwatchBack?.(),this._unwatchBack=null,this._members.reportActive(!1),super.onUnloaded()}get isActive(){return this._members.active}get is_active(){return this._members.active}get maximized(){return this._members.maximized}set maximized(t){e(t,!0)?this.maximize():this.unmaximize()}is_maximized(){return this.maximized}maximize(){}unmaximize(){throw Error(`GtkWindow.unmaximize is not supported on NativeScript: the window is the whole screen and the platform has no un-maximized state to go back to.`)}present(){}get focusWidget(){return this.get_focus()}get focus_widget(){return this.get_focus()}set focus_widget(e){this.set_focus(e)}get_focus(){let e=i();return findView(this,t=>e.isFocused(t))}set_focus(e){let t=i();if(e===null){let e=this.get_focus();e!==null&&t.clearFocus(e);return}if(findView(this,t=>t===e)===null)throw Error(`GtkWindow.set_focus: the widget is not a descendant of this window.`);t.requestFocus(e)}close(){let e=i();if(this.isLoaded&&!e.canFinish)throw Error(`GtkWindow.close is not supported on this platform: iOS has no public API to close the root window. Android finishes the foreground activity.`);this._requestClose()}_requestClose(){let e=i();this._closeRequest.close({realized:this.isLoaded,hideOnClose:!1,emit:()=>{let e=new s;return this.notify({eventName:f,object:this,accumulator:e}),e.stopped},hide:()=>{},destroy:()=>e.finish()})}_handleBack(){return this._consumeBack()||popInnermostNavigation(this)||this._requestClose(),!0}_consumeBack(){return!1}_isToplevel(){for(let e=this.parent;e;e=e.parent)if(e instanceof GtkWindow)return!1;return!0}connect(e,t){if(e===`notify::focus-widget`)throw Error(`GtkWindow notify::focus-widget is not supported on NativeScript: focus the user moves is not observable here. Read get_focus() when you need it.`);return super.connect(e,t)}get title(){return this._title}set title(e){this._title=e??``}get defaultWidth(){return this._defaultWidth}set defaultWidth(e){this._defaultWidth=r(t(e,NaN),e,this._defaultWidth,`defaultWidth`)}get defaultHeight(){return this._defaultHeight}set defaultHeight(e){this._defaultHeight=r(t(e,NaN),e,this._defaultHeight,`defaultHeight`)}};function findView(e,t){let n=null;return e.eachChildView(e=>t(e)?(n=e,!1):(n=findView(e,t),n===null)),n}const popsOnBack=e=>typeof e.popFromShortcut==`function`;function popInnermostNavigation(e){let t=!1;return e.eachChildView(e=>e.visibility===`visible`&&(popInnermostNavigation(e)||popsOnBack(e)&&e.isLoaded&&e.popFromShortcut()===`stop`)?(t=!0,!1):!0),t}export{f as CLOSE_REQUEST,p as GtkWindow,d as NOTIFY_FOCUS_WIDGET,l as NOTIFY_IS_ACTIVE,u as NOTIFY_MAXIMIZED};
@@ -19,6 +19,7 @@ export { GtkOverlay as Overlay } from '../widgets/gtk-overlay.js';
19
19
  export { GtkRevealer as Revealer } from '../widgets/gtk-revealer.js';
20
20
  export { GtkScrolledWindow as ScrolledWindow } from '../widgets/gtk-scrolled-window.js';
21
21
  export { GtkWindow as Window } from '../widgets/gtk-window.js';
22
+ export type { WindowCommon } from '@gjsify/adwaita-core';
22
23
  export { GtkSeparator as Separator } from '../widgets/gtk-separator.js';
23
24
  export { GtkStack as Stack } from '../widgets/gtk-stack.js';
24
25
  export { GtkStackPage as StackPage } from '../widgets/stack-page.js';
@@ -19,7 +19,8 @@ export declare class GtkWindow extends AdwSingleChildBase {
19
19
  onUnloaded(): void;
20
20
  /** `GtkWindow:is-active` (read-only): the application is in the foreground. */
21
21
  get isActive(): boolean;
22
- is_active(): boolean;
22
+ /** The GJS spelling of {@link isActive}: a property, as in `@girs/gtk-4.0` (ADR 0098 Amendment 4). */
23
+ get is_active(): boolean;
23
24
  /** `GtkWindow:maximized`: always true here. Writing false throws; writing true is a no-op. */
24
25
  get maximized(): boolean;
25
26
  set maximized(value: boolean | string);
@@ -29,8 +30,11 @@ export declare class GtkWindow extends AdwSingleChildBase {
29
30
  unmaximize(): void;
30
31
  /** The application's `activate` returns the root window, so it is presented already. */
31
32
  present(): void;
32
- /** `GtkWindow:focus-widget` (read-only): the view holding native focus, found live. */
33
+ /** `GtkWindow:focus-widget`: the view holding native focus, found live. */
33
34
  get focusWidget(): View | null;
35
+ /** `GtkWindow:focus-widget` under its GJS spelling; writing it is `set_focus`. */
36
+ get focus_widget(): View | null;
37
+ set focus_widget(widget: View | null);
34
38
  get_focus(): View | null;
35
39
  /** Move native focus to a descendant, or clear it with `null`. */
36
40
  set_focus(widget: View | null): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/adwaita-nativescript",
3
- "version": "0.64.1-next.243",
3
+ "version": "0.64.1-next.244",
4
4
  "description": "Native Adwaita widgets for the NativeScript runtime — real NativeScript components (StackLayout/GridLayout/Switch/Label) styled like Libadwaita, not a webview",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -73,15 +73,15 @@
73
73
  "design-system"
74
74
  ],
75
75
  "dependencies": {
76
- "@gjsify/adwaita-core": "0.64.1-next.243",
77
- "@gjsify/adwaita-fonts": "0.64.1-next.243",
78
- "@gjsify/adwaita-icons": "0.64.1-next.243",
79
- "@gjsify/canvas2d-core": "0.64.1-next.243",
80
- "@gjsify/native-platform": "0.64.1-next.243"
76
+ "@gjsify/adwaita-core": "0.64.1-next.244",
77
+ "@gjsify/adwaita-fonts": "0.64.1-next.244",
78
+ "@gjsify/adwaita-icons": "0.64.1-next.244",
79
+ "@gjsify/canvas2d-core": "0.64.1-next.244",
80
+ "@gjsify/native-platform": "0.64.1-next.244"
81
81
  },
82
82
  "peerDependencies": {
83
83
  "@nativescript/core": "*",
84
- "@gjsify/app-settings": "0.64.1-next.243"
84
+ "@gjsify/app-settings": "0.64.1-next.244"
85
85
  },
86
86
  "peerDependenciesMeta": {
87
87
  "@nativescript/core": {
@@ -92,11 +92,11 @@
92
92
  }
93
93
  },
94
94
  "devDependencies": {
95
- "@gjsify/app-settings": "0.64.1-next.243",
96
- "@gjsify/blueprint": "0.64.1-next.243",
97
- "@gjsify/cli": "0.64.1-next.243",
98
- "@gjsify/unit": "0.64.1-next.243",
99
- "@gjsify/vite-plugin-blueprint": "0.64.1-next.243",
95
+ "@gjsify/app-settings": "0.64.1-next.244",
96
+ "@gjsify/blueprint": "0.64.1-next.244",
97
+ "@gjsify/cli": "0.64.1-next.244",
98
+ "@gjsify/unit": "0.64.1-next.244",
99
+ "@gjsify/vite-plugin-blueprint": "0.64.1-next.244",
100
100
  "@types/node": "^25.9.2",
101
101
  "typescript": "^6.0.3"
102
102
  },
@@ -126,5 +126,5 @@
126
126
  "url": "https://github.com/gjsify/gjsify/issues"
127
127
  },
128
128
  "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/nativescript-bridge/adwaita#readme",
129
- "gitHead": "f88c7b1074d454e211094963a9f4dc7d0982bf32"
129
+ "gitHead": "9a6ca179c1a74477f23791c5b8f6d5a7bffaee61"
130
130
  }