@glimstone/react 4.5.0 → 4.5.2
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/README.md +5 -2
- package/dist/AboutCard.d.ts +13 -3
- package/dist/AboutCard.js +9 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -116,7 +116,8 @@ wrapper, so they stack in the page's own rhythm.
|
|
|
116
116
|
the app ships, each with a `name`, an optional `sub` line, the `version` read
|
|
117
117
|
from the build and the `repoUrl` whose release page the number opens. A row
|
|
118
118
|
without `repoUrl`, or a build that is not a published release, shows the
|
|
119
|
-
number as plain text.
|
|
119
|
+
number as plain text. The GlimStone row sets `latest`, so its number opens
|
|
120
|
+
the newest release at `GLIMSTONE_RELEASE_URL`. `updateCheck.run` checks them all and resolves to how
|
|
120
121
|
many have a newer release; the button turns `ok` with `upToDate`, `warn` with
|
|
121
122
|
`updatesFound(n)`, or `danger` with `checkFailed` and a shake when it rejects.
|
|
122
123
|
The app puts the reason for a failure in its toast. One button stands
|
|
@@ -124,7 +125,9 @@ wrapper, so they stack in the page's own rhythm.
|
|
|
124
125
|
window with the release notes and the changes as tabs, or, in an app that
|
|
125
126
|
marks no changes, "Release notes" from `onReleaseNotes` with
|
|
126
127
|
`text.releaseNotes`, which opens the notes alone. The card never draws both.
|
|
127
|
-
- **Help:** the report sentence, GitHub,
|
|
128
|
+
- **Help:** the report sentence, GitHub, Discord with `IconDiscord` as
|
|
129
|
+
`discordGlyph` when the sentence names Discord and `discordUrl` and
|
|
130
|
+
`text.discordButton` are set, Email with `MAIL_SVG` when the
|
|
128
131
|
sentence names a mail route and `mailAddress` is set, the manual when
|
|
129
132
|
`manualUrl` and `text.manual` are set, with `MANUAL_SVG` as `manualGlyph` and
|
|
130
133
|
"Open" as `text.manualSub`, and the bug report when `onBugReport` and
|
package/dist/AboutCard.d.ts
CHANGED
|
@@ -66,6 +66,8 @@ export interface InfoHelpCardProps {
|
|
|
66
66
|
hint?: string;
|
|
67
67
|
report: string;
|
|
68
68
|
repoButton: string;
|
|
69
|
+
/** "Discord". Only drawn together with `discordUrl`. */
|
|
70
|
+
discordButton?: string;
|
|
69
71
|
mailButton: string;
|
|
70
72
|
mailSubject: string;
|
|
71
73
|
/** "Bug report". Only drawn together with `onBugReport`. */
|
|
@@ -81,6 +83,11 @@ export interface InfoHelpCardProps {
|
|
|
81
83
|
/** The mark on the repository button, passed for the same reason as the
|
|
82
84
|
* give buttons' marks. */
|
|
83
85
|
repoGlyph?: ReactNode;
|
|
86
|
+
/** An invite to the app's Discord server, for an app that takes its
|
|
87
|
+
* questions there rather than by mail. */
|
|
88
|
+
discordUrl?: string;
|
|
89
|
+
/** `IconDiscord`, Discord's own mark. */
|
|
90
|
+
discordGlyph?: ReactNode;
|
|
84
91
|
/** The workshop's own mailbox. Omit it and the card offers no mail route. */
|
|
85
92
|
mailAddress?: string;
|
|
86
93
|
/** The envelope, `MAIL_SVG` from appMarks.ts, which opens under the pointer. */
|
|
@@ -98,8 +105,8 @@ export interface InfoHelpCardProps {
|
|
|
98
105
|
openUrl?: OpenUrl;
|
|
99
106
|
hueIndex?: number;
|
|
100
107
|
}
|
|
101
|
-
/** The second card: a sentence inviting a report, then GitHub, Email, the manual and the bug report. */
|
|
102
|
-
export declare function InfoHelpCard({ text, repoUrl, repoGlyph, mailAddress, mailGlyph, manualUrl, manualGlyph, onBugReport, bugGlyph, openUrl, hueIndex, }: InfoHelpCardProps): import("react").JSX.Element;
|
|
108
|
+
/** The second card: a sentence inviting a report, then GitHub, Discord, Email, the manual and the bug report. */
|
|
109
|
+
export declare function InfoHelpCard({ text, repoUrl, repoGlyph, discordUrl, discordGlyph, mailAddress, mailGlyph, manualUrl, manualGlyph, onBugReport, bugGlyph, openUrl, hueIndex, }: InfoHelpCardProps): import("react").JSX.Element;
|
|
103
110
|
export interface InfoTileProps {
|
|
104
111
|
version: Omit<InfoVersionCardProps, "hueIndex">;
|
|
105
112
|
help: Omit<InfoHelpCardProps, "hueIndex">;
|
|
@@ -119,7 +126,7 @@ export declare function InfoTile({ version, help, about, hueIndex, ...data }: In
|
|
|
119
126
|
* @deprecated Use `InfoTile`, which adds the version rows' sub-lines, the
|
|
120
127
|
* other components, "Check for updates" and the bug report. Removed in 5.0.0.
|
|
121
128
|
*/
|
|
122
|
-
export declare function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, mailAddress, mailGlyph, openUrl, hueIndex, }: {
|
|
129
|
+
export declare function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, discordUrl, discordGlyph, mailAddress, mailGlyph, openUrl, hueIndex, }: {
|
|
123
130
|
text: {
|
|
124
131
|
title: string;
|
|
125
132
|
body: string;
|
|
@@ -129,6 +136,7 @@ export declare function AboutCard({ text, version, glimstoneVersion, repoUrl, re
|
|
|
129
136
|
paypalButton?: string;
|
|
130
137
|
report: string;
|
|
131
138
|
repoButton: string;
|
|
139
|
+
discordButton?: string;
|
|
132
140
|
mailButton: string;
|
|
133
141
|
mailSubject: string;
|
|
134
142
|
version: string;
|
|
@@ -147,6 +155,8 @@ export declare function AboutCard({ text, version, glimstoneVersion, repoUrl, re
|
|
|
147
155
|
paypalGlyph?: ReactNode;
|
|
148
156
|
onPaypal?: () => void;
|
|
149
157
|
onCrypto?: () => void;
|
|
158
|
+
discordUrl?: string;
|
|
159
|
+
discordGlyph?: ReactNode;
|
|
150
160
|
mailAddress?: string;
|
|
151
161
|
mailGlyph?: ReactNode;
|
|
152
162
|
openUrl?: (url: string) => void;
|
package/dist/AboutCard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from "react";
|
|
3
|
-
import { mailHref, offersMail, openInBrowser, runUpdateCheck, updateFace, updateStage, versionLink, warnDeprecated, } from "@glimstone/core";
|
|
3
|
+
import { mailHref, offersDiscord, offersMail, openInBrowser, runUpdateCheck, updateFace, updateStage, versionLink, warnDeprecated, } from "@glimstone/core";
|
|
4
4
|
import { Button } from "./Button.js";
|
|
5
5
|
import { Card } from "./Card.js";
|
|
6
6
|
import { ReadmeButton } from "./ReadmeButton.js";
|
|
@@ -37,10 +37,11 @@ function VersionNumber({ row, unreleased, openUrl }) {
|
|
|
37
37
|
openUrl(href);
|
|
38
38
|
}, className: "glim-num glim-version-number", children: shown }));
|
|
39
39
|
}
|
|
40
|
-
/** The second card: a sentence inviting a report, then GitHub, Email, the manual and the bug report. */
|
|
41
|
-
export function InfoHelpCard({ text, repoUrl, repoGlyph, mailAddress, mailGlyph, manualUrl, manualGlyph, onBugReport, bugGlyph, openUrl = openInBrowser, hueIndex, }) {
|
|
40
|
+
/** The second card: a sentence inviting a report, then GitHub, Discord, Email, the manual and the bug report. */
|
|
41
|
+
export function InfoHelpCard({ text, repoUrl, repoGlyph, discordUrl, discordGlyph, mailAddress, mailGlyph, manualUrl, manualGlyph, onBugReport, bugGlyph, openUrl = openInBrowser, hueIndex, }) {
|
|
42
42
|
const wantsMail = offersMail(text.report, mailAddress);
|
|
43
|
-
|
|
43
|
+
const wantsDiscord = offersDiscord(text.report, discordUrl) && Boolean(text.discordButton);
|
|
44
|
+
return (_jsxs(Card, { "data-glim": "InfoHelpCard", title: text.title, hint: text.hint, hueIndex: hueIndex, children: [_jsx("p", { className: "glim-info-text", children: text.report }), _jsxs("div", { className: "glim-readme-btn-rows", children: [_jsx(ReadmeButton, { brand: "github", parts: [{ name: text.repoButton, onClick: () => openUrl(repoUrl) }], mark: repoGlyph, markClass: "glim-github-mark" }), wantsDiscord && (_jsx(ReadmeButton, { brand: "discord", parts: [{ name: text.discordButton, onClick: () => openUrl(discordUrl) }], mark: discordGlyph, markClass: "glim-discord-mark" })), wantsMail && (_jsx(ReadmeButton, { brand: "house", parts: [
|
|
44
45
|
{
|
|
45
46
|
name: text.mailButton,
|
|
46
47
|
onClick: () => openUrl(mailHref(mailAddress, text.mailSubject)),
|
|
@@ -60,7 +61,7 @@ export function InfoTile({ version, help, about, hueIndex, ...data }) {
|
|
|
60
61
|
* @deprecated Use `InfoTile`, which adds the version rows' sub-lines, the
|
|
61
62
|
* other components, "Check for updates" and the bug report. Removed in 5.0.0.
|
|
62
63
|
*/
|
|
63
|
-
export function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, mailAddress, mailGlyph, openUrl = openInBrowser, hueIndex, }) {
|
|
64
|
+
export function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph, glimstoneRepoUrl, onCoffee, coffeeArt, cryptoGlyph, paypalGlyph, onPaypal, onCrypto, discordUrl, discordGlyph, mailAddress, mailGlyph, openUrl = openInBrowser, hueIndex, }) {
|
|
64
65
|
warnDeprecated("AboutCard");
|
|
65
66
|
const rows = [
|
|
66
67
|
...(version ? [{ name: text.version, version, repoUrl }] : []),
|
|
@@ -71,11 +72,14 @@ export function AboutCard({ text, version, glimstoneVersion, repoUrl, repoGlyph,
|
|
|
71
72
|
title: text.helpTitle,
|
|
72
73
|
report: text.report,
|
|
73
74
|
repoButton: text.repoButton,
|
|
75
|
+
discordButton: text.discordButton,
|
|
74
76
|
mailButton: text.mailButton,
|
|
75
77
|
mailSubject: text.mailSubject,
|
|
76
78
|
},
|
|
77
79
|
repoUrl,
|
|
78
80
|
repoGlyph,
|
|
81
|
+
discordUrl,
|
|
82
|
+
discordGlyph,
|
|
79
83
|
mailAddress,
|
|
80
84
|
mailGlyph,
|
|
81
85
|
openUrl,
|
package/dist/index.d.ts
CHANGED
|
@@ -63,4 +63,4 @@ export * from "./useLabelMode.ts";
|
|
|
63
63
|
export * from "./usePaypalButtons.ts";
|
|
64
64
|
export * from "./useTipBubble.tsx";
|
|
65
65
|
export type { ToastAction } from "@glimstone/core";
|
|
66
|
-
export { GLIMSTONE_VERSION } from "@glimstone/core";
|
|
66
|
+
export { GLIMSTONE_RELEASE_URL, GLIMSTONE_REPO, GLIMSTONE_VERSION } from "@glimstone/core";
|
package/dist/index.js
CHANGED
|
@@ -62,4 +62,4 @@ export * from "./useDragArmed.js";
|
|
|
62
62
|
export * from "./useLabelMode.js";
|
|
63
63
|
export * from "./usePaypalButtons.js";
|
|
64
64
|
export * from "./useTipBubble.js";
|
|
65
|
-
export { GLIMSTONE_VERSION } from "@glimstone/core";
|
|
65
|
+
export { GLIMSTONE_RELEASE_URL, GLIMSTONE_REPO, GLIMSTONE_VERSION } from "@glimstone/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glimstone/react",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"description": "GlimStone's components for React",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/junkerderprovinz/glimstone.git", "directory": "packages/react" },
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"build": "tsc -p tsconfig.build.json"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@glimstone/core": "4.5.
|
|
19
|
+
"@glimstone/core": "4.5.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@internationalized/date": "^3.12.4",
|