@clicoh/orion-library 1.0.12 → 1.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"useSegments.d.ts","sourceRoot":"","sources":["../../src/hooks/useSegments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE,CAazE"}
1
+ {"version":3,"file":"useSegments.d.ts","sourceRoot":"","sources":["../../src/hooks/useSegments.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,EAAE,CAezE"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { usePathname } from 'next/navigation';
2
+ import { usePathname, useSearchParams } from 'next/navigation';
3
3
  /**
4
4
  * Custom hook to generate breadcrumb segments from the current pathname.
5
5
  *
@@ -8,13 +8,15 @@ import { usePathname } from 'next/navigation';
8
8
  */
9
9
  export function useSegments(pageTitles) {
10
10
  const pathname = usePathname() || '/lorem/ipsum';
11
+ const searchParams = useSearchParams();
11
12
  const segments = pathname.split('/').filter((segment) => segment);
13
+ const query = searchParams.toString();
12
14
  let accumulatedPath = '';
13
15
  return segments.map((segment) => {
14
16
  accumulatedPath += `/${segment}`;
15
17
  const name = pageTitles[accumulatedPath] || segment; // Get title from prop
16
18
  return {
17
- path: accumulatedPath,
19
+ path: query ? `${accumulatedPath}?${query}` : accumulatedPath,
18
20
  name,
19
21
  };
20
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"useSegments.js","sourceRoot":"","sources":["../../src/hooks/useSegments.ts"],"names":[],"mappings":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AAI,IAAI,OAAO,EAAE,CAAC;QACjC,MAAM,IAAI,GAAG,UAAU,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,CAAC,sBAAsB;QAC3E,OAAO;YACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,eAAe,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,eAAe;YAC7D,IAAI;SACL,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clicoh/orion-library",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "@floating-ui/react": "0.26.19",