-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d54dfc
commit 0faec2c
Showing
7 changed files
with
49 additions
and
107 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
apps/server/prisma/migrations/20250220130624_remove_activity/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
Warnings: | ||
- The values [Activity] on the enum `ModelName` will be removed. If these variants are still used in the database, this will fail. | ||
*/ | ||
-- AlterEnum | ||
BEGIN; | ||
CREATE TYPE "ModelName_new" AS ENUM ('Attachment', 'IntegrationAccount', 'IntegrationDefinitionV2', 'Task', 'SyncAction', 'User', 'Workspace', 'Page', 'Status', 'Conversation', 'ConversationHistory', 'List'); | ||
ALTER TABLE "SyncAction" ALTER COLUMN "modelName" TYPE "ModelName_new" USING ("modelName"::text::"ModelName_new"); | ||
ALTER TYPE "ModelName" RENAME TO "ModelName_old"; | ||
ALTER TYPE "ModelName_new" RENAME TO "ModelName"; | ||
DROP TYPE "ModelName_old"; | ||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,12 @@ | ||
import { Blockquote } from '@tiptap/extension-blockquote'; | ||
import { BulletList } from '@tiptap/extension-bullet-list'; | ||
import { CodeBlock } from '@tiptap/extension-code-block'; | ||
import { Document } from '@tiptap/extension-document'; | ||
import { HardBreak } from '@tiptap/extension-hard-break'; | ||
import { Heading } from '@tiptap/extension-heading'; | ||
import { HorizontalRule } from '@tiptap/extension-horizontal-rule'; | ||
import { Image } from '@tiptap/extension-image'; | ||
import { Link } from '@tiptap/extension-link'; | ||
import { ListItem } from '@tiptap/extension-list-item'; | ||
import { OrderedList } from '@tiptap/extension-ordered-list'; | ||
import { Paragraph } from '@tiptap/extension-paragraph'; | ||
import { TaskItem } from '@tiptap/extension-task-item'; | ||
import { TaskList } from '@tiptap/extension-task-list'; | ||
import { Text } from '@tiptap/extension-text'; | ||
import { Underline } from '@tiptap/extension-underline'; | ||
import { generateHTML, generateJSON } from '@tiptap/html'; | ||
|
||
export const tiptapExtensions = [ | ||
Document, | ||
Text, | ||
Paragraph, | ||
Heading, | ||
Blockquote, | ||
ListItem, | ||
OrderedList, | ||
BulletList, | ||
TaskList, | ||
TaskItem, | ||
Image, | ||
CodeBlock, | ||
HardBreak, | ||
HorizontalRule, | ||
Link, | ||
Underline, | ||
]; | ||
import { defaultExtensions } from './editor-extensions'; | ||
|
||
export function convertHtmlToTiptapJson(html: string) { | ||
const tiptapJson = generateJSON(html, tiptapExtensions); | ||
const tiptapJson = generateJSON(html, defaultExtensions); | ||
return tiptapJson; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
export function convertTiptapJsonToHtml(tiptapJson: Record<string, any>) { | ||
return generateHTML(tiptapJson, tiptapExtensions); | ||
return generateHTML(tiptapJson, defaultExtensions); | ||
} |