@softwareone/spi-sv5-library 1.7.4 → 1.7.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.
@@ -1,13 +1,14 @@
1
1
  <script lang="ts">
2
2
  interface FooterProps {
3
3
  homeUrl?: string;
4
+ logoUrl?: string;
4
5
  }
5
- let { homeUrl = '/' }: FooterProps = $props();
6
+ let { homeUrl = '/', logoUrl = '/softwareone-logo-white.svg' }: FooterProps = $props();
6
7
  </script>
7
8
 
8
9
  <footer class="footer-section">
9
10
  <a href={homeUrl} title="Home">
10
- <img alt="SoftwareOne logo" class="logo-image" src="/softwareone-logo-white.svg" />
11
+ <img alt="SoftwareOne logo" class="logo-image" src={logoUrl} />
11
12
  </a>
12
13
  <ul class="links">
13
14
  <li>
@@ -1,5 +1,6 @@
1
1
  interface FooterProps {
2
2
  homeUrl?: string;
3
+ logoUrl?: string;
3
4
  }
4
5
  declare const Footer: import("svelte").Component<FooterProps, {}, "">;
5
6
  type Footer = ReturnType<typeof Footer>;
@@ -19,7 +19,8 @@
19
19
  };
20
20
 
21
21
  const isActiveMenuItem = (url: string) => {
22
- const firstSegmentUrl = page.url.pathname.split('/')[1];
22
+ const pathname = page.url.pathname.replace(/^\/v\d+\//, '/');
23
+ const firstSegmentUrl = pathname.split('/')[1];
23
24
  return existRoute(`/${firstSegmentUrl}`, url);
24
25
  };
25
26
 
@@ -28,7 +29,6 @@
28
29
  return regex.test(pathname);
29
30
  };
30
31
 
31
-
32
32
  const onHandleMenu = () => {
33
33
  showMenu = !showMenu;
34
34
  };
@@ -1,7 +1,12 @@
1
1
  export const getSubMenuItemsFromMenu = (items, url, excludedRoutes) => {
2
- if (excludedRoutes?.includes(url))
2
+ const cleanUrl = url.replace(/^\/v\d+\//, '/');
3
+ if (excludedRoutes?.includes(cleanUrl))
3
4
  return [];
4
- const matchedPath = /^\/[^/]+/.exec(url);
5
+ const matchedPath = /^\/[^/]+/.exec(cleanUrl);
5
6
  const urlValue = matchedPath?.[0] ?? '';
6
- return items.find((menu) => menu.url.startsWith(urlValue))?.children ?? [];
7
+ const matchedMenu = items.find((menu) => {
8
+ const regex = new RegExp(`${urlValue}(?![\\w-])`);
9
+ return regex.test(menu.url);
10
+ });
11
+ return matchedMenu?.children ?? [];
7
12
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softwareone/spi-sv5-library",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "Svelte components",
5
5
  "keywords": [
6
6
  "svelte",