@cratis/showrunner.playbill.react 2.19.0 → 2.21.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/Dialog/PlaybillDialog.tsx +5 -2
- package/Dialog/PlaybillHistoryDialog.tsx +47 -0
- package/Dialog/index.ts +1 -0
- package/Markdown/index.ts +1 -0
- package/Markdown/linkIssueReferences.ts +25 -0
- package/Playbill.tsx +5 -1
- package/README.md +2 -1
- package/Release/ReleaseNoteView.tsx +7 -3
- package/Release/index.ts +1 -0
- package/Release/issueRepositoryFor.ts +17 -0
- package/dist/cjs/Dialog/PlaybillDialog.d.ts +3 -2
- package/dist/cjs/Dialog/PlaybillDialog.d.ts.map +1 -1
- package/dist/cjs/Dialog/PlaybillDialog.js +3 -1
- package/dist/cjs/Dialog/PlaybillDialog.js.map +1 -1
- package/dist/cjs/Dialog/PlaybillHistoryDialog.d.ts +7 -0
- package/dist/cjs/Dialog/PlaybillHistoryDialog.d.ts.map +1 -0
- package/dist/cjs/Dialog/PlaybillHistoryDialog.js +41 -0
- package/dist/cjs/Dialog/PlaybillHistoryDialog.js.map +1 -0
- package/dist/cjs/Dialog/index.d.ts +1 -0
- package/dist/cjs/Dialog/index.d.ts.map +1 -1
- package/dist/cjs/Examples/HistoryDialog.d.ts +2 -0
- package/dist/cjs/Examples/HistoryDialog.d.ts.map +1 -0
- package/dist/cjs/Markdown/index.d.ts +1 -0
- package/dist/cjs/Markdown/index.d.ts.map +1 -1
- package/dist/cjs/Markdown/linkIssueReferences.d.ts +2 -0
- package/dist/cjs/Markdown/linkIssueReferences.d.ts.map +1 -0
- package/dist/cjs/Markdown/linkIssueReferences.js +22 -0
- package/dist/cjs/Markdown/linkIssueReferences.js.map +1 -0
- package/dist/cjs/Playbill.d.ts +3 -2
- package/dist/cjs/Playbill.d.ts.map +1 -1
- package/dist/cjs/Playbill.js +3 -1
- package/dist/cjs/Playbill.js.map +1 -1
- package/dist/cjs/Release/ReleaseNoteView.d.ts +2 -1
- package/dist/cjs/Release/ReleaseNoteView.d.ts.map +1 -1
- package/dist/cjs/Release/ReleaseNoteView.js +5 -3
- package/dist/cjs/Release/ReleaseNoteView.js.map +1 -1
- package/dist/cjs/Release/index.d.ts +1 -0
- package/dist/cjs/Release/index.d.ts.map +1 -1
- package/dist/cjs/Release/issueRepositoryFor.d.ts +3 -0
- package/dist/cjs/Release/issueRepositoryFor.d.ts.map +1 -0
- package/dist/cjs/Release/issueRepositoryFor.js +16 -0
- package/dist/cjs/Release/issueRepositoryFor.js.map +1 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/Dialog/PlaybillDialog.d.ts +3 -2
- package/dist/esm/Dialog/PlaybillDialog.d.ts.map +1 -1
- package/dist/esm/Dialog/PlaybillDialog.js +3 -1
- package/dist/esm/Dialog/PlaybillDialog.js.map +1 -1
- package/dist/esm/Dialog/PlaybillHistoryDialog.d.ts +7 -0
- package/dist/esm/Dialog/PlaybillHistoryDialog.d.ts.map +1 -0
- package/dist/esm/Dialog/PlaybillHistoryDialog.js +39 -0
- package/dist/esm/Dialog/PlaybillHistoryDialog.js.map +1 -0
- package/dist/esm/Dialog/index.d.ts +1 -0
- package/dist/esm/Dialog/index.d.ts.map +1 -1
- package/dist/esm/Dialog/index.js +1 -0
- package/dist/esm/Dialog/index.js.map +1 -1
- package/dist/esm/Examples/HistoryDialog.d.ts +2 -0
- package/dist/esm/Examples/HistoryDialog.d.ts.map +1 -0
- package/dist/esm/Examples/HistoryDialog.js +8 -0
- package/dist/esm/Examples/HistoryDialog.js.map +1 -0
- package/dist/esm/Markdown/index.d.ts +1 -0
- package/dist/esm/Markdown/index.d.ts.map +1 -1
- package/dist/esm/Markdown/index.js +1 -0
- package/dist/esm/Markdown/index.js.map +1 -1
- package/dist/esm/Markdown/linkIssueReferences.d.ts +2 -0
- package/dist/esm/Markdown/linkIssueReferences.d.ts.map +1 -0
- package/dist/esm/Markdown/linkIssueReferences.js +20 -0
- package/dist/esm/Markdown/linkIssueReferences.js.map +1 -0
- package/dist/esm/Playbill.d.ts +3 -2
- package/dist/esm/Playbill.d.ts.map +1 -1
- package/dist/esm/Playbill.js +3 -1
- package/dist/esm/Playbill.js.map +1 -1
- package/dist/esm/Release/ReleaseNoteView.d.ts +2 -1
- package/dist/esm/Release/ReleaseNoteView.d.ts.map +1 -1
- package/dist/esm/Release/ReleaseNoteView.js +5 -3
- package/dist/esm/Release/ReleaseNoteView.js.map +1 -1
- package/dist/esm/Release/index.d.ts +1 -0
- package/dist/esm/Release/index.d.ts.map +1 -1
- package/dist/esm/Release/index.js +1 -0
- package/dist/esm/Release/index.js.map +1 -1
- package/dist/esm/Release/issueRepositoryFor.d.ts +3 -0
- package/dist/esm/Release/issueRepositoryFor.d.ts.map +1 -0
- package/dist/esm/Release/issueRepositoryFor.js +14 -0
- package/dist/esm/Release/issueRepositoryFor.js.map +1 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/styles.css +6 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var linkIssueReferences = require('../Markdown/linkIssueReferences.js');
|
|
4
5
|
var PlaybillMarkdown = require('../Markdown/PlaybillMarkdown.js');
|
|
5
6
|
var formatReleaseDate = require('./formatReleaseDate.js');
|
|
6
7
|
var sectionPresentation = require('./sectionPresentation.js');
|
|
@@ -10,10 +11,11 @@ var sectionPresentation = require('./sectionPresentation.js');
|
|
|
10
11
|
/**
|
|
11
12
|
* One release: its version and date, what its note says before the first section, and each section under its heading.
|
|
12
13
|
* It draws no frame of its own, so a page, a dialog or a product's own surface can hold it.
|
|
13
|
-
*/ const ReleaseNoteView = ({ release, assetBase, labels, markdown: Markdown = PlaybillMarkdown.PlaybillMarkdown, locale, isUnread = false, isCurrent = false, headingLevel = 2 })=>{
|
|
14
|
+
*/ const ReleaseNoteView = ({ release, assetBase, labels, markdown: Markdown = PlaybillMarkdown.PlaybillMarkdown, locale, isUnread = false, isCurrent = false, issueRepository, headingLevel = 2 })=>{
|
|
14
15
|
const Heading = `h${headingLevel}`;
|
|
15
16
|
const SectionHeading = `h${headingLevel + 1}`;
|
|
16
17
|
const date = formatReleaseDate.formatReleaseDate(release.releasedAt, locale);
|
|
18
|
+
const prepared = (markdown)=>issueRepository ? linkIssueReferences.linkIssueReferences(markdown, issueRepository) : markdown;
|
|
17
19
|
return /*#__PURE__*/ jsxRuntime.jsxs("article", {
|
|
18
20
|
className: "playbill-release",
|
|
19
21
|
"data-version": release.version,
|
|
@@ -47,7 +49,7 @@ var sectionPresentation = require('./sectionPresentation.js');
|
|
|
47
49
|
release.lead.trim() !== '' && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
48
50
|
className: "playbill-release__lead",
|
|
49
51
|
children: /*#__PURE__*/ jsxRuntime.jsx(Markdown, {
|
|
50
|
-
source: release.lead,
|
|
52
|
+
source: prepared(release.lead),
|
|
51
53
|
assetBase: assetBase
|
|
52
54
|
})
|
|
53
55
|
}),
|
|
@@ -61,7 +63,7 @@ var sectionPresentation = require('./sectionPresentation.js');
|
|
|
61
63
|
children: presentation.title
|
|
62
64
|
}),
|
|
63
65
|
/*#__PURE__*/ jsxRuntime.jsx(Markdown, {
|
|
64
|
-
source: section.markdown,
|
|
66
|
+
source: prepared(section.markdown),
|
|
65
67
|
assetBase: assetBase
|
|
66
68
|
})
|
|
67
69
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseNoteView.js","sources":["../../../Release/ReleaseNoteView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentType } from 'react';\nimport { Release } from '../Client/index.js';\nimport { PlaybillLabels } from '../Labels/index.js';\nimport { PlaybillMarkdown, PlaybillMarkdownProps } from '../Markdown/index.js';\nimport { formatReleaseDate } from './formatReleaseDate.js';\nimport { sectionPresentation } from './sectionPresentation.js';\n\n/**\n * Props for {@link ReleaseNoteView}, and for the component given to the `release` slot of {@link Playbill} and\n * {@link PlaybillDialog}.\n */\nexport interface ReleaseNoteViewProps {\n /** The release to show. */\n release: Release;\n /** Where the files of the release are served from; given to the Markdown renderer so its images load. */\n assetBase?: string;\n /** The texts to show. */\n labels: PlaybillLabels;\n /** Renders the Markdown of the note; the `markdown` slot of {@link Playbill}. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The locale to write the date in; the browser's when not given. */\n locale?: string | string[];\n /** Whether the person has not seen this release yet; it is marked with the `unread` text. */\n isUnread?: boolean;\n /** Whether this is the version the application is running; it is marked with the `current` text. */\n isCurrent?: boolean;\n /** The level of the heading of the version, so the release fits under the heading of the page or dialog around it. Defaults to 2. */\n headingLevel?: 2 | 3 | 4;\n}\n\n/**\n * One release: its version and date, what its note says before the first section, and each section under its heading.\n * It draws no frame of its own, so a page, a dialog or a product's own surface can hold it.\n */\nexport const ReleaseNoteView = ({\n release,\n assetBase,\n labels,\n markdown: Markdown = PlaybillMarkdown,\n locale,\n isUnread = false,\n isCurrent = false,\n headingLevel = 2\n}: ReleaseNoteViewProps) => {\n const Heading = `h${headingLevel}` as 'h2';\n const SectionHeading = `h${headingLevel + 1}` as 'h3';\n const date = formatReleaseDate(release.releasedAt, locale);\n return (\n <article className='playbill-release' data-version={release.version}>\n <header className='playbill-release__header'>\n <Heading className='playbill-release__version'>{release.version}</Heading>\n {isCurrent && <span className='playbill-tag playbill-tag--current'>{labels.current}</span>}\n {isUnread && <span className='playbill-tag playbill-tag--unread'>{labels.unread}</span>}\n {date && (\n <time className='playbill-release__date' dateTime={release.releasedAt ?? undefined}>\n {labels.released} {date}\n </time>\n )}\n </header>\n {release.lead.trim() !== '' && (\n <div className='playbill-release__lead'>\n <Markdown source={release.lead} assetBase={assetBase} />\n </div>\n )}\n {release.sections.map(section => {\n const presentation = sectionPresentation(section.name, labels);\n return (\n <section key={section.name} className={`playbill-section playbill-section--${presentation.modifier}`}>\n <SectionHeading className='playbill-section__title'>{presentation.title}</SectionHeading>\n <Markdown source={section.markdown} assetBase={assetBase} />\n </section>\n );\n })}\n </article>\n );\n};\n"],"names":["ReleaseNoteView","release","assetBase","labels","markdown","Markdown","PlaybillMarkdown","locale","isUnread","isCurrent","headingLevel","Heading","SectionHeading","date","formatReleaseDate","releasedAt","_jsxs","article","className","data-version","version","header","_jsx","span","current","unread","time","dateTime","undefined","released","lead","trim","div","source","sections","map","section","presentation","sectionPresentation","name","modifier","title"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReleaseNoteView.js","sources":["../../../Release/ReleaseNoteView.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentType } from 'react';\nimport { Release } from '../Client/index.js';\nimport { PlaybillLabels } from '../Labels/index.js';\nimport { linkIssueReferences, PlaybillMarkdown, PlaybillMarkdownProps } from '../Markdown/index.js';\nimport { formatReleaseDate } from './formatReleaseDate.js';\nimport { sectionPresentation } from './sectionPresentation.js';\n\n/**\n * Props for {@link ReleaseNoteView}, and for the component given to the `release` slot of {@link Playbill} and\n * {@link PlaybillDialog}.\n */\nexport interface ReleaseNoteViewProps {\n /** The release to show. */\n release: Release;\n /** Where the files of the release are served from; given to the Markdown renderer so its images load. */\n assetBase?: string;\n /** The texts to show. */\n labels: PlaybillLabels;\n /** Renders the Markdown of the note; the `markdown` slot of {@link Playbill}. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The locale to write the date in; the browser's when not given. */\n locale?: string | string[];\n /** Whether the person has not seen this release yet; it is marked with the `unread` text. */\n isUnread?: boolean;\n /** Whether this is the version the application is running; it is marked with the `current` text. */\n isCurrent?: boolean;\n /** The address of the repository whose issues a bare `#123` in the note refers to. The references are made links when it is given. */\n issueRepository?: string;\n /** The level of the heading of the version, so the release fits under the heading of the page or dialog around it. Defaults to 2. */\n headingLevel?: 2 | 3 | 4;\n}\n\n/**\n * One release: its version and date, what its note says before the first section, and each section under its heading.\n * It draws no frame of its own, so a page, a dialog or a product's own surface can hold it.\n */\nexport const ReleaseNoteView = ({\n release,\n assetBase,\n labels,\n markdown: Markdown = PlaybillMarkdown,\n locale,\n isUnread = false,\n isCurrent = false,\n issueRepository,\n headingLevel = 2\n}: ReleaseNoteViewProps) => {\n const Heading = `h${headingLevel}` as 'h2';\n const SectionHeading = `h${headingLevel + 1}` as 'h3';\n const date = formatReleaseDate(release.releasedAt, locale);\n const prepared = (markdown: string) => issueRepository ? linkIssueReferences(markdown, issueRepository) : markdown;\n return (\n <article className='playbill-release' data-version={release.version}>\n <header className='playbill-release__header'>\n <Heading className='playbill-release__version'>{release.version}</Heading>\n {isCurrent && <span className='playbill-tag playbill-tag--current'>{labels.current}</span>}\n {isUnread && <span className='playbill-tag playbill-tag--unread'>{labels.unread}</span>}\n {date && (\n <time className='playbill-release__date' dateTime={release.releasedAt ?? undefined}>\n {labels.released} {date}\n </time>\n )}\n </header>\n {release.lead.trim() !== '' && (\n <div className='playbill-release__lead'>\n <Markdown source={prepared(release.lead)} assetBase={assetBase} />\n </div>\n )}\n {release.sections.map(section => {\n const presentation = sectionPresentation(section.name, labels);\n return (\n <section key={section.name} className={`playbill-section playbill-section--${presentation.modifier}`}>\n <SectionHeading className='playbill-section__title'>{presentation.title}</SectionHeading>\n <Markdown source={prepared(section.markdown)} assetBase={assetBase} />\n </section>\n );\n })}\n </article>\n );\n};\n"],"names":["ReleaseNoteView","release","assetBase","labels","markdown","Markdown","PlaybillMarkdown","locale","isUnread","isCurrent","issueRepository","headingLevel","Heading","SectionHeading","date","formatReleaseDate","releasedAt","prepared","linkIssueReferences","_jsxs","article","className","data-version","version","header","_jsx","span","current","unread","time","dateTime","undefined","released","lead","trim","div","source","sections","map","section","presentation","sectionPresentation","name","modifier","title"],"mappings":";;;;;;;;AAAA;AACA;AAkCA;;;IAIO,MAAMA,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
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Release/index.ts"],"names":[],"mappings":"AAGA,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issueRepositoryFor.d.ts","sourceRoot":"","sources":["../../../Release/issueRepositoryFor.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC,CAAC;AAQjF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,eAAe,GAAG,SAAS,EAAE,SAAS,MAAM,KAAG,MAAM,GAAG,SACxC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Where the issues of a release are tracked: one address for every release, or a function that answers for each version, for a
|
|
7
|
+
* product whose issues moved to another repository at some point.
|
|
8
|
+
*/ /**
|
|
9
|
+
* Works out the repository a release's issue references belong to.
|
|
10
|
+
* @param issues - What the product gave, if anything.
|
|
11
|
+
* @param version - The version of the release.
|
|
12
|
+
* @returns The address of the repository, or undefined to leave the references as text.
|
|
13
|
+
*/ const issueRepositoryFor = (issues, version)=>typeof issues === 'function' ? issues(version) : issues;
|
|
14
|
+
|
|
15
|
+
exports.issueRepositoryFor = issueRepositoryFor;
|
|
16
|
+
//# sourceMappingURL=issueRepositoryFor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issueRepositoryFor.js","sources":["../../../Release/issueRepositoryFor.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Where the issues of a release are tracked: one address for every release, or a function that answers for each version, for a\n * product whose issues moved to another repository at some point.\n */\nexport type IssueRepository = string | ((version: string) => string | undefined);\n\n/**\n * Works out the repository a release's issue references belong to.\n * @param issues - What the product gave, if anything.\n * @param version - The version of the release.\n * @returns The address of the repository, or undefined to leave the references as text.\n */\nexport const issueRepositoryFor = (issues: IssueRepository | undefined, version: string): string | undefined =>\n typeof issues === 'function' ? issues(version) : issues;\n"],"names":["issueRepositoryFor","issues","version"],"mappings":";;AAAA;AACA;AAEA;;;;;;;;IAYO,MAAMA,kBAAAA,GAAqB,CAACC,MAAAA,EAAqCC,OAAAA,GACpE,OAAOD,MAAAA,KAAW,UAAA,GAAaA,MAAAA,CAAOC,OAAAA,CAAAA,GAAWD;;"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,14 +4,17 @@ var PlaybillBadge = require('./Badge/PlaybillBadge.js');
|
|
|
4
4
|
var PlaybillClient = require('./Client/PlaybillClient.js');
|
|
5
5
|
var PlaybillProvider = require('./Configuration/PlaybillProvider.js');
|
|
6
6
|
var PlaybillDialog = require('./Dialog/PlaybillDialog.js');
|
|
7
|
+
var PlaybillHistoryDialog = require('./Dialog/PlaybillHistoryDialog.js');
|
|
7
8
|
var Icons = require('./Icons.js');
|
|
8
9
|
var defaultPlaybillLabels = require('./Labels/defaultPlaybillLabels.js');
|
|
9
10
|
var resolveLabels = require('./Labels/resolveLabels.js');
|
|
10
11
|
var assetUrl = require('./Markdown/assetUrl.js');
|
|
12
|
+
var linkIssueReferences = require('./Markdown/linkIssueReferences.js');
|
|
11
13
|
var PlaybillMarkdown = require('./Markdown/PlaybillMarkdown.js');
|
|
12
14
|
var safeLink = require('./Markdown/safeLink.js');
|
|
13
15
|
var Playbill = require('./Playbill.js');
|
|
14
16
|
var formatReleaseDate = require('./Release/formatReleaseDate.js');
|
|
17
|
+
var issueRepositoryFor = require('./Release/issueRepositoryFor.js');
|
|
15
18
|
var ReleaseNoteView = require('./Release/ReleaseNoteView.js');
|
|
16
19
|
var sectionPresentation = require('./Release/sectionPresentation.js');
|
|
17
20
|
var usePlaybill = require('./usePlaybill.js');
|
|
@@ -26,16 +29,19 @@ exports.defaultBasePath = PlaybillClient.defaultBasePath;
|
|
|
26
29
|
exports.PlaybillProvider = PlaybillProvider.PlaybillProvider;
|
|
27
30
|
exports.usePlaybillClient = PlaybillProvider.usePlaybillClient;
|
|
28
31
|
exports.PlaybillDialog = PlaybillDialog.PlaybillDialog;
|
|
32
|
+
exports.PlaybillHistoryDialog = PlaybillHistoryDialog.PlaybillHistoryDialog;
|
|
29
33
|
exports.PlaybillIcon = Icons.PlaybillIcon;
|
|
30
34
|
exports.defaultPlaybillLabels = defaultPlaybillLabels.defaultPlaybillLabels;
|
|
31
35
|
exports.resolveLabels = resolveLabels.resolveLabels;
|
|
32
36
|
exports.withCount = resolveLabels.withCount;
|
|
33
37
|
exports.resolveAssetUrl = assetUrl.resolveAssetUrl;
|
|
38
|
+
exports.linkIssueReferences = linkIssueReferences.linkIssueReferences;
|
|
34
39
|
exports.PlaybillMarkdown = PlaybillMarkdown.PlaybillMarkdown;
|
|
35
40
|
exports.isSafeLink = safeLink.isSafeLink;
|
|
36
41
|
exports.safeLinkOrEmpty = safeLink.safeLinkOrEmpty;
|
|
37
42
|
exports.Playbill = Playbill.Playbill;
|
|
38
43
|
exports.formatReleaseDate = formatReleaseDate.formatReleaseDate;
|
|
44
|
+
exports.issueRepositoryFor = issueRepositoryFor.issueRepositoryFor;
|
|
39
45
|
exports.ReleaseNoteView = ReleaseNoteView.ReleaseNoteView;
|
|
40
46
|
exports.sectionPresentation = sectionPresentation.sectionPresentation;
|
|
41
47
|
exports.usePlaybill = usePlaybill.usePlaybill;
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { PlaybillLabels } from '../Labels/index.js';
|
|
3
3
|
import { PlaybillMarkdownProps } from '../Markdown/index.js';
|
|
4
|
-
import { ReleaseNoteViewProps } from '../Release/index.js';
|
|
4
|
+
import { IssueRepository, ReleaseNoteViewProps } from '../Release/index.js';
|
|
5
5
|
export interface PlaybillDialogProps {
|
|
6
6
|
release?: ComponentType<ReleaseNoteViewProps>;
|
|
7
7
|
markdown?: ComponentType<PlaybillMarkdownProps>;
|
|
8
8
|
labels?: Partial<PlaybillLabels>;
|
|
9
9
|
locale?: string | string[];
|
|
10
|
+
issues?: IssueRepository;
|
|
10
11
|
maxReleases?: number;
|
|
11
12
|
}
|
|
12
|
-
export declare const PlaybillDialog: ({ release: Release, markdown, labels, locale, maxReleases }: PlaybillDialogProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const PlaybillDialog: ({ release: Release, markdown, labels, locale, issues, maxReleases }: PlaybillDialogProps) => import("react").JSX.Element;
|
|
13
14
|
//# sourceMappingURL=PlaybillDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaybillDialog.d.ts","sourceRoot":"","sources":["../../../Dialog/PlaybillDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,cAAc,EAA4B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAoB,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"PlaybillDialog.d.ts","sourceRoot":"","sources":["../../../Dialog/PlaybillDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,cAAc,EAA4B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAoB,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAuC,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAOjH,MAAM,WAAW,mBAAmB;IAEhC,OAAO,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAE9C,QAAQ,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAEhD,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAOD,eAAO,MAAM,cAAc,GAAI,qEAA2F,mBAAmB,gCAiD5I,CAAC"}
|
|
@@ -5,6 +5,7 @@ import { useMemo, useState } from 'react';
|
|
|
5
5
|
import { usePlaybillClient } from '../Configuration/PlaybillProvider.js';
|
|
6
6
|
import { resolveLabels, withCount } from '../Labels/resolveLabels.js';
|
|
7
7
|
import { PlaybillMarkdown } from '../Markdown/PlaybillMarkdown.js';
|
|
8
|
+
import { issueRepositoryFor } from '../Release/issueRepositoryFor.js';
|
|
8
9
|
import { ReleaseNoteView } from '../Release/ReleaseNoteView.js';
|
|
9
10
|
import { usePlaybillStatus } from '../usePlaybillStatus.js';
|
|
10
11
|
import { useReleaseNotes } from '../useReleases.js';
|
|
@@ -13,7 +14,7 @@ import { useReleaseNotes } from '../useReleases.js';
|
|
|
13
14
|
* Tells the signed-in person what is new: a dialog that opens by itself with the notes of the releases they have not
|
|
14
15
|
* seen, and records that they have when it is closed, so it does not return on any device. Nothing opens when nothing
|
|
15
16
|
* is unread. Mount it once, in the application shell and inside Arc's context.
|
|
16
|
-
*/ const PlaybillDialog = ({ release: Release = ReleaseNoteView, markdown, labels, locale, maxReleases = 5 })=>{
|
|
17
|
+
*/ const PlaybillDialog = ({ release: Release = ReleaseNoteView, markdown, labels, locale, issues, maxReleases = 5 })=>{
|
|
17
18
|
const client = usePlaybillClient();
|
|
18
19
|
const { unreadVersions, markSeen } = usePlaybillStatus();
|
|
19
20
|
const resolved = useMemo(()=>resolveLabels(labels), [
|
|
@@ -62,6 +63,7 @@ import { useReleaseNotes } from '../useReleases.js';
|
|
|
62
63
|
labels: resolved,
|
|
63
64
|
markdown: markdown ?? PlaybillMarkdown,
|
|
64
65
|
locale: locale,
|
|
66
|
+
issueRepository: issueRepositoryFor(issues, note.version),
|
|
65
67
|
headingLevel: 3
|
|
66
68
|
}, note.version)),
|
|
67
69
|
unreadVersions.length > shown.length && /*#__PURE__*/ jsx("p", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlaybillDialog.js","sources":["../../../Dialog/PlaybillDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogButtons } from '@cratis/arc.react/dialogs';\nimport { Dialog, DialogInitialFocus } from '@cratis/components/Dialogs';\nimport { ComponentType, useMemo, useState } from 'react';\nimport { usePlaybillClient } from '../Configuration/index.js';\nimport { PlaybillLabels, resolveLabels, withCount } from '../Labels/index.js';\nimport { PlaybillMarkdown, PlaybillMarkdownProps } from '../Markdown/index.js';\nimport { ReleaseNoteView, ReleaseNoteViewProps } from '../Release/index.js';\nimport { usePlaybillStatus } from '../usePlaybillStatus.js';\nimport { useReleaseNotes } from '../useReleases.js';\n\n/**\n * Props for {@link PlaybillDialog}.\n */\nexport interface PlaybillDialogProps {\n /** Replaces how one release is drawn. */\n release?: ComponentType<ReleaseNoteViewProps>;\n /** Replaces the Markdown renderer the default release view uses, and that a custom one is given. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The texts to replace; the rest stay English. */\n labels?: Partial<PlaybillLabels>;\n /** The locale to write the dates in; the browser's when not given. */\n locale?: string | string[];\n /** The most releases to show at once, the newest first. Defaults to 5; the rest are pointed to with the `earlier` text. */\n maxReleases?: number;\n}\n\n/**\n * Tells the signed-in person what is new: a dialog that opens by itself with the notes of the releases they have not\n * seen, and records that they have when it is closed, so it does not return on any device. Nothing opens when nothing\n * is unread. Mount it once, in the application shell and inside Arc's context.\n */\nexport const PlaybillDialog = ({ release: Release = ReleaseNoteView, markdown, labels, locale, maxReleases = 5 }: PlaybillDialogProps) => {\n const client = usePlaybillClient();\n const { unreadVersions, markSeen } = usePlaybillStatus();\n const resolved = useMemo(() => resolveLabels(labels), [labels]);\n const shown = useMemo(() => unreadVersions.slice(0, maxReleases), [unreadVersions, maxReleases]);\n const key = shown.join('|');\n const [dismissed, setDismissed] = useState<string>();\n const { data: releases, isLoading, error } = useReleaseNotes(shown);\n\n if (shown.length === 0 || dismissed === key) {\n return <></>;\n }\n\n const close = () => {\n setDismissed(key);\n // Failing to remember it must not keep a person from reading on.\n markSeen(shown[0]).catch(() => undefined);\n };\n\n return (\n <Dialog\n title={resolved.title}\n width='40rem'\n buttons={DialogButtons.Ok}\n okLabel={resolved.acknowledge}\n closeAriaLabel={resolved.close}\n initialFocus={DialogInitialFocus.Content}\n onConfirm={close}\n onCancel={close}>\n <div className='playbill-dialog'>\n {isLoading && <p className='playbill-status' role='status'>{resolved.loading}</p>}\n {error && <p className='playbill-status playbill-status--failed' role='alert'>{resolved.failed}</p>}\n {!isLoading && !error && releases?.map(note => (\n <Release\n key={note.version}\n release={note}\n assetBase={client.assetBase(note.version)}\n labels={resolved}\n markdown={markdown ?? PlaybillMarkdown}\n locale={locale}\n headingLevel={3} />\n ))}\n {unreadVersions.length > shown.length && (\n <p className='playbill-dialog__earlier'>{withCount(resolved.earlier, unreadVersions.length - shown.length)}</p>\n )}\n </div>\n </Dialog>\n );\n};\n"],"names":["PlaybillDialog","release","Release","ReleaseNoteView","markdown","labels","locale","maxReleases","client","usePlaybillClient","unreadVersions","markSeen","usePlaybillStatus","resolved","useMemo","resolveLabels","shown","slice","key","join","dismissed","setDismissed","useState","data","releases","isLoading","error","useReleaseNotes","length","_jsx","_Fragment","close","catch","undefined","Dialog","title","width","buttons","DialogButtons","Ok","okLabel","acknowledge","closeAriaLabel","initialFocus","DialogInitialFocus","Content","onConfirm","onCancel","_jsxs","div","className","p","role","loading","failed","map","note","assetBase","version","PlaybillMarkdown","headingLevel","withCount","earlier"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlaybillDialog.js","sources":["../../../Dialog/PlaybillDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogButtons } from '@cratis/arc.react/dialogs';\nimport { Dialog, DialogInitialFocus } from '@cratis/components/Dialogs';\nimport { ComponentType, useMemo, useState } from 'react';\nimport { usePlaybillClient } from '../Configuration/index.js';\nimport { PlaybillLabels, resolveLabels, withCount } from '../Labels/index.js';\nimport { PlaybillMarkdown, PlaybillMarkdownProps } from '../Markdown/index.js';\nimport { IssueRepository, issueRepositoryFor, ReleaseNoteView, ReleaseNoteViewProps } from '../Release/index.js';\nimport { usePlaybillStatus } from '../usePlaybillStatus.js';\nimport { useReleaseNotes } from '../useReleases.js';\n\n/**\n * Props for {@link PlaybillDialog}.\n */\nexport interface PlaybillDialogProps {\n /** Replaces how one release is drawn. */\n release?: ComponentType<ReleaseNoteViewProps>;\n /** Replaces the Markdown renderer the default release view uses, and that a custom one is given. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The texts to replace; the rest stay English. */\n labels?: Partial<PlaybillLabels>;\n /** The locale to write the dates in; the browser's when not given. */\n locale?: string | string[];\n /** Where the issues of the releases are tracked, so `#123` in a note links to one. A function answers for each version. Not linked when not given. */\n issues?: IssueRepository;\n /** The most releases to show at once, the newest first. Defaults to 5; the rest are pointed to with the `earlier` text. */\n maxReleases?: number;\n}\n\n/**\n * Tells the signed-in person what is new: a dialog that opens by itself with the notes of the releases they have not\n * seen, and records that they have when it is closed, so it does not return on any device. Nothing opens when nothing\n * is unread. Mount it once, in the application shell and inside Arc's context.\n */\nexport const PlaybillDialog = ({ release: Release = ReleaseNoteView, markdown, labels, locale, issues, maxReleases = 5 }: PlaybillDialogProps) => {\n const client = usePlaybillClient();\n const { unreadVersions, markSeen } = usePlaybillStatus();\n const resolved = useMemo(() => resolveLabels(labels), [labels]);\n const shown = useMemo(() => unreadVersions.slice(0, maxReleases), [unreadVersions, maxReleases]);\n const key = shown.join('|');\n const [dismissed, setDismissed] = useState<string>();\n const { data: releases, isLoading, error } = useReleaseNotes(shown);\n\n if (shown.length === 0 || dismissed === key) {\n return <></>;\n }\n\n const close = () => {\n setDismissed(key);\n // Failing to remember it must not keep a person from reading on.\n markSeen(shown[0]).catch(() => undefined);\n };\n\n return (\n <Dialog\n title={resolved.title}\n width='40rem'\n buttons={DialogButtons.Ok}\n okLabel={resolved.acknowledge}\n closeAriaLabel={resolved.close}\n initialFocus={DialogInitialFocus.Content}\n onConfirm={close}\n onCancel={close}>\n <div className='playbill-dialog'>\n {isLoading && <p className='playbill-status' role='status'>{resolved.loading}</p>}\n {error && <p className='playbill-status playbill-status--failed' role='alert'>{resolved.failed}</p>}\n {!isLoading && !error && releases?.map(note => (\n <Release\n key={note.version}\n release={note}\n assetBase={client.assetBase(note.version)}\n labels={resolved}\n markdown={markdown ?? PlaybillMarkdown}\n locale={locale}\n issueRepository={issueRepositoryFor(issues, note.version)}\n headingLevel={3} />\n ))}\n {unreadVersions.length > shown.length && (\n <p className='playbill-dialog__earlier'>{withCount(resolved.earlier, unreadVersions.length - shown.length)}</p>\n )}\n </div>\n </Dialog>\n );\n};\n"],"names":["PlaybillDialog","release","Release","ReleaseNoteView","markdown","labels","locale","issues","maxReleases","client","usePlaybillClient","unreadVersions","markSeen","usePlaybillStatus","resolved","useMemo","resolveLabels","shown","slice","key","join","dismissed","setDismissed","useState","data","releases","isLoading","error","useReleaseNotes","length","_jsx","_Fragment","close","catch","undefined","Dialog","title","width","buttons","DialogButtons","Ok","okLabel","acknowledge","closeAriaLabel","initialFocus","DialogInitialFocus","Content","onConfirm","onCancel","_jsxs","div","className","p","role","loading","failed","map","note","assetBase","version","PlaybillMarkdown","issueRepository","issueRepositoryFor","headingLevel","withCount","earlier"],"mappings":";;;;;;;;;;;;AA+BA;;;;AAIC,IACM,MAAMA,cAAAA,GAAiB,CAAC,EAAEC,OAAAA,EAASC,UAAUC,eAAe,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,WAAAA,GAAc,CAAC,EAAuB,GAAA;AACzI,IAAA,MAAMC,MAAAA,GAASC,iBAAAA,EAAAA;AACf,IAAA,MAAM,EAAEC,cAAc,EAAEC,QAAQ,EAAE,GAAGC,iBAAAA,EAAAA;AACrC,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,aAAAA,CAAcX,MAAAA,CAAAA,EAAS;AAACA,QAAAA;AAAO,KAAA,CAAA;AAC9D,IAAA,MAAMY,QAAQF,OAAAA,CAAQ,IAAMJ,eAAeO,KAAK,CAAC,GAAGV,WAAAA,CAAAA,EAAc;AAACG,QAAAA,cAAAA;AAAgBH,QAAAA;AAAY,KAAA,CAAA;IAC/F,MAAMW,GAAAA,GAAMF,KAAAA,CAAMG,IAAI,CAAC,GAAA,CAAA;IACvB,MAAM,CAACC,SAAAA,EAAWC,YAAAA,CAAa,GAAGC,QAAAA,EAAAA;IAClC,MAAM,EAAEC,MAAMC,QAAQ,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,eAAAA,CAAgBX,KAAAA,CAAAA;AAE7D,IAAA,IAAIA,KAAAA,CAAMY,MAAM,KAAK,CAAA,IAAKR,cAAcF,GAAAA,EAAK;QACzC,qBAAOW,GAAA,CAAAC,QAAA,EAAA,EAAA,CAAA;AACX,IAAA;AAEA,IAAA,MAAMC,KAAAA,GAAQ,IAAA;QACVV,YAAAA,CAAaH,GAAAA,CAAAA;;AAEbP,QAAAA,QAAAA,CAASK,KAAK,CAAC,CAAA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IAAAA,CAAKE,OAAO,CAAA;wBACxDI,YAAAA,EAAc;AAPTN,qBAAAA,EAAAA,IAAAA,CAAKE,OAAO,CAAA,CAAA;AASxBhD,gBAAAA,cAAAA,CAAekB,MAAM,GAAGZ,KAAAA,CAAMY,MAAM,kBACjCC,GAAA,CAACsB,GAAAA,EAAAA;oBAAED,SAAAA,EAAU,0BAAA;AAA4Ba,oBAAAA,QAAAA,EAAAA,SAAAA,CAAUlD,SAASmD,OAAO,EAAEtD,eAAekB,MAAM,GAAGZ,MAAMY,MAAM;;;;;AAK7H;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PlaybillProps } from '../Playbill.js';
|
|
2
|
+
export interface PlaybillHistoryDialogProps extends Omit<PlaybillProps, 'selected' | 'onSelect'> {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const PlaybillHistoryDialog: ({ open, onClose, labels, ...page }: PlaybillHistoryDialogProps) => import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=PlaybillHistoryDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaybillHistoryDialog.d.ts","sourceRoot":"","sources":["../../../Dialog/PlaybillHistoryDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAY,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAKzD,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,UAAU,CAAC;IAE5F,IAAI,EAAE,OAAO,CAAC;IAEd,OAAO,EAAE,MAAM,IAAI,CAAC;CACvB;AAOD,eAAO,MAAM,qBAAqB,GAAI,oCAAoC,0BAA0B,gCAsBnG,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { DialogButtons } from '@cratis/arc.react/dialogs';
|
|
3
|
+
import { Dialog, DialogInitialFocus } from '@cratis/components/Dialogs';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { resolveLabels } from '../Labels/resolveLabels.js';
|
|
6
|
+
import { Playbill } from '../Playbill.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The whole release history in a dialog, for an application that has no page for it: the "What's new" entry of a menu or the
|
|
10
|
+
* "About" dialog opens it on request. It is the {@link Playbill} page inside a dialog, so showing a release that has not been
|
|
11
|
+
* seen records it as seen. Mount it once in the application shell, inside Arc's context, and control it with `open`.
|
|
12
|
+
*/ const PlaybillHistoryDialog = ({ open, onClose, labels, ...page })=>{
|
|
13
|
+
const resolved = useMemo(()=>resolveLabels(labels), [
|
|
14
|
+
labels
|
|
15
|
+
]);
|
|
16
|
+
if (!open) {
|
|
17
|
+
return /*#__PURE__*/ jsx(Fragment, {});
|
|
18
|
+
}
|
|
19
|
+
return /*#__PURE__*/ jsx(Dialog, {
|
|
20
|
+
title: resolved.title,
|
|
21
|
+
width: "56rem",
|
|
22
|
+
buttons: DialogButtons.Ok,
|
|
23
|
+
okLabel: resolved.acknowledge,
|
|
24
|
+
closeAriaLabel: resolved.close,
|
|
25
|
+
initialFocus: DialogInitialFocus.Content,
|
|
26
|
+
onConfirm: onClose,
|
|
27
|
+
onCancel: onClose,
|
|
28
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
29
|
+
className: "playbill-history",
|
|
30
|
+
children: /*#__PURE__*/ jsx(Playbill, {
|
|
31
|
+
labels: labels,
|
|
32
|
+
...page
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { PlaybillHistoryDialog };
|
|
39
|
+
//# sourceMappingURL=PlaybillHistoryDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlaybillHistoryDialog.js","sources":["../../../Dialog/PlaybillHistoryDialog.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DialogButtons } from '@cratis/arc.react/dialogs';\nimport { Dialog, DialogInitialFocus } from '@cratis/components/Dialogs';\nimport { useMemo } from 'react';\nimport { resolveLabels } from '../Labels/index.js';\nimport { Playbill, PlaybillProps } from '../Playbill.js';\n\n/**\n * Props for {@link PlaybillHistoryDialog}.\n */\nexport interface PlaybillHistoryDialogProps extends Omit<PlaybillProps, 'selected' | 'onSelect'> {\n /** Whether the dialog is shown. */\n open: boolean;\n /** Called when the person closes the dialog. */\n onClose: () => void;\n}\n\n/**\n * The whole release history in a dialog, for an application that has no page for it: the \"What's new\" entry of a menu or the\n * \"About\" dialog opens it on request. It is the {@link Playbill} page inside a dialog, so showing a release that has not been\n * seen records it as seen. Mount it once in the application shell, inside Arc's context, and control it with `open`.\n */\nexport const PlaybillHistoryDialog = ({ open, onClose, labels, ...page }: PlaybillHistoryDialogProps) => {\n const resolved = useMemo(() => resolveLabels(labels), [labels]);\n\n if (!open) {\n return <></>;\n }\n\n return (\n <Dialog\n title={resolved.title}\n width='56rem'\n buttons={DialogButtons.Ok}\n okLabel={resolved.acknowledge}\n closeAriaLabel={resolved.close}\n initialFocus={DialogInitialFocus.Content}\n onConfirm={onClose}\n onCancel={onClose}>\n <div className='playbill-history'>\n <Playbill labels={labels} {...page} />\n </div>\n </Dialog>\n );\n};\n"],"names":["PlaybillHistoryDialog","open","onClose","labels","page","resolved","useMemo","resolveLabels","_jsx","_Fragment","Dialog","title","width","buttons","DialogButtons","Ok","okLabel","acknowledge","closeAriaLabel","close","initialFocus","DialogInitialFocus","Content","onConfirm","onCancel","div","className","Playbill"],"mappings":";;;;;;;AAmBA;;;;AAIC,IACM,MAAMA,qBAAAA,GAAwB,CAAC,EAAEC,IAAI,EAAEC,OAAO,EAAEC,MAAM,EAAE,GAAGC,IAAAA,EAAkC,GAAA;AAChG,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,aAAAA,CAAcJ,MAAAA,CAAAA,EAAS;AAACA,QAAAA;AAAO,KAAA,CAAA;AAE9D,IAAA,IAAI,CAACF,IAAAA,EAAM;QACP,qBAAOO,GAAA,CAAAC,QAAA,EAAA,EAAA,CAAA;AACX,IAAA;AAEA,IAAA,qBACID,GAAA,CAACE,MAAAA,EAAAA;AACGC,QAAAA,KAAAA,EAAON,SAASM,KAAK;QACrBC,KAAAA,EAAM,OAAA;AACNC,QAAAA,OAAAA,EAASC,cAAcC,EAAE;AACzBC,QAAAA,OAAAA,EAASX,SAASY,WAAW;AAC7BC,QAAAA,cAAAA,EAAgBb,SAASc,KAAK;AAC9BC,QAAAA,YAAAA,EAAcC,mBAAmBC,OAAO;QACxCC,SAAAA,EAAWrB,OAAAA;QACXsB,QAAAA,EAAUtB,OAAAA;AACV,QAAA,QAAA,gBAAAM,GAAA,CAACiB,KAAAA,EAAAA;YAAIC,SAAAA,EAAU,kBAAA;AACX,YAAA,QAAA,gBAAAlB,GAAA,CAACmB,QAAAA,EAAAA;gBAASxB,MAAAA,EAAQA,MAAAA;AAAS,gBAAA,GAAGC;;;;AAI9C;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Dialog/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Dialog/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
package/dist/esm/Dialog/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Dialog/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Dialog/index.ts"],"names":[],"mappings":"AAGA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryDialog.d.ts","sourceRoot":"","sources":["../../../Examples/HistoryDialog.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB,mCAS7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PlaybillHistoryDialog } from '@cratis/showrunner.playbill.react';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
export const WhatsNewMenuEntry = () => {
|
|
5
|
+
const [open, setOpen] = useState(false);
|
|
6
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { type: 'button', onClick: () => setOpen(true), children: "What's new" }), _jsx(PlaybillHistoryDialog, { open: open, onClose: () => setOpen(false) })] }));
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=HistoryDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HistoryDialog.js","sourceRoot":"","sources":["../../../Examples/HistoryDialog.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,EAAE;IAClC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExC,OAAO,CACH,8BACI,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,2BAAqB,EACvE,KAAC,qBAAqB,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,GAAI,IACrE,CACN,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Markdown/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Markdown/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Markdown/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Markdown/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkIssueReferences.d.ts","sourceRoot":"","sources":["../../../Markdown/linkIssueReferences.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,EAAE,YAAY,MAAM,KAAG,MAO1E,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
// A qualified issue reference (`owner/repo#123`) after the start of a line, whitespace or an opening parenthesis.
|
|
4
|
+
const qualifiedIssuePattern = /(^|[\s(])([A-Za-z\d][A-Za-z\d-]*\/[A-Za-z\d._-]+)#(\d+)\b/g;
|
|
5
|
+
// A bare issue reference (`#123`) in the same places. A heading never matches, because `#` is followed by a space, and a
|
|
6
|
+
// reference inside a link or an address is preceded by a character that does not match.
|
|
7
|
+
const bareIssuePattern = /(^|[\s(])#(\d+)\b/g;
|
|
8
|
+
/**
|
|
9
|
+
* Turns the issue references in a note into links: `#123` to an issue of the repository the notes belong to, and
|
|
10
|
+
* `owner/repo#123` to that repository's.
|
|
11
|
+
* @param markdown - The Markdown of the note.
|
|
12
|
+
* @param repository - The address of the repository `#123` belongs to, such as `https://github.com/Cratis/Studio`.
|
|
13
|
+
* @returns The Markdown with the references as links.
|
|
14
|
+
*/ const linkIssueReferences = (markdown, repository)=>{
|
|
15
|
+
const home = repository.replace(/\/+$/, '');
|
|
16
|
+
return markdown.replace(qualifiedIssuePattern, (_match, prefix, name, number)=>`${prefix}[${name}#${number}](https://github.com/${name}/issues/${number})`).replace(bareIssuePattern, (_match, prefix, number)=>`${prefix}[#${number}](${home}/issues/${number})`);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { linkIssueReferences };
|
|
20
|
+
//# sourceMappingURL=linkIssueReferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkIssueReferences.js","sources":["../../../Markdown/linkIssueReferences.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n// A qualified issue reference (`owner/repo#123`) after the start of a line, whitespace or an opening parenthesis.\nconst qualifiedIssuePattern = /(^|[\\s(])([A-Za-z\\d][A-Za-z\\d-]*\\/[A-Za-z\\d._-]+)#(\\d+)\\b/g;\n\n// A bare issue reference (`#123`) in the same places. A heading never matches, because `#` is followed by a space, and a\n// reference inside a link or an address is preceded by a character that does not match.\nconst bareIssuePattern = /(^|[\\s(])#(\\d+)\\b/g;\n\n/**\n * Turns the issue references in a note into links: `#123` to an issue of the repository the notes belong to, and\n * `owner/repo#123` to that repository's.\n * @param markdown - The Markdown of the note.\n * @param repository - The address of the repository `#123` belongs to, such as `https://github.com/Cratis/Studio`.\n * @returns The Markdown with the references as links.\n */\nexport const linkIssueReferences = (markdown: string, repository: string): string => {\n const home = repository.replace(/\\/+$/, '');\n return markdown\n .replace(qualifiedIssuePattern, (_match, prefix: string, name: string, number: string) =>\n `${prefix}[${name}#${number}](https://github.com/${name}/issues/${number})`)\n .replace(bareIssuePattern, (_match, prefix: string, number: string) =>\n `${prefix}[#${number}](${home}/issues/${number})`);\n};\n"],"names":["qualifiedIssuePattern","bareIssuePattern","linkIssueReferences","markdown","repository","home","replace","_match","prefix","name","number"],"mappings":"AAAA;AACA;AAEA;AACA,MAAMA,qBAAAA,GAAwB,4DAAA;AAE9B;AACA;AACA,MAAMC,gBAAAA,GAAmB,oBAAA;AAEzB;;;;;;AAMC,IACM,MAAMC,mBAAAA,GAAsB,CAACC,QAAAA,EAAkBC,UAAAA,GAAAA;AAClD,IAAA,MAAMC,IAAAA,GAAOD,UAAAA,CAAWE,OAAO,CAAC,MAAA,EAAQ,EAAA,CAAA;IACxC,OAAOH,QAAAA,CACFG,OAAO,CAACN,qBAAAA,EAAuB,CAACO,MAAAA,EAAQC,MAAAA,EAAgBC,MAAcC,MAAAA,GACnE,CAAA,EAAGF,OAAO,CAAC,EAAEC,KAAK,CAAC,EAAEC,OAAO,qBAAqB,EAAED,KAAK,QAAQ,EAAEC,OAAO,CAAC,CAAC,EAC9EJ,OAAO,CAACL,kBAAkB,CAACM,MAAAA,EAAQC,QAAgBE,MAAAA,GAChD,CAAA,EAAGF,OAAO,EAAE,EAAEE,OAAO,EAAE,EAAEL,KAAK,QAAQ,EAAEK,MAAAA,CAAO,CAAC,CAAC,CAAA;AAC7D;;"}
|
package/dist/esm/Playbill.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
import { PlaybillLabels } from './Labels/index.js';
|
|
3
3
|
import { PlaybillMarkdownProps } from './Markdown/index.js';
|
|
4
|
-
import { ReleaseNoteViewProps } from './Release/index.js';
|
|
4
|
+
import { IssueRepository, ReleaseNoteViewProps } from './Release/index.js';
|
|
5
5
|
export interface PlaybillProps {
|
|
6
6
|
release?: ComponentType<ReleaseNoteViewProps>;
|
|
7
7
|
markdown?: ComponentType<PlaybillMarkdownProps>;
|
|
8
8
|
labels?: Partial<PlaybillLabels>;
|
|
9
9
|
locale?: string | string[];
|
|
10
|
+
issues?: IssueRepository;
|
|
10
11
|
selected?: string;
|
|
11
12
|
onSelect?: (version: string) => void;
|
|
12
13
|
markSeenWhenShown?: boolean;
|
|
13
14
|
}
|
|
14
|
-
export declare const Playbill: ({ release: Release, markdown, labels, locale, selected, onSelect, markSeenWhenShown }: PlaybillProps) => import("react").JSX.Element;
|
|
15
|
+
export declare const Playbill: ({ release: Release, markdown, labels, locale, issues, selected, onSelect, markSeenWhenShown }: PlaybillProps) => import("react").JSX.Element;
|
|
15
16
|
//# sourceMappingURL=Playbill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Playbill.d.ts","sourceRoot":"","sources":["../../Playbill.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAgC,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAoB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"Playbill.d.ts","sourceRoot":"","sources":["../../Playbill.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAgC,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAiB,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAoB,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAqB,eAAe,EAAuC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAOnI,MAAM,WAAW,aAAa;IAE1B,OAAO,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAE9C,QAAQ,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAEhD,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IAEjC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,MAAM,CAAC,EAAE,eAAe,CAAC;IAEzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAErC,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAOD,eAAO,MAAM,QAAQ,GAAI,+FAStB,aAAa,gCA6Ef,CAAC"}
|
package/dist/esm/Playbill.js
CHANGED
|
@@ -4,6 +4,7 @@ import { usePlaybillClient } from './Configuration/PlaybillProvider.js';
|
|
|
4
4
|
import { resolveLabels } from './Labels/resolveLabels.js';
|
|
5
5
|
import { PlaybillMarkdown } from './Markdown/PlaybillMarkdown.js';
|
|
6
6
|
import { formatReleaseDate } from './Release/formatReleaseDate.js';
|
|
7
|
+
import { issueRepositoryFor } from './Release/issueRepositoryFor.js';
|
|
7
8
|
import { ReleaseNoteView } from './Release/ReleaseNoteView.js';
|
|
8
9
|
import { usePlaybill } from './usePlaybill.js';
|
|
9
10
|
import { useRelease } from './useReleases.js';
|
|
@@ -12,7 +13,7 @@ import { useRelease } from './useReleases.js';
|
|
|
12
13
|
* The release notes of the application as a page: the releases newest first on one side and the selected release on the
|
|
13
14
|
* other. It marks what the person has not seen with a tag, and records a release as seen when it is shown. Place it
|
|
14
15
|
* where the application has room for a page, inside Arc's context. It draws no heading of its own.
|
|
15
|
-
*/ const Playbill = ({ release: Release = ReleaseNoteView, markdown, labels, locale, selected, onSelect, markSeenWhenShown = true })=>{
|
|
16
|
+
*/ const Playbill = ({ release: Release = ReleaseNoteView, markdown, labels, locale, issues, selected, onSelect, markSeenWhenShown = true })=>{
|
|
16
17
|
const client = usePlaybillClient();
|
|
17
18
|
const { releases, current, isLoading, error, unreadVersions, markSeen } = usePlaybill();
|
|
18
19
|
const resolved = useMemo(()=>resolveLabels(labels), [
|
|
@@ -120,6 +121,7 @@ import { useRelease } from './useReleases.js';
|
|
|
120
121
|
labels: resolved,
|
|
121
122
|
markdown: markdown ?? PlaybillMarkdown,
|
|
122
123
|
locale: locale,
|
|
124
|
+
issueRepository: issueRepositoryFor(issues, note.version),
|
|
123
125
|
isUnread: selectedIsUnread,
|
|
124
126
|
isCurrent: note.version === current
|
|
125
127
|
})
|
package/dist/esm/Playbill.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Playbill.js","sources":["../../Playbill.tsx"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentType, useEffect, useMemo, useState } from 'react';\nimport { usePlaybillClient } from './Configuration/index.js';\nimport { PlaybillLabels, resolveLabels } from './Labels/index.js';\nimport { PlaybillMarkdown, PlaybillMarkdownProps } from './Markdown/index.js';\nimport { formatReleaseDate, ReleaseNoteView, ReleaseNoteViewProps } from './Release/index.js';\nimport { usePlaybill } from './usePlaybill.js';\nimport { useRelease } from './useReleases.js';\n\n/**\n * Props for {@link Playbill}.\n */\nexport interface PlaybillProps {\n /** Replaces how the selected release is drawn. */\n release?: ComponentType<ReleaseNoteViewProps>;\n /** Replaces the Markdown renderer the default release view uses, and that a custom one is given. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The texts to replace; the rest stay English. */\n labels?: Partial<PlaybillLabels>;\n /** The locale to write the dates in; the browser's when not given. */\n locale?: string | string[];\n /** The version to show. Give it, with `onSelect`, to keep the selection in the address; by default the newest is selected. */\n selected?: string;\n /** Called when the person picks another release. */\n onSelect?: (version: string) => void;\n /** Records that the person has seen a release when it is shown. On by default; turn it off to leave what is unread to a dialog. */\n markSeenWhenShown?: boolean;\n}\n\n/**\n * The release notes of the application as a page: the releases newest first on one side and the selected release on the\n * other. It marks what the person has not seen with a tag, and records a release as seen when it is shown. Place it\n * where the application has room for a page, inside Arc's context. It draws no heading of its own.\n */\nexport const Playbill = ({\n release: Release = ReleaseNoteView,\n markdown,\n labels,\n locale,\n selected,\n onSelect,\n markSeenWhenShown = true\n}: PlaybillProps) => {\n const client = usePlaybillClient();\n const { releases, current, isLoading, error, unreadVersions, markSeen } = usePlaybill();\n const resolved = useMemo(() => resolveLabels(labels), [labels]);\n const [picked, setPicked] = useState<string>();\n const version = selected ?? picked ?? releases[0]?.version;\n const { data: note, isLoading: isLoadingNote, error: noteError } = useRelease(version);\n const isUnread = (candidate?: string) => candidate !== undefined && unreadVersions.includes(candidate);\n const selectedIsUnread = isUnread(version);\n\n useEffect(() => {\n if (markSeenWhenShown && note && selectedIsUnread) {\n // Failing to remember it must not keep a person from reading on.\n markSeen(note.version).catch(() => undefined);\n }\n }, [markSeenWhenShown, note, selectedIsUnread, markSeen]);\n\n const select = (next: string) => {\n setPicked(next);\n onSelect?.(next);\n };\n\n if (error || noteError) {\n return <p className='playbill-status playbill-status--failed' role='alert'>{resolved.failed}</p>;\n }\n\n if (isLoading) {\n return <p className='playbill-status' role='status'>{resolved.loading}</p>;\n }\n\n if (releases.length === 0) {\n return <p className='playbill-status'>{resolved.empty}</p>;\n }\n\n return (\n <div className='playbill'>\n <nav className='playbill__list' aria-label={resolved.releases}>\n <ul>\n {releases.map(summary => {\n const date = formatReleaseDate(summary.releasedAt, locale);\n const isSelected = summary.version === version;\n return (\n <li key={summary.version}>\n <button\n type='button'\n className={isSelected ? 'playbill-item playbill-item--selected' : 'playbill-item'}\n aria-current={isSelected ? 'true' : undefined}\n onClick={() => select(summary.version)}>\n <span className='playbill-item__heading'>\n <span className='playbill-item__version'>{summary.version}</span>\n {summary.version === current && <span className='playbill-tag playbill-tag--current'>{resolved.current}</span>}\n {isUnread(summary.version) && <span className='playbill-tag playbill-tag--unread'>{resolved.unread}</span>}\n </span>\n {date && <span className='playbill-item__date'>{date}</span>}\n {summary.summary && <span className='playbill-item__summary'>{summary.summary}</span>}\n </button>\n </li>\n );\n })}\n </ul>\n </nav>\n <div className='playbill__content'>\n {isLoadingNote && <p className='playbill-status' role='status'>{resolved.loading}</p>}\n {!isLoadingNote && note && (\n <Release\n release={note}\n assetBase={client.assetBase(note.version)}\n labels={resolved}\n markdown={markdown ?? PlaybillMarkdown}\n locale={locale}\n isUnread={selectedIsUnread}\n isCurrent={note.version === current} />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Playbill","release","Release","ReleaseNoteView","markdown","labels","locale","selected","onSelect","markSeenWhenShown","client","usePlaybillClient","releases","current","isLoading","error","unreadVersions","markSeen","usePlaybill","resolved","useMemo","resolveLabels","picked","setPicked","useState","version","data","note","isLoadingNote","noteError","useRelease","isUnread","candidate","undefined","includes","selectedIsUnread","useEffect","catch","select","next","_jsx","p","className","role","failed","loading","length","empty","_jsxs","div","nav","aria-label","ul","map","summary","date","formatReleaseDate","releasedAt","isSelected","li","button","type","aria-current","onClick","span","unread","assetBase","PlaybillMarkdown","isCurrent"],"mappings":";;;;;;;;;;AA+BA;;;;UAKaA,QAAAA,GAAW,CAAC,EACrBC,OAAAA,EAASC,OAAAA,GAAUC,eAAe,EAClCC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACRC,iBAAAA,GAAoB,IAAI,EACZ,GAAA;AACZ,IAAA,MAAMC,MAAAA,GAASC,iBAAAA,EAAAA;AACf,IAAA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,SAAS,EAAEC,KAAK,EAAEC,cAAc,EAAEC,QAAQ,EAAE,GAAGC,WAAAA,EAAAA;AAC1E,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,aAAAA,CAAchB,MAAAA,CAAAA,EAAS;AAACA,QAAAA;AAAO,KAAA,CAAA;IAC9D,MAAM,CAACiB,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,QAAAA,EAAAA;AAC5B,IAAA,MAAMC,UAAUlB,QAAAA,IAAYe,MAAAA,IAAUV,QAAQ,CAAC,EAA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c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentType, useEffect, useMemo, useState } from 'react';\nimport { usePlaybillClient } from './Configuration/index.js';\nimport { PlaybillLabels, resolveLabels } from './Labels/index.js';\nimport { PlaybillMarkdown, PlaybillMarkdownProps } from './Markdown/index.js';\nimport { formatReleaseDate, IssueRepository, issueRepositoryFor, ReleaseNoteView, ReleaseNoteViewProps } from './Release/index.js';\nimport { usePlaybill } from './usePlaybill.js';\nimport { useRelease } from './useReleases.js';\n\n/**\n * Props for {@link Playbill}.\n */\nexport interface PlaybillProps {\n /** Replaces how the selected release is drawn. */\n release?: ComponentType<ReleaseNoteViewProps>;\n /** Replaces the Markdown renderer the default release view uses, and that a custom one is given. */\n markdown?: ComponentType<PlaybillMarkdownProps>;\n /** The texts to replace; the rest stay English. */\n labels?: Partial<PlaybillLabels>;\n /** The locale to write the dates in; the browser's when not given. */\n locale?: string | string[];\n /** Where the issues of the releases are tracked, so `#123` in a note links to one. A function answers for each version. Not linked when not given. */\n issues?: IssueRepository;\n /** The version to show. Give it, with `onSelect`, to keep the selection in the address; by default the newest is selected. */\n selected?: string;\n /** Called when the person picks another release. */\n onSelect?: (version: string) => void;\n /** Records that the person has seen a release when it is shown. On by default; turn it off to leave what is unread to a dialog. */\n markSeenWhenShown?: boolean;\n}\n\n/**\n * The release notes of the application as a page: the releases newest first on one side and the selected release on the\n * other. It marks what the person has not seen with a tag, and records a release as seen when it is shown. Place it\n * where the application has room for a page, inside Arc's context. It draws no heading of its own.\n */\nexport const Playbill = ({\n release: Release = ReleaseNoteView,\n markdown,\n labels,\n locale,\n issues,\n selected,\n onSelect,\n markSeenWhenShown = true\n}: PlaybillProps) => {\n const client = usePlaybillClient();\n const { releases, current, isLoading, error, unreadVersions, markSeen } = usePlaybill();\n const resolved = useMemo(() => resolveLabels(labels), [labels]);\n const [picked, setPicked] = useState<string>();\n const version = selected ?? picked ?? releases[0]?.version;\n const { data: note, isLoading: isLoadingNote, error: noteError } = useRelease(version);\n const isUnread = (candidate?: string) => candidate !== undefined && unreadVersions.includes(candidate);\n const selectedIsUnread = isUnread(version);\n\n useEffect(() => {\n if (markSeenWhenShown && note && selectedIsUnread) {\n // Failing to remember it must not keep a person from reading on.\n markSeen(note.version).catch(() => undefined);\n }\n }, [markSeenWhenShown, note, selectedIsUnread, markSeen]);\n\n const select = (next: string) => {\n setPicked(next);\n onSelect?.(next);\n };\n\n if (error || noteError) {\n return <p className='playbill-status playbill-status--failed' role='alert'>{resolved.failed}</p>;\n }\n\n if (isLoading) {\n return <p className='playbill-status' role='status'>{resolved.loading}</p>;\n }\n\n if (releases.length === 0) {\n return <p className='playbill-status'>{resolved.empty}</p>;\n }\n\n return (\n <div className='playbill'>\n <nav className='playbill__list' aria-label={resolved.releases}>\n <ul>\n {releases.map(summary => {\n const date = formatReleaseDate(summary.releasedAt, locale);\n const isSelected = summary.version === version;\n return (\n <li key={summary.version}>\n <button\n type='button'\n className={isSelected ? 'playbill-item playbill-item--selected' : 'playbill-item'}\n aria-current={isSelected ? 'true' : undefined}\n onClick={() => select(summary.version)}>\n <span className='playbill-item__heading'>\n <span className='playbill-item__version'>{summary.version}</span>\n {summary.version === current && <span className='playbill-tag playbill-tag--current'>{resolved.current}</span>}\n {isUnread(summary.version) && <span className='playbill-tag playbill-tag--unread'>{resolved.unread}</span>}\n </span>\n {date && <span className='playbill-item__date'>{date}</span>}\n {summary.summary && <span className='playbill-item__summary'>{summary.summary}</span>}\n </button>\n </li>\n );\n })}\n </ul>\n </nav>\n <div className='playbill__content'>\n {isLoadingNote && <p className='playbill-status' role='status'>{resolved.loading}</p>}\n {!isLoadingNote && note && (\n <Release\n release={note}\n assetBase={client.assetBase(note.version)}\n labels={resolved}\n markdown={markdown ?? PlaybillMarkdown}\n locale={locale}\n issueRepository={issueRepositoryFor(issues, note.version)}\n isUnread={selectedIsUnread}\n isCurrent={note.version === current} />\n )}\n </div>\n </div>\n );\n};\n"],"names":["Playbill","release","Release","ReleaseNoteView","markdown","labels","locale","issues","selected","onSelect","markSeenWhenShown","client","usePlaybillClient","releases","current","isLoading","error","unreadVersions","markSeen","usePlaybill","resolved","useMemo","resolveLabels","picked","setPicked","useState","version","data","note","isLoadingNote","noteError","useRelease","isUnread","candidate","undefined","includes","selectedIsUnread","useEffect","catch","select","next","_jsx","p","className","role","failed","loading","length","empty","_jsxs","div","nav","aria-label","ul","map","summary","date","formatReleaseDate","releasedAt","isSelected","li","button","type","aria-current","onClick","span","unread","assetBase","PlaybillMarkdown","issueRepository","issueRepositoryFor","isCurrent"],"mappings":";;;;;;;;;;;AAiCA;;;;UAKaA,QAAAA,GAAW,CAAC,EACrBC,OAAAA,EAASC,OAAAA,GAAUC,eAAe,EAClCC,QAAQ,EACRC,MAAM,EACNC,MAAM,EACNC,MAAM,EACNC,QAAQ,EACRC,QAAQ,EACRC,iBAAAA,GAAoB,IAAI,EACZ,GAAA;AACZ,IAAA,MAAMC,MAAAA,GAASC,iBAAAA,EAAAA;AACf,IAAA,MAAM,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,SAAS,EAAEC,KAAK,EAAEC,cAAc,EAAEC,QAAQ,EAAE,GAAGC,WAAAA,EAAAA;AAC1E,IAAA,MAAMC,QAAAA,GAAWC,OAAAA,CAAQ,IAAMC,aAAAA,CAAcjB,MAAAA,CAAAA,EAAS;AAACA,QAAAA;AAAO,KAAA,CAAA;IAC9D,MAAM,CAACkB,MAAAA,EAAQC,SAAAA,CAAU,GAAGC,QAAAA,EAAAA;AAC5B,IAAA,MAAMC,UAAUlB,QAAAA,IAAYe,MAAAA,IAAUV,QAAQ,CAAC,EAAE,EAAEa,OAAAA;IACnD,MAAM,EAAEC,IAAAA,EAAMC,IAAI,EAAEb,SAAAA,EAAWc,aAAa,EAAEb,KAAAA,EAAOc,SAAS,EAAE,GAAGC,UAAAA,CAAWL,OAAAA,CAAAA;AAC9E,IAAA,MAAMM,WAAW,CAACC,SAAAA,GAAuBA,cAAcC,SA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A,kBAAQf,GAAA,CAACwB,MAAAA,EAAAA;wCAAKtB,SAAAA,EAAU,qBAAA;AAAuBa,wCAAAA,QAAAA,EAAAA;;oCAC/CD,OAAAA,CAAQA,OAAO,kBAAId,GAAA,CAACwB,MAAAA,EAAAA;wCAAKtB,SAAAA,EAAU,wBAAA;AAA0BY,wCAAAA,QAAAA,EAAAA,OAAAA,CAAQA;;;;AAZrEA,yBAAAA,EAAAA,OAAAA,CAAQ7B,OAAO,CAAA;AAgBhC,oBAAA,CAAA;;;0BAGRuB,IAAA,CAACC,KAAAA,EAAAA;gBAAIP,SAAAA,EAAU,mBAAA;;AACVd,oBAAAA,aAAAA,kBAAiBY,GAAA,CAACC,GAAAA,EAAAA;wBAAEC,SAAAA,EAAU,iBAAA;wBAAkBC,IAAAA,EAAK,QAAA;AAAUxB,wBAAAA,QAAAA,EAAAA,QAAAA,CAAS0B;;oBACxE,CAACjB,aAAAA,IAAiBD,sBACfa,GAAA,CAACvC,OAAAA,EAAAA;wBACGD,OAAAA,EAAS2B,IAAAA;AACTuC,wBAAAA,SAAAA,EAAWxD,MAAAA,CAAOwD,SAAS,CAACvC,IAAAA,CAAKF,OAAO,CAAA;wBACxCrB,MAAAA,EAAQe,QAAAA;AACRhB,wBAAAA,QAAAA,EAAUA,QAAAA,IAAYgE,gBAAAA;wBACtB9D,MAAAA,EAAQA,MAAAA;wBACR+D,eAAAA,EAAiBC,kBAAAA,CAAmB/D,MAAAA,EAAQqB,IAAAA,CAAKF,OAAO,CAAA;wBACxDM,QAAAA,EAAUI,gBAAAA;wBACVmC,SAAAA,EAAW3C,IAAAA,CAAKF,OAAO,KAAKZ;;;;;;AAKpD;;"}
|
|
@@ -10,7 +10,8 @@ export interface ReleaseNoteViewProps {
|
|
|
10
10
|
locale?: string | string[];
|
|
11
11
|
isUnread?: boolean;
|
|
12
12
|
isCurrent?: boolean;
|
|
13
|
+
issueRepository?: string;
|
|
13
14
|
headingLevel?: 2 | 3 | 4;
|
|
14
15
|
}
|
|
15
|
-
export declare const ReleaseNoteView: ({ release, assetBase, labels, markdown: Markdown, locale, isUnread, isCurrent, headingLevel }: ReleaseNoteViewProps) => import("react").JSX.Element;
|
|
16
|
+
export declare const ReleaseNoteView: ({ release, assetBase, labels, markdown: Markdown, locale, isUnread, isCurrent, issueRepository, headingLevel }: ReleaseNoteViewProps) => import("react").JSX.Element;
|
|
16
17
|
//# sourceMappingURL=ReleaseNoteView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReleaseNoteView.d.ts","sourceRoot":"","sources":["../../../Release/ReleaseNoteView.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"ReleaseNoteView.d.ts","sourceRoot":"","sources":["../../../Release/ReleaseNoteView.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAyC,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAQpG,MAAM,WAAW,oBAAoB;IAEjC,OAAO,EAAE,OAAO,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,MAAM,EAAE,cAAc,CAAC;IAEvB,QAAQ,CAAC,EAAE,aAAa,CAAC,qBAAqB,CAAC,CAAC;IAEhD,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAE3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;CAC5B;AAMD,eAAO,MAAM,eAAe,GAAI,gHAU7B,oBAAoB,gCAiCtB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { linkIssueReferences } from '../Markdown/linkIssueReferences.js';
|
|
2
3
|
import { PlaybillMarkdown } from '../Markdown/PlaybillMarkdown.js';
|
|
3
4
|
import { formatReleaseDate } from './formatReleaseDate.js';
|
|
4
5
|
import { sectionPresentation } from './sectionPresentation.js';
|
|
@@ -8,10 +9,11 @@ import { sectionPresentation } from './sectionPresentation.js';
|
|
|
8
9
|
/**
|
|
9
10
|
* One release: its version and date, what its note says before the first section, and each section under its heading.
|
|
10
11
|
* It draws no frame of its own, so a page, a dialog or a product's own surface can hold it.
|
|
11
|
-
*/ const ReleaseNoteView = ({ release, assetBase, labels, markdown: Markdown = PlaybillMarkdown, locale, isUnread = false, isCurrent = false, headingLevel = 2 })=>{
|
|
12
|
+
*/ const ReleaseNoteView = ({ release, assetBase, labels, markdown: Markdown = PlaybillMarkdown, locale, isUnread = false, isCurrent = false, issueRepository, headingLevel = 2 })=>{
|
|
12
13
|
const Heading = `h${headingLevel}`;
|
|
13
14
|
const SectionHeading = `h${headingLevel + 1}`;
|
|
14
15
|
const date = formatReleaseDate(release.releasedAt, locale);
|
|
16
|
+
const prepared = (markdown)=>issueRepository ? linkIssueReferences(markdown, issueRepository) : markdown;
|
|
15
17
|
return /*#__PURE__*/ jsxs("article", {
|
|
16
18
|
className: "playbill-release",
|
|
17
19
|
"data-version": release.version,
|
|
@@ -45,7 +47,7 @@ import { sectionPresentation } from './sectionPresentation.js';
|
|
|
45
47
|
release.lead.trim() !== '' && /*#__PURE__*/ jsx("div", {
|
|
46
48
|
className: "playbill-release__lead",
|
|
47
49
|
children: /*#__PURE__*/ jsx(Markdown, {
|
|
48
|
-
source: release.lead,
|
|
50
|
+
source: prepared(release.lead),
|
|
49
51
|
assetBase: assetBase
|
|
50
52
|
})
|
|
51
53
|
}),
|
|
@@ -59,7 +61,7 @@ import { sectionPresentation } from './sectionPresentation.js';
|
|
|
59
61
|
children: presentation.title
|
|
60
62
|
}),
|
|
61
63
|
/*#__PURE__*/ jsx(Markdown, {
|
|
62
|
-
source: section.markdown,
|
|
64
|
+
source: prepared(section.markdown),
|
|
63
65
|
assetBase: assetBase
|
|
64
66
|
})
|
|
65
67
|
]
|