upper to timi-ts

This commit is contained in:
Timi
2026-08-28 15:19:08 +08:00
parent f790122c01
commit ef71681bd5
45 changed files with 816 additions and 1018 deletions
+2 -2
View File
@@ -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;
+7 -7
View File
@@ -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) {