@glimstone/react 4.5.1 → 4.5.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/README.md CHANGED
@@ -125,7 +125,9 @@ wrapper, so they stack in the page's own rhythm.
125
125
  window with the release notes and the changes as tabs, or, in an app that
126
126
  marks no changes, "Release notes" from `onReleaseNotes` with
127
127
  `text.releaseNotes`, which opens the notes alone. The card never draws both.
128
- - **Help:** the report sentence, GitHub, Email with `MAIL_SVG` when the
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
129
131
  sentence names a mail route and `mailAddress` is set, the manual when
130
132
  `manualUrl` and `text.manual` are set, with `MANUAL_SVG` as `manualGlyph` and
131
133
  "Open" as `text.manualSub`, and the bug report when `onBugReport` and
@@ -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
- 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" }), wantsMail && (_jsx(ReadmeButton, { brand: "house", parts: [
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glimstone/react",
3
- "version": "4.5.1",
3
+ "version": "4.5.3",
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.1"
19
+ "@glimstone/core": "4.5.3"
20
20
  },
21
21
  "peerDependencies": {
22
22
  "@internationalized/date": "^3.12.4",