@crowdin/app-project-module 0.90.0 → 0.91.0
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/out/modules/manifest.js +15 -5
- package/out/modules/modal/index.js +14 -2
- package/out/types.d.ts +3 -1
- package/package.json +1 -1
package/out/modules/manifest.js
CHANGED
|
@@ -193,11 +193,21 @@ function handle(config) {
|
|
|
193
193
|
];
|
|
194
194
|
}
|
|
195
195
|
if (config.modal) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
196
|
+
let modals = [];
|
|
197
|
+
if (Array.isArray(config.modal)) {
|
|
198
|
+
modals = config.modal.map((modal, i) => {
|
|
199
|
+
const moduleKey = modal.key || `${config.identifier}-modal-${i}`;
|
|
200
|
+
return Object.assign({ key: moduleKey, name: modal.name || config.name, url: modal.url || `/modal-${moduleKey}/` + (modal.fileName || 'index.html') }, (!!modal.environments && { environments: normalizeEnvironments(modal.environments) }));
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
modals = [
|
|
205
|
+
Object.assign({ key: config.identifier + '-modal', name: config.modal.name || config.name, url: config.modal.url || '/modal/' + (config.modal.fileName || 'index.html') }, (!!config.modal.environments && {
|
|
206
|
+
environments: normalizeEnvironments(config.modal.environments),
|
|
207
|
+
})),
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
modules['modal'] = modals;
|
|
201
211
|
}
|
|
202
212
|
if (config.contextMenu) {
|
|
203
213
|
// prevent possible overrides of the other modules
|
|
@@ -10,8 +10,20 @@ const util_1 = require("../../util");
|
|
|
10
10
|
function register({ config, app }) {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
const allowUnauthorized = !(0, util_1.isAuthorizedConfig)(config);
|
|
13
|
-
if (
|
|
14
|
-
|
|
13
|
+
if (!config.modal) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (Array.isArray(config.modal)) {
|
|
17
|
+
config.modal.forEach((modal) => {
|
|
18
|
+
if ((modal === null || modal === void 0 ? void 0 : modal.uiPath) || (modal === null || modal === void 0 ? void 0 : modal.formSchema)) {
|
|
19
|
+
app.use(`/modal-${modal.key}`, (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: modal.key }), (0, render_ui_module_1.default)(modal));
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (((_a = config.modal) === null || _a === void 0 ? void 0 : _a.uiPath) || ((_b = config.modal) === null || _b === void 0 ? void 0 : _b.formSchema)) {
|
|
25
|
+
app.use('/modal', (0, ui_module_1.default)({ config, allowUnauthorized, moduleType: config.modal.key }), (0, render_ui_module_1.default)(config.modal));
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
28
|
}
|
|
17
29
|
exports.register = register;
|
package/out/types.d.ts
CHANGED
|
@@ -159,7 +159,7 @@ export interface ClientConfig extends ImagePath {
|
|
|
159
159
|
/**
|
|
160
160
|
* modal module
|
|
161
161
|
*/
|
|
162
|
-
modal?:
|
|
162
|
+
modal?: ModalModule | ModalModule[];
|
|
163
163
|
/**
|
|
164
164
|
* Install hook
|
|
165
165
|
*/
|
|
@@ -497,4 +497,6 @@ export declare enum storageFiles {
|
|
|
497
497
|
SQLITE_BACKUP = "backup_app.sqlite",
|
|
498
498
|
DUMP = "dump_table_%s.sql"
|
|
499
499
|
}
|
|
500
|
+
export interface ModalModule extends ModuleContent, UiModule, Environments {
|
|
501
|
+
}
|
|
500
502
|
export {};
|
package/package.json
CHANGED