@evercam/ui 0.0.63-preview-copilot-annotations-ed807c126 → 0.0.63-preview-emarkdown-tables-cdc161d26
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/components/chat/EChatMessage.vue.d.ts +1 -1
- package/dist/components/chat/EMarkdown.vue.d.ts +3 -25
- package/dist/components/chat/MarkdownProcessor.d.ts +53 -0
- package/dist/index.mjs +1246 -1178
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +13 -12
- package/dist/index.umd.js.map +1 -1
- package/dist/types.d.ts +4 -0
- package/dist/web-types.json +1 -1
- package/package.json +1 -1
|
@@ -2,13 +2,13 @@ import Vue from "vue";
|
|
|
2
2
|
import { ChatMessageRole, EMarkdownRegex, Feedback } from '../../types';
|
|
3
3
|
declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, {
|
|
4
4
|
showActions: boolean;
|
|
5
|
+
nextChunks: string[];
|
|
5
6
|
}, {
|
|
6
7
|
onMouseOver(): void;
|
|
7
8
|
onMouseLeave(e: MouseEvent): void;
|
|
8
9
|
onFeedback(feedback: Feedback): void;
|
|
9
10
|
}, {
|
|
10
11
|
isBotRole: boolean;
|
|
11
|
-
isStream: boolean;
|
|
12
12
|
userMessageClasses: Record<string, boolean>;
|
|
13
13
|
logoClasses: Record<string, boolean>;
|
|
14
14
|
dotColor: string;
|
|
@@ -1,34 +1,12 @@
|
|
|
1
1
|
import Vue from "vue";
|
|
2
2
|
import { EMarkdownRegex } from '../../types';
|
|
3
|
-
import {
|
|
3
|
+
import { MarkdownProcessor } from '../../components/chat/MarkdownProcessor';
|
|
4
4
|
declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, {
|
|
5
5
|
isProcessing: boolean;
|
|
6
|
-
|
|
7
|
-
renderTargets: Record<string, {
|
|
8
|
-
match: string;
|
|
9
|
-
type: string;
|
|
10
|
-
}>;
|
|
11
|
-
isRenderingTable: boolean;
|
|
12
|
-
isIncompleteTableRow: boolean;
|
|
13
|
-
processor: import("unified").Processor<undefined, undefined, undefined, undefined, undefined> | null;
|
|
14
|
-
accumulator: string;
|
|
15
|
-
lastProcessedLength: number;
|
|
6
|
+
processor: MarkdownProcessor | null;
|
|
16
7
|
}, {
|
|
17
|
-
initTypewriter(): void;
|
|
18
8
|
initProcessor(): void;
|
|
19
|
-
processMarkdown(markdown: string): Promise<string | null>;
|
|
20
|
-
remarkCustomRegex(regexList: EMarkdownRegex[]): (tree: UnistNode) => void;
|
|
21
|
-
processTextNode(node: UnistNode, nodeIndex: number, parent: UnistParent, regex: RegExp, type: string): any[] | undefined;
|
|
22
|
-
replaceRegexTargets(parts: string[], regex: RegExp, type: string, node: UnistNode, nodeIndex: number): ({
|
|
23
|
-
type: string;
|
|
24
|
-
value: string;
|
|
25
|
-
} | null)[];
|
|
26
|
-
generateUniqueId(node: UnistNode, nodeIndex: number, partIndex: number, type: string): string;
|
|
27
|
-
remarkCheckIncompleteTableRows(): (tree: UnistNode) => void;
|
|
28
9
|
processChunk(newChunk: string): Promise<void>;
|
|
29
|
-
animateNewChunk(processedHtml: string): Promise<void>;
|
|
30
|
-
getNewContent(processedHtml: string): string;
|
|
31
|
-
updateContent(processedHtml: string): void;
|
|
32
10
|
handleNewChunk(newChunk: string): Promise<void>;
|
|
33
11
|
processInitialChunks(): Promise<void>;
|
|
34
12
|
renderRegexesScopedSlots(): void;
|
|
@@ -40,7 +18,7 @@ declare const _default: import("vue/types/vue").ExtendedVue<Vue<Record<string, a
|
|
|
40
18
|
};
|
|
41
19
|
}): import("vue/types/vue").CombinedVueInstance<Vue<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => Vue<Record<string, any>, Record<string, any>, never, never, any>>, object, object, object, Record<never, any>, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue/types/v3-component-public-instance").OptionTypesType<{}, {}, {}, {}, {}, {}>> | undefined;
|
|
42
20
|
}, unknown, {
|
|
43
|
-
|
|
21
|
+
nextChunks: string | string[];
|
|
44
22
|
exposedRegexes: EMarkdownRegex[];
|
|
45
23
|
animated: boolean;
|
|
46
24
|
dark: boolean;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Processor as UnifiedJsProcessor } from "unified";
|
|
2
|
+
import { UnistNode, UnistParent } from "unist-util-visit/lib";
|
|
3
|
+
import Typewriter from "typewriter-effect/dist/core";
|
|
4
|
+
import { EMarkdownRegex, EMarkdownRegexMatch } from '../../types';
|
|
5
|
+
export declare class MarkdownProcessor {
|
|
6
|
+
container: HTMLElement;
|
|
7
|
+
htmlRenderingTarget: HTMLElement;
|
|
8
|
+
processor: UnifiedJsProcessor | null;
|
|
9
|
+
accumulator: string;
|
|
10
|
+
totalMarkdown: string;
|
|
11
|
+
lastProcessedLength: number;
|
|
12
|
+
exposedRegexes: EMarkdownRegex[];
|
|
13
|
+
regexRenderTargetsById: Record<string, EMarkdownRegexMatch>;
|
|
14
|
+
isRenderingTable: boolean;
|
|
15
|
+
isFirstTableRender: boolean;
|
|
16
|
+
mdTableHeaderString: string;
|
|
17
|
+
isIncompleteTableRow: boolean;
|
|
18
|
+
pendingRowString: string;
|
|
19
|
+
tableId: number;
|
|
20
|
+
animated: boolean;
|
|
21
|
+
onAnimationStart: () => void;
|
|
22
|
+
onAnimationEnd: () => void;
|
|
23
|
+
typewriter: Typewriter | null;
|
|
24
|
+
constructor(container: HTMLElement, config: {
|
|
25
|
+
exposedRegexes?: {
|
|
26
|
+
regex: RegExp;
|
|
27
|
+
type: string;
|
|
28
|
+
}[];
|
|
29
|
+
animated?: boolean;
|
|
30
|
+
onAnimationStart?: () => void;
|
|
31
|
+
onAnimationEnd?: () => void;
|
|
32
|
+
});
|
|
33
|
+
initProcessor(): void;
|
|
34
|
+
remarkCheckIncompleteTableRows(): (tree: UnistNode) => void;
|
|
35
|
+
setIsRenderingTable(v: boolean): void;
|
|
36
|
+
processMarkdown(markdown: string): Promise<boolean>;
|
|
37
|
+
render(processedHtml: string): Promise<void>;
|
|
38
|
+
updateTableContent(processedHtml: string): void;
|
|
39
|
+
processTextNode(node: UnistNode, nodeIndex: number, parent: UnistParent, regex: RegExp, type: string): void;
|
|
40
|
+
replaceRegexTargets(parts: string[], regex: RegExp, type: string, node: any, nodeIndex: number): import("unist").Node[];
|
|
41
|
+
ensureTableExists(container: HTMLElement): HTMLTableElement;
|
|
42
|
+
ensureTBodyExists(table: HTMLTableElement): HTMLTableSectionElement;
|
|
43
|
+
copyTableHead(sourceTable: HTMLTableElement, destinationTable: HTMLTableElement): void;
|
|
44
|
+
copyTableBodyRows(sourceTBody: HTMLTableSectionElement, destinationTBody: HTMLTableSectionElement): void;
|
|
45
|
+
removeEmptyTableRows(tableElement: HTMLTableElement): void;
|
|
46
|
+
getRegexRenderTargets(): Record<string, EMarkdownRegexMatch>;
|
|
47
|
+
clearRegexRenderTargets(): void;
|
|
48
|
+
extractTableFromHtml(processedHtml: string): HTMLTableElement | null;
|
|
49
|
+
updateContent(processedHtml: string): void;
|
|
50
|
+
initTypewriter(): any;
|
|
51
|
+
animateNewChunk(processedHtml: string): Promise<void>;
|
|
52
|
+
getNewContent(processedHtml: string): string;
|
|
53
|
+
}
|