@sierra-95/svelte-scaffold 1.2.19 → 1.2.20
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/dist/{Hooks → Utils}/redirectTo.d.ts +2 -2
- package/dist/{Hooks → Utils}/redirectTo.js +13 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -6
- package/package.json +1 -1
- /package/dist/{Hooks → Utils}/buildSearch.d.ts +0 -0
- /package/dist/{Hooks → Utils}/buildSearch.js +0 -0
- /package/dist/{Hooks → Utils}/button.d.ts +0 -0
- /package/dist/{Hooks → Utils}/button.js +0 -0
- /package/dist/{Hooks → Utils}/layout_menu.d.ts +0 -0
- /package/dist/{Hooks → Utils}/layout_menu.js +0 -0
- /package/dist/{Hooks → Utils}/preview.d.ts +0 -0
- /package/dist/{Hooks → Utils}/preview.js +0 -0
- /package/dist/{Hooks → Utils}/validateForms.d.ts +0 -0
- /package/dist/{Hooks → Utils}/validateForms.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare function buildRedirectUrl(baseUrl: string, redirectTo?: string): string;
|
|
1
|
+
export declare function buildRedirectUrl(baseUrl: string, redirectTo?: string, extraParameters?: Record<string, string>): string;
|
|
2
2
|
type RedirectOptions = {
|
|
3
3
|
replaceState?: boolean;
|
|
4
4
|
useHardRedirect?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function handleRedirect(baseUrl: string, redirectTo?: string, options?: RedirectOptions): void;
|
|
6
|
+
export declare function handleRedirect(baseUrl: string, redirectTo?: string, options?: RedirectOptions, extraParameters?: Record<string, string>): void;
|
|
7
7
|
export {};
|
|
@@ -14,16 +14,23 @@ function sanitizeRedirect(redirectTo) {
|
|
|
14
14
|
}
|
|
15
15
|
return redirectTo;
|
|
16
16
|
}
|
|
17
|
-
export function buildRedirectUrl(baseUrl, redirectTo) {
|
|
17
|
+
export function buildRedirectUrl(baseUrl, redirectTo, extraParameters = {}) {
|
|
18
18
|
const safe = sanitizeRedirect(redirectTo);
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const url = new URL(baseUrl, window.location.origin);
|
|
20
|
+
Object.entries(extraParameters).forEach(([key, value]) => {
|
|
21
|
+
if (value !== undefined && value !== null) {
|
|
22
|
+
url.searchParams.set(key, value);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
if (safe) {
|
|
26
|
+
url.searchParams.set('redirectTo', safe);
|
|
27
|
+
}
|
|
28
|
+
return url.pathname + url.search;
|
|
22
29
|
}
|
|
23
|
-
export function handleRedirect(baseUrl, redirectTo, options = {}) {
|
|
30
|
+
export function handleRedirect(baseUrl, redirectTo, options = {}, extraParameters = {}) {
|
|
24
31
|
if (!browser)
|
|
25
32
|
return;
|
|
26
|
-
const finalUrl = buildRedirectUrl(baseUrl, redirectTo);
|
|
33
|
+
const finalUrl = buildRedirectUrl(baseUrl, redirectTo, extraParameters);
|
|
27
34
|
const { replaceState = false, useHardRedirect = false } = options;
|
|
28
35
|
if (useHardRedirect) {
|
|
29
36
|
window.location.href = finalUrl;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,11 +56,11 @@ export { fileInputStore, resetFileInputStore, fileInputConfig } from './stores/m
|
|
|
56
56
|
export type { FileInputStoreMediaItem } from './stores/modules/fileInput.js';
|
|
57
57
|
export { layoutStore, resetLayoutStore } from './stores/modules/layout.js';
|
|
58
58
|
export { addToast, removeToast, toasts } from './stores/features/toastManager.js';
|
|
59
|
-
export { getPreviewUrlForMedia, toggleSelectForMedia, removeFileForMedia, DOCUMENT_MIME_TYPES, IMAGE_MIME_TYPES_PREVIEW } from './
|
|
60
|
-
export { validateLayoutMenuSections, filterSectionsByRole } from './
|
|
61
|
-
export { buttonRipple } from './
|
|
62
|
-
export { buildSearchIndex } from './
|
|
63
|
-
export { isValidEmail } from './
|
|
64
|
-
export { handleRedirect, buildRedirectUrl } from './
|
|
65
|
-
export type { SearchResult } from './
|
|
59
|
+
export { getPreviewUrlForMedia, toggleSelectForMedia, removeFileForMedia, DOCUMENT_MIME_TYPES, IMAGE_MIME_TYPES_PREVIEW } from './Utils/preview.js';
|
|
60
|
+
export { validateLayoutMenuSections, filterSectionsByRole } from './Utils/layout_menu.js';
|
|
61
|
+
export { buttonRipple } from './Utils/button.js';
|
|
62
|
+
export { buildSearchIndex } from './Utils/buildSearch.js';
|
|
63
|
+
export { isValidEmail } from './Utils/validateForms.js';
|
|
64
|
+
export { handleRedirect, buildRedirectUrl } from './Utils/redirectTo.js';
|
|
65
|
+
export type { SearchResult } from './Utils/buildSearch.js';
|
|
66
66
|
export type { Section, SectionItem } from './stores/modules/layout.js';
|
package/dist/index.js
CHANGED
|
@@ -68,9 +68,9 @@ export { fileInputStore, resetFileInputStore, fileInputConfig } from './stores/m
|
|
|
68
68
|
export { layoutStore, resetLayoutStore } from './stores/modules/layout.js';
|
|
69
69
|
export { addToast, removeToast, toasts } from './stores/features/toastManager.js';
|
|
70
70
|
//#######################HOOKS/UTILS########################
|
|
71
|
-
export { getPreviewUrlForMedia, toggleSelectForMedia, removeFileForMedia, DOCUMENT_MIME_TYPES, IMAGE_MIME_TYPES_PREVIEW } from './
|
|
72
|
-
export { validateLayoutMenuSections, filterSectionsByRole } from './
|
|
73
|
-
export { buttonRipple } from './
|
|
74
|
-
export { buildSearchIndex } from './
|
|
75
|
-
export { isValidEmail } from './
|
|
76
|
-
export { handleRedirect, buildRedirectUrl } from './
|
|
71
|
+
export { getPreviewUrlForMedia, toggleSelectForMedia, removeFileForMedia, DOCUMENT_MIME_TYPES, IMAGE_MIME_TYPES_PREVIEW } from './Utils/preview.js';
|
|
72
|
+
export { validateLayoutMenuSections, filterSectionsByRole } from './Utils/layout_menu.js';
|
|
73
|
+
export { buttonRipple } from './Utils/button.js';
|
|
74
|
+
export { buildSearchIndex } from './Utils/buildSearch.js';
|
|
75
|
+
export { isValidEmail } from './Utils/validateForms.js';
|
|
76
|
+
export { handleRedirect, buildRedirectUrl } from './Utils/redirectTo.js';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|