@copilotkit/vue 1.69.1 → 1.69.2

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.
Files changed (45) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.mjs +2 -2
  3. package/dist/use-render-activity-message-CIlNtfvE.cjs +85 -0
  4. package/dist/use-render-activity-message-CIlNtfvE.cjs.map +1 -0
  5. package/dist/{use-render-activity-message-CADUB--8.js → use-render-activity-message-Db2rOZkW.js} +3940 -4241
  6. package/dist/use-render-activity-message-Db2rOZkW.js.map +1 -0
  7. package/dist/v2/components/CopilotKitInspector.vue.d.ts +0 -2
  8. package/dist/v2/components/CopilotKitInspector.vue.d.ts.map +1 -1
  9. package/dist/v2/components/OpenGenerativeUIRenderer.d.ts.map +1 -1
  10. package/dist/v2/components/chat/CopilotChatAssistantMessage.vue.d.ts.map +1 -1
  11. package/dist/v2/components/chat/CopilotChatInput.vue.d.ts +0 -18
  12. package/dist/v2/components/chat/CopilotChatInput.vue.d.ts.map +1 -1
  13. package/dist/v2/components/chat/CopilotChatMessageView.vue.d.ts.map +1 -1
  14. package/dist/v2/components/chat/CopilotChatReasoningMessage.vue.d.ts.map +1 -1
  15. package/dist/v2/components/chat/CopilotChatToolCallsView.vue.d.ts.map +1 -1
  16. package/dist/v2/components/icons/index.d.ts +1 -1
  17. package/dist/v2/components/icons/index.d.ts.map +1 -1
  18. package/dist/v2/index.cjs +1 -1
  19. package/dist/v2/index.mjs +1 -1
  20. package/dist/v2/providers/CopilotKitProvider.vue.d.ts.map +1 -1
  21. package/dist/v2/providers/keys.d.ts +0 -36
  22. package/dist/v2/providers/keys.d.ts.map +1 -1
  23. package/dist/v2/providers/types.d.ts +0 -3
  24. package/dist/v2/providers/types.d.ts.map +1 -1
  25. package/package.json +5 -5
  26. package/src/v2/components/CopilotKitInspector.vue +1 -19
  27. package/src/v2/components/OpenGenerativeUIRenderer.ts +1 -42
  28. package/src/v2/components/chat/CopilotChatAssistantMessage.vue +1 -52
  29. package/src/v2/components/chat/CopilotChatMessageView.vue +23 -57
  30. package/src/v2/components/chat/CopilotChatReasoningMessage.vue +32 -68
  31. package/src/v2/components/chat/CopilotChatToolCallsView.vue +16 -70
  32. package/src/v2/components/icons/__tests__/icons.test.ts +0 -2
  33. package/src/v2/components/icons/index.ts +0 -1
  34. package/src/v2/providers/CopilotKitProvider.vue +6 -66
  35. package/src/v2/providers/keys.ts +0 -47
  36. package/src/v2/providers/types.ts +0 -3
  37. package/dist/use-render-activity-message-BtaJ2iQc.cjs +0 -97
  38. package/dist/use-render-activity-message-BtaJ2iQc.cjs.map +0 -1
  39. package/dist/use-render-activity-message-CADUB--8.js.map +0 -1
  40. package/dist/v2/components/chat/SaveSnippetBeside.vue.d.ts +0 -20
  41. package/dist/v2/components/chat/SaveSnippetBeside.vue.d.ts.map +0 -1
  42. package/dist/v2/components/chat/save-snippet-beside.d.ts +0 -20
  43. package/dist/v2/components/chat/save-snippet-beside.d.ts.map +0 -1
  44. package/src/v2/components/chat/SaveSnippetBeside.vue +0 -82
  45. package/src/v2/components/chat/save-snippet-beside.ts +0 -84
@@ -1,20 +0,0 @@
1
- type __VLS_Props = {
2
- enabled: boolean;
3
- };
4
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
5
- type __VLS_Slots = {} & {
6
- default?: (props: typeof __VLS_1) => any;
7
- } & {
8
- default?: (props: typeof __VLS_3) => any;
9
- } & {
10
- save?: (props: typeof __VLS_5) => any;
11
- };
12
- declare const __VLS_component: 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>;
13
- declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
14
- export default _default;
15
- type __VLS_WithSlots<T, S> = T & {
16
- new (): {
17
- $slots: S;
18
- };
19
- };
20
- //# sourceMappingURL=SaveSnippetBeside.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SaveSnippetBeside.vue.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/SaveSnippetBeside.vue"],"names":[],"mappings":"AA8FA,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAoFF,QAAA,IAAI,OAAO,IAAU,EAAE,OAAO,IAAU,EAAE,OAAO,IAAW,CAAE;AAC9D,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,GAC5C;IAAE,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA4B5C,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,20 +0,0 @@
1
- export declare const SAVE_SNIPPET_ICON_SLOT_PX = 36;
2
- export declare const SAVE_SNIPPET_BESIDE_WRAP_CLASS = "cpk:relative cpk:w-full cpk:overflow-visible";
3
- export declare const SAVE_SNIPPET_BESIDE_BODY_CLASS = "cpk:w-full";
4
- export declare const SAVE_SNIPPET_BESIDE_SAVE_CLASS = "cpk:absolute cpk:top-0 cpk:z-10";
5
- export declare function saveSnippetBesideStyle(side: "left" | "right"): {
6
- readonly left: "auto";
7
- readonly right: "100%";
8
- readonly marginLeft: "0px";
9
- readonly marginRight: "4px";
10
- } | {
11
- readonly left: "100%";
12
- readonly right: "auto";
13
- readonly marginLeft: "4px";
14
- readonly marginRight: "0px";
15
- };
16
- export declare function pickSaveSnippetSide(roomRight: number, roomLeft: number, slotPx?: number): "left" | "right";
17
- export declare function findOverflowAncestor(el: HTMLElement): HTMLElement;
18
- export declare function measurableBox(el: HTMLElement): HTMLElement;
19
- export declare function measureSaveSnippetSide(wrap: HTMLElement, body: HTMLElement): "left" | "right";
20
- //# sourceMappingURL=save-snippet-beside.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"save-snippet-beside.d.ts","sourceRoot":"","sources":["../../../../src/v2/components/chat/save-snippet-beside.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,eAAO,MAAM,8BAA8B,iDACK,CAAC;AAEjD,eAAO,MAAM,8BAA8B,eAAe,CAAC;AAE3D,eAAO,MAAM,8BAA8B,oCAAoC,CAAC;AAEhF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;;;;;;;;;;EAe5D;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,SAA4B,GACjC,MAAM,GAAG,OAAO,CAQlB;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,CAmBjE;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,WAAW,GAAG,WAAW,CAM1D;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,WAAW,GAChB,MAAM,GAAG,OAAO,CAWlB"}
@@ -1,82 +0,0 @@
1
- <script setup lang="ts">
2
- import { onBeforeUnmount, onMounted, ref, watch } from "vue";
3
- import {
4
- SAVE_SNIPPET_BESIDE_BODY_CLASS,
5
- SAVE_SNIPPET_BESIDE_SAVE_CLASS,
6
- SAVE_SNIPPET_BESIDE_WRAP_CLASS,
7
- findOverflowAncestor,
8
- measureSaveSnippetSide,
9
- saveSnippetBesideStyle,
10
- } from "./save-snippet-beside";
11
-
12
- const props = defineProps<{
13
- enabled: boolean;
14
- }>();
15
-
16
- const wrapRef = ref<HTMLElement | null>(null);
17
- const bodyRef = ref<HTMLElement | null>(null);
18
- const side = ref<"left" | "right">("right");
19
- let observer: ResizeObserver | undefined;
20
-
21
- function measure() {
22
- const wrap = wrapRef.value;
23
- const body = bodyRef.value;
24
- if (!props.enabled || !wrap || !body) {
25
- return;
26
- }
27
- side.value = measureSaveSnippetSide(wrap, body);
28
- }
29
-
30
- function bindObserver() {
31
- observer?.disconnect();
32
- const wrap = wrapRef.value;
33
- const body = bodyRef.value;
34
- if (!props.enabled || !wrap || !body) {
35
- return;
36
- }
37
- measure();
38
- if (typeof ResizeObserver === "undefined") {
39
- return;
40
- }
41
- observer = new ResizeObserver(measure);
42
- observer.observe(wrap);
43
- observer.observe(body);
44
- const clip = findOverflowAncestor(wrap);
45
- if (clip !== wrap) {
46
- observer.observe(clip);
47
- }
48
- }
49
-
50
- onMounted(() => {
51
- watch([wrapRef, bodyRef, () => props.enabled], () => bindObserver(), {
52
- flush: "post",
53
- immediate: true,
54
- });
55
- window.addEventListener("resize", measure);
56
- });
57
-
58
- onBeforeUnmount(() => {
59
- observer?.disconnect();
60
- window.removeEventListener("resize", measure);
61
- });
62
- </script>
63
-
64
- <template>
65
- <slot v-if="!enabled" />
66
- <div
67
- v-else
68
- ref="wrapRef"
69
- :class="SAVE_SNIPPET_BESIDE_WRAP_CLASS"
70
- :data-save-snippet-side="side"
71
- >
72
- <div ref="bodyRef" :class="SAVE_SNIPPET_BESIDE_BODY_CLASS">
73
- <slot />
74
- </div>
75
- <div
76
- :class="SAVE_SNIPPET_BESIDE_SAVE_CLASS"
77
- :style="saveSnippetBesideStyle(side)"
78
- >
79
- <slot name="save" />
80
- </div>
81
- </div>
82
- </template>
@@ -1,84 +0,0 @@
1
- export const SAVE_SNIPPET_ICON_SLOT_PX = 36;
2
-
3
- export const SAVE_SNIPPET_BESIDE_WRAP_CLASS =
4
- "cpk:relative cpk:w-full cpk:overflow-visible";
5
-
6
- export const SAVE_SNIPPET_BESIDE_BODY_CLASS = "cpk:w-full";
7
-
8
- export const SAVE_SNIPPET_BESIDE_SAVE_CLASS = "cpk:absolute cpk:top-0 cpk:z-10";
9
-
10
- export function saveSnippetBesideStyle(side: "left" | "right") {
11
- if (side === "left") {
12
- return {
13
- left: "auto",
14
- right: "100%",
15
- marginLeft: "0px",
16
- marginRight: "4px",
17
- } as const;
18
- }
19
- return {
20
- left: "100%",
21
- right: "auto",
22
- marginLeft: "4px",
23
- marginRight: "0px",
24
- } as const;
25
- }
26
-
27
- export function pickSaveSnippetSide(
28
- roomRight: number,
29
- roomLeft: number,
30
- slotPx = SAVE_SNIPPET_ICON_SLOT_PX,
31
- ): "left" | "right" {
32
- if (roomRight >= slotPx) {
33
- return "right";
34
- }
35
- if (roomLeft >= slotPx) {
36
- return "left";
37
- }
38
- return "right";
39
- }
40
-
41
- export function findOverflowAncestor(el: HTMLElement): HTMLElement {
42
- let node: HTMLElement | null = el.parentElement;
43
- while (node) {
44
- const style = getComputedStyle(node);
45
- const overflowX = style.overflowX;
46
- const overflow = style.overflow;
47
- if (
48
- overflowX === "hidden" ||
49
- overflowX === "auto" ||
50
- overflowX === "scroll" ||
51
- overflow === "hidden" ||
52
- overflow === "auto" ||
53
- overflow === "scroll"
54
- ) {
55
- return node;
56
- }
57
- node = node.parentElement;
58
- }
59
- return document.documentElement;
60
- }
61
-
62
- export function measurableBox(el: HTMLElement): HTMLElement {
63
- let node: HTMLElement | null = el;
64
- while (node && getComputedStyle(node).display === "contents") {
65
- node = node.firstElementChild as HTMLElement | null;
66
- }
67
- return node ?? el;
68
- }
69
-
70
- export function measureSaveSnippetSide(
71
- wrap: HTMLElement,
72
- body: HTMLElement,
73
- ): "left" | "right" {
74
- const clip = findOverflowAncestor(wrap);
75
- const clipRect = clip.getBoundingClientRect();
76
- const box = measurableBox(
77
- (body.firstElementChild as HTMLElement | null) ?? body,
78
- );
79
- const bodyRect = box.getBoundingClientRect();
80
- return pickSaveSnippetSide(
81
- clipRect.right - bodyRect.right,
82
- bodyRect.left - clipRect.left,
83
- );
84
- }