@crowdin/app-project-module 0.22.6 → 0.23.1

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/README.md CHANGED
@@ -795,6 +795,7 @@ Framework also supports following modules:
795
795
  - [organization-menu module](https://support.crowdin.com/enterprise/crowdin-apps-modules/#organization-menu-module)
796
796
  - [editor-right-panel module](https://support.crowdin.com/crowdin-apps-modules/#editor-panels-module)
797
797
  - [project-menu module](https://support.crowdin.com/crowdin-apps-modules/#project-menu-module)
798
+ - [project-menu-crowdsource module](https://developer.crowdin.com/crowdin-apps-module-project-menu-crowdsource/)
798
799
  - [project-tools module](https://support.crowdin.com/crowdin-apps-modules/#tools-module)
799
800
  - [project-reports module](https://support.crowdin.com/crowdin-apps-modules/#reports-module)
800
801
 
@@ -812,7 +813,7 @@ const configuration = {
812
813
  description: 'Sample App description',
813
814
  dbFolder: __dirname,
814
815
  imagePath: __dirname + '/' + 'logo.png',
815
- projectReports: { //can be editorRightPanel, projectMenu, projectTools
816
+ projectReports: { //can be editorRightPanel, projectMenu, projectTools, projectMenuCrowdsource
816
817
  imagePath: __dirname + '/' + 'reports.png',
817
818
  fileName: 'reports.html', //optional, only needed if file is not index.html
818
819
  uiPath: __dirname + '/' + 'public' // folder where UI of the module is located (js, html, css files)
@@ -34,6 +34,7 @@ function handle(config) {
34
34
  {
35
35
  key: config.identifier + '-mt',
36
36
  name: config.name,
37
+ logo: '/logo/mt/logo.png',
37
38
  url: '/translate',
38
39
  },
39
40
  ];
@@ -77,6 +78,15 @@ function handle(config) {
77
78
  },
78
79
  ];
79
80
  }
81
+ if (config.projectMenuCrowdsource) {
82
+ modules['project-menu-crowdsource'] = [
83
+ {
84
+ key: config.identifier + '-project-menu-crowdsource',
85
+ name: config.name,
86
+ url: '/project-menu-crowdsource/' + (config.projectMenuCrowdsource.fileName || 'index.html'),
87
+ },
88
+ ];
89
+ }
80
90
  if (config.projectTools) {
81
91
  modules['project-tools'] = [
82
92
  {
package/out/index.js CHANGED
@@ -138,6 +138,7 @@ function addCrowdinEndpoints(app, config) {
138
138
  app.get('/file/download', (0, download_1.default)(config, config.customFileFormat.filesFolder || config.dbFolder || '/'));
139
139
  }
140
140
  if (config.customMT) {
141
+ app.get('/logo/mt/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.customMT) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
141
142
  app.post('/translate', (0, crowdin_client_1.default)(config), (0, translate_1.default)(config, config.customMT));
142
143
  }
143
144
  if (config.profileResourcesMenu) {
@@ -154,6 +155,9 @@ function addCrowdinEndpoints(app, config) {
154
155
  if (config.projectMenu) {
155
156
  app.use('/project-menu', (0, ui_module_1.default)(config), express_1.default.static(config.projectMenu.uiPath));
156
157
  }
158
+ if (config.projectMenuCrowdsource) {
159
+ app.use('/project-menu-crowdsource', (0, ui_module_1.default)(config), express_1.default.static(config.projectMenuCrowdsource.uiPath));
160
+ }
157
161
  if (config.projectTools) {
158
162
  app.get('/logo/tools/logo.png', (req, res) => { var _a; return res.sendFile(((_a = config.projectTools) === null || _a === void 0 ? void 0 : _a.imagePath) || config.imagePath || (0, path_1.join)(__dirname, 'logo.png')); });
159
163
  app.use('/tools', (0, ui_module_1.default)(config), express_1.default.static(config.projectTools.uiPath));
@@ -75,7 +75,7 @@ export interface Config extends ImagePath {
75
75
  /**
76
76
  * custom MT module logic
77
77
  */
78
- customMT?: CustomMTLogic;
78
+ customMT?: CustomMTLogic & ImagePath;
79
79
  /**
80
80
  * resources module
81
81
  */
@@ -92,6 +92,10 @@ export interface Config extends ImagePath {
92
92
  * project menu module
93
93
  */
94
94
  projectMenu?: UiModule;
95
+ /**
96
+ * project menu crowdsource module
97
+ */
98
+ projectMenuCrowdsource?: UiModule;
95
99
  /**
96
100
  * tools module
97
101
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.22.6",
3
+ "version": "0.23.1",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",