@adminforth/agent 1.27.4 → 1.27.6

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 207,560 bytes received 562 bytes 138,748.00 bytes/sec
42
- total size is 205,246 speedup is 0.99
41
+ sent 207,807 bytes received 562 bytes 416,738.00 bytes/sec
42
+ total size is 205,493 speedup is 0.99
@@ -219,7 +219,7 @@ const isModeMenuOpen = ref(false);
219
219
  let startX = 0
220
220
  let startWidth = 0
221
221
 
222
- onClickOutside(chatSurface, () => {if (!agentStore.isTeleportedToBody) agentStore.setIsChatOpen(false);});
222
+ onClickOutside(chatSurface, () => {if (!agentStore.isTeleportedToBody && !agentStore.isFullScreen) agentStore.setIsChatOpen(false);});
223
223
  onClickOutside(modeMenu, () => { isModeMenuOpen.value = false; });
224
224
 
225
225
  onMounted(async () => {
@@ -89,7 +89,7 @@ onUnmounted(() => {
89
89
  observer?.disconnect()
90
90
  })
91
91
 
92
- function isNearBottom(): boolean {
92
+ function isNearBottom(customThreshold?: number): boolean {
93
93
  const container = containerRef.value?.scrollEl
94
94
  if (!container) return true
95
95
 
@@ -97,7 +97,8 @@ function isNearBottom(): boolean {
97
97
  scrollParams.value.scrollTop = scrollTop
98
98
  scrollParams.value.scrollHeight = scrollHeight
99
99
  scrollParams.value.clientHeight = clientHeight
100
- return scrollHeight - scrollTop - clientHeight <= props.threshold
100
+ const threshold = customThreshold ?? props.threshold
101
+ return scrollHeight - scrollTop - clientHeight <= threshold
101
102
  }
102
103
 
103
104
  function scrollToBottom(force = false): void {
@@ -119,7 +120,7 @@ function hasScrollbar(): boolean {
119
120
  }
120
121
 
121
122
 
122
- function handleScroll(detectScrollDown = true): void {
123
+ function handleScroll(detectScrollDown = true, customThreshold?: number): void {
123
124
  const container = containerRef.value.scrollEl
124
125
  if (!container) return
125
126
 
@@ -130,7 +131,7 @@ function handleScroll(detectScrollDown = true): void {
130
131
  lastScrollHeight = scrollHeight
131
132
  return
132
133
  }
133
- if (isNearBottom()) {
134
+ if (isNearBottom(customThreshold)) {
134
135
  isUserScrolledUp.value = false
135
136
  } else {
136
137
  const isScrollingUp = scrollTop < lastScrollTop
@@ -14,7 +14,7 @@
14
14
  :enabled="!showScrollToBottomButton"
15
15
  class="relative h-full flex flex-col overflow-y-auto translate-x-[-50%] left-1/2"
16
16
  ref="scrollContainer"
17
- :threshold="10"
17
+ :threshold="THRESHOLD_TO_SHOW_BUTTON"
18
18
  behavior="smooth"
19
19
  :wrapperStyle = "{
20
20
  height: '100%',
@@ -111,6 +111,7 @@ const showBottomSpacer = ref(false);
111
111
  const spacerHeight = ref(0);
112
112
  const MASK_HEIGHT = 20;
113
113
  const EMPTY_MESSAGE_HEIGHT = 18;
114
+ const THRESHOLD_TO_SHOW_BUTTON = 10;
114
115
  let messageResizeObserver: ResizeObserver | null = null;
115
116
  let observedLastUserMessageElement: HTMLElement | null = null;
116
117
  let observedLastAgentMessageElement: HTMLElement | null = null;
@@ -275,7 +276,7 @@ async function handleSendMessage() {
275
276
 
276
277
  function recalculateScroll() {
277
278
  if (scrollContainer.value) {
278
- scrollContainer.value.handleScroll(false);
279
+ scrollContainer.value.handleScroll(false,spacerHeight.value + THRESHOLD_TO_SHOW_BUTTON);
279
280
  const isScrolledUp = scrollContainer.value.isUserScrolledUp();
280
281
  showScrollToBottomButton.value = !!isScrolledUp;
281
282
  }
@@ -219,7 +219,7 @@ const isModeMenuOpen = ref(false);
219
219
  let startX = 0
220
220
  let startWidth = 0
221
221
 
222
- onClickOutside(chatSurface, () => {if (!agentStore.isTeleportedToBody) agentStore.setIsChatOpen(false);});
222
+ onClickOutside(chatSurface, () => {if (!agentStore.isTeleportedToBody && !agentStore.isFullScreen) agentStore.setIsChatOpen(false);});
223
223
  onClickOutside(modeMenu, () => { isModeMenuOpen.value = false; });
224
224
 
225
225
  onMounted(async () => {
@@ -89,7 +89,7 @@ onUnmounted(() => {
89
89
  observer?.disconnect()
90
90
  })
91
91
 
92
- function isNearBottom(): boolean {
92
+ function isNearBottom(customThreshold?: number): boolean {
93
93
  const container = containerRef.value?.scrollEl
94
94
  if (!container) return true
95
95
 
@@ -97,7 +97,8 @@ function isNearBottom(): boolean {
97
97
  scrollParams.value.scrollTop = scrollTop
98
98
  scrollParams.value.scrollHeight = scrollHeight
99
99
  scrollParams.value.clientHeight = clientHeight
100
- return scrollHeight - scrollTop - clientHeight <= props.threshold
100
+ const threshold = customThreshold ?? props.threshold
101
+ return scrollHeight - scrollTop - clientHeight <= threshold
101
102
  }
102
103
 
103
104
  function scrollToBottom(force = false): void {
@@ -119,7 +120,7 @@ function hasScrollbar(): boolean {
119
120
  }
120
121
 
121
122
 
122
- function handleScroll(detectScrollDown = true): void {
123
+ function handleScroll(detectScrollDown = true, customThreshold?: number): void {
123
124
  const container = containerRef.value.scrollEl
124
125
  if (!container) return
125
126
 
@@ -130,7 +131,7 @@ function handleScroll(detectScrollDown = true): void {
130
131
  lastScrollHeight = scrollHeight
131
132
  return
132
133
  }
133
- if (isNearBottom()) {
134
+ if (isNearBottom(customThreshold)) {
134
135
  isUserScrolledUp.value = false
135
136
  } else {
136
137
  const isScrollingUp = scrollTop < lastScrollTop
@@ -14,7 +14,7 @@
14
14
  :enabled="!showScrollToBottomButton"
15
15
  class="relative h-full flex flex-col overflow-y-auto translate-x-[-50%] left-1/2"
16
16
  ref="scrollContainer"
17
- :threshold="10"
17
+ :threshold="THRESHOLD_TO_SHOW_BUTTON"
18
18
  behavior="smooth"
19
19
  :wrapperStyle = "{
20
20
  height: '100%',
@@ -111,6 +111,7 @@ const showBottomSpacer = ref(false);
111
111
  const spacerHeight = ref(0);
112
112
  const MASK_HEIGHT = 20;
113
113
  const EMPTY_MESSAGE_HEIGHT = 18;
114
+ const THRESHOLD_TO_SHOW_BUTTON = 10;
114
115
  let messageResizeObserver: ResizeObserver | null = null;
115
116
  let observedLastUserMessageElement: HTMLElement | null = null;
116
117
  let observedLastAgentMessageElement: HTMLElement | null = null;
@@ -275,7 +276,7 @@ async function handleSendMessage() {
275
276
 
276
277
  function recalculateScroll() {
277
278
  if (scrollContainer.value) {
278
- scrollContainer.value.handleScroll(false);
279
+ scrollContainer.value.handleScroll(false,spacerHeight.value + THRESHOLD_TO_SHOW_BUTTON);
279
280
  const isScrolledUp = scrollContainer.value.isUserScrolledUp();
280
281
  showScrollToBottomButton.value = !!isScrolledUp;
281
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.27.4",
3
+ "version": "1.27.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",