@meistrari/chat-nuxt 4.11.0-rc.7 → 4.11.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
3
  "configKey": "chatNuxt",
4
- "version": "4.11.0-rc.7",
4
+ "version": "4.11.0-rc.8",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -4,6 +4,7 @@ import { wrapCustomMarkdownComponents } from "../markdown/custom-components";
4
4
  import { STREAMING_TEXT_FADE_MS } from "../markdown/streaming-text-segments";
5
5
  import { escapeSingleDollarSigns } from "../markdown/escape-dollar-signs";
6
6
  import { normalizeCustomTagJson } from "../markdown/normalize-custom-tag-json";
7
+ import MarkdownCodeBlock from "./markdown-code-block.vue";
7
8
  import StreamingTextNode from "../markdown/streaming-text-node.vue";
8
9
  const props = defineProps({
9
10
  content: { type: [String, null], required: false, default: "" },
@@ -34,7 +35,7 @@ watch(() => props.typewriter, (typewriter) => {
34
35
  streamingTextActive.value = false;
35
36
  }, STREAMING_TEXT_FADE_MS);
36
37
  });
37
- const registeredComponents = computed(() => streamingTextActive.value ? { text: StreamingTextNode, ...customMarkdownComponents.value } : customMarkdownComponents.value);
38
+ const registeredComponents = computed(() => streamingTextActive.value ? { code_block: MarkdownCodeBlock, text: StreamingTextNode, ...customMarkdownComponents.value } : { code_block: MarkdownCodeBlock, ...customMarkdownComponents.value });
38
39
  watch(registeredComponents, (components) => setCustomComponents(scopeId, components), { immediate: true });
39
40
  onBeforeUnmount(() => {
40
41
  if (streamingTextTimer !== void 0)
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ node: {
3
+ code: string;
4
+ language?: string;
5
+ loading?: boolean;
6
+ };
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,33 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ node: { type: Object, required: true }
4
+ });
5
+ const language = computed(() => props.node.language?.trim() || "text");
6
+ const plainText = computed(() => props.node.loading || ["text", "txt", "plain", "plaintext", "csv", "tsv"].includes(language.value.toLowerCase()));
7
+ </script>
8
+
9
+ <template>
10
+ <div class="chat-code-block min-w-0 overflow-hidden rounded-20px border-0.5px border bg-muted my-12px">
11
+ <div class="flex items-center justify-between gap-12px px-20px pt-12px pb-8px">
12
+ <div class="flex min-w-0 items-center gap-8px text-primary body-12-regular">
13
+ <TelaIcon name="i-ph-code" size="sm" class="shrink-0" aria-hidden="true" />
14
+ <span class="truncate">{{ language }}</span>
15
+ </div>
16
+ <TelaCopyButton :content="node.code" variant="ghost" size="md" aria-label="Copiar código" title="Copiar código" />
17
+ </div>
18
+ <pre v-if="plainText" class="chat-code-text m-0 overflow-x-auto px-20px pb-16px"><code>{{ node.code }}</code></pre>
19
+ <TelaCodeBlock
20
+ v-else
21
+ :code="node.code"
22
+ :language="language"
23
+ :is-copy-code="false"
24
+ hide-line-numbers
25
+ without-border
26
+ background="transparent"
27
+ />
28
+ </div>
29
+ </template>
30
+
31
+ <style scoped>
32
+ .chat-code-text{-moz-tab-size:4;-o-tab-size:4;tab-size:4;white-space:pre}.chat-code-block :deep(pre.shiki){padding:0 20px 16px;-moz-tab-size:4;-o-tab-size:4;tab-size:4}
33
+ </style>
@@ -0,0 +1,10 @@
1
+ type __VLS_Props = {
2
+ node: {
3
+ code: string;
4
+ language?: string;
5
+ loading?: boolean;
6
+ };
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/chat-nuxt",
3
- "version": "4.11.0-rc.7",
3
+ "version": "4.11.0-rc.8",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {