plusui-native 0.2.104 → 0.2.105

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.104",
3
+ "version": "0.2.105",
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.102",
31
- "plusui-native-connect": "^0.1.102"
30
+ "plusui-native-builder": "^0.1.103",
31
+ "plusui-native-connect": "^0.1.103"
32
32
  },
33
33
  "peerDependencies": {
34
- "plusui-native-connect": "^0.1.102"
34
+ "plusui-native-connect": "^0.1.103"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -37,7 +37,7 @@ struct WindowConfig {
37
37
  bool showInTaskbar = true;
38
38
  bool devTools = true;
39
39
  bool scrollbars = false;
40
- bool enableFileDrop = true;
40
+ bool fileDrop = true; // Enable file drop from OS to webview
41
41
  std::string route = "/"; // Starting route
42
42
  int devServerPort = 5173;
43
43
  } windowConfig;
@@ -79,7 +79,7 @@ int main() {
79
79
  .alwaysOnTop(windowConfig.alwaysOnTop)
80
80
  .skipTaskbar(!windowConfig.showInTaskbar)
81
81
  .scrollbars(windowConfig.scrollbars)
82
- .enableFileDrop(windowConfig.enableFileDrop)
82
+ .fileDrop(windowConfig.fileDrop)
83
83
  .centered(true)
84
84
  .build();
85
85
 
@@ -93,10 +93,10 @@ int main() {
93
93
  mainWindow.hide();
94
94
  }
95
95
 
96
- // Wire up custom connect channels
96
+ // Wire up connect system (for custom frontend ↔ backend communication)
97
+ // Run `plusui connect` after adding custom connect methods
97
98
  static Connect conn;
98
99
  bindConnect(mainWindow, conn);
99
- initConnect(conn);
100
100
 
101
101
  // Load frontend
102
102
  #ifdef PLUSUI_DEV_MODE
@@ -105,19 +105,6 @@ int main() {
105
105
  mainWindow.loadFile("frontend/dist/index.html" + (windowConfig.route == "/" ? "" : "#" + windowConfig.route));
106
106
  #endif
107
107
 
108
- // File drop — C++ receives dropped files automatically.
109
- // Frontend receives the event via plusui.fileDrop.onFilesDropped().
110
- mainWindow.onFileDrop([](const std::string& filesJson) {
111
- try {
112
- auto files = json::parse(filesJson);
113
- std::cout << "[FileDrop] " << files.size() << " file(s) received\n";
114
- for (const auto& f : files) {
115
- std::cout << " " << f.value("name", "?")
116
- << " (" << f.value("size", 0) << " bytes)\n";
117
- }
118
- } catch (...) {}
119
- });
120
-
121
108
  App runtime;
122
109
  runtime.run();
123
110
  return 0;
@@ -37,7 +37,7 @@ struct WindowConfig {
37
37
  bool showInTaskbar = true;
38
38
  bool devTools = true;
39
39
  bool scrollbars = false;
40
- bool enableFileDrop = true;
40
+ bool fileDrop = true; // Enable file drop from OS to webview
41
41
  std::string route = "/"; // Starting route
42
42
  int devServerPort = 5173;
43
43
  } windowConfig;
@@ -79,7 +79,7 @@ int main() {
79
79
  .alwaysOnTop(windowConfig.alwaysOnTop)
80
80
  .skipTaskbar(!windowConfig.showInTaskbar)
81
81
  .scrollbars(windowConfig.scrollbars)
82
- .enableFileDrop(windowConfig.enableFileDrop)
82
+ .fileDrop(windowConfig.fileDrop)
83
83
  .centered(true)
84
84
  .build();
85
85
 
@@ -93,10 +93,10 @@ int main() {
93
93
  mainWindow.hide();
94
94
  }
95
95
 
96
- // Wire up custom connect channels
96
+ // Wire up connect system (for custom frontend ↔ backend communication)
97
+ // Run `plusui connect` after adding custom connect methods
97
98
  static Connect conn;
98
99
  bindConnect(mainWindow, conn);
99
- initConnect(conn);
100
100
 
101
101
  // Load frontend
102
102
  #ifdef PLUSUI_DEV_MODE
@@ -105,19 +105,6 @@ int main() {
105
105
  mainWindow.loadFile("frontend/dist/index.html" + (windowConfig.route == "/" ? "" : "#" + windowConfig.route));
106
106
  #endif
107
107
 
108
- // File drop — C++ receives dropped files automatically.
109
- // Frontend receives the event via plusui.fileDrop.onFilesDropped().
110
- mainWindow.onFileDrop([](const std::string& filesJson) {
111
- try {
112
- auto files = json::parse(filesJson);
113
- std::cout << "[FileDrop] " << files.size() << " file(s) received\n";
114
- for (const auto& f : files) {
115
- std::cout << " " << f.value("name", "?")
116
- << " (" << f.value("size", 0) << " bytes)\n";
117
- }
118
- } catch (...) {}
119
- });
120
-
121
108
  App runtime;
122
109
  runtime.run();
123
110
  return 0;