@cccarv82/freya 1.0.65 → 1.0.66
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/cli/web-ui.js +26 -6
- package/package.json +1 -1
package/cli/web-ui.js
CHANGED
|
@@ -565,6 +565,7 @@
|
|
|
565
565
|
+ '<div class="reportName">' + escapeHtml(item.name) + '</div>'
|
|
566
566
|
+ '<div class="reportMeta">'
|
|
567
567
|
+ '<span class="reportMetaText">' + escapeHtml(item.relPath) + ' • ' + escapeHtml(meta) + '</span>'
|
|
568
|
+
+ '<button class="iconBtn" data-action="copy" title="Copiar">⧉</button>'
|
|
568
569
|
+ '<button class="iconBtn" data-action="pdf" title="Baixar PDF">⬇</button>'
|
|
569
570
|
+ '</div>'
|
|
570
571
|
+ '</div>'
|
|
@@ -611,6 +612,30 @@
|
|
|
611
612
|
};
|
|
612
613
|
}
|
|
613
614
|
|
|
615
|
+
const copyBtn = card.querySelector('[data-action="copy"]');
|
|
616
|
+
if (copyBtn) {
|
|
617
|
+
copyBtn.onclick = async (ev) => {
|
|
618
|
+
ev.stopPropagation();
|
|
619
|
+
try {
|
|
620
|
+
const html = renderMarkdown(state.reportTexts[item.relPath] || '');
|
|
621
|
+
const text = (preview && preview.innerText) ? preview.innerText : (state.reportTexts[item.relPath] || '');
|
|
622
|
+
const blob = new Blob([`<div>${html}</div>`], { type: 'text/html' });
|
|
623
|
+
const data = [new ClipboardItem({ 'text/html': blob, 'text/plain': new Blob([text], { type: 'text/plain' }) })];
|
|
624
|
+
await navigator.clipboard.write(data);
|
|
625
|
+
setPill('ok', 'copiado');
|
|
626
|
+
setTimeout(() => setPill('ok', 'pronto'), 800);
|
|
627
|
+
} catch {
|
|
628
|
+
try {
|
|
629
|
+
await navigator.clipboard.writeText(state.reportTexts[item.relPath] || '');
|
|
630
|
+
setPill('ok', 'copiado');
|
|
631
|
+
setTimeout(() => setPill('ok', 'pronto'), 800);
|
|
632
|
+
} catch {
|
|
633
|
+
setPill('err', 'copy failed');
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
};
|
|
637
|
+
}
|
|
638
|
+
|
|
614
639
|
const pdfBtn = card.querySelector('[data-action="pdf"]');
|
|
615
640
|
if (pdfBtn) {
|
|
616
641
|
pdfBtn.onclick = (ev) => {
|
|
@@ -628,12 +653,7 @@
|
|
|
628
653
|
};
|
|
629
654
|
}
|
|
630
655
|
|
|
631
|
-
grid.appendChild(card);
|
|
632
|
-
|
|
633
|
-
if (expanded && raw) {
|
|
634
|
-
requestAnimationFrame(() => autoGrowTextarea(raw));
|
|
635
|
-
}
|
|
636
|
-
}
|
|
656
|
+
grid.appendChild(card); }
|
|
637
657
|
}
|
|
638
658
|
|
|
639
659
|
async function refreshReportsPage() {
|