@glimstone/svelte 4.8.1 → 4.8.3
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/AboutCard.svelte +36 -21
- package/dist/InfoComponentsCard.svelte +86 -0
- package/dist/InfoComponentsCard.svelte.d.ts +22 -0
- package/dist/InfoTile.svelte +9 -4
- package/dist/InfoTile.svelte.d.ts +2 -0
- package/dist/InfoVersionCard.svelte +98 -73
- package/dist/InfoVersionCard.svelte.d.ts +30 -23
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/dist/AboutCard.svelte
CHANGED
|
@@ -40,14 +40,15 @@
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<script lang="ts">
|
|
43
|
-
import { openInBrowser, warnDeprecated, type VersionRow } from "@glimstone/core";
|
|
44
|
-
import
|
|
43
|
+
import { openInBrowser, versionLink, warnDeprecated, type VersionRow } from "@glimstone/core";
|
|
44
|
+
import Card from "./Card.svelte";
|
|
45
|
+
import InfoAboutCard from "./InfoAboutCard.svelte";
|
|
46
|
+
import InfoHelpCard from "./InfoHelpCard.svelte";
|
|
45
47
|
|
|
46
48
|
// The 3.2.0 props of the single About card, laid out as the Info tile: the
|
|
47
49
|
// About card under `text.title`, the Version card under `text.version` with
|
|
48
50
|
// the app and GlimStone as its rows, and the Help card. Deprecated for
|
|
49
|
-
// InfoTile, which adds the
|
|
50
|
-
// "Check for updates" and the bug report.
|
|
51
|
+
// InfoTile, which adds the update state, the components and the bug report.
|
|
51
52
|
let {
|
|
52
53
|
text,
|
|
53
54
|
version,
|
|
@@ -74,28 +75,42 @@
|
|
|
74
75
|
...(version ? [{ name: text.version, version, repoUrl }] : []),
|
|
75
76
|
{ name: "GlimStone", version: glimstoneVersion, repoUrl: glimstoneRepoUrl },
|
|
76
77
|
]);
|
|
78
|
+
const at = (offset: number) => (hueIndex === undefined ? undefined : hueIndex + offset);
|
|
77
79
|
</script>
|
|
78
80
|
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
<div data-glim="AboutCard" style="display: contents">
|
|
82
|
+
<Card title={text.version} hueIndex={at(0)}>
|
|
83
|
+
<ul class="glim-version-rows">
|
|
84
|
+
{#each rows as row (row.name)}
|
|
85
|
+
{@const link = versionLink(row)}
|
|
86
|
+
<li class="glim-version-row">
|
|
87
|
+
<span class="glim-version-name"><span class="glim-version-part">{row.name}</span></span>
|
|
88
|
+
{#if link.href}
|
|
89
|
+
<a href={link.href} target="_blank" rel="noopener noreferrer" class="glim-num glim-version-number">{link.shown}</a>
|
|
90
|
+
{:else}
|
|
91
|
+
<span class="glim-num glim-version-number">{link.released ? link.shown : text.unreleased(link.shown)}</span>
|
|
92
|
+
{/if}
|
|
93
|
+
</li>
|
|
94
|
+
{/each}
|
|
95
|
+
</ul>
|
|
96
|
+
</Card>
|
|
97
|
+
<InfoHelpCard
|
|
98
|
+
hueIndex={at(1)}
|
|
99
|
+
text={{
|
|
86
100
|
title: text.helpTitle,
|
|
87
101
|
report: text.report,
|
|
88
102
|
repoButton: text.repoButton,
|
|
89
103
|
discordButton: text.discordButton,
|
|
90
104
|
mailButton: text.mailButton,
|
|
91
105
|
mailSubject: text.mailSubject,
|
|
92
|
-
}
|
|
93
|
-
repoUrl
|
|
94
|
-
repoGlyph
|
|
95
|
-
discordUrl
|
|
96
|
-
discordGlyph
|
|
97
|
-
mailAddress
|
|
98
|
-
mailGlyph
|
|
99
|
-
openUrl
|
|
100
|
-
|
|
101
|
-
/>
|
|
106
|
+
}}
|
|
107
|
+
{repoUrl}
|
|
108
|
+
{repoGlyph}
|
|
109
|
+
{discordUrl}
|
|
110
|
+
{discordGlyph}
|
|
111
|
+
{mailAddress}
|
|
112
|
+
{mailGlyph}
|
|
113
|
+
{openUrl}
|
|
114
|
+
/>
|
|
115
|
+
<InfoAboutCard hueIndex={at(2)} {text} {onCoffee} {coffeeArt} {onPaypal} {paypalGlyph} {onCrypto} {cryptoGlyph} />
|
|
116
|
+
</div>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<script lang="ts" module>
|
|
2
|
+
import type { ComponentRow, ComponentsCardText, OpenUrl } from "@glimstone/core";
|
|
3
|
+
|
|
4
|
+
export type { ComponentRow, ComponentsCardText } from "@glimstone/core";
|
|
5
|
+
|
|
6
|
+
export interface InfoComponentsCardProps {
|
|
7
|
+
/** `componentText(lang).componentsCard`, or the app's own words in its shape. */
|
|
8
|
+
text: ComponentsCardText;
|
|
9
|
+
/** The app's name, which fills "{app}" in the card's sentences. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** The app's own parts, the programs it brings along and, for a desktop
|
|
12
|
+
* build, its installer. The card adds the design language and sorts them. */
|
|
13
|
+
rows: ComponentRow[];
|
|
14
|
+
/** The switch for updating the components, bound with `bind:autoUpdate`. Left out, the card draws none. */
|
|
15
|
+
autoUpdate?: boolean;
|
|
16
|
+
onAutoUpdateChange?: (on: boolean) => void;
|
|
17
|
+
/** "Update components" at the foot of the card. Omit it where the app updates none. */
|
|
18
|
+
onUpdate?: () => void;
|
|
19
|
+
updating?: boolean;
|
|
20
|
+
openUrl?: OpenUrl;
|
|
21
|
+
hueIndex?: number;
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<script lang="ts">
|
|
26
|
+
import { componentRows, designRow, numberLink, openInBrowser, withApp } from "@glimstone/core";
|
|
27
|
+
import Button from "./Button.svelte";
|
|
28
|
+
import Card from "./Card.svelte";
|
|
29
|
+
import FieldRow from "./FieldRow.svelte";
|
|
30
|
+
import InfoBubble from "./InfoBubble.svelte";
|
|
31
|
+
import Toggle from "./Toggle.svelte";
|
|
32
|
+
|
|
33
|
+
// The second card of the Info tile: every version the app is made of or
|
|
34
|
+
// brings along, as plain numbers in a fixed order, with a status and one
|
|
35
|
+
// action on a row that needs one.
|
|
36
|
+
let { text, name, rows, autoUpdate = $bindable(), onAutoUpdateChange, onUpdate, updating = false, openUrl = openInBrowser, hueIndex }: InfoComponentsCardProps = $props();
|
|
37
|
+
|
|
38
|
+
const sorted = $derived(componentRows([...rows, designRow(text)]));
|
|
39
|
+
|
|
40
|
+
function open(e: MouseEvent, href: string) {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
openUrl(href);
|
|
43
|
+
}
|
|
44
|
+
function flip(on: boolean) {
|
|
45
|
+
autoUpdate = on;
|
|
46
|
+
onAutoUpdateChange?.(on);
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<Card data-glim="InfoComponentsCard" title={text.title} hint={withApp(text.hint, name)} {hueIndex}>
|
|
51
|
+
<ul class="glim-version-rows">
|
|
52
|
+
{#each sorted as row (row.name)}
|
|
53
|
+
{@const link = numberLink(row)}
|
|
54
|
+
<li class="glim-version-row">
|
|
55
|
+
<span class="glim-version-name">
|
|
56
|
+
<span class="glim-version-part">{row.name}</span>
|
|
57
|
+
{#if row.hint}<InfoBubble tip={row.hint} />{/if}
|
|
58
|
+
</span>
|
|
59
|
+
<span class="glim-version-end">
|
|
60
|
+
{#if row.status}<span class="glim-version-status" data-tone={row.tone}>{row.status}</span>{/if}
|
|
61
|
+
<span class="glim-version-tail">
|
|
62
|
+
{#if row.action}
|
|
63
|
+
{@const a = row.action}
|
|
64
|
+
<Button label={a.label} labelKey={a.labelKey} onClick={() => a.onClick()} />
|
|
65
|
+
{/if}
|
|
66
|
+
{#if link.href}
|
|
67
|
+
<a href={link.href} target="_blank" rel="noopener noreferrer" class="glim-num glim-version-number" onclick={(e) => open(e, link.href!)}>{link.shown}</a>
|
|
68
|
+
{:else}
|
|
69
|
+
<span class="glim-num glim-version-number">{link.released ? link.shown : text.unreleased(link.shown)}</span>
|
|
70
|
+
{/if}
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
73
|
+
</li>
|
|
74
|
+
{/each}
|
|
75
|
+
</ul>
|
|
76
|
+
{#if autoUpdate !== undefined}
|
|
77
|
+
<FieldRow label={text.auto} hint={withApp(text.autoHint, name)}>
|
|
78
|
+
<Toggle checked={autoUpdate} onChange={flip} label={text.auto} hideLabel />
|
|
79
|
+
</FieldRow>
|
|
80
|
+
{/if}
|
|
81
|
+
{#if onUpdate}
|
|
82
|
+
<div class="glim-version-actions">
|
|
83
|
+
<Button label={text.update} labelKey="components.update" busy={updating} onClick={() => onUpdate?.()} />
|
|
84
|
+
</div>
|
|
85
|
+
{/if}
|
|
86
|
+
</Card>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentRow, ComponentsCardText, OpenUrl } from "@glimstone/core";
|
|
2
|
+
export type { ComponentRow, ComponentsCardText } from "@glimstone/core";
|
|
3
|
+
export interface InfoComponentsCardProps {
|
|
4
|
+
/** `componentText(lang).componentsCard`, or the app's own words in its shape. */
|
|
5
|
+
text: ComponentsCardText;
|
|
6
|
+
/** The app's name, which fills "{app}" in the card's sentences. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The app's own parts, the programs it brings along and, for a desktop
|
|
9
|
+
* build, its installer. The card adds the design language and sorts them. */
|
|
10
|
+
rows: ComponentRow[];
|
|
11
|
+
/** The switch for updating the components, bound with `bind:autoUpdate`. Left out, the card draws none. */
|
|
12
|
+
autoUpdate?: boolean;
|
|
13
|
+
onAutoUpdateChange?: (on: boolean) => void;
|
|
14
|
+
/** "Update components" at the foot of the card. Omit it where the app updates none. */
|
|
15
|
+
onUpdate?: () => void;
|
|
16
|
+
updating?: boolean;
|
|
17
|
+
openUrl?: OpenUrl;
|
|
18
|
+
hueIndex?: number;
|
|
19
|
+
}
|
|
20
|
+
declare const InfoComponentsCard: import("svelte").Component<InfoComponentsCardProps, {}, "autoUpdate">;
|
|
21
|
+
type InfoComponentsCard = ReturnType<typeof InfoComponentsCard>;
|
|
22
|
+
export default InfoComponentsCard;
|
package/dist/InfoTile.svelte
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
2
|
import type { InfoAboutCardProps } from "./InfoAboutCard.svelte";
|
|
3
|
+
import type { InfoComponentsCardProps } from "./InfoComponentsCard.svelte";
|
|
3
4
|
import type { InfoHelpCardProps } from "./InfoHelpCard.svelte";
|
|
4
5
|
import type { InfoVersionCardProps } from "./InfoVersionCard.svelte";
|
|
5
6
|
|
|
6
7
|
export interface InfoTileProps {
|
|
7
8
|
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
9
|
+
components: Omit<InfoComponentsCardProps, "hueIndex">;
|
|
8
10
|
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
9
11
|
about: Omit<InfoAboutCardProps, "hueIndex">;
|
|
10
12
|
/** The Version card's rainbow position; the cards after it take the next ones. */
|
|
@@ -16,16 +18,19 @@
|
|
|
16
18
|
|
|
17
19
|
<script lang="ts">
|
|
18
20
|
import InfoAboutCard from "./InfoAboutCard.svelte";
|
|
21
|
+
import InfoComponentsCard from "./InfoComponentsCard.svelte";
|
|
19
22
|
import InfoHelpCard from "./InfoHelpCard.svelte";
|
|
20
23
|
import InfoVersionCard from "./InfoVersionCard.svelte";
|
|
21
24
|
|
|
22
|
-
// The Info tile's cards in their fixed order,
|
|
23
|
-
|
|
25
|
+
// The Info tile's cards in their fixed order, Version, Components, Help and
|
|
26
|
+
// About, for the page that stacks them.
|
|
27
|
+
let { version, components, help, about, hueIndex, ...data }: InfoTileProps = $props();
|
|
24
28
|
const at = (offset: number) => (hueIndex === undefined ? undefined : hueIndex + offset);
|
|
25
29
|
</script>
|
|
26
30
|
|
|
27
31
|
<div data-glim="InfoTile" {...data} style="display: contents">
|
|
28
32
|
<InfoVersionCard {...version} hueIndex={at(0)} />
|
|
29
|
-
<
|
|
30
|
-
<
|
|
33
|
+
<InfoComponentsCard {...components} hueIndex={at(1)} />
|
|
34
|
+
<InfoHelpCard {...help} hueIndex={at(2)} />
|
|
35
|
+
<InfoAboutCard {...about} hueIndex={at(3)} />
|
|
31
36
|
</div>
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { InfoAboutCardProps } from "./InfoAboutCard.svelte";
|
|
2
|
+
import type { InfoComponentsCardProps } from "./InfoComponentsCard.svelte";
|
|
2
3
|
import type { InfoHelpCardProps } from "./InfoHelpCard.svelte";
|
|
3
4
|
import type { InfoVersionCardProps } from "./InfoVersionCard.svelte";
|
|
4
5
|
export interface InfoTileProps {
|
|
5
6
|
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
7
|
+
components: Omit<InfoComponentsCardProps, "hueIndex">;
|
|
6
8
|
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
7
9
|
about: Omit<InfoAboutCardProps, "hueIndex">;
|
|
8
10
|
/** The Version card's rainbow position; the cards after it take the next ones. */
|
|
@@ -1,99 +1,124 @@
|
|
|
1
1
|
<script lang="ts" module>
|
|
2
|
-
import type {
|
|
3
|
-
import type { OpenUrl, UpdateCheck, VersionRow } from "@glimstone/core";
|
|
2
|
+
import type { OpenUrl, UpdateRoute, UpdateState, VersionCardText } from "@glimstone/core";
|
|
4
3
|
|
|
5
|
-
export type { UpdateCheck, VersionRow } from "@glimstone/core";
|
|
4
|
+
export type { UpdateCheck, UpdateRoute, UpdateState, VersionCardText, VersionRow } from "@glimstone/core";
|
|
6
5
|
|
|
7
6
|
export interface InfoVersionCardProps {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
/** `componentText(lang).versionCard`, or the app's own words in its shape. */
|
|
8
|
+
text: VersionCardText;
|
|
9
|
+
/** The app's name, which fills "{app}" in the card's sentences. */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Read from the build, never typed in. */
|
|
12
|
+
version: string;
|
|
13
|
+
/** The repository whose newest release the number opens. */
|
|
14
|
+
repoUrl?: string;
|
|
15
|
+
/** How the app gets a new version, which decides the one action. */
|
|
16
|
+
route: UpdateRoute;
|
|
17
|
+
/** Where the updates stand. The app finds out; the card shows it. */
|
|
18
|
+
state: UpdateState;
|
|
19
|
+
/** "Check for updates". A store app passes none. */
|
|
20
|
+
onCheck?: () => void;
|
|
21
|
+
/** Fetches and installs the new version, or leads to the host's plugin page. */
|
|
22
|
+
onUpdate?: () => void;
|
|
23
|
+
/** Starts the downloaded version. */
|
|
24
|
+
onRestart?: () => void;
|
|
25
|
+
/** Where a container's update instructions live. */
|
|
26
|
+
guideUrl?: string;
|
|
27
|
+
/** Opens the app's window of what changed, a card per release with its notes. */
|
|
28
|
+
onWhatsNew: () => void;
|
|
29
|
+
/** How many marked changes are still unseen. */
|
|
30
|
+
unseen?: number;
|
|
31
|
+
/** The switch under the state, bound with `bind:autoUpdate`. Left out, the card draws none. */
|
|
32
|
+
autoUpdate?: boolean;
|
|
33
|
+
onAutoUpdateChange?: (on: boolean) => void;
|
|
27
34
|
openUrl?: OpenUrl;
|
|
28
35
|
hueIndex?: number;
|
|
29
36
|
}
|
|
30
37
|
</script>
|
|
31
38
|
|
|
32
39
|
<script lang="ts">
|
|
33
|
-
import {
|
|
40
|
+
import { autoSwitch, checkButton, numberLink, openInBrowser, updateAction, updateLine, whatsNewLabel, withApp } from "@glimstone/core";
|
|
34
41
|
import Button from "./Button.svelte";
|
|
35
42
|
import Card from "./Card.svelte";
|
|
43
|
+
import FieldRow from "./FieldRow.svelte";
|
|
44
|
+
import Toggle from "./Toggle.svelte";
|
|
36
45
|
|
|
37
|
-
// The first card of the Info tile:
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
let {
|
|
46
|
+
// The first card of the Info tile: the app's name and version, the switch,
|
|
47
|
+
// and a last row with where the updates stand at its start and the buttons
|
|
48
|
+
// at its end.
|
|
49
|
+
let {
|
|
50
|
+
text,
|
|
51
|
+
name,
|
|
52
|
+
version,
|
|
53
|
+
repoUrl,
|
|
54
|
+
route,
|
|
55
|
+
state,
|
|
56
|
+
onCheck,
|
|
57
|
+
onUpdate,
|
|
58
|
+
onRestart,
|
|
59
|
+
guideUrl,
|
|
60
|
+
onWhatsNew,
|
|
61
|
+
unseen = 0,
|
|
62
|
+
autoUpdate = $bindable(),
|
|
63
|
+
onAutoUpdateChange,
|
|
64
|
+
openUrl = openInBrowser,
|
|
65
|
+
hueIndex,
|
|
66
|
+
}: InfoVersionCardProps = $props();
|
|
41
67
|
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
68
|
+
const face = $derived(updateLine(state, text));
|
|
69
|
+
const action = $derived(updateAction(route, state, text));
|
|
70
|
+
const toggle = $derived(autoSwitch(route, text));
|
|
71
|
+
const check = $derived(checkButton(route, state));
|
|
72
|
+
const number = $derived(numberLink({ name, version, repoUrl }));
|
|
45
73
|
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
74
|
+
function press() {
|
|
75
|
+
if (action?.kind === "restart") onRestart?.();
|
|
76
|
+
else if (action?.kind === "guide") guideUrl && openUrl(guideUrl);
|
|
77
|
+
else onUpdate?.();
|
|
51
78
|
}
|
|
52
79
|
function open(e: MouseEvent, href: string) {
|
|
53
80
|
e.preventDefault();
|
|
54
81
|
openUrl(href);
|
|
55
82
|
}
|
|
83
|
+
function flip(on: boolean) {
|
|
84
|
+
autoUpdate = on;
|
|
85
|
+
onAutoUpdateChange?.(on);
|
|
86
|
+
}
|
|
56
87
|
</script>
|
|
57
88
|
|
|
58
|
-
<Card data-glim="InfoVersionCard" title={text.title} hint={text.hint} {hueIndex}>
|
|
59
|
-
<
|
|
60
|
-
{
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
<Card data-glim="InfoVersionCard" title={text.title} hint={withApp(text.hint, name)} {hueIndex}>
|
|
90
|
+
<div class="glim-version-head">
|
|
91
|
+
<span class="glim-version-app">{name}</span>
|
|
92
|
+
{#if number.href}
|
|
93
|
+
<a href={number.href} target="_blank" rel="noopener noreferrer" class="glim-num glim-version-number" onclick={(e) => open(e, number.href!)}>{number.shown}</a>
|
|
94
|
+
{:else}
|
|
95
|
+
<span class="glim-num glim-version-number">{number.released ? number.shown : text.unreleased(number.shown)}</span>
|
|
96
|
+
{/if}
|
|
97
|
+
</div>
|
|
98
|
+
{#if toggle && autoUpdate !== undefined}
|
|
99
|
+
<FieldRow label={toggle.label} hint={withApp(toggle.hint, name)}>
|
|
100
|
+
<Toggle checked={autoUpdate} onChange={flip} label={toggle.label} hideLabel />
|
|
101
|
+
</FieldRow>
|
|
102
|
+
{/if}
|
|
103
|
+
{#if state.kind === "downloading"}
|
|
104
|
+
<div class="glim-version-progress" role="progressbar" aria-label={face.line} aria-valuemin={0} aria-valuemax={100} aria-valuenow={state.percent}>
|
|
105
|
+
<span style:width={`${state.percent}%`}></span>
|
|
106
|
+
</div>
|
|
107
|
+
{/if}
|
|
108
|
+
<div class="glim-version-foot">
|
|
109
|
+
<p class="glim-version-state" data-tone={face.tone} role="status">
|
|
110
|
+
<span class="glim-version-line">{face.line}</span>
|
|
111
|
+
{#if face.note}<span class="glim-version-note">{face.note}</span>{/if}
|
|
112
|
+
</p>
|
|
78
113
|
<div class="glim-version-actions">
|
|
79
|
-
{#
|
|
80
|
-
{
|
|
81
|
-
{#if
|
|
82
|
-
{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
label={face.label}
|
|
87
|
-
labelKey={face.labelKey}
|
|
88
|
-
tone={face.tone}
|
|
89
|
-
stage={updateStage(updateCheck.text, face.label)}
|
|
90
|
-
busy={verdict.kind === "busy"}
|
|
91
|
-
onClick={() => check(updateCheck)}
|
|
92
|
-
class={shake > 0 ? "glim-shake" : ""}
|
|
93
|
-
/>
|
|
94
|
-
{/key}
|
|
95
|
-
<span role="status" class="glim-sr-only">{face.announced}</span>
|
|
114
|
+
{#snippet dot()}<span class="glim-version-dot" data-unseen={unseen > 0 ? "" : undefined} aria-hidden="true"></span>{/snippet}
|
|
115
|
+
<Button label={whatsNewLabel(text, unseen)} labelKey="version.whatsNew" before={dot} onClick={() => onWhatsNew()} />
|
|
116
|
+
{#if check && onCheck}
|
|
117
|
+
<Button label={text.check} labelKey="version.check" busy={check.busy} disabled={check.busy} onClick={() => onCheck?.()} />
|
|
118
|
+
{/if}
|
|
119
|
+
{#if action}
|
|
120
|
+
<Button label={action.label} labelKey={action.labelKey} tone={action.kind === "guide" ? "neutral" : "accent"} onClick={press} />
|
|
96
121
|
{/if}
|
|
97
122
|
</div>
|
|
98
|
-
|
|
123
|
+
</div>
|
|
99
124
|
</Card>
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type { UpdateCheck, VersionRow } from "@glimstone/core";
|
|
1
|
+
import type { OpenUrl, UpdateRoute, UpdateState, VersionCardText } from "@glimstone/core";
|
|
2
|
+
export type { UpdateCheck, UpdateRoute, UpdateState, VersionCardText, VersionRow } from "@glimstone/core";
|
|
4
3
|
export interface InfoVersionCardProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
4
|
+
/** `componentText(lang).versionCard`, or the app's own words in its shape. */
|
|
5
|
+
text: VersionCardText;
|
|
6
|
+
/** The app's name, which fills "{app}" in the card's sentences. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Read from the build, never typed in. */
|
|
9
|
+
version: string;
|
|
10
|
+
/** The repository whose newest release the number opens. */
|
|
11
|
+
repoUrl?: string;
|
|
12
|
+
/** How the app gets a new version, which decides the one action. */
|
|
13
|
+
route: UpdateRoute;
|
|
14
|
+
/** Where the updates stand. The app finds out; the card shows it. */
|
|
15
|
+
state: UpdateState;
|
|
16
|
+
/** "Check for updates". A store app passes none. */
|
|
17
|
+
onCheck?: () => void;
|
|
18
|
+
/** Fetches and installs the new version, or leads to the host's plugin page. */
|
|
19
|
+
onUpdate?: () => void;
|
|
20
|
+
/** Starts the downloaded version. */
|
|
21
|
+
onRestart?: () => void;
|
|
22
|
+
/** Where a container's update instructions live. */
|
|
23
|
+
guideUrl?: string;
|
|
24
|
+
/** Opens the app's window of what changed, a card per release with its notes. */
|
|
25
|
+
onWhatsNew: () => void;
|
|
26
|
+
/** How many marked changes are still unseen. */
|
|
27
|
+
unseen?: number;
|
|
28
|
+
/** The switch under the state, bound with `bind:autoUpdate`. Left out, the card draws none. */
|
|
29
|
+
autoUpdate?: boolean;
|
|
30
|
+
onAutoUpdateChange?: (on: boolean) => void;
|
|
24
31
|
openUrl?: OpenUrl;
|
|
25
32
|
hueIndex?: number;
|
|
26
33
|
}
|
|
27
|
-
declare const InfoVersionCard: import("svelte").Component<InfoVersionCardProps, {}, "">;
|
|
34
|
+
declare const InfoVersionCard: import("svelte").Component<InfoVersionCardProps, {}, "autoUpdate">;
|
|
28
35
|
type InfoVersionCard = ReturnType<typeof InfoVersionCard>;
|
|
29
36
|
export default InfoVersionCard;
|
package/dist/index.d.ts
CHANGED
|
@@ -29,9 +29,10 @@ export { default as IconButton, type IconButtonProps } from "./IconButton.svelte
|
|
|
29
29
|
export { default as IconTipButton, type IconTipButtonProps } from "./IconTipButton.svelte";
|
|
30
30
|
export { default as InfoAboutCard, type InfoAboutCardProps } from "./InfoAboutCard.svelte";
|
|
31
31
|
export { default as InfoBubble, type InfoBubbleProps } from "./InfoBubble.svelte";
|
|
32
|
+
export { default as InfoComponentsCard, type InfoComponentsCardProps, type ComponentRow, type ComponentsCardText } from "./InfoComponentsCard.svelte";
|
|
32
33
|
export { default as InfoHelpCard, type InfoHelpCardProps } from "./InfoHelpCard.svelte";
|
|
33
34
|
export { default as InfoTile, type InfoTileProps } from "./InfoTile.svelte";
|
|
34
|
-
export { default as InfoVersionCard, type InfoVersionCardProps, type UpdateCheck, type VersionRow } from "./InfoVersionCard.svelte";
|
|
35
|
+
export { default as InfoVersionCard, type InfoVersionCardProps, type UpdateCheck, type UpdateRoute, type UpdateState, type VersionCardText, type VersionRow } from "./InfoVersionCard.svelte";
|
|
35
36
|
export { default as InstanceCard, type InstanceCardProps, type InstanceFigure } from "./InstanceCard.svelte";
|
|
36
37
|
export { default as Kbd, type KbdProps } from "./Kbd.svelte";
|
|
37
38
|
export { default as ListRow, type ListRowProps } from "./ListRow.svelte";
|
package/dist/index.js
CHANGED
|
@@ -29,6 +29,7 @@ export { default as IconButton } from "./IconButton.svelte";
|
|
|
29
29
|
export { default as IconTipButton } from "./IconTipButton.svelte";
|
|
30
30
|
export { default as InfoAboutCard } from "./InfoAboutCard.svelte";
|
|
31
31
|
export { default as InfoBubble } from "./InfoBubble.svelte";
|
|
32
|
+
export { default as InfoComponentsCard } from "./InfoComponentsCard.svelte";
|
|
32
33
|
export { default as InfoHelpCard } from "./InfoHelpCard.svelte";
|
|
33
34
|
export { default as InfoTile } from "./InfoTile.svelte";
|
|
34
35
|
export { default as InfoVersionCard } from "./InfoVersionCard.svelte";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glimstone/svelte",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3",
|
|
4
4
|
"description": "GlimStone's components for Svelte",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"build": "svelte-package -i src -o dist"
|
|
142
142
|
},
|
|
143
143
|
"dependencies": {
|
|
144
|
-
"@glimstone/core": "4.8.
|
|
144
|
+
"@glimstone/core": "4.8.3"
|
|
145
145
|
},
|
|
146
146
|
"peerDependencies": {
|
|
147
147
|
"@internationalized/date": "^3.12.4",
|