@intuitionrobotics/thunderstorm 0.41.69 → 0.41.70
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/app-backend/api/v1/utils/version/_assert.js +1 -1
- package/app-backend/api/v1/utils/version/_assert.js.map +1 -1
- package/app-backend/api/v1/utils/version/assert.js +13 -58
- package/app-backend/api/v1/utils/version/assert.js.map +1 -1
- package/app-backend/core/BaseStorm.js +34 -87
- package/app-backend/core/BaseStorm.js.map +1 -1
- package/app-backend/core/Storm.js +42 -112
- package/app-backend/core/Storm.js.map +1 -1
- package/app-backend/exceptions.js +11 -27
- package/app-backend/exceptions.js.map +1 -1
- package/app-backend/modules/CleanupScheduler.js +24 -92
- package/app-backend/modules/CleanupScheduler.js.map +1 -1
- package/app-backend/modules/FirestoreBackupScheduler.js +47 -138
- package/app-backend/modules/FirestoreBackupScheduler.js.map +1 -1
- package/app-backend/modules/ForceUpgrade.js +31 -82
- package/app-backend/modules/ForceUpgrade.js.map +1 -1
- package/app-backend/modules/http/AxiosHttpModule.js +116 -184
- package/app-backend/modules/http/AxiosHttpModule.js.map +1 -1
- package/app-backend/modules/proxy/RemoteProxy.js +40 -90
- package/app-backend/modules/proxy/RemoteProxy.js.map +1 -1
- package/app-backend/modules/proxy/RemoteProxyCaller.js +49 -122
- package/app-backend/modules/proxy/RemoteProxyCaller.js.map +1 -1
- package/app-backend/modules/server/HttpServer.js +153 -216
- package/app-backend/modules/server/HttpServer.js.map +1 -1
- package/app-backend/modules/server/server-api.js +236 -361
- package/app-backend/modules/server/server-api.js.map +1 -1
- package/app-backend/modules/server/server-errors.js +51 -91
- package/app-backend/modules/server/server-errors.js.map +1 -1
- package/app-backend/utils/LogClient_File.js +23 -42
- package/app-backend/utils/LogClient_File.js.map +1 -1
- package/app-backend/utils/file.js +7 -50
- package/app-backend/utils/file.js.map +1 -1
- package/app-backend/utils/promisify-request.js +13 -43
- package/app-backend/utils/promisify-request.js.map +1 -1
- package/app-backend/utils/to-be-removed.js +7 -8
- package/app-backend/utils/to-be-removed.js.map +1 -1
- package/app-backend/utils/types.js +1 -1
- package/app-backend/utils/types.js.map +1 -1
- package/app-frontend/components/ActionButton.js +5 -5
- package/app-frontend/components/ActionButton.js.map +1 -1
- package/app-frontend/components/DropDown.js +91 -119
- package/app-frontend/components/DropDown.js.map +1 -1
- package/app-frontend/components/FilterInput.js +31 -48
- package/app-frontend/components/FilterInput.js.map +1 -1
- package/app-frontend/components/GenericSelect.js +30 -59
- package/app-frontend/components/GenericSelect.js.map +1 -1
- package/app-frontend/components/GenericTabs.js +5 -23
- package/app-frontend/components/GenericTabs.js.map +1 -1
- package/app-frontend/components/Overlay.js +15 -34
- package/app-frontend/components/Overlay.js.map +1 -1
- package/app-frontend/components/TS_Input.js +43 -60
- package/app-frontend/components/TS_Input.js.map +1 -1
- package/app-frontend/components/TS_Table.js +31 -48
- package/app-frontend/components/TS_Table.js.map +1 -1
- package/app-frontend/components/TS_TextArea.js +21 -48
- package/app-frontend/components/TS_TextArea.js.map +1 -1
- package/app-frontend/components/Tabs.js +16 -33
- package/app-frontend/components/Tabs.js.map +1 -1
- package/app-frontend/components/adapter/Adapter.js +103 -154
- package/app-frontend/components/adapter/Adapter.js.map +1 -1
- package/app-frontend/components/adapter/BaseRenderer.js +9 -32
- package/app-frontend/components/adapter/BaseRenderer.js.map +1 -1
- package/app-frontend/components/checkbox/TS_Checkbox.js +12 -29
- package/app-frontend/components/checkbox/TS_Checkbox.js.map +1 -1
- package/app-frontend/components/checkbox/TS_CheckboxField.js +16 -34
- package/app-frontend/components/checkbox/TS_CheckboxField.js.map +1 -1
- package/app-frontend/components/form/Form.js +21 -39
- package/app-frontend/components/form/Form.js.map +1 -1
- package/app-frontend/components/playground/Example_NewProps.js +25 -53
- package/app-frontend/components/playground/Example_NewProps.js.map +1 -1
- package/app-frontend/components/playground/Playground.js +21 -49
- package/app-frontend/components/playground/Playground.js.map +1 -1
- package/app-frontend/components/tree/MenuComponent.js +11 -27
- package/app-frontend/components/tree/MenuComponent.js.map +1 -1
- package/app-frontend/components/tree/MultiTypeAdaptor.js +16 -32
- package/app-frontend/components/tree/MultiTypeAdaptor.js.map +1 -1
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js +18 -52
- package/app-frontend/components/tree/SimpleTreeNodeRenderer.js.map +1 -1
- package/app-frontend/components/tree/Tree.js +142 -178
- package/app-frontend/components/tree/Tree.js.map +1 -1
- package/app-frontend/components/treeicons.js +5 -5
- package/app-frontend/components/treeicons.js.map +1 -1
- package/app-frontend/core/AbstractThunder.js +27 -43
- package/app-frontend/core/AbstractThunder.js.map +1 -1
- package/app-frontend/core/AppPage.js +16 -32
- package/app-frontend/core/AppPage.js.map +1 -1
- package/app-frontend/core/AppWrapper.js +9 -10
- package/app-frontend/core/AppWrapper.js.map +1 -1
- package/app-frontend/core/BaseComponent.js +62 -106
- package/app-frontend/core/BaseComponent.js.map +1 -1
- package/app-frontend/core/SimpleScriptInjector.js +12 -31
- package/app-frontend/core/SimpleScriptInjector.js.map +1 -1
- package/app-frontend/core/Thunder.js +32 -48
- package/app-frontend/core/Thunder.js.map +1 -1
- package/app-frontend/core/thunder-dispatcher.js +18 -67
- package/app-frontend/core/thunder-dispatcher.js.map +1 -1
- package/app-frontend/modules/ConnectivityModule.js +16 -32
- package/app-frontend/modules/ConnectivityModule.js.map +1 -1
- package/app-frontend/modules/ForceUpgrade.js +17 -33
- package/app-frontend/modules/ForceUpgrade.js.map +1 -1
- package/app-frontend/modules/HistoryModule.js +51 -79
- package/app-frontend/modules/HistoryModule.js.map +1 -1
- package/app-frontend/modules/ResourcesModule.js +12 -28
- package/app-frontend/modules/ResourcesModule.js.map +1 -1
- package/app-frontend/modules/StorageModule.js +47 -68
- package/app-frontend/modules/StorageModule.js.map +1 -1
- package/app-frontend/modules/ThunderstormModule.js +15 -31
- package/app-frontend/modules/ThunderstormModule.js.map +1 -1
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js +24 -41
- package/app-frontend/modules/component-loader/ReactEntryComponentInjector.js.map +1 -1
- package/app-frontend/modules/component-loader/entry-component-loading-module.js +19 -36
- package/app-frontend/modules/component-loader/entry-component-loading-module.js.map +1 -1
- package/app-frontend/modules/dialog/Dialog.js +55 -96
- package/app-frontend/modules/dialog/Dialog.js.map +1 -1
- package/app-frontend/modules/dialog/DialogModule.js +48 -84
- package/app-frontend/modules/dialog/DialogModule.js.map +1 -1
- package/app-frontend/modules/http/HttpClient.js +46 -93
- package/app-frontend/modules/http/HttpClient.js.map +1 -1
- package/app-frontend/modules/http/XhrHttpModule.js +66 -88
- package/app-frontend/modules/http/XhrHttpModule.js.map +1 -1
- package/app-frontend/modules/locale/LocaleModule.js +23 -50
- package/app-frontend/modules/locale/LocaleModule.js.map +1 -1
- package/app-frontend/modules/menu/MenuAndButton.js +23 -40
- package/app-frontend/modules/menu/MenuAndButton.js.map +1 -1
- package/app-frontend/modules/menu/MenuModule.js +25 -42
- package/app-frontend/modules/menu/MenuModule.js.map +1 -1
- package/app-frontend/modules/menu/PopupMenu.js +37 -64
- package/app-frontend/modules/menu/PopupMenu.js.map +1 -1
- package/app-frontend/modules/routing/RoutingModule.js +47 -66
- package/app-frontend/modules/routing/RoutingModule.js.map +1 -1
- package/app-frontend/modules/routing/route.js +31 -33
- package/app-frontend/modules/routing/route.js.map +1 -1
- package/app-frontend/modules/toaster/BaseToaster.js +18 -36
- package/app-frontend/modules/toaster/BaseToaster.js.map +1 -1
- package/app-frontend/modules/toaster/Toaster.js +12 -38
- package/app-frontend/modules/toaster/Toaster.js.map +1 -1
- package/app-frontend/modules/toaster/ToasterModule.js +61 -88
- package/app-frontend/modules/toaster/ToasterModule.js.map +1 -1
- package/app-frontend/modules/tooltip/Tooltip.js +25 -52
- package/app-frontend/modules/tooltip/Tooltip.js.map +1 -1
- package/app-frontend/modules/tooltip/TooltipModule.js +32 -51
- package/app-frontend/modules/tooltip/TooltipModule.js.map +1 -1
- package/app-frontend/tools/KeyboardListener.js +24 -41
- package/app-frontend/tools/KeyboardListener.js.map +1 -1
- package/app-frontend/tools/Stylable.js +14 -28
- package/app-frontend/tools/Stylable.js.map +1 -1
- package/app-frontend/utils/tools.js +8 -8
- package/app-frontend/utils/tools.js.map +1 -1
- package/app-frontend/widgets/FieldEditor.js +16 -32
- package/app-frontend/widgets/FieldEditor.js.map +1 -1
- package/app-frontend/widgets/FieldEditorClick.js +32 -49
- package/app-frontend/widgets/FieldEditorClick.js.map +1 -1
- package/app-frontend/widgets/FieldEditorWithButtons.js +33 -49
- package/app-frontend/widgets/FieldEditorWithButtons.js.map +1 -1
- package/app-frontend/widgets/click-to-drag/ClickToDrag.js +25 -41
- package/app-frontend/widgets/click-to-drag/ClickToDrag.js.map +1 -1
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.js +22 -38
- package/app-frontend/widgets/click-to-drag/OverlayWithDocumentListener.js.map +1 -1
- package/package.json +4 -4
- package/shared/BaseHttpModule.js +44 -64
- package/shared/BaseHttpModule.js.map +1 -1
- package/shared/BaseHttpRequest.js +122 -176
- package/shared/BaseHttpRequest.js.map +1 -1
- package/shared/request-types.js +4 -19
- package/shared/request-types.js.map +1 -1
- package/test-backend/StormTester.js +37 -90
- package/test-backend/StormTester.js.map +1 -1
|
@@ -19,60 +19,42 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __extends = (this && this.__extends) || (function () {
|
|
23
|
-
var extendStatics = function (d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
return function (d, b) {
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
23
|
exports.StorageKey = exports.StorageModule = exports.StorageModule_Class = void 0;
|
|
37
24
|
/**
|
|
38
25
|
* Created by tacb0ss on 27/07/2018.
|
|
39
26
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var dispatcher = new thunder_dispatcher_1.ThunderDispatcher('__onStorageKeyEvent');
|
|
27
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
28
|
+
const thunder_dispatcher_1 = require("../core/thunder-dispatcher");
|
|
29
|
+
class StorageModule_Class extends ts_common_1.Module {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.cache = {};
|
|
33
|
+
this.handleStorageEvent = (e) => {
|
|
34
|
+
const dispatcher = new thunder_dispatcher_1.ThunderDispatcher('__onStorageKeyEvent');
|
|
49
35
|
dispatcher.dispatchUI([e]);
|
|
50
36
|
dispatcher.dispatchModule([e]);
|
|
51
37
|
};
|
|
52
|
-
|
|
53
|
-
return _this;
|
|
38
|
+
this.getStorage = (persist) => persist ? localStorage : sessionStorage;
|
|
54
39
|
}
|
|
55
|
-
|
|
40
|
+
init() {
|
|
56
41
|
window.addEventListener('storage', this.handleStorageEvent);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (persist === void 0) { persist = true; }
|
|
42
|
+
}
|
|
43
|
+
set(key, value, persist = true) {
|
|
60
44
|
if (!value)
|
|
61
45
|
return this.delete(key);
|
|
62
46
|
this.cache[key] = value;
|
|
63
47
|
this.getStorage(persist).setItem(key, JSON.stringify(value));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (persist === void 0) { persist = true; }
|
|
48
|
+
}
|
|
49
|
+
delete(key, persist = true) {
|
|
67
50
|
this.clearCache(key);
|
|
68
51
|
this.getStorage(persist).removeItem(key);
|
|
69
|
-
}
|
|
70
|
-
|
|
52
|
+
}
|
|
53
|
+
clearCache(key) {
|
|
71
54
|
delete this.cache[key];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
var value = this.cache[key];
|
|
55
|
+
}
|
|
56
|
+
get(key, defaultValue, persist = true) {
|
|
57
|
+
let value = this.cache[key];
|
|
76
58
|
if (value)
|
|
77
59
|
return value;
|
|
78
60
|
value = this.getStorage(persist).getItem(key);
|
|
@@ -80,16 +62,16 @@ var StorageModule_Class = /** @class */ (function (_super) {
|
|
|
80
62
|
if (!value)
|
|
81
63
|
return defaultValue || null;
|
|
82
64
|
return this.cache[key] = JSON.parse(value);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
for (
|
|
87
|
-
|
|
65
|
+
}
|
|
66
|
+
query(query) {
|
|
67
|
+
const toRet = [];
|
|
68
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
69
|
+
const key = localStorage.key(i);
|
|
88
70
|
if (key === null || key === void 0 ? void 0 : key.match(query)) {
|
|
89
|
-
|
|
71
|
+
const item = localStorage.getItem(key);
|
|
90
72
|
if (item) {
|
|
91
73
|
try {
|
|
92
|
-
|
|
74
|
+
const exp = JSON.parse(item);
|
|
93
75
|
toRet.push(exp);
|
|
94
76
|
}
|
|
95
77
|
catch (e) {
|
|
@@ -98,48 +80,45 @@ var StorageModule_Class = /** @class */ (function (_super) {
|
|
|
98
80
|
}
|
|
99
81
|
}
|
|
100
82
|
return toRet;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
for (
|
|
104
|
-
|
|
83
|
+
}
|
|
84
|
+
deleteAll(query) {
|
|
85
|
+
for (let i = 0; i < localStorage.length; i++) {
|
|
86
|
+
const key = localStorage.key(i);
|
|
105
87
|
if (key === null || key === void 0 ? void 0 : key.match(query)) {
|
|
106
88
|
localStorage.removeItem(key);
|
|
107
89
|
}
|
|
108
90
|
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
}(ts_common_1.Module));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
112
93
|
exports.StorageModule_Class = StorageModule_Class;
|
|
113
94
|
exports.StorageModule = new StorageModule_Class();
|
|
114
95
|
//TODO Generic Keys like in the tests contexts
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
if (persist === void 0) { persist = true; }
|
|
96
|
+
class StorageKey {
|
|
97
|
+
constructor(key, persist = true) {
|
|
118
98
|
this.key = key;
|
|
119
99
|
this.persist = persist;
|
|
120
100
|
}
|
|
121
|
-
|
|
101
|
+
get(defaultValue) {
|
|
122
102
|
// @ts-ignore
|
|
123
103
|
return exports.StorageModule.get(this.key, defaultValue, this.persist);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
104
|
+
}
|
|
105
|
+
patch(value) {
|
|
106
|
+
const previousValue = this.get();
|
|
107
|
+
const mergedValue = ts_common_1.merge(previousValue, value);
|
|
128
108
|
this.set(mergedValue);
|
|
129
109
|
return mergedValue;
|
|
130
|
-
}
|
|
131
|
-
|
|
110
|
+
}
|
|
111
|
+
set(value) {
|
|
132
112
|
// @ts-ignore
|
|
133
113
|
exports.StorageModule.set(this.key, value, this.persist);
|
|
134
114
|
return value;
|
|
135
|
-
}
|
|
136
|
-
|
|
115
|
+
}
|
|
116
|
+
delete() {
|
|
137
117
|
exports.StorageModule.delete(this.key, this.persist);
|
|
138
|
-
}
|
|
139
|
-
|
|
118
|
+
}
|
|
119
|
+
clearCache() {
|
|
140
120
|
exports.StorageModule.clearCache(this.key);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
}());
|
|
121
|
+
}
|
|
122
|
+
}
|
|
144
123
|
exports.StorageKey = StorageKey;
|
|
145
124
|
//# sourceMappingURL=StorageModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorageModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/StorageModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"StorageModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/StorageModule.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH;;GAEG;AACH,4DAGsC;AACtC,mEAA6D;AAM7D,MAAa,mBACZ,SAAQ,kBAAM;IADf;;QAES,UAAK,GAA8C,EAAE,CAAC;QAMtD,uBAAkB,GAAG,CAAC,CAAe,EAAE,EAAE;YAChD,MAAM,UAAU,GAAG,IAAI,sCAAiB,CAAyC,qBAAqB,CAAC,CAAC;YACxG,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3B,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,CAAC,CAAC;QAEF,eAAU,GAAG,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC;IA2D5E,CAAC;IArEU,IAAI;QACb,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC7D,CAAC;IAUD,GAAG,CAAC,GAAW,EAAE,KAA+B,EAAE,UAAmB,IAAI;QACxE,IAAI,CAAC,KAAK;YACT,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAEzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,MAAM,CAAC,GAAW,EAAE,UAAmB,IAAI;QAC1C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,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AAC;IAED,UAAU;QACT,qBAAa,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;CACD;AAlCD,gCAkCC"}
|
|
@@ -1,47 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.ThunderstormModule = void 0;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_this.setDefaultConfig({ appName: "Thunderstorm-WebApp" });
|
|
23
|
-
return _this;
|
|
4
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
5
|
+
class ThunderstormModule_Class extends ts_common_1.Module {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.setDefaultConfig({ appName: "Thunderstorm-WebApp" });
|
|
24
9
|
}
|
|
25
|
-
|
|
10
|
+
init() {
|
|
26
11
|
this.setAppName(this.config.appName);
|
|
27
12
|
this.setChromeThemeColor(this.config.themeColor);
|
|
28
|
-
}
|
|
29
|
-
|
|
13
|
+
}
|
|
14
|
+
setAppName(appName) {
|
|
30
15
|
document.title = appName;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
16
|
+
}
|
|
17
|
+
setChromeThemeColor(themeColor) {
|
|
18
|
+
let themeTag = document.head.querySelector('meta[name="theme-color"]');
|
|
34
19
|
if (!themeTag) {
|
|
35
20
|
themeTag = document.createElement('meta');
|
|
36
21
|
themeTag.name = "theme-color";
|
|
37
22
|
document.getElementsByTagName('head')[0].appendChild(themeTag);
|
|
38
23
|
}
|
|
39
24
|
themeTag.setAttribute('content', themeColor);
|
|
40
|
-
}
|
|
41
|
-
|
|
25
|
+
}
|
|
26
|
+
getAppName() {
|
|
42
27
|
return this.config.appName;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}(ts_common_1.Module));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
46
30
|
exports.ThunderstormModule = new ThunderstormModule_Class();
|
|
47
31
|
//# sourceMappingURL=ThunderstormModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThunderstormModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/ThunderstormModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThunderstormModule.js","sourceRoot":"","sources":["../../../src/main/app-frontend/modules/ThunderstormModule.ts"],"names":[],"mappings":";;;AAAA,4DAAoD;AAOpD,MAAM,wBACL,SAAQ,kBAAc;IAEtB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,EAAC,OAAO,EAAE,qBAAqB,EAAC,CAAC,CAAC;IACzD,CAAC;IAED,IAAI;QACH,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACrC,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAClD,CAAC;IAED,UAAU,CAAC,OAAe;QACzB,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAA;IACzB,CAAC;IAED,mBAAmB,CAAC,UAAkB;QACrC,IAAI,QAAQ,GAA2B,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;QAC/F,IAAI,CAAC,QAAQ,EAAE;YACd,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;YAC1C,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC;YAC9B,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;SAC/D;QAED,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9C,CAAC;IAED,UAAU;QACT,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;IAC5B,CAAC;CACD;AAEY,QAAA,kBAAkB,GAAG,IAAI,wBAAwB,EAAE,CAAC"}
|
|
@@ -19,66 +19,49 @@
|
|
|
19
19
|
* See the License for the specific language governing permissions and
|
|
20
20
|
* limitations under the License.
|
|
21
21
|
*/
|
|
22
|
-
var __extends = (this && this.__extends) || (function () {
|
|
23
|
-
var extendStatics = function (d, b) {
|
|
24
|
-
extendStatics = Object.setPrototypeOf ||
|
|
25
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
27
|
-
return extendStatics(d, b);
|
|
28
|
-
};
|
|
29
|
-
return function (d, b) {
|
|
30
|
-
extendStatics(d, b);
|
|
31
|
-
function __() { this.constructor = d; }
|
|
32
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
23
|
exports.ReactEntryComponentInjector = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (key !== _this.props.src)
|
|
24
|
+
const React = require("react");
|
|
25
|
+
const entry_component_loading_module_1 = require("./entry-component-loading-module");
|
|
26
|
+
const BaseComponent_1 = require("../../core/BaseComponent");
|
|
27
|
+
class ReactEntryComponentInjector extends BaseComponent_1.BaseComponent {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
super(props);
|
|
30
|
+
this.myRef = React.createRef();
|
|
31
|
+
this.__onRequestCompleted = (key, success) => {
|
|
32
|
+
if (key !== this.props.src)
|
|
47
33
|
return;
|
|
48
34
|
if (!success)
|
|
49
35
|
// Need to add error handling here...
|
|
50
36
|
return;
|
|
51
|
-
|
|
37
|
+
this.injectComponent(entry_component_loading_module_1.EntryComponentLoadingModule.getNode(key));
|
|
52
38
|
};
|
|
53
|
-
|
|
54
|
-
return _this;
|
|
39
|
+
this.state = { loading: false, progress: 0 };
|
|
55
40
|
}
|
|
56
|
-
|
|
41
|
+
injectComponent(node) {
|
|
57
42
|
var _a;
|
|
58
43
|
(_a = this.myRef.current) === null || _a === void 0 ? void 0 : _a.appendChild(node);
|
|
59
44
|
this.setState({ loading: false });
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var node = entry_component_loading_module_1.EntryComponentLoadingModule.getNode(src);
|
|
45
|
+
}
|
|
46
|
+
componentDidMount() {
|
|
47
|
+
const src = this.props.src;
|
|
48
|
+
const node = entry_component_loading_module_1.EntryComponentLoadingModule.getNode(src);
|
|
65
49
|
if (node)
|
|
66
50
|
return this.injectComponent(node);
|
|
67
|
-
entry_component_loading_module_1.EntryComponentLoadingModule.loadScript(src,
|
|
51
|
+
entry_component_loading_module_1.EntryComponentLoadingModule.loadScript(src, (progress) => this.setState({ progress }));
|
|
68
52
|
this.setState({ loading: true });
|
|
69
|
-
}
|
|
70
|
-
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
71
55
|
return React.createElement("div", { ref: this.myRef, id: this.props.src }, this.extracted());
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
56
|
+
}
|
|
57
|
+
extracted() {
|
|
58
|
+
const Loader = this.props.loader;
|
|
75
59
|
if (Loader)
|
|
76
60
|
return React.createElement(Loader, { progress: this.state.progress });
|
|
77
61
|
return React.createElement("div", { style: { width: "100%", height: "100%" } },
|
|
78
62
|
this.state.progress,
|
|
79
63
|
" %");
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
}(BaseComponent_1.BaseComponent));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
83
66
|
exports.ReactEntryComponentInjector = ReactEntryComponentInjector;
|
|
84
67
|
//# sourceMappingURL=ReactEntryComponentInjector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactEntryComponentInjector.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/component-loader/ReactEntryComponentInjector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG
|
|
1
|
+
{"version":3,"file":"ReactEntryComponentInjector.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/component-loader/ReactEntryComponentInjector.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;AAEH,+BAA+B;AAC/B,qFAA6E;AAC7E,4DAAuD;AAgBvD,MAAa,2BACZ,SAAQ,6BAA2B;IAKnC,YAAY,KAAY;QACvB,KAAK,CAAC,KAAK,CAAC,CAAC;QAHN,UAAK,GAAoC,KAAK,CAAC,SAAS,EAAE,CAAC;QAOnE,yBAAoB,GAAG,CAAC,GAAW,EAAE,OAAgB,EAAE,EAAE;YACxD,IAAI,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,GAAG;gBACzB,OAAO;YAER,IAAI,CAAC,OAAO;gBACZ,qCAAqC;gBACpC,OAAO;YAER,IAAI,CAAC,eAAe,CAAC,4DAA2B,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC,CAAC;QAZD,IAAI,CAAC,KAAK,GAAG,EAAC,OAAO,EAAE,KAAK,EAAE,QAA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
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
extendStatics(d, b);
|
|
11
|
-
function __() { this.constructor = d; }
|
|
12
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
13
|
-
};
|
|
14
|
-
})();
|
|
15
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
3
|
exports.EntryComponentLoadingModule = exports.PageLoadingModule_Class = void 0;
|
|
17
4
|
/*
|
|
@@ -34,40 +21,36 @@ exports.EntryComponentLoadingModule = exports.PageLoadingModule_Class = void 0;
|
|
|
34
21
|
* See the License for the specific language governing permissions and
|
|
35
22
|
* limitations under the License.
|
|
36
23
|
*/
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
const index_1 = require("../../../index");
|
|
25
|
+
const ts_common_1 = require("@intuitionrobotics/ts-common");
|
|
39
26
|
// noinspection TypeScriptPreferShortImport
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.injected = {};
|
|
47
|
-
return _this;
|
|
27
|
+
const XhrHttpModule_1 = require("../http/XhrHttpModule");
|
|
28
|
+
const HistoryModule_1 = require("../HistoryModule");
|
|
29
|
+
class PageLoadingModule_Class extends ts_common_1.Module {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
this.injected = {};
|
|
48
33
|
}
|
|
49
|
-
|
|
50
|
-
var _this = this;
|
|
34
|
+
loadScript(src, progressListener) {
|
|
51
35
|
XhrHttpModule_1.XhrHttpModule
|
|
52
36
|
.createRequest(index_1.HttpMethod.GET, src)
|
|
53
|
-
.setUrl(HistoryModule_1.BrowserHistoryModule.getOrigin()
|
|
54
|
-
.setOnProgressListener(
|
|
55
|
-
|
|
37
|
+
.setUrl(`${HistoryModule_1.BrowserHistoryModule.getOrigin()}/${src}`)
|
|
38
|
+
.setOnProgressListener((ev) => {
|
|
39
|
+
const progress = ev.loaded / ev.total;
|
|
56
40
|
progressListener(progress);
|
|
57
41
|
})
|
|
58
|
-
.execute(
|
|
59
|
-
|
|
42
|
+
.execute(response => {
|
|
43
|
+
const divElement = document.createElement("script");
|
|
60
44
|
divElement.innerHTML = response;
|
|
61
45
|
divElement.id = src;
|
|
62
46
|
divElement.async = true;
|
|
63
|
-
|
|
47
|
+
this.injected[src] = divElement;
|
|
64
48
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
49
|
+
}
|
|
50
|
+
getNode(src) {
|
|
67
51
|
return this.injected[src];
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}(ts_common_1.Module));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
71
54
|
exports.PageLoadingModule_Class = PageLoadingModule_Class;
|
|
72
55
|
exports.EntryComponentLoadingModule = new PageLoadingModule_Class();
|
|
73
56
|
//# sourceMappingURL=entry-component-loading-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry-component-loading-module.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/component-loader/entry-component-loading-module.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entry-component-loading-module.js","sourceRoot":"","sources":["../../../../src/main/app-frontend/modules/component-loader/entry-component-loading-module.tsx"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,0CAIwB;AAExB,4DAAoD;AACpD,2CAA2C;AAC3C,yDAAoD;AACpD,oDAAsD;AAItD,MAAa,uBACZ,SAAQ,kBAAU;IADnB;;QAGkB,aAAQ,GAAyC,EAAE,CAAC;IAsBtE,CAAC;IApBA,UAAU,CAAC,GAAW,EAAE,gBAA4C;QACnE,6BAAa;aACX,aAAa,CAAqB,kBAAU,CAAC,GAAG,EAAE,GAAG,CAAC;aACtD,MAAM,CAAC,GAAG,oCAAoB,CAAC,SAAS,EAAE,IAAI,GAAG,EAAE,CAAC;aACpD,qBAAqB,CAAC,CAAC,EAAe,EAAE,EAAE;YAC1C,MAAM,QAAQ,GAAG,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC;YACtC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC,CAAC;aACD,OAAO,CAAC,QAAQ,CAAC,EAAE;YACnB,MAAM,UAAU,GAAsB,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YACvE,UAAU,CAAC,SAAS,GAAG,QAAQ,CAAC;YAChC,UAAU,CAAC,EAAE,GAAG,GAAG,CAAC;YACpB,UAAU,CAAC,KAAK,GAAG,IAAI,CAAC;YACxB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;QACjC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,GAAW;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACD;AAzBD,0DAyBC;AAEY,QAAA,2BAA2B,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
|