@bsv/overlay-express 0.1.5 → 0.1.7
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/cjs/package.json +1 -1
- package/dist/cjs/src/makeUserInterface.js +128 -19
- package/dist/cjs/src/makeUserInterface.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/makeUserInterface.js +128 -19
- package/dist/esm/src/makeUserInterface.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/makeUserInterface.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/makeUserInterface.ts +128 -19
package/src/makeUserInterface.ts
CHANGED
|
@@ -52,16 +52,13 @@ export default (config: UIConfig = {}): string => {
|
|
|
52
52
|
background-color: var(--background-color);
|
|
53
53
|
margin: 0;
|
|
54
54
|
padding: 0;
|
|
55
|
+
color: var(--primary-color);
|
|
55
56
|
}
|
|
56
57
|
|
|
57
58
|
h1, h2, h3 {
|
|
58
59
|
font-family: var(--heading-font-family);
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
* {
|
|
62
|
-
color: var(--primary-color);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
62
|
a {
|
|
66
63
|
color: var(--link-color);
|
|
67
64
|
text-decoration: none;
|
|
@@ -99,28 +96,80 @@ export default (config: UIConfig = {}): string => {
|
|
|
99
96
|
border-bottom: 1px solid var(--border-color);
|
|
100
97
|
}
|
|
101
98
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
li {
|
|
99
|
+
/* List styles */
|
|
100
|
+
.list-item {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
108
103
|
margin: 0.5em 0;
|
|
109
104
|
}
|
|
110
105
|
|
|
111
|
-
|
|
112
|
-
display:
|
|
106
|
+
.list-item a {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
width: 100%;
|
|
113
110
|
padding: 0.5em;
|
|
114
111
|
background-color: transparent;
|
|
115
112
|
border-radius: 5px;
|
|
116
113
|
transition: background-color 0.3s;
|
|
114
|
+
text-decoration: none;
|
|
115
|
+
color: inherit;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
|
-
|
|
118
|
+
.list-item a:hover {
|
|
120
119
|
background-color: var(--hover-color);
|
|
121
120
|
cursor: pointer;
|
|
122
121
|
}
|
|
123
122
|
|
|
123
|
+
.list-icon {
|
|
124
|
+
width: 40px;
|
|
125
|
+
height: 40px;
|
|
126
|
+
margin-right: 1em;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.list-text {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.list-title {
|
|
135
|
+
font-weight: bold;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.list-description {
|
|
139
|
+
font-size: 0.9em;
|
|
140
|
+
color: var(--secondary-color);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Detail styles */
|
|
144
|
+
.detail-header {
|
|
145
|
+
display: flex;
|
|
146
|
+
align-items: center;
|
|
147
|
+
margin-bottom: 1em;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.detail-icon {
|
|
151
|
+
width: 60px;
|
|
152
|
+
height: 60px;
|
|
153
|
+
margin-right: 1em;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.detail-text {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.detail-title {
|
|
162
|
+
margin: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.detail-description, .detail-version, .detail-info {
|
|
166
|
+
margin: 0.2em 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.detail-info a {
|
|
170
|
+
color: var(--link-color);
|
|
171
|
+
}
|
|
172
|
+
|
|
124
173
|
/* Responsive design */
|
|
125
174
|
@media screen and (max-width: 850px) {
|
|
126
175
|
.main {
|
|
@@ -141,6 +190,8 @@ export default (config: UIConfig = {}): string => {
|
|
|
141
190
|
</style>
|
|
142
191
|
<script src="https://cdn.jsdelivr.net/npm/showdown@2.0.3/dist/showdown.min.js"></script>
|
|
143
192
|
<script>
|
|
193
|
+
const faviconUrl = '${faviconUrl}';
|
|
194
|
+
|
|
144
195
|
const showdown = window.showdown;
|
|
145
196
|
|
|
146
197
|
const Convert = (md) => {
|
|
@@ -148,13 +199,30 @@ export default (config: UIConfig = {}): string => {
|
|
|
148
199
|
return converter.makeHtml(md);
|
|
149
200
|
};
|
|
150
201
|
|
|
202
|
+
let managersData = {};
|
|
203
|
+
let providersData = {};
|
|
204
|
+
|
|
151
205
|
window.managerDocumentation = async (manager) => {
|
|
152
206
|
try {
|
|
153
207
|
let res = await fetch(\`/getDocumentationForTopicManager?manager=\${manager}\`);
|
|
154
208
|
let docs = await res.text();
|
|
155
209
|
let managerReadme = Convert(docs);
|
|
210
|
+
|
|
211
|
+
let managerData = managersData[manager];
|
|
212
|
+
let iconURL = managerData.iconURL || faviconUrl;
|
|
213
|
+
|
|
156
214
|
document.getElementById('documentation_container').innerHTML = managerReadme;
|
|
157
|
-
document.getElementById('documentation_title').innerHTML =
|
|
215
|
+
document.getElementById('documentation_title').innerHTML = \`
|
|
216
|
+
<div class="detail-header">
|
|
217
|
+
<img src="\${iconURL}" alt="icon" class="detail-icon">
|
|
218
|
+
<div class="detail-text">
|
|
219
|
+
<h1 class="detail-title">\${managerData.name}</h1>
|
|
220
|
+
<p class="detail-description">\${managerData.shortDescription || ''}</p>
|
|
221
|
+
\${managerData.version ? '<p class="detail-version">Version: ' + managerData.version + '</p>' : ''}
|
|
222
|
+
\${managerData.informationURL ? '<p class="detail-info"><a href="' + managerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
|
|
223
|
+
</div>
|
|
224
|
+
</div>
|
|
225
|
+
\`;
|
|
158
226
|
} catch (error) {
|
|
159
227
|
console.error('Error fetching manager documentation:', error);
|
|
160
228
|
}
|
|
@@ -165,8 +233,22 @@ export default (config: UIConfig = {}): string => {
|
|
|
165
233
|
let res = await fetch(\`/getDocumentationForLookupServiceProvider?lookupServices=\${provider}\`);
|
|
166
234
|
let docs = await res.text();
|
|
167
235
|
let providerReadme = Convert(docs);
|
|
236
|
+
|
|
237
|
+
let providerData = providersData[provider];
|
|
238
|
+
let iconURL = providerData.iconURL || faviconUrl;
|
|
239
|
+
|
|
168
240
|
document.getElementById('documentation_container').innerHTML = providerReadme;
|
|
169
|
-
document.getElementById('documentation_title').innerHTML =
|
|
241
|
+
document.getElementById('documentation_title').innerHTML = \`
|
|
242
|
+
<div class="detail-header">
|
|
243
|
+
<img src="\${iconURL}" alt="icon" class="detail-icon">
|
|
244
|
+
<div class="detail-text">
|
|
245
|
+
<h1 class="detail-title">\${providerData.name}</h1>
|
|
246
|
+
<p class="detail-description">\${providerData.shortDescription || ''}</p>
|
|
247
|
+
\${providerData.version ? '<p class="detail-version">Version: ' + providerData.version + '</p>' : ''}
|
|
248
|
+
\${providerData.informationURL ? '<p class="detail-info"><a href="' + providerData.informationURL + '" target="_blank">More Information</a></p>' : ''}
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
\`;
|
|
170
252
|
} catch (error) {
|
|
171
253
|
console.error('Error fetching provider documentation:', error);
|
|
172
254
|
}
|
|
@@ -176,10 +258,22 @@ export default (config: UIConfig = {}): string => {
|
|
|
176
258
|
fetch('/listTopicManagers')
|
|
177
259
|
.then(res => res.json())
|
|
178
260
|
.then(managers => {
|
|
261
|
+
managersData = managers;
|
|
179
262
|
const managerList = document.getElementById('manager_list');
|
|
180
|
-
managers.forEach(manager => {
|
|
263
|
+
Object.keys(managers).forEach(manager => {
|
|
264
|
+
let managerData = managers[manager];
|
|
265
|
+
let iconURL = managerData.iconURL || faviconUrl;
|
|
181
266
|
let li = document.createElement('li');
|
|
182
|
-
li.
|
|
267
|
+
li.className = 'list-item';
|
|
268
|
+
li.innerHTML = \`
|
|
269
|
+
<a onclick="window.managerDocumentation('\${manager}')">
|
|
270
|
+
<img src="\${iconURL}" alt="icon" class="list-icon">
|
|
271
|
+
<div class="list-text">
|
|
272
|
+
<span class="list-title">\${managerData.name}</span>
|
|
273
|
+
<span class="list-description">\${managerData.shortDescription || ''}</span>
|
|
274
|
+
</div>
|
|
275
|
+
</a>
|
|
276
|
+
\`;
|
|
183
277
|
managerList.appendChild(li);
|
|
184
278
|
});
|
|
185
279
|
})
|
|
@@ -192,10 +286,22 @@ export default (config: UIConfig = {}): string => {
|
|
|
192
286
|
fetch('/listLookupServiceProviders')
|
|
193
287
|
.then(res => res.json())
|
|
194
288
|
.then(providers => {
|
|
289
|
+
providersData = providers;
|
|
195
290
|
const providerList = document.getElementById('provider_list');
|
|
196
|
-
providers.forEach(provider => {
|
|
291
|
+
Object.keys(providers).forEach(provider => {
|
|
292
|
+
let providerData = providers[provider];
|
|
293
|
+
let iconURL = providerData.iconURL || faviconUrl;
|
|
197
294
|
let li = document.createElement('li');
|
|
198
|
-
li.
|
|
295
|
+
li.className = 'list-item';
|
|
296
|
+
li.innerHTML = \`
|
|
297
|
+
<a onclick="window.topicDocumentation('\${provider}')">
|
|
298
|
+
<img src="\${iconURL}" alt="icon" class="list-icon">
|
|
299
|
+
<div class="list-text">
|
|
300
|
+
<span class="list-title">\${providerData.name}</span>
|
|
301
|
+
<span class="list-description">\${providerData.shortDescription || ''}</span>
|
|
302
|
+
</div>
|
|
303
|
+
</a>
|
|
304
|
+
\`;
|
|
199
305
|
providerList.appendChild(li);
|
|
200
306
|
});
|
|
201
307
|
})
|
|
@@ -204,6 +310,9 @@ export default (config: UIConfig = {}): string => {
|
|
|
204
310
|
message.innerText = 'Something went wrong!';
|
|
205
311
|
provider_list.insertBefore(message, provider_list.children[0]);
|
|
206
312
|
});
|
|
313
|
+
|
|
314
|
+
// Display default message when no manager or provider is selected
|
|
315
|
+
document.getElementById('documentation_container').innerHTML = '<p>Please select a manager or service from the left to see details.</p>';
|
|
207
316
|
});
|
|
208
317
|
</script>
|
|
209
318
|
</head>
|