@wailsio/runtime 3.0.0-alpha.4 → 3.0.0-alpha.6

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/contextmenu.js CHANGED
@@ -11,6 +11,7 @@ The electron alternative for Go
11
11
  /* jshint esversion: 9 */
12
12
 
13
13
  import {newRuntimeCallerWithID, objectNames} from "./runtime";
14
+ import {IsDebug} from "./system";
14
15
 
15
16
  const call = newRuntimeCallerWithID(objectNames.ContextMenu, '');
16
17
  const ContextMenuOpen = 0;
@@ -47,8 +48,9 @@ function contextMenuHandler(event) {
47
48
  This rule is inherited like normal CSS rules, so nesting works as expected
48
49
  */
49
50
  function processDefaultContextMenu(event) {
51
+
50
52
  // Debug builds always show the menu
51
- if (DEBUG) {
53
+ if (IsDebug()) {
52
54
  return;
53
55
  }
54
56
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wailsio/runtime",
3
- "version": "3.0.0-alpha.4",
3
+ "version": "3.0.0-alpha.6",
4
4
  "description": "Wails Runtime",
5
5
  "main": "index.js",
6
6
  "repository": {
package/system.js CHANGED
@@ -116,3 +116,7 @@ export function IsARM() {
116
116
  export function IsARM64() {
117
117
  return environmentCache.Arch === "arm64";
118
118
  }
119
+
120
+ export function IsDebug() {
121
+ return environmentCache.Debug === true;
122
+ }
package/wml.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import {Emit, WailsEvent} from "./events";
3
3
  import {Question} from "./dialogs";
4
4
  import {WindowMethods, Get} from "./window";
5
+ import {OpenURL} from "./browser";
5
6
 
6
7
  /**
7
8
  * Sends an event with the given name and optional data.
@@ -119,12 +120,12 @@ function addWMLOpenBrowserListener() {
119
120
  if (confirm) {
120
121
  Question({Title: "Confirm", Message:confirm, Buttons:[{Label:"Yes"},{Label:"No", IsDefault:true}]}).then(function (result) {
121
122
  if (result !== "No") {
122
- void wails.Browser.OpenURL(url);
123
+ void OpenURL(url);
123
124
  }
124
125
  });
125
126
  return;
126
127
  }
127
- void wails.Browser.OpenURL(url);
128
+ void OpenURL(url);
128
129
  };
129
130
 
130
131
  // Remove existing listeners