plusui-native 0.2.55 → 0.2.57

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.55",
3
+ "version": "0.2.57",
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.54",
31
- "plusui-native-connect": "^0.1.54"
30
+ "plusui-native-builder": "^0.1.56",
31
+ "plusui-native-connect": "^0.1.56"
32
32
  },
33
33
  "peerDependencies": {
34
- "plusui-native-connect": "^0.1.54"
34
+ "plusui-native-connect": "^0.1.56"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
package/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import { mkdir, readFile, stat, rm, readdir, writeFile, copyFile } from 'fs/promises';
4
4
  import { existsSync, watch, statSync, mkdirSync } from 'fs';
@@ -301,12 +301,30 @@ async function updatePlusUIPackages() {
301
301
  if (isInProject) {
302
302
  let updatedCount = 0;
303
303
  let upToDateCount = 0;
304
+ let installedCount = 0;
304
305
 
305
306
  for (const pkg of packages) {
306
307
  const currentVersion = getInstalledPackageVersion(pkg);
307
308
 
308
309
  if (!currentVersion) {
309
- log(`${COLORS.dim}${pkg}: not installed${COLORS.reset}`);
310
+ const latestVersion = getLatestPackageVersion(pkg);
311
+
312
+ if (!latestVersion) {
313
+ log(`${COLORS.yellow}${pkg}: not installed (couldn't resolve latest version)${COLORS.reset}`);
314
+ continue;
315
+ }
316
+
317
+ try {
318
+ log(`${COLORS.blue}${pkg}: not installed → ${latestVersion}${COLORS.reset}`);
319
+ execSync(`npm install ${pkg}@${latestVersion}`, {
320
+ stdio: ['ignore', 'ignore', 'pipe'],
321
+ encoding: 'utf8'
322
+ });
323
+ log(`${COLORS.green}✓ ${pkg} installed${COLORS.reset}`);
324
+ installedCount++;
325
+ } catch (e) {
326
+ log(`${COLORS.red}✗ ${pkg} install failed${COLORS.reset}`);
327
+ }
310
328
  continue;
311
329
  }
312
330
 
@@ -344,6 +362,9 @@ async function updatePlusUIPackages() {
344
362
  if (updatedCount > 0) {
345
363
  log(`Updated ${updatedCount} package${updatedCount !== 1 ? 's' : ''}`, 'green');
346
364
  }
365
+ if (installedCount > 0) {
366
+ log(`Installed ${installedCount} missing package${installedCount !== 1 ? 's' : ''}`, 'green');
367
+ }
347
368
  if (upToDateCount > 0) {
348
369
  log(`${upToDateCount} package${upToDateCount !== 1 ? 's' : ''} already up to date`, 'dim');
349
370
  }
@@ -449,8 +470,8 @@ function getDevBuildDir() {
449
470
 
450
471
  function resolveBindgenScriptPath() {
451
472
  const candidates = [
452
- resolve(__dirname, '../../plusui-connector/src/connect.js'),
453
- resolve(__dirname, '../../plusui-connector/src/index.js'),
473
+ resolve(__dirname, '../../plusui-connect/src/connect.js'),
474
+ resolve(__dirname, '../../plusui-connect/src/index.js'),
454
475
  resolve(__dirname, '../../plusui-native-connect/src/connect.js'),
455
476
  resolve(__dirname, '../../plusui-native-connect/src/index.js'),
456
477
  resolve(__dirname, '../../plusui-native-bindgen/src/index.js'),
@@ -27,7 +27,7 @@ set(PLUSUI_CORE_DIR "")
27
27
 
28
28
  # Location 1: Project-local Core directory
29
29
  set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
30
- if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
30
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
31
31
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
32
32
  add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
33
33
  set(PLUSUI_FOUND TRUE)
@@ -36,7 +36,7 @@ endif()
36
36
 
37
37
  # Location 2: Local development (sibling to project inside PlusUI repo)
38
38
  set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
39
- if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
39
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
40
40
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
41
41
  add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
42
42
  set(PLUSUI_FOUND TRUE)
@@ -174,23 +174,14 @@ int main() {
174
174
  // ========================================
175
175
  // FILE DROP EVENTS (Native Drag & Drop API)
176
176
  // ========================================
177
- // Native FileDrop API - handles OS-level file drag-and-drop
178
- // Enabled via windowConfig.enableFileDrop which automatically disables
179
- // webview drag-drop to prevent "copy" cursor at window edges
180
- event::on("fileDrop.filesDropped", [](const std::string& data) {
177
+ // Native FileDrop API - handles OS-level file drag-and-drop.
178
+ // Frontend dragEnter/dragLeave events are dispatched from injected WebView script.
179
+ mainWindow.onFileDrop([](const std::string& data) {
181
180
  std::cout << "Files dropped: " << data << std::endl;
182
181
  // Parse the JSON data to get file info
183
182
  // You can process files here in C++
184
183
  });
185
184
 
186
- event::on("fileDrop.dragEnter", [](const std::string&) {
187
- std::cout << "Drag entered window" << std::endl;
188
- });
189
-
190
- event::on("fileDrop.dragLeave", [](const std::string&) {
191
- std::cout << "Drag left window" << std::endl;
192
- });
193
-
194
185
  // ========================================
195
186
  // RUN APPLICATION
196
187
  // ========================================
@@ -27,7 +27,7 @@ set(PLUSUI_CORE_DIR "")
27
27
 
28
28
  # Location 1: Project-local Core directory
29
29
  set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
30
- if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
30
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
31
31
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
32
32
  add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
33
33
  set(PLUSUI_FOUND TRUE)
@@ -36,7 +36,7 @@ endif()
36
36
 
37
37
  # Location 2: Local development (sibling to project inside PlusUI repo)
38
38
  set(PLUSUI_CORE_DEV "${CMAKE_SOURCE_DIR}/../Core")
39
- if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
39
+ if(NOT PLUSUI_FOUND AND EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
40
40
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
41
41
  add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
42
42
  set(PLUSUI_FOUND TRUE)
@@ -168,23 +168,14 @@ int main() {
168
168
  // ========================================
169
169
  // FILE DROP EVENTS (Native Drag & Drop API)
170
170
  // ========================================
171
- // Native FileDrop API - handles OS-level file drag-and-drop
172
- // Enabled via windowConfig.enableFileDrop which automatically disables
173
- // webview drag-drop to prevent "copy" cursor at window edges
174
- event::on("fileDrop.filesDropped", [](const std::string& data) {
171
+ // Native FileDrop API - handles OS-level file drag-and-drop.
172
+ // Frontend dragEnter/dragLeave events are dispatched from injected WebView script.
173
+ mainWindow.onFileDrop([](const std::string& data) {
175
174
  std::cout << "Files dropped: " << data << std::endl;
176
175
  // Parse the JSON data to get file info
177
176
  // You can process files here in C++
178
177
  });
179
178
 
180
- event::on("fileDrop.dragEnter", [](const std::string&) {
181
- std::cout << "Drag entered window" << std::endl;
182
- });
183
-
184
- event::on("fileDrop.dragLeave", [](const std::string&) {
185
- std::cout << "Drag left window" << std::endl;
186
- });
187
-
188
179
  // ========================================
189
180
  // RUN APPLICATION
190
181
  // ========================================