@bsv/overlay-express 0.8.1 → 0.8.2-rc1
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 +13 -13
- package/dist/cjs/src/OverlayExpress.js +27 -86
- package/dist/cjs/src/OverlayExpress.js.map +1 -1
- package/dist/cjs/src/makeUserInterface.js +93 -290
- package/dist/cjs/src/makeUserInterface.js.map +1 -1
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/src/OverlayExpress.js +21 -80
- package/dist/esm/src/OverlayExpress.js.map +1 -1
- package/dist/esm/src/makeUserInterface.js +93 -287
- package/dist/esm/src/makeUserInterface.js.map +1 -1
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/types/src/OverlayExpress.d.ts +3 -15
- package/dist/types/src/OverlayExpress.d.ts.map +1 -1
- package/dist/types/src/makeUserInterface.d.ts +2 -7
- package/dist/types/src/makeUserInterface.d.ts.map +1 -1
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/cjs/src/JanitorService.js +0 -215
- package/dist/cjs/src/JanitorService.js.map +0 -1
- package/dist/cjs/src/generalGuide.md.js +0 -77
- package/dist/cjs/src/generalGuide.md.js.map +0 -1
- package/dist/esm/src/JanitorService.js +0 -211
- package/dist/esm/src/JanitorService.js.map +0 -1
- package/dist/esm/src/generalGuide.md.js +0 -75
- package/dist/esm/src/generalGuide.md.js.map +0 -1
- package/dist/types/src/JanitorService.d.ts +0 -59
- package/dist/types/src/JanitorService.d.ts.map +0 -1
- package/dist/types/src/generalGuide.md.d.ts +0 -3
- package/dist/types/src/generalGuide.md.d.ts.map +0 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
import generalGuide from './generalGuide.md.js';
|
|
3
1
|
export default (config = {}) => {
|
|
4
|
-
const {
|
|
2
|
+
const { faviconUrl = 'https://bsvblockchain.org/favicon.ico', backgroundColor = '#282E33', primaryColor = '#B6C2CF', secondaryColor = '#579DFF', fontFamily = 'Arial, sans-serif', headingFontFamily = 'Arial Black, Gadget, sans-serif', additionalStyles = '', sectionBackgroundColor = '#323940', linkColor = '#579DFF', hoverColor = '#3A4147', borderColor = '#B6C2CF', } = config;
|
|
5
3
|
return `<!DOCTYPE html>
|
|
6
4
|
<html>
|
|
7
5
|
<head>
|
|
@@ -20,9 +18,6 @@ export default (config = {}) => {
|
|
|
20
18
|
--link-color: ${linkColor};
|
|
21
19
|
--hover-color: ${hoverColor};
|
|
22
20
|
--border-color: ${borderColor};
|
|
23
|
-
--secondary-background-color: ${secondaryBackgroundColor};
|
|
24
|
-
--secondary-text-color: ${secondaryTextColor};
|
|
25
|
-
--primary-text-color: ${primaryTextColor};
|
|
26
21
|
}
|
|
27
22
|
|
|
28
23
|
body {
|
|
@@ -30,24 +25,13 @@ export default (config = {}) => {
|
|
|
30
25
|
background-color: var(--background-color);
|
|
31
26
|
margin: 0;
|
|
32
27
|
padding: 0;
|
|
33
|
-
color: var(--primary-
|
|
28
|
+
color: var(--primary-color);
|
|
34
29
|
}
|
|
35
30
|
|
|
36
31
|
h1, h2, h3 {
|
|
37
32
|
font-family: var(--heading-font-family);
|
|
38
33
|
}
|
|
39
34
|
|
|
40
|
-
p {
|
|
41
|
-
line-height: 1.5;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.welcome {
|
|
45
|
-
background-clip: text;
|
|
46
|
-
color: transparent;
|
|
47
|
-
background-image: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
|
|
48
|
-
cursor: pointer;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
35
|
a {
|
|
52
36
|
color: var(--link-color);
|
|
53
37
|
text-decoration: none;
|
|
@@ -64,57 +48,69 @@ export default (config = {}) => {
|
|
|
64
48
|
overflow: hidden;
|
|
65
49
|
}
|
|
66
50
|
|
|
67
|
-
.column_right {
|
|
51
|
+
.column_left, .column_right {
|
|
68
52
|
padding: 1.5em;
|
|
69
53
|
overflow-y: auto;
|
|
70
54
|
}
|
|
71
55
|
|
|
72
56
|
.column_left {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
width: 360px;
|
|
76
|
-
background-color: var(--secondary-background-color);
|
|
77
|
-
color: var(--secondary-text-color);
|
|
57
|
+
width: 35%;
|
|
58
|
+
background-color: var(--section-background-color);
|
|
78
59
|
}
|
|
79
60
|
|
|
80
61
|
.column_right {
|
|
81
|
-
width:
|
|
62
|
+
width: 65%;
|
|
63
|
+
border-left: 1px solid var(--border-color);
|
|
82
64
|
}
|
|
83
65
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
66
|
+
.docs_heading {
|
|
67
|
+
text-align: center;
|
|
68
|
+
padding-bottom: 0.5em;
|
|
69
|
+
border-bottom: 1px solid var(--border-color);
|
|
87
70
|
}
|
|
88
71
|
|
|
89
72
|
/* List styles */
|
|
90
73
|
.list-item {
|
|
91
|
-
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
margin: 0.5em 0;
|
|
92
77
|
}
|
|
93
78
|
|
|
94
79
|
.list-item a {
|
|
95
|
-
display:
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
96
82
|
width: 100%;
|
|
97
|
-
padding: 0.5em
|
|
83
|
+
padding: 0.5em;
|
|
98
84
|
background-color: transparent;
|
|
99
85
|
border-radius: 5px;
|
|
100
86
|
transition: background-color 0.3s;
|
|
101
87
|
text-decoration: none;
|
|
102
88
|
color: inherit;
|
|
103
|
-
font-weight: 500;
|
|
104
|
-
cursor: pointer;
|
|
105
89
|
}
|
|
106
90
|
|
|
107
|
-
.list-item a:hover
|
|
108
|
-
background
|
|
109
|
-
color: white;
|
|
91
|
+
.list-item a:hover {
|
|
92
|
+
background-color: var(--hover-color);
|
|
110
93
|
cursor: pointer;
|
|
111
|
-
border-radius: 8px 0 0 8px;
|
|
112
94
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
margin-
|
|
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);
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
/* Detail styles */
|
|
@@ -147,186 +143,41 @@ export default (config = {}) => {
|
|
|
147
143
|
color: var(--link-color);
|
|
148
144
|
}
|
|
149
145
|
|
|
150
|
-
/* Code highlighting styles */
|
|
151
|
-
pre {
|
|
152
|
-
position: relative;
|
|
153
|
-
padding: 1em;
|
|
154
|
-
border-radius: 5px;
|
|
155
|
-
overflow: auto;
|
|
156
|
-
background-color: #282c34;
|
|
157
|
-
margin: 1em 0;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
pre[data-language]:before {
|
|
161
|
-
content: attr(data-language);
|
|
162
|
-
position: absolute;
|
|
163
|
-
top: 0;
|
|
164
|
-
right: 0;
|
|
165
|
-
padding: 0.25em 0.5em;
|
|
166
|
-
font-size: 0.75em;
|
|
167
|
-
color: #abb2bf;
|
|
168
|
-
background-color: #3e4451;
|
|
169
|
-
border-radius: 0 0 0 4px;
|
|
170
|
-
text-transform: uppercase;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
code {
|
|
174
|
-
font-family: Menlo, Monaco, 'Courier New', monospace;
|
|
175
|
-
font-size: 0.9em;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* Inline code */
|
|
179
|
-
p code, li code {
|
|
180
|
-
background-color: #3e4451;
|
|
181
|
-
padding: 0.2em 0.4em;
|
|
182
|
-
border-radius: 3px;
|
|
183
|
-
white-space: nowrap;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
146
|
/* Responsive design */
|
|
187
147
|
@media screen and (max-width: 850px) {
|
|
188
148
|
.main {
|
|
189
149
|
flex-direction: column;
|
|
190
150
|
}
|
|
191
151
|
|
|
192
|
-
.column_left {
|
|
193
|
-
max-height: 30vh;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
152
|
.column_left, .column_right {
|
|
197
|
-
width:
|
|
198
|
-
margin: 0;
|
|
199
|
-
padding: 0 5%;
|
|
153
|
+
width: 100%;
|
|
200
154
|
}
|
|
201
155
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
156
|
+
.column_right {
|
|
157
|
+
border-left: none;
|
|
158
|
+
border-top: 1px solid var(--border-color);
|
|
205
159
|
}
|
|
206
160
|
}
|
|
207
161
|
|
|
208
162
|
${additionalStyles}
|
|
209
163
|
</style>
|
|
210
164
|
<script src="https://cdn.jsdelivr.net/npm/showdown@2.0.3/dist/showdown.min.js"></script>
|
|
211
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/styles/atom-one-dark.min.css">
|
|
212
|
-
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.7.0/build/highlight.min.js"></script>
|
|
213
165
|
<script>
|
|
214
166
|
const faviconUrl = '${faviconUrl}';
|
|
215
167
|
|
|
216
168
|
const showdown = window.showdown;
|
|
217
|
-
window.hljs.configure({ languages: ['typescript', 'javascript', 'json', 'html', 'css', 'bash', 'markdown'] });
|
|
218
|
-
|
|
219
169
|
|
|
220
170
|
const Convert = (md) => {
|
|
221
|
-
let converter = new showdown.Converter(
|
|
222
|
-
|
|
223
|
-
simpleLineBreaks: true,
|
|
224
|
-
ghMentions: true,
|
|
225
|
-
tables: true,
|
|
226
|
-
tasklists: true,
|
|
227
|
-
strikethrough: true,
|
|
228
|
-
parseImgDimensions: true,
|
|
229
|
-
simplifiedAutoLink: true
|
|
230
|
-
});
|
|
231
|
-
// Set to use GitHub flavor markdown
|
|
232
|
-
converter.setFlavor('github');
|
|
233
|
-
|
|
234
|
-
// Set language detection for code blocks
|
|
235
|
-
converter.setOption('ghCodeBlocks', true);
|
|
236
|
-
converter.setOption('omitExtraWLInCodeBlocks', true);
|
|
237
|
-
converter.setOption('literalMidWordUnderscores', true);
|
|
238
|
-
converter.setOption('parseImgDimensions', true);
|
|
239
|
-
|
|
240
|
-
// Add custom extension for adding language-specific class to code blocks
|
|
241
|
-
const codeExtension = () => [
|
|
242
|
-
{
|
|
243
|
-
type: 'output',
|
|
244
|
-
filter: function(text) {
|
|
245
|
-
return text.replace(/<pre><code\s*class="([^"]*)">(.*?)<\\/code><\\/pre>/gs, function(match, language, content) {
|
|
246
|
-
if (language) {
|
|
247
|
-
// Clean up the language identifier
|
|
248
|
-
const lang = language.replace('language-', '').trim();
|
|
249
|
-
return \`<pre data-language="\${lang}"><code class="language-\${lang} hljs">\${content}</code></pre>\`;
|
|
250
|
-
} else {
|
|
251
|
-
return \`<pre><code class="hljs">\${content}</code></pre>\`;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
];
|
|
257
|
-
|
|
258
|
-
// Add the extension
|
|
259
|
-
converter.addExtension(codeExtension());
|
|
260
|
-
const html = converter.makeHtml(md);
|
|
261
|
-
|
|
262
|
-
return html;
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
window.returnHome = () => {
|
|
266
|
-
if (!window.defaultHtml) {
|
|
267
|
-
let newStuff = Convert(${defaultContent});
|
|
268
|
-
window.defaultHtml = newStuff;
|
|
269
|
-
}
|
|
270
|
-
document.getElementById('documentation_container').innerHTML = window.defaultHtml;
|
|
271
|
-
window.location.hash = '';
|
|
272
|
-
document.querySelectorAll('.list-item a').forEach(item => {
|
|
273
|
-
item.classList.remove('active');
|
|
274
|
-
});
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
// Function to apply syntax highlighting after content is inserted
|
|
278
|
-
const applyHighlighting = () => {
|
|
279
|
-
document.querySelectorAll('pre code').forEach(block => {
|
|
280
|
-
const blockElement = block;
|
|
281
|
-
|
|
282
|
-
// Check for language class
|
|
283
|
-
const classList = Array.from(blockElement.classList);
|
|
284
|
-
const langClass = classList.find(cls => cls.startsWith('language-'));
|
|
285
|
-
|
|
286
|
-
if (langClass) {
|
|
287
|
-
const language = langClass.replace('language-', '');
|
|
288
|
-
// Set language label on the parent pre element
|
|
289
|
-
const preElement = blockElement.parentElement;
|
|
290
|
-
if (preElement) {
|
|
291
|
-
preElement.setAttribute('data-language', language);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
// Apply highlighting to all code blocks
|
|
296
|
-
try {
|
|
297
|
-
// @ts-ignore - hljs is loaded from CDN
|
|
298
|
-
window.hljs.highlightElement(blockElement);
|
|
299
|
-
} catch (e) {
|
|
300
|
-
console.error('Error highlighting code:', e);
|
|
301
|
-
}
|
|
302
|
-
});
|
|
171
|
+
let converter = new showdown.Converter();
|
|
172
|
+
return converter.makeHtml(md);
|
|
303
173
|
};
|
|
304
174
|
|
|
305
175
|
let managersData = {};
|
|
306
176
|
let providersData = {};
|
|
307
177
|
|
|
308
|
-
// Function to update URL hash and highlight selected item
|
|
309
|
-
const updateSelectedItem = (type, id) => {
|
|
310
|
-
// Update URL hash
|
|
311
|
-
window.location.hash = \`\${type}/\${id}\`;
|
|
312
|
-
|
|
313
|
-
// Remove active class from all list items
|
|
314
|
-
document.querySelectorAll('.list-item a').forEach(item => {
|
|
315
|
-
item.classList.remove('active');
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
// Add active class to selected item
|
|
319
|
-
const selector = \`[data-\${type}="\${id}"]\`;
|
|
320
|
-
const selectedItem = document.querySelector(selector);
|
|
321
|
-
if (selectedItem) {
|
|
322
|
-
selectedItem.classList.add('active');
|
|
323
|
-
}
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
// @ts-ignore - Adding custom property to window
|
|
327
178
|
window.managerDocumentation = async (manager) => {
|
|
328
179
|
try {
|
|
329
|
-
let res = await fetch(
|
|
180
|
+
let res = await fetch(\`/getDocumentationForTopicManager?manager=\${manager}\`);
|
|
330
181
|
let docs = await res.text();
|
|
331
182
|
let managerReadme = Convert(docs);
|
|
332
183
|
|
|
@@ -334,19 +185,25 @@ export default (config = {}) => {
|
|
|
334
185
|
let iconURL = managerData.iconURL || faviconUrl;
|
|
335
186
|
|
|
336
187
|
document.getElementById('documentation_container').innerHTML = managerReadme;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
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
|
+
\`;
|
|
341
199
|
} catch (error) {
|
|
342
200
|
console.error('Error fetching manager documentation:', error);
|
|
343
201
|
}
|
|
344
202
|
};
|
|
345
203
|
|
|
346
|
-
// @ts-ignore - Adding custom property to window
|
|
347
204
|
window.topicDocumentation = async (provider) => {
|
|
348
205
|
try {
|
|
349
|
-
let res = await fetch(
|
|
206
|
+
let res = await fetch(\`/getDocumentationForLookupServiceProvider?lookupService=\${provider}\`);
|
|
350
207
|
let docs = await res.text();
|
|
351
208
|
let providerReadme = Convert(docs);
|
|
352
209
|
|
|
@@ -354,127 +211,81 @@ export default (config = {}) => {
|
|
|
354
211
|
let iconURL = providerData.iconURL || faviconUrl;
|
|
355
212
|
|
|
356
213
|
document.getElementById('documentation_container').innerHTML = providerReadme;
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
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
|
+
\`;
|
|
361
225
|
} catch (error) {
|
|
362
226
|
console.error('Error fetching provider documentation:', error);
|
|
363
227
|
}
|
|
364
228
|
};
|
|
365
229
|
|
|
366
|
-
// Function to parse hash and load appropriate content
|
|
367
|
-
const handleUrlHash = () => {
|
|
368
|
-
const hash = window.location.hash.substring(1); // Remove the # character
|
|
369
|
-
if (hash) {
|
|
370
|
-
const [type, id] = hash.split('/');
|
|
371
|
-
if (type && id) {
|
|
372
|
-
if (type === 'manager') {
|
|
373
|
-
// Check if managers data is loaded
|
|
374
|
-
if (Object.keys(managersData).length > 0 && managersData[id]) {
|
|
375
|
-
window.managerDocumentation(id);
|
|
376
|
-
}
|
|
377
|
-
} else if (type === 'provider') {
|
|
378
|
-
// Check if providers data is loaded
|
|
379
|
-
if (Object.keys(providersData).length > 0 && providersData[id]) {
|
|
380
|
-
window.topicDocumentation(id);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
};
|
|
386
|
-
|
|
387
230
|
document.addEventListener('DOMContentLoaded', () => {
|
|
388
|
-
|
|
389
|
-
let providersLoaded = false;
|
|
390
|
-
|
|
391
|
-
// Check if both managers and providers are loaded before handling hash
|
|
392
|
-
const checkAllLoaded = () => {
|
|
393
|
-
if (managersLoaded && providersLoaded) {
|
|
394
|
-
handleUrlHash();
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
|
|
398
|
-
fetch('${host}/listTopicManagers')
|
|
231
|
+
fetch('/listTopicManagers')
|
|
399
232
|
.then(res => res.json())
|
|
400
233
|
.then(managers => {
|
|
401
234
|
managersData = managers;
|
|
402
235
|
const managerList = document.getElementById('manager_list');
|
|
403
236
|
Object.keys(managers).forEach(manager => {
|
|
404
237
|
let managerData = managers[manager];
|
|
238
|
+
let iconURL = managerData.iconURL || faviconUrl;
|
|
405
239
|
let li = document.createElement('li');
|
|
406
240
|
li.className = 'list-item';
|
|
407
241
|
li.innerHTML = \`
|
|
408
|
-
<a
|
|
409
|
-
\${
|
|
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>
|
|
410
248
|
</a>
|
|
411
249
|
\`;
|
|
412
250
|
managerList.appendChild(li);
|
|
413
251
|
});
|
|
414
|
-
managersLoaded = true;
|
|
415
|
-
checkAllLoaded();
|
|
416
252
|
})
|
|
417
253
|
.catch(() => {
|
|
418
254
|
let message = document.createElement('h4');
|
|
419
255
|
message.innerText = 'Something went wrong!';
|
|
420
256
|
manager_list.insertBefore(message, manager_list.children[0]);
|
|
421
|
-
managersLoaded = true;
|
|
422
|
-
checkAllLoaded();
|
|
423
257
|
});
|
|
424
258
|
|
|
425
|
-
fetch('
|
|
259
|
+
fetch('/listLookupServiceProviders')
|
|
426
260
|
.then(res => res.json())
|
|
427
261
|
.then(providers => {
|
|
428
262
|
providersData = providers;
|
|
429
263
|
const providerList = document.getElementById('provider_list');
|
|
430
264
|
Object.keys(providers).forEach(provider => {
|
|
431
265
|
let providerData = providers[provider];
|
|
266
|
+
let iconURL = providerData.iconURL || faviconUrl;
|
|
432
267
|
let li = document.createElement('li');
|
|
433
268
|
li.className = 'list-item';
|
|
434
269
|
li.innerHTML = \`
|
|
435
|
-
<a
|
|
436
|
-
\${
|
|
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>
|
|
437
276
|
</a>
|
|
438
277
|
\`;
|
|
439
278
|
providerList.appendChild(li);
|
|
440
279
|
});
|
|
441
|
-
providersLoaded = true;
|
|
442
|
-
checkAllLoaded();
|
|
443
280
|
})
|
|
444
281
|
.catch(() => {
|
|
445
282
|
let message = document.createElement('h4');
|
|
446
283
|
message.innerText = 'Something went wrong!';
|
|
447
284
|
provider_list.insertBefore(message, provider_list.children[0]);
|
|
448
|
-
providersLoaded = true;
|
|
449
|
-
checkAllLoaded();
|
|
450
285
|
});
|
|
451
286
|
|
|
452
|
-
//
|
|
453
|
-
|
|
454
|
-
const hash = window.location.hash.substring(1); // Remove the # symbol
|
|
455
|
-
if (hash) {
|
|
456
|
-
const parts = hash.split('/');
|
|
457
|
-
if (parts.length === 2) {
|
|
458
|
-
const type = parts[0];
|
|
459
|
-
const id = parts[1];
|
|
460
|
-
|
|
461
|
-
if (type === 'manager' && id && managersData[id]) {
|
|
462
|
-
window.managerDocumentation(id);
|
|
463
|
-
} else if (type === 'provider' && id && providersData[id]) {
|
|
464
|
-
window.topicDocumentation(id);
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
} else {
|
|
468
|
-
// Display default message when no manager or provider is selected
|
|
469
|
-
returnHome();
|
|
470
|
-
}
|
|
471
|
-
};
|
|
472
|
-
|
|
473
|
-
// Listen for hash changes
|
|
474
|
-
window.addEventListener('hashchange', checkUrlHash);
|
|
475
|
-
|
|
476
|
-
// Check hash on initial page load
|
|
477
|
-
checkUrlHash();
|
|
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>';
|
|
478
289
|
});
|
|
479
290
|
</script>
|
|
480
291
|
</head>
|
|
@@ -483,27 +294,22 @@ export default (config = {}) => {
|
|
|
483
294
|
<div class="main">
|
|
484
295
|
<div class="column_left">
|
|
485
296
|
<div class="page_head">
|
|
486
|
-
<h1
|
|
297
|
+
<h1>Welcome to Overlay Services</h1>
|
|
298
|
+
<p>Learn more on <a href="https://github.com/bitcoin-sv/overlay-services" target="_blank">GitHub</a></p>
|
|
487
299
|
</div>
|
|
488
300
|
<div class="topic_container">
|
|
489
|
-
<
|
|
301
|
+
<h2>Endpoint Documentation:</h2>
|
|
302
|
+
<h3>Supported Topic Managers:</h3>
|
|
490
303
|
<ul id="manager_list"></ul>
|
|
491
304
|
</div>
|
|
492
305
|
<div class="provider_container">
|
|
493
|
-
<h3>Lookup
|
|
306
|
+
<h3>Supported Lookup Service Providers:</h3>
|
|
494
307
|
<ul id="provider_list"></ul>
|
|
495
308
|
</div>
|
|
496
|
-
<div>
|
|
497
|
-
<h3>External Links</h3>
|
|
498
|
-
<ul id="external_list">
|
|
499
|
-
<li class="list-item"><a href="https://github.com/bsv-blockchain/overlay-services" target="_blank">Overlay Services GitHub</a></li>
|
|
500
|
-
<li class="list-item"><a href="https://bsv.brc.dev/transactions/0076" target="_blank">BRC-76 GASP</a></li>
|
|
501
|
-
<li class="list-item"><a href="https://fast.brc.dev" target="_blank">Quick Start for App Developers</a></li>
|
|
502
|
-
</ul>
|
|
503
|
-
</div>
|
|
504
309
|
</div>
|
|
505
310
|
<div class="column_right">
|
|
506
|
-
<div id="
|
|
311
|
+
<div id="documentation_title"></div>
|
|
312
|
+
<div id="documentation_container" style="margin-left: 1.5em"></div>
|
|
507
313
|
</div>
|
|
508
314
|
</div>
|
|
509
315
|
</body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeUserInterface.js","sourceRoot":"","sources":["../../../src/makeUserInterface.ts"],"names":[],"mappings":"
|
|
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"}
|