diff --git a/package.json b/package.json index a682d838..bdead105 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "@msgpack/msgpack": "3.0.0-beta2", "@tauri-apps/api": "1.2.0", "buffer": "^6.0.3", + "core-js": "^3.30.2", "dompurify": "^3.0.1", "exifr": "^7.1.3", "gpt-3-encoder": "^1.1.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e64679e5..ac98d069 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,7 @@ specifiers: '@types/wicg-file-system-access': ^2020.9.6 autoprefixer: ^10.4.14 buffer: ^6.0.3 + core-js: ^3.30.2 dompurify: ^3.0.1 exifr: ^7.1.3 gpt-3-encoder: ^1.1.4 @@ -55,6 +56,7 @@ dependencies: '@msgpack/msgpack': 3.0.0-beta2 '@tauri-apps/api': 1.2.0 buffer: 6.0.3 + core-js: 3.30.2 dompurify: 3.0.1 exifr: 7.1.3 gpt-3-encoder: 1.1.4 @@ -852,6 +854,11 @@ packages: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true + /core-js/3.30.2: + resolution: {integrity: sha512-uBJiDmwqsbJCWHAwjrx3cvjbMXP7xD72Dmsn5LOJpiRmE3WbBbN5rCqQ2Qh6Ek6/eOrjlWngEynBWo4VxerQhg==} + requiresBuild: true + dev: false + /crc-32/0.3.0: resolution: {integrity: sha512-kucVIjOmMc1f0tv53BJ/5WIX+MGLcKuoBhnGqQrgKJNqLByb/sVMWfW/Aw6hw0jgcqjJ2pi9E5y32zOIpaUlsA==} engines: {node: '>=0.8'} diff --git a/src/lang/en.ts b/src/lang/en.ts index 9ba0cf72..d401b737 100644 --- a/src/lang/en.ts +++ b/src/lang/en.ts @@ -71,7 +71,8 @@ export const languageEnglish = { personality: "A brief description about character's personality. \n\n**It is not recommended to use this option. Describe it in character description instead.**", scenario: "A brief description about character's scenario. \n\n**It is not recommended to use this option. Describe it in character description instead.**", utilityBot: "When activated, it ignores main prompt. \n\n**It is not recommended to use this option. Modifiy system prompt instead.**", - loreSelective: "If Selective mode is toggled, both Activation Key and Secondary key should have a match to activate the lore." + loreSelective: "If Selective mode is toggled, both Activation Key and Secondary key should have a match to activate the lore.", + additionalAssets: "Additional assets to display in your chat. \n\n - use `{{raw::}}` to use as path.\n - use `{{img::}}` to use as image" }, setup: { chooseProvider: "Choose AI Provider", @@ -251,5 +252,7 @@ export const languageEnglish = { streaming: "Streaming", chatBot:'Chat Bot', otherBots:'Other Bots', - user:"User" + user:"User", + additionalAssets:"Additional Assets", + editDisplay: "Modify Display" } diff --git a/src/lang/ko.ts b/src/lang/ko.ts index 1ae7b5fa..a84ab05c 100644 --- a/src/lang/ko.ts +++ b/src/lang/ko.ts @@ -237,5 +237,7 @@ export const languageKorean = { streaming: "스트리밍", chatBot:'채팅 봇', otherBots:'기타 봇', - user:"유저" + user:"유저", + editDisplay: "디스플레이 수정" + } \ No newline at end of file diff --git a/src/lib/ChatScreens/Chat.svelte b/src/lib/ChatScreens/Chat.svelte index 0054c483..f0ac6c40 100644 --- a/src/lib/ChatScreens/Chat.svelte +++ b/src/lib/ChatScreens/Chat.svelte @@ -4,7 +4,7 @@ import AutoresizeArea from "./AutoresizeArea.svelte"; import { alertConfirm } from "../../ts/alert"; import { language } from "../../lang"; - import { DataBase } from "../../ts/database"; + import { DataBase, type character, type groupChat } from "../../ts/database"; import { selectedCharID } from "../../ts/stores"; import { translate } from "../../ts/translator/translator"; import { replacePlaceholders } from "../../ts/util"; @@ -16,6 +16,7 @@ export let rerollIcon = false export let onReroll = () => {} export let unReroll = () => {} + export let character:character|groupChat|null = null let translating = false let editMode = false export let altGreeting = false @@ -127,10 +128,12 @@ {#if editMode} {:else} - {@html ParseMarkdown(msgDisplay)} + {#await ParseMarkdown(msgDisplay, character) then md} + {@html md} + {/await} {/if} diff --git a/src/lib/ChatScreens/CreatorQuote.svelte b/src/lib/ChatScreens/CreatorQuote.svelte index 51fbab95..ea4023a0 100644 --- a/src/lib/ChatScreens/CreatorQuote.svelte +++ b/src/lib/ChatScreens/CreatorQuote.svelte @@ -6,14 +6,16 @@
- {@html ParseMarkdown(quote)} + {#await ParseMarkdown(quote) then md} + {@html md} + {/await}