plusui-native 0.2.42 → 0.2.44

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.42",
3
+ "version": "0.2.44",
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.41",
31
- "plusui-native-bindgen": "^0.1.41"
30
+ "plusui-native-builder": "^0.1.43",
31
+ "plusui-native-bindgen": "^0.1.43"
32
32
  },
33
33
  "peerDependencies": {
34
- "plusui-native-bindgen": "^0.1.41"
34
+ "plusui-native-bindgen": "^0.1.43"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -23,6 +23,7 @@ endif()
23
23
  # Find PlusUI Core library
24
24
  # Strategy: Check multiple locations for the Core library
25
25
  set(PLUSUI_FOUND FALSE)
26
+ set(PLUSUI_CORE_DIR "")
26
27
 
27
28
  # Location 1: Project-local Core directory
28
29
  set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
@@ -30,6 +31,7 @@ if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
30
31
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
31
32
  add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
32
33
  set(PLUSUI_FOUND TRUE)
34
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_LOCAL}")
33
35
  endif()
34
36
 
35
37
  # Location 2: Local development (sibling to project inside PlusUI repo)
@@ -38,21 +40,36 @@ if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
38
40
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
39
41
  add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
40
42
  set(PLUSUI_FOUND TRUE)
43
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_DEV}")
41
44
  endif()
42
45
 
43
- # Location 3: Installed via npm (separate core package)
46
+ # Location 3: Installed via npm packages
44
47
  if(NOT PLUSUI_FOUND)
48
+ set(PLUSUI_NATIVE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native")
49
+ set(PLUSUI_NATIVE_NPM_CORE "${CMAKE_SOURCE_DIR}/node_modules/plusui-native/Core")
45
50
  set(PLUSUI_CORE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core")
46
51
  set(PLUSUI_CORE_NPM_LEGACY "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core/Core")
47
52
 
48
- if(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
53
+ if(EXISTS "${PLUSUI_NATIVE_NPM}/CMakeLists.txt")
54
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM}")
55
+ add_subdirectory("${PLUSUI_NATIVE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
56
+ set(PLUSUI_FOUND TRUE)
57
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM}")
58
+ elseif(EXISTS "${PLUSUI_NATIVE_NPM_CORE}/CMakeLists.txt")
59
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM_CORE}")
60
+ add_subdirectory("${PLUSUI_NATIVE_NPM_CORE}" "${CMAKE_BINARY_DIR}/plusui-core")
61
+ set(PLUSUI_FOUND TRUE)
62
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM_CORE}")
63
+ elseif(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
49
64
  message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_CORE_NPM}")
50
65
  add_subdirectory("${PLUSUI_CORE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
51
66
  set(PLUSUI_FOUND TRUE)
67
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM}")
52
68
  elseif(EXISTS "${PLUSUI_CORE_NPM_LEGACY}/CMakeLists.txt")
53
69
  message(STATUS "Found PlusUI Core in node_modules (legacy): ${PLUSUI_CORE_NPM_LEGACY}")
54
70
  add_subdirectory("${PLUSUI_CORE_NPM_LEGACY}" "${CMAKE_BINARY_DIR}/plusui-core")
55
71
  set(PLUSUI_FOUND TRUE)
72
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM_LEGACY}")
56
73
  endif()
57
74
  endif()
58
75
 
@@ -63,6 +80,7 @@ if(NOT PLUSUI_FOUND)
63
80
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_PARENT}")
64
81
  add_subdirectory("${PLUSUI_CORE_PARENT}" "${CMAKE_BINARY_DIR}/plusui-core")
65
82
  set(PLUSUI_FOUND TRUE)
83
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_PARENT}")
66
84
  endif()
67
85
  endif()
68
86
 
@@ -70,17 +88,31 @@ if(NOT PLUSUI_FOUND)
70
88
  message(FATAL_ERROR "
71
89
  PlusUI Core not found!
72
90
 
73
- Install dependencies (npm install) or add a Core folder in this project root.
91
+ Install dependencies (npm install) or add a Core folder in this project root.
74
92
 
75
93
  Searched locations:
76
94
  - ${PLUSUI_CORE_LOCAL}
77
- - ${PLUSUI_CORE_DEV}
95
+ - ${PLUSUI_CORE_DEV}
96
+ - ${PLUSUI_NATIVE_NPM}
97
+ - ${PLUSUI_NATIVE_NPM_CORE}
78
98
  - ${PLUSUI_CORE_NPM}
79
99
  - ${PLUSUI_CORE_NPM_LEGACY}
80
- - ${PLUSUI_CORE_PARENT}
100
+ - ${PLUSUI_CORE_PARENT}
81
101
  ")
82
102
  endif()
83
103
 
104
+ # Validate native FileDrop support in the resolved Core
105
+ if(NOT EXISTS "${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp")
106
+ message(FATAL_ERROR "
107
+ PlusUI Core found, but native FileDrop support is missing.
108
+
109
+ Expected file:
110
+ ${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp
111
+
112
+ Update PlusUI Core to a version that includes FileDrop support.
113
+ ")
114
+ endif()
115
+
84
116
  # Create the executable
85
117
  add_executable({{PROJECT_NAME}} main.cpp)
86
118
 
@@ -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
 
@@ -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
 
@@ -23,6 +23,7 @@ endif()
23
23
  # Find PlusUI Core library
24
24
  # Strategy: Check multiple locations for the Core library
25
25
  set(PLUSUI_FOUND FALSE)
26
+ set(PLUSUI_CORE_DIR "")
26
27
 
27
28
  # Location 1: Project-local Core directory
28
29
  set(PLUSUI_CORE_LOCAL "${CMAKE_SOURCE_DIR}/Core")
@@ -30,6 +31,7 @@ if(EXISTS "${PLUSUI_CORE_LOCAL}/CMakeLists.txt")
30
31
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_LOCAL}")
31
32
  add_subdirectory("${PLUSUI_CORE_LOCAL}" "${CMAKE_BINARY_DIR}/plusui-core")
32
33
  set(PLUSUI_FOUND TRUE)
34
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_LOCAL}")
33
35
  endif()
34
36
 
35
37
  # Location 2: Local development (sibling to project inside PlusUI repo)
@@ -38,21 +40,36 @@ if(EXISTS "${PLUSUI_CORE_DEV}/CMakeLists.txt")
38
40
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_DEV}")
39
41
  add_subdirectory("${PLUSUI_CORE_DEV}" "${CMAKE_BINARY_DIR}/plusui-core")
40
42
  set(PLUSUI_FOUND TRUE)
43
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_DEV}")
41
44
  endif()
42
45
 
43
- # Location 3: Installed via npm (separate core package)
46
+ # Location 3: Installed via npm packages
44
47
  if(NOT PLUSUI_FOUND)
48
+ set(PLUSUI_NATIVE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native")
49
+ set(PLUSUI_NATIVE_NPM_CORE "${CMAKE_SOURCE_DIR}/node_modules/plusui-native/Core")
45
50
  set(PLUSUI_CORE_NPM "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core")
46
51
  set(PLUSUI_CORE_NPM_LEGACY "${CMAKE_SOURCE_DIR}/node_modules/plusui-native-core/Core")
47
52
 
48
- if(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
53
+ if(EXISTS "${PLUSUI_NATIVE_NPM}/CMakeLists.txt")
54
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM}")
55
+ add_subdirectory("${PLUSUI_NATIVE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
56
+ set(PLUSUI_FOUND TRUE)
57
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM}")
58
+ elseif(EXISTS "${PLUSUI_NATIVE_NPM_CORE}/CMakeLists.txt")
59
+ message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_NATIVE_NPM_CORE}")
60
+ add_subdirectory("${PLUSUI_NATIVE_NPM_CORE}" "${CMAKE_BINARY_DIR}/plusui-core")
61
+ set(PLUSUI_FOUND TRUE)
62
+ set(PLUSUI_CORE_DIR "${PLUSUI_NATIVE_NPM_CORE}")
63
+ elseif(EXISTS "${PLUSUI_CORE_NPM}/CMakeLists.txt")
49
64
  message(STATUS "Found PlusUI Core in node_modules: ${PLUSUI_CORE_NPM}")
50
65
  add_subdirectory("${PLUSUI_CORE_NPM}" "${CMAKE_BINARY_DIR}/plusui-core")
51
66
  set(PLUSUI_FOUND TRUE)
67
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM}")
52
68
  elseif(EXISTS "${PLUSUI_CORE_NPM_LEGACY}/CMakeLists.txt")
53
69
  message(STATUS "Found PlusUI Core in node_modules (legacy): ${PLUSUI_CORE_NPM_LEGACY}")
54
70
  add_subdirectory("${PLUSUI_CORE_NPM_LEGACY}" "${CMAKE_BINARY_DIR}/plusui-core")
55
71
  set(PLUSUI_FOUND TRUE)
72
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_NPM_LEGACY}")
56
73
  endif()
57
74
  endif()
58
75
 
@@ -63,6 +80,7 @@ if(NOT PLUSUI_FOUND)
63
80
  message(STATUS "Found PlusUI Core at: ${PLUSUI_CORE_PARENT}")
64
81
  add_subdirectory("${PLUSUI_CORE_PARENT}" "${CMAKE_BINARY_DIR}/plusui-core")
65
82
  set(PLUSUI_FOUND TRUE)
83
+ set(PLUSUI_CORE_DIR "${PLUSUI_CORE_PARENT}")
66
84
  endif()
67
85
  endif()
68
86
 
@@ -70,17 +88,31 @@ if(NOT PLUSUI_FOUND)
70
88
  message(FATAL_ERROR "
71
89
  PlusUI Core not found!
72
90
 
73
- Install dependencies (npm install) or add a Core folder in this project root.
91
+ Install dependencies (npm install) or add a Core folder in this project root.
74
92
 
75
93
  Searched locations:
76
94
  - ${PLUSUI_CORE_LOCAL}
77
- - ${PLUSUI_CORE_DEV}
95
+ - ${PLUSUI_CORE_DEV}
96
+ - ${PLUSUI_NATIVE_NPM}
97
+ - ${PLUSUI_NATIVE_NPM_CORE}
78
98
  - ${PLUSUI_CORE_NPM}
79
99
  - ${PLUSUI_CORE_NPM_LEGACY}
80
- - ${PLUSUI_CORE_PARENT}
100
+ - ${PLUSUI_CORE_PARENT}
81
101
  ")
82
102
  endif()
83
103
 
104
+ # Validate native FileDrop support in the resolved Core
105
+ if(NOT EXISTS "${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp")
106
+ message(FATAL_ERROR "
107
+ PlusUI Core found, but native FileDrop support is missing.
108
+
109
+ Expected file:
110
+ ${PLUSUI_CORE_DIR}/Features/FileDrop/filedrop.cpp
111
+
112
+ Update PlusUI Core to a version that includes FileDrop support.
113
+ ")
114
+ endif()
115
+
84
116
  # Create the executable
85
117
  add_executable({{PROJECT_NAME}} main.cpp)
86
118