feat(smart-app): implement complete mobile app MVP

- App.tsx: full navigation (Auth stack + Main tabs with 5 screens)
- Auth: LoginScreen, RegisterScreen, ForgotPasswordScreen
- HomeScreen: dashboard with IoT metrics, weather widget, alerts, quick actions, sensors
- MapScreen: interactive map with layer toggles (6 layers)
- MarketplaceScreen: categories (6), products (5), search
- ChatScreen: AI chat with quick prompts (4), bot responses
- ProfileScreen: user info, stats, menu (9 items), logout
- AlertsScreen: alert list with severity, acknowledge
- SensorsScreen: sensor list with type filters (6 types), search
- ZonesScreen: zone cards with stats
- SettingsScreen: language picker (FR/EN/ES/DE), privacy, about
- Stores: iotStore (sensors, zones, alerts), notificationStore, uiStore + i18n
- Hooks: useSensors, useAlerts, useNotifications, useLocation
- Components: Card, Button, LoadingSpinner, ErrorBoundary, Header
- Services: iotService, notificationService (with axios API client)
- Utils: formatters (temp, AQI, noise, dates), validators (email, password, IBAN)
- Theme: colors.ts with full design system (Blue Ocean palette)
- Ditto: fixed MongoDB connection, new JWT secrets, official gateway image
This commit is contained in:
Eric FELIXINE
2026-06-01 18:00:35 -04:00
parent 08ca495bde
commit e30ae8ed09
35578 changed files with 3703534 additions and 43 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,6 @@
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"Hdai":[function(require,module,exports) {
function o(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?module.exports=o=function(o){return typeof o}:module.exports=o=function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},o(t)}module.exports=o;
},{}],"sYUN":[function(require,module,exports) {
"use strict";var e=t(require("@babel/runtime/helpers/typeof"));function t(e){return e&&e.__esModule?e:{default:e}}onmessage=function(){var t,i,n=(i=!1,function(){i||console.warn.toString().includes("[native code]")||(i=!0,console.warn("Remote debugger is in a background tab which may cause apps to perform slowly. Fix this by foregrounding the tab (or opening it in a separate window)."))}),r={executeApplicationScript:function(e,t){for(var i in e.inject)self[i]=JSON.parse(e.inject[i]);var n;try{importScripts(e.url)}catch(r){n=r.message}t(null,n)},setDebuggerVisibility:function(e){t=e.visibilityState}};return function(i){"hidden"===t&&n();var a=i.data,o=function(e,t){postMessage({replyID:a.id,result:e,error:t})},s=r[a.method];if(s)s(a,o);else{var c,u=[[],[],[],0];try{"object"===("undefined"==typeof __fbBatchedBridge?"undefined":(0,e.default)(__fbBatchedBridge))?u=__fbBatchedBridge[a.method].apply(null,a.arguments):c="Failed to call function, __fbBatchedBridge is undefined"}catch(d){c=d.message}finally{o(JSON.stringify(u),c)}}}}();
},{"@babel/runtime/helpers/typeof":"Hdai"}]},{},["sYUN"], null)
//# sourceMappingURL=/debugger-ui/debuggerWorker.aca173c4.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../node_modules/@babel/runtime/helpers/typeof.js","debuggerWorker.js"],"names":["onmessage","visibilityState","hasWarned","showVisibilityWarning","console","warn","toString","includes","messageHandlers","executeApplicationScript","message","sendReply","key","inject","self","JSON","parse","error","importScripts","url","err","setDebuggerVisibility","object","data","result","postMessage","replyID","id","handler","method","returnValue","__fbBatchedBridge","apply","arguments","stringify"],"mappings":";AAAA,SAAA,EAAA,GAaA,MAVA,mBAAA,QAAA,iBAAA,OAAA,SACA,OAAA,QAAA,EAAA,SAAA,GACA,cAAA,GAGA,OAAA,QAAA,EAAA,SAAA,GACA,OAAA,GAAA,mBAAA,QAAA,EAAA,cAAA,QAAA,IAAA,OAAA,UAAA,gBAAA,GAIA,EAAA,GAGA,OAAA,QAAA;;ACLA,aAAA,IAAA,EAAA,EAAA,QAAA,kCAAA,SAAA,EAAA,GAAA,OAAA,GAAA,EAAA,WAAA,EAAA,CAAA,QAAA,GAAAA,UAAa,WACPC,IAAAA,EAEEC,EADFC,GACED,GAAY,EACT,WAEDA,GAAaE,QAAQC,KAAKC,WAAWC,SAAS,mBAGlDL,GAAY,EACZE,QAAQC,KACN,6JAOFG,EAAkB,CACpBC,yBAA0B,SAAUC,EAASC,GACtC,IAAA,IAAIC,KAAOF,EAAQG,OACtBC,KAAKF,GAAOG,KAAKC,MAAMN,EAAQG,OAAOD,IAEpCK,IAAAA,EACA,IACFC,cAAcR,EAAQS,KACtB,MAAOC,GACPH,EAAQG,EAAIV,QAEdC,EAAU,KAAmBM,IAE/BI,sBAAuB,SAAUX,GAC/BT,EAAkBS,EAAQT,kBAIvB,OAAA,SAAUS,GACS,WAApBT,GACFE,IAGEmB,IAAAA,EAASZ,EAAQa,KAEjBZ,EAAY,SAAUa,EAAQP,GAChCQ,YAAY,CAACC,QAASJ,EAAOK,GAAIH,OAAQA,EAAQP,MAAOA,KAGtDW,EAAUpB,EAAgBc,EAAOO,QACjCD,GAAAA,EAEFA,EAAQN,EAAQX,OACX,CAEDmB,IACAb,EADAa,EAAc,CAAC,GAAI,GAAI,GAAI,GAE3B,IAC+B,YAAtBC,oBAAAA,kBAAAA,aAAAA,EAAAA,EAAAA,SAAAA,oBACTD,EAAcC,kBAAkBT,EAAOO,QAAQG,MAC7C,KACAV,EAAOW,WAGThB,EAAQ,0DAEV,MAAOG,GACPH,EAAQG,EAAIV,QACJ,QACRC,EAAUI,KAAKmB,UAAUJ,GAAcb,MAnElC","file":"debuggerWorker.aca173c4.js","sourceRoot":"../../src/ui","sourcesContent":["function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/* global __fbBatchedBridge, self, importScripts, postMessage, onmessage: true */\n/* eslint no-unused-vars: 0 */\n\nonmessage = (function () {\n var visibilityState;\n var showVisibilityWarning = (function () {\n var hasWarned = false;\n return function () {\n // Wait until `YellowBox` gets initialized before displaying the warning.\n if (hasWarned || console.warn.toString().includes('[native code]')) {\n return;\n }\n hasWarned = true;\n console.warn(\n 'Remote debugger is in a background tab which may cause apps to ' +\n 'perform slowly. Fix this by foregrounding the tab (or opening it in ' +\n 'a separate window).',\n );\n };\n })();\n\n var messageHandlers = {\n executeApplicationScript: function (message, sendReply) {\n for (var key in message.inject) {\n self[key] = JSON.parse(message.inject[key]);\n }\n var error;\n try {\n importScripts(message.url);\n } catch (err) {\n error = err.message;\n }\n sendReply(null /* result */, error);\n },\n setDebuggerVisibility: function (message) {\n visibilityState = message.visibilityState;\n },\n };\n\n return function (message) {\n if (visibilityState === 'hidden') {\n showVisibilityWarning();\n }\n\n var object = message.data;\n\n var sendReply = function (result, error) {\n postMessage({replyID: object.id, result: result, error: error});\n };\n\n var handler = messageHandlers[object.method];\n if (handler) {\n // Special cased handlers\n handler(object, sendReply);\n } else {\n // Other methods get called on the bridge\n var returnValue = [[], [], [], 0];\n var error;\n try {\n if (typeof __fbBatchedBridge === 'object') {\n returnValue = __fbBatchedBridge[object.method].apply(\n null,\n object.arguments,\n );\n } else {\n error = 'Failed to call function, __fbBatchedBridge is undefined';\n }\n } catch (err) {\n error = err.message;\n } finally {\n sendReply(JSON.stringify(returnValue), error);\n }\n }\n };\n})();\n"]}

View File

@@ -0,0 +1,79 @@
"use strict";
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/* global __fbBatchedBridge, self, importScripts, postMessage, onmessage: true */
/* eslint no-unused-vars: 0 */
onmessage = function () {
var visibilityState;
var showVisibilityWarning = function () {
var hasWarned = false;
return function () {
// Wait until `YellowBox` gets initialized before displaying the warning.
if (hasWarned || console.warn.toString().includes('[native code]')) {
return;
}
hasWarned = true;
console.warn('Remote debugger is in a background tab which may cause apps to ' + 'perform slowly. Fix this by foregrounding the tab (or opening it in ' + 'a separate window).');
};
}();
var messageHandlers = {
executeApplicationScript: function (message, sendReply) {
for (var key in message.inject) {
self[key] = JSON.parse(message.inject[key]);
}
var error;
try {
importScripts(message.url);
} catch (err) {
error = err.message;
}
sendReply(null /* result */, error);
},
setDebuggerVisibility: function (message) {
visibilityState = message.visibilityState;
}
};
return function (message) {
if (visibilityState === 'hidden') {
showVisibilityWarning();
}
var object = message.data;
var sendReply = function (result, error) {
postMessage({
replyID: object.id,
result: result,
error: error
});
};
var handler = messageHandlers[object.method];
if (handler) {
// Special cased handlers
handler(object, sendReply);
} else {
// Other methods get called on the bridge
var returnValue = [[], [], [], 0];
var error;
try {
if (typeof __fbBatchedBridge === 'object') {
returnValue = __fbBatchedBridge[object.method].apply(null, object.arguments);
} else {
error = 'Failed to call function, __fbBatchedBridge is undefined';
}
} catch (err) {
error = err.message;
} finally {
sendReply(JSON.stringify(returnValue), error);
}
}
};
}();
//# sourceMappingURL=debuggerWorker.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["onmessage","visibilityState","showVisibilityWarning","hasWarned","console","warn","toString","includes","messageHandlers","executeApplicationScript","message","sendReply","key","inject","self","JSON","parse","error","importScripts","url","err","setDebuggerVisibility","object","data","result","postMessage","replyID","id","handler","method","returnValue","__fbBatchedBridge","apply","arguments","stringify"],"sources":["../../src/ui/debuggerWorker.js"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n/* global __fbBatchedBridge, self, importScripts, postMessage, onmessage: true */\n/* eslint no-unused-vars: 0 */\n\nonmessage = (function () {\n var visibilityState;\n var showVisibilityWarning = (function () {\n var hasWarned = false;\n return function () {\n // Wait until `YellowBox` gets initialized before displaying the warning.\n if (hasWarned || console.warn.toString().includes('[native code]')) {\n return;\n }\n hasWarned = true;\n console.warn(\n 'Remote debugger is in a background tab which may cause apps to ' +\n 'perform slowly. Fix this by foregrounding the tab (or opening it in ' +\n 'a separate window).',\n );\n };\n })();\n\n var messageHandlers = {\n executeApplicationScript: function (message, sendReply) {\n for (var key in message.inject) {\n self[key] = JSON.parse(message.inject[key]);\n }\n var error;\n try {\n importScripts(message.url);\n } catch (err) {\n error = err.message;\n }\n sendReply(null /* result */, error);\n },\n setDebuggerVisibility: function (message) {\n visibilityState = message.visibilityState;\n },\n };\n\n return function (message) {\n if (visibilityState === 'hidden') {\n showVisibilityWarning();\n }\n\n var object = message.data;\n\n var sendReply = function (result, error) {\n postMessage({replyID: object.id, result: result, error: error});\n };\n\n var handler = messageHandlers[object.method];\n if (handler) {\n // Special cased handlers\n handler(object, sendReply);\n } else {\n // Other methods get called on the bridge\n var returnValue = [[], [], [], 0];\n var error;\n try {\n if (typeof __fbBatchedBridge === 'object') {\n returnValue = __fbBatchedBridge[object.method].apply(\n null,\n object.arguments,\n );\n } else {\n error = 'Failed to call function, __fbBatchedBridge is undefined';\n }\n } catch (err) {\n error = err.message;\n } finally {\n sendReply(JSON.stringify(returnValue), error);\n }\n }\n };\n})();\n"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEAA,SAAS,GAAI,YAAY;EACvB,IAAIC,eAAe;EACnB,IAAIC,qBAAqB,GAAI,YAAY;IACvC,IAAIC,SAAS,GAAG,KAAK;IACrB,OAAO,YAAY;MACjB;MACA,IAAIA,SAAS,IAAIC,OAAO,CAACC,IAAI,CAACC,QAAQ,EAAE,CAACC,QAAQ,CAAC,eAAe,CAAC,EAAE;QAClE;MACF;MACAJ,SAAS,GAAG,IAAI;MAChBC,OAAO,CAACC,IAAI,CACV,iEAAiE,GAC/D,sEAAsE,GACtE,qBAAqB,CACxB;IACH,CAAC;EACH,CAAC,EAAG;EAEJ,IAAIG,eAAe,GAAG;IACpBC,wBAAwB,EAAE,UAAUC,OAAO,EAAEC,SAAS,EAAE;MACtD,KAAK,IAAIC,GAAG,IAAIF,OAAO,CAACG,MAAM,EAAE;QAC9BC,IAAI,CAACF,GAAG,CAAC,GAAGG,IAAI,CAACC,KAAK,CAACN,OAAO,CAACG,MAAM,CAACD,GAAG,CAAC,CAAC;MAC7C;MACA,IAAIK,KAAK;MACT,IAAI;QACFC,aAAa,CAACR,OAAO,CAACS,GAAG,CAAC;MAC5B,CAAC,CAAC,OAAOC,GAAG,EAAE;QACZH,KAAK,GAAGG,GAAG,CAACV,OAAO;MACrB;MACAC,SAAS,CAAC,IAAI,CAAC,cAAcM,KAAK,CAAC;IACrC,CAAC;IACDI,qBAAqB,EAAE,UAAUX,OAAO,EAAE;MACxCT,eAAe,GAAGS,OAAO,CAACT,eAAe;IAC3C;EACF,CAAC;EAED,OAAO,UAAUS,OAAO,EAAE;IACxB,IAAIT,eAAe,KAAK,QAAQ,EAAE;MAChCC,qBAAqB,EAAE;IACzB;IAEA,IAAIoB,MAAM,GAAGZ,OAAO,CAACa,IAAI;IAEzB,IAAIZ,SAAS,GAAG,UAAUa,MAAM,EAAEP,KAAK,EAAE;MACvCQ,WAAW,CAAC;QAACC,OAAO,EAAEJ,MAAM,CAACK,EAAE;QAAEH,MAAM,EAAEA,MAAM;QAAEP,KAAK,EAAEA;MAAK,CAAC,CAAC;IACjE,CAAC;IAED,IAAIW,OAAO,GAAGpB,eAAe,CAACc,MAAM,CAACO,MAAM,CAAC;IAC5C,IAAID,OAAO,EAAE;MACX;MACAA,OAAO,CAACN,MAAM,EAAEX,SAAS,CAAC;IAC5B,CAAC,MAAM;MACL;MACA,IAAImB,WAAW,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;MACjC,IAAIb,KAAK;MACT,IAAI;QACF,IAAI,OAAOc,iBAAiB,KAAK,QAAQ,EAAE;UACzCD,WAAW,GAAGC,iBAAiB,CAACT,MAAM,CAACO,MAAM,CAAC,CAACG,KAAK,CAClD,IAAI,EACJV,MAAM,CAACW,SAAS,CACjB;QACH,CAAC,MAAM;UACLhB,KAAK,GAAG,yDAAyD;QACnE;MACF,CAAC,CAAC,OAAOG,GAAG,EAAE;QACZH,KAAK,GAAGG,GAAG,CAACV,OAAO;MACrB,CAAC,SAAS;QACRC,SAAS,CAACI,IAAI,CAACmB,SAAS,CAACJ,WAAW,CAAC,EAAEb,KAAK,CAAC;MAC/C;IACF;EACF,CAAC;AACH,CAAC,EAAG"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1,66 @@
html,
body {
font-family: Helvetica, Verdana, sans-serif;
font-size: large;
font-weight: 200;
height: 100%;
margin: 0;
padding: 0;
}
.shortcut {
border-radius: 4px;
color: #eee;
background-color: #333;
font-family: 'Monaco', monospace;
font-size: medium;
letter-spacing: 3px;
padding: 4px;
}
.content {
padding: 10px;
}
.reload-btn {
padding: 5px 10px;
}
body.dark {
background-color: #242424;
color: #afafaf;
}
.dark .shortcut {
color: #c1c1c1;
}
.dark a {
color: #3b99fc;
}
input[type='checkbox'] {
vertical-align: middle;
}
.warning {
box-sizing: border-box;
max-width: 800px;
padding: 16px;
margin-bottom: 1em;
border-left: 5px solid rgb(230, 167, 0);
border-radius: 6px;
background-color: rgb(255, 248, 230);
box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
color: rgb(77, 56, 0);
font-size: 16px;
font-weight: 500;
line-height: 1.6;
}
.warning p {
margin-top: 0;
}
.warning p:last-child {
margin: 0;
}
.dark .warning {
background: rgb(77, 56, 0);
border-left-color: rgb(230, 167, 0);
color: rgb(255, 248, 230);
}

View File

@@ -0,0 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="icon" href="data:;base64,iVBORw0KGgo="><title>React Native Remote Debugging (Deprecated)</title><script src="/debugger-ui/ui.e31bb0bc.js"></script><link rel="stylesheet" href="/debugger-ui/ui.e31bb0bc.css"></head><body> <div class="content"> <div class="warning"> <p> Remote JavaScript debugging (this workflow) is <strong>deprecated</strong> in React Native 0.73 and will be removed in a future release. </p> <p> Please use the <a href="https://reactnative.dev/docs/next/debugging#opening-the-debugger"><strong>Open Debugger</strong></a> workflow to debug apps using Hermes directly. This can be accessed from the Dev Menu, or by pressing <kbd class="shortcut">j</kbd> in the CLI (when run with <code>--experimental-debugger</code>). </p> <p> If your app is using JSC, please use <a href="https://reactnative.dev/docs/next/other-debugging-methods">direct debugging via Safari</a>. </p> <p> Learn more about debugging in React Native in the <strong><a href="https://reactnative.dev/docs/debugging">refreshed docs</a></strong> 📖. </p> </div> <label for="dark"> <input type="checkbox" id="dark" onclick="Page.toggleDarkTheme()"> Dark Theme </label> <label for="maintain-priority"> <input type="checkbox" id="maintain-priority" onclick="Page.togglePriorityMaintenance()"> Maintain Priority </label> <p> React Native JS code runs as a web worker inside this tab. </p> <p> Press <kbd id="shortcut" class="shortcut">⌘⌥I</kbd> to open Developer Tools. Enable <a href="https://stackoverflow.com/a/17324511/232122" target="_blank">Pause On Caught Exceptions</a> for a better debugging experience. </p> <p> You may also install <a href="https://www.npmjs.com/package/react-devtools" target="_blank">the standalone version of React Developer Tools</a> to inspect the React component hierarchy, their props, and state. </p> <p>Status: <span id="status">Loading...</span></p> <button class="reload-btn" onclick="window.onReloadClicked()"> Reload app </button> </div> <audio id="silence" loop="" src="/debugger-ui/priority.5583346b.wav"></audio> </body></html>

View File

@@ -0,0 +1,206 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
require("./index.css");
var _blueIcon = _interopRequireDefault(require("./assets/blue-icon.png"));
var _grayIcon = _interopRequireDefault(require("./assets/gray-icon.png"));
var _orangeIcon = _interopRequireDefault(require("./assets/orange-icon.png"));
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
/* eslint-env browser */
const isMacLike = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);
const refreshShortcut = isMacLike ? '⌘R' : 'Ctrl R';
window.onload = function () {
if (!isMacLike) {
document.getElementById('shortcut').innerHTML = 'Ctrl⇧J';
}
Page.render();
};
window.onReloadClicked = function () {
var xhr = new XMLHttpRequest();
xhr.open('GET', `${window.location.origin}/reload`, true);
xhr.send();
};
const Page = window.Page = {
state: {
isDark: localStorage.getItem('darkTheme') === null ? window.matchMedia('(prefers-color-scheme: dark)').matches : localStorage.getItem('darkTheme') === 'on',
isPriorityMaintained: localStorage.getItem('maintainPriority') === 'on',
status: {
type: 'disconnected'
},
visibilityState: document.visibilityState
},
setState(partialState) {
Page.state = Object.assign({}, Page.state, partialState);
Page.render();
},
render() {
const {
isDark,
isPriorityMaintained,
status,
visibilityState
} = Page.state;
const statusNode = document.getElementById('status');
switch (status.type) {
case 'connected':
statusNode.textContent = 'Debugger session active.';
break;
case 'error':
statusNode.textContent = status.error.reason || 'Disconnected from proxy. Attempting reconnection. Is node server running?';
break;
case 'connecting':
case 'disconnected':
// Fall through.
default:
statusNode.innerHTML = 'Waiting, press <span class="shortcut">' + refreshShortcut + '</span> in simulator to reload and connect.';
break;
}
const linkNode = document.querySelector('link[rel=icon]');
if (status.type === 'disconnected' || status.type === 'error') {
linkNode.href = _grayIcon.default;
} else {
if (visibilityState === 'visible' || isPriorityMaintained) {
linkNode.href = _blueIcon.default;
} else {
linkNode.href = _orangeIcon.default;
}
}
const darkCheckbox = document.getElementById('dark');
document.body.classList.toggle('dark', isDark);
darkCheckbox.checked = isDark;
localStorage.setItem('darkTheme', isDark ? 'on' : '');
const maintainPriorityCheckbox = document.getElementById('maintain-priority');
const silence = document.getElementById('silence');
silence.volume = 0.1;
if (isPriorityMaintained) {
silence.play();
} else {
silence.pause();
}
maintainPriorityCheckbox.checked = isPriorityMaintained;
localStorage.setItem('maintainPriority', isPriorityMaintained ? 'on' : '');
},
toggleDarkTheme() {
Page.setState({
isDark: !Page.state.isDark
});
},
togglePriorityMaintenance() {
Page.setState({
isPriorityMaintained: !Page.state.isPriorityMaintained
});
}
};
function connectToDebuggerProxy() {
const ws = new WebSocket('ws://' + window.location.host + '/debugger-proxy?role=debugger&name=Chrome');
let worker;
function createJSRuntime() {
// This worker will run the application JavaScript code,
// making sure that it's run in an environment without a global
// document, to make it consistent with the JSC executor environment.
worker = new Worker('./debuggerWorker.js');
worker.onmessage = function (message) {
ws.send(JSON.stringify(message.data));
};
window.onbeforeunload = function () {
return 'If you reload this page, it is going to break the debugging session. ' + 'Press ' + refreshShortcut + ' on the device to reload.';
};
updateVisibility();
}
function shutdownJSRuntime() {
if (worker) {
worker.terminate();
worker = null;
window.onbeforeunload = null;
}
}
function updateVisibility() {
if (worker && !Page.state.isPriorityMaintained) {
worker.postMessage({
method: 'setDebuggerVisibility',
visibilityState: document.visibilityState
});
}
Page.setState({
visibilityState: document.visibilityState
});
}
ws.onopen = function () {
Page.setState({
status: {
type: 'connecting'
}
});
};
ws.onmessage = async function (message) {
if (!message.data) {
return;
}
const object = JSON.parse(message.data);
if (object.$event === 'client-disconnected') {
shutdownJSRuntime();
Page.setState({
status: {
type: 'disconnected'
}
});
return;
}
if (!object.method) {
return;
}
// Special message that asks for a new JS runtime
if (object.method === 'prepareJSRuntime') {
shutdownJSRuntime();
console.clear();
createJSRuntime();
ws.send(JSON.stringify({
replyID: object.id
}));
Page.setState({
status: {
type: 'connected',
id: object.id
}
});
} else if (object.method === '$disconnected') {
shutdownJSRuntime();
Page.setState({
status: {
type: 'disconnected'
}
});
} else {
worker.postMessage(object);
}
};
ws.onclose = function (error) {
shutdownJSRuntime();
Page.setState({
status: {
type: 'error',
error
}
});
if (error.reason) {
console.warn(error.reason);
}
setTimeout(connectToDebuggerProxy, 500);
};
// Let debuggerWorker.js know when we're not visible so that we can warn about
// poor performance when using remote debugging.
document.addEventListener('visibilitychange', updateVisibility, false);
}
connectToDebuggerProxy();
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -0,0 +1,2 @@
body,html{font-family:Helvetica,Verdana,sans-serif;font-size:large;font-weight:200;height:100%;margin:0;padding:0}.shortcut{border-radius:4px;color:#eee;background-color:#333;font-family:Monaco,monospace;font-size:medium;letter-spacing:3px;padding:4px}.content{padding:10px}.reload-btn{padding:5px 10px}body.dark{background-color:#242424;color:#afafaf}.dark .shortcut{color:#c1c1c1}.dark a{color:#3b99fc}input[type=checkbox]{vertical-align:middle}.warning{box-sizing:border-box;max-width:800px;padding:16px;margin-bottom:1em;border-left:5px solid #e6a700;border-radius:6px;background-color:#fff8e6;box-shadow:0 1px 2px 0 rgba(0,0,0,.1);color:#4d3800;font-size:16px;font-weight:500;line-height:1.6}.warning p{margin-top:0}.warning p:last-child{margin:0}.dark .warning{background:#4d3800;border-left-color:#e6a700;color:#fff8e6}
/*# sourceMappingURL=/debugger-ui/ui.e31bb0bc.css.map */

View File

@@ -0,0 +1 @@
{"version":3,"sources":["index.css"],"names":[],"mappings":"AAAA,UAEE,wCAA2C,CAC3C,eAAgB,CAChB,eAAgB,CAChB,WAAY,CACZ,QAAS,CACT,SACF,CACA,UACE,iBAAkB,CAClB,UAAW,CACX,qBAAsB,CACtB,4BAAgC,CAChC,gBAAiB,CACjB,kBAAmB,CACnB,WACF,CACA,SACE,YACF,CACA,YACE,gBACF,CACA,UACE,wBAAyB,CACzB,aACF,CACA,gBACE,aACF,CACA,QACE,aACF,CACA,qBACE,qBACF,CAEA,SACE,qBAAsB,CACtB,eAAgB,CAChB,YAAa,CACb,iBAAkB,CAClB,6BAAuC,CACvC,iBAAkB,CAClB,wBAAoC,CACpC,qCAA8C,CAC9C,aAAqB,CACrB,cAAe,CACf,eAAgB,CAChB,eACF,CAEA,WACE,YACF,CAEA,sBACE,QACF,CAEA,eACE,kBAA0B,CAC1B,yBAAmC,CACnC,aACF","file":"ui.e31bb0bc.css","sourceRoot":"../../src/ui","sourcesContent":["html,\nbody {\n font-family: Helvetica, Verdana, sans-serif;\n font-size: large;\n font-weight: 200;\n height: 100%;\n margin: 0;\n padding: 0;\n}\n.shortcut {\n border-radius: 4px;\n color: #eee;\n background-color: #333;\n font-family: 'Monaco', monospace;\n font-size: medium;\n letter-spacing: 3px;\n padding: 4px;\n}\n.content {\n padding: 10px;\n}\n.reload-btn {\n padding: 5px 10px;\n}\nbody.dark {\n background-color: #242424;\n color: #afafaf;\n}\n.dark .shortcut {\n color: #c1c1c1;\n}\n.dark a {\n color: #3b99fc;\n}\ninput[type='checkbox'] {\n vertical-align: middle;\n}\n\n.warning {\n box-sizing: border-box;\n max-width: 800px;\n padding: 16px;\n margin-bottom: 1em;\n border-left: 5px solid rgb(230, 167, 0);\n border-radius: 6px;\n background-color: rgb(255, 248, 230);\n box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;\n color: rgb(77, 56, 0);\n font-size: 16px;\n font-weight: 500;\n line-height: 1.6;\n}\n\n.warning p {\n margin-top: 0;\n}\n\n.warning p:last-child {\n margin: 0;\n}\n\n.dark .warning {\n background: rgb(77, 56, 0);\n border-left-color: rgb(230, 167, 0);\n color: rgb(255, 248, 230);\n}\n"]}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long