euv-example 0.50.0

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