@meistrari/chat-nuxt 3.17.0-rc.13 → 3.17.0-rc.15
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 +1 @@
|
|
|
1
|
-
.markstream-vue{font-family:inherit;--at-apply:"body-16-regular leading-24px text-primary";--list-item-marker:#a3a3a3;--list-item-counter-marker:#262626}.markstream-vue code,.markstream-vue kbd,.markstream-vue pre,.markstream-vue samp{font-family:Geist Mono Variable,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:13px;font-variation-settings:normal;letter-spacing:0;line-height:1.5}.markstream-vue ol,.markstream-vue ul{margin:8px 0;padding-left:1.5em}.markstream-vue .hr-node{border-color:#e5e5e5;border-top-width:.5px;margin-bottom:24px;margin-top:24px}.markstream-vue .strong-node{--at-apply:"font-580"}.markstream-vue .list-node.list-node{margin-bottom:8px;margin-left:4px;margin-top:8px;padding-left:1em}.markstream-vue ul{list-style:disc;list-style-position:outside}.markstream-vue ol{list-style:decimal;list-style-position:outside}.markstream-vue li{margin:4px 0}.markstream-vue .paragraph-node{--at-apply:"body-16-regular leading-24px";margin:0}.markstream-vue>.node-slot[data-node-type=paragraph]:not(:first-child){margin-top:12px}@keyframes chat-stream-chunk-in{0%{opacity:0}to{opacity:1}}.markstream-vue .chat-stream-chunk{animation:chat-stream-chunk-in var(--chat-stream-fade-duration,.32s) cubic-bezier(.2,0,0,1) both}@media (prefers-reduced-motion:reduce){.markstream-vue .chat-stream-chunk{animation:none}}.markstream-vue .typewriter-cursor,.markstream-vue .typewriter-simple-cursor .typewriter-simple-cursor-target:after{display:none}.markstream-vue .my-8{margin-bottom:8px;margin-top:8px}.markstream-vue .heading-node.heading-1,.markstream-vue h1{--at-apply:"heading-h2-semibold text-primary";margin:24px 0 8px}.markstream-vue .heading-node.heading-2,.markstream-vue h2{--at-apply:"heading-h3-semibold text-primary";margin:24px 0 8px}.markstream-vue .heading-node.heading-3,.markstream-vue h3{--at-apply:"heading-h4-semibold text-primary";margin:20px 0 8px}.markstream-vue .heading-node.heading-4,.markstream-vue .heading-node.heading-5,.markstream-vue .heading-node.heading-6,.markstream-vue h4,.markstream-vue h5,.markstream-vue h6{--at-apply:"heading-h5-semibold text-primary";margin:16px 0 8px}.markstream-vue>.node-slot:first-child .heading-node{margin-top:0}.markstream-vue [class*=tooltip],[class*=tooltip-element]{background-color:var(--neutral-900,#1a1a1a)!important;border-radius:4px;color:#fff!important;font-size:12px;padding:4px 8px}.mention-tag{align-items:center;border-radius:9999px;display:inline-flex;font-size:.875em;font-weight:500;gap:4px;padding:2px 8px;vertical-align:middle;white-space:nowrap}.mention-tag-file{background-color:rgba(127,189,247,.12);color:#7fbdf7}.mention-tag-skill{background-color:rgba(155,111,222,.12);color:#9b6fde}.mention-tag-canvas{background-color:rgba(234,161,65,.12);color:#d4882e}.mention-tag>span[class*=i-ph]{flex-shrink:0}
|
|
1
|
+
.markstream-vue{font-family:inherit;--at-apply:"body-16-regular leading-24px text-primary";--list-item-marker:#a3a3a3;--list-item-counter-marker:#262626}.markstream-vue code,.markstream-vue kbd,.markstream-vue pre,.markstream-vue samp{font-family:Geist Mono Variable,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:13px;font-variation-settings:normal;letter-spacing:0;line-height:1.5}.markstream-vue ol,.markstream-vue ul{margin:8px 0;padding-left:1.5em}.markstream-vue .hr-node{border-color:#e5e5e5;border-top-width:.5px;margin-bottom:24px;margin-top:24px}.markstream-vue .strong-node{--at-apply:"font-580"}.markstream-vue .list-node.list-node{margin-bottom:8px;margin-left:4px;margin-top:8px;padding-left:1em}.markstream-vue ol.list-node.list-node{padding-left:3em}.markstream-vue ul{list-style:disc;list-style-position:outside}.markstream-vue ol{list-style:decimal;list-style-position:outside}.markstream-vue li{margin:4px 0}.markstream-vue .paragraph-node{--at-apply:"body-16-regular leading-24px";margin:0}.markstream-vue>.node-slot[data-node-type=paragraph]:not(:first-child){margin-top:12px}@keyframes chat-stream-chunk-in{0%{opacity:0}to{opacity:1}}.markstream-vue .chat-stream-chunk{animation:chat-stream-chunk-in var(--chat-stream-fade-duration,.32s) cubic-bezier(.2,0,0,1) both}@media (prefers-reduced-motion:reduce){.markstream-vue .chat-stream-chunk{animation:none}}.markstream-vue .typewriter-cursor,.markstream-vue .typewriter-simple-cursor .typewriter-simple-cursor-target:after{display:none}.markstream-vue .my-8{margin-bottom:8px;margin-top:8px}.markstream-vue .heading-node.heading-1,.markstream-vue h1{--at-apply:"heading-h2-semibold text-primary";margin:24px 0 8px}.markstream-vue .heading-node.heading-2,.markstream-vue h2{--at-apply:"heading-h3-semibold text-primary";margin:24px 0 8px}.markstream-vue .heading-node.heading-3,.markstream-vue h3{--at-apply:"heading-h4-semibold text-primary";margin:20px 0 8px}.markstream-vue .heading-node.heading-4,.markstream-vue .heading-node.heading-5,.markstream-vue .heading-node.heading-6,.markstream-vue h4,.markstream-vue h5,.markstream-vue h6{--at-apply:"heading-h5-semibold text-primary";margin:16px 0 8px}.markstream-vue>.node-slot:first-child .heading-node{margin-top:0}.markstream-vue [class*=tooltip],[class*=tooltip-element]{background-color:var(--neutral-900,#1a1a1a)!important;border-radius:4px;color:#fff!important;font-size:12px;padding:4px 8px}.mention-tag{align-items:center;border-radius:9999px;display:inline-flex;font-size:.875em;font-weight:500;gap:4px;padding:2px 8px;vertical-align:middle;white-space:nowrap}.mention-tag-file{background-color:rgba(127,189,247,.12);color:#7fbdf7}.mention-tag-skill{background-color:rgba(155,111,222,.12);color:#9b6fde}.mention-tag-canvas{background-color:rgba(234,161,65,.12);color:#d4882e}.mention-tag>span[class*=i-ph]{flex-shrink:0}
|
|
@@ -20,6 +20,8 @@ export type ContentSegment = {
|
|
|
20
20
|
export type ParseContentOptions = {
|
|
21
21
|
/** Detect bare `cite://` tokens as citation segments. Off by default: only hosts that configured citations opt in. */
|
|
22
22
|
detectCitations?: boolean;
|
|
23
|
+
/** Keep Markdown links in text so the Markdown renderer can preserve enclosing structures such as tables and lists. */
|
|
24
|
+
preserveMarkdownLinks?: boolean;
|
|
23
25
|
};
|
|
24
26
|
export declare function detectFilesInText(text: string): DetectedFile[];
|
|
25
27
|
export declare function parseContentWithFiles(text: string, options?: ParseContentOptions): ContentSegment[];
|
|
@@ -140,12 +140,14 @@ export function detectFilesInText(text) {
|
|
|
140
140
|
}
|
|
141
141
|
export function parseContentWithFiles(text, options) {
|
|
142
142
|
const segments = [];
|
|
143
|
-
const
|
|
143
|
+
const markdownFileLinkMatches = collectMarkdownFileLinkMatches(text);
|
|
144
|
+
const fileMatches = options?.preserveMarkdownLinks ? [] : [...markdownFileLinkMatches];
|
|
144
145
|
for (const match of text.matchAll(VAULT_REGEX)) {
|
|
145
146
|
const rawUrl = match[0];
|
|
146
147
|
const url = stripTrailingPunctuation(rawUrl);
|
|
147
|
-
if (overlapsFileMatch(match.index, match.index + url.length, fileMatches))
|
|
148
|
+
if (overlapsFileMatch(match.index, match.index + url.length, markdownFileLinkMatches) || overlapsFileMatch(match.index, match.index + url.length, fileMatches)) {
|
|
148
149
|
continue;
|
|
150
|
+
}
|
|
149
151
|
const hashParams = parseVaultHashParams(url);
|
|
150
152
|
const filenameExt = hashParams?.filename?.split(".").pop()?.toLowerCase();
|
|
151
153
|
const urlExt = getExtensionFromUrl(url);
|
|
@@ -165,8 +167,9 @@ export function parseContentWithFiles(text, options) {
|
|
|
165
167
|
for (const match of text.matchAll(URL_REGEX)) {
|
|
166
168
|
const rawUrl = match[0];
|
|
167
169
|
const url = stripTrailingPunctuation(rawUrl);
|
|
168
|
-
if (overlapsFileMatch(match.index, match.index + url.length, fileMatches))
|
|
170
|
+
if (overlapsFileMatch(match.index, match.index + url.length, markdownFileLinkMatches) || overlapsFileMatch(match.index, match.index + url.length, fileMatches)) {
|
|
169
171
|
continue;
|
|
172
|
+
}
|
|
170
173
|
if (isVaultS3Url(url)) {
|
|
171
174
|
const { name, mimeType } = getFileInfoFromVaultS3Url(url);
|
|
172
175
|
fileMatches.push({
|
|
@@ -100,7 +100,7 @@ const contentSegments = computed(() => {
|
|
|
100
100
|
const content = displayContent.value;
|
|
101
101
|
if (!content)
|
|
102
102
|
return [];
|
|
103
|
-
return parseContentWithFiles(content);
|
|
103
|
+
return parseContentWithFiles(content, { preserveMarkdownLinks: true });
|
|
104
104
|
});
|
|
105
105
|
const hasDetectedFiles = computed(() => contentSegments.value.some((s) => s.type !== "text"));
|
|
106
106
|
</script>
|