refac
This commit is contained in:
@@ -356,6 +356,7 @@
|
|||||||
<Markdown
|
<Markdown
|
||||||
id={`${message.id}-reply-to`}
|
id={`${message.id}-reply-to`}
|
||||||
content={message?.reply_to_message?.content}
|
content={message?.reply_to_message?.content}
|
||||||
|
allowEmbeds={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
@@ -527,6 +528,7 @@
|
|||||||
id={message.id}
|
id={message.id}
|
||||||
content={message.content}
|
content={message.content}
|
||||||
paragraphTag="span"
|
paragraphTag="span"
|
||||||
|
allowEmbeds={!!message?.meta?.model_id}
|
||||||
/>{#if message.created_at !== message.updated_at && (message?.meta?.model_id ?? null) === null}<span
|
/>{#if message.created_at !== message.updated_at && (message?.meta?.model_id ?? null) === null}<span
|
||||||
class="text-gray-500 text-[10px] pl-1 self-center">({$i18n.t('edited')})</span
|
class="text-gray-500 text-[10px] pl-1 self-center">({$i18n.t('edited')})</span
|
||||||
>{/if}
|
>{/if}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
export let paragraphTag = 'p';
|
export let paragraphTag = 'p';
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
export let topPadding = false;
|
export let topPadding = false;
|
||||||
|
export let allowEmbeds = true;
|
||||||
|
|
||||||
export let sourceIds = [];
|
export let sourceIds = [];
|
||||||
|
|
||||||
@@ -104,6 +105,7 @@
|
|||||||
{editCodeBlock}
|
{editCodeBlock}
|
||||||
{sourceIds}
|
{sourceIds}
|
||||||
{topPadding}
|
{topPadding}
|
||||||
|
{allowEmbeds}
|
||||||
{onTaskClick}
|
{onTaskClick}
|
||||||
{onSourceClick}
|
{onSourceClick}
|
||||||
{onSave}
|
{onSave}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
}> = [];
|
}> = [];
|
||||||
|
|
||||||
export let messageDone = true;
|
export let messageDone = true;
|
||||||
|
export let allowEmbeds = true;
|
||||||
|
|
||||||
let open = $settings?.expandDetails ?? false;
|
let open = $settings?.expandDetails ?? false;
|
||||||
|
|
||||||
@@ -51,6 +52,8 @@
|
|||||||
|
|
||||||
// Collect all embeds from tool_calls tokens
|
// Collect all embeds from tool_calls tokens
|
||||||
$: allEmbeds = (() => {
|
$: allEmbeds = (() => {
|
||||||
|
if (!allowEmbeds) return [];
|
||||||
|
|
||||||
const result: Array<{ name: string; embed: string; args: string }> = [];
|
const result: Array<{ name: string; embed: string; args: string }> = [];
|
||||||
for (const t of tokens) {
|
for (const t of tokens) {
|
||||||
if (t?.attributes?.type !== 'tool_calls') continue;
|
if (t?.attributes?.type !== 'tool_calls') continue;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
|
|
||||||
export let editCodeBlock = true;
|
export let editCodeBlock = true;
|
||||||
export let topPadding = false;
|
export let topPadding = false;
|
||||||
|
export let allowEmbeds = true;
|
||||||
|
|
||||||
export let onSave: Function = () => {};
|
export let onSave: Function = () => {};
|
||||||
export let onUpdate: Function = () => {};
|
export let onUpdate: Function = () => {};
|
||||||
@@ -371,6 +372,7 @@
|
|||||||
id={`${id}-${tokenIdx}-detail-group`}
|
id={`${id}-${tokenIdx}-detail-group`}
|
||||||
tokens={token.items}
|
tokens={token.items}
|
||||||
messageDone={done}
|
messageDone={done}
|
||||||
|
{allowEmbeds}
|
||||||
>
|
>
|
||||||
<div slot="content" class="space-y-1">
|
<div slot="content" class="space-y-1">
|
||||||
{#each token.items as detailToken, detailIdx}
|
{#each token.items as detailToken, detailIdx}
|
||||||
|
|||||||
Reference in New Issue
Block a user