@gsa-tts/graymatter-ui 2.0.4 → 2.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gsa-tts/graymatter-ui",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,9 +9,27 @@
9
9
 
10
10
  let sideMenuElement = $state<HTMLDivElement | null>(null);
11
11
  let pendingMobileHash: string | null = null;
12
+ let sectionVisibleTimer: ReturnType<typeof setTimeout> | null = null;
12
13
 
13
14
  let { logoLinkUrl, logoLinkLabel, children } = $props();
14
15
 
16
+ // Announce the section after the scroll settles, so the header picks up the
17
+ // final position rather than the pre-scroll one.
18
+ function scheduleSectionVisible(el: Element) {
19
+ if (sectionVisibleTimer) clearTimeout(sectionVisibleTimer);
20
+ sectionVisibleTimer = setTimeout(() => {
21
+ sectionVisibleTimer = null;
22
+ window.dispatchEvent(
23
+ new CustomEvent('sectionVisible', {
24
+ detail: {
25
+ title: el.textContent?.trim(),
26
+ id: el.id,
27
+ },
28
+ })
29
+ );
30
+ }, 100);
31
+ }
32
+
15
33
  function handleMobileAnchorNavigate(event: Event) {
16
34
  const customEvent = event as CustomEvent;
17
35
  pendingMobileHash = customEvent.detail.hash;
@@ -34,16 +52,7 @@
34
52
  mobileContent.scrollTo({ top: scrollTop, behavior: 'auto' });
35
53
 
36
54
  // Update header after scroll completes
37
- setTimeout(() => {
38
- window.dispatchEvent(
39
- new CustomEvent('sectionVisible', {
40
- detail: {
41
- title: mobileAnchor.textContent?.trim(),
42
- id: mobileAnchor.id,
43
- },
44
- })
45
- );
46
- }, 100);
55
+ scheduleSectionVisible(mobileAnchor);
47
56
  } else {
48
57
  // Fallback to desktop content
49
58
  let scrollableParent = el.parentElement;
@@ -59,16 +68,7 @@
59
68
  const desktopMain = document.getElementById('main-content');
60
69
  if (desktopMain) {
61
70
  el.scrollIntoView({ behavior: 'auto', block: 'start' });
62
- setTimeout(() => {
63
- window.dispatchEvent(
64
- new CustomEvent('sectionVisible', {
65
- detail: {
66
- title: el.textContent?.trim(),
67
- id: el.id,
68
- },
69
- })
70
- );
71
- }, 100);
71
+ scheduleSectionVisible(el);
72
72
  } else {
73
73
  el.scrollIntoView({ behavior: 'auto', block: 'start' });
74
74
  }
@@ -121,6 +121,7 @@
121
121
  window.removeEventListener('closeMobileMenu', handleCloseMobileMenu);
122
122
  window.removeEventListener('layoutTransition', handleLayoutTransition);
123
123
  window.removeEventListener('keydown', handleEscape);
124
+ if (sectionVisibleTimer) clearTimeout(sectionVisibleTimer);
124
125
  };
125
126
  });
126
127
 
@@ -44,6 +44,8 @@
44
44
 
45
45
  const isHelpSelected = $derived(() => checkIsHelpPage());
46
46
 
47
+ let defaultHeaderTimer: ReturnType<typeof setTimeout> | null = null;
48
+
47
49
  $effect(() => {
48
50
  if (typeof window === 'undefined') return;
49
51
  // Listen for section visibility changes to update header
@@ -86,7 +88,8 @@
86
88
  // Set default header on mount only if no stored title exists
87
89
  const storedTitle = sessionStorage.getItem('subNav-selectedTitle');
88
90
  if (!storedTitle || storedTitle === '""' || storedTitle === 'null') {
89
- setTimeout(() => {
91
+ defaultHeaderTimer = setTimeout(() => {
92
+ defaultHeaderTimer = null;
90
93
  setDefaultHeaderFromFirstSubmenu();
91
94
  }, 100);
92
95
  }
@@ -102,6 +105,7 @@
102
105
  return () => {
103
106
  window.removeEventListener('sectionVisible', handleSectionVisible);
104
107
  window.removeEventListener('popstate', handleNavigationChange);
108
+ if (defaultHeaderTimer) clearTimeout(defaultHeaderTimer);
105
109
  };
106
110
  });
107
111
 
@@ -17,15 +17,18 @@ USAi API is organized around [REST](http://en.wikipedia.org/wiki/Representationa
17
17
  **[Google AI models](https://ai.google.dev/gemini-api/docs/)**
18
18
  - Gemini 2.5 Flash
19
19
  - Gemini 2.5 Pro
20
+ - Gemini 3.5 Flash
21
+ - Gemini 3.7 Flash
20
22
  - Gemini 3.8 Flash
21
23
 
22
24
  **[Anthropic models](https://docs.claude.com/en/docs/overview)**
23
25
  - Claude Haiku 4.5
24
26
  - Claude Sonnet 4.5
25
27
  - Claude Sonnet 4.6
26
- - Claude Opus 4.5
28
+ - Claude Sonnet 5
27
29
  - Claude Opus 4.7
28
30
  - Claude Opus 4.8
31
+ - Claude Opus 5
29
32
 
30
33
  **[Meta models](https://www.llama.com/docs/model-cards-and-prompt-formats/)**
31
34
  - Llama 4 Maverick
@@ -40,6 +43,7 @@ USAi API is organized around [REST](http://en.wikipedia.org/wiki/Representationa
40
43
 
41
44
  **[xAI models](https://docs.x.ai/developers/models/)**
42
45
  - Grok 4
46
+ - Grok 4.3
43
47
  - Grok 4.6
44
48
 
45
49
  The interface is modeled after the [OpenAI Chat Completion API](https://platform.openai.com/docs/guides/text?api-mode=responses). We will continue to add more models over time; we may also remove models if they are found to not meet our standards. You will be notified if a model is removed.