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