@fuzdev/fuz_ui 0.212.0 → 0.213.0
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/Redirect.svelte +4 -1
- package/dist/Redirect.svelte.d.ts.map +1 -1
- package/dist/autofocus.svelte.d.ts.map +1 -1
- package/dist/autofocus.svelte.js +0 -1
- package/dist/csp.d.ts +1 -1
- package/dist/csp.js +1 -1
- package/dist/docs_helpers.svelte.d.ts +1 -1
- package/dist/docs_helpers.svelte.d.ts.map +1 -1
- package/dist/page_helpers.d.ts +2 -2
- package/dist/page_helpers.d.ts.map +1 -1
- package/dist/page_helpers.js +3 -3
- package/dist/vite_plugin_pkg_json.d.ts +1 -1
- package/dist/vite_plugin_pkg_json.js +1 -1
- package/package.json +21 -17
- package/src/lib/autofocus.svelte.ts +1 -2
- package/src/lib/csp.ts +1 -1
- package/src/lib/page_helpers.ts +7 -4
package/dist/Redirect.svelte
CHANGED
|
@@ -28,7 +28,10 @@
|
|
|
28
28
|
const url = $derived(host + path);
|
|
29
29
|
|
|
30
30
|
onMount(() => {
|
|
31
|
-
if (auto)
|
|
31
|
+
if (!auto) return;
|
|
32
|
+
// `goto` rejects URLs that aren't routes of this app, like static files, other apps,
|
|
33
|
+
// and other hosts, which navigate the browser itself
|
|
34
|
+
goto(url, { replace: true }).catch(() => location.replace(url));
|
|
32
35
|
});
|
|
33
36
|
</script>
|
|
34
37
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Redirect.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Redirect.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;CAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"Redirect.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/Redirect.svelte"],"names":[],"mappings":"AAMA,OAAO,EAAW,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE9C,KAAK,gBAAgB,GAAI;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;CAClC,CAAC;AAuCH,QAAA,MAAM,QAAQ,sDAAwC,CAAC;AACvD,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,CAAC;AAC5C,eAAe,QAAQ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autofocus.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/autofocus.svelte.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,YAAY,KAAG,UAAU,CAAC,WAAW,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"autofocus.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/autofocus.svelte.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GACpB,UAAU,YAAY,KAAG,UAAU,CAAC,WAAW,GAAG,UAAU,CAG5D,CAAC"}
|
package/dist/autofocus.svelte.js
CHANGED
|
@@ -10,6 +10,5 @@
|
|
|
10
10
|
* @param options - focus options forwarded to `element.focus()`; defaults to `{focusVisible: true}` to show focus indicators on programmatic focus
|
|
11
11
|
*/
|
|
12
12
|
export const autofocus = (options) => (el) => {
|
|
13
|
-
// focusVisible missing from TS lib.dom.d.ts as of 5.9
|
|
14
13
|
el.focus({ focusVisible: true, ...options });
|
|
15
14
|
};
|
package/dist/csp.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export interface CreateCspDirectivesOptions {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
* Builds a CSP directives map for use with SvelteKit's `
|
|
61
|
+
* Builds a CSP directives map for use with SvelteKit's `csp.directives` option (passed to `sveltekit()`).
|
|
62
62
|
*
|
|
63
63
|
* Restrictive by default; opt into specific permissions via `extend` (append) or
|
|
64
64
|
* `overrides` (replace). Designed to read as an audit log: every user-added source
|
package/dist/csp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builds a CSP directives map for use with SvelteKit's `
|
|
2
|
+
* Builds a CSP directives map for use with SvelteKit's `csp.directives` option (passed to `sveltekit()`).
|
|
3
3
|
*
|
|
4
4
|
* Restrictive by default; opt into specific permissions via `extend` (append) or
|
|
5
5
|
* `overrides` (replace). Designed to read as an audit log: every user-added source
|
|
@@ -15,7 +15,7 @@ export declare const docs_links_context: {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const docs_slugify: (str: string) => string;
|
|
17
17
|
export declare const DOCS_PATH_DEFAULT = "/docs";
|
|
18
|
-
export declare const DOCS_PATH: string
|
|
18
|
+
export declare const DOCS_PATH: "/" | "/about" | "/docs" | "/docs/Alert" | "/docs/Breadcrumb" | "/docs/Breadcrumb/a" | "/docs/Breadcrumb/a/b" | "/docs/Breadcrumb/a/b/c" | "/docs/Breadcrumb/a/b/c/d" | "/docs/Card" | "/docs/Contextmenu" | "/docs/Details" | "/docs/Dialog" | "/docs/Docs" | "/docs/HueInput" | "/docs/LibraryDetail" | "/docs/LibrarySummary" | "/docs/Library" | "/docs/PendingAnimation" | "/docs/PendingButton" | "/docs/Redirect" | "/docs/Sparkline" | "/docs/Svg" | "/docs/Teleport" | "/docs/ThemeRoot" | "/docs/api" | "/docs/csp" | "/docs/icons" | "/docs/intersect" | "/docs/introduction" | "/docs/logos" | "/docs/theming" | "/docs/vite_plugin_pkg_json" | "/help" | `/${string}/` | `/${`docs/api/${string}` & {}}` | `/${string}/help` | `/${string}/about` | `/${string}/docs` | `/${string}/docs/Alert` | `/${string}/docs/Breadcrumb` | `/${string}/docs/Breadcrumb/a` | `/${string}/docs/Breadcrumb/a/b` | `/${string}/docs/Breadcrumb/a/b/c` | `/${string}/docs/Breadcrumb/a/b/c/d` | `/${string}/docs/Card` | `/${string}/docs/Contextmenu` | `/${string}/docs/Details` | `/${string}/docs/Dialog` | `/${string}/docs/Docs` | `/${string}/docs/HueInput` | `/${string}/docs/LibraryDetail` | `/${string}/docs/LibrarySummary` | `/${string}/docs/Library` | `/${string}/docs/PendingAnimation` | `/${string}/docs/PendingButton` | `/${string}/docs/Redirect` | `/${string}/docs/Sparkline` | `/${string}/docs/Svg` | `/${string}/docs/Teleport` | `/${string}/docs/ThemeRoot` | `/${string}/docs/api` | `/${string}/${`docs/api/${string}` & {}}` | `/${string}/docs/csp` | `/${string}/docs/icons` | `/${string}/docs/intersect` | `/${string}/docs/introduction` | `/${string}/docs/logos` | `/${string}/docs/theming` | `/${string}/docs/vite_plugin_pkg_json`;
|
|
19
19
|
export declare const DOCS_API_PATH: string;
|
|
20
20
|
export declare const to_docs_path_info: (path_slug: string, pathname: string, root_path?: string) => {
|
|
21
21
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs_helpers.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/docs_helpers.svelte.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,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,KAAK,EAAE,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAmB;IAgBlE,UAAU,iBA4BP;IAEH,QAAQ,CAAC,kBAAkB,EAAE,SAAS,CAAC,MAAM,CAAC,CAAmB;gBAErD,SAAS,SAAoB;IAIzC,GAAG,CACF,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,WAAW,EACjB,KAAK,SAAI,EACT,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,CAAC,EAAE,MAAM,GAClB,MAAM;IAkBT,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAIxB;;;OAGG;IACH,mBAAmB,IAAI,MAAM;CAG7B"}
|
package/dist/page_helpers.d.ts
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* against `url`, as a browser resolves it.
|
|
10
10
|
*
|
|
11
11
|
* @param href - a link's `href`, absolute or relative
|
|
12
|
-
* @param url - the current page's url, e.g. `page.url`
|
|
12
|
+
* @param url - the current page's url, e.g. SvelteKit's readonly `page.url`
|
|
13
13
|
* @returns `false` for an `href` that isn't a valid url
|
|
14
14
|
*/
|
|
15
|
-
export declare const href_is_current_page: (href: string, url: URL) => boolean;
|
|
15
|
+
export declare const href_is_current_page: (href: string, url: Pick<URL, "href" | "origin" | "pathname">) => boolean;
|
|
16
16
|
//# sourceMappingURL=page_helpers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/page_helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"page_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/page_helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,GAChC,MAAM,MAAM,EACZ,KAAK,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC,KAC5C,OAOF,CAAC"}
|
package/dist/page_helpers.js
CHANGED
|
@@ -11,13 +11,13 @@ const strip_trailing_slash = (pathname) => pathname.length > 1 && pathname.endsW
|
|
|
11
11
|
* against `url`, as a browser resolves it.
|
|
12
12
|
*
|
|
13
13
|
* @param href - a link's `href`, absolute or relative
|
|
14
|
-
* @param url - the current page's url, e.g. `page.url`
|
|
14
|
+
* @param url - the current page's url, e.g. SvelteKit's readonly `page.url`
|
|
15
15
|
* @returns `false` for an `href` that isn't a valid url
|
|
16
16
|
*/
|
|
17
17
|
export const href_is_current_page = (href, url) => {
|
|
18
|
-
if (!URL.canParse(href, url))
|
|
18
|
+
if (!URL.canParse(href, url.href))
|
|
19
19
|
return false;
|
|
20
|
-
const target = new URL(href, url);
|
|
20
|
+
const target = new URL(href, url.href);
|
|
21
21
|
return (target.origin === url.origin &&
|
|
22
22
|
strip_trailing_slash(target.pathname) === strip_trailing_slash(url.pathname));
|
|
23
23
|
};
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* ```ts
|
|
23
23
|
* // vite.config.ts
|
|
24
|
-
* import {vite_plugin_pkg_json} from '
|
|
24
|
+
* import {vite_plugin_pkg_json} from '@fuzdev/fuz_ui/vite_plugin_pkg_json.ts';
|
|
25
25
|
* export default defineConfig({plugins: [vite_plugin_pkg_json(), sveltekit()]});
|
|
26
26
|
* ```
|
|
27
27
|
*
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*
|
|
22
22
|
* ```ts
|
|
23
23
|
* // vite.config.ts
|
|
24
|
-
* import {vite_plugin_pkg_json} from '
|
|
24
|
+
* import {vite_plugin_pkg_json} from '@fuzdev/fuz_ui/vite_plugin_pkg_json.ts';
|
|
25
25
|
* export default defineConfig({plugins: [vite_plugin_pkg_json(), sveltekit()]});
|
|
26
26
|
* ```
|
|
27
27
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuzdev/fuz_ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.213.0",
|
|
4
4
|
"description": "Svelte UI library",
|
|
5
5
|
"tagline": "friendly user zystem",
|
|
6
6
|
"glyph": "🧶",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"deploy": "gro deploy"
|
|
30
30
|
},
|
|
31
31
|
"type": "module",
|
|
32
|
+
"imports": {
|
|
33
|
+
"#lib/*": "./src/lib/*",
|
|
34
|
+
"#routes/*": "./src/routes/*"
|
|
35
|
+
},
|
|
32
36
|
"engines": {
|
|
33
37
|
"node": ">=24.14"
|
|
34
38
|
},
|
|
@@ -36,9 +40,9 @@
|
|
|
36
40
|
"@fuzdev/fuz_code": ">=0.46.0",
|
|
37
41
|
"@fuzdev/fuz_css": ">=0.65.0",
|
|
38
42
|
"@fuzdev/fuz_util": ">=0.72.0",
|
|
39
|
-
"@fuzdev/gro": ">=0.
|
|
43
|
+
"@fuzdev/gro": ">=0.214.0",
|
|
40
44
|
"@fuzdev/mdz": ">=0.2.0",
|
|
41
|
-
"@sveltejs/kit": "^
|
|
45
|
+
"@sveltejs/kit": "^3",
|
|
42
46
|
"esm-env": "^1",
|
|
43
47
|
"svelte": "^5",
|
|
44
48
|
"zod": "^4.1.12"
|
|
@@ -64,28 +68,28 @@
|
|
|
64
68
|
"@changesets/changelog-git": "^0.2.1",
|
|
65
69
|
"@fuzdev/blake3-wasm": "^0.2.0",
|
|
66
70
|
"@fuzdev/fuz_code": "^0.50.0",
|
|
67
|
-
"@fuzdev/fuz_css": "^0.66.
|
|
71
|
+
"@fuzdev/fuz_css": "^0.66.1",
|
|
68
72
|
"@fuzdev/fuz_util": "^0.72.0",
|
|
69
|
-
"@fuzdev/gro": "^0.
|
|
70
|
-
"@fuzdev/mdz": "^0.
|
|
71
|
-
"@ryanatkn/eslint-config": "^0.12.
|
|
72
|
-
"@sveltejs/adapter-static": "^
|
|
73
|
-
"@sveltejs/kit": "^
|
|
74
|
-
"@sveltejs/package": "^
|
|
75
|
-
"@sveltejs/vite-plugin-svelte": "^
|
|
73
|
+
"@fuzdev/gro": "^0.214.0",
|
|
74
|
+
"@fuzdev/mdz": "^0.4.0",
|
|
75
|
+
"@ryanatkn/eslint-config": "^0.12.3",
|
|
76
|
+
"@sveltejs/adapter-static": "^4.0.0",
|
|
77
|
+
"@sveltejs/kit": "^3.0.1",
|
|
78
|
+
"@sveltejs/package": "^3.0.0",
|
|
79
|
+
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
76
80
|
"@types/node": "^24.10.1",
|
|
77
81
|
"@webref/css": "^8.2.0",
|
|
78
82
|
"eslint": "^9.39.4",
|
|
79
83
|
"eslint-plugin-svelte": "^3.19.0",
|
|
80
84
|
"esm-env": "^1.2.2",
|
|
81
85
|
"jsdom": "^29.1.1",
|
|
82
|
-
"svelte": "^5.
|
|
83
|
-
"svelte-check": "^4.7.
|
|
84
|
-
"svelte-docinfo": "^0.8.
|
|
86
|
+
"svelte": "^5.57.2",
|
|
87
|
+
"svelte-check": "^4.7.6",
|
|
88
|
+
"svelte-docinfo": "^0.8.1",
|
|
85
89
|
"tslib": "^2.8.1",
|
|
86
|
-
"typescript": "^
|
|
87
|
-
"typescript-eslint": "^8.
|
|
88
|
-
"vite": "^
|
|
90
|
+
"typescript": "^6.0.3",
|
|
91
|
+
"typescript-eslint": "^8.71.1",
|
|
92
|
+
"vite": "^8.3.4",
|
|
89
93
|
"vitest": "^5.0.0",
|
|
90
94
|
"zod": "^4.3.6"
|
|
91
95
|
},
|
|
@@ -15,6 +15,5 @@ import type { Attachment } from 'svelte/attachments';
|
|
|
15
15
|
export const autofocus =
|
|
16
16
|
(options?: FocusOptions): Attachment<HTMLElement | SVGElement> =>
|
|
17
17
|
(el) => {
|
|
18
|
-
|
|
19
|
-
el.focus({ focusVisible: true, ...options } as FocusOptions);
|
|
18
|
+
el.focus({ focusVisible: true, ...options });
|
|
20
19
|
};
|
package/src/lib/csp.ts
CHANGED
|
@@ -65,7 +65,7 @@ export interface CreateCspDirectivesOptions {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Builds a CSP directives map for use with SvelteKit's `
|
|
68
|
+
* Builds a CSP directives map for use with SvelteKit's `csp.directives` option (passed to `sveltekit()`).
|
|
69
69
|
*
|
|
70
70
|
* Restrictive by default; opt into specific permissions via `extend` (append) or
|
|
71
71
|
* `overrides` (replace). Designed to read as an audit log: every user-added source
|
package/src/lib/page_helpers.ts
CHANGED
|
@@ -14,12 +14,15 @@ const strip_trailing_slash = (pathname: string): string =>
|
|
|
14
14
|
* against `url`, as a browser resolves it.
|
|
15
15
|
*
|
|
16
16
|
* @param href - a link's `href`, absolute or relative
|
|
17
|
-
* @param url - the current page's url, e.g. `page.url`
|
|
17
|
+
* @param url - the current page's url, e.g. SvelteKit's readonly `page.url`
|
|
18
18
|
* @returns `false` for an `href` that isn't a valid url
|
|
19
19
|
*/
|
|
20
|
-
export const href_is_current_page = (
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export const href_is_current_page = (
|
|
21
|
+
href: string,
|
|
22
|
+
url: Pick<URL, 'href' | 'origin' | 'pathname'>
|
|
23
|
+
): boolean => {
|
|
24
|
+
if (!URL.canParse(href, url.href)) return false;
|
|
25
|
+
const target = new URL(href, url.href);
|
|
23
26
|
return (
|
|
24
27
|
target.origin === url.origin &&
|
|
25
28
|
strip_trailing_slash(target.pathname) === strip_trailing_slash(url.pathname)
|