import utils from '../../services/utils.js'; import server from '../../services/server.js'; import toastService from "../../services/toast.js"; import appContext from "../../components/app_context.js"; import libraryLoader from "../../services/library_loader.js"; import openService from "../../services/open.js"; import protectedSessionHolder from "../../services/protected_session_holder.js"; import BasicWidget from "../basic_widget.js"; import dialogService from "../../services/dialog.js"; const TPL = `
").text(fullRevision.content));
        } else if (revisionItem.type === 'image') {
            this.$content.html($("![]() ")
                // the reason why we put this inline as base64 is that we do not want to let user copy this
                // as a URL to be used in a note. Instead, if they copy and paste it into a note, it will be uploaded as a new note
                .attr("src", `data:${fullRevision.mime};base64,${fullRevision.content}`)
                .css("max-width", "100%")
                .css("max-height", "100%"));
        } else if (revisionItem.type === 'file') {
            const $table = $("
")
                // the reason why we put this inline as base64 is that we do not want to let user copy this
                // as a URL to be used in a note. Instead, if they copy and paste it into a note, it will be uploaded as a new note
                .attr("src", `data:${fullRevision.mime};base64,${fullRevision.content}`)
                .css("max-width", "100%")
                .css("max-height", "100%"));
        } else if (revisionItem.type === 'file') {
            const $table = $("| ").text("MIME: "), $(" | ").text(revisionItem.mime) )) .append($(" | 
|---|---|
| ").text("File size:"), $(" | ").text(utils.formatSize(revisionItem.contentLength)) )); if (fullRevision.content) { $table.append($(" | 
| ').append(
                        $(' ').text("Preview:"),
                        $('')
                            .text(fullRevision.content)
                    )
                ));
            }
            this.$content.html($table);
        } else if (revisionItem.type === 'canvas') {
            const sanitizedTitle = revisionItem.title.replace(/[^a-z0-9-.]/gi, "");
            this.$content.html($(" | |