@digital-ai/dot-illustrations 2.0.40 → 2.0.42
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/demo/github-upload.js +16 -4
- package/demo/index.html +7 -0
- package/demo/script.js +13 -18
- package/package.json +1 -1
package/demo/github-upload.js
CHANGED
|
@@ -295,14 +295,26 @@ async function ghCreateIntegrationPR(id, svgBuf) {
|
|
|
295
295
|
// ─── Utility: append an ID to a JS array in source text ──────────────────────
|
|
296
296
|
|
|
297
297
|
function appendToJsArray(source, arrayName, id) {
|
|
298
|
-
//
|
|
298
|
+
// Insert id alphabetically into the named array
|
|
299
299
|
const re = new RegExp(`(const ${arrayName} = \\[)([\\s\\S]*?)(\\s*\\];)`, 'm');
|
|
300
300
|
const match = source.match(re);
|
|
301
301
|
if (!match) return source;
|
|
302
|
+
|
|
302
303
|
const body = match[2];
|
|
303
|
-
const indent = (body.match(/\n(\s+)"/) ||
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
const indent = (body.match(/\n(\s+)"/) || ['', ' '])[1];
|
|
305
|
+
|
|
306
|
+
// Extract existing entries
|
|
307
|
+
const entries = [];
|
|
308
|
+
const entryRe = /"([^"]+)"/g;
|
|
309
|
+
let m;
|
|
310
|
+
while ((m = entryRe.exec(body)) !== null) entries.push(m[1]);
|
|
311
|
+
|
|
312
|
+
// Insert in alphabetical position
|
|
313
|
+
entries.push(id);
|
|
314
|
+
entries.sort((a, b) => a.localeCompare(b));
|
|
315
|
+
|
|
316
|
+
const newBody = '\n' + entries.map(e => `${indent}"${e}",`).join('\n') + '\n ';
|
|
317
|
+
return source.replace(re, `$1${newBody}$3`);
|
|
306
318
|
}
|
|
307
319
|
|
|
308
320
|
// ─── Export ──────────────────────────────────────────────────────────────────
|
package/demo/index.html
CHANGED
|
@@ -318,5 +318,12 @@
|
|
|
318
318
|
</div>
|
|
319
319
|
</div>
|
|
320
320
|
|
|
321
|
+
<!-- Toast — pre-defined so Tailwind CDN scans the classes -->
|
|
322
|
+
<div id="toast-message" role="status" aria-live="polite"
|
|
323
|
+
style="display:none;position:fixed;bottom:1.5rem;left:50%;transform:translateX(-50%);z-index:9999;
|
|
324
|
+
background:#111827;color:#fff;padding:.625rem 1.25rem;border-radius:.5rem;
|
|
325
|
+
font-size:.875rem;box-shadow:0 4px 12px rgba(0,0,0,.35);white-space:nowrap;">
|
|
326
|
+
</div>
|
|
327
|
+
|
|
321
328
|
</body>
|
|
322
329
|
</html>
|
package/demo/script.js
CHANGED
|
@@ -33,19 +33,15 @@ function hideTooltip(button) {
|
|
|
33
33
|
|
|
34
34
|
// Toast logic
|
|
35
35
|
function showToast(message) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
document.body.appendChild(toast);
|
|
42
|
-
}
|
|
36
|
+
// Uses the pre-defined #toast-message element in index.html.
|
|
37
|
+
// Inline styles only — Tailwind CDN does not generate styles for
|
|
38
|
+
// dynamically-injected class names so we never rely on it here.
|
|
39
|
+
const toast = document.getElementById('toast-message');
|
|
40
|
+
if (!toast) return;
|
|
43
41
|
toast.textContent = message;
|
|
44
|
-
toast.style.display = '
|
|
42
|
+
toast.style.display = 'block';
|
|
45
43
|
clearTimeout(window._toastTimeout);
|
|
46
|
-
window._toastTimeout = setTimeout(() => {
|
|
47
|
-
toast.style.display = 'none';
|
|
48
|
-
}, 2000);
|
|
44
|
+
window._toastTimeout = setTimeout(() => { toast.style.display = 'none'; }, 2400);
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
// Patch copyCode and copyText to show toast
|
|
@@ -321,7 +317,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
321
317
|
"dynatrace","edge","essential-app-protection","explorer","f5","firefox",
|
|
322
318
|
"flux-cd","fortify","fortify-on-demand","free-marker","git-ops","github",
|
|
323
319
|
"github-actions","gitlab","google","google-cloud","google-cloud-functions",
|
|
324
|
-
"hashi-corp-vault","helm","ibm","ingress","inteligence","jboss","jenkins",
|
|
320
|
+
"grafana","hashi-corp-vault","helm","ibm","ingress","inteligence","jboss","jenkins",
|
|
325
321
|
"jfrog","jira","key","kubernetes","linux","mailhog","microsoft-iis",
|
|
326
322
|
"microsoft-teams","mysql","netscaler","new-relic","octopus-deploy",
|
|
327
323
|
"open-policy-agent","openid","openshift","opsgenie","oracle","parasoft",
|
|
@@ -330,7 +326,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
330
326
|
"sonarcloud","sonarqube","sonatype","svn","team-forge","teamcity","terraform",
|
|
331
327
|
"testlink","topaz","travis-ci","urbancode-deploy","vmware","webhook",
|
|
332
328
|
"windows","xray","zendesk",
|
|
333
|
-
"grafana",
|
|
334
329
|
];
|
|
335
330
|
|
|
336
331
|
// --- FAVOURITES LOGIC ---
|
|
@@ -380,11 +375,11 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
380
375
|
const themeClass = root.classList.contains('dark') ? 'dark' : 'light';
|
|
381
376
|
const isInteg = type === 'integration' || (integrationsList.includes(item) && !illustrations.includes(item));
|
|
382
377
|
|
|
383
|
-
// Toggle field visibility
|
|
378
|
+
// Toggle field visibility — use style.display (more reliable than Tailwind hidden class)
|
|
384
379
|
const illusFields = document.getElementById('modal-illus-fields');
|
|
385
380
|
const integFields = document.getElementById('modal-integ-fields');
|
|
386
|
-
if (illusFields) illusFields.
|
|
387
|
-
if (integFields) integFields.
|
|
381
|
+
if (illusFields) illusFields.style.display = isInteg ? 'none' : 'block';
|
|
382
|
+
if (integFields) integFields.style.display = !isInteg ? 'none' : 'block';
|
|
388
383
|
|
|
389
384
|
if (isInteg) {
|
|
390
385
|
// Integration modal â single usage field
|
|
@@ -529,7 +524,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
529
524
|
div.dataset.itemId = item;
|
|
530
525
|
div.dataset.itemType = 'integration';
|
|
531
526
|
div.innerHTML = `
|
|
532
|
-
<button class="fav-btn absolute top-2.5 right-2.5 z-20 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm shadow-sm" onclick="event.stopPropagation();window.toggleFavourite('${item}')">
|
|
527
|
+
<button class="fav-btn absolute top-2.5 right-2.5 z-20 ${isFav ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'} transition-opacity p-1 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm shadow-sm" onclick="event.stopPropagation();window.toggleFavourite('${item}')">
|
|
533
528
|
<svg class="w-3.5 h-3.5" fill="${isFav ? '#FBBF24' : 'none'}" viewBox="0 0 24 24" stroke="${isFav ? '#FBBF24' : '#9CA3AF'}" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l2.036 6.29a1 1 0 00.95.69h6.631c.969 0 1.371 1.24.588 1.81l-5.37 3.905a1 1 0 00-.364 1.118l2.036 6.29c.3.921-.755 1.688-1.54 1.118l-5.37-3.905a1 1 0 00-1.176 0l-5.37 3.905c-.784.57-1.838-.197-1.54-1.118l2.036-6.29a1 1 0 00-.364-1.118L2.342 11.717c-.783-.57-.38-1.81.588-1.81h6.631a1 1 0 00.95-.69l2.036-6.29z"/></svg>
|
|
534
529
|
</button>
|
|
535
530
|
<div class="flex items-center justify-center h-36 px-4">
|
|
@@ -555,7 +550,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
555
550
|
div.dataset.itemId = item;
|
|
556
551
|
div.dataset.itemType = 'illustration';
|
|
557
552
|
div.innerHTML = `
|
|
558
|
-
<button class="fav-btn absolute top-2.5 right-2.5 z-20 opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm shadow-sm" onclick="event.stopPropagation();window.toggleFavourite('${item}')">
|
|
553
|
+
<button class="fav-btn absolute top-2.5 right-2.5 z-20 ${isFav ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'} transition-opacity p-1 rounded-lg bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm shadow-sm" onclick="event.stopPropagation();window.toggleFavourite('${item}')">
|
|
559
554
|
<svg class="w-3.5 h-3.5" fill="${isFav ? '#FBBF24' : 'none'}" viewBox="0 0 24 24" stroke="${isFav ? '#FBBF24' : '#9CA3AF'}" stroke-width="2"><path stroke-linecap="round" stroke-linejoin="round" d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l2.036 6.29a1 1 0 00.95.69h6.631c.969 0 1.371 1.24.588 1.81l-5.37 3.905a1 1 0 00-.364 1.118l2.036 6.29c.3.921-.755 1.688-1.54 1.118l-5.37-3.905a1 1 0 00-1.176 0l-5.37 3.905c-.784.57-1.838-.197-1.54-1.118l2.036-6.29a1 1 0 00-.364-1.118L2.342 11.717c-.783-.57-.38-1.81.588-1.81h6.631a1 1 0 00.95-.69l2.036-6.29z"/></svg>
|
|
560
555
|
</button>
|
|
561
556
|
<div class="flex items-center justify-center h-36 px-4 dot-illustration">
|
package/package.json
CHANGED