bunite-core 0.14.0 → 0.16.0
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 +4 -4
- package/src/host/core/App.ts +2 -1
- package/src/host/core/BrowserView.ts +345 -24
- package/src/host/core/SurfaceBrowserIPC.ts +10 -1
- package/src/host/core/SurfaceManager.ts +357 -16
- package/src/host/events/webviewEvents.ts +18 -1
- package/src/host/log.ts +6 -1
- package/src/host/native.ts +140 -1
- package/src/host/preloadBundle.ts +7 -2
- package/src/native/linux/bunite_linux_ffi.cpp +205 -1
- package/src/native/linux/bunite_linux_internal.h +12 -0
- package/src/native/linux/bunite_linux_runtime.cpp +6 -1
- package/src/native/linux/bunite_linux_view.cpp +211 -5
- package/src/native/mac/bunite_mac_ffi.mm +278 -4
- package/src/native/mac/bunite_mac_internal.h +13 -0
- package/src/native/mac/bunite_mac_view.mm +227 -7
- package/src/native/shared/ffi_exports.h +93 -30
- package/src/native/win/native_host_cef.cpp +102 -10
- package/src/native/win/native_host_ffi.cpp +818 -2
- package/src/native/win/native_host_internal.h +22 -0
- package/src/native/win-webview2/bunite_webview2_ffi.cpp +788 -4
- package/src/native/win-webview2/webview2_internal.h +14 -0
- package/src/native/win-webview2/webview2_runtime.cpp +276 -23
- package/src/preload/runtime.built.js +1 -1
- package/src/rpc/framework.ts +174 -11
- package/src/rpc/index.ts +11 -0
- package/src/webview/native.ts +142 -32
- package/src/webview/polyfill.ts +91 -14
|
@@ -108,12 +108,31 @@ struct ViewHost {
|
|
|
108
108
|
std::unordered_map<uint32_t, CefRefPtr<CefJSDialogCallback>> pending_dialogs;
|
|
109
109
|
uint32_t next_dialog_request_id = 1;
|
|
110
110
|
|
|
111
|
+
// Download policy: 0=auto, 1=ask, 2=block. Default block.
|
|
112
|
+
std::atomic<int32_t> download_policy{2};
|
|
113
|
+
std::string download_dir;
|
|
114
|
+
|
|
115
|
+
// True for ViewHosts minted by OnBeforePopup; popup_accept binds them to a
|
|
116
|
+
// user window, popup_dismiss destroys them.
|
|
117
|
+
bool is_popup_pending = false;
|
|
118
|
+
// If popup_accept arrives before OnAfterCreated, stash parameters; the
|
|
119
|
+
// browser-create completion applies them.
|
|
120
|
+
struct PendingPopupAccept { uint32_t host_window_id; double x, y, w, h; };
|
|
121
|
+
std::optional<PendingPopupAccept> pending_popup_accept;
|
|
122
|
+
bool popup_dismiss_requested = false;
|
|
123
|
+
|
|
111
124
|
// Pending state: applied in OnAfterCreated when browser HWND becomes available.
|
|
112
125
|
bool pending_visible = true;
|
|
113
126
|
bool pending_bring_to_front = false;
|
|
114
127
|
bool pending_passthrough = false;
|
|
115
128
|
bool has_pending_bounds = false;
|
|
116
129
|
RECT pending_bounds{0, 0, 0, 0};
|
|
130
|
+
|
|
131
|
+
// OOPIF input dispatch — populated by Target.attachedToTarget events after
|
|
132
|
+
// lazy Target.setAutoAttach. frameId → sessionId for flatten:true routing.
|
|
133
|
+
std::atomic<bool> oopif_autoattach_armed = false;
|
|
134
|
+
std::mutex oopif_sessions_mutex;
|
|
135
|
+
std::unordered_map<std::string, std::string> oopif_sessions; // frameId → sessionId
|
|
117
136
|
};
|
|
118
137
|
|
|
119
138
|
struct WindowHost {
|
|
@@ -208,6 +227,9 @@ bool shouldAllowNavigation(const ViewHost* view, const std::string& url);
|
|
|
208
227
|
void emitWindowEvent(uint32_t window_id, const char* event_name, const std::string& payload = {});
|
|
209
228
|
void emitWebviewEvent(uint32_t view_id, const char* event_name, const std::string& payload = {});
|
|
210
229
|
|
|
230
|
+
// Bind a popup ViewHost (created by OnBeforePopup) to a user window + bounds.
|
|
231
|
+
void applyPopupAccept(ViewHost* view, uint32_t host_window_id, double x, double y, double w, double h);
|
|
232
|
+
|
|
211
233
|
std::string normalizeAppResPath(const std::string& url);
|
|
212
234
|
std::string getMimeType(const std::filesystem::path& file_path);
|
|
213
235
|
std::string getAppResRootForView(uint32_t view_id);
|