@bsv/overlay-express 0.1.6 → 0.1.8

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.
@@ -27,16 +27,13 @@ exports.default = (config = {}) => {
27
27
  background-color: var(--background-color);
28
28
  margin: 0;
29
29
  padding: 0;
30
+ color: var(--primary-color);
30
31
  }
31
32
 
32
33
  h1, h2, h3 {
33
34
  font-family: var(--heading-font-family);
34
35
  }
35
36
 
36
- * {
37
- color: var(--primary-color);
38
- }
39
-
40
37
  a {
41
38
  color: var(--link-color);
42
39
  text-decoration: none;
@@ -74,28 +71,80 @@ exports.default = (config = {}) => {
74
71
  border-bottom: 1px solid var(--border-color);
75
72
  }
76
73
 
77
- ul {
78
- list-style-type: none;
79
- padding: 0;
80
- }
81
-
82
- li {
74
+ /* List styles */
75
+ .list-item {
76
+ display: flex;
77
+ align-items: center;
83
78
  margin: 0.5em 0;
84
79
  }
85
80
 
86
- li a {
87
- display: block;
81
+ .list-item a {
82
+ display: flex;
83
+ align-items: center;
84
+ width: 100%;
88
85
  padding: 0.5em;
89
86
  background-color: transparent;
90
87
  border-radius: 5px;
91
88
  transition: background-color 0.3s;
89
+ text-decoration: none;
90
+ color: inherit;
92
91
  }
93
92
 
94
- li a:hover {
93
+ .list-item a:hover {
95
94
  background-color: var(--hover-color);
96
95
  cursor: pointer;
97
96
  }
98
97
 
98
+ .list-icon {
99
+ width: 40px;
100
+ height: 40px;
101
+ margin-right: 1em;
102
+ }
103
+
104
+ .list-text {
105
+ display: flex;
106
+ flex-direction: column;
107
+ }
108
+
109
+ .list-title {
110
+ font-weight: bold;
111
+ }
112
+
113
+ .list-description {
114
+ font-size: 0.9em;
115
+ color: var(--secondary-color);
116
+ }
117
+
118
+ /* Detail styles */
119
+ .detail-header {
120
+ display: flex;
121
+ align-items: center;
122
+ margin-bottom: 1em;
123
+ }
124
+
125
+ .detail-icon {
126
+ width: 60px;
127
+ height: 60px;
128
+ margin-right: 1em;
129
+ }
130
+
131
+ .detail-text {
132
+ display: flex;
133
+ flex-direction: column;
134
+ }
135
+
136
+ .detail-title {
137
+ margin: 0;
138
+ }
139
+
140
+ .detail-description, .detail-version, .detail-info {
141
+ margin: 0.2em 0;
142
+ }
143
+
144
+ .detail-info a {
145
+ color: var(--link-color);
146
+ }
147
+
99
148
  /* Responsive design */
100
149
  @media screen and (max-width: 850px) {
101
150
  .main {
@@ -116,6 +165,8 @@ exports.default = (config = {}) => {
116
165
  </style>
117
166
  <script src="https://cdn.jsdelivr.net/npm/showdown@2.0.3/dist/showdown.min.js"></script>
118
167
  <script>
168
+ const faviconUrl = '${faviconUrl}';
169
+
119
170
  const showdown = window.showdown;
120
171
 
121
172
  const Convert = (md) => {
@@ -123,13 +174,30 @@ exports.default = (config = {}) => {
123
174
  return converter.makeHtml(md);
124
175
  };
125
176
 
177
+ let managersData = {};
178
+ let providersData = {};
179
+
126
180
  window.managerDocumentation = async (manager) => {
127
181
  try {
128
182
  let res = await fetch(\`/getDocumentationForTopicManager?manager=\${manager}\`);
129
183
  let docs = await res.text();
130
184
  let managerReadme = Convert(docs);
185
+
186
+ let managerData = managersData[manager];
187
+ let iconURL = managerData.iconURL || faviconUrl;
188
+
131
189
  document.getElementById('documentation_container').innerHTML = managerReadme;
132
- document.getElementById('documentation_title').innerHTML = \`<h1 class="docs_heading">\${manager} Topic Manager</h1>\`;
190
+ document.getElementById('documentation_title').innerHTML = \`
191
+ <div class="detail-header">
192
+ <img src="\${iconURL}" alt="icon" class="detail-icon">
193
+ <div class="detail-text">
194
+ <h1 class="detail-title">\${managerData.name}</h1>
195
+ <p class="detail-description">\${managerData.shortDescription || ''}</p>
196
+ \${managerData.version ? '<p class="detail-version">Version: ' + managerData.version + '</p>' : ''}
197
+ \${managerData.informationURL ? '<p class="detail-info"><a href="' + managerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
198
+ </div>
199
+ </div>
200
+ \`;
133
201
  } catch (error) {
134
202
  console.error('Error fetching manager documentation:', error);
135
203
  }
@@ -140,8 +208,22 @@ exports.default = (config = {}) => {
140
208
  let res = await fetch(\`/getDocumentationForLookupServiceProvider?lookupServices=\${provider}\`);
141
209
  let docs = await res.text();
142
210
  let providerReadme = Convert(docs);
211
+
212
+ let providerData = providersData[provider];
213
+ let iconURL = providerData.iconURL || faviconUrl;
214
+
143
215
  document.getElementById('documentation_container').innerHTML = providerReadme;
144
- document.getElementById('documentation_title').innerHTML = \`<h1 class="docs_heading">\${provider} Lookup Service</h1>\`;
216
+ document.getElementById('documentation_title').innerHTML = \`
217
+ <div class="detail-header">
218
+ <img src="\${iconURL}" alt="icon" class="detail-icon">
219
+ <div class="detail-text">
220
+ <h1 class="detail-title">\${providerData.name}</h1>
221
+ <p class="detail-description">\${providerData.shortDescription || ''}</p>
222
+ \${providerData.version ? '<p class="detail-version">Version: ' + providerData.version + '</p>' : ''}
223
+ \${providerData.informationURL ? '<p class="detail-info"><a href="' + providerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
224
+ </div>
225
+ </div>
226
+ \`;
145
227
  } catch (error) {
146
228
  console.error('Error fetching provider documentation:', error);
147
229
  }
@@ -151,10 +233,22 @@ exports.default = (config = {}) => {
151
233
  fetch('/listTopicManagers')
152
234
  .then(res => res.json())
153
235
  .then(managers => {
236
+ managersData = managers;
154
237
  const managerList = document.getElementById('manager_list');
155
- managers.forEach(manager => {
238
+ Object.keys(managers).forEach(manager => {
239
+ let managerData = managers[manager];
240
+ let iconURL = managerData.iconURL || faviconUrl;
156
241
  let li = document.createElement('li');
157
- li.innerHTML = \`<a onclick="window.managerDocumentation('\${manager}')">\${manager}</a>\`;
242
+ li.className = 'list-item';
243
+ li.innerHTML = \`
244
+ <a onclick="window.managerDocumentation('\${manager}')">
245
+ <img src="\${iconURL}" alt="icon" class="list-icon">
246
+ <div class="list-text">
247
+ <span class="list-title">\${managerData.name}</span>
248
+ <span class="list-description">\${managerData.shortDescription || ''}</span>
249
+ </div>
250
+ </a>
251
+ \`;
158
252
  managerList.appendChild(li);
159
253
  });
160
254
  })
@@ -167,10 +261,22 @@ exports.default = (config = {}) => {
167
261
  fetch('/listLookupServiceProviders')
168
262
  .then(res => res.json())
169
263
  .then(providers => {
264
+ providersData = providers;
170
265
  const providerList = document.getElementById('provider_list');
171
- providers.forEach(provider => {
266
+ Object.keys(providers).forEach(provider => {
267
+ let providerData = providers[provider];
268
+ let iconURL = providerData.iconURL || faviconUrl;
172
269
  let li = document.createElement('li');
173
- li.innerHTML = \`<a onclick="window.topicDocumentation('\${provider}')">\${provider}</a>\`;
270
+ li.className = 'list-item';
271
+ li.innerHTML = \`
272
+ <a onclick="window.topicDocumentation('\${provider}')">
273
+ <img src="\${iconURL}" alt="icon" class="list-icon">
274
+ <div class="list-text">
275
+ <span class="list-title">\${providerData.name}</span>
276
+ <span class="list-description">\${providerData.shortDescription || ''}</span>
277
+ </div>
278
+ </a>
279
+ \`;
174
280
  providerList.appendChild(li);
175
281
  });
176
282
  })
@@ -179,6 +285,9 @@ exports.default = (config = {}) => {
179
285
  message.innerText = 'Something went wrong!';
180
286
  provider_list.insertBefore(message, provider_list.children[0]);
181
287
  });
288
+
289
+ // Display default message when no manager or provider is selected
290
+ document.getElementById('documentation_container').innerHTML = '<p>Please select a manager or service from the left to see details.</p>';
182
291
  });
183
292
  </script>
184
293
  </head>
@@ -1 +1 @@
1
- {"version":3,"file":"makeUserInterface.js","sourceRoot":"","sources":["../../../src/makeUserInterface.ts"],"names":[],"mappings":";;AAcA,kBAAe,CAAC,SAAmB,EAAE,EAAU,EAAE;IAC/C,MAAM,EACJ,UAAU,GAAG,uCAAuC,EACpD,eAAe,GAAG,SAAS,EAC3B,YAAY,GAAG,SAAS,EACxB,cAAc,GAAG,SAAS,EAC1B,UAAU,GAAG,mBAAmB,EAChC,iBAAiB,GAAG,iCAAiC,EACrD,gBAAgB,GAAG,EAAE,EACrB,sBAAsB,GAAG,SAAS,EAClC,SAAS,GAAG,SAAS,EACrB,UAAU,GAAG,SAAS,EACtB,W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