upper to timi-ts
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import view from "./index.vue";
|
||||
import { Toolkit } from "timi-web";
|
||||
import { WebToolkit } from "timi-web";
|
||||
|
||||
export const ArticleView = Toolkit.withInstall(view);
|
||||
export const ArticleView = WebToolkit.withInstall(view);
|
||||
export default ArticleView;
|
||||
|
||||
@@ -13,17 +13,15 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Article, Attachment } from "timi-web/editor";
|
||||
import { AttachmentAPI } from "timi-web/editor";
|
||||
import type { Article, Attachment } from "../article-editor/types";
|
||||
import { MarkdownView } from "timi-web";
|
||||
import { TiptapView } from "../tiptap-view";
|
||||
import {
|
||||
ATTACHMENT_ID_ATTR,
|
||||
getAttachmentIdFromSrc,
|
||||
normalizeArticleContentType,
|
||||
normalizeContent,
|
||||
normalizeRawArticleContent
|
||||
} from "timi-web/editor";
|
||||
} from "../article-editor/content";
|
||||
import { ATTACHMENT_ID_ATTR, normalizeContent } from "timi-web/editor";
|
||||
|
||||
defineOptions({
|
||||
name: "ArticleView"
|
||||
@@ -69,11 +67,13 @@ async function buildAttachmentPreviewUrl(attachmentId: string) {
|
||||
return customUrl;
|
||||
}
|
||||
}
|
||||
const previewUrl = `${attachment?.metadata?.previewUrl || ""}`;
|
||||
const previewUrl = typeof attachment?.metadata?.previewUrl === "string"
|
||||
? attachment.metadata.previewUrl
|
||||
: "";
|
||||
if (previewUrl) {
|
||||
return previewUrl;
|
||||
}
|
||||
return attachmentId ? AttachmentAPI.getReadURL(attachmentId) : "";
|
||||
return attachment?.url || "";
|
||||
}
|
||||
|
||||
async function buildRenderContent(content?: string) {
|
||||
|
||||
Reference in New Issue
Block a user