@mablhq/mabl-cli 1.16.23 → 1.16.32
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.
|
@@ -16,6 +16,16 @@ mablEmbeddedPdfDetector = () => {
|
|
|
16
16
|
) {
|
|
17
17
|
window.addEventListener(PDFEventType, handle, true);
|
|
18
18
|
|
|
19
|
+
// Don't wait for animation to load existing embedded elements
|
|
20
|
+
Array.from(document.querySelectorAll('object, embed')).forEach(
|
|
21
|
+
(element) => {
|
|
22
|
+
handle({
|
|
23
|
+
target: element,
|
|
24
|
+
animationName: MABL_PDF_DETECTOR_ANIMATION_NAME,
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
|
|
19
29
|
if (!document.getElementById(MABL_PDF_DETECTOR_STYLE_ID)) {
|
|
20
30
|
const pdfDetectorStyleElem = document.createElement.call(
|
|
21
31
|
document,
|
|
@@ -51,6 +61,13 @@ mablEmbeddedPdfDetector = () => {
|
|
|
51
61
|
const pdfUrl = pdfElement.src || pdfElement.data;
|
|
52
62
|
const pdfFileName = mablGetPdfFilenameFromUrl(pdfUrl);
|
|
53
63
|
|
|
64
|
+
const embeddedPdfMablId = '__mabl_pdf_viewer_' + idSanitize(pdfFileName);
|
|
65
|
+
// Mark the embedded PDF element so that we can find it to replace it later
|
|
66
|
+
pdfElement.setAttribute(
|
|
67
|
+
MABL_EMBEDDED_PDF_DETECTED_FLAG,
|
|
68
|
+
embeddedPdfMablId,
|
|
69
|
+
);
|
|
70
|
+
|
|
54
71
|
// Signal embedded PDF detection and pending download
|
|
55
72
|
// Wait for the event to be acknowledged before starting the download
|
|
56
73
|
await window.dispatchMablEvent({
|
|
@@ -63,13 +80,6 @@ mablEmbeddedPdfDetector = () => {
|
|
|
63
80
|
// Trigger a download for the PDF
|
|
64
81
|
mablDownloadEmbeddedPdf(pdfFileName, pdfUrl);
|
|
65
82
|
|
|
66
|
-
const embeddedPdfMablId = '__mabl_pdf_viewer_' + idSanitize(pdfFileName);
|
|
67
|
-
// Mark the embedded PDF element so that we can find it to replace it later
|
|
68
|
-
pdfElement.setAttribute(
|
|
69
|
-
MABL_EMBEDDED_PDF_DETECTED_FLAG,
|
|
70
|
-
embeddedPdfMablId,
|
|
71
|
-
);
|
|
72
|
-
|
|
73
83
|
// Trigger replacement of the embedded PDF with an interactable version served by PDF server
|
|
74
84
|
window.dispatchMablEvent({
|
|
75
85
|
type: MESSAGE_TYPE_EMBEDDED_PDF_MARKED,
|
package/util/logUtils.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.formatTimestamp = exports.valueToString = exports.logWebUIAndCliOutput = exports.findResultSeverityToLogLevel = exports.logCliOutput = exports.logInternal = void 0;
|
|
6
|
+
exports.formatTimestamp = exports.valueToString = exports.logWebUIAndCliOutput = exports.logWebUI = exports.findResultSeverityToLogLevel = exports.logCliOutput = exports.logInternal = void 0;
|
|
7
7
|
const mablscriptFind_1 = require("../mablscriptFind");
|
|
8
8
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
9
9
|
const moment_1 = __importDefault(require("moment"));
|
|
@@ -43,6 +43,12 @@ function findResultSeverityToLogLevel(severity) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
exports.findResultSeverityToLogLevel = findResultSeverityToLogLevel;
|
|
46
|
+
function logWebUI(logLine, logLevel, executionContext, metadata) {
|
|
47
|
+
metadata = metadata ? JSON.parse(JSON.stringify(metadata)) : {};
|
|
48
|
+
metadata.shouldOutputInConsole = false;
|
|
49
|
+
logWebUIAndCliOutput(logLine, logLevel, executionContext, metadata);
|
|
50
|
+
}
|
|
51
|
+
exports.logWebUI = logWebUI;
|
|
46
52
|
function logWebUIAndCliOutput(logLine, logLevel, executionContext, metadata) {
|
|
47
53
|
switch (logLevel) {
|
|
48
54
|
case loggingProvider_1.LogLevel.Error:
|