From d2ecd28047fba7235d909f8e83d9723671ecbe96 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Mon, 22 Jul 2024 10:58:32 +0100 Subject: [PATCH] fix: localize attachment type * fixes #86 --- .../editor-ext/src/lib/image/image-upload.ts | 2 +- packages/editor-ext/src/lib/types.ts | 17 +++++++++++++++++ .../editor-ext/src/lib/video/video-upload.ts | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 packages/editor-ext/src/lib/types.ts diff --git a/packages/editor-ext/src/lib/image/image-upload.ts b/packages/editor-ext/src/lib/image/image-upload.ts index 2c197e3a..8ffa2cbd 100644 --- a/packages/editor-ext/src/lib/image/image-upload.ts +++ b/packages/editor-ext/src/lib/image/image-upload.ts @@ -1,7 +1,7 @@ import { type EditorState, Plugin, PluginKey } from "@tiptap/pm/state"; import { Decoration, DecorationSet } from "@tiptap/pm/view"; -import { IAttachment } from "client/src/lib/types"; import { MediaUploadOptions, UploadFn } from "../media-utils"; +import { IAttachment } from "../types"; const uploadKey = new PluginKey("image-upload"); diff --git a/packages/editor-ext/src/lib/types.ts b/packages/editor-ext/src/lib/types.ts new file mode 100644 index 00000000..595d7f4b --- /dev/null +++ b/packages/editor-ext/src/lib/types.ts @@ -0,0 +1,17 @@ +// repetition for now +export interface IAttachment { + id: string; + fileName: string; + filePath: string; + fileSize: number; + fileExt: string; + mimeType: string; + type: string; + creatorId: string; + pageId: string | null; + spaceId: string | null; + workspaceId: string; + createdAt: string; + updatedAt: string; + deletedAt: string | null; +} diff --git a/packages/editor-ext/src/lib/video/video-upload.ts b/packages/editor-ext/src/lib/video/video-upload.ts index 60e8bed2..022e6306 100644 --- a/packages/editor-ext/src/lib/video/video-upload.ts +++ b/packages/editor-ext/src/lib/video/video-upload.ts @@ -1,7 +1,7 @@ import { type EditorState, Plugin, PluginKey } from "@tiptap/pm/state"; import { Decoration, DecorationSet } from "@tiptap/pm/view"; -import { IAttachment } from "client/src/lib/types"; import { MediaUploadOptions, UploadFn } from "../media-utils"; +import { IAttachment } from "../types"; const uploadKey = new PluginKey("video-upload");