@fuzdev/fuz_ui 0.197.0 → 0.198.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/DeclarationLink.svelte +12 -3
- package/dist/DeclarationLink.svelte.d.ts +6 -0
- package/dist/DeclarationLink.svelte.d.ts.map +1 -1
- package/dist/LibraryDetail.svelte +9 -2
- package/dist/LibraryDetail.svelte.d.ts +6 -0
- package/dist/LibraryDetail.svelte.d.ts.map +1 -1
- package/dist/ModuleLink.svelte +12 -3
- package/dist/ModuleLink.svelte.d.ts +6 -0
- package/dist/ModuleLink.svelte.d.ts.map +1 -1
- package/dist/library_helpers.d.ts +0 -30
- package/dist/library_helpers.d.ts.map +1 -1
- package/dist/library_helpers.js +0 -36
- package/dist/module.svelte.d.ts +7 -0
- package/dist/module.svelte.d.ts.map +1 -1
- package/dist/module.svelte.js +9 -0
- package/package.json +1 -1
- package/src/lib/library_helpers.ts +0 -45
- package/src/lib/module.svelte.ts +12 -0
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
const {
|
|
10
10
|
name,
|
|
11
11
|
hash,
|
|
12
|
+
full = false,
|
|
12
13
|
children,
|
|
13
14
|
class: class_prop = 'chip',
|
|
14
15
|
...rest
|
|
@@ -16,17 +17,25 @@
|
|
|
16
17
|
name: string;
|
|
17
18
|
/** URL fragment to append, with or without the `#`. */
|
|
18
19
|
hash?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Link to the library's own deployed docs (`url_api_full`) instead of a
|
|
22
|
+
* site-local path (`url_api`). Use when rendering a foreign library on a
|
|
23
|
+
* different site, e.g. an aggregator, so links don't dangle locally.
|
|
24
|
+
*/
|
|
25
|
+
full?: boolean;
|
|
19
26
|
} = $props();
|
|
20
27
|
|
|
21
28
|
const library = library_context.get();
|
|
22
29
|
|
|
23
30
|
const declaration = $derived(library.declaration_by_name.get(name));
|
|
24
31
|
|
|
32
|
+
// When linking a foreign library's docs, prefer its full URL; fall back to
|
|
33
|
+
// the site-local path if `homepage_url` is unavailable.
|
|
34
|
+
const url_api = $derived((full && declaration?.url_api_full) || declaration?.url_api);
|
|
35
|
+
|
|
25
36
|
const contextmenu_entries = $derived(
|
|
26
37
|
declaration ? create_declaration_contextmenu(declaration) : undefined,
|
|
27
38
|
);
|
|
28
|
-
|
|
29
|
-
// TODO @many support full https:// url variants - automatic detection? library prop?
|
|
30
39
|
</script>
|
|
31
40
|
|
|
32
41
|
{#if declaration}
|
|
@@ -35,7 +44,7 @@
|
|
|
35
44
|
<a
|
|
36
45
|
{...rest}
|
|
37
46
|
class="declaration-link {class_prop}"
|
|
38
|
-
href={
|
|
47
|
+
href={url_api + (hash ? ensure_start(hash, '#') : '')}
|
|
39
48
|
{@attach contextmenu_attachment(contextmenu_entries)}
|
|
40
49
|
>
|
|
41
50
|
{#if children}
|
|
@@ -3,6 +3,12 @@ type $$ComponentProps = SvelteHTMLElements['a'] & {
|
|
|
3
3
|
name: string;
|
|
4
4
|
/** URL fragment to append, with or without the `#`. */
|
|
5
5
|
hash?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Link to the library's own deployed docs (`url_api_full`) instead of a
|
|
8
|
+
* site-local path (`url_api`). Use when rendering a foreign library on a
|
|
9
|
+
* different site, e.g. an aggregator, so links don't dangle locally.
|
|
10
|
+
*/
|
|
11
|
+
full?: boolean;
|
|
6
12
|
};
|
|
7
13
|
declare const DeclarationLink: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
14
|
type DeclarationLink = ReturnType<typeof DeclarationLink>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeclarationLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DeclarationLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/DeclarationLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAoDH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -21,6 +21,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
|
|
|
21
21
|
|
|
22
22
|
const {
|
|
23
23
|
library,
|
|
24
|
+
links_full = false,
|
|
24
25
|
repo_name,
|
|
25
26
|
description,
|
|
26
27
|
tagline,
|
|
@@ -29,6 +30,12 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
|
|
|
29
30
|
children,
|
|
30
31
|
}: {
|
|
31
32
|
library: Library;
|
|
33
|
+
/**
|
|
34
|
+
* Link the module/declaration index to the library's own deployed docs
|
|
35
|
+
* (`url_api_full`) instead of site-local paths. Use when rendering a
|
|
36
|
+
* foreign library on a different site, e.g. an aggregator.
|
|
37
|
+
*/
|
|
38
|
+
links_full?: boolean;
|
|
32
39
|
repo_name?: Snippet<[repo_name: string]>;
|
|
33
40
|
description?: Snippet<[description: string]>;
|
|
34
41
|
tagline?: Snippet<[description: string]>;
|
|
@@ -166,7 +173,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
|
|
|
166
173
|
>
|
|
167
174
|
<div class="module-content">
|
|
168
175
|
<span class="font_size_xl">
|
|
169
|
-
<ModuleLink module_path={module.path}>
|
|
176
|
+
<ModuleLink module_path={module.path} full={links_full}>
|
|
170
177
|
{module.path}
|
|
171
178
|
</ModuleLink>
|
|
172
179
|
</span>
|
|
@@ -174,7 +181,7 @@ with file-type coloring. Uses svelte-docinfo's file type predicates for module c
|
|
|
174
181
|
<ul class="declarations unstyled">
|
|
175
182
|
{#each module.declarations as declaration (declaration.name)}
|
|
176
183
|
<li>
|
|
177
|
-
<DeclarationLink name={declaration.name} />
|
|
184
|
+
<DeclarationLink name={declaration.name} full={links_full} />
|
|
178
185
|
</li>
|
|
179
186
|
{/each}
|
|
180
187
|
</ul>
|
|
@@ -2,6 +2,12 @@ import type { Snippet } from 'svelte';
|
|
|
2
2
|
import type { Library } from './library.svelte.js';
|
|
3
3
|
type $$ComponentProps = {
|
|
4
4
|
library: Library;
|
|
5
|
+
/**
|
|
6
|
+
* Link the module/declaration index to the library's own deployed docs
|
|
7
|
+
* (`url_api_full`) instead of site-local paths. Use when rendering a
|
|
8
|
+
* foreign library on a different site, e.g. an aggregator.
|
|
9
|
+
*/
|
|
10
|
+
links_full?: boolean;
|
|
5
11
|
repo_name?: Snippet<[repo_name: string]>;
|
|
6
12
|
description?: Snippet<[description: string]>;
|
|
7
13
|
tagline?: Snippet<[description: string]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LibraryDetail.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/LibraryDetail.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAOhD,KAAK,gBAAgB,GAAI;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,M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aAAa,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACtD,eAAe,aAAa,CAAC"}
|
package/dist/ModuleLink.svelte
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
const {
|
|
10
10
|
module_path,
|
|
11
11
|
hash,
|
|
12
|
+
full = false,
|
|
12
13
|
children,
|
|
13
14
|
class: class_prop = 'chip',
|
|
14
15
|
...rest
|
|
@@ -16,17 +17,25 @@
|
|
|
16
17
|
module_path: string; // TODO maybe rename?
|
|
17
18
|
/** URL fragment to append, with or without the `#`. */
|
|
18
19
|
hash?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Link to the library's own deployed docs (`url_api_full`) instead of a
|
|
22
|
+
* site-local path (`url_api`). Use when rendering a foreign library on a
|
|
23
|
+
* different site, e.g. an aggregator, so links don't dangle locally.
|
|
24
|
+
*/
|
|
25
|
+
full?: boolean;
|
|
19
26
|
} = $props();
|
|
20
27
|
|
|
21
28
|
const library = library_context.get();
|
|
22
29
|
|
|
23
30
|
const module = $derived(library.module_by_path.get(module_path));
|
|
24
31
|
|
|
32
|
+
// When linking a foreign library's docs, prefer its full URL; fall back to
|
|
33
|
+
// the site-local path if `homepage_url` is unavailable.
|
|
34
|
+
const url_api = $derived((full && module?.url_api_full) || module?.url_api);
|
|
35
|
+
|
|
25
36
|
const color_class = $derived(module_path.endsWith('.svelte') ? 'color_h' : '');
|
|
26
37
|
|
|
27
38
|
const contextmenu_entries = $derived(module ? create_module_contextmenu(module) : undefined);
|
|
28
|
-
|
|
29
|
-
// TODO @many support full https:// url variants - automatic detection? library prop?
|
|
30
39
|
</script>
|
|
31
40
|
|
|
32
41
|
{#if module}
|
|
@@ -34,7 +43,7 @@
|
|
|
34
43
|
<a
|
|
35
44
|
{...rest}
|
|
36
45
|
class="module-link {class_prop} {color_class}"
|
|
37
|
-
href={
|
|
46
|
+
href={url_api + (hash ? ensure_start(hash, '#') : '')}
|
|
38
47
|
{@attach contextmenu_attachment(contextmenu_entries)}
|
|
39
48
|
>
|
|
40
49
|
<!-- eslint-enable svelte/no-navigation-without-resolve -->
|
|
@@ -3,6 +3,12 @@ type $$ComponentProps = SvelteHTMLElements['a'] & {
|
|
|
3
3
|
module_path: string;
|
|
4
4
|
/** URL fragment to append, with or without the `#`. */
|
|
5
5
|
hash?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Link to the library's own deployed docs (`url_api_full`) instead of a
|
|
8
|
+
* site-local path (`url_api`). Use when rendering a foreign library on a
|
|
9
|
+
* different site, e.g. an aggregator, so links don't dangle locally.
|
|
10
|
+
*/
|
|
11
|
+
full?: boolean;
|
|
6
12
|
};
|
|
7
13
|
declare const ModuleLink: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
8
14
|
type ModuleLink = ReturnType<typeof ModuleLink>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ModuleLink.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ModuleLink.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,iBAAiB,CAAC;AAOvD,KAAK,gBAAgB,GAAI,kBAAkB,CAAC,GAAG,CAAC,GAAG;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAoDH,QAAA,MAAM,UAAU,sDAAwC,CAAC;AACzD,KAAK,UAAU,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -8,36 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
/**
|
|
12
|
-
* Build project-relative API documentation URL with hash anchor.
|
|
13
|
-
*
|
|
14
|
-
* @param declaration_name - name of the declaration to link to
|
|
15
|
-
* @returns URL path like '/docs/api#declaration_name'
|
|
16
|
-
*/
|
|
17
|
-
export declare const url_api_declaration: (declaration_name: string) => string;
|
|
18
|
-
/**
|
|
19
|
-
* Build full API documentation URL with domain and hash anchor.
|
|
20
|
-
*
|
|
21
|
-
* @param homepage - package homepage URL
|
|
22
|
-
* @param declaration_name - name of the declaration to link to
|
|
23
|
-
* @returns full URL like 'https://example.com/docs/api#declaration_name'
|
|
24
|
-
*/
|
|
25
|
-
export declare const url_api_declaration_full: (homepage: string, declaration_name: string) => string;
|
|
26
|
-
/**
|
|
27
|
-
* Build project-relative module documentation URL.
|
|
28
|
-
*
|
|
29
|
-
* @param module_path - module path (e.g., 'helpers.ts')
|
|
30
|
-
* @returns URL path like '/docs/api/helpers.ts'
|
|
31
|
-
*/
|
|
32
|
-
export declare const url_api_module: (module_path: string) => string;
|
|
33
|
-
/**
|
|
34
|
-
* Build package logo URL with favicon.png fallback.
|
|
35
|
-
*
|
|
36
|
-
* @param homepage_url - package homepage URL, or null
|
|
37
|
-
* @param logo_path - optional custom logo path (defaults to 'favicon.png')
|
|
38
|
-
* @returns full URL to the logo, or null if no homepage
|
|
39
|
-
*/
|
|
40
|
-
export declare const url_package_logo: (homepage_url: string | null, logo_path?: string) => string | null;
|
|
41
11
|
/**
|
|
42
12
|
* Convert a full URL to root-relative format by removing the origin.
|
|
43
13
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"library_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"library_helpers.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/library_helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,EAAE,SAAQ,MAAwB,KAAG,MAcpF,CAAC"}
|
package/dist/library_helpers.js
CHANGED
|
@@ -10,42 +10,6 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { ensure_end, strip_start } from '@fuzdev/fuz_util/string.js';
|
|
12
12
|
import { page } from '$app/state';
|
|
13
|
-
import { DOCS_API_PATH, DOCS_PATH_DEFAULT } from './docs_helpers.svelte.js';
|
|
14
|
-
/**
|
|
15
|
-
* Build project-relative API documentation URL with hash anchor.
|
|
16
|
-
*
|
|
17
|
-
* @param declaration_name - name of the declaration to link to
|
|
18
|
-
* @returns URL path like '/docs/api#declaration_name'
|
|
19
|
-
*/
|
|
20
|
-
export const url_api_declaration = (declaration_name) => `${DOCS_API_PATH}#${encodeURIComponent(declaration_name)}`;
|
|
21
|
-
/**
|
|
22
|
-
* Build full API documentation URL with domain and hash anchor.
|
|
23
|
-
*
|
|
24
|
-
* @param homepage - package homepage URL
|
|
25
|
-
* @param declaration_name - name of the declaration to link to
|
|
26
|
-
* @returns full URL like 'https://example.com/docs/api#declaration_name'
|
|
27
|
-
*/
|
|
28
|
-
export const url_api_declaration_full = (homepage, declaration_name) => `${homepage}${DOCS_PATH_DEFAULT}/api#${encodeURIComponent(declaration_name)}`;
|
|
29
|
-
/**
|
|
30
|
-
* Build project-relative module documentation URL.
|
|
31
|
-
*
|
|
32
|
-
* @param module_path - module path (e.g., 'helpers.ts')
|
|
33
|
-
* @returns URL path like '/docs/api/helpers.ts'
|
|
34
|
-
*/
|
|
35
|
-
export const url_api_module = (module_path) => `${DOCS_API_PATH}/${module_path}`;
|
|
36
|
-
/**
|
|
37
|
-
* Build package logo URL with favicon.png fallback.
|
|
38
|
-
*
|
|
39
|
-
* @param homepage_url - package homepage URL, or null
|
|
40
|
-
* @param logo_path - optional custom logo path (defaults to 'favicon.png')
|
|
41
|
-
* @returns full URL to the logo, or null if no homepage
|
|
42
|
-
*/
|
|
43
|
-
export const url_package_logo = (homepage_url, logo_path) => {
|
|
44
|
-
if (!homepage_url)
|
|
45
|
-
return null;
|
|
46
|
-
const path = logo_path ? strip_start(logo_path, '/') : 'favicon.png';
|
|
47
|
-
return ensure_end(homepage_url, '/') + path;
|
|
48
|
-
};
|
|
49
13
|
/**
|
|
50
14
|
* Convert a full URL to root-relative format by removing the origin.
|
|
51
15
|
*
|
package/dist/module.svelte.d.ts
CHANGED
|
@@ -38,6 +38,13 @@ export declare class Module {
|
|
|
38
38
|
* API documentation URL for this module.
|
|
39
39
|
*/
|
|
40
40
|
url_api: string;
|
|
41
|
+
/**
|
|
42
|
+
* Public documentation link (if `homepage_url` is available).
|
|
43
|
+
*
|
|
44
|
+
* Absolute URL into the library's own deployed docs, for rendering a
|
|
45
|
+
* foreign library's modules on a different site (e.g. an aggregator).
|
|
46
|
+
*/
|
|
47
|
+
url_api_full: string | undefined;
|
|
41
48
|
/**
|
|
42
49
|
* GitHub source URL.
|
|
43
50
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/module.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAC,WAAW,EAAC,MAAM,yBAAyB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAC;AAGjD;;;;;;;;GAQG;AACH,qBAAa,MAAM;IAClB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAiB;IAK1C,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAiB;IAEtD;;;;;;;;;;OAUG;IACH,IAAI,SAAmC;IAEvC;;OAEG;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CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS;CAG9D"}
|
package/dist/module.svelte.js
CHANGED
|
@@ -43,6 +43,15 @@ export class Module {
|
|
|
43
43
|
* API documentation URL for this module.
|
|
44
44
|
*/
|
|
45
45
|
url_api = $derived(`/docs/api${this.library.url_prefix}/${this.path}`);
|
|
46
|
+
/**
|
|
47
|
+
* Public documentation link (if `homepage_url` is available).
|
|
48
|
+
*
|
|
49
|
+
* Absolute URL into the library's own deployed docs, for rendering a
|
|
50
|
+
* foreign library's modules on a different site (e.g. an aggregator).
|
|
51
|
+
*/
|
|
52
|
+
url_api_full = $derived(this.library.homepage_url
|
|
53
|
+
? `${this.library.homepage_url.replace(/\/$/, '')}/docs/api/${this.path}`
|
|
54
|
+
: undefined);
|
|
46
55
|
/**
|
|
47
56
|
* GitHub source URL.
|
|
48
57
|
*/
|
package/package.json
CHANGED
|
@@ -12,51 +12,6 @@
|
|
|
12
12
|
import {ensure_end, strip_start} from '@fuzdev/fuz_util/string.js';
|
|
13
13
|
import {page} from '$app/state';
|
|
14
14
|
|
|
15
|
-
import {DOCS_API_PATH, DOCS_PATH_DEFAULT} from './docs_helpers.svelte.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Build project-relative API documentation URL with hash anchor.
|
|
19
|
-
*
|
|
20
|
-
* @param declaration_name - name of the declaration to link to
|
|
21
|
-
* @returns URL path like '/docs/api#declaration_name'
|
|
22
|
-
*/
|
|
23
|
-
export const url_api_declaration = (declaration_name: string): string =>
|
|
24
|
-
`${DOCS_API_PATH}#${encodeURIComponent(declaration_name)}`;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Build full API documentation URL with domain and hash anchor.
|
|
28
|
-
*
|
|
29
|
-
* @param homepage - package homepage URL
|
|
30
|
-
* @param declaration_name - name of the declaration to link to
|
|
31
|
-
* @returns full URL like 'https://example.com/docs/api#declaration_name'
|
|
32
|
-
*/
|
|
33
|
-
export const url_api_declaration_full = (homepage: string, declaration_name: string): string =>
|
|
34
|
-
`${homepage}${DOCS_PATH_DEFAULT}/api#${encodeURIComponent(declaration_name)}`;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Build project-relative module documentation URL.
|
|
38
|
-
*
|
|
39
|
-
* @param module_path - module path (e.g., 'helpers.ts')
|
|
40
|
-
* @returns URL path like '/docs/api/helpers.ts'
|
|
41
|
-
*/
|
|
42
|
-
export const url_api_module = (module_path: string): string => `${DOCS_API_PATH}/${module_path}`;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Build package logo URL with favicon.png fallback.
|
|
46
|
-
*
|
|
47
|
-
* @param homepage_url - package homepage URL, or null
|
|
48
|
-
* @param logo_path - optional custom logo path (defaults to 'favicon.png')
|
|
49
|
-
* @returns full URL to the logo, or null if no homepage
|
|
50
|
-
*/
|
|
51
|
-
export const url_package_logo = (
|
|
52
|
-
homepage_url: string | null,
|
|
53
|
-
logo_path?: string,
|
|
54
|
-
): string | null => {
|
|
55
|
-
if (!homepage_url) return null;
|
|
56
|
-
const path = logo_path ? strip_start(logo_path, '/') : 'favicon.png';
|
|
57
|
-
return ensure_end(homepage_url, '/') + path;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
15
|
/**
|
|
61
16
|
* Convert a full URL to root-relative format by removing the origin.
|
|
62
17
|
*
|
package/src/lib/module.svelte.ts
CHANGED
|
@@ -55,6 +55,18 @@ export class Module {
|
|
|
55
55
|
*/
|
|
56
56
|
url_api = $derived(`/docs/api${this.library.url_prefix}/${this.path}`);
|
|
57
57
|
|
|
58
|
+
/**
|
|
59
|
+
* Public documentation link (if `homepage_url` is available).
|
|
60
|
+
*
|
|
61
|
+
* Absolute URL into the library's own deployed docs, for rendering a
|
|
62
|
+
* foreign library's modules on a different site (e.g. an aggregator).
|
|
63
|
+
*/
|
|
64
|
+
url_api_full = $derived(
|
|
65
|
+
this.library.homepage_url
|
|
66
|
+
? `${this.library.homepage_url.replace(/\/$/, '')}/docs/api/${this.path}`
|
|
67
|
+
: undefined,
|
|
68
|
+
);
|
|
69
|
+
|
|
58
70
|
/**
|
|
59
71
|
* GitHub source URL.
|
|
60
72
|
*/
|