pake-cli 1.2.1 → 1.2.3
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/README.md +75 -76
- package/dist/cli.js +41 -19
- package/package.json +3 -3
- package/src-tauri/Cargo.lock +126 -94
- package/src-tauri/Cargo.toml +3 -2
- package/src-tauri/icons/xapi.icns +0 -0
- package/src-tauri/src/main.rs +56 -8
- package/src-tauri/src/pake.js +25 -2
- package/src-tauri/icons/tableconvert.icns +0 -0
- package/src-tauri/png/tableconvert_256.ico +0 -0
- package/src-tauri/png/tableconvert_32.ico +0 -0
- package/src-tauri/png/tableconvert_512.png +0 -0
- package/src-tauri/png/tool_256.ico +0 -0
- package/src-tauri/png/tool_32.ico +0 -0
- package/src-tauri/png/tool_512.png +0 -0
- package/src-tauri/png/witeboard_256.ico +0 -0
- package/src-tauri/png/witeboard_32.ico +0 -0
- package/src-tauri/png/witeboard_512.png +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
<
|
|
1
|
+
<h4 align="right"><strong>English</strong> | <a href="https://github.com/tw93/Pake/blob/master/README_CN.md">简体中文</a></h4>
|
|
2
2
|
<p align="center">
|
|
3
3
|
<img src=https://gw.alipayobjects.com/zos/k/fa/logo-modified.png width=138/>
|
|
4
4
|
</p>
|
|
5
5
|
<h1 align="center">Pake</h1>
|
|
6
|
+
<p align="center"><strong>Turn any webpage into a desktop app with Rust <em>with ease</em>.</strong></p>
|
|
6
7
|
<div align="center">
|
|
7
8
|
<a href="https://twitter.com/HiTw93" target="_blank">
|
|
8
|
-
<img alt="twitter" src="https://img.shields.io/
|
|
9
|
+
<img alt="twitter" src="https://img.shields.io/badge/follow-Tw93-red?style=flat-square&logo=Twitter"></a>
|
|
9
10
|
<a href="https://t.me/miaoyan" target="_blank">
|
|
10
11
|
<img alt="telegram" src="https://img.shields.io/badge/chat-telegram-blueviolet?style=flat-square&logo=Telegram"></a>
|
|
11
12
|
<a href="https://github.com/tw93/Pake/releases" target="_blank">
|
|
@@ -15,25 +16,26 @@
|
|
|
15
16
|
<a href="https://github.com/tw93/Pake/issues?q=is%3Aissue+is%3Aclosed" target="_blank">
|
|
16
17
|
<img alt="GitHub closed issues" src="https://img.shields.io/github/issues-closed/tw93/Pake.svg?style=flat-square"></a>
|
|
17
18
|
</div>
|
|
18
|
-
<div align="left">很简单的用 Rust 打包网页生成很小的桌面 App,支持 Mac / Windows / Linux 系统,常用包下载、<a href="#命令行一键打包">命令行一键打包</a>、<a href="#定制开发">定制开发</a> 可见下面文档,也欢迎去 <a href=https://github.com/tw93/Pake/discussions>讨论区</a> 交流。</div>
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
<div align="left">Pake supports Mac, Windows, and Linux. Check out README for <a href="#popular-packages">Popular Packages</a>, <a href="#command-line-packaging">Command-Line Packaging</a>, and <a href="#development">Customized Development</a> information. Feel free to share your suggestions in <a href=https://github.com/tw93/Pake/discussions>Discussions</a>.</div>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
😂 **快**:Pake 的底层使用的 Rust Tauri 框架,性能体验较 JS 框架要轻快不少,内存小很多。
|
|
24
|
-
🩴 **特**:不是单纯打包,实现了快捷键的透传、沉浸式的窗口、拖动、样式改写、去广告、产品的极简风格定制。
|
|
25
|
-
🐶 **玩**:只是一个很简单的小玩具,用 Rust 替代之前套壳网页打包的老思路,其实 PWA 也很好。
|
|
22
|
+
## Features
|
|
26
23
|
|
|
27
|
-
|
|
24
|
+
- 🎐 Nearly 40 times smaller than an Electron package (less than 3M!)
|
|
25
|
+
- 🚀 With Rust Tauri, Pake is much more lightweight and faster than JS-based frameworks.
|
|
26
|
+
- 📦 Battery-included package — shortcut pass-through, immersive windows, and minimalist customization.
|
|
27
|
+
- 👻 Pake is just a simple tool — replace the old bundle approach with Rust (though PWA is good enough).
|
|
28
|
+
|
|
29
|
+
## Popular Packages
|
|
28
30
|
|
|
29
31
|
<table>
|
|
30
32
|
<tr>
|
|
31
|
-
<td>WeRead
|
|
33
|
+
<td>WeRead
|
|
32
34
|
<a href="https://github.com/tw93/Pake/releases/latest/download/WeRead.dmg">Mac</a>
|
|
33
35
|
<a href="https://github.com/tw93/Pake/releases/latest/download/WeRead_x64.msi">Windows</a>
|
|
34
36
|
<a href="https://github.com/tw93/Pake/releases/latest/download/WeRead_amd64.deb">Linux</a>
|
|
35
37
|
</td>
|
|
36
|
-
<td>Twitter
|
|
38
|
+
<td>Twitter
|
|
37
39
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Twitter.dmg">Mac</a>
|
|
38
40
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Twitter_x64.msi">Windows</a>
|
|
39
41
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Twitter_amd64.deb">Linux</a>
|
|
@@ -44,12 +46,12 @@
|
|
|
44
46
|
<td><img src=https://cdn.fliggy.com/upic/mc41xq.jpg width=600/></td>
|
|
45
47
|
</tr>
|
|
46
48
|
<tr>
|
|
47
|
-
<td>LiZhi
|
|
49
|
+
<td>LiZhi
|
|
48
50
|
<a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi.dmg">Mac</a>
|
|
49
51
|
<a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi_x64.msi">Windows</a>
|
|
50
52
|
<a href="https://github.com/tw93/Pake/releases/latest/download/LiZhi_amd64.deb">Linux</a>
|
|
51
53
|
</td>
|
|
52
|
-
<td>YouTube
|
|
54
|
+
<td>YouTube
|
|
53
55
|
<a href="https://github.com/tw93/Pake/releases/latest/download/YouTube.dmg">Mac</a>
|
|
54
56
|
<a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_x64.msi">Windows</a>
|
|
55
57
|
<a href="https://github.com/tw93/Pake/releases/latest/download/YouTube_amd64.deb">Linux</a>
|
|
@@ -60,119 +62,116 @@
|
|
|
60
62
|
<td><img src=https://cdn.fliggy.com/upic/Ea5ZRw.png width=600/></td>
|
|
61
63
|
</tr>
|
|
62
64
|
<tr>
|
|
63
|
-
<td>
|
|
64
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
65
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
66
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
65
|
+
<td>Qwerty
|
|
66
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty.dmg">Mac</a>
|
|
67
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_x64.msi">Windows</a>
|
|
68
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/Qwerty_amd64.deb">Linux</a>
|
|
67
69
|
</td>
|
|
68
|
-
<td>Reference
|
|
70
|
+
<td>Reference
|
|
69
71
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Reference.dmg">Mac</a>
|
|
70
72
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Reference_x64.msi">Windows</a>
|
|
71
73
|
<a href="https://github.com/tw93/Pake/releases/latest/download/Reference_amd64.deb">Linux</a>
|
|
72
74
|
</td>
|
|
73
75
|
</tr>
|
|
74
76
|
<tr>
|
|
75
|
-
<td><img src=https://cdn.fliggy.com/upic/
|
|
77
|
+
<td><img src=https://cdn.fliggy.com/upic/CJjagn.jpg width=600/></td>
|
|
76
78
|
<td><img src=https://cdn.fliggy.com/upic/KFsZIY.png width=600/></td>
|
|
77
79
|
</tr>
|
|
78
|
-
|
|
79
|
-
<td>
|
|
80
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
81
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
82
|
-
<a href="https://github.com/tw93/Pake/releases/latest/download/
|
|
80
|
+
<tr>
|
|
81
|
+
<td>Book
|
|
82
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary.dmg">Mac</a>
|
|
83
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_x64.msi">Windows</a>
|
|
84
|
+
<a href="https://github.com/tw93/Pake/releases/latest/download/ZLibrary_amd64.deb">Linux</a>
|
|
83
85
|
</td>
|
|
84
|
-
<td>ChatGPT
|
|
86
|
+
<td>ChatGPT
|
|
85
87
|
<a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT.dmg">Mac</a>
|
|
86
88
|
<a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT_x64.msi">Windows</a>
|
|
87
89
|
<a href="https://github.com/tw93/Pake/releases/latest/download/ChatGPT_amd64.deb">Linux</a>
|
|
88
90
|
</td>
|
|
89
91
|
</tr>
|
|
90
92
|
<tr>
|
|
91
|
-
<td><img src=https://cdn.fliggy.com/upic/
|
|
93
|
+
<td><img src=https://cdn.fliggy.com/upic/lJiTRc.jpg width=600/></td>
|
|
92
94
|
<td><img src=https://cdn.fliggy.com/upic/sfnTXf.png width=600/></td>
|
|
93
95
|
</tr>
|
|
94
96
|
</table>
|
|
95
97
|
|
|
96
98
|
<details>
|
|
97
|
-
|
|
98
|
-
<summary>🏂 更多应用如 Flomo / 语雀 / RunCode 可去 <a href="https://github.com/tw93/Pake/releases">Release</a>下载,<b>此外点击可展开快捷键说明</b></summary>
|
|
99
|
+
<summary>🏂 You can download more applications (such as Flomo / YuQue / RunCode) from <a href="https://github.com/tw93/Pake/releases">Releases</a>. <b>Click here to expand the shortcuts reference!</b></summary>
|
|
99
100
|
|
|
100
101
|
<br/>
|
|
101
102
|
|
|
102
|
-
| Mac | Windows/Linux |
|
|
103
|
-
| --------------------------- | ------------------------------ |
|
|
104
|
-
| <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> |
|
|
105
|
-
| <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> |
|
|
106
|
-
| <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> |
|
|
107
|
-
| <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> |
|
|
108
|
-
| <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> |
|
|
109
|
-
| <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> |
|
|
110
|
-
| <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> |
|
|
111
|
-
| <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> |
|
|
112
|
-
| <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> |
|
|
113
|
-
| <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> |
|
|
114
|
-
|
|
115
|
-
|
|
103
|
+
| Mac | Windows/Linux | Function |
|
|
104
|
+
| --------------------------- | ------------------------------ | ----------------------------- |
|
|
105
|
+
| <kbd>⌘</kbd> + <kbd>[</kbd> | <kbd>Ctrl</kbd> + <kbd>←</kbd> | Return to the previous page |
|
|
106
|
+
| <kbd>⌘</kbd> + <kbd>]</kbd> | <kbd>Ctrl</kbd> + <kbd>→</kbd> | Go to the next page |
|
|
107
|
+
| <kbd>⌘</kbd> + <kbd>↑</kbd> | <kbd>Ctrl</kbd> + <kbd>↑</kbd> | Auto scroll to top of page |
|
|
108
|
+
| <kbd>⌘</kbd> + <kbd>↓</kbd> | <kbd>Ctrl</kbd> + <kbd>↓</kbd> | Auto scroll to bottom of page |
|
|
109
|
+
| <kbd>⌘</kbd> + <kbd>r</kbd> | <kbd>Ctrl</kbd> + <kbd>r</kbd> | Refresh Page |
|
|
110
|
+
| <kbd>⌘</kbd> + <kbd>w</kbd> | <kbd>Ctrl</kbd> + <kbd>w</kbd> | Hide window, not quite |
|
|
111
|
+
| <kbd>⌘</kbd> + <kbd>-</kbd> | <kbd>Ctrl</kbd> + <kbd>-</kbd> | Zoom out the page |
|
|
112
|
+
| <kbd>⌘</kbd> + <kbd>+</kbd> | <kbd>Ctrl</kbd> + <kbd>+</kbd> | Zoom in the page |
|
|
113
|
+
| <kbd>⌘</kbd> + <kbd>=</kbd> | <kbd>Ctrl</kbd> + <kbd>=</kbd> | Zoom in the Page |
|
|
114
|
+
| <kbd>⌘</kbd> + <kbd>0</kbd> | <kbd>Ctrl</kbd> + <kbd>0</kbd> | Reset the page zoom |
|
|
115
|
+
|
|
116
|
+
In addition, double-click the title bar to switch to full-screen mode. For Mac users, you can also use the gesture to go to the previous or next page and drag the title bar to move the window.
|
|
116
117
|
|
|
117
118
|
</details>
|
|
118
119
|
|
|
119
|
-
##
|
|
120
|
+
## Before starting
|
|
120
121
|
|
|
121
|
-
1.
|
|
122
|
-
2.
|
|
123
|
-
3.
|
|
122
|
+
1. **For beginners**: Play with Popular Packages to find out Pake's capabilities, or try to pack your application with [GitHub Actions](https://github.com/tw93/Pake/wiki/GitHub-Actions-Online-Compilation-Multi-system-Version). Don't hesitate to reach for assistance at [Discussion](https://github.com/tw93/Pake/discussions)!
|
|
123
|
+
2. **For developers**: “Command-Line Packaging” supports macOS fully. For Windows/Linux users, it requires some tinkering. [Configure your environment](https://tauri.app/v1/guides/getting-started/prerequisites) before getting started.
|
|
124
|
+
3. **For hackers**: For people who are good at both front-end development and Rust, how about customizing your apps' function more with the following [Customized Development](#development)?
|
|
124
125
|
|
|
125
|
-
##
|
|
126
|
+
## Command-Line Packaging
|
|
126
127
|
|
|
127
|
-
|
|
128
|
-
<img src="https://gw.alipayobjects.com/zos/k/zd/pake.gif" width="100%">
|
|
129
|
-
</kbd>
|
|
130
|
-
<br/><br/>
|
|
128
|
+

|
|
131
129
|
|
|
132
|
-
**Pake
|
|
130
|
+
**Pake provides a command line tool, making the flow of package customization quicker and easier. See [documentation](./bin/README_EN.md) for more information.**
|
|
133
131
|
|
|
134
132
|
```bash
|
|
135
|
-
|
|
133
|
+
# Install with npm
|
|
136
134
|
npm install -g pake-cli
|
|
137
135
|
|
|
138
|
-
|
|
139
|
-
pake url [
|
|
136
|
+
# Command usage
|
|
137
|
+
pake url [OPTIONS]...
|
|
140
138
|
|
|
141
|
-
|
|
139
|
+
# Feel free to play with Pake! It might take a while to prepare the environment the first time you launch Pake.
|
|
142
140
|
pake https://weekly.tw93.fun --name Weekly --transparent
|
|
143
141
|
```
|
|
144
142
|
|
|
145
|
-
|
|
143
|
+
If you are new to the command line, you can compile packages online with _GitHub Actions_. See the [Tutorial](https://github.com/tw93/Pake/wiki/GitHub-Actions-Online-Compilation-Multi-system-Version) for more information.
|
|
146
144
|
|
|
147
|
-
##
|
|
145
|
+
## Development
|
|
148
146
|
|
|
149
|
-
|
|
147
|
+
Prepare your environment before starting. Make sure you have Rust `>=1.63` and Node `>=16` (e.g., `16.18.1`) installed on your computer. For installation guidance, see [Tauri documentation](https://tauri.app/v1/guides/getting-started/prerequisites).
|
|
148
|
+
|
|
149
|
+
If you are unfamiliar with these, it is better to try out the above tool to pack with one click.
|
|
150
150
|
|
|
151
151
|
```sh
|
|
152
|
-
|
|
152
|
+
# Install Dependencies
|
|
153
153
|
npm i
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
# Local development
|
|
156
156
|
npm run dev
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
# Local debug
|
|
159
159
|
npm run dev:debug
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
# Pack application
|
|
162
162
|
npm run build
|
|
163
|
-
|
|
164
163
|
```
|
|
165
164
|
|
|
166
|
-
##
|
|
165
|
+
## Advanced Usage
|
|
167
166
|
|
|
168
|
-
1.
|
|
169
|
-
2.
|
|
170
|
-
3.
|
|
171
|
-
4.
|
|
167
|
+
1. You can refer to the [codebase structure](https://github.com/tw93/Pake/wiki/Description-of-Pake's-code-structure) before working on Pake, which will help you much in development.
|
|
168
|
+
2. Add four fields (`url`, `productName`, `icon`, and `identifier`) to the `tauri.conf.json` and `tauri.xxx.conf.json` in the `src-tauri` directory. You can select a `icon` from the `icons` directory or download one from [macOSicons](https://macosicons.com/#/) to match your product needs.
|
|
169
|
+
3. For configurations on window properties, you can modify the `tauri.conf.json` file to change the value of `width`, `height`, `fullscreen` (or not), `resizable` (or not) of the `windows` property. To adapt to the immersive header on Mac, change `transparent` to `true`, look for the `Header` element, and add the `padding-top` property.
|
|
170
|
+
4. For advanced usages such as style rewriting, advertisement removal, JS injection, container message communication, and user-defined shortcut keys, see [Advanced Usage of Make](https://github.com/tw93/Pake/wiki/Advanced-Usage-of-Make).
|
|
172
171
|
|
|
173
|
-
##
|
|
172
|
+
## Developer
|
|
174
173
|
|
|
175
|
-
Pake
|
|
174
|
+
Pake's development can not be without these Hackers. They contributed a lot of capabilities for Pake. Also, welcome to follow them! ❤️
|
|
176
175
|
|
|
177
176
|
<!-- readme: contributors -start -->
|
|
178
177
|
<table>
|
|
@@ -301,9 +300,9 @@ Pake 的发展离不开这些 Hacker 们,一起贡献了大量能力,也欢
|
|
|
301
300
|
</table>
|
|
302
301
|
<!-- readme: contributors -end -->
|
|
303
302
|
|
|
304
|
-
##
|
|
303
|
+
## Support
|
|
305
304
|
|
|
306
|
-
1.
|
|
307
|
-
2.
|
|
308
|
-
3.
|
|
309
|
-
4.
|
|
305
|
+
1. I have two cats, TangYuan and Coke. If you think Pake delights your life, you can feed them <a href="https://miaoyan.app/cats.html?name=Pake" target="_blank">some canned food 🥩</a>.
|
|
306
|
+
2. If you like Pake, you can star it on GitHub. Also, welcome to [recommend Pake](https://twitter.com/intent/tweet?url=https://github.com/tw93/Pake&text=%23Pake%20-%20A%20simple%20Rust%20packaged%20web%20pages%20to%20generate%20Mac%20App%20tool,%20compared%20to%20traditional%20Electron%20package,%20the%20size%20of%20nearly%2040%20times%20smaller,%20generally%20about%202M,%20the%20underlying%20use%20of%20Tauri,%20performance%20experience%20than%20the%20JS%20framework%20is%20much%20lighter~) to your friends.
|
|
307
|
+
3. You can follow my [Twitter](https://twitter.com/HiTw93) to get the latest news of Pake or join our [Telegram](https://t.me/miaoyan) chat group.
|
|
308
|
+
4. I hope that you enjoy playing with it. Let us know if you find a website that would be great for a Mac App!
|
package/dist/cli.js
CHANGED
|
@@ -48,6 +48,7 @@ const DEFAULT_PAKE_OPTIONS = {
|
|
|
48
48
|
resizable: true,
|
|
49
49
|
transparent: false,
|
|
50
50
|
debug: false,
|
|
51
|
+
multiArch: false,
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
const tlds = [
|
|
@@ -1642,7 +1643,7 @@ function mergeTauriConfig(url, options, tauriConf) {
|
|
|
1642
1643
|
process.exit();
|
|
1643
1644
|
}
|
|
1644
1645
|
}
|
|
1645
|
-
if (process.platform === "win32"
|
|
1646
|
+
if (process.platform === "win32") {
|
|
1646
1647
|
const reg = new RegExp(/([0-9]*[a-zA-Z]+[0-9]*)+/);
|
|
1647
1648
|
if (!reg.test(name) || reg.exec(name)[0].length != name.length) {
|
|
1648
1649
|
logger.error("package name is illegal, it must be letters, numbers, and it must contain the letters");
|
|
@@ -2016,10 +2017,23 @@ class MacBuilder {
|
|
|
2016
2017
|
log.debug('PakeAppOptions', options);
|
|
2017
2018
|
const { name } = options;
|
|
2018
2019
|
yield mergeTauriConfig(url, options, tauriConf);
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2020
|
+
let dmgName;
|
|
2021
|
+
if (options.multiArch) {
|
|
2022
|
+
yield shellExec(`cd ${npmDirectory} && npm install && npm run build:mac`);
|
|
2023
|
+
dmgName = `${name}_${tauriConf.package.version}_universal.dmg`;
|
|
2024
|
+
}
|
|
2025
|
+
else {
|
|
2026
|
+
yield shellExec(`cd ${npmDirectory} && npm install && npm run build`);
|
|
2027
|
+
let arch = "x64";
|
|
2028
|
+
if (process.arch === "arm64") {
|
|
2029
|
+
arch = "aarch64";
|
|
2030
|
+
}
|
|
2031
|
+
else {
|
|
2032
|
+
arch = process.arch;
|
|
2033
|
+
}
|
|
2034
|
+
dmgName = `${name}_${tauriConf.package.version}_${arch}.dmg`;
|
|
2035
|
+
}
|
|
2036
|
+
const appPath = this.getBuildAppPath(npmDirectory, dmgName, options.multiArch);
|
|
2023
2037
|
const distPath = path.resolve(`${name}.dmg`);
|
|
2024
2038
|
yield fs.copyFile(appPath, distPath);
|
|
2025
2039
|
yield fs.unlink(appPath);
|
|
@@ -2027,8 +2041,15 @@ class MacBuilder {
|
|
|
2027
2041
|
logger.success('You can find the app installer in', distPath);
|
|
2028
2042
|
});
|
|
2029
2043
|
}
|
|
2030
|
-
getBuildAppPath(npmDirectory, dmgName) {
|
|
2031
|
-
|
|
2044
|
+
getBuildAppPath(npmDirectory, dmgName, multiArch) {
|
|
2045
|
+
let dmgPath;
|
|
2046
|
+
if (multiArch) {
|
|
2047
|
+
dmgPath = 'src-tauri/target/universal-apple-darwin/release/bundle/dmg';
|
|
2048
|
+
}
|
|
2049
|
+
else {
|
|
2050
|
+
dmgPath = 'src-tauri/target/release/bundle/dmg';
|
|
2051
|
+
}
|
|
2052
|
+
return path.join(npmDirectory, dmgPath, dmgName);
|
|
2032
2053
|
}
|
|
2033
2054
|
}
|
|
2034
2055
|
|
|
@@ -2149,10 +2170,10 @@ class BuilderFactory {
|
|
|
2149
2170
|
}
|
|
2150
2171
|
|
|
2151
2172
|
var name = "pake-cli";
|
|
2152
|
-
var version = "1.2.
|
|
2153
|
-
var description = "🤱🏻
|
|
2173
|
+
var version = "1.2.3";
|
|
2174
|
+
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。";
|
|
2154
2175
|
var engines = {
|
|
2155
|
-
node: "
|
|
2176
|
+
node: ">=16.0.0"
|
|
2156
2177
|
};
|
|
2157
2178
|
var bin = {
|
|
2158
2179
|
pake: "./cli.js"
|
|
@@ -2252,18 +2273,19 @@ function checkUpdateTips() {
|
|
|
2252
2273
|
});
|
|
2253
2274
|
}
|
|
2254
2275
|
|
|
2255
|
-
program.version(packageJson.version).description('A cli application can
|
|
2276
|
+
program.version(packageJson.version).description('A cli application can turn any webpage into a desktop app with Rust.');
|
|
2256
2277
|
program
|
|
2257
2278
|
.showHelpAfterError()
|
|
2258
2279
|
.argument('[url]', 'the web url you want to package', validateUrlInput)
|
|
2259
|
-
.option('--name <string>', 'application name')
|
|
2260
|
-
.option('--icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
|
2261
|
-
.option('--
|
|
2262
|
-
.option('--
|
|
2263
|
-
.option('--
|
|
2264
|
-
.option('--
|
|
2265
|
-
.option('--
|
|
2266
|
-
.option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.
|
|
2280
|
+
.option('-n, --name <string>', 'application name')
|
|
2281
|
+
.option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
|
2282
|
+
.option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
|
2283
|
+
.option('-h, --height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
|
|
2284
|
+
.option('-f, --fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
|
2285
|
+
.option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
|
2286
|
+
.option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
|
|
2287
|
+
.option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
|
|
2288
|
+
.option('-m, --multi-arch', "Supports both Intel and m1 chips, only for Mac.", DEFAULT_PAKE_OPTIONS.multiArch)
|
|
2267
2289
|
.action((url, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2268
2290
|
yield checkUpdateTips();
|
|
2269
2291
|
if (!url) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pake-cli",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "🤱🏻
|
|
3
|
+
"version": "1.2.3",
|
|
4
|
+
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 很简单的用 Rust 打包网页生成很小的桌面 App。",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": "
|
|
6
|
+
"node": ">=16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"bin": {
|
|
9
9
|
"pake": "./cli.js"
|
package/src-tauri/Cargo.lock
CHANGED
|
@@ -34,14 +34,15 @@ dependencies = [
|
|
|
34
34
|
|
|
35
35
|
[[package]]
|
|
36
36
|
name = "anyhow"
|
|
37
|
-
version = "1.0.
|
|
37
|
+
version = "1.0.68"
|
|
38
38
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
39
|
-
checksum = "
|
|
39
|
+
checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61"
|
|
40
40
|
|
|
41
41
|
[[package]]
|
|
42
42
|
name = "app"
|
|
43
43
|
version = "0.1.0"
|
|
44
44
|
dependencies = [
|
|
45
|
+
"dirs",
|
|
45
46
|
"home",
|
|
46
47
|
"image",
|
|
47
48
|
"serde",
|
|
@@ -139,11 +140,12 @@ dependencies = [
|
|
|
139
140
|
|
|
140
141
|
[[package]]
|
|
141
142
|
name = "bstr"
|
|
142
|
-
version = "
|
|
143
|
+
version = "1.1.0"
|
|
143
144
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
144
|
-
checksum = "
|
|
145
|
+
checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b"
|
|
145
146
|
dependencies = [
|
|
146
147
|
"memchr",
|
|
148
|
+
"serde",
|
|
147
149
|
]
|
|
148
150
|
|
|
149
151
|
[[package]]
|
|
@@ -196,9 +198,9 @@ dependencies = [
|
|
|
196
198
|
|
|
197
199
|
[[package]]
|
|
198
200
|
name = "cargo_toml"
|
|
199
|
-
version = "0.13.
|
|
201
|
+
version = "0.13.3"
|
|
200
202
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
201
|
-
checksum = "
|
|
203
|
+
checksum = "497049e9477329f8f6a559972ee42e117487d01d1e8c2cc9f836ea6fa23a9e1a"
|
|
202
204
|
dependencies = [
|
|
203
205
|
"serde",
|
|
204
206
|
"toml",
|
|
@@ -206,9 +208,9 @@ dependencies = [
|
|
|
206
208
|
|
|
207
209
|
[[package]]
|
|
208
210
|
name = "cc"
|
|
209
|
-
version = "1.0.
|
|
211
|
+
version = "1.0.78"
|
|
210
212
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
211
|
-
checksum = "
|
|
213
|
+
checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d"
|
|
212
214
|
|
|
213
215
|
[[package]]
|
|
214
216
|
name = "cesu8"
|
|
@@ -522,6 +524,15 @@ dependencies = [
|
|
|
522
524
|
"crypto-common",
|
|
523
525
|
]
|
|
524
526
|
|
|
527
|
+
[[package]]
|
|
528
|
+
name = "dirs"
|
|
529
|
+
version = "4.0.0"
|
|
530
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
531
|
+
checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059"
|
|
532
|
+
dependencies = [
|
|
533
|
+
"dirs-sys",
|
|
534
|
+
]
|
|
535
|
+
|
|
525
536
|
[[package]]
|
|
526
537
|
name = "dirs-next"
|
|
527
538
|
version = "2.0.0"
|
|
@@ -532,6 +543,17 @@ dependencies = [
|
|
|
532
543
|
"dirs-sys-next",
|
|
533
544
|
]
|
|
534
545
|
|
|
546
|
+
[[package]]
|
|
547
|
+
name = "dirs-sys"
|
|
548
|
+
version = "0.3.7"
|
|
549
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
550
|
+
checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6"
|
|
551
|
+
dependencies = [
|
|
552
|
+
"libc",
|
|
553
|
+
"redox_users",
|
|
554
|
+
"winapi",
|
|
555
|
+
]
|
|
556
|
+
|
|
535
557
|
[[package]]
|
|
536
558
|
name = "dirs-sys-next"
|
|
537
559
|
version = "0.1.2"
|
|
@@ -860,7 +882,7 @@ dependencies = [
|
|
|
860
882
|
"libc",
|
|
861
883
|
"log",
|
|
862
884
|
"rustversion",
|
|
863
|
-
"windows",
|
|
885
|
+
"windows 0.39.0",
|
|
864
886
|
]
|
|
865
887
|
|
|
866
888
|
[[package]]
|
|
@@ -984,15 +1006,15 @@ dependencies = [
|
|
|
984
1006
|
|
|
985
1007
|
[[package]]
|
|
986
1008
|
name = "glob"
|
|
987
|
-
version = "0.3.
|
|
1009
|
+
version = "0.3.1"
|
|
988
1010
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
989
|
-
checksum = "
|
|
1011
|
+
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
|
990
1012
|
|
|
991
1013
|
[[package]]
|
|
992
1014
|
name = "globset"
|
|
993
|
-
version = "0.4.
|
|
1015
|
+
version = "0.4.10"
|
|
994
1016
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
995
|
-
checksum = "
|
|
1017
|
+
checksum = "029d74589adefde59de1a0c4f4732695c32805624aec7b68d91503d4dba79afc"
|
|
996
1018
|
dependencies = [
|
|
997
1019
|
"aho-corasick",
|
|
998
1020
|
"bstr",
|
|
@@ -1069,9 +1091,9 @@ dependencies = [
|
|
|
1069
1091
|
|
|
1070
1092
|
[[package]]
|
|
1071
1093
|
name = "half"
|
|
1072
|
-
version = "2.
|
|
1094
|
+
version = "2.2.0"
|
|
1073
1095
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1074
|
-
checksum = "
|
|
1096
|
+
checksum = "6c467d36af040b7b2681f5fddd27427f6da8d3d072f575a265e181d2f8e8d157"
|
|
1075
1097
|
dependencies = [
|
|
1076
1098
|
"crunchy",
|
|
1077
1099
|
]
|
|
@@ -1099,9 +1121,9 @@ checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
|
|
|
1099
1121
|
|
|
1100
1122
|
[[package]]
|
|
1101
1123
|
name = "hermit-abi"
|
|
1102
|
-
version = "0.
|
|
1124
|
+
version = "0.2.6"
|
|
1103
1125
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1104
|
-
checksum = "
|
|
1126
|
+
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
|
|
1105
1127
|
dependencies = [
|
|
1106
1128
|
"libc",
|
|
1107
1129
|
]
|
|
@@ -1137,7 +1159,7 @@ checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
|
|
|
1137
1159
|
dependencies = [
|
|
1138
1160
|
"bytes",
|
|
1139
1161
|
"fnv",
|
|
1140
|
-
"itoa 1.0.
|
|
1162
|
+
"itoa 1.0.5",
|
|
1141
1163
|
]
|
|
1142
1164
|
|
|
1143
1165
|
[[package]]
|
|
@@ -1174,11 +1196,10 @@ dependencies = [
|
|
|
1174
1196
|
|
|
1175
1197
|
[[package]]
|
|
1176
1198
|
name = "ignore"
|
|
1177
|
-
version = "0.4.
|
|
1199
|
+
version = "0.4.19"
|
|
1178
1200
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1179
|
-
checksum = "
|
|
1201
|
+
checksum = "a05705bc64e0b66a806c3740bd6578ea66051b157ec42dc219c785cbf185aef3"
|
|
1180
1202
|
dependencies = [
|
|
1181
|
-
"crossbeam-utils",
|
|
1182
1203
|
"globset",
|
|
1183
1204
|
"lazy_static",
|
|
1184
1205
|
"log",
|
|
@@ -1245,9 +1266,9 @@ checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
|
|
|
1245
1266
|
|
|
1246
1267
|
[[package]]
|
|
1247
1268
|
name = "itoa"
|
|
1248
|
-
version = "1.0.
|
|
1269
|
+
version = "1.0.5"
|
|
1249
1270
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1250
|
-
checksum = "
|
|
1271
|
+
checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
|
|
1251
1272
|
|
|
1252
1273
|
[[package]]
|
|
1253
1274
|
name = "javascriptcore-rs"
|
|
@@ -1347,9 +1368,9 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
|
|
|
1347
1368
|
|
|
1348
1369
|
[[package]]
|
|
1349
1370
|
name = "libc"
|
|
1350
|
-
version = "0.2.
|
|
1371
|
+
version = "0.2.139"
|
|
1351
1372
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1352
|
-
checksum = "
|
|
1373
|
+
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
|
1353
1374
|
|
|
1354
1375
|
[[package]]
|
|
1355
1376
|
name = "line-wrap"
|
|
@@ -1562,9 +1583,9 @@ dependencies = [
|
|
|
1562
1583
|
|
|
1563
1584
|
[[package]]
|
|
1564
1585
|
name = "num_cpus"
|
|
1565
|
-
version = "1.
|
|
1586
|
+
version = "1.15.0"
|
|
1566
1587
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1567
|
-
checksum = "
|
|
1588
|
+
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
|
|
1568
1589
|
dependencies = [
|
|
1569
1590
|
"hermit-abi",
|
|
1570
1591
|
"libc",
|
|
@@ -1621,9 +1642,9 @@ dependencies = [
|
|
|
1621
1642
|
|
|
1622
1643
|
[[package]]
|
|
1623
1644
|
name = "once_cell"
|
|
1624
|
-
version = "1.
|
|
1645
|
+
version = "1.17.0"
|
|
1625
1646
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1626
|
-
checksum = "
|
|
1647
|
+
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
|
|
1627
1648
|
|
|
1628
1649
|
[[package]]
|
|
1629
1650
|
name = "overload"
|
|
@@ -1681,9 +1702,9 @@ dependencies = [
|
|
|
1681
1702
|
|
|
1682
1703
|
[[package]]
|
|
1683
1704
|
name = "paste"
|
|
1684
|
-
version = "1.0.
|
|
1705
|
+
version = "1.0.11"
|
|
1685
1706
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1686
|
-
checksum = "
|
|
1707
|
+
checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
|
|
1687
1708
|
|
|
1688
1709
|
[[package]]
|
|
1689
1710
|
name = "percent-encoding"
|
|
@@ -1693,9 +1714,9 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
|
|
|
1693
1714
|
|
|
1694
1715
|
[[package]]
|
|
1695
1716
|
name = "pest"
|
|
1696
|
-
version = "2.5.
|
|
1717
|
+
version = "2.5.2"
|
|
1697
1718
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1698
|
-
checksum = "
|
|
1719
|
+
checksum = "0f6e86fb9e7026527a0d46bc308b841d73170ef8f443e1807f6ef88526a816d4"
|
|
1699
1720
|
dependencies = [
|
|
1700
1721
|
"thiserror",
|
|
1701
1722
|
"ucd-trie",
|
|
@@ -1912,24 +1933,24 @@ dependencies = [
|
|
|
1912
1933
|
|
|
1913
1934
|
[[package]]
|
|
1914
1935
|
name = "proc-macro-hack"
|
|
1915
|
-
version = "0.5.
|
|
1936
|
+
version = "0.5.20+deprecated"
|
|
1916
1937
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1917
|
-
checksum = "
|
|
1938
|
+
checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068"
|
|
1918
1939
|
|
|
1919
1940
|
[[package]]
|
|
1920
1941
|
name = "proc-macro2"
|
|
1921
|
-
version = "1.0.
|
|
1942
|
+
version = "1.0.49"
|
|
1922
1943
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1923
|
-
checksum = "
|
|
1944
|
+
checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
|
|
1924
1945
|
dependencies = [
|
|
1925
1946
|
"unicode-ident",
|
|
1926
1947
|
]
|
|
1927
1948
|
|
|
1928
1949
|
[[package]]
|
|
1929
1950
|
name = "quote"
|
|
1930
|
-
version = "1.0.
|
|
1951
|
+
version = "1.0.23"
|
|
1931
1952
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1932
|
-
checksum = "
|
|
1953
|
+
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
|
|
1933
1954
|
dependencies = [
|
|
1934
1955
|
"proc-macro2",
|
|
1935
1956
|
]
|
|
@@ -2116,20 +2137,20 @@ version = "0.4.0"
|
|
|
2116
2137
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2117
2138
|
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
|
|
2118
2139
|
dependencies = [
|
|
2119
|
-
"semver 1.0.
|
|
2140
|
+
"semver 1.0.16",
|
|
2120
2141
|
]
|
|
2121
2142
|
|
|
2122
2143
|
[[package]]
|
|
2123
2144
|
name = "rustversion"
|
|
2124
|
-
version = "1.0.
|
|
2145
|
+
version = "1.0.11"
|
|
2125
2146
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2126
|
-
checksum = "
|
|
2147
|
+
checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70"
|
|
2127
2148
|
|
|
2128
2149
|
[[package]]
|
|
2129
2150
|
name = "ryu"
|
|
2130
|
-
version = "1.0.
|
|
2151
|
+
version = "1.0.12"
|
|
2131
2152
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2132
|
-
checksum = "
|
|
2153
|
+
checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
|
|
2133
2154
|
|
|
2134
2155
|
[[package]]
|
|
2135
2156
|
name = "safemem"
|
|
@@ -2195,9 +2216,9 @@ dependencies = [
|
|
|
2195
2216
|
|
|
2196
2217
|
[[package]]
|
|
2197
2218
|
name = "semver"
|
|
2198
|
-
version = "1.0.
|
|
2219
|
+
version = "1.0.16"
|
|
2199
2220
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2200
|
-
checksum = "
|
|
2221
|
+
checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a"
|
|
2201
2222
|
dependencies = [
|
|
2202
2223
|
"serde",
|
|
2203
2224
|
]
|
|
@@ -2213,18 +2234,18 @@ dependencies = [
|
|
|
2213
2234
|
|
|
2214
2235
|
[[package]]
|
|
2215
2236
|
name = "serde"
|
|
2216
|
-
version = "1.0.
|
|
2237
|
+
version = "1.0.152"
|
|
2217
2238
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2218
|
-
checksum = "
|
|
2239
|
+
checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
|
|
2219
2240
|
dependencies = [
|
|
2220
2241
|
"serde_derive",
|
|
2221
2242
|
]
|
|
2222
2243
|
|
|
2223
2244
|
[[package]]
|
|
2224
2245
|
name = "serde_derive"
|
|
2225
|
-
version = "1.0.
|
|
2246
|
+
version = "1.0.152"
|
|
2226
2247
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2227
|
-
checksum = "
|
|
2248
|
+
checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
|
|
2228
2249
|
dependencies = [
|
|
2229
2250
|
"proc-macro2",
|
|
2230
2251
|
"quote",
|
|
@@ -2233,20 +2254,20 @@ dependencies = [
|
|
|
2233
2254
|
|
|
2234
2255
|
[[package]]
|
|
2235
2256
|
name = "serde_json"
|
|
2236
|
-
version = "1.0.
|
|
2257
|
+
version = "1.0.91"
|
|
2237
2258
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2238
|
-
checksum = "
|
|
2259
|
+
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
|
|
2239
2260
|
dependencies = [
|
|
2240
|
-
"itoa 1.0.
|
|
2261
|
+
"itoa 1.0.5",
|
|
2241
2262
|
"ryu",
|
|
2242
2263
|
"serde",
|
|
2243
2264
|
]
|
|
2244
2265
|
|
|
2245
2266
|
[[package]]
|
|
2246
2267
|
name = "serde_repr"
|
|
2247
|
-
version = "0.1.
|
|
2268
|
+
version = "0.1.10"
|
|
2248
2269
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2249
|
-
checksum = "
|
|
2270
|
+
checksum = "9a5ec9fa74a20ebbe5d9ac23dac1fc96ba0ecfe9f50f2843b52e537b10fbcb4e"
|
|
2250
2271
|
dependencies = [
|
|
2251
2272
|
"proc-macro2",
|
|
2252
2273
|
"quote",
|
|
@@ -2434,9 +2455,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
|
|
2434
2455
|
|
|
2435
2456
|
[[package]]
|
|
2436
2457
|
name = "syn"
|
|
2437
|
-
version = "1.0.
|
|
2458
|
+
version = "1.0.107"
|
|
2438
2459
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2439
|
-
checksum = "
|
|
2460
|
+
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
|
|
2440
2461
|
dependencies = [
|
|
2441
2462
|
"proc-macro2",
|
|
2442
2463
|
"quote",
|
|
@@ -2471,9 +2492,9 @@ dependencies = [
|
|
|
2471
2492
|
|
|
2472
2493
|
[[package]]
|
|
2473
2494
|
name = "tao"
|
|
2474
|
-
version = "0.15.
|
|
2495
|
+
version = "0.15.8"
|
|
2475
2496
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2476
|
-
checksum = "
|
|
2497
|
+
checksum = "ac8e6399427c8494f9849b58694754d7cc741293348a6836b6c8d2c5aa82d8e6"
|
|
2477
2498
|
dependencies = [
|
|
2478
2499
|
"bitflags",
|
|
2479
2500
|
"cairo-rs",
|
|
@@ -2510,7 +2531,7 @@ dependencies = [
|
|
|
2510
2531
|
"serde",
|
|
2511
2532
|
"unicode-segmentation",
|
|
2512
2533
|
"uuid 1.2.2",
|
|
2513
|
-
"windows",
|
|
2534
|
+
"windows 0.39.0",
|
|
2514
2535
|
"windows-implement",
|
|
2515
2536
|
"x11-dl",
|
|
2516
2537
|
]
|
|
@@ -2528,9 +2549,9 @@ dependencies = [
|
|
|
2528
2549
|
|
|
2529
2550
|
[[package]]
|
|
2530
2551
|
name = "tauri"
|
|
2531
|
-
version = "1.2.
|
|
2552
|
+
version = "1.2.3"
|
|
2532
2553
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2533
|
-
checksum = "
|
|
2554
|
+
checksum = "5b48820ee3bb6a5031a83b2b6e11f8630bdc5a2f68cb841ab8ebc7a15a916679"
|
|
2534
2555
|
dependencies = [
|
|
2535
2556
|
"anyhow",
|
|
2536
2557
|
"cocoa",
|
|
@@ -2550,7 +2571,7 @@ dependencies = [
|
|
|
2550
2571
|
"percent-encoding",
|
|
2551
2572
|
"rand 0.8.5",
|
|
2552
2573
|
"raw-window-handle",
|
|
2553
|
-
"semver 1.0.
|
|
2574
|
+
"semver 1.0.16",
|
|
2554
2575
|
"serde",
|
|
2555
2576
|
"serde_json",
|
|
2556
2577
|
"serde_repr",
|
|
@@ -2568,7 +2589,7 @@ dependencies = [
|
|
|
2568
2589
|
"uuid 1.2.2",
|
|
2569
2590
|
"webkit2gtk",
|
|
2570
2591
|
"webview2-com",
|
|
2571
|
-
"windows",
|
|
2592
|
+
"windows 0.39.0",
|
|
2572
2593
|
]
|
|
2573
2594
|
|
|
2574
2595
|
[[package]]
|
|
@@ -2581,7 +2602,7 @@ dependencies = [
|
|
|
2581
2602
|
"cargo_toml",
|
|
2582
2603
|
"heck 0.4.0",
|
|
2583
2604
|
"json-patch",
|
|
2584
|
-
"semver 1.0.
|
|
2605
|
+
"semver 1.0.16",
|
|
2585
2606
|
"serde_json",
|
|
2586
2607
|
"tauri-utils",
|
|
2587
2608
|
"winres",
|
|
@@ -2601,7 +2622,7 @@ dependencies = [
|
|
|
2601
2622
|
"png",
|
|
2602
2623
|
"proc-macro2",
|
|
2603
2624
|
"quote",
|
|
2604
|
-
"semver 1.0.
|
|
2625
|
+
"semver 1.0.16",
|
|
2605
2626
|
"serde",
|
|
2606
2627
|
"serde_json",
|
|
2607
2628
|
"sha2",
|
|
@@ -2643,7 +2664,7 @@ dependencies = [
|
|
|
2643
2664
|
"thiserror",
|
|
2644
2665
|
"uuid 1.2.2",
|
|
2645
2666
|
"webview2-com",
|
|
2646
|
-
"windows",
|
|
2667
|
+
"windows 0.39.0",
|
|
2647
2668
|
]
|
|
2648
2669
|
|
|
2649
2670
|
[[package]]
|
|
@@ -2662,7 +2683,7 @@ dependencies = [
|
|
|
2662
2683
|
"uuid 1.2.2",
|
|
2663
2684
|
"webkit2gtk",
|
|
2664
2685
|
"webview2-com",
|
|
2665
|
-
"windows",
|
|
2686
|
+
"windows 0.39.0",
|
|
2666
2687
|
"wry",
|
|
2667
2688
|
]
|
|
2668
2689
|
|
|
@@ -2684,14 +2705,14 @@ dependencies = [
|
|
|
2684
2705
|
"phf 0.10.1",
|
|
2685
2706
|
"proc-macro2",
|
|
2686
2707
|
"quote",
|
|
2687
|
-
"semver 1.0.
|
|
2708
|
+
"semver 1.0.16",
|
|
2688
2709
|
"serde",
|
|
2689
2710
|
"serde_json",
|
|
2690
2711
|
"serde_with",
|
|
2691
2712
|
"thiserror",
|
|
2692
2713
|
"url",
|
|
2693
2714
|
"walkdir",
|
|
2694
|
-
"windows",
|
|
2715
|
+
"windows 0.39.0",
|
|
2695
2716
|
]
|
|
2696
2717
|
|
|
2697
2718
|
[[package]]
|
|
@@ -2727,18 +2748,18 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c"
|
|
|
2727
2748
|
|
|
2728
2749
|
[[package]]
|
|
2729
2750
|
name = "thiserror"
|
|
2730
|
-
version = "1.0.
|
|
2751
|
+
version = "1.0.38"
|
|
2731
2752
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2732
|
-
checksum = "
|
|
2753
|
+
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
|
|
2733
2754
|
dependencies = [
|
|
2734
2755
|
"thiserror-impl",
|
|
2735
2756
|
]
|
|
2736
2757
|
|
|
2737
2758
|
[[package]]
|
|
2738
2759
|
name = "thiserror-impl"
|
|
2739
|
-
version = "1.0.
|
|
2760
|
+
version = "1.0.38"
|
|
2740
2761
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2741
|
-
checksum = "
|
|
2762
|
+
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
|
|
2742
2763
|
dependencies = [
|
|
2743
2764
|
"proc-macro2",
|
|
2744
2765
|
"quote",
|
|
@@ -2780,7 +2801,7 @@ version = "0.3.17"
|
|
|
2780
2801
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2781
2802
|
checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376"
|
|
2782
2803
|
dependencies = [
|
|
2783
|
-
"itoa 1.0.
|
|
2804
|
+
"itoa 1.0.5",
|
|
2784
2805
|
"serde",
|
|
2785
2806
|
"time-core",
|
|
2786
2807
|
"time-macros",
|
|
@@ -2818,9 +2839,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
|
|
|
2818
2839
|
|
|
2819
2840
|
[[package]]
|
|
2820
2841
|
name = "tokio"
|
|
2821
|
-
version = "1.
|
|
2842
|
+
version = "1.24.1"
|
|
2822
2843
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2823
|
-
checksum = "
|
|
2844
|
+
checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae"
|
|
2824
2845
|
dependencies = [
|
|
2825
2846
|
"autocfg",
|
|
2826
2847
|
"bytes",
|
|
@@ -2832,9 +2853,9 @@ dependencies = [
|
|
|
2832
2853
|
|
|
2833
2854
|
[[package]]
|
|
2834
2855
|
name = "toml"
|
|
2835
|
-
version = "0.5.
|
|
2856
|
+
version = "0.5.10"
|
|
2836
2857
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2837
|
-
checksum = "
|
|
2858
|
+
checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f"
|
|
2838
2859
|
dependencies = [
|
|
2839
2860
|
"serde",
|
|
2840
2861
|
]
|
|
@@ -2930,9 +2951,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
|
|
|
2930
2951
|
|
|
2931
2952
|
[[package]]
|
|
2932
2953
|
name = "unicode-ident"
|
|
2933
|
-
version = "1.0.
|
|
2954
|
+
version = "1.0.6"
|
|
2934
2955
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2935
|
-
checksum = "
|
|
2956
|
+
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
|
2936
2957
|
|
|
2937
2958
|
[[package]]
|
|
2938
2959
|
name = "unicode-normalization"
|
|
@@ -3095,18 +3116,20 @@ dependencies = [
|
|
|
3095
3116
|
|
|
3096
3117
|
[[package]]
|
|
3097
3118
|
name = "webbrowser"
|
|
3098
|
-
version = "0.8.
|
|
3119
|
+
version = "0.8.4"
|
|
3099
3120
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3100
|
-
checksum = "
|
|
3121
|
+
checksum = "e74f5ff7786c4c21f61ba8e30ea29c9745f06fca0a4a02d083b3c662583399e8"
|
|
3101
3122
|
dependencies = [
|
|
3123
|
+
"core-foundation",
|
|
3124
|
+
"dirs",
|
|
3102
3125
|
"jni",
|
|
3126
|
+
"log",
|
|
3103
3127
|
"ndk-context",
|
|
3104
3128
|
"objc",
|
|
3105
3129
|
"raw-window-handle",
|
|
3106
3130
|
"url",
|
|
3107
3131
|
"web-sys",
|
|
3108
|
-
"
|
|
3109
|
-
"winapi",
|
|
3132
|
+
"windows 0.43.0",
|
|
3110
3133
|
]
|
|
3111
3134
|
|
|
3112
3135
|
[[package]]
|
|
@@ -3164,7 +3187,7 @@ checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178"
|
|
|
3164
3187
|
dependencies = [
|
|
3165
3188
|
"webview2-com-macros",
|
|
3166
3189
|
"webview2-com-sys",
|
|
3167
|
-
"windows",
|
|
3190
|
+
"windows 0.39.0",
|
|
3168
3191
|
"windows-implement",
|
|
3169
3192
|
]
|
|
3170
3193
|
|
|
@@ -3189,7 +3212,7 @@ dependencies = [
|
|
|
3189
3212
|
"serde",
|
|
3190
3213
|
"serde_json",
|
|
3191
3214
|
"thiserror",
|
|
3192
|
-
"windows",
|
|
3215
|
+
"windows 0.39.0",
|
|
3193
3216
|
"windows-bindgen",
|
|
3194
3217
|
"windows-metadata",
|
|
3195
3218
|
]
|
|
@@ -3200,12 +3223,6 @@ version = "0.1.7"
|
|
|
3200
3223
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3201
3224
|
checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
|
|
3202
3225
|
|
|
3203
|
-
[[package]]
|
|
3204
|
-
name = "widestring"
|
|
3205
|
-
version = "1.0.2"
|
|
3206
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3207
|
-
checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8"
|
|
3208
|
-
|
|
3209
3226
|
[[package]]
|
|
3210
3227
|
name = "winapi"
|
|
3211
3228
|
version = "0.3.9"
|
|
@@ -3251,6 +3268,21 @@ dependencies = [
|
|
|
3251
3268
|
"windows_x86_64_msvc 0.39.0",
|
|
3252
3269
|
]
|
|
3253
3270
|
|
|
3271
|
+
[[package]]
|
|
3272
|
+
name = "windows"
|
|
3273
|
+
version = "0.43.0"
|
|
3274
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3275
|
+
checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
|
|
3276
|
+
dependencies = [
|
|
3277
|
+
"windows_aarch64_gnullvm",
|
|
3278
|
+
"windows_aarch64_msvc 0.42.0",
|
|
3279
|
+
"windows_i686_gnu 0.42.0",
|
|
3280
|
+
"windows_i686_msvc 0.42.0",
|
|
3281
|
+
"windows_x86_64_gnu 0.42.0",
|
|
3282
|
+
"windows_x86_64_gnullvm",
|
|
3283
|
+
"windows_x86_64_msvc 0.42.0",
|
|
3284
|
+
]
|
|
3285
|
+
|
|
3254
3286
|
[[package]]
|
|
3255
3287
|
name = "windows-bindgen"
|
|
3256
3288
|
version = "0.39.0"
|
|
@@ -3413,7 +3445,7 @@ dependencies = [
|
|
|
3413
3445
|
"webkit2gtk",
|
|
3414
3446
|
"webkit2gtk-sys",
|
|
3415
3447
|
"webview2-com",
|
|
3416
|
-
"windows",
|
|
3448
|
+
"windows 0.39.0",
|
|
3417
3449
|
"windows-implement",
|
|
3418
3450
|
]
|
|
3419
3451
|
|
package/src-tauri/Cargo.toml
CHANGED
|
@@ -7,7 +7,7 @@ license = ""
|
|
|
7
7
|
repository = ""
|
|
8
8
|
default-run = "app"
|
|
9
9
|
edition = "2021"
|
|
10
|
-
rust-version = "1.
|
|
10
|
+
rust-version = "1.63.0"
|
|
11
11
|
|
|
12
12
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
13
13
|
|
|
@@ -17,12 +17,13 @@ tauri-build = { version = "1.2.1", features = [] }
|
|
|
17
17
|
[dependencies]
|
|
18
18
|
serde_json = "1.0.89"
|
|
19
19
|
serde = { version = "1.0.150", features = ["derive"] }
|
|
20
|
-
tauri = { version = "1.2.
|
|
20
|
+
tauri = { version = "1.2.3", features = [] }
|
|
21
21
|
image = "0.24.5"
|
|
22
22
|
home = "0.5"
|
|
23
23
|
tauri-utils = "1.2.1"
|
|
24
24
|
webbrowser = "0.8.2"
|
|
25
25
|
wry = "0.23.4"
|
|
26
|
+
dirs = "4.0"
|
|
26
27
|
|
|
27
28
|
[features]
|
|
28
29
|
# by default Tauri runs in production mode
|
|
Binary file
|
package/src-tauri/src/main.rs
CHANGED
|
@@ -26,6 +26,14 @@ use wry::application::window::Icon;
|
|
|
26
26
|
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
|
27
27
|
use wry::webview::WebContext;
|
|
28
28
|
|
|
29
|
+
use dirs::download_dir;
|
|
30
|
+
use std::path::PathBuf;
|
|
31
|
+
|
|
32
|
+
enum UserEvent {
|
|
33
|
+
DownloadStarted(String, String),
|
|
34
|
+
DownloadComplete(Option<PathBuf>, bool),
|
|
35
|
+
}
|
|
36
|
+
|
|
29
37
|
fn main() -> wry::Result<()> {
|
|
30
38
|
#[cfg(target_os = "macos")]
|
|
31
39
|
let (menu_bar_menu, close_item) = {
|
|
@@ -82,8 +90,9 @@ fn main() -> wry::Result<()> {
|
|
|
82
90
|
fullscreen,
|
|
83
91
|
..
|
|
84
92
|
} = get_windows_config().1.unwrap_or_default();
|
|
85
|
-
let event_loop = EventLoop::new();
|
|
86
93
|
|
|
94
|
+
let event_loop: EventLoop<UserEvent> = EventLoop::with_user_event();
|
|
95
|
+
let proxy = event_loop.create_proxy();
|
|
87
96
|
let common_window = WindowBuilder::new()
|
|
88
97
|
.with_title("")
|
|
89
98
|
.with_resizable(resizable)
|
|
@@ -93,9 +102,14 @@ fn main() -> wry::Result<()> {
|
|
|
93
102
|
None
|
|
94
103
|
})
|
|
95
104
|
.with_inner_size(wry::application::dpi::LogicalSize::new(width, height));
|
|
105
|
+
|
|
96
106
|
#[cfg(target_os = "windows")]
|
|
97
107
|
let window = {
|
|
98
|
-
let icon_path = format!("png/{}_32.ico", package_name);
|
|
108
|
+
let mut icon_path = format!("png/{}_32.ico", package_name);
|
|
109
|
+
// If there is no setting, use the default one.
|
|
110
|
+
if !std::path::Path::new(&icon_path).exists() {
|
|
111
|
+
icon_path = "png/icon_32.ico".to_string();
|
|
112
|
+
}
|
|
99
113
|
let icon = load_icon(std::path::Path::new(&icon_path));
|
|
100
114
|
common_window
|
|
101
115
|
.with_decorations(true)
|
|
@@ -117,22 +131,40 @@ fn main() -> wry::Result<()> {
|
|
|
117
131
|
.build(&event_loop)
|
|
118
132
|
.unwrap();
|
|
119
133
|
|
|
134
|
+
// Handling events of JS -> Rust
|
|
120
135
|
let handler = move |window: &Window, req: String| {
|
|
121
136
|
if req == "drag_window" {
|
|
122
137
|
let _ = window.drag_window();
|
|
123
138
|
} else if req == "fullscreen" {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
} else {
|
|
127
|
-
window.set_fullscreen(Some(Fullscreen::Borderless(None)));
|
|
128
|
-
}
|
|
139
|
+
let is_maximized = window.is_maximized();
|
|
140
|
+
window.set_maximized(!is_maximized);
|
|
129
141
|
} else if req.starts_with("open_browser") {
|
|
130
142
|
let href = req.replace("open_browser:", "");
|
|
131
143
|
webbrowser::open(&href).expect("no browser");
|
|
132
144
|
}
|
|
133
145
|
};
|
|
134
146
|
|
|
135
|
-
|
|
147
|
+
let download_started = {
|
|
148
|
+
let proxy = proxy.clone();
|
|
149
|
+
move |uri: String, default_path: &mut PathBuf| {
|
|
150
|
+
let path = download_dir()
|
|
151
|
+
.unwrap()
|
|
152
|
+
.join(default_path.display().to_string())
|
|
153
|
+
.as_path()
|
|
154
|
+
.to_path_buf();
|
|
155
|
+
*default_path = path.clone();
|
|
156
|
+
let submitted = proxy
|
|
157
|
+
.send_event(UserEvent::DownloadStarted(uri, path.display().to_string()))
|
|
158
|
+
.is_ok();
|
|
159
|
+
submitted
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
let download_completed = {
|
|
164
|
+
move |_uri, path, success| {
|
|
165
|
+
let _ = proxy.send_event(UserEvent::DownloadComplete(path, success));
|
|
166
|
+
}
|
|
167
|
+
};
|
|
136
168
|
|
|
137
169
|
#[cfg(target_os = "macos")]
|
|
138
170
|
let webview = {
|
|
@@ -144,6 +176,8 @@ fn main() -> wry::Result<()> {
|
|
|
144
176
|
.with_initialization_script(include_str!("pake.js"))
|
|
145
177
|
.with_ipc_handler(handler)
|
|
146
178
|
.with_back_forward_navigation_gestures(true)
|
|
179
|
+
.with_download_started_handler(download_started)
|
|
180
|
+
.with_download_completed_handler(download_completed)
|
|
147
181
|
.build()?
|
|
148
182
|
};
|
|
149
183
|
|
|
@@ -173,6 +207,8 @@ fn main() -> wry::Result<()> {
|
|
|
173
207
|
.with_initialization_script(include_str!("pake.js"))
|
|
174
208
|
.with_ipc_handler(handler)
|
|
175
209
|
.with_web_context(&mut web_content)
|
|
210
|
+
.with_download_started_handler(download_started)
|
|
211
|
+
.with_download_completed_handler(download_completed)
|
|
176
212
|
.build()?
|
|
177
213
|
};
|
|
178
214
|
#[cfg(feature = "devtools")]
|
|
@@ -201,6 +237,18 @@ fn main() -> wry::Result<()> {
|
|
|
201
237
|
println!("Clicked on {:?}", menu_id);
|
|
202
238
|
println!("Clicked on {:?}", webview.window().is_visible());
|
|
203
239
|
}
|
|
240
|
+
Event::UserEvent(UserEvent::DownloadStarted(uri, temp_dir)) => {
|
|
241
|
+
println!("Download: {}", uri);
|
|
242
|
+
println!("Will write to: {:?}", temp_dir);
|
|
243
|
+
}
|
|
244
|
+
Event::UserEvent(UserEvent::DownloadComplete(_, success)) => {
|
|
245
|
+
println!("Succeeded: {}", success);
|
|
246
|
+
if success {
|
|
247
|
+
let _ = webview.evaluate_script("window.pakeToast('Save in downloads folder')");
|
|
248
|
+
} else {
|
|
249
|
+
println!("No output path")
|
|
250
|
+
}
|
|
251
|
+
}
|
|
204
252
|
_ => (),
|
|
205
253
|
}
|
|
206
254
|
});
|
package/src-tauri/src/pake.js
CHANGED
|
@@ -51,11 +51,17 @@ window.addEventListener("DOMContentLoaded", (_event) => {
|
|
|
51
51
|
display: none !important;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
#page .main_header, .cb-layout-basic--navbar
|
|
54
|
+
#page .main_header, .cb-layout-basic--navbar,
|
|
55
|
+
#app .splitpanes.splitpanes--horizontal.no-splitter header {
|
|
55
56
|
padding-top: 20px;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
.chakra-ui-light #app .chakra-heading,
|
|
59
|
+
.chakra-ui-light #app .chakra-heading,
|
|
60
|
+
.chakra-ui-dark #app .chakra-heading,
|
|
61
|
+
.chakra-ui-light #app .chakra-stack,
|
|
62
|
+
.chakra-ui-dark #app .chakra-stack,
|
|
63
|
+
.app-main .sidebar-mouse-in-out,
|
|
64
|
+
.chakra-modal__content-container .chakra-modal__header > div > div {
|
|
59
65
|
padding-top: 10px;
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -362,3 +368,20 @@ function zoomIn() {
|
|
|
362
368
|
function zoomOut() {
|
|
363
369
|
zoomCommon((htmlZoom) => `${Math.max(parseInt(htmlZoom) - 10, 30)}%`);
|
|
364
370
|
}
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
function pakeToast(msg) {
|
|
374
|
+
const m = document.createElement('div');
|
|
375
|
+
m.innerHTML = msg;
|
|
376
|
+
m.style.cssText = "max-width:60%;min-width: 180px;padding:0 8px;height: 36px;color: rgb(255, 255, 255);line-height: 36px;text-align: center;border-radius: 4px;position: fixed;bottom:16px;right: 16px;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.9);font-size: 14px;";
|
|
377
|
+
document.body.appendChild(m);
|
|
378
|
+
setTimeout(function() {
|
|
379
|
+
const d = 0.5;
|
|
380
|
+
m.style.transition = 'transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
|
|
381
|
+
m.style.opacity = '0';
|
|
382
|
+
setTimeout(function() {
|
|
383
|
+
document.body.removeChild(m)
|
|
384
|
+
}, d * 1000);
|
|
385
|
+
}, 2500);
|
|
386
|
+
}
|
|
387
|
+
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|