@crowdin/app-project-module 0.86.1 → 0.88.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/types.d.ts CHANGED
@@ -72,6 +72,10 @@ export interface ClientConfig extends ImagePath {
72
72
  * app description
73
73
  */
74
74
  description: string;
75
+ /**
76
+ * link to the app's description/detail page
77
+ */
78
+ detailPage?: string;
75
79
  /**
76
80
  * Set default app permissions
77
81
  */
@@ -39,5 +39,8 @@ exports.engine = (0, express_handlebars_1.default)({
39
39
  or: function (a, b, options) {
40
40
  return a || b ? options.fn(this) : options.inverse(this);
41
41
  },
42
+ incrementedIndex: function (index) {
43
+ return index + 1;
44
+ },
42
45
  },
43
46
  });
@@ -0,0 +1,102 @@
1
+ <html>
2
+ <head>
3
+ <title>{{name}}</title>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+
8
+ {{#if storeLink}}
9
+ <link rel="canonical" href="{{storeLink}}">
10
+ {{/if}}
11
+
12
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
13
+ <link href="/assets/css/about.css" media="screen" rel="stylesheet" type="text/css">
14
+ </head>
15
+ <body>
16
+ <header id="header" class="navbar navbar-expand-lg fixed-top crowdin-navbar">
17
+ <a itemprop="url" class="navbar-brand crowdin-navbar__logo" href="https://crowdin.com" title="Crowdin — Localization Management Platform">
18
+ <svg class="d-none d-md-block d-lg-block default-logo" width="180" height="54" aria-labelledby="crowdinLogoTitle">
19
+ <title id="crowdinLogoTitle">Crowdin</title>
20
+ <image class="d-none d-md-block d-lg-block" href="/assets/img/crowdin.svg" width="180" height="54" alt="Crowdin" />
21
+ </svg>
22
+ <svg class="d-block d-md-none d-lg-none default-logo" width="173" height="32">
23
+ <image class="d-block d-md-none d-lg-none" href="/assets/img/crowdin_small.svg" width="173" height="32" alt="Crowdin"/>
24
+ </svg>
25
+ </a>
26
+ <div class="flex-nowrap justify-content-lg-end ml-auto my-lg-0">
27
+ <div class="pr-0 ml-2 my-2">
28
+ <span class="crowdin-navbar__nav-link contact ">
29
+ <a title="Contact" href="https://crowdin.com/contacts">Contact</a>
30
+ </span>
31
+ </div>
32
+ </div>
33
+ </header>
34
+ <div class="main">
35
+ <div class="container">
36
+ <div class="row crwd__product-template__header align-items-center">
37
+
38
+ <div class="offset-lg-1 col-lg-2 product-single__photo-wrapper crwd__product-single__photo-wrapper">
39
+ <div class="product-single__photo text-center mb-3 mb-lg-0">
40
+ <div class="image-holder">
41
+ <img width="200" src="{{logo}}" alt="{{name}}" id="FeaturedImage-product-template" class="img-fluid lazyloaded ls-is-cached product-featured-img" style="position: unset;">
42
+ </div>
43
+ </div>
44
+ </div>
45
+ <div class=" col-lg-8 crwd__product-template__header__title-container">
46
+ <div class="product-single__meta">
47
+ <div class="section-header">
48
+ <h1 class="product-single__title text-center text-lg-left">
49
+ <span>{{name}}</span>
50
+ </h1>
51
+ <div class="description">
52
+ {{name}} extends the default functionality available in Crowdin and Crowdin Enterprise by providing additional capabilities to enhance your localization workflows.
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <div class="row">
59
+ <div class="offset-lg-1 col-lg-10">
60
+ <p>To install this app, you can use either of the following methods: </p>
61
+ <ol>
62
+ <li>Install it directly from the <a href="https://store.crowdin.com/" target="_blank">Crowdin Store</a>, if available.</li>
63
+ <li>Install it manually using the manifest URL below.</li>
64
+ </ol>
65
+ <p>For detailed steps, follow the <a href="https://support.crowdin.com/developer/crowdin-apps-installation/" target="_blank">App Installation</a></p>
66
+
67
+ <div class="mb-3">
68
+ <label for="manifest-url" class="form-label">Paste the following manifest URL when prompted during manual installation:</label>
69
+ <div class="input-group">
70
+ <input
71
+ type="text"
72
+ class="form-control"
73
+ id="manifest-url"
74
+ value="{{manifest}}"
75
+ readonly
76
+ >
77
+ <button class="btn btn-outline-secondary" type="button" id="copy-button">
78
+ Copy
79
+ </button>
80
+ </div>
81
+ </div>
82
+
83
+
84
+
85
+ {{#if storeLink}}
86
+ <div>Read more about <a href="{{storeLink}}" target="_blank" title="{{name}} on Crowdin Store">{{name}}</a>.</div>
87
+ {{/if}}
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </body>
93
+ <script>
94
+ document.getElementById('copy-button').addEventListener('click', async () => {
95
+ const text = document.getElementById('manifest-url').value;
96
+ await navigator.clipboard.writeText(text);
97
+ const btn = document.getElementById('copy-button');
98
+ btn.textContent = 'Copied!';
99
+ setTimeout(() => btn.textContent = 'Copy', 1500);
100
+ });
101
+ </script>
102
+ </html>
@@ -258,7 +258,11 @@
258
258
  <crowdin-progress-indicator></crowdin-progress-indicator>
259
259
  </div>
260
260
  <div id="modal-content">
261
+ <crowdin-tabs tabs-config='[{{#each configurationFields}}"{{name}}"{{#unless @last}},{{/unless}}{{/each}}]' active-tab="1">
261
262
  {{#each configurationFields}}
263
+ <div slot="tab-{{incrementedIndex @index}}">
264
+ <div class="crowdin-form">
265
+ {{#each fields}}
262
266
  {{#if key}}
263
267
  {{#ifeq type "checkbox"}}
264
268
  <crowdin-checkbox
@@ -395,7 +399,11 @@
395
399
  data-dependency="{{dependencySettings}}"
396
400
  {{/if}}
397
401
  ></div>
402
+ {{/each}}
403
+ </div>
404
+ </div>
398
405
  {{/each}}
406
+ </crowdin-tabs>
399
407
  </div>
400
408
  <div slot="footer">
401
409
  <crowdin-button id="settings-save-btn" outlined onclick="saveSettings()">Save</crowdin-button>
@@ -529,6 +537,8 @@
529
537
  id: e.id,
530
538
  customContent: e.customContent,
531
539
  labels: e.labels,
540
+ disabled: e.disabled,
541
+ tooltip: e.tooltip,
532
542
  };
533
543
  if (e.type) {
534
544
  item.type = e.type;
@@ -584,6 +594,8 @@
584
594
  id: e.id,
585
595
  customContent: e.customContent,
586
596
  labels: e.labels,
597
+ disabled: e.disabled,
598
+ tooltip: e.tooltip,
587
599
  };
588
600
  if (e.type) {
589
601
  item.isNew = e.isNew;
@@ -1178,26 +1190,31 @@
1178
1190
 
1179
1191
  function saveSettings() {
1180
1192
  setLoader('#settings-modal');
1181
- const settingsElements = Array.from(document.getElementById('modal-content').children);
1193
+ const settingsElements = Array.from(document.querySelectorAll('#modal-content crowdin-tabs > div'));
1182
1194
  const tags = ['crowdin-checkbox', 'crowdin-select', 'crowdin-input', 'crowdin-textarea'];
1183
1195
  const configReq = {};
1184
- settingsElements
1185
- .filter(e => tags.includes(e.tagName.toLowerCase()))
1186
- .forEach(e => {
1187
- const key = e.getAttribute('key');
1188
- let value;
1189
- if (e.tagName.toLowerCase() === 'crowdin-select') {
1190
- value = JSON.parse(e.value);
1191
- if (!e.hasAttribute('is-multi')) {
1192
- value = value.length > 0 ? value[0] : undefined;
1196
+
1197
+ settingsElements.forEach(tab => {
1198
+ const formElements = Array.from(tab.querySelectorAll('.crowdin-form > *'));
1199
+ formElements
1200
+ .filter(e => tags.includes(e.tagName.toLowerCase()))
1201
+ .forEach(e => {
1202
+ const key = e.getAttribute('key');
1203
+ let value;
1204
+ if (e.tagName.toLowerCase() === 'crowdin-select') {
1205
+ value = JSON.parse(e.value);
1206
+ if (!e.hasAttribute('is-multi')) {
1207
+ value = value.length > 0 ? value[0] : undefined;
1208
+ }
1209
+ } else if (e.tagName.toLowerCase() === 'crowdin-checkbox') {
1210
+ value = !!e.checked;
1211
+ } else {
1212
+ value = e.value;
1193
1213
  }
1194
- } else if (e.tagName.toLowerCase() === 'crowdin-checkbox') {
1195
- value = !!e.checked;
1196
- } else {
1197
- value = e.value;
1198
- }
1199
- configReq[key] = value;
1200
- });
1214
+ configReq[key] = value;
1215
+ });
1216
+ });
1217
+
1201
1218
  settingsSaveBtn.setAttribute('disabled', true);
1202
1219
  checkOrigin()
1203
1220
  .then(restParams => fetch('api/settings' + restParams, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.86.1",
3
+ "version": "0.88.0",
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",