@wailsio/runtime 3.0.0-alpha.35 → 3.0.0-alpha.39
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 +1 -4
- package/src/calls.js +1 -1
- package/src/dialogs.js +1 -1
- package/src/event_types.js +3 -0
- package/src/nanoid.js +42 -0
- package/src/runtime.js +1 -1
- package/src/system.js +1 -1
- package/types/event_types.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wailsio/runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-alpha.
|
|
4
|
+
"version": "3.0.0-alpha.39",
|
|
5
5
|
"description": "Wails Runtime",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -34,8 +34,5 @@
|
|
|
34
34
|
"typedoc": "^0.25.7",
|
|
35
35
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
36
36
|
"typescript": "^5.3.3"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"nanoid": "^5.0.7"
|
|
40
37
|
}
|
|
41
38
|
}
|
package/src/calls.js
CHANGED
|
@@ -10,7 +10,7 @@ The electron alternative for Go
|
|
|
10
10
|
|
|
11
11
|
/* jshint esversion: 9 */
|
|
12
12
|
import { newRuntimeCallerWithID, objectNames } from "./runtime";
|
|
13
|
-
import { nanoid } from 'nanoid
|
|
13
|
+
import { nanoid } from './nanoid.js';
|
|
14
14
|
|
|
15
15
|
// Setup
|
|
16
16
|
window._wails = window._wails || {};
|
package/src/dialogs.js
CHANGED
|
@@ -80,7 +80,7 @@ window._wails.dialogResultCallback = dialogResultCallback;
|
|
|
80
80
|
|
|
81
81
|
import {newRuntimeCallerWithID, objectNames} from "./runtime";
|
|
82
82
|
|
|
83
|
-
import { nanoid } from 'nanoid
|
|
83
|
+
import { nanoid } from './nanoid.js';
|
|
84
84
|
|
|
85
85
|
// Define constants from the `methods` object in Title Case
|
|
86
86
|
const DialogInfo = 0;
|
package/src/event_types.js
CHANGED
|
@@ -44,6 +44,7 @@ export const EventTypes = {
|
|
|
44
44
|
WindowNonClientMouseUp: "windows:WindowNonClientMouseUp",
|
|
45
45
|
WindowNonClientMouseMove: "windows:WindowNonClientMouseMove",
|
|
46
46
|
WindowNonClientMouseLeave: "windows:WindowNonClientMouseLeave",
|
|
47
|
+
WindowDPIChanged: "windows:WindowDPIChanged",
|
|
47
48
|
},
|
|
48
49
|
Mac: {
|
|
49
50
|
ApplicationDidBecomeActive: "mac:ApplicationDidBecomeActive",
|
|
@@ -174,6 +175,8 @@ export const EventTypes = {
|
|
|
174
175
|
WindowFileDraggingEntered: "mac:WindowFileDraggingEntered",
|
|
175
176
|
WindowFileDraggingPerformed: "mac:WindowFileDraggingPerformed",
|
|
176
177
|
WindowFileDraggingExited: "mac:WindowFileDraggingExited",
|
|
178
|
+
WindowShow: "mac:WindowShow",
|
|
179
|
+
WindowHide: "mac:WindowHide",
|
|
177
180
|
},
|
|
178
181
|
Linux: {
|
|
179
182
|
SystemThemeChanged: "linux:SystemThemeChanged",
|
package/src/nanoid.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Source: https://github.com/ai/nanoid
|
|
2
|
+
|
|
3
|
+
// The MIT License (MIT)
|
|
4
|
+
//
|
|
5
|
+
// Copyright 2017 Andrey Sitnik <andrey@sitnik.ru>
|
|
6
|
+
//
|
|
7
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
8
|
+
// this software and associated documentation files (the "Software"), to deal in
|
|
9
|
+
// the Software without restriction, including without limitation the rights to
|
|
10
|
+
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
11
|
+
// the Software, and to permit persons to whom the Software is furnished to do so,
|
|
12
|
+
// subject to the following conditions:
|
|
13
|
+
//
|
|
14
|
+
// The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
// copies or substantial portions of the Software.
|
|
16
|
+
//
|
|
17
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
19
|
+
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
20
|
+
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
21
|
+
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
22
|
+
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
// This alphabet uses `A-Za-z0-9_-` symbols.
|
|
25
|
+
// The order of characters is optimized for better gzip and brotli compression.
|
|
26
|
+
// References to the same file (works both for gzip and brotli):
|
|
27
|
+
// `'use`, `andom`, and `rict'`
|
|
28
|
+
// References to the brotli default dictionary:
|
|
29
|
+
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
|
|
30
|
+
let urlAlphabet =
|
|
31
|
+
'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict'
|
|
32
|
+
|
|
33
|
+
export let nanoid = (size = 21) => {
|
|
34
|
+
let id = ''
|
|
35
|
+
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
36
|
+
let i = size | 0
|
|
37
|
+
while (i--) {
|
|
38
|
+
// `| 0` is more compact and faster than `Math.floor()`.
|
|
39
|
+
id += urlAlphabet[(Math.random() * 64) | 0]
|
|
40
|
+
}
|
|
41
|
+
return id
|
|
42
|
+
}
|
package/src/runtime.js
CHANGED
package/src/system.js
CHANGED
|
@@ -24,7 +24,7 @@ const _invoke = (() => {
|
|
|
24
24
|
return (msg) => window.webkit.messageHandlers.external.postMessage(msg);
|
|
25
25
|
}
|
|
26
26
|
} catch(e) {
|
|
27
|
-
console.warn('\n%c⚠️ Browser Environment Detected %c\n\n%cOnly UI previews are available in the browser. For full functionality, please run the application in desktop mode.\nMore information at: https://
|
|
27
|
+
console.warn('\n%c⚠️ Browser Environment Detected %c\n\n%cOnly UI previews are available in the browser. For full functionality, please run the application in desktop mode.\nMore information at: https://v3.wails.io/learn/build/#using-a-browser-for-development\n',
|
|
28
28
|
'background: #ffffff; color: #000000; font-weight: bold; padding: 4px 8px; border-radius: 4px; border: 2px solid #000000;',
|
|
29
29
|
'background: transparent;',
|
|
30
30
|
'color: #ffffff; font-style: italic; font-weight: bold;');
|
package/types/event_types.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare const EventTypes: {
|
|
|
44
44
|
WindowNonClientMouseUp: string,
|
|
45
45
|
WindowNonClientMouseMove: string,
|
|
46
46
|
WindowNonClientMouseLeave: string,
|
|
47
|
+
WindowDPIChanged: string,
|
|
47
48
|
},
|
|
48
49
|
Mac: {
|
|
49
50
|
ApplicationDidBecomeActive: string,
|
|
@@ -174,6 +175,8 @@ export declare const EventTypes: {
|
|
|
174
175
|
WindowFileDraggingEntered: string,
|
|
175
176
|
WindowFileDraggingPerformed: string,
|
|
176
177
|
WindowFileDraggingExited: string,
|
|
178
|
+
WindowShow: string,
|
|
179
|
+
WindowHide: string,
|
|
177
180
|
},
|
|
178
181
|
Linux: {
|
|
179
182
|
SystemThemeChanged: string,
|