Skip to main content

euv_example/app/
const.rs

1/// Default window title for the native showcase binary.
2pub const SHOWCASE_WINDOW_TITLE: &str = "Euv Studio";
3/// Default logical window width in pixels.
4pub const SHOWCASE_WINDOW_WIDTH: u32 = 1200;
5/// Default logical window height in pixels.
6pub const SHOWCASE_WINDOW_HEIGHT: u32 = 800;
7/// Command-line flag enabling deterministic headless execution.
8pub const FLAG_HEADLESS: &str = "--headless";
9/// Command-line flag selecting the software rasterizer.
10pub const FLAG_SOFTWARE: &str = "--software";
11/// Command-line flag selecting the hardware GPU pipeline.
12pub const FLAG_HARDWARE: &str = "--hardware";
13/// Command-line flag selecting the hybrid compositor pipeline.
14pub const FLAG_HYBRID: &str = "--hybrid";
15/// Command-line flag keeping the native window open in an interactive event loop.
16pub const FLAG_INTERACTIVE: &str = "--interactive";
17/// Command-line flag capturing raw RGBA screenshots of all showcase routes into the following directory.
18pub const FLAG_CAPTURE_DIR: &str = "--capture-dir";
19/// Dev-only CLI flag printing the live AI Schema v1 runtime & layout snapshot JSON.
20#[cfg(all(debug_assertions, not(target_arch = "wasm32")))]
21pub const FLAG_AI_SCHEMA: &str = "--ai-schema";
22/// Dev-only CLI flag executing a single AI Schema v1 JSON request against the headless showcase.
23#[cfg(all(debug_assertions, not(target_arch = "wasm32")))]
24pub const FLAG_AI_QUERY: &str = "--ai-query";
25/// Dev-only CLI flag executing a single `euv://automation/...` protocol URI against the headless showcase.
26#[cfg(all(debug_assertions, not(target_arch = "wasm32")))]
27pub const FLAG_AI_URI: &str = "--ai-uri";
28/// Environment variable overriding the dev automation bridge bind address (defaults to `127.0.0.1:4174`).
29#[cfg(all(debug_assertions, not(target_arch = "wasm32")))]
30pub const ENV_AI_INSPECTOR_ADDR: &str = "EUV_AI_INSPECTOR_ADDR";
31/// CoreFoundation run-loop mode active exclusively during macOS modal window live-resize and tracking loops.
32#[cfg(target_os = "macos")]
33pub const MACOS_EVENT_TRACKING_RUN_LOOP_MODE: &str = "NSEventTrackingRunLoopMode";
34/// UTF-8 encoding identifier (`kCFStringEncodingUTF8`) for CoreFoundation string construction on macOS.
35#[cfg(target_os = "macos")]
36pub const MACOS_CF_STRING_ENCODING_UTF8: u32 = 0x0800_0100;
37/// Browser `window` property exposing the dev-only JSON automation protocol entrypoint on Web/WebView.
38#[cfg(all(debug_assertions, target_arch = "wasm32"))]
39pub(crate) const WEB_PROP_EUV_AUTOMATION: &str = "__euv_automation";
40/// Browser `window` property exposing the dev-only `euv://automation/...` URI dispatcher on Web/WebView.
41#[cfg(all(debug_assertions, target_arch = "wasm32"))]
42pub(crate) const WEB_PROP_EUV_AUTOMATION_URI: &str = "__euv_automation_uri";
43/// DOM KeyboardEvent key name for Enter.
44#[cfg(target_arch = "wasm32")]
45pub(crate) const WEB_KEY_ENTER: &str = "Enter";
46/// DOM KeyboardEvent key name for Backspace.
47#[cfg(target_arch = "wasm32")]
48pub(crate) const WEB_KEY_BACKSPACE: &str = "Backspace";
49/// DOM KeyboardEvent key name for Delete.
50#[cfg(target_arch = "wasm32")]
51pub(crate) const WEB_KEY_DELETE: &str = "Delete";
52/// DOM KeyboardEvent key name for Escape.
53#[cfg(target_arch = "wasm32")]
54pub(crate) const WEB_KEY_ESCAPE: &str = "Escape";
55/// DOM KeyboardEvent key name for Tab.
56#[cfg(target_arch = "wasm32")]
57pub(crate) const WEB_KEY_TAB: &str = "Tab";
58/// DOM KeyboardEvent key name for Spacebar.
59#[cfg(target_arch = "wasm32")]
60pub(crate) const WEB_KEY_SPACE: &str = " ";
61/// DOM KeyboardEvent key name for ArrowLeft.
62#[cfg(target_arch = "wasm32")]
63pub(crate) const WEB_KEY_ARROW_LEFT: &str = "ArrowLeft";
64/// DOM KeyboardEvent key name for ArrowRight.
65#[cfg(target_arch = "wasm32")]
66pub(crate) const WEB_KEY_ARROW_RIGHT: &str = "ArrowRight";
67/// DOM KeyboardEvent key name for ArrowUp.
68#[cfg(target_arch = "wasm32")]
69pub(crate) const WEB_KEY_ARROW_UP: &str = "ArrowUp";
70/// DOM KeyboardEvent key name for ArrowDown.
71#[cfg(target_arch = "wasm32")]
72pub(crate) const WEB_KEY_ARROW_DOWN: &str = "ArrowDown";
73/// DOM KeyboardEvent key name for Home.
74#[cfg(target_arch = "wasm32")]
75pub(crate) const WEB_KEY_HOME: &str = "Home";
76/// DOM KeyboardEvent key name for End.
77#[cfg(target_arch = "wasm32")]
78pub(crate) const WEB_KEY_END: &str = "End";
79/// DOM KeyboardEvent key name for PageUp.
80#[cfg(target_arch = "wasm32")]
81pub(crate) const WEB_KEY_PAGE_UP: &str = "PageUp";
82/// DOM KeyboardEvent key name for PageDown.
83#[cfg(target_arch = "wasm32")]
84pub(crate) const WEB_KEY_PAGE_DOWN: &str = "PageDown";
85/// DOM physical KeyboardEvent code for `W`.
86#[cfg(target_arch = "wasm32")]
87pub(crate) const WEB_CODE_KEY_W: &str = "KeyW";
88/// DOM physical KeyboardEvent code for `A`.
89#[cfg(target_arch = "wasm32")]
90pub(crate) const WEB_CODE_KEY_A: &str = "KeyA";
91/// DOM physical KeyboardEvent code for `S`.
92#[cfg(target_arch = "wasm32")]
93pub(crate) const WEB_CODE_KEY_S: &str = "KeyS";
94/// DOM physical KeyboardEvent code for `D`.
95#[cfg(target_arch = "wasm32")]
96pub(crate) const WEB_CODE_KEY_D: &str = "KeyD";
97/// DOM physical KeyboardEvent code for `E`.
98#[cfg(target_arch = "wasm32")]
99pub(crate) const WEB_CODE_KEY_E: &str = "KeyE";
100/// DOM physical KeyboardEvent code for `F`.
101#[cfg(target_arch = "wasm32")]
102pub(crate) const WEB_CODE_KEY_F: &str = "KeyF";
103/// DOM physical KeyboardEvent code for `Q`.
104#[cfg(target_arch = "wasm32")]
105pub(crate) const WEB_CODE_KEY_Q: &str = "KeyQ";
106/// DOM physical KeyboardEvent code for `R`.
107#[cfg(target_arch = "wasm32")]
108pub(crate) const WEB_CODE_KEY_R: &str = "KeyR";
109/// DOM physical KeyboardEvent code for `P`.
110#[cfg(target_arch = "wasm32")]
111pub(crate) const WEB_CODE_KEY_P: &str = "KeyP";
112/// DOM physical KeyboardEvent code for `J`.
113#[cfg(target_arch = "wasm32")]
114pub(crate) const WEB_CODE_KEY_J: &str = "KeyJ";
115/// DOM physical KeyboardEvent code for `C`.
116#[cfg(target_arch = "wasm32")]
117pub(crate) const WEB_CODE_KEY_C: &str = "KeyC";
118/// DOM physical KeyboardEvent code for `V`.
119#[cfg(target_arch = "wasm32")]
120pub(crate) const WEB_CODE_KEY_V: &str = "KeyV";
121/// DOM physical KeyboardEvent code for `X`.
122#[cfg(target_arch = "wasm32")]
123pub(crate) const WEB_CODE_KEY_X: &str = "KeyX";
124/// DOM physical KeyboardEvent code for `Z`.
125#[cfg(target_arch = "wasm32")]
126pub(crate) const WEB_CODE_KEY_Z: &str = "KeyZ";
127/// DOM physical KeyboardEvent code for `K`.
128#[cfg(target_arch = "wasm32")]
129pub(crate) const WEB_CODE_KEY_K: &str = "KeyK";
130/// DOM physical KeyboardEvent code for Space.
131#[cfg(target_arch = "wasm32")]
132pub(crate) const WEB_CODE_SPACE: &str = "Space";
133/// DOM event name for pointer movement.
134#[cfg(target_arch = "wasm32")]
135pub(crate) const WEB_EVENT_POINTER_MOVE: &str = "pointermove";
136/// DOM event name for pointer press.
137#[cfg(target_arch = "wasm32")]
138pub(crate) const WEB_EVENT_POINTER_DOWN: &str = "pointerdown";
139/// DOM event name for pointer release.
140#[cfg(target_arch = "wasm32")]
141pub(crate) const WEB_EVENT_POINTER_UP: &str = "pointerup";
142/// DOM event name for pointer cancel.
143#[cfg(target_arch = "wasm32")]
144pub(crate) const WEB_EVENT_POINTER_CANCEL: &str = "pointercancel";
145/// DOM event name for lost pointer capture.
146#[cfg(target_arch = "wasm32")]
147pub(crate) const WEB_EVENT_LOST_POINTER_CAPTURE: &str = "lostpointercapture";
148/// DOM event name for window blur.
149#[cfg(target_arch = "wasm32")]
150pub(crate) const WEB_EVENT_BLUR: &str = "blur";
151/// DOM event name for mouse/trackpad wheel scroll.
152#[cfg(target_arch = "wasm32")]
153pub(crate) const WEB_EVENT_WHEEL: &str = "wheel";
154/// DOM event name for key down.
155#[cfg(target_arch = "wasm32")]
156pub(crate) const WEB_EVENT_KEY_DOWN: &str = "keydown";
157/// DOM event name for key up.
158#[cfg(target_arch = "wasm32")]
159pub(crate) const WEB_EVENT_KEY_UP: &str = "keyup";
160/// DOM event name for window resize.
161#[cfg(target_arch = "wasm32")]
162pub(crate) const WEB_EVENT_RESIZE: &str = "resize";
163/// DOM `PointerEvent.pointerType` value for touch contacts.
164#[cfg(target_arch = "wasm32")]
165pub(crate) const WEB_PTR_TYPE_TOUCH: &str = "touch";
166/// DOM `PointerEvent.pointerType` value for pen/stylus contacts.
167#[cfg(target_arch = "wasm32")]
168pub(crate) const WEB_PTR_TYPE_PEN: &str = "pen";
169/// DOM CSS selector for the mounted canvas element.
170#[cfg(target_arch = "wasm32")]
171pub(crate) const WEB_SELECTOR_CANVAS: &str = "canvas";
172/// DOM tag name for the hidden browser IME proxy input element.
173#[cfg(target_arch = "wasm32")]
174pub(crate) const WEB_IME_INPUT_TAG: &str = "input";
175/// DOM id attribute for the hidden browser IME proxy input element.
176#[cfg(target_arch = "wasm32")]
177pub(crate) const WEB_IME_INPUT_ID: &str = "euv-ime-proxy";
178/// DOM attribute name for `id`.
179#[cfg(target_arch = "wasm32")]
180pub(crate) const WEB_IME_ATTR_ID: &str = "id";
181/// DOM attribute name for `type`.
182#[cfg(target_arch = "wasm32")]
183pub(crate) const WEB_IME_ATTR_TYPE: &str = "type";
184/// DOM `<input type="text">` attribute value.
185#[cfg(target_arch = "wasm32")]
186pub(crate) const WEB_IME_ATTR_TEXT: &str = "text";
187/// DOM attribute name for `autocomplete`.
188#[cfg(target_arch = "wasm32")]
189pub(crate) const WEB_IME_ATTR_AUTOCOMPLETE: &str = "autocomplete";
190/// DOM attribute value disabling autocomplete/autocorrect/autocapitalize.
191#[cfg(target_arch = "wasm32")]
192pub(crate) const WEB_IME_ATTR_OFF: &str = "off";
193/// DOM attribute name for `autocorrect`.
194#[cfg(target_arch = "wasm32")]
195pub(crate) const WEB_IME_ATTR_AUTOCORRECT: &str = "autocorrect";
196/// DOM attribute name for `autocapitalize`.
197#[cfg(target_arch = "wasm32")]
198pub(crate) const WEB_IME_ATTR_AUTOCAPITALIZE: &str = "autocapitalize";
199/// DOM attribute name for `spellcheck`.
200#[cfg(target_arch = "wasm32")]
201pub(crate) const WEB_IME_ATTR_SPELLCHECK: &str = "spellcheck";
202/// DOM attribute value `"false"`.
203#[cfg(target_arch = "wasm32")]
204pub(crate) const WEB_IME_ATTR_FALSE: &str = "false";
205/// DOM attribute name for `aria-label`.
206#[cfg(target_arch = "wasm32")]
207pub(crate) const WEB_IME_ATTR_ARIA_LABEL: &str = "aria-label";
208/// Accessible label applied to the hidden IME proxy input.
209#[cfg(target_arch = "wasm32")]
210pub(crate) const WEB_IME_ARIA_LABEL: &str = "euv text input";
211/// DOM attribute name for inline CSS `style`.
212#[cfg(target_arch = "wasm32")]
213pub(crate) const WEB_IME_ATTR_STYLE: &str = "style";
214/// Inline CSS keeping the IME proxy input visually hidden without triggering iOS Safari auto-zoom or tap highlights.
215#[cfg(target_arch = "wasm32")]
216pub(crate) const WEB_IME_STYLE: &str = "position:fixed;left:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0;margin:0;z-index:-1;font-size:16px;outline:none;-webkit-tap-highlight-color:transparent;";
217/// DOM event name for text input changes.
218#[cfg(target_arch = "wasm32")]
219pub(crate) const WEB_EVENT_INPUT: &str = "input";
220/// DOM event name for IME composition start.
221#[cfg(target_arch = "wasm32")]
222pub(crate) const WEB_EVENT_COMPOSITION_START: &str = "compositionstart";
223/// DOM event name for IME composition update.
224#[cfg(target_arch = "wasm32")]
225pub(crate) const WEB_EVENT_COMPOSITION_UPDATE: &str = "compositionupdate";
226/// DOM event name for IME composition end.
227#[cfg(target_arch = "wasm32")]
228pub(crate) const WEB_EVENT_COMPOSITION_END: &str = "compositionend";
229/// DOM JS property name for an input element's string value.
230#[cfg(target_arch = "wasm32")]
231pub(crate) const WEB_PROP_VALUE: &str = "value";
232/// DOM JS property name for `CompositionEvent.data` / `InputEvent.data`.
233#[cfg(target_arch = "wasm32")]
234pub(crate) const WEB_PROP_DATA: &str = "data";
235/// DOM JS property name for `InputEvent.isComposing`.
236#[cfg(target_arch = "wasm32")]
237pub(crate) const WEB_PROP_IS_COMPOSING: &str = "isComposing";
238/// DOM `KeyboardEvent.key` value emitted by browsers while an IME is processing a keystroke.
239pub(crate) const WEB_KEY_PROCESS: &str = "Process";
240/// Legacy DOM `KeyboardEvent.keyCode` value (`229`) emitted while an IME is processing a keystroke.
241pub(crate) const WEB_KEY_CODE_IME_PROCESS: u32 = 229;
242/// Native action subcommand showing the browser soft keyboard / IME proxy.
243#[cfg(target_arch = "wasm32")]
244pub(crate) const WEB_IME_ACTION_SHOW: &str = "show";
245/// Native action subcommand hiding the browser soft keyboard / IME proxy.
246#[cfg(target_arch = "wasm32")]
247pub(crate) const WEB_IME_ACTION_HIDE: &str = "hide";
248/// Native action subcommand requesting browser fullscreen entry.
249#[cfg(target_arch = "wasm32")]
250pub(crate) const WEB_FS_ACTION_ON: &str = "on";
251/// Native action subcommand requesting browser fullscreen exit.
252#[cfg(target_arch = "wasm32")]
253pub(crate) const WEB_FS_ACTION_OFF: &str = "off";
254/// DOM event name for page visibility changes.
255#[cfg(target_arch = "wasm32")]
256pub(crate) const WEB_EVENT_VISIBILITY_CHANGE: &str = "visibilitychange";
257/// DOM event name for window focus gain.
258#[cfg(target_arch = "wasm32")]
259pub(crate) const WEB_EVENT_FOCUS: &str = "focus";
260/// DOM event name for page show lifecycle notifications.
261#[cfg(target_arch = "wasm32")]
262pub(crate) const WEB_EVENT_PAGE_SHOW: &str = "pageshow";
263/// DOM event name for page hide lifecycle notifications.
264#[cfg(target_arch = "wasm32")]
265pub(crate) const WEB_EVENT_PAGE_HIDE: &str = "pagehide";
266/// DOM event name for page unload termination warnings.
267#[cfg(target_arch = "wasm32")]
268pub(crate) const WEB_EVENT_BEFORE_UNLOAD: &str = "beforeunload";
269/// DOM event name for network online transitions.
270#[cfg(target_arch = "wasm32")]
271pub(crate) const WEB_EVENT_ONLINE: &str = "online";
272/// DOM event name for network offline transitions.
273#[cfg(target_arch = "wasm32")]
274pub(crate) const WEB_EVENT_OFFLINE: &str = "offline";
275/// DOM event name for media-query preference changes.
276#[cfg(target_arch = "wasm32")]
277pub(crate) const WEB_EVENT_CHANGE: &str = "change";
278/// DOM event name for URL fragment hash navigation changes.
279#[cfg(target_arch = "wasm32")]
280pub(crate) const WEB_EVENT_HASH_CHANGE: &str = "hashchange";
281/// DOM event name for browser history back/forward traversal.
282#[cfg(target_arch = "wasm32")]
283pub(crate) const WEB_EVENT_POP_STATE: &str = "popstate";
284/// DOM event name for standard fullscreen state transitions.
285#[cfg(target_arch = "wasm32")]
286pub(crate) const WEB_EVENT_FULLSCREEN_CHANGE: &str = "fullscreenchange";
287/// DOM event name for WebKit-prefixed Safari fullscreen state transitions.
288#[cfg(target_arch = "wasm32")]
289pub(crate) const WEB_EVENT_WEBKIT_FULLSCREEN_CHANGE: &str = "webkitfullscreenchange";
290/// DOM event name for mobile screen orientation changes.
291#[cfg(target_arch = "wasm32")]
292pub(crate) const WEB_EVENT_ORIENTATION_CHANGE: &str = "orientationchange";
293/// DOM event name for clipboard paste delivery.
294#[cfg(target_arch = "wasm32")]
295pub(crate) const WEB_EVENT_PASTE: &str = "paste";
296/// DOM event name for clipboard copy delivery of selected canvas text.
297#[cfg(target_arch = "wasm32")]
298pub(crate) const WEB_EVENT_COPY: &str = "copy";
299/// HTML attribute marking `euv-core`'s offscreen copy proxy `<textarea>` so native `copy` events pass through.
300#[cfg(target_arch = "wasm32")]
301pub(crate) const WEB_ATTR_COPY_PROXY: &str = "data-euv-copy-proxy";
302/// Attribute value identifying the offscreen copy proxy `<textarea>`.
303#[cfg(target_arch = "wasm32")]
304pub(crate) const WEB_COPY_PROXY_FLAG: &str = "1";
305/// DOM `DataTransfer.setData` method name for writing plain text on `copy` events.
306#[cfg(target_arch = "wasm32")]
307pub(crate) const WEB_PROP_SET_DATA: &str = "setData";
308/// DOM event name for legacy touch cancellation.
309#[cfg(target_arch = "wasm32")]
310pub(crate) const WEB_EVENT_TOUCH_CANCEL: &str = "touchcancel";
311/// DOM `ClipboardEvent.clipboardData` property key.
312#[cfg(target_arch = "wasm32")]
313pub(crate) const WEB_PROP_CLIPBOARD_DATA: &str = "clipboardData";
314/// DOM `DataTransfer.getData` method name.
315#[cfg(target_arch = "wasm32")]
316pub(crate) const WEB_PROP_GET_DATA: &str = "getData";
317/// Plain-text MIME type passed to `DataTransfer.getData`.
318#[cfg(target_arch = "wasm32")]
319pub(crate) const WEB_MIME_TEXT_PLAIN: &str = "text/plain";
320/// WebKit-prefixed `document.webkitFullscreenElement` property key.
321#[cfg(target_arch = "wasm32")]
322pub(crate) const WEB_PROP_WEBKIT_FULLSCREEN_ELEMENT: &str = "webkitFullscreenElement";
323/// DOM `window.screen` property key.
324#[cfg(target_arch = "wasm32")]
325pub(crate) const WEB_PROP_SCREEN: &str = "screen";
326/// DOM `screen.orientation` property key.
327#[cfg(target_arch = "wasm32")]
328pub(crate) const WEB_PROP_ORIENTATION: &str = "orientation";
329/// CSS media query detecting browser dark color scheme preference.
330#[cfg(target_arch = "wasm32")]
331pub(crate) const WEB_MEDIA_PREFERS_DARK: &str = "(prefers-color-scheme: dark)";
332/// DOM window property exposing the mobile soft-keyboard `VisualViewport`.
333#[cfg(target_arch = "wasm32")]
334pub(crate) const WEB_PROP_VISUAL_VIEWPORT: &str = "visualViewport";
335/// DOM `VisualViewport.width` property key.
336#[cfg(target_arch = "wasm32")]
337pub(crate) const WEB_PROP_WIDTH: &str = "width";
338/// DOM `VisualViewport.height` property key.
339#[cfg(target_arch = "wasm32")]
340pub(crate) const WEB_PROP_HEIGHT: &str = "height";
341/// DOM `VisualViewport.scale` property key guarding pinch-zoom from shrinking the layout canvas.
342#[cfg(target_arch = "wasm32")]
343pub(crate) const WEB_PROP_SCALE: &str = "scale";
344/// Minimum supported Web `devicePixelRatio` multiplier (`0.25x`, preserving sub-100% browser zoom cleanly).
345#[cfg(target_arch = "wasm32")]
346pub(crate) const WEB_DPR_MIN: f32 = 0.25;
347/// Maximum supported Web `devicePixelRatio` multiplier (`16.0x`, covering 4x Retina displays at up to 400% zoom).
348#[cfg(target_arch = "wasm32")]
349pub(crate) const WEB_DPR_MAX: f32 = 16.0;
350/// DOM `data-euv-tiled` attribute recording active lossless tile grid geometry when exceeding single-surface GPU ceilings.
351#[cfg(target_arch = "wasm32")]
352pub(crate) const WEB_ATTR_DATA_TILED: &str = "data-euv-tiled";
353/// Threshold above `1.0` indicating browser pinch-zoom is active on `window.visualViewport`.
354#[cfg(target_arch = "wasm32")]
355pub(crate) const WEB_PINCH_ZOOM_THRESHOLD: f64 = 1.01;
356/// `window.open` target opening external URLs in a new tab.
357#[cfg(target_arch = "wasm32")]
358pub(crate) const WEB_OPEN_TARGET_BLANK: &str = "_blank";
359/// `window.open` security feature string preventing reverse tabnabbing.
360#[cfg(target_arch = "wasm32")]
361pub(crate) const WEB_OPEN_FEATURES_SAFE: &str = "noopener,noreferrer";
362/// DOM `EventTarget.addEventListener` method name for attaching non-passive listeners.
363#[cfg(target_arch = "wasm32")]
364pub(crate) const WEB_METHOD_ADD_EVENT_LISTENER: &str = "addEventListener";
365/// DOM `AddEventListenerOptions.passive` option key.
366#[cfg(target_arch = "wasm32")]
367pub(crate) const WEB_OPT_PASSIVE: &str = "passive";
368/// Minimum logical pixel viewport contraction treated as an active browser soft keyboard.
369#[cfg(target_arch = "wasm32")]
370pub(crate) const WEB_KEYBOARD_MIN_DELTA_PX: f32 = 80.0;
371/// JS parameter list for attaching a `ResizeObserver` onto the showcase `<canvas>`.
372#[cfg(target_arch = "wasm32")]
373pub(crate) const WEB_JS_ATTACH_RESIZE_ARGS: &str = "el,cb";
374/// JS body attaching a retained `ResizeObserver` reporting exact `devicePixelContentBoxSize` and `contentRect` dimensions without synchronous `getBoundingClientRect` reflows.
375#[cfg(target_arch = "wasm32")]
376pub(crate) const WEB_JS_ATTACH_RESIZE_OBSERVER: &str = "if(typeof ResizeObserver!=='undefined'){var ro=new ResizeObserver(function(entries){var pw=0,ph=0,cw=0,ch=0;if(entries&&entries.length>0){var e=entries[entries.length-1];var d=e.devicePixelContentBoxSize;if(d&&d.length>0){pw=Math.round(d[0].inlineSize||0);ph=Math.round(d[0].blockSize||0);}if(e.contentRect){cw=e.contentRect.width||0;ch=e.contentRect.height||0;}}cb(pw,ph,cw,ch);});el.__euvRo=ro;try{ro.observe(el,{box:'device-pixel-content-box'});}catch(_){ro.observe(el);}}";
377/// JS parameter list for installing a self-rearming `devicePixelRatio` media-query watcher.
378#[cfg(target_arch = "wasm32")]
379pub(crate) const WEB_JS_WATCH_DPR_ARGS: &str = "cb";
380/// Global JS flag set by non-DOM MiniApp/QuickApp/Wearable shells to suppress browser DOM auto-boot.
381#[cfg(target_arch = "wasm32")]
382pub(crate) const HOST_GLOBAL_MODE_KEY: &str = "__EUV_HOST_MODE";
383/// Minimum logical viewport axis for compact wearable/host canvases in logical dp.
384pub(crate) const HOST_MIN_VIEWPORT_DIM: u32 = 120;
385/// JSON command kind for writing clipboard text on external JS hosts.
386#[cfg(target_arch = "wasm32")]
387pub(crate) const HOST_CMD_SET_CLIPBOARD: &str = "setClipboardData";
388/// JSON command kind for toggling host IME soft keyboard.
389#[cfg(target_arch = "wasm32")]
390pub(crate) const HOST_CMD_SHOW_KEYBOARD: &str = "showKeyboard";
391/// JSON command kind for short tactile haptics on external JS hosts.
392#[cfg(target_arch = "wasm32")]
393pub(crate) const HOST_CMD_VIBRATE_SHORT: &str = "vibrateShort";
394/// JSON command kind for opening an external URL on external JS hosts.
395#[cfg(target_arch = "wasm32")]
396pub(crate) const HOST_CMD_OPEN_URL: &str = "openUrl";
397/// JSON command kind for displaying a lightweight host toast.
398#[cfg(target_arch = "wasm32")]
399pub(crate) const HOST_CMD_SHOW_TOAST: &str = "showToast";
400/// JSON command kind for toggling fullscreen presentation.
401#[cfg(target_arch = "wasm32")]
402pub(crate) const HOST_CMD_SET_FULLSCREEN: &str = "setFullscreen";
403/// JSON command kind for popping the host navigation stack.
404#[cfg(target_arch = "wasm32")]
405pub(crate) const HOST_CMD_NAVIGATE_BACK: &str = "navigateBack";
406/// Network status label for Wi-Fi connectivity.
407#[cfg(target_arch = "wasm32")]
408pub(crate) const HOST_NET_WIFI: &str = "wifi";
409/// Network status label for cellular connectivity.
410#[cfg(target_arch = "wasm32")]
411pub(crate) const HOST_NET_CELLULAR: &str = "cellular";
412/// Network status label for offline state.
413#[cfg(target_arch = "wasm32")]
414pub(crate) const HOST_NET_NONE: &str = "none";
415/// Network status label for offline state alias.
416#[cfg(target_arch = "wasm32")]
417pub(crate) const HOST_NET_OFFLINE: &str = "offline";
418/// Default external host vendor label when caller omits a vendor string.
419#[cfg(target_arch = "wasm32")]
420pub(crate) const HOST_DEFAULT_VENDOR: &str = "generic";
421/// JS body listening for `devicePixelRatio` transitions via a pure event-driven `matchMedia` watcher with zero periodic polling timers.
422#[cfg(target_arch = "wasm32")]
423pub(crate) const WEB_JS_WATCH_DPR_BODY: &str = "var rearm=function(){if(typeof matchMedia!=='function'){return;}var dpr=window.devicePixelRatio||1;var m=matchMedia('(resolution: '+dpr+'dppx)');window.__euvDprMql=m;var on=function(){if(window.__euvDprMql===m){window.__euvDprMql=null;}cb();rearm();};if(m.addEventListener){m.addEventListener('change',on,{once:true});}else if(m.addListener){m.addListener(on);}};rearm();";