Skip to content

Commit c8b93db

Browse files
chore: small changes to bump packages versions
1 parent 2ca2e17 commit c8b93db

File tree

6 files changed

+52
-36
lines changed

6 files changed

+52
-36
lines changed

.changeset/shaggy-wasps-arrive.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@storefront-ui/tw-plugin-peer-next': patch
3+
'@storefront-ui/tailwind-config': patch
4+
'@storefront-ui/typography': patch
5+
'@storefront-ui/shared': patch
6+
---
7+
8+
Update licence year and small typing issue in useSearchParams
Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,44 @@
11
import { throttle } from 'lodash-es';
22

3-
export type UrlParams = Record<string, string[] | string>
3+
export type UrlParams = Record<string, string[] | string>;
44

55
const constructQuery = (params: URLSearchParams) => {
6-
const stringified = params.toString()
7-
return `${stringified ? `?${stringified}` : ''}${window.location.hash || ''}`
6+
const stringified = params.toString();
7+
return `${stringified ? `?${stringified}` : ''}${window.location.hash || ''}`;
88
};
99

10-
const replaceUrlParams = throttle((searchParams: URLSearchParams) =>
11-
window.history.replaceState(
12-
window.history.state,
13-
window.document.title,
14-
window.location.pathname + constructQuery(searchParams),
15-
), 300);
10+
const replaceUrlParams = throttle(
11+
(searchParams: URLSearchParams) =>
12+
window.history.replaceState(
13+
window.history.state,
14+
window.document.title,
15+
window.location.pathname + constructQuery(searchParams),
16+
),
17+
300,
18+
);
1619

17-
export function useSearchParams<T extends Record<string, any> = UrlParams>(
18-
{ initialValue, onStateChange }: { initialValue: T; onStateChange?: () => void },
19-
) {
20+
export function useSearchParams<T extends Record<string, any> = UrlParams>({
21+
initialValue,
22+
onStateChange,
23+
}: {
24+
initialValue: T;
25+
onStateChange?: () => void;
26+
}) {
2027
const state = { ...initialValue } as T & Record<string, unknown>;
2128

2229
const readSearchParams = () => {
2330
const readState = {} as typeof state;
24-
new URLSearchParams(window.location.search || '')
25-
.forEach((value, key) => {
26-
let parsedValue = undefined;
27-
if (value) {
28-
try {
29-
parsedValue = JSON.parse(value);
30-
} catch {
31-
console.error(`Cannot parse param ${key}, found value: ${value}`);
32-
}
31+
new URLSearchParams(window.location.search || '').forEach((value, key) => {
32+
let parsedValue = undefined;
33+
if (value) {
34+
try {
35+
parsedValue = JSON.parse(value);
36+
} catch {
37+
console.error(`Cannot parse param ${key}, found value: ${value}`);
3338
}
34-
readState[key as keyof typeof state] = parsedValue;
35-
});
39+
}
40+
readState[key as keyof typeof state] = parsedValue as T[string];
41+
});
3642

3743
return readState;
3844
};
@@ -47,13 +53,17 @@ export function useSearchParams<T extends Record<string, any> = UrlParams>(
4753
};
4854

4955
if (typeof window !== 'undefined') {
50-
window.addEventListener('popstate', () => {
51-
for (const key in state) {
52-
delete state[key];
53-
}
54-
Object.assign(state, readSearchParams());
55-
onStateChange?.();
56-
}, { passive: false });
56+
window.addEventListener(
57+
'popstate',
58+
() => {
59+
for (const key in state) {
60+
delete state[key];
61+
}
62+
Object.assign(state, readSearchParams());
63+
onStateChange?.();
64+
},
65+
{ passive: false },
66+
);
5767

5868
Object.assign(state, readSearchParams());
5969
}
@@ -66,4 +76,4 @@ export function useSearchParams<T extends Record<string, any> = UrlParams>(
6676
return returnValue;
6777
},
6878
});
69-
}
79+
}

packages/config/tailwind/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Alokai
3+
Copyright (c) 2025 Alokai
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

packages/sfui/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Core package with components, styling and everything around them.
1414
- `components` (place where components and its friends(types) should be placed)
1515
- `composables` (util functions react specific that helps coding)
1616
- `shared` (same as `shared` but only for vue)
17-
- `sass` (styles used in components)
18-
- `css` (compiled `sass` package)
1917
- `shared` (Files shared across 2 frameworks - they are populated from package `@storefront-ui/shared` into `frameworks/vue` and `frameworks/react`, so we would have one place for common utils, types etc, during release package will be copied into package so it will be able work as standalone package in end-user `node_modules`)
2018

2119
## Generating icons

packages/sfui/tw-plugin-peer-next/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Alokai
3+
Copyright (c) 2025 Alokai
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

packages/sfui/typography/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Alokai
3+
Copyright (c) 2025 Alokai
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)