codenotch-react 1.0.55 → 1.0.57
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/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { ICodenotchApi, ICodenotchDialog, ICodenotchEnv } from "./models/Codenotch";
|
|
2
|
+
import { Auml } from "./components/Auml";
|
|
3
|
+
import CodeEditor from "./components/CodeEditor";
|
|
2
4
|
declare const env: ICodenotchEnv;
|
|
3
5
|
/**
|
|
4
6
|
* Setup Codenotch environment from the given object
|
|
5
|
-
* @param
|
|
7
|
+
* @param envVariables An object containing the Codenotch environment variables as key-value pairs. This can be obtained from URL parameters or any other source.
|
|
6
8
|
* @returns {void}
|
|
7
9
|
*/
|
|
8
|
-
declare function
|
|
10
|
+
declare function init(envVariables: any): void;
|
|
9
11
|
declare function i18n(key: string, ...args: any[]): string;
|
|
10
12
|
/**
|
|
11
13
|
* Return Codenotch API
|
|
12
14
|
* @returns {ICodenotchApi} Codenotch API
|
|
13
15
|
*/
|
|
14
16
|
declare function useCodenotch(): ICodenotchApi;
|
|
15
|
-
export { env
|
|
17
|
+
export { env, i18n, useCodenotch, init, ICodenotchEnv, ICodenotchApi, ICodenotchDialog, Auml, CodeEditor };
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEpF,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,UAAU,MAAM,yBAAyB,CAAC;AAIjD,QAAA,MAAM,GAAG,EAAE,aAAkB,CAAC;AAO9B;;;;GAIG;AACH,iBAAS,IAAI,CAAC,YAAY,EAAE,GAAG,GAAG,IAAI,CAiDrC;AAED,iBAAS,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,MAAM,CAoCjD;AAED;;;GAGG;AACH,iBAAS,YAAY,IAAI,aAAa,CAsKrC;AAED,OAAO,EACH,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACb,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3,40 +3,44 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.CodeEditor = exports.Auml = exports.env = void 0;
|
|
7
7
|
exports.i18n = i18n;
|
|
8
8
|
exports.useCodenotch = useCodenotch;
|
|
9
|
-
exports.
|
|
9
|
+
exports.init = init;
|
|
10
10
|
const react_dom_1 = __importDefault(require("react-dom"));
|
|
11
11
|
const SignalR_1 = require("./core/SignalR");
|
|
12
12
|
const ProcessUtils_1 = __importDefault(require("./core/ProcessUtils"));
|
|
13
13
|
const uuid_1 = require("uuid");
|
|
14
|
+
const Auml_1 = require("./components/Auml");
|
|
15
|
+
Object.defineProperty(exports, "Auml", { enumerable: true, get: function () { return Auml_1.Auml; } });
|
|
16
|
+
const CodeEditor_1 = __importDefault(require("./components/CodeEditor"));
|
|
17
|
+
exports.CodeEditor = CodeEditor_1.default;
|
|
14
18
|
var signalR = undefined;
|
|
15
19
|
const env = {};
|
|
16
|
-
exports.
|
|
20
|
+
exports.env = env;
|
|
17
21
|
const MISSING_CLUSTER_URL_ERROR = "Codenotch cluster URL is not defined. Please set it in the Codenotch configuration.";
|
|
18
22
|
const MISSING_SERVICE_NAME_ERROR = "Codenotch service name is not defined. Please set it in the Codenotch configuration.";
|
|
19
23
|
const MISSING_TENANT_NAME_ERROR = "Codenotch tenant name is not defined. Please set it in the Codenotch configuration.";
|
|
20
24
|
/**
|
|
21
25
|
* Setup Codenotch environment from the given object
|
|
22
|
-
* @param
|
|
26
|
+
* @param envVariables An object containing the Codenotch environment variables as key-value pairs. This can be obtained from URL parameters or any other source.
|
|
23
27
|
* @returns {void}
|
|
24
28
|
*/
|
|
25
|
-
function
|
|
26
|
-
if (
|
|
29
|
+
function init(envVariables) {
|
|
30
|
+
if (envVariables === undefined || envVariables === null) {
|
|
27
31
|
console.warn("Codenotch environment is not defined. Please set it in the Codenotch configuration.");
|
|
28
32
|
return;
|
|
29
33
|
}
|
|
30
34
|
// i18n.fr.somekey=some value
|
|
31
35
|
let i18nLanguages = new Set();
|
|
32
|
-
Object.keys(
|
|
36
|
+
Object.keys(envVariables).forEach((key) => {
|
|
33
37
|
if (key.startsWith("i18n.")) {
|
|
34
38
|
// Special case
|
|
35
39
|
let parts = key.split(".");
|
|
36
40
|
let language = parts[1];
|
|
37
41
|
let keyName = parts.slice(2).join(".");
|
|
38
42
|
i18nLanguages.add(language);
|
|
39
|
-
let keyValue = `${
|
|
43
|
+
let keyValue = `${envVariables[key]}`.trim();
|
|
40
44
|
if (keyValue.startsWith('"') && keyValue.endsWith('"')) {
|
|
41
45
|
// Parse like json
|
|
42
46
|
try {
|
|
@@ -51,7 +55,7 @@ function setupCodenotchEnv(env) {
|
|
|
51
55
|
env.i18n[language][keyName] = keyValue;
|
|
52
56
|
}
|
|
53
57
|
else {
|
|
54
|
-
env[key] =
|
|
58
|
+
env[key] = envVariables[key];
|
|
55
59
|
console.log(`Codenotch environment variable ${key} set to ${env[key]}`);
|
|
56
60
|
}
|
|
57
61
|
});
|