@aleph-alpha/chat-kit 0.6.0 → 0.6.1

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.
@@ -59,7 +59,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
59
59
  const scrollContainerRef = ref(null);
60
60
  const containerHeight = ref(0);
61
61
  const isAutoScrollEnabled = ref(true);
62
- const isProgrammaticScroll = ref(false);
63
62
  const hasBottomSpacer = ref(false);
64
63
  const spacerHeight = ref(0);
65
64
  let resizeObserver = null;
@@ -89,10 +88,9 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
89
88
  if (!lastRow) return true;
90
89
  const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
91
90
  const viewportBottom = container.scrollTop + container.clientHeight;
92
- return viewportBottom >= lastRowBottom - 100;
91
+ return viewportBottom >= lastRowBottom - 10;
93
92
  }
94
93
  function handleScroll() {
95
- if (isProgrammaticScroll.value) return;
96
94
  isAutoScrollEnabled.value = isFollowingContent();
97
95
  }
98
96
  function updateSpacerHeight() {
@@ -128,15 +126,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
128
126
  const userRows = container.querySelectorAll('[data-message-row="user"]');
129
127
  const lastUserRow = userRows[userRows.length - 1];
130
128
  if (lastUserRow) {
131
- isProgrammaticScroll.value = true;
132
129
  lastUserRow.scrollIntoView({ behavior: "smooth", block: "start" });
133
- container.addEventListener(
134
- "scrollend",
135
- () => {
136
- isProgrammaticScroll.value = false;
137
- },
138
- { once: true }
139
- );
140
130
  }
141
131
  isAutoScrollEnabled.value = true;
142
132
  });
@@ -150,11 +140,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
150
140
  const lastRowBottom = lastRow.offsetTop + lastRow.offsetHeight;
151
141
  const viewportBottom = container.scrollTop + container.clientHeight;
152
142
  if (lastRowBottom > viewportBottom) {
153
- isProgrammaticScroll.value = true;
154
143
  container.scrollTop = lastRowBottom - container.clientHeight;
155
- requestAnimationFrame(() => {
156
- isProgrammaticScroll.value = false;
157
- });
158
144
  }
159
145
  }
160
146
  watch(
@@ -187,7 +173,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
187
173
  return openBlock(), createElementBlock("div", {
188
174
  ref_key: "scrollContainerRef",
189
175
  ref: scrollContainerRef,
190
- class: "flex flex-col gap-4 overflow-y-auto",
176
+ class: "relative flex flex-col gap-4 overflow-y-auto",
191
177
  onScroll: handleScroll
192
178
  }, [
193
179
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.messages, (message) => {
@@ -1 +1 @@
1
- {"version":3,"file":"CkConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkConversationLayout/CkConversationLayout.vue"],"names":[],"mappings":"AA8ME,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC9D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WA+PO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB;kBA3PzC,CAAC,EAAE;MA2PyD,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC1I,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;wBAxPS,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;yBAC9B,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;;UAyP7C,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"CkConversationLayout.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/base/CkConversationLayout/CkConversationLayout.vue"],"names":[],"mappings":"AAoME,QAAA,MAAM,YAAY,GAAK,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAC9D,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,gBAAgB,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EAClE;WAkPO,OAAO,KAAK,EAAE,WAAW,GAAG,mBAAmB;kBA9OzC,CAAC,EAAE;MA8OyD,GAAG,CAAC,OAAO,UAAU,SAAS;QAAE,oBAAoB,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,CAAC,GAAG,EAAE,CAAC;YAC1I,CAAC,OAAO,EAAE,EAAE,KAAK,IAAI;WACtB,GAAG;;wBA3OS,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;yBAC9B,CAAC,KAAK,EAAE;YAAE,OAAO,EAAE,CAAC,CAAA;SAAE,KAAK,IAAI;;UA4O7C,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAI,CAAC;wBACvD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,CAAC,GAAG,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { _, a, b, c, d, e, f, g, h } from "../CkInput.vue_vue_type_script_setup_true_lang-UrrLmx86.js";
1
+ import { _, a, b, c, d, e, f, g, h } from "../CkInput.vue_vue_type_script_setup_true_lang-BWh7IesK.js";
2
2
  export {
3
3
  _ as CkAgentMessage,
4
4
  a as CkConversation,
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { C } from "./ChatService-LogwJNxh.js";
2
2
  import { u } from "./useMessageHandler-D7OdrrcB.js";
3
3
  import { C as C2, d, p, u as u2, a } from "./useChatKitLabels-xZXcnxZZ.js";
4
4
  import { useChat } from "./composables/index.js";
5
- import { _, a as a2, b, c, d as d2, e, f, g, h } from "./CkInput.vue_vue_type_script_setup_true_lang-UrrLmx86.js";
5
+ import { _, a as a2, b, c, d as d2, e, f, g, h } from "./CkInput.vue_vue_type_script_setup_true_lang-BWh7IesK.js";
6
6
  export {
7
7
  C2 as CHAT_KIT_LABELS,
8
8
  C as ChatService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aleph-alpha/chat-kit",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Chat kit package for building chat interfaces with Vue",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",