@adminforth/agent 1.24.12 → 1.24.13

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/build.log CHANGED
@@ -38,5 +38,5 @@ custom/skills/fetch_data/SKILL.md
38
38
  custom/skills/mutate_data/
39
39
  custom/skills/mutate_data/SKILL.md
40
40
 
41
- sent 201,341 bytes received 562 bytes 403,806.00 bytes/sec
42
- total size is 199,037 speedup is 0.99
41
+ sent 202,025 bytes received 566 bytes 405,182.00 bytes/sec
42
+ total size is 199,751 speedup is 0.99
@@ -254,6 +254,7 @@ onMounted(async () => {
254
254
  agentStore.setIsTeleportedToBody(isTeleportedToBodyFromLocalStorage || props.meta.stickByDefault);
255
255
  }
256
256
  await agentStore.fetchSessionsList();
257
+ agentStore.setFullScreen(true);
257
258
  });
258
259
 
259
260
  function autoResize() {
@@ -11,12 +11,16 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
14
+ import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
15
15
  import CustomScrollbar from 'custom-vue-scrollbar';
16
16
  import 'custom-vue-scrollbar/dist/style.css';
17
17
  import { useAgentStore } from './composables/useAgentStore';
18
18
 
19
- const agentStore = useAgentStore();
19
+ const scrollParams = ref({
20
+ scrollTop: 0,
21
+ scrollHeight: 0,
22
+ clientHeight: 0
23
+ });
20
24
 
21
25
  const props = withDefaults(defineProps<{
22
26
  enabled?: boolean
@@ -42,6 +46,9 @@ function isNearBottom(): boolean {
42
46
  if (!container) return true
43
47
 
44
48
  const { scrollTop, scrollHeight, clientHeight } = container
49
+ scrollParams.value.scrollTop = scrollTop
50
+ scrollParams.value.scrollHeight = scrollHeight
51
+ scrollParams.value.clientHeight = clientHeight
45
52
  return scrollHeight - scrollTop - clientHeight <= props.threshold
46
53
  }
47
54
 
@@ -107,6 +114,9 @@ onMounted(() => {
107
114
  }
108
115
 
109
116
  lastScrollHeight = containerRef.value.scrollEl.scrollHeight
117
+ scrollParams.value.scrollTop = containerRef.value.scrollEl.scrollTop
118
+ scrollParams.value.scrollHeight = containerRef.value.scrollEl.scrollHeight
119
+ scrollParams.value.clientHeight = containerRef.value.scrollEl.clientHeight
110
120
  if (props.enabled && !isUserScrolledUp.value) {
111
121
  scrollToBottom()
112
122
  }
@@ -128,7 +138,8 @@ defineExpose({
128
138
  scrollToBottom: () => scrollToBottom(true),
129
139
  isUserScrolledUp: () => isUserScrolledUp.value,
130
140
  container: containerRef,
131
- handleScroll
141
+ handleScroll,
142
+ scrollParams
132
143
  })
133
144
  </script>
134
145
 
@@ -8,7 +8,7 @@
8
8
  class="absolute bg-black/10 backdrop-blur-md z-10 h-full w-full"
9
9
  >
10
10
  </div>
11
- <div class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
11
+ <div ref="chatContainerRef" class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
12
12
  <CustomAutoScrollContainer
13
13
  v-if="showScrollContainer"
14
14
  :enabled="!showScrollToBottomButton"
@@ -24,10 +24,6 @@
24
24
  marginLeft: 'auto',
25
25
  marginRight: 'auto',
26
26
  }"
27
- :contentStyle="{
28
- height: '100%',
29
- maxHeight: '100%',
30
- }"
31
27
  :style="{
32
28
  maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'rem' : '100%',
33
29
  transition: `
@@ -46,11 +42,15 @@
46
42
  </div>
47
43
  <div
48
44
  v-if="props.messages.length === 0"
49
- class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-full"
45
+ class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-max"
46
+ :style="{
47
+ height: chatContainerRef ? chatContainerRef.clientHeight + 'px' : '100%',
48
+ }"
50
49
  >
51
50
  <p>{{ $t('Start the conversation') }}</p>
52
51
  <p class="tracking-normal text-base text">{{ $t('Give any input to begin') }}</p>
53
52
  </div>
53
+ <div></div>
54
54
  </CustomAutoScrollContainer>
55
55
  <button @click="scrollContainer.scrollToBottom();">
56
56
  <IconArrowDownOutline
@@ -83,6 +83,11 @@ const innerScrollContainerRef = ref(null);
83
83
  const agentStore = useAgentStore();
84
84
  const agentTransitions = useAgentTransitions();
85
85
  const showScrollContainer = ref(true);
86
+ const chatContainerRef = ref(null);
87
+
88
+ const scrollHeight = computed(() => {
89
+ return scrollContainer.value ? scrollContainer.value.scrollParams.scrollHeight : 0;
90
+ });
86
91
 
87
92
  function recalculateScroll() {
88
93
  if (scrollContainer.value) {
@@ -254,6 +254,7 @@ onMounted(async () => {
254
254
  agentStore.setIsTeleportedToBody(isTeleportedToBodyFromLocalStorage || props.meta.stickByDefault);
255
255
  }
256
256
  await agentStore.fetchSessionsList();
257
+ agentStore.setFullScreen(true);
257
258
  });
258
259
 
259
260
  function autoResize() {
@@ -11,12 +11,16 @@
11
11
  </template>
12
12
 
13
13
  <script setup lang="ts">
14
- import { ref, onMounted, onUnmounted, nextTick, watch } from 'vue'
14
+ import { ref, onMounted, onUnmounted, nextTick, computed } from 'vue'
15
15
  import CustomScrollbar from 'custom-vue-scrollbar';
16
16
  import 'custom-vue-scrollbar/dist/style.css';
17
17
  import { useAgentStore } from './composables/useAgentStore';
18
18
 
19
- const agentStore = useAgentStore();
19
+ const scrollParams = ref({
20
+ scrollTop: 0,
21
+ scrollHeight: 0,
22
+ clientHeight: 0
23
+ });
20
24
 
21
25
  const props = withDefaults(defineProps<{
22
26
  enabled?: boolean
@@ -42,6 +46,9 @@ function isNearBottom(): boolean {
42
46
  if (!container) return true
43
47
 
44
48
  const { scrollTop, scrollHeight, clientHeight } = container
49
+ scrollParams.value.scrollTop = scrollTop
50
+ scrollParams.value.scrollHeight = scrollHeight
51
+ scrollParams.value.clientHeight = clientHeight
45
52
  return scrollHeight - scrollTop - clientHeight <= props.threshold
46
53
  }
47
54
 
@@ -107,6 +114,9 @@ onMounted(() => {
107
114
  }
108
115
 
109
116
  lastScrollHeight = containerRef.value.scrollEl.scrollHeight
117
+ scrollParams.value.scrollTop = containerRef.value.scrollEl.scrollTop
118
+ scrollParams.value.scrollHeight = containerRef.value.scrollEl.scrollHeight
119
+ scrollParams.value.clientHeight = containerRef.value.scrollEl.clientHeight
110
120
  if (props.enabled && !isUserScrolledUp.value) {
111
121
  scrollToBottom()
112
122
  }
@@ -128,7 +138,8 @@ defineExpose({
128
138
  scrollToBottom: () => scrollToBottom(true),
129
139
  isUserScrolledUp: () => isUserScrolledUp.value,
130
140
  container: containerRef,
131
- handleScroll
141
+ handleScroll,
142
+ scrollParams
132
143
  })
133
144
  </script>
134
145
 
@@ -8,7 +8,7 @@
8
8
  class="absolute bg-black/10 backdrop-blur-md z-10 h-full w-full"
9
9
  >
10
10
  </div>
11
- <div class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
11
+ <div ref="chatContainerRef" class="relative flex-1 min-h-0 overflow-hidden" @click="recalculateScroll()">
12
12
  <CustomAutoScrollContainer
13
13
  v-if="showScrollContainer"
14
14
  :enabled="!showScrollToBottomButton"
@@ -24,10 +24,6 @@
24
24
  marginLeft: 'auto',
25
25
  marginRight: 'auto',
26
26
  }"
27
- :contentStyle="{
28
- height: '100%',
29
- maxHeight: '100%',
30
- }"
31
27
  :style="{
32
28
  maxWidth: agentStore.isFullScreen ? agentStore.MAX_WIDTH+'rem' : '100%',
33
29
  transition: `
@@ -46,11 +42,15 @@
46
42
  </div>
47
43
  <div
48
44
  v-if="props.messages.length === 0"
49
- class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-full"
45
+ class="flex-1 flex flex-col items-center justify-center text-gray-400 tracking-widest text-xl font-medium h-max"
46
+ :style="{
47
+ height: chatContainerRef ? chatContainerRef.clientHeight + 'px' : '100%',
48
+ }"
50
49
  >
51
50
  <p>{{ $t('Start the conversation') }}</p>
52
51
  <p class="tracking-normal text-base text">{{ $t('Give any input to begin') }}</p>
53
52
  </div>
53
+ <div></div>
54
54
  </CustomAutoScrollContainer>
55
55
  <button @click="scrollContainer.scrollToBottom();">
56
56
  <IconArrowDownOutline
@@ -83,6 +83,11 @@ const innerScrollContainerRef = ref(null);
83
83
  const agentStore = useAgentStore();
84
84
  const agentTransitions = useAgentTransitions();
85
85
  const showScrollContainer = ref(true);
86
+ const chatContainerRef = ref(null);
87
+
88
+ const scrollHeight = computed(() => {
89
+ return scrollContainer.value ? scrollContainer.value.scrollParams.scrollHeight : 0;
90
+ });
86
91
 
87
92
  function recalculateScroll() {
88
93
  if (scrollContainer.value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.24.12",
3
+ "version": "1.24.13",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",