plusui-native 0.2.41 → 0.2.43
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": "plusui-native",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.43",
|
|
4
4
|
"description": "PlusUI CLI - Build C++ desktop apps modern UI ",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"semver": "^7.6.0",
|
|
28
28
|
"which": "^4.0.0",
|
|
29
29
|
"execa": "^8.0.1",
|
|
30
|
-
"plusui-native-builder": "^0.1.
|
|
31
|
-
"plusui-native-bindgen": "^0.1.
|
|
30
|
+
"plusui-native-builder": "^0.1.42",
|
|
31
|
+
"plusui-native-bindgen": "^0.1.42"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"plusui-native-bindgen": "^0.1.
|
|
34
|
+
"plusui-native-bindgen": "^0.1.42"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
@@ -21,6 +21,10 @@ function App() {
|
|
|
21
21
|
const [dropZoneStyle, setDropZoneStyle] = useState('');
|
|
22
22
|
|
|
23
23
|
useEffect(() => {
|
|
24
|
+
win.show().catch(() => {
|
|
25
|
+
// no-op for browser preview mode
|
|
26
|
+
});
|
|
27
|
+
|
|
24
28
|
// Setup routes
|
|
25
29
|
router.setRoutes(routes);
|
|
26
30
|
|
|
@@ -211,26 +215,6 @@ function App() {
|
|
|
211
215
|
)}
|
|
212
216
|
</div>
|
|
213
217
|
|
|
214
|
-
<div className="ick={handleReload} className="button">Reload</button>
|
|
215
|
-
</div>
|
|
216
|
-
</div>
|
|
217
|
-
|
|
218
|
-
<div className="card">
|
|
219
|
-
<h2>Router (SPA Navigation)</h2>
|
|
220
|
-
<div className="button-group">
|
|
221
|
-
<button onClick={handleGoHome} className="button">Home /</button>
|
|
222
|
-
<button onClick={handleGoSettings} className="button">Settings</button>
|
|
223
|
-
</div>
|
|
224
|
-
<p style={{ fontSize: '0.85em', color: '#666', marginTop: '10px' }}>
|
|
225
|
-
Define routes with <code>router.setRoutes({'{ ... }'})</code> then navigate with <code>router.push('/path')</code>
|
|
226
|
-
</p>
|
|
227
|
-
</div>
|
|
228
|
-
|
|
229
|
-
<div className="card">
|
|
230
|
-
<h2>App Control</h2>
|
|
231
|
-
<button onClick={handleQuit} className="button button-danger">Quit App</button>
|
|
232
|
-
</div>
|
|
233
|
-
|
|
234
218
|
<div className="info">
|
|
235
219
|
<p>Edit <code>frontend/src/App.tsx</code> to modify the UI.</p>
|
|
236
220
|
<p>Edit <code>main.cpp</code> to add C++ functionality.</p>
|
|
@@ -73,6 +73,8 @@ initBridge();
|
|
|
73
73
|
export const win = {
|
|
74
74
|
minimize: async () => invoke('window.minimize', []),
|
|
75
75
|
maximize: async () => invoke('window.maximize', []),
|
|
76
|
+
show: async () => invoke('window.show', []),
|
|
77
|
+
hide: async () => invoke('window.hide', []),
|
|
76
78
|
close: async () => invoke('window.close', []),
|
|
77
79
|
setPosition: async (x: number, y: number) => invoke('window.setPosition', [x, y]),
|
|
78
80
|
getSize: async (): Promise<WindowSize> => invoke('window.getSize', []) as Promise<WindowSize>,
|
|
@@ -26,6 +26,7 @@ struct AppConfig {
|
|
|
26
26
|
// --- Startup ---
|
|
27
27
|
bool autoStart = false; // Launch on system startup
|
|
28
28
|
bool hiddenOnStartup = false; // Start hidden
|
|
29
|
+
bool showWhenFrontendReady = true; // Hide initial blank webview until React is mounted
|
|
29
30
|
|
|
30
31
|
// --- Security ---
|
|
31
32
|
bool webSecurity = true; // Enable web security (CORS, etc.)
|
|
@@ -149,7 +150,7 @@ int main() {
|
|
|
149
150
|
// ========================================
|
|
150
151
|
// HEADLESS / HIDDEN STARTUP
|
|
151
152
|
// ========================================
|
|
152
|
-
if (appConfig.headless || appConfig.hiddenOnStartup) {
|
|
153
|
+
if (appConfig.headless || appConfig.hiddenOnStartup || appConfig.showWhenFrontendReady) {
|
|
153
154
|
mainWindow.hide();
|
|
154
155
|
}
|
|
155
156
|
|