@cratis/showrunner.playbill.react 0.0.0-stage → 2.19.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.
Files changed (290) hide show
  1. package/Badge/PlaybillBadge.tsx +45 -0
  2. package/Badge/index.ts +4 -0
  3. package/Client/PlaybillClient.ts +78 -0
  4. package/Client/index.ts +5 -0
  5. package/Client/models.ts +64 -0
  6. package/Configuration/PlaybillProvider.tsx +38 -0
  7. package/Configuration/index.ts +4 -0
  8. package/Dialog/PlaybillDialog.tsx +83 -0
  9. package/Dialog/index.ts +4 -0
  10. package/Icons.tsx +14 -0
  11. package/Labels/PlaybillLabels.ts +46 -0
  12. package/Labels/defaultPlaybillLabels.ts +29 -0
  13. package/Labels/index.ts +6 -0
  14. package/Labels/resolveLabels.ts +20 -0
  15. package/Markdown/PlaybillLink.tsx +14 -0
  16. package/Markdown/PlaybillMarkdown.tsx +41 -0
  17. package/Markdown/assetUrl.ts +28 -0
  18. package/Markdown/index.ts +6 -0
  19. package/Markdown/safeLink.ts +25 -0
  20. package/Playbill.tsx +121 -0
  21. package/README.md +54 -2
  22. package/Release/ReleaseNoteView.tsx +79 -0
  23. package/Release/formatReleaseDate.ts +22 -0
  24. package/Release/index.ts +6 -0
  25. package/Release/sectionPresentation.ts +35 -0
  26. package/dist/cjs/Badge/PlaybillBadge.d.ts +10 -0
  27. package/dist/cjs/Badge/PlaybillBadge.d.ts.map +1 -0
  28. package/dist/cjs/Badge/PlaybillBadge.js +38 -0
  29. package/dist/cjs/Badge/PlaybillBadge.js.map +1 -0
  30. package/dist/cjs/Badge/index.d.ts +2 -0
  31. package/dist/cjs/Badge/index.d.ts.map +1 -0
  32. package/dist/cjs/Client/PlaybillClient.d.ts +13 -0
  33. package/dist/cjs/Client/PlaybillClient.d.ts.map +1 -0
  34. package/dist/cjs/Client/PlaybillClient.js +71 -0
  35. package/dist/cjs/Client/PlaybillClient.js.map +1 -0
  36. package/dist/cjs/Client/index.d.ts +3 -0
  37. package/dist/cjs/Client/index.d.ts.map +1 -0
  38. package/dist/cjs/Client/models.d.ts +27 -0
  39. package/dist/cjs/Client/models.d.ts.map +1 -0
  40. package/dist/cjs/Configuration/PlaybillProvider.d.ts +11 -0
  41. package/dist/cjs/Configuration/PlaybillProvider.d.ts.map +1 -0
  42. package/dist/cjs/Configuration/PlaybillProvider.js +30 -0
  43. package/dist/cjs/Configuration/PlaybillProvider.js.map +1 -0
  44. package/dist/cjs/Configuration/index.d.ts +2 -0
  45. package/dist/cjs/Configuration/index.d.ts.map +1 -0
  46. package/dist/cjs/Dialog/PlaybillDialog.d.ts +13 -0
  47. package/dist/cjs/Dialog/PlaybillDialog.d.ts.map +1 -0
  48. package/dist/cjs/Dialog/PlaybillDialog.js +79 -0
  49. package/dist/cjs/Dialog/PlaybillDialog.js.map +1 -0
  50. package/dist/cjs/Dialog/index.d.ts +2 -0
  51. package/dist/cjs/Dialog/index.d.ts.map +1 -0
  52. package/dist/cjs/Examples/AppShell.d.ts +5 -0
  53. package/dist/cjs/Examples/AppShell.d.ts.map +1 -0
  54. package/dist/cjs/Examples/LocalizedPlaybill.d.ts +2 -0
  55. package/dist/cjs/Examples/LocalizedPlaybill.d.ts.map +1 -0
  56. package/dist/cjs/Examples/OwnEndpoint.d.ts +2 -0
  57. package/dist/cjs/Examples/OwnEndpoint.d.ts.map +1 -0
  58. package/dist/cjs/Examples/OwnMarkdown.d.ts +2 -0
  59. package/dist/cjs/Examples/OwnMarkdown.d.ts.map +1 -0
  60. package/dist/cjs/Examples/OwnRelease.d.ts +2 -0
  61. package/dist/cjs/Examples/OwnRelease.d.ts.map +1 -0
  62. package/dist/cjs/Examples/OwnSurface.d.ts +2 -0
  63. package/dist/cjs/Examples/OwnSurface.d.ts.map +1 -0
  64. package/dist/cjs/Examples/ReleaseNotesPage.d.ts +2 -0
  65. package/dist/cjs/Examples/ReleaseNotesPage.d.ts.map +1 -0
  66. package/dist/cjs/Icons.d.ts +2 -0
  67. package/dist/cjs/Icons.d.ts.map +1 -0
  68. package/dist/cjs/Icons.js +36 -0
  69. package/dist/cjs/Icons.js.map +1 -0
  70. package/dist/cjs/Labels/PlaybillLabels.d.ts +22 -0
  71. package/dist/cjs/Labels/PlaybillLabels.d.ts.map +1 -0
  72. package/dist/cjs/Labels/defaultPlaybillLabels.d.ts +3 -0
  73. package/dist/cjs/Labels/defaultPlaybillLabels.d.ts.map +1 -0
  74. package/dist/cjs/Labels/defaultPlaybillLabels.js +30 -0
  75. package/dist/cjs/Labels/defaultPlaybillLabels.js.map +1 -0
  76. package/dist/cjs/Labels/index.d.ts +4 -0
  77. package/dist/cjs/Labels/index.d.ts.map +1 -0
  78. package/dist/cjs/Labels/resolveLabels.d.ts +4 -0
  79. package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
  80. package/dist/cjs/Labels/resolveLabels.js +24 -0
  81. package/dist/cjs/Labels/resolveLabels.js.map +1 -0
  82. package/dist/cjs/Markdown/PlaybillLink.d.ts +5 -0
  83. package/dist/cjs/Markdown/PlaybillLink.d.ts.map +1 -0
  84. package/dist/cjs/Markdown/PlaybillLink.js +21 -0
  85. package/dist/cjs/Markdown/PlaybillLink.js.map +1 -0
  86. package/dist/cjs/Markdown/PlaybillMarkdown.d.ts +7 -0
  87. package/dist/cjs/Markdown/PlaybillMarkdown.d.ts.map +1 -0
  88. package/dist/cjs/Markdown/PlaybillMarkdown.js +34 -0
  89. package/dist/cjs/Markdown/PlaybillMarkdown.js.map +1 -0
  90. package/dist/cjs/Markdown/assetUrl.d.ts +2 -0
  91. package/dist/cjs/Markdown/assetUrl.d.ts.map +1 -0
  92. package/dist/cjs/Markdown/assetUrl.js +29 -0
  93. package/dist/cjs/Markdown/assetUrl.js.map +1 -0
  94. package/dist/cjs/Markdown/index.d.ts +4 -0
  95. package/dist/cjs/Markdown/index.d.ts.map +1 -0
  96. package/dist/cjs/Markdown/safeLink.d.ts +3 -0
  97. package/dist/cjs/Markdown/safeLink.d.ts.map +1 -0
  98. package/dist/cjs/Markdown/safeLink.js +30 -0
  99. package/dist/cjs/Markdown/safeLink.js.map +1 -0
  100. package/dist/cjs/Playbill.d.ts +15 -0
  101. package/dist/cjs/Playbill.d.ts.map +1 -0
  102. package/dist/cjs/Playbill.js +135 -0
  103. package/dist/cjs/Playbill.js.map +1 -0
  104. package/dist/cjs/Release/ReleaseNoteView.d.ts +16 -0
  105. package/dist/cjs/Release/ReleaseNoteView.d.ts.map +1 -0
  106. package/dist/cjs/Release/ReleaseNoteView.js +75 -0
  107. package/dist/cjs/Release/ReleaseNoteView.js.map +1 -0
  108. package/dist/cjs/Release/formatReleaseDate.d.ts +2 -0
  109. package/dist/cjs/Release/formatReleaseDate.d.ts.map +1 -0
  110. package/dist/cjs/Release/formatReleaseDate.js +26 -0
  111. package/dist/cjs/Release/formatReleaseDate.js.map +1 -0
  112. package/dist/cjs/Release/index.d.ts +4 -0
  113. package/dist/cjs/Release/index.d.ts.map +1 -0
  114. package/dist/cjs/Release/sectionPresentation.d.ts +7 -0
  115. package/dist/cjs/Release/sectionPresentation.d.ts.map +1 -0
  116. package/dist/cjs/Release/sectionPresentation.js +31 -0
  117. package/dist/cjs/Release/sectionPresentation.js.map +1 -0
  118. package/dist/cjs/index.d.ts +13 -0
  119. package/dist/cjs/index.d.ts.map +1 -0
  120. package/dist/cjs/index.js +46 -0
  121. package/dist/cjs/index.js.map +1 -0
  122. package/dist/cjs/package.json +3 -0
  123. package/dist/cjs/useLoaded.d.ts +7 -0
  124. package/dist/cjs/useLoaded.d.ts.map +1 -0
  125. package/dist/cjs/useLoaded.js +45 -0
  126. package/dist/cjs/useLoaded.js.map +1 -0
  127. package/dist/cjs/usePlaybill.d.ts +5 -0
  128. package/dist/cjs/usePlaybill.d.ts.map +1 -0
  129. package/dist/cjs/usePlaybill.js +18 -0
  130. package/dist/cjs/usePlaybill.js.map +1 -0
  131. package/dist/cjs/usePlaybillStatus.d.ts +8 -0
  132. package/dist/cjs/usePlaybillStatus.d.ts.map +1 -0
  133. package/dist/cjs/usePlaybillStatus.js +34 -0
  134. package/dist/cjs/usePlaybillStatus.js.map +1 -0
  135. package/dist/cjs/useReleases.d.ts +12 -0
  136. package/dist/cjs/useReleases.d.ts.map +1 -0
  137. package/dist/cjs/useReleases.js +58 -0
  138. package/dist/cjs/useReleases.js.map +1 -0
  139. package/dist/esm/Badge/PlaybillBadge.d.ts +10 -0
  140. package/dist/esm/Badge/PlaybillBadge.d.ts.map +1 -0
  141. package/dist/esm/Badge/PlaybillBadge.js +36 -0
  142. package/dist/esm/Badge/PlaybillBadge.js.map +1 -0
  143. package/dist/esm/Badge/index.d.ts +2 -0
  144. package/dist/esm/Badge/index.d.ts.map +1 -0
  145. package/dist/esm/Badge/index.js +2 -0
  146. package/dist/esm/Badge/index.js.map +1 -0
  147. package/dist/esm/Client/PlaybillClient.d.ts +13 -0
  148. package/dist/esm/Client/PlaybillClient.d.ts.map +1 -0
  149. package/dist/esm/Client/PlaybillClient.js +68 -0
  150. package/dist/esm/Client/PlaybillClient.js.map +1 -0
  151. package/dist/esm/Client/index.d.ts +3 -0
  152. package/dist/esm/Client/index.d.ts.map +1 -0
  153. package/dist/esm/Client/index.js +3 -0
  154. package/dist/esm/Client/index.js.map +1 -0
  155. package/dist/esm/Client/models.d.ts +27 -0
  156. package/dist/esm/Client/models.d.ts.map +1 -0
  157. package/dist/esm/Client/models.js +2 -0
  158. package/dist/esm/Client/models.js.map +1 -0
  159. package/dist/esm/Configuration/PlaybillProvider.d.ts +11 -0
  160. package/dist/esm/Configuration/PlaybillProvider.d.ts.map +1 -0
  161. package/dist/esm/Configuration/PlaybillProvider.js +27 -0
  162. package/dist/esm/Configuration/PlaybillProvider.js.map +1 -0
  163. package/dist/esm/Configuration/index.d.ts +2 -0
  164. package/dist/esm/Configuration/index.d.ts.map +1 -0
  165. package/dist/esm/Configuration/index.js +2 -0
  166. package/dist/esm/Configuration/index.js.map +1 -0
  167. package/dist/esm/Dialog/PlaybillDialog.d.ts +13 -0
  168. package/dist/esm/Dialog/PlaybillDialog.d.ts.map +1 -0
  169. package/dist/esm/Dialog/PlaybillDialog.js +77 -0
  170. package/dist/esm/Dialog/PlaybillDialog.js.map +1 -0
  171. package/dist/esm/Dialog/index.d.ts +2 -0
  172. package/dist/esm/Dialog/index.d.ts.map +1 -0
  173. package/dist/esm/Dialog/index.js +2 -0
  174. package/dist/esm/Dialog/index.js.map +1 -0
  175. package/dist/esm/Examples/AppShell.d.ts +5 -0
  176. package/dist/esm/Examples/AppShell.d.ts.map +1 -0
  177. package/dist/esm/Examples/AppShell.js +6 -0
  178. package/dist/esm/Examples/AppShell.js.map +1 -0
  179. package/dist/esm/Examples/LocalizedPlaybill.d.ts +2 -0
  180. package/dist/esm/Examples/LocalizedPlaybill.d.ts.map +1 -0
  181. package/dist/esm/Examples/LocalizedPlaybill.js +13 -0
  182. package/dist/esm/Examples/LocalizedPlaybill.js.map +1 -0
  183. package/dist/esm/Examples/OwnEndpoint.d.ts +2 -0
  184. package/dist/esm/Examples/OwnEndpoint.d.ts.map +1 -0
  185. package/dist/esm/Examples/OwnEndpoint.js +8 -0
  186. package/dist/esm/Examples/OwnEndpoint.js.map +1 -0
  187. package/dist/esm/Examples/OwnMarkdown.d.ts +2 -0
  188. package/dist/esm/Examples/OwnMarkdown.d.ts.map +1 -0
  189. package/dist/esm/Examples/OwnMarkdown.js +5 -0
  190. package/dist/esm/Examples/OwnMarkdown.js.map +1 -0
  191. package/dist/esm/Examples/OwnRelease.d.ts +2 -0
  192. package/dist/esm/Examples/OwnRelease.d.ts.map +1 -0
  193. package/dist/esm/Examples/OwnRelease.js +5 -0
  194. package/dist/esm/Examples/OwnRelease.js.map +1 -0
  195. package/dist/esm/Examples/OwnSurface.d.ts +2 -0
  196. package/dist/esm/Examples/OwnSurface.d.ts.map +1 -0
  197. package/dist/esm/Examples/OwnSurface.js +8 -0
  198. package/dist/esm/Examples/OwnSurface.js.map +1 -0
  199. package/dist/esm/Examples/ReleaseNotesPage.d.ts +2 -0
  200. package/dist/esm/Examples/ReleaseNotesPage.d.ts.map +1 -0
  201. package/dist/esm/Examples/ReleaseNotesPage.js +4 -0
  202. package/dist/esm/Examples/ReleaseNotesPage.js.map +1 -0
  203. package/dist/esm/Icons.d.ts +2 -0
  204. package/dist/esm/Icons.d.ts.map +1 -0
  205. package/dist/esm/Icons.js +34 -0
  206. package/dist/esm/Icons.js.map +1 -0
  207. package/dist/esm/Labels/PlaybillLabels.d.ts +22 -0
  208. package/dist/esm/Labels/PlaybillLabels.d.ts.map +1 -0
  209. package/dist/esm/Labels/PlaybillLabels.js +2 -0
  210. package/dist/esm/Labels/PlaybillLabels.js.map +1 -0
  211. package/dist/esm/Labels/defaultPlaybillLabels.d.ts +3 -0
  212. package/dist/esm/Labels/defaultPlaybillLabels.d.ts.map +1 -0
  213. package/dist/esm/Labels/defaultPlaybillLabels.js +28 -0
  214. package/dist/esm/Labels/defaultPlaybillLabels.js.map +1 -0
  215. package/dist/esm/Labels/index.d.ts +4 -0
  216. package/dist/esm/Labels/index.d.ts.map +1 -0
  217. package/dist/esm/Labels/index.js +4 -0
  218. package/dist/esm/Labels/index.js.map +1 -0
  219. package/dist/esm/Labels/resolveLabels.d.ts +4 -0
  220. package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
  221. package/dist/esm/Labels/resolveLabels.js +21 -0
  222. package/dist/esm/Labels/resolveLabels.js.map +1 -0
  223. package/dist/esm/Markdown/PlaybillLink.d.ts +5 -0
  224. package/dist/esm/Markdown/PlaybillLink.d.ts.map +1 -0
  225. package/dist/esm/Markdown/PlaybillLink.js +19 -0
  226. package/dist/esm/Markdown/PlaybillLink.js.map +1 -0
  227. package/dist/esm/Markdown/PlaybillMarkdown.d.ts +7 -0
  228. package/dist/esm/Markdown/PlaybillMarkdown.d.ts.map +1 -0
  229. package/dist/esm/Markdown/PlaybillMarkdown.js +32 -0
  230. package/dist/esm/Markdown/PlaybillMarkdown.js.map +1 -0
  231. package/dist/esm/Markdown/assetUrl.d.ts +2 -0
  232. package/dist/esm/Markdown/assetUrl.d.ts.map +1 -0
  233. package/dist/esm/Markdown/assetUrl.js +27 -0
  234. package/dist/esm/Markdown/assetUrl.js.map +1 -0
  235. package/dist/esm/Markdown/index.d.ts +4 -0
  236. package/dist/esm/Markdown/index.d.ts.map +1 -0
  237. package/dist/esm/Markdown/index.js +4 -0
  238. package/dist/esm/Markdown/index.js.map +1 -0
  239. package/dist/esm/Markdown/safeLink.d.ts +3 -0
  240. package/dist/esm/Markdown/safeLink.d.ts.map +1 -0
  241. package/dist/esm/Markdown/safeLink.js +27 -0
  242. package/dist/esm/Markdown/safeLink.js.map +1 -0
  243. package/dist/esm/Playbill.d.ts +15 -0
  244. package/dist/esm/Playbill.d.ts.map +1 -0
  245. package/dist/esm/Playbill.js +133 -0
  246. package/dist/esm/Playbill.js.map +1 -0
  247. package/dist/esm/Release/ReleaseNoteView.d.ts +16 -0
  248. package/dist/esm/Release/ReleaseNoteView.d.ts.map +1 -0
  249. package/dist/esm/Release/ReleaseNoteView.js +73 -0
  250. package/dist/esm/Release/ReleaseNoteView.js.map +1 -0
  251. package/dist/esm/Release/formatReleaseDate.d.ts +2 -0
  252. package/dist/esm/Release/formatReleaseDate.d.ts.map +1 -0
  253. package/dist/esm/Release/formatReleaseDate.js +24 -0
  254. package/dist/esm/Release/formatReleaseDate.js.map +1 -0
  255. package/dist/esm/Release/index.d.ts +4 -0
  256. package/dist/esm/Release/index.d.ts.map +1 -0
  257. package/dist/esm/Release/index.js +4 -0
  258. package/dist/esm/Release/index.js.map +1 -0
  259. package/dist/esm/Release/sectionPresentation.d.ts +7 -0
  260. package/dist/esm/Release/sectionPresentation.d.ts.map +1 -0
  261. package/dist/esm/Release/sectionPresentation.js +29 -0
  262. package/dist/esm/Release/sectionPresentation.js.map +1 -0
  263. package/dist/esm/index.d.ts +13 -0
  264. package/dist/esm/index.d.ts.map +1 -0
  265. package/dist/esm/index.js +18 -0
  266. package/dist/esm/index.js.map +1 -0
  267. package/dist/esm/package.json +3 -0
  268. package/dist/esm/useLoaded.d.ts +7 -0
  269. package/dist/esm/useLoaded.d.ts.map +1 -0
  270. package/dist/esm/useLoaded.js +43 -0
  271. package/dist/esm/useLoaded.js.map +1 -0
  272. package/dist/esm/usePlaybill.d.ts +5 -0
  273. package/dist/esm/usePlaybill.d.ts.map +1 -0
  274. package/dist/esm/usePlaybill.js +16 -0
  275. package/dist/esm/usePlaybill.js.map +1 -0
  276. package/dist/esm/usePlaybillStatus.d.ts +8 -0
  277. package/dist/esm/usePlaybillStatus.d.ts.map +1 -0
  278. package/dist/esm/usePlaybillStatus.js +32 -0
  279. package/dist/esm/usePlaybillStatus.js.map +1 -0
  280. package/dist/esm/useReleases.d.ts +12 -0
  281. package/dist/esm/useReleases.d.ts.map +1 -0
  282. package/dist/esm/useReleases.js +54 -0
  283. package/dist/esm/useReleases.js.map +1 -0
  284. package/index.ts +15 -0
  285. package/package.json +87 -4
  286. package/styles.css +298 -0
  287. package/useLoaded.ts +45 -0
  288. package/usePlaybill.ts +17 -0
  289. package/usePlaybillStatus.ts +48 -0
  290. package/useReleases.ts +59 -0
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Playbill } from '@cratis/showrunner.playbill.react';
3
+ const PlainText = ({ source }) => (_jsx("pre", { children: source }));
4
+ export const PlainTextNotes = () => (_jsx(Playbill, { markdown: PlainText }));
5
+ //# sourceMappingURL=OwnMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnMarkdown.js","sourceRoot":"","sources":["../../../Examples/OwnMarkdown.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAyB,MAAM,mCAAmC,CAAC;AAEpF,MAAM,SAAS,GAAG,CAAC,EAAE,MAAM,EAAyB,EAAE,EAAE,CAAC,CACrD,wBAAM,MAAM,GAAO,CACtB,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAChC,KAAC,QAAQ,IAAC,QAAQ,EAAE,SAAS,GAAI,CACpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const OwnReleasePage: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=OwnRelease.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnRelease.d.ts","sourceRoot":"","sources":["../../../Examples/OwnRelease.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,cAAc,mCAE1B,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { Playbill } from '@cratis/showrunner.playbill.react';
3
+ const OwnRelease = ({ release }) => (_jsxs("article", { children: [_jsxs("h2", { children: ["Version ", release.version] }), release.sections.map(section => (_jsxs("details", { open: section.name === 'Added', children: [_jsx("summary", { children: section.name }), _jsx("pre", { children: section.markdown })] }, section.name)))] }));
4
+ export const OwnReleasePage = () => (_jsx(Playbill, { release: OwnRelease }));
5
+ //# sourceMappingURL=OwnRelease.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnRelease.js","sourceRoot":"","sources":["../../../Examples/OwnRelease.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAwB,MAAM,mCAAmC,CAAC;AAEnF,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE,CAAC,CACtD,8BACI,qCAAa,OAAO,CAAC,OAAO,IAAM,EACjC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAC7B,mBAA4B,IAAI,EAAE,OAAO,CAAC,IAAI,KAAK,OAAO,aACtD,4BAAU,OAAO,CAAC,IAAI,GAAW,EACjC,wBAAM,OAAO,CAAC,QAAQ,GAAO,KAFnB,OAAO,CAAC,IAAI,CAGhB,CACb,CAAC,IACI,CACb,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,EAAE,CAAC,CAChC,KAAC,QAAQ,IAAC,OAAO,EAAE,UAAU,GAAI,CACpC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const OwnSurface: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=OwnSurface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnSurface.d.ts","sourceRoot":"","sources":["../../../Examples/OwnSurface.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU,mCAatB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
+ import { usePlaybill } from '@cratis/showrunner.playbill.react';
3
+ export const OwnSurface = () => {
4
+ const { releases, unread, unreadVersions, markSeen } = usePlaybill();
5
+ const newest = releases[0];
6
+ return (_jsxs("aside", { children: [_jsxs("strong", { children: [unread, " new"] }), newest && _jsxs("p", { children: [newest.version, ": ", newest.summary] }), _jsx("button", { type: 'button', onClick: () => void markSeen(unreadVersions[0]), disabled: unread === 0, children: "Mark as read" })] }));
7
+ };
8
+ //# sourceMappingURL=OwnSurface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnSurface.js","sourceRoot":"","sources":["../../../Examples/OwnSurface.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE;IAC3B,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,WAAW,EAAE,CAAC;IACrE,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE3B,OAAO,CACH,4BACI,6BAAS,MAAM,YAAc,EAC5B,MAAM,IAAI,wBAAI,MAAM,CAAC,OAAO,QAAI,MAAM,CAAC,OAAO,IAAK,EACpD,iBAAQ,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC,6BAEpF,IACL,CACX,CAAC;AACN,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const ReleaseNotesPage: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=ReleaseNotesPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReleaseNotesPage.d.ts","sourceRoot":"","sources":["../../../Examples/ReleaseNotesPage.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,mCAE5B,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Playbill } from '@cratis/showrunner.playbill.react';
3
+ export const ReleaseNotesPage = () => (_jsx(Playbill, {}));
4
+ //# sourceMappingURL=ReleaseNotesPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReleaseNotesPage.js","sourceRoot":"","sources":["../../../Examples/ReleaseNotesPage.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAClC,KAAC,QAAQ,KAAG,CACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const PlaybillIcon: () => import("react").JSX.Element;
2
+ //# sourceMappingURL=Icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icons.d.ts","sourceRoot":"","sources":["../../Icons.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,YAAY,mCAMxB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
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
+ * The icon of the release notes: a page with a ribbon. It is decorative, so it is hidden from assistive technology; the
7
+ * control that holds it carries the accessible name.
8
+ */ const PlaybillIcon = ()=>/*#__PURE__*/ jsxs("svg", {
9
+ className: "playbill-icon",
10
+ viewBox: "0 0 24 24",
11
+ width: "1em",
12
+ height: "1em",
13
+ fill: "none",
14
+ stroke: "currentColor",
15
+ strokeWidth: "2",
16
+ strokeLinecap: "round",
17
+ strokeLinejoin: "round",
18
+ "aria-hidden": "true",
19
+ focusable: "false",
20
+ children: [
21
+ /*#__PURE__*/ jsx("path", {
22
+ d: "M6 3h9l4 4v14H6z"
23
+ }),
24
+ /*#__PURE__*/ jsx("path", {
25
+ d: "M14 3v5h5"
26
+ }),
27
+ /*#__PURE__*/ jsx("path", {
28
+ d: "M9 13h7M9 17h7"
29
+ })
30
+ ]
31
+ });
32
+
33
+ export { PlaybillIcon };
34
+ //# sourceMappingURL=Icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Icons.js","sources":["../../Icons.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\n/**\n * The icon of the release notes: a page with a ribbon. It is decorative, so it is hidden from assistive technology; the\n * control that holds it carries the accessible name.\n */\nexport const PlaybillIcon = () => (\n <svg className='playbill-icon' viewBox='0 0 24 24' width='1em' height='1em' fill='none' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' aria-hidden='true' focusable='false'>\n <path d='M6 3h9l4 4v14H6z' />\n <path d='M14 3v5h5' />\n <path d='M9 13h7M9 17h7' />\n </svg>\n);\n"],"names":["PlaybillIcon","_jsxs","svg","className","viewBox","width","height","fill","stroke","strokeWidth","strokeLinecap","strokeLinejoin","aria-hidden","focusable","_jsx","path","d"],"mappings":";;AAAA;AACA;AAEA;;;AAGC,IACM,MAAMA,YAAAA,GAAe,kBACxBC,IAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,eAAA;QAAgBC,OAAAA,EAAQ,WAAA;QAAYC,KAAAA,EAAM,KAAA;QAAMC,MAAAA,EAAO,KAAA;QAAMC,IAAAA,EAAK,MAAA;QAAOC,MAAAA,EAAO,cAAA;QAAeC,WAAAA,EAAY,GAAA;QAAIC,aAAAA,EAAc,OAAA;QAAQC,cAAAA,EAAe,OAAA;QAAQC,aAAAA,EAAY,MAAA;QAAOC,SAAAA,EAAU,OAAA;;0BACpMC,GAAA,CAACC,MAAAA,EAAAA;gBAAKC,CAAAA,EAAE;;0BACRF,GAAA,CAACC,MAAAA,EAAAA;gBAAKC,CAAAA,EAAE;;0BACRF,GAAA,CAACC,MAAAA,EAAAA;gBAAKC,CAAAA,EAAE;;;AAEd,KAAA;;"}
@@ -0,0 +1,22 @@
1
+ export interface PlaybillLabels {
2
+ title: string;
3
+ acknowledge: string;
4
+ close: string;
5
+ releases: string;
6
+ unread: string;
7
+ current: string;
8
+ released: string;
9
+ loading: string;
10
+ failed: string;
11
+ empty: string;
12
+ badge: string;
13
+ badgeUnread: string;
14
+ earlier: string;
15
+ added: string;
16
+ changed: string;
17
+ fixed: string;
18
+ removed: string;
19
+ security: string;
20
+ deprecated: string;
21
+ }
22
+ //# sourceMappingURL=PlaybillLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillLabels.d.ts","sourceRoot":"","sources":["../../../Labels/PlaybillLabels.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAE3B,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,KAAK,EAAE,MAAM,CAAC;IAEd,QAAQ,EAAE,MAAM,CAAC;IAEjB,MAAM,EAAE,MAAM,CAAC;IAEf,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,EAAE,MAAM,CAAC;IAEf,KAAK,EAAE,MAAM,CAAC;IAEd,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,CAAC;IAEhB,QAAQ,EAAE,MAAM,CAAC;IAEjB,UAAU,EAAE,MAAM,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=PlaybillLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillLabels.js","sourceRoot":"","sources":["../../../Labels/PlaybillLabels.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { PlaybillLabels } from './PlaybillLabels.js';
2
+ export declare const defaultPlaybillLabels: PlaybillLabels;
3
+ //# sourceMappingURL=defaultPlaybillLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultPlaybillLabels.d.ts","sourceRoot":"","sources":["../../../Labels/defaultPlaybillLabels.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAKrD,eAAO,MAAM,qBAAqB,EAAE,cAoBnC,CAAC"}
@@ -0,0 +1,28 @@
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
+ /**
4
+ * The English texts Playbill shows unless a product replaces them.
5
+ */ const defaultPlaybillLabels = {
6
+ title: 'What\'s new',
7
+ acknowledge: 'Got it',
8
+ close: 'Close',
9
+ releases: 'Releases',
10
+ unread: 'New',
11
+ current: 'Current',
12
+ released: 'Released',
13
+ loading: 'Loading release notes…',
14
+ failed: 'The release notes could not be loaded.',
15
+ empty: 'There are no release notes yet.',
16
+ badge: 'Release notes',
17
+ badgeUnread: 'Release notes, {count} new',
18
+ earlier: '{count} earlier releases are on the release notes page.',
19
+ added: 'Added',
20
+ changed: 'Changed',
21
+ fixed: 'Fixed',
22
+ removed: 'Removed',
23
+ security: 'Security',
24
+ deprecated: 'Deprecated'
25
+ };
26
+
27
+ export { defaultPlaybillLabels };
28
+ //# sourceMappingURL=defaultPlaybillLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultPlaybillLabels.js","sources":["../../../Labels/defaultPlaybillLabels.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\nimport { PlaybillLabels } from './PlaybillLabels.js';\n\n/**\n * The English texts Playbill shows unless a product replaces them.\n */\nexport const defaultPlaybillLabels: PlaybillLabels = {\n title: 'What\\'s new',\n acknowledge: 'Got it',\n close: 'Close',\n releases: 'Releases',\n unread: 'New',\n current: 'Current',\n released: 'Released',\n loading: 'Loading release notes…',\n failed: 'The release notes could not be loaded.',\n empty: 'There are no release notes yet.',\n badge: 'Release notes',\n badgeUnread: 'Release notes, {count} new',\n earlier: '{count} earlier releases are on the release notes page.',\n added: 'Added',\n changed: 'Changed',\n fixed: 'Fixed',\n removed: 'Removed',\n security: 'Security',\n deprecated: 'Deprecated'\n};\n"],"names":["defaultPlaybillLabels","title","acknowledge","close","releases","unread","current","released","loading","failed","empty","badge","badgeUnread","earlier","added","changed","fixed","removed","security","deprecated"],"mappings":"AAAA;AACA;AAIA;;UAGaA,qBAAAA,GAAwC;IACjDC,KAAAA,EAAO,aAAA;IACPC,WAAAA,EAAa,QAAA;IACbC,KAAAA,EAAO,OAAA;IACPC,QAAAA,EAAU,UAAA;IACVC,MAAAA,EAAQ,KAAA;IACRC,OAAAA,EAAS,SAAA;IACTC,QAAAA,EAAU,UAAA;IACVC,OAAAA,EAAS,wBAAA;IACTC,MAAAA,EAAQ,wCAAA;IACRC,KAAAA,EAAO,iCAAA;IACPC,KAAAA,EAAO,eAAA;IACPC,WAAAA,EAAa,4BAAA;IACbC,OAAAA,EAAS,yDAAA;IACTC,KAAAA,EAAO,OAAA;IACPC,OAAAA,EAAS,SAAA;IACTC,KAAAA,EAAO,OAAA;IACPC,OAAAA,EAAS,SAAA;IACTC,QAAAA,EAAU,UAAA;IACVC,UAAAA,EAAY;AAChB;;"}
@@ -0,0 +1,4 @@
1
+ export * from './defaultPlaybillLabels.js';
2
+ export * from './PlaybillLabels.js';
3
+ export * from './resolveLabels.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Labels/index.ts"],"names":[],"mappings":"AAGA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './defaultPlaybillLabels.js';
2
+ export * from './PlaybillLabels.js';
3
+ export * from './resolveLabels.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Labels/index.ts"],"names":[],"mappings":"AAGA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PlaybillLabels } from './PlaybillLabels.js';
2
+ export declare const resolveLabels: (overrides?: Partial<PlaybillLabels>) => PlaybillLabels;
3
+ export declare const withCount: (text: string, count: number) => string;
4
+ //# sourceMappingURL=resolveLabels.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveLabels.d.ts","sourceRoot":"","sources":["../../../Labels/resolveLabels.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOrD,eAAO,MAAM,aAAa,GAAI,YAAY,OAAO,CAAC,cAAc,CAAC,KAAG,cAA8D,CAAC;AAQnI,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAAsD,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { defaultPlaybillLabels } from './defaultPlaybillLabels.js';
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
+ * Overlays the texts a product gives on the English defaults.
7
+ * @param overrides The texts to replace; the rest stay English.
8
+ * @returns The texts to show.
9
+ */ const resolveLabels = (overrides)=>({
10
+ ...defaultPlaybillLabels,
11
+ ...overrides
12
+ });
13
+ /**
14
+ * Puts a number into a text that has `{count}`.
15
+ * @param text The text.
16
+ * @param count The number.
17
+ * @returns The text with the number in it.
18
+ */ const withCount = (text, count)=>text.split('{count}').join(count.toString());
19
+
20
+ export { resolveLabels, withCount };
21
+ //# sourceMappingURL=resolveLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveLabels.js","sources":["../../../Labels/resolveLabels.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\nimport { defaultPlaybillLabels } from './defaultPlaybillLabels.js';\nimport { PlaybillLabels } from './PlaybillLabels.js';\n\n/**\n * Overlays the texts a product gives on the English defaults.\n * @param overrides The texts to replace; the rest stay English.\n * @returns The texts to show.\n */\nexport const resolveLabels = (overrides?: Partial<PlaybillLabels>): PlaybillLabels => ({ ...defaultPlaybillLabels, ...overrides });\n\n/**\n * Puts a number into a text that has `{count}`.\n * @param text The text.\n * @param count The number.\n * @returns The text with the number in it.\n */\nexport const withCount = (text: string, count: number): string => text.split('{count}').join(count.toString());\n"],"names":["resolveLabels","overrides","defaultPlaybillLabels","withCount","text","count","split","join","toString"],"mappings":";;AAAA;AACA;AAKA;;;;AAIC,IACM,MAAMA,aAAAA,GAAgB,CAACC,aAAyD;AAAE,QAAA,GAAGC,qBAAqB;AAAE,QAAA,GAAGD;AAAU,KAAA;AAEhI;;;;;AAKC,IACM,MAAME,SAAAA,GAAY,CAACC,MAAcC,KAAAA,GAA0BD,IAAAA,CAAKE,KAAK,CAAC,SAAA,CAAA,CAAWC,IAAI,CAACF,KAAAA,CAAMG,QAAQ,EAAA;;"}
@@ -0,0 +1,5 @@
1
+ import { ComponentProps } from 'react';
2
+ type LinkProps = ComponentProps<'a'>;
3
+ export declare const PlaybillLink: ({ href, title, children }: LinkProps) => import("react").JSX.Element;
4
+ export {};
5
+ //# sourceMappingURL=PlaybillLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillLink.d.ts","sourceRoot":"","sources":["../../../Markdown/PlaybillLink.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,KAAK,SAAS,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;AAMrC,eAAO,MAAM,YAAY,GAAI,2BAA2B,SAAS,gCAEpC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx } from 'react/jsx-runtime';
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
+ * A link in a release note: it opens in a new tab with `noopener noreferrer`. A link that is not safe has no `href`
7
+ * left, because the URL transform emptied it, and is only its text.
8
+ */ const PlaybillLink = ({ href, title, children })=>href ? /*#__PURE__*/ jsx("a", {
9
+ href: href,
10
+ title: title,
11
+ target: "_blank",
12
+ rel: "noopener noreferrer",
13
+ children: children
14
+ }) : /*#__PURE__*/ jsx("span", {
15
+ children: children
16
+ });
17
+
18
+ export { PlaybillLink };
19
+ //# sourceMappingURL=PlaybillLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillLink.js","sources":["../../../Markdown/PlaybillLink.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 { ComponentProps } from 'react';\n\ntype LinkProps = ComponentProps<'a'>;\n\n/**\n * A link in a release note: it opens in a new tab with `noopener noreferrer`. A link that is not safe has no `href`\n * left, because the URL transform emptied it, and is only its text.\n */\nexport const PlaybillLink = ({ href, title, children }: LinkProps) => href\n ? <a href={href} title={title} target='_blank' rel='noopener noreferrer'>{children}</a>\n : <span>{children}</span>;\n"],"names":["PlaybillLink","href","title","children","_jsx","a","target","rel","span"],"mappings":";;AAAA;AACA;AAMA;;;AAGC,IACM,MAAMA,YAAAA,GAAe,CAAC,EAAEC,IAAI,EAAEC,KAAK,EAAEC,QAAQ,EAAa,GAAKF,qBAChEG,GAAA,CAACC,GAAAA,EAAAA;QAAEJ,IAAAA,EAAMA,IAAAA;QAAMC,KAAAA,EAAOA,KAAAA;QAAOI,MAAAA,EAAO,QAAA;QAASC,GAAAA,EAAI,qBAAA;AAAuBJ,QAAAA,QAAAA,EAAAA;uBACxEC,GAAA,CAACI,MAAAA,EAAAA;AAAML,QAAAA,QAAAA,EAAAA;AAAiB,KAAA;;"}
@@ -0,0 +1,7 @@
1
+ import { ComponentType } from 'react';
2
+ export interface PlaybillMarkdownProps {
3
+ source: string;
4
+ assetBase?: string;
5
+ }
6
+ export declare const PlaybillMarkdown: ComponentType<PlaybillMarkdownProps>;
7
+ //# sourceMappingURL=PlaybillMarkdown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillMarkdown.d.ts","sourceRoot":"","sources":["../../../Markdown/PlaybillMarkdown.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,aAAa,EAAE,MAAM,OAAO,CAAC;AAUtD,MAAM,WAAW,qBAAqB;IAElC,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAUD,eAAO,MAAM,gBAAgB,EAAE,aAAa,CAAC,qBAAqB,CAYjE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx, Fragment } from 'react/jsx-runtime';
2
+ import ReactMarkdown from 'react-markdown';
3
+ import { resolveAssetUrl } from './assetUrl.js';
4
+ import { PlaybillLink } from './PlaybillLink.js';
5
+ import { safeLinkOrEmpty } from './safeLink.js';
6
+
7
+ // Copyright (c) Cratis. All rights reserved.
8
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
9
+ /**
10
+ * Renders the Markdown of a release note as React elements, never as injected HTML: raw HTML in the source is dropped,
11
+ * a link opens in a new tab with `noopener noreferrer`, and only `https`, `mailto` and `tel` links are links at all.
12
+ * Images are the ones captured with the release, loaded from its own folder, and `https` images the capture could not
13
+ * download; every other image is left out.
14
+ */ const PlaybillMarkdown = ({ source, assetBase })=>/*#__PURE__*/ jsx("div", {
15
+ className: "playbill-markdown",
16
+ children: /*#__PURE__*/ jsx(ReactMarkdown, {
17
+ skipHtml: true,
18
+ urlTransform: (url, key)=>key === 'src' ? resolveAssetUrl(url, assetBase) : safeLinkOrEmpty(url),
19
+ components: {
20
+ a: PlaybillLink,
21
+ img: ({ src, alt })=>src ? /*#__PURE__*/ jsx("img", {
22
+ src: src,
23
+ alt: alt ?? '',
24
+ loading: "lazy"
25
+ }) : /*#__PURE__*/ jsx(Fragment, {})
26
+ },
27
+ children: source
28
+ })
29
+ });
30
+
31
+ export { PlaybillMarkdown };
32
+ //# sourceMappingURL=PlaybillMarkdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlaybillMarkdown.js","sources":["../../../Markdown/PlaybillMarkdown.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 { ComponentProps, ComponentType } from 'react';\nimport ReactMarkdown from 'react-markdown';\nimport { resolveAssetUrl } from './assetUrl.js';\nimport { PlaybillLink } from './PlaybillLink.js';\nimport { safeLinkOrEmpty } from './safeLink.js';\n\n/**\n * Props for the component that renders the Markdown of a release note. Give your own to the `markdown` slot of\n * {@link Playbill}, {@link PlaybillDialog} or {@link ReleaseNoteView}.\n */\nexport interface PlaybillMarkdownProps {\n /** The Markdown source. */\n source: string;\n /** Where the files of the release are served from, so an image written as `hero.png` can be loaded. */\n assetBase?: string;\n}\n\ntype ImageProps = ComponentProps<'img'>;\n\n/**\n * Renders the Markdown of a release note as React elements, never as injected HTML: raw HTML in the source is dropped,\n * a link opens in a new tab with `noopener noreferrer`, and only `https`, `mailto` and `tel` links are links at all.\n * Images are the ones captured with the release, loaded from its own folder, and `https` images the capture could not\n * download; every other image is left out.\n */\nexport const PlaybillMarkdown: ComponentType<PlaybillMarkdownProps> = ({ source, assetBase }: PlaybillMarkdownProps) => (\n <div className='playbill-markdown'>\n <ReactMarkdown\n skipHtml\n urlTransform={(url, key) => key === 'src' ? resolveAssetUrl(url, assetBase) : safeLinkOrEmpty(url)}\n components={{\n a: PlaybillLink,\n img: ({ src, alt }: ImageProps) => src ? <img src={src} alt={alt ?? ''} loading='lazy' /> : <></>\n }}>\n {source}\n </ReactMarkdown>\n </div>\n);\n"],"names":["PlaybillMarkdown","source","assetBase","_jsx","div","className","ReactMarkdown","skipHtml","urlTransform","url","key","resolveAssetUrl","safeLinkOrEmpty","components","a","PlaybillLink","img","src","alt","loading","_Fragment"],"mappings":";;;;;;AAAA;AACA;AAqBA;;;;;IAMO,MAAMA,gBAAAA,GAAyD,CAAC,EAAEC,MAAM,EAAEC,SAAS,EAAyB,iBAC/GC,GAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,mBAAA;AACX,QAAA,QAAA,gBAAAF,GAAA,CAACG,aAAAA,EAAAA;YACGC,QAAQ,EAAA,IAAA;YACRC,YAAAA,EAAc,CAACC,KAAKC,GAAAA,GAAQA,GAAAA,KAAQ,QAAQC,eAAAA,CAAgBF,GAAAA,EAAKP,aAAaU,eAAAA,CAAgBH,GAAAA,CAAAA;YAC9FI,UAAAA,EAAY;gBACRC,CAAAA,EAAGC,YAAAA;gBACHC,GAAAA,EAAK,CAAC,EAAEC,GAAG,EAAEC,GAAG,EAAc,GAAKD,oBAAMd,GAAA,CAACa,KAAAA,EAAAA;wBAAIC,GAAAA,EAAKA,GAAAA;AAAKC,wBAAAA,GAAAA,EAAKA,GAAAA,IAAO,EAAA;wBAAIC,OAAAA,EAAQ;AAAY,qBAAA,CAAA,iBAAAhB,GAAA,CAAAiB,QAAA,EAAA,EAAA;AAChG,aAAA;AACCnB,YAAAA,QAAAA,EAAAA;;AAGX,KAAA;;"}
@@ -0,0 +1,2 @@
1
+ export declare const resolveAssetUrl: (source: string, assetBase?: string) => string;
2
+ //# sourceMappingURL=assetUrl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetUrl.d.ts","sourceRoot":"","sources":["../../../Markdown/assetUrl.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,EAAE,YAAY,MAAM,KAAG,MAapE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { isSafeLink } from './safeLink.js';
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
+ * Works out where an image of a release note is loaded from. A note refers to the files captured with it by their
7
+ * name, such as `hero.png`; those are served from the release's own folder. An `https` image the capture could not
8
+ * download is left as it was written. Anything else, such as `javascript:`, `data:` or a path that climbs out of the
9
+ * folder, is not an image.
10
+ * @param source The image as written in the note.
11
+ * @param assetBase Where the files of the release are served from, without a trailing slash; absent when it is not known.
12
+ * @returns The address to load the image from, or an empty string when it is not safe to load.
13
+ */ const resolveAssetUrl = (source, assetBase)=>{
14
+ if (/^https:\/\//i.test(source)) {
15
+ return isSafeLink(source) ? source : '';
16
+ }
17
+ const relative = source.replace(/^\.\//, '');
18
+ const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(relative) || relative.startsWith('//') || relative.startsWith('/');
19
+ const climbs = relative.split('/').includes('..');
20
+ if (!assetBase || !relative || hasScheme || climbs) {
21
+ return '';
22
+ }
23
+ return `${assetBase}/${relative.split('/').map(encodeURIComponent).join('/')}`;
24
+ };
25
+
26
+ export { resolveAssetUrl };
27
+ //# sourceMappingURL=assetUrl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assetUrl.js","sources":["../../../Markdown/assetUrl.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\nimport { isSafeLink } from './safeLink.js';\n\n/**\n * Works out where an image of a release note is loaded from. A note refers to the files captured with it by their\n * name, such as `hero.png`; those are served from the release's own folder. An `https` image the capture could not\n * download is left as it was written. Anything else, such as `javascript:`, `data:` or a path that climbs out of the\n * folder, is not an image.\n * @param source The image as written in the note.\n * @param assetBase Where the files of the release are served from, without a trailing slash; absent when it is not known.\n * @returns The address to load the image from, or an empty string when it is not safe to load.\n */\nexport const resolveAssetUrl = (source: string, assetBase?: string): string => {\n if (/^https:\\/\\//i.test(source)) {\n return isSafeLink(source) ? source : '';\n }\n\n const relative = source.replace(/^\\.\\//, '');\n const hasScheme = /^[a-z][a-z0-9+.-]*:/i.test(relative) || relative.startsWith('//') || relative.startsWith('/');\n const climbs = relative.split('/').includes('..');\n if (!assetBase || !relative || hasScheme || climbs) {\n return '';\n }\n\n return `${assetBase}/${relative.split('/').map(encodeURIComponent).join('/')}`;\n};\n"],"names":["resolveAssetUrl","source","assetBase","test","isSafeLink","relative","replace","hasScheme","startsWith","climbs","split","includes","map","encodeURIComponent","join"],"mappings":";;AAAA;AACA;AAIA;;;;;;;;AAQC,IACM,MAAMA,eAAAA,GAAkB,CAACC,MAAAA,EAAgBC,SAAAA,GAAAA;IAC5C,IAAI,cAAA,CAAeC,IAAI,CAACF,MAAAA,CAAAA,EAAS;QAC7B,OAAOG,UAAAA,CAAWH,UAAUA,MAAAA,GAAS,EAAA;AACzC,IAAA;AAEA,IAAA,MAAMI,QAAAA,GAAWJ,MAAAA,CAAOK,OAAO,CAAC,OAAA,EAAS,EAAA,CAAA;IACzC,MAAMC,SAAAA,GAAY,sBAAA,CAAuBJ,IAAI,CAACE,QAAAA,CAAAA,IAAaA,QAAAA,CAASG,UAAU,CAAC,IAAA,CAAA,IAASH,QAAAA,CAASG,UAAU,CAAC,GAAA,CAAA;AAC5G,IAAA,MAAMC,SAASJ,QAAAA,CAASK,KAAK,CAAC,GAAA,CAAA,CAAKC,QAAQ,CAAC,IAAA,CAAA;AAC5C,IAAA,IAAI,CAACT,SAAAA,IAAa,CAACG,QAAAA,IAAYE,aAAaE,MAAAA,EAAQ;QAChD,OAAO,EAAA;AACX,IAAA;AAEA,IAAA,OAAO,CAAA,EAAGP,SAAAA,CAAU,CAAC,EAAEG,QAAAA,CAASK,KAAK,CAAC,GAAA,CAAA,CAAKE,GAAG,CAACC,kBAAAA,CAAAA,CAAoBC,IAAI,CAAC,GAAA,CAAA,CAAA,CAAM;AAClF;;"}
@@ -0,0 +1,4 @@
1
+ export * from './assetUrl.js';
2
+ export * from './PlaybillMarkdown.js';
3
+ export * from './safeLink.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,4 @@
1
+ export * from './assetUrl.js';
2
+ export * from './PlaybillMarkdown.js';
3
+ export * from './safeLink.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export declare const isSafeLink: (url: string) => boolean;
2
+ export declare const safeLinkOrEmpty: (url: string) => string;
3
+ //# sourceMappingURL=safeLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeLink.d.ts","sourceRoot":"","sources":["../../../Markdown/safeLink.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,KAAG,OAMxC,CAAC;AAOF,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAAoC,CAAC"}
@@ -0,0 +1,27 @@
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
+ const allowedProtocols = new Set([
4
+ 'https:',
5
+ 'mailto:',
6
+ 'tel:'
7
+ ]);
8
+ /**
9
+ * Whether a link may be followed from a release note: only `https`, `mailto` and `tel`. A relative link, a scheme that
10
+ * runs code such as `javascript:` and a scheme that carries content such as `data:` are not.
11
+ * @param url The link as written in the note.
12
+ * @returns True when it is safe to link to.
13
+ */ const isSafeLink = (url)=>{
14
+ try {
15
+ return allowedProtocols.has(new URL(url).protocol);
16
+ } catch {
17
+ return false;
18
+ }
19
+ };
20
+ /**
21
+ * Empties a link that is not safe, so it never reaches an `href`.
22
+ * @param url The link as written in the note.
23
+ * @returns The link, or an empty string.
24
+ */ const safeLinkOrEmpty = (url)=>isSafeLink(url) ? url : '';
25
+
26
+ export { isSafeLink, safeLinkOrEmpty };
27
+ //# sourceMappingURL=safeLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safeLink.js","sources":["../../../Markdown/safeLink.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\nconst allowedProtocols = new Set(['https:', 'mailto:', 'tel:']);\n\n/**\n * Whether a link may be followed from a release note: only `https`, `mailto` and `tel`. A relative link, a scheme that\n * runs code such as `javascript:` and a scheme that carries content such as `data:` are not.\n * @param url The link as written in the note.\n * @returns True when it is safe to link to.\n */\nexport const isSafeLink = (url: string): boolean => {\n try {\n return allowedProtocols.has(new URL(url).protocol);\n } catch {\n return false;\n }\n};\n\n/**\n * Empties a link that is not safe, so it never reaches an `href`.\n * @param url The link as written in the note.\n * @returns The link, or an empty string.\n */\nexport const safeLinkOrEmpty = (url: string): string => isSafeLink(url) ? url : '';\n"],"names":["allowedProtocols","Set","isSafeLink","url","has","URL","protocol","safeLinkOrEmpty"],"mappings":"AAAA;AACA;AAEA,MAAMA,gBAAAA,GAAmB,IAAIC,GAAAA,CAAI;AAAC,IAAA,QAAA;AAAU,IAAA,SAAA;AAAW,IAAA;AAAO,CAAA,CAAA;AAE9D;;;;;IAMO,MAAMC,UAAAA,GAAa,CAACC,GAAAA,GAAAA;IACvB,IAAI;AACA,QAAA,OAAOH,iBAAiBI,GAAG,CAAC,IAAIC,GAAAA,CAAIF,KAAKG,QAAQ,CAAA;AACrD,IAAA,CAAA,CAAE,OAAM;QACJ,OAAO,KAAA;AACX,IAAA;AACJ;AAEA;;;;UAKaC,eAAAA,GAAkB,CAACJ,MAAwBD,UAAAA,CAAWC,GAAAA,CAAAA,GAAOA,MAAM;;"}
@@ -0,0 +1,15 @@
1
+ import { ComponentType } from 'react';
2
+ import { PlaybillLabels } from './Labels/index.js';
3
+ import { PlaybillMarkdownProps } from './Markdown/index.js';
4
+ import { ReleaseNoteViewProps } from './Release/index.js';
5
+ export interface PlaybillProps {
6
+ release?: ComponentType<ReleaseNoteViewProps>;
7
+ markdown?: ComponentType<PlaybillMarkdownProps>;
8
+ labels?: Partial<PlaybillLabels>;
9
+ locale?: string | string[];
10
+ selected?: string;
11
+ onSelect?: (version: string) => void;
12
+ markSeenWhenShown?: boolean;
13
+ }
14
+ export declare const Playbill: ({ release: Release, markdown, labels, locale, selected, onSelect, markSeenWhenShown }: PlaybillProps) => import("react").JSX.Element;
15
+ //# sourceMappingURL=Playbill.d.ts.map
@@ -0,0 +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,EAAsC,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAO9F,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,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,uFAQtB,aAAa,gCA4Ef,CAAC"}
@@ -0,0 +1,133 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useMemo, useState, useEffect } from 'react';
3
+ import { usePlaybillClient } from './Configuration/PlaybillProvider.js';
4
+ import { resolveLabels } from './Labels/resolveLabels.js';
5
+ import { PlaybillMarkdown } from './Markdown/PlaybillMarkdown.js';
6
+ import { formatReleaseDate } from './Release/formatReleaseDate.js';
7
+ import { ReleaseNoteView } from './Release/ReleaseNoteView.js';
8
+ import { usePlaybill } from './usePlaybill.js';
9
+ import { useRelease } from './useReleases.js';
10
+
11
+ /**
12
+ * The release notes of the application as a page: the releases newest first on one side and the selected release on the
13
+ * 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
+ * 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 client = usePlaybillClient();
17
+ const { releases, current, isLoading, error, unreadVersions, markSeen } = usePlaybill();
18
+ const resolved = useMemo(()=>resolveLabels(labels), [
19
+ labels
20
+ ]);
21
+ const [picked, setPicked] = useState();
22
+ const version = selected ?? picked ?? releases[0]?.version;
23
+ const { data: note, isLoading: isLoadingNote, error: noteError } = useRelease(version);
24
+ const isUnread = (candidate)=>candidate !== undefined && unreadVersions.includes(candidate);
25
+ const selectedIsUnread = isUnread(version);
26
+ useEffect(()=>{
27
+ if (markSeenWhenShown && note && selectedIsUnread) {
28
+ // Failing to remember it must not keep a person from reading on.
29
+ markSeen(note.version).catch(()=>undefined);
30
+ }
31
+ }, [
32
+ markSeenWhenShown,
33
+ note,
34
+ selectedIsUnread,
35
+ markSeen
36
+ ]);
37
+ const select = (next)=>{
38
+ setPicked(next);
39
+ onSelect?.(next);
40
+ };
41
+ if (error || noteError) {
42
+ return /*#__PURE__*/ jsx("p", {
43
+ className: "playbill-status playbill-status--failed",
44
+ role: "alert",
45
+ children: resolved.failed
46
+ });
47
+ }
48
+ if (isLoading) {
49
+ return /*#__PURE__*/ jsx("p", {
50
+ className: "playbill-status",
51
+ role: "status",
52
+ children: resolved.loading
53
+ });
54
+ }
55
+ if (releases.length === 0) {
56
+ return /*#__PURE__*/ jsx("p", {
57
+ className: "playbill-status",
58
+ children: resolved.empty
59
+ });
60
+ }
61
+ return /*#__PURE__*/ jsxs("div", {
62
+ className: "playbill",
63
+ children: [
64
+ /*#__PURE__*/ jsx("nav", {
65
+ className: "playbill__list",
66
+ "aria-label": resolved.releases,
67
+ children: /*#__PURE__*/ jsx("ul", {
68
+ children: releases.map((summary)=>{
69
+ const date = formatReleaseDate(summary.releasedAt, locale);
70
+ const isSelected = summary.version === version;
71
+ return /*#__PURE__*/ jsx("li", {
72
+ children: /*#__PURE__*/ jsxs("button", {
73
+ type: "button",
74
+ className: isSelected ? 'playbill-item playbill-item--selected' : 'playbill-item',
75
+ "aria-current": isSelected ? 'true' : undefined,
76
+ onClick: ()=>select(summary.version),
77
+ children: [
78
+ /*#__PURE__*/ jsxs("span", {
79
+ className: "playbill-item__heading",
80
+ children: [
81
+ /*#__PURE__*/ jsx("span", {
82
+ className: "playbill-item__version",
83
+ children: summary.version
84
+ }),
85
+ summary.version === current && /*#__PURE__*/ jsx("span", {
86
+ className: "playbill-tag playbill-tag--current",
87
+ children: resolved.current
88
+ }),
89
+ isUnread(summary.version) && /*#__PURE__*/ jsx("span", {
90
+ className: "playbill-tag playbill-tag--unread",
91
+ children: resolved.unread
92
+ })
93
+ ]
94
+ }),
95
+ date && /*#__PURE__*/ jsx("span", {
96
+ className: "playbill-item__date",
97
+ children: date
98
+ }),
99
+ summary.summary && /*#__PURE__*/ jsx("span", {
100
+ className: "playbill-item__summary",
101
+ children: summary.summary
102
+ })
103
+ ]
104
+ })
105
+ }, summary.version);
106
+ })
107
+ })
108
+ }),
109
+ /*#__PURE__*/ jsxs("div", {
110
+ className: "playbill__content",
111
+ children: [
112
+ isLoadingNote && /*#__PURE__*/ jsx("p", {
113
+ className: "playbill-status",
114
+ role: "status",
115
+ children: resolved.loading
116
+ }),
117
+ !isLoadingNote && note && /*#__PURE__*/ jsx(Release, {
118
+ release: note,
119
+ assetBase: client.assetBase(note.version),
120
+ labels: resolved,
121
+ markdown: markdown ?? PlaybillMarkdown,
122
+ locale: locale,
123
+ isUnread: selectedIsUnread,
124
+ isCurrent: note.version === current
125
+ })
126
+ ]
127
+ })
128
+ ]
129
+ });
130
+ };
131
+
132
+ export { Playbill };
133
+ //# sourceMappingURL=Playbill.js.map