@gsa-tts/graymatter-ui 0.4.4 → 0.4.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gsa-tts/graymatter-ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"vite": "^6.3.5",
|
|
63
63
|
"vitest": "^3.0.7",
|
|
64
64
|
"@gsa-tts/graymatter-eslint": "0.0.2",
|
|
65
|
-
"@gsa-tts/graymatter-
|
|
66
|
-
"@gsa-tts/graymatter-
|
|
65
|
+
"@gsa-tts/graymatter-vitest-config": "0.0.1",
|
|
66
|
+
"@gsa-tts/graymatter-typescript-config": "0.0.2"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@fontsource-variable/archivo": "^5.2.6",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { createEventDispatcher, onMount } from 'svelte';
|
|
3
|
-
import { subNavReady } from '
|
|
3
|
+
import { subNavReady } from '../stores/subNavReadyStore';
|
|
4
4
|
import type { SubNavData, SubNavItem } from '../types/subnav.ts';
|
|
5
5
|
import ApiDocSubNavList from './ApiDocSubNavList.svelte';
|
|
6
6
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import GlobalAppLayout from './GlobalAppLayout.astro';
|
|
3
3
|
import ApiDocSubNavMenu from '../components/ApiDocSubNavMenu.svelte';
|
|
4
4
|
import NavigationInitializer from '../components/NavigationInitializer.svelte';
|
|
5
|
-
import { getBaseUrl } from '../helpers';
|
|
6
5
|
import { getCollection } from 'astro:content';
|
|
7
6
|
import { render } from 'astro:content';
|
|
8
7
|
import { generateApiDocumentationNavData } from '../utils/generateApiNavData.js';
|
|
@@ -18,6 +17,8 @@ const {
|
|
|
18
17
|
profileMenuData = null,
|
|
19
18
|
hideDiscover = true,
|
|
20
19
|
contentCustomization = undefined,
|
|
20
|
+
logoLinkUrl,
|
|
21
|
+
logoLinkLabel,
|
|
21
22
|
} = Astro.props;
|
|
22
23
|
|
|
23
24
|
// Handle ALL logic internally
|
|
@@ -58,8 +59,8 @@ const subNavData = generateApiDocumentationNavData(apiDocsMetadata);
|
|
|
58
59
|
gtmID={gtmID}
|
|
59
60
|
{showAppIcons}
|
|
60
61
|
{profileMenuData}
|
|
61
|
-
logoLinkUrl
|
|
62
|
-
logoLinkLabel
|
|
62
|
+
{logoLinkUrl}
|
|
63
|
+
{logoLinkLabel}
|
|
63
64
|
title={title}
|
|
64
65
|
{description}
|
|
65
66
|
{openGraphImage}
|
|
@@ -129,9 +130,24 @@ const subNavData = generateApiDocumentationNavData(apiDocsMetadata);
|
|
|
129
130
|
.replace(/'/g, ''');
|
|
130
131
|
}
|
|
131
132
|
function linkify(input) {
|
|
133
|
+
// Handle array input - convert to paragraphs
|
|
134
|
+
if (Array.isArray(input)) {
|
|
135
|
+
return input
|
|
136
|
+
.map(paragraph => {
|
|
137
|
+
const processed = linkifySingle(String(paragraph));
|
|
138
|
+
return `<p>${processed}</p>`;
|
|
139
|
+
})
|
|
140
|
+
.join('');
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// Handle string input
|
|
144
|
+
return linkifySingle(String(input));
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function linkifySingle(input) {
|
|
132
148
|
// Preserve markdown links [label](url) using placeholders
|
|
133
149
|
const placeholders = [];
|
|
134
|
-
const withPlaceholders =
|
|
150
|
+
const withPlaceholders = input.replace(
|
|
135
151
|
/\[([^\]]+)\]\(((https?:\/\/|www\.)[^\s)]+)\)/gi,
|
|
136
152
|
(m, label, href) => {
|
|
137
153
|
const safeLabel = escapeHtml(label);
|
|
@@ -8,7 +8,6 @@ import MobileBottomNav from '../components/MobileBottomNav.svelte';
|
|
|
8
8
|
import MobileSideMenu from '../components/MobileSideMenu.svelte';
|
|
9
9
|
import Logo from '../components/Logo.svelte';
|
|
10
10
|
import { siteName } from '../constants';
|
|
11
|
-
import { getUrlFromBase } from '../helpers/url.js';
|
|
12
11
|
import { getSecret } from 'astro:env/server';
|
|
13
12
|
|
|
14
13
|
const {
|
|
@@ -28,13 +27,14 @@ const {
|
|
|
28
27
|
// Use getSecret directly for better environment variable handling
|
|
29
28
|
const chatUrl = getSecret('CHAT_URL') || getSecret('PUBLIC_CHAT_URL');
|
|
30
29
|
const consoleUrl = getSecret('CONSOLE_URL') || getSecret('PUBLIC_CONSOLE_URL');
|
|
31
|
-
const
|
|
30
|
+
const apiDocsUrl =
|
|
31
|
+
getSecret('API_DOCS_URL') || getSecret('PUBLIC_API_DOCS_URL');
|
|
32
32
|
const discoverUrl =
|
|
33
33
|
getSecret('DISCOVER_URL') || getSecret('PUBLIC_DISCOVER_URL');
|
|
34
34
|
|
|
35
35
|
const chat = chatUrl || '#';
|
|
36
36
|
const console = consoleUrl || '#';
|
|
37
|
-
const api =
|
|
37
|
+
const api = apiDocsUrl || '#';
|
|
38
38
|
const discover = discoverUrl || '#';
|
|
39
39
|
---
|
|
40
40
|
|