| <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>widget-sandbox — dev app</title> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div id="app"> |
| 10 | <aside id="left"> |
| 11 | <h2>Corpus</h2> |
| 12 | <div id="drop" tabindex="0">Drop any .html file here<br><small>(or click to pick)</small><input type="file" id="file" accept=".html,.htm,text/html" hidden></div> |
| 13 | <ul id="corpus"></ul> |
| 14 | </aside> |
| 15 | <main id="center"> |
| 16 | <div class="toolbar"> |
| 17 | <span id="title">no widget loaded</span> |
| 18 | <span class="spacer"></span> |
| 19 | <label class="single-only" title="the bubble's width: what a client lays the widget out at (the reference and compare columns follow); free: drag the column's corner"><select id="width"></select> <span id="width-value" class="muted"></span></label> |
| 20 | <label title="who gets a press (docs/sdk-v1.md §5.5): the bubble of a phone client or of a desktop client, unless touch-action claims it; off: the widget gets everything (no client does that)">gestures <select id="gesture-mode"></select></label> |
| 21 | <label class="single-only" title="the message time (docs/sdk-v1.md §2.17): in the caption's line (nothing over the widget), or over the widget's bottom corner as on a photo, right (a left-to-right client) or left (right-to-left); the widget gets the band and the corner as env(safe-area-inset-bottom), --tg-content-safe-area-* and TelegramWidget.contentSafeAreaInset">time <select id="time-corner"></select></label> |
| 22 | <label><input type="checkbox" id="dark"> dark</label> |
| 23 | <label class="single-only"><input type="checkbox" id="reference"> reference mode</label> |
| 24 | <label class="single-only" title="Blitz renderer (wasm) instead of the iframe — dev tooling, needs pnpm build:blitz-web"><input type="checkbox" id="blitz"> Blitz</label> |
| 25 | <label class="single-only" title="litehtml renderer (wasm) instead of the iframe — dev tooling, needs pnpm build:litehtml-web"><input type="checkbox" id="litehtml"> litehtml</label> |
| 26 | <label class="single-only" title="Shadow DOM renderer instead of the iframe — the same renderer core on a shadow root in this page (prototype)"><input type="checkbox" id="shadow"> shadow</label> |
| 27 | <label class="single-only" title="every renderer side by side — iframe, Blitz, litehtml and the native reference — dev tooling"><input type="checkbox" id="compare"> compare all</label> |
| 28 | <label title="chat feed demo: 60–80 bubbles on corpus/common with the list's own lifecycle, a warmed worker pool, a live renderer switch and one hostile bubble — dev tooling (src/feed.ts)"><input type="checkbox" id="feed"> feed</label> |
| 29 | <button id="reload" class="single-only" type="button" title="re-create the sandbox from the same HTML">restart</button> |
| 30 | </div> |
| 31 | <!-- feed mode (?feed=1): src/feed.ts builds the chat feed, its controls and the metrics overlay here --> |
| 32 | <div id="feed-view" class="hidden"></div> |
| 33 | <div class="stage"> |
| 34 | <div class="chat" id="chat-sandbox"> |
| 35 | <!-- the network marker (docs/integration.md "The network marker"): shown when the message has can_query --> |
| 36 | <div class="bubble-head">sandbox <span id="net-marker" class="net-marker hidden" title="can_query: a tap on this widget may send data to the bot's server (docs/integration.md, the network marker)">⇅ may send data to the bot</span></div> |
| 37 | <div class="bubble"><div class="frame-wrap" id="sandbox-wrap"></div><div id="time-corner-view" class="hidden"></div></div> |
| 38 | <div id="widget-error" class="hidden"></div> |
| 39 | </div> |
| 40 | <!-- compare mode: one more column per renderer the main bubble is not using (main.ts fills it) --> |
| 41 | <div id="compare-chats" class="compare-chats"></div> |
| 42 | <div class="chat hidden" id="chat-reference"> |
| 43 | <div class="bubble-head">reference — native, dev tooling only</div> |
| 44 | <div class="bubble"><div class="frame-wrap" id="reference-wrap"></div><div id="time-corner-ref" class="hidden"></div></div> |
| 45 | </div> |
| 46 | </div> |
| 47 | </main> |
| 48 | <aside id="right"> |
| 49 | <section><h3>Status</h3><div id="status">—</div></section> |
| 50 | <section><h3>Stats</h3><table id="stats"></table></section> |
| 51 | <section><h3>Diagnostics</h3><ul id="diags"></ul></section> |
| 52 | <section><h3>Bridge</h3><ul id="bridge"></ul></section> |
| 53 | <section title="the mock bot (src/mock-bot.ts): the widget's chatData / publicData, the bot's edits, its answers to requests, and the context a client passes"><h3>Bot (mock)</h3><div id="bot-panel"></div></section> |
| 54 | <section><h3>Gestures</h3><ul id="gestures"></ul></section> |
| 55 | <section class="grow"><h3>Widget console</h3><pre id="console"></pre></section> |
| 56 | </aside> |
| 57 | </div> |
| 58 | <script type="module" src="/src/main.ts"></script> |
| 59 | </body> |
| 60 | </html> |
| 61 |