@wailsio/runtime 3.0.0-alpha.24 → 3.0.0-alpha.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wailsio/runtime",
3
- "version": "3.0.0-alpha.24",
3
+ "version": "3.0.0-alpha.26",
4
4
  "description": "Wails Runtime",
5
5
  "main": "src/index.js",
6
6
  "types": "types/index.d.ts",
package/src/drag.js CHANGED
@@ -46,7 +46,7 @@ function onMouseDown(e) {
46
46
 
47
47
  // Check for resizing
48
48
  if (resizeEdge) {
49
- invoke("resize:" + resizeEdge);
49
+ invoke("wails:resize:" + resizeEdge);
50
50
  e.preventDefault();
51
51
  return;
52
52
  }
@@ -76,7 +76,7 @@ function onMouseMove(e) {
76
76
  shouldDrag = false;
77
77
  let mousePressed = e.buttons !== undefined ? e.buttons : e.which;
78
78
  if (mousePressed > 0) {
79
- invoke("drag");
79
+ invoke("wails:drag");
80
80
  return;
81
81
  }
82
82
  }
@@ -26,6 +26,8 @@ export const EventTypes = {
26
26
  WindowDragEnter: "windows:WindowDragEnter",
27
27
  WindowDragLeave: "windows:WindowDragLeave",
28
28
  WindowDragOver: "windows:WindowDragOver",
29
+ WindowDidMove: "windows:WindowDidMove",
30
+ WindowDidResize: "windows:WindowDidResize",
29
31
  },
30
32
  Mac: {
31
33
  ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive",
@@ -157,6 +159,8 @@ export const EventTypes = {
157
159
  SystemThemeChanged: "linux:SystemThemeChanged",
158
160
  WindowLoadChanged: "linux:WindowLoadChanged",
159
161
  WindowDeleteEvent: "linux:WindowDeleteEvent",
162
+ WindowDidMove: "linux:WindowDidMove",
163
+ WindowDidResize: "linux:WindowDidResize",
160
164
  WindowFocusIn: "linux:WindowFocusIn",
161
165
  WindowFocusOut: "linux:WindowFocusOut",
162
166
  ApplicationStartup: "linux:ApplicationStartup",
@@ -183,5 +187,7 @@ export const EventTypes = {
183
187
  WindowFilesDropped: "common:WindowFilesDropped",
184
188
  WindowRuntimeReady: "common:WindowRuntimeReady",
185
189
  ThemeChanged: "common:ThemeChanged",
190
+ WindowDidMove: "common:WindowDidMove",
191
+ WindowDidResize: "common:WindowDidResize",
186
192
  },
187
193
  };
package/src/window.js CHANGED
@@ -36,7 +36,7 @@ The electron alternative for Go
36
36
 
37
37
  import {newRuntimeCallerWithID, objectNames} from "./runtime";
38
38
 
39
- const AbsolutePositionMethod = 0;
39
+ const PositionMethod = 0;
40
40
  const CenterMethod = 1;
41
41
  const CloseMethod = 2;
42
42
  const DisableSizeConstraintsMethod = 3;
@@ -60,7 +60,7 @@ const RelativePositionMethod = 20;
60
60
  const ReloadMethod = 21;
61
61
  const ResizableMethod = 22;
62
62
  const RestoreMethod = 23;
63
- const SetAbsolutePositionMethod = 24;
63
+ const SetPositionMethod = 24;
64
64
  const SetAlwaysOnTopMethod = 25;
65
65
  const SetBackgroundColourMethod = 26;
66
66
  const SetFramelessMethod = 27;
@@ -128,13 +128,13 @@ class Window {
128
128
  }
129
129
 
130
130
  /**
131
- * Returns the absolute position of the window to the screen.
131
+ * Returns the absolute position of the window.
132
132
  *
133
133
  * @public
134
134
  * @return {Promise<Position>} - The current absolute position of the window.
135
135
  */
136
- AbsolutePosition() {
137
- return this[caller](AbsolutePositionMethod);
136
+ Position() {
137
+ return this[caller](PositionMethod);
138
138
  }
139
139
 
140
140
  /**
@@ -368,15 +368,15 @@ class Window {
368
368
  }
369
369
 
370
370
  /**
371
- * Sets the absolute position of the window to the screen.
371
+ * Sets the absolute position of the window.
372
372
  *
373
373
  * @public
374
374
  * @param {number} x - The desired horizontal absolute position of the window
375
375
  * @param {number} y - The desired vertical absolute position of the window
376
376
  * @return {Promise<void>}
377
377
  */
378
- SetAbsolutePosition(x, y) {
379
- return this[caller](SetAbsolutePositionMethod, { x, y });
378
+ SetPosition(x, y) {
379
+ return this[caller](SetPositionMethod, { x, y });
380
380
  }
381
381
 
382
382
  /**
@@ -26,6 +26,8 @@ export declare const EventTypes: {
26
26
  WindowDragEnter: string,
27
27
  WindowDragLeave: string,
28
28
  WindowDragOver: string,
29
+ WindowDidMove: string,
30
+ WindowDidResize: string,
29
31
  },
30
32
  Mac: {
31
33
  ApplicationDidBecomeActive: string,
@@ -157,6 +159,8 @@ export declare const EventTypes: {
157
159
  SystemThemeChanged: string,
158
160
  WindowLoadChanged: string,
159
161
  WindowDeleteEvent: string,
162
+ WindowDidMove: string,
163
+ WindowDidResize: string,
160
164
  WindowFocusIn: string,
161
165
  WindowFocusOut: string,
162
166
  ApplicationStartup: string,
@@ -183,5 +187,7 @@ export declare const EventTypes: {
183
187
  WindowFilesDropped: string,
184
188
  WindowRuntimeReady: string,
185
189
  ThemeChanged: string,
190
+ WindowDidMove: string,
191
+ WindowDidResize: string,
186
192
  },
187
193
  };
package/types/window.d.ts CHANGED
@@ -49,12 +49,12 @@ declare class Window {
49
49
  */
50
50
  public Get(name: string): Window;
51
51
  /**
52
- * Returns the absolute position of the window to the screen.
52
+ * Returns the absolute position of the window.
53
53
  *
54
54
  * @public
55
55
  * @return {Promise<Position>} - The current absolute position of the window.
56
56
  */
57
- public AbsolutePosition(): Promise<Position>;
57
+ public Position(): Promise<Position>;
58
58
  /**
59
59
  * Centers the window on the screen.
60
60
  *
@@ -217,14 +217,14 @@ declare class Window {
217
217
  */
218
218
  public Restore(): Promise<void>;
219
219
  /**
220
- * Sets the absolute position of the window to the screen.
220
+ * Sets the absolute position of the window.
221
221
  *
222
222
  * @public
223
223
  * @param {number} x - The desired horizontal absolute position of the window
224
224
  * @param {number} y - The desired vertical absolute position of the window
225
225
  * @return {Promise<void>}
226
226
  */
227
- public SetAbsolutePosition(x: number, y: number): Promise<void>;
227
+ public SetPosition(x: number, y: number): Promise<void>;
228
228
  /**
229
229
  * Sets the window to be always on top.
230
230
  *