@cratis/showrunner.usher.react 0.0.0-bootstrap.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 (507) hide show
  1. package/Buttons/MyIssuesButton.tsx +78 -0
  2. package/Buttons/ReportButton.tsx +51 -0
  3. package/Buttons/buttonModels.ts +55 -0
  4. package/Buttons/index.ts +6 -0
  5. package/Correlation/CorrelationTracker.ts +51 -0
  6. package/Correlation/index.ts +5 -0
  7. package/Correlation/withCorrelationIdHeader.ts +44 -0
  8. package/Icons.tsx +29 -0
  9. package/Issues/IssueView/AccessPanel.tsx +85 -0
  10. package/Issues/IssueView/GrantAccessDialog.tsx +56 -0
  11. package/Issues/IssueView/IdentityPanel.tsx +38 -0
  12. package/Issues/IssueView/IssueActions.tsx +52 -0
  13. package/Issues/IssueView/IssueConversationPanel.tsx +89 -0
  14. package/Issues/IssueView/IssueHeader.tsx +69 -0
  15. package/Issues/IssueView/IssueView.tsx +74 -0
  16. package/Issues/IssueView/QuestionBanner.tsx +27 -0
  17. package/Issues/IssueView/ReopenIssueDialog.tsx +37 -0
  18. package/Issues/IssueView/ShareIdentityDialog.tsx +37 -0
  19. package/Issues/IssueView/StatusStrip.tsx +42 -0
  20. package/Issues/IssueView/SupportSessions.tsx +59 -0
  21. package/Issues/IssueView/index.ts +15 -0
  22. package/Issues/MyIssues/IssueList.tsx +78 -0
  23. package/Issues/MyIssues/MyIssuesDialog.tsx +64 -0
  24. package/Issues/MyIssues/MyIssuesNavigation.ts +61 -0
  25. package/Issues/MyIssues/index.ts +6 -0
  26. package/Issues/MyIssuesList.ts +33 -0
  27. package/Issues/accessStatus.ts +68 -0
  28. package/Issues/conversationMessages.ts +136 -0
  29. package/Issues/index.ts +12 -0
  30. package/Issues/issueStates.ts +69 -0
  31. package/Issues/sessionActivity.ts +43 -0
  32. package/Issues/useAccessStatus.ts +24 -0
  33. package/Issues/webAddress.ts +22 -0
  34. package/Labels/UsherLabels.ts +365 -0
  35. package/Labels/defaultUsherLabels.ts +178 -0
  36. package/Labels/format.ts +13 -0
  37. package/Labels/index.ts +7 -0
  38. package/Labels/resolveLabels.ts +36 -0
  39. package/Provider/UsherBoundary.tsx +30 -0
  40. package/Provider/UsherContext.ts +109 -0
  41. package/Provider/UsherProvider.tsx +134 -0
  42. package/Provider/index.ts +7 -0
  43. package/Provider/useUsher.ts +72 -0
  44. package/README.md +72 -0
  45. package/Reporting/AccessChoice.ts +107 -0
  46. package/Reporting/AccessFields.tsx +74 -0
  47. package/Reporting/AccessNotice.tsx +33 -0
  48. package/Reporting/ReportErrorDialog.tsx +94 -0
  49. package/Reporting/ReportIssueDialog.tsx +80 -0
  50. package/Reporting/ReportLimits.ts +24 -0
  51. package/Reporting/ReportSent.ts +12 -0
  52. package/Reporting/SentWithReport.tsx +37 -0
  53. package/Reporting/TechnicalDetails.tsx +60 -0
  54. package/Reporting/durationOptions.ts +31 -0
  55. package/Reporting/formatLocation.ts +27 -0
  56. package/Reporting/index.ts +16 -0
  57. package/Reporting/reportValues.ts +150 -0
  58. package/Reporting/useAccessChoice.ts +53 -0
  59. package/dist/cjs/Buttons/MyIssuesButton.d.ts +14 -0
  60. package/dist/cjs/Buttons/MyIssuesButton.d.ts.map +1 -0
  61. package/dist/cjs/Buttons/MyIssuesButton.js +76 -0
  62. package/dist/cjs/Buttons/MyIssuesButton.js.map +1 -0
  63. package/dist/cjs/Buttons/ReportButton.d.ts +8 -0
  64. package/dist/cjs/Buttons/ReportButton.d.ts.map +1 -0
  65. package/dist/cjs/Buttons/ReportButton.js +34 -0
  66. package/dist/cjs/Buttons/ReportButton.js.map +1 -0
  67. package/dist/cjs/Buttons/buttonModels.d.ts +10 -0
  68. package/dist/cjs/Buttons/buttonModels.d.ts.map +1 -0
  69. package/dist/cjs/Buttons/buttonModels.js +44 -0
  70. package/dist/cjs/Buttons/buttonModels.js.map +1 -0
  71. package/dist/cjs/Buttons/index.d.ts +4 -0
  72. package/dist/cjs/Buttons/index.d.ts.map +1 -0
  73. package/dist/cjs/Correlation/CorrelationTracker.d.ts +10 -0
  74. package/dist/cjs/Correlation/CorrelationTracker.d.ts.map +1 -0
  75. package/dist/cjs/Correlation/CorrelationTracker.js +50 -0
  76. package/dist/cjs/Correlation/CorrelationTracker.js.map +1 -0
  77. package/dist/cjs/Correlation/index.d.ts +3 -0
  78. package/dist/cjs/Correlation/index.d.ts.map +1 -0
  79. package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts +6 -0
  80. package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts.map +1 -0
  81. package/dist/cjs/Correlation/withCorrelationIdHeader.js +39 -0
  82. package/dist/cjs/Correlation/withCorrelationIdHeader.js.map +1 -0
  83. package/dist/cjs/Icons.d.ts +4 -0
  84. package/dist/cjs/Icons.d.ts.map +1 -0
  85. package/dist/cjs/Icons.js +53 -0
  86. package/dist/cjs/Icons.js.map +1 -0
  87. package/dist/cjs/Issues/IssueView/AccessPanel.d.ts +6 -0
  88. package/dist/cjs/Issues/IssueView/AccessPanel.d.ts.map +1 -0
  89. package/dist/cjs/Issues/IssueView/AccessPanel.js +124 -0
  90. package/dist/cjs/Issues/IssueView/AccessPanel.js.map +1 -0
  91. package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts +6 -0
  92. package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts.map +1 -0
  93. package/dist/cjs/Issues/IssueView/GrantAccessDialog.js +56 -0
  94. package/dist/cjs/Issues/IssueView/GrantAccessDialog.js.map +1 -0
  95. package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts +6 -0
  96. package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts.map +1 -0
  97. package/dist/cjs/Issues/IssueView/IdentityPanel.js +45 -0
  98. package/dist/cjs/Issues/IssueView/IdentityPanel.js.map +1 -0
  99. package/dist/cjs/Issues/IssueView/IssueActions.d.ts +6 -0
  100. package/dist/cjs/Issues/IssueView/IssueActions.d.ts.map +1 -0
  101. package/dist/cjs/Issues/IssueView/IssueActions.js +58 -0
  102. package/dist/cjs/Issues/IssueView/IssueActions.js.map +1 -0
  103. package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts +6 -0
  104. package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts.map +1 -0
  105. package/dist/cjs/Issues/IssueView/IssueConversationPanel.js +97 -0
  106. package/dist/cjs/Issues/IssueView/IssueConversationPanel.js.map +1 -0
  107. package/dist/cjs/Issues/IssueView/IssueHeader.d.ts +7 -0
  108. package/dist/cjs/Issues/IssueView/IssueHeader.d.ts.map +1 -0
  109. package/dist/cjs/Issues/IssueView/IssueHeader.js +94 -0
  110. package/dist/cjs/Issues/IssueView/IssueHeader.js.map +1 -0
  111. package/dist/cjs/Issues/IssueView/IssueView.d.ts +7 -0
  112. package/dist/cjs/Issues/IssueView/IssueView.d.ts.map +1 -0
  113. package/dist/cjs/Issues/IssueView/IssueView.js +85 -0
  114. package/dist/cjs/Issues/IssueView/IssueView.js.map +1 -0
  115. package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts +5 -0
  116. package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts.map +1 -0
  117. package/dist/cjs/Issues/IssueView/QuestionBanner.js +24 -0
  118. package/dist/cjs/Issues/IssueView/QuestionBanner.js.map +1 -0
  119. package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts +6 -0
  120. package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts.map +1 -0
  121. package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js +34 -0
  122. package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js.map +1 -0
  123. package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts +6 -0
  124. package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts.map +1 -0
  125. package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js +32 -0
  126. package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js.map +1 -0
  127. package/dist/cjs/Issues/IssueView/StatusStrip.d.ts +6 -0
  128. package/dist/cjs/Issues/IssueView/StatusStrip.d.ts.map +1 -0
  129. package/dist/cjs/Issues/IssueView/StatusStrip.js +31 -0
  130. package/dist/cjs/Issues/IssueView/StatusStrip.js.map +1 -0
  131. package/dist/cjs/Issues/IssueView/SupportSessions.d.ts +7 -0
  132. package/dist/cjs/Issues/IssueView/SupportSessions.d.ts.map +1 -0
  133. package/dist/cjs/Issues/IssueView/SupportSessions.js +62 -0
  134. package/dist/cjs/Issues/IssueView/SupportSessions.js.map +1 -0
  135. package/dist/cjs/Issues/IssueView/index.d.ts +13 -0
  136. package/dist/cjs/Issues/IssueView/index.d.ts.map +1 -0
  137. package/dist/cjs/Issues/MyIssues/IssueList.d.ts +7 -0
  138. package/dist/cjs/Issues/MyIssues/IssueList.d.ts.map +1 -0
  139. package/dist/cjs/Issues/MyIssues/IssueList.js +92 -0
  140. package/dist/cjs/Issues/MyIssues/IssueList.js.map +1 -0
  141. package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts +7 -0
  142. package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts.map +1 -0
  143. package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js +79 -0
  144. package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js.map +1 -0
  145. package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts +21 -0
  146. package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts.map +1 -0
  147. package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js +52 -0
  148. package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js.map +1 -0
  149. package/dist/cjs/Issues/MyIssues/index.d.ts +4 -0
  150. package/dist/cjs/Issues/MyIssues/index.d.ts.map +1 -0
  151. package/dist/cjs/Issues/MyIssuesList.d.ts +7 -0
  152. package/dist/cjs/Issues/MyIssuesList.d.ts.map +1 -0
  153. package/dist/cjs/Issues/MyIssuesList.js +33 -0
  154. package/dist/cjs/Issues/MyIssuesList.js.map +1 -0
  155. package/dist/cjs/Issues/accessStatus.d.ts +13 -0
  156. package/dist/cjs/Issues/accessStatus.d.ts.map +1 -0
  157. package/dist/cjs/Issues/accessStatus.js +60 -0
  158. package/dist/cjs/Issues/accessStatus.js.map +1 -0
  159. package/dist/cjs/Issues/conversationMessages.d.ts +14 -0
  160. package/dist/cjs/Issues/conversationMessages.d.ts.map +1 -0
  161. package/dist/cjs/Issues/conversationMessages.js +131 -0
  162. package/dist/cjs/Issues/conversationMessages.js.map +1 -0
  163. package/dist/cjs/Issues/index.d.ts +10 -0
  164. package/dist/cjs/Issues/index.d.ts.map +1 -0
  165. package/dist/cjs/Issues/issueStates.d.ts +12 -0
  166. package/dist/cjs/Issues/issueStates.d.ts.map +1 -0
  167. package/dist/cjs/Issues/issueStates.js +86 -0
  168. package/dist/cjs/Issues/issueStates.js.map +1 -0
  169. package/dist/cjs/Issues/sessionActivity.d.ts +8 -0
  170. package/dist/cjs/Issues/sessionActivity.d.ts.map +1 -0
  171. package/dist/cjs/Issues/sessionActivity.js +39 -0
  172. package/dist/cjs/Issues/sessionActivity.js.map +1 -0
  173. package/dist/cjs/Issues/useAccessStatus.d.ts +4 -0
  174. package/dist/cjs/Issues/useAccessStatus.d.ts.map +1 -0
  175. package/dist/cjs/Issues/useAccessStatus.js +30 -0
  176. package/dist/cjs/Issues/useAccessStatus.js.map +1 -0
  177. package/dist/cjs/Issues/webAddress.d.ts +2 -0
  178. package/dist/cjs/Issues/webAddress.d.ts.map +1 -0
  179. package/dist/cjs/Issues/webAddress.js +24 -0
  180. package/dist/cjs/Issues/webAddress.js.map +1 -0
  181. package/dist/cjs/Labels/UsherLabels.d.ts +177 -0
  182. package/dist/cjs/Labels/UsherLabels.d.ts.map +1 -0
  183. package/dist/cjs/Labels/defaultUsherLabels.d.ts +3 -0
  184. package/dist/cjs/Labels/defaultUsherLabels.d.ts.map +1 -0
  185. package/dist/cjs/Labels/defaultUsherLabels.js +179 -0
  186. package/dist/cjs/Labels/defaultUsherLabels.js.map +1 -0
  187. package/dist/cjs/Labels/format.d.ts +2 -0
  188. package/dist/cjs/Labels/format.d.ts.map +1 -0
  189. package/dist/cjs/Labels/format.js +15 -0
  190. package/dist/cjs/Labels/format.js.map +1 -0
  191. package/dist/cjs/Labels/index.d.ts +5 -0
  192. package/dist/cjs/Labels/index.d.ts.map +1 -0
  193. package/dist/cjs/Labels/resolveLabels.d.ts +3 -0
  194. package/dist/cjs/Labels/resolveLabels.d.ts.map +1 -0
  195. package/dist/cjs/Labels/resolveLabels.js +35 -0
  196. package/dist/cjs/Labels/resolveLabels.js.map +1 -0
  197. package/dist/cjs/Provider/UsherBoundary.d.ts +6 -0
  198. package/dist/cjs/Provider/UsherBoundary.d.ts.map +1 -0
  199. package/dist/cjs/Provider/UsherBoundary.js +24 -0
  200. package/dist/cjs/Provider/UsherBoundary.js.map +1 -0
  201. package/dist/cjs/Provider/UsherContext.d.ts +24 -0
  202. package/dist/cjs/Provider/UsherContext.d.ts.map +1 -0
  203. package/dist/cjs/Provider/UsherContext.js +41 -0
  204. package/dist/cjs/Provider/UsherContext.js.map +1 -0
  205. package/dist/cjs/Provider/UsherProvider.d.ts +14 -0
  206. package/dist/cjs/Provider/UsherProvider.d.ts.map +1 -0
  207. package/dist/cjs/Provider/UsherProvider.js +122 -0
  208. package/dist/cjs/Provider/UsherProvider.js.map +1 -0
  209. package/dist/cjs/Provider/index.d.ts +5 -0
  210. package/dist/cjs/Provider/index.d.ts.map +1 -0
  211. package/dist/cjs/Provider/useUsher.d.ts +13 -0
  212. package/dist/cjs/Provider/useUsher.d.ts.map +1 -0
  213. package/dist/cjs/Provider/useUsher.js +31 -0
  214. package/dist/cjs/Provider/useUsher.js.map +1 -0
  215. package/dist/cjs/Reporting/AccessChoice.d.ts +13 -0
  216. package/dist/cjs/Reporting/AccessChoice.d.ts.map +1 -0
  217. package/dist/cjs/Reporting/AccessChoice.js +113 -0
  218. package/dist/cjs/Reporting/AccessChoice.js.map +1 -0
  219. package/dist/cjs/Reporting/AccessFields.d.ts +12 -0
  220. package/dist/cjs/Reporting/AccessFields.d.ts.map +1 -0
  221. package/dist/cjs/Reporting/AccessFields.js +79 -0
  222. package/dist/cjs/Reporting/AccessFields.js.map +1 -0
  223. package/dist/cjs/Reporting/AccessNotice.d.ts +7 -0
  224. package/dist/cjs/Reporting/AccessNotice.d.ts.map +1 -0
  225. package/dist/cjs/Reporting/AccessNotice.js +28 -0
  226. package/dist/cjs/Reporting/AccessNotice.js.map +1 -0
  227. package/dist/cjs/Reporting/ReportErrorDialog.d.ts +9 -0
  228. package/dist/cjs/Reporting/ReportErrorDialog.d.ts.map +1 -0
  229. package/dist/cjs/Reporting/ReportErrorDialog.js +87 -0
  230. package/dist/cjs/Reporting/ReportErrorDialog.js.map +1 -0
  231. package/dist/cjs/Reporting/ReportIssueDialog.d.ts +8 -0
  232. package/dist/cjs/Reporting/ReportIssueDialog.d.ts.map +1 -0
  233. package/dist/cjs/Reporting/ReportIssueDialog.js +81 -0
  234. package/dist/cjs/Reporting/ReportIssueDialog.js.map +1 -0
  235. package/dist/cjs/Reporting/ReportLimits.d.ts +8 -0
  236. package/dist/cjs/Reporting/ReportLimits.d.ts.map +1 -0
  237. package/dist/cjs/Reporting/ReportLimits.js +19 -0
  238. package/dist/cjs/Reporting/ReportLimits.js.map +1 -0
  239. package/dist/cjs/Reporting/ReportSent.d.ts +5 -0
  240. package/dist/cjs/Reporting/ReportSent.d.ts.map +1 -0
  241. package/dist/cjs/Reporting/SentWithReport.d.ts +7 -0
  242. package/dist/cjs/Reporting/SentWithReport.d.ts.map +1 -0
  243. package/dist/cjs/Reporting/SentWithReport.js +40 -0
  244. package/dist/cjs/Reporting/SentWithReport.js.map +1 -0
  245. package/dist/cjs/Reporting/TechnicalDetails.d.ts +9 -0
  246. package/dist/cjs/Reporting/TechnicalDetails.d.ts.map +1 -0
  247. package/dist/cjs/Reporting/TechnicalDetails.js +75 -0
  248. package/dist/cjs/Reporting/TechnicalDetails.js.map +1 -0
  249. package/dist/cjs/Reporting/durationOptions.d.ts +9 -0
  250. package/dist/cjs/Reporting/durationOptions.d.ts.map +1 -0
  251. package/dist/cjs/Reporting/durationOptions.js +29 -0
  252. package/dist/cjs/Reporting/durationOptions.js.map +1 -0
  253. package/dist/cjs/Reporting/formatLocation.d.ts +7 -0
  254. package/dist/cjs/Reporting/formatLocation.d.ts.map +1 -0
  255. package/dist/cjs/Reporting/formatLocation.js +23 -0
  256. package/dist/cjs/Reporting/formatLocation.js.map +1 -0
  257. package/dist/cjs/Reporting/index.d.ts +14 -0
  258. package/dist/cjs/Reporting/index.d.ts.map +1 -0
  259. package/dist/cjs/Reporting/reportValues.d.ts +22 -0
  260. package/dist/cjs/Reporting/reportValues.d.ts.map +1 -0
  261. package/dist/cjs/Reporting/reportValues.js +124 -0
  262. package/dist/cjs/Reporting/reportValues.js.map +1 -0
  263. package/dist/cjs/Reporting/useAccessChoice.d.ts +13 -0
  264. package/dist/cjs/Reporting/useAccessChoice.d.ts.map +1 -0
  265. package/dist/cjs/Reporting/useAccessChoice.js +41 -0
  266. package/dist/cjs/Reporting/useAccessChoice.js.map +1 -0
  267. package/dist/cjs/index.d.ts +8 -0
  268. package/dist/cjs/index.d.ts.map +1 -0
  269. package/dist/cjs/index.js +133 -0
  270. package/dist/cjs/index.js.map +1 -0
  271. package/dist/cjs/package.json +3 -0
  272. package/dist/esm/Buttons/MyIssuesButton.d.ts +14 -0
  273. package/dist/esm/Buttons/MyIssuesButton.d.ts.map +1 -0
  274. package/dist/esm/Buttons/MyIssuesButton.js +73 -0
  275. package/dist/esm/Buttons/MyIssuesButton.js.map +1 -0
  276. package/dist/esm/Buttons/ReportButton.d.ts +8 -0
  277. package/dist/esm/Buttons/ReportButton.d.ts.map +1 -0
  278. package/dist/esm/Buttons/ReportButton.js +32 -0
  279. package/dist/esm/Buttons/ReportButton.js.map +1 -0
  280. package/dist/esm/Buttons/buttonModels.d.ts +10 -0
  281. package/dist/esm/Buttons/buttonModels.d.ts.map +1 -0
  282. package/dist/esm/Buttons/buttonModels.js +41 -0
  283. package/dist/esm/Buttons/buttonModels.js.map +1 -0
  284. package/dist/esm/Buttons/index.d.ts +4 -0
  285. package/dist/esm/Buttons/index.d.ts.map +1 -0
  286. package/dist/esm/Buttons/index.js +4 -0
  287. package/dist/esm/Buttons/index.js.map +1 -0
  288. package/dist/esm/Correlation/CorrelationTracker.d.ts +10 -0
  289. package/dist/esm/Correlation/CorrelationTracker.d.ts.map +1 -0
  290. package/dist/esm/Correlation/CorrelationTracker.js +48 -0
  291. package/dist/esm/Correlation/CorrelationTracker.js.map +1 -0
  292. package/dist/esm/Correlation/index.d.ts +3 -0
  293. package/dist/esm/Correlation/index.d.ts.map +1 -0
  294. package/dist/esm/Correlation/index.js +3 -0
  295. package/dist/esm/Correlation/index.js.map +1 -0
  296. package/dist/esm/Correlation/withCorrelationIdHeader.d.ts +6 -0
  297. package/dist/esm/Correlation/withCorrelationIdHeader.d.ts.map +1 -0
  298. package/dist/esm/Correlation/withCorrelationIdHeader.js +36 -0
  299. package/dist/esm/Correlation/withCorrelationIdHeader.js.map +1 -0
  300. package/dist/esm/Icons.d.ts +4 -0
  301. package/dist/esm/Icons.d.ts.map +1 -0
  302. package/dist/esm/Icons.js +49 -0
  303. package/dist/esm/Icons.js.map +1 -0
  304. package/dist/esm/Issues/IssueView/AccessPanel.d.ts +6 -0
  305. package/dist/esm/Issues/IssueView/AccessPanel.d.ts.map +1 -0
  306. package/dist/esm/Issues/IssueView/AccessPanel.js +122 -0
  307. package/dist/esm/Issues/IssueView/AccessPanel.js.map +1 -0
  308. package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts +6 -0
  309. package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts.map +1 -0
  310. package/dist/esm/Issues/IssueView/GrantAccessDialog.js +54 -0
  311. package/dist/esm/Issues/IssueView/GrantAccessDialog.js.map +1 -0
  312. package/dist/esm/Issues/IssueView/IdentityPanel.d.ts +6 -0
  313. package/dist/esm/Issues/IssueView/IdentityPanel.d.ts.map +1 -0
  314. package/dist/esm/Issues/IssueView/IdentityPanel.js +43 -0
  315. package/dist/esm/Issues/IssueView/IdentityPanel.js.map +1 -0
  316. package/dist/esm/Issues/IssueView/IssueActions.d.ts +6 -0
  317. package/dist/esm/Issues/IssueView/IssueActions.d.ts.map +1 -0
  318. package/dist/esm/Issues/IssueView/IssueActions.js +56 -0
  319. package/dist/esm/Issues/IssueView/IssueActions.js.map +1 -0
  320. package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts +6 -0
  321. package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts.map +1 -0
  322. package/dist/esm/Issues/IssueView/IssueConversationPanel.js +95 -0
  323. package/dist/esm/Issues/IssueView/IssueConversationPanel.js.map +1 -0
  324. package/dist/esm/Issues/IssueView/IssueHeader.d.ts +7 -0
  325. package/dist/esm/Issues/IssueView/IssueHeader.d.ts.map +1 -0
  326. package/dist/esm/Issues/IssueView/IssueHeader.js +92 -0
  327. package/dist/esm/Issues/IssueView/IssueHeader.js.map +1 -0
  328. package/dist/esm/Issues/IssueView/IssueView.d.ts +7 -0
  329. package/dist/esm/Issues/IssueView/IssueView.d.ts.map +1 -0
  330. package/dist/esm/Issues/IssueView/IssueView.js +83 -0
  331. package/dist/esm/Issues/IssueView/IssueView.js.map +1 -0
  332. package/dist/esm/Issues/IssueView/QuestionBanner.d.ts +5 -0
  333. package/dist/esm/Issues/IssueView/QuestionBanner.d.ts.map +1 -0
  334. package/dist/esm/Issues/IssueView/QuestionBanner.js +22 -0
  335. package/dist/esm/Issues/IssueView/QuestionBanner.js.map +1 -0
  336. package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts +6 -0
  337. package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts.map +1 -0
  338. package/dist/esm/Issues/IssueView/ReopenIssueDialog.js +32 -0
  339. package/dist/esm/Issues/IssueView/ReopenIssueDialog.js.map +1 -0
  340. package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts +6 -0
  341. package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts.map +1 -0
  342. package/dist/esm/Issues/IssueView/ShareIdentityDialog.js +30 -0
  343. package/dist/esm/Issues/IssueView/ShareIdentityDialog.js.map +1 -0
  344. package/dist/esm/Issues/IssueView/StatusStrip.d.ts +6 -0
  345. package/dist/esm/Issues/IssueView/StatusStrip.d.ts.map +1 -0
  346. package/dist/esm/Issues/IssueView/StatusStrip.js +29 -0
  347. package/dist/esm/Issues/IssueView/StatusStrip.js.map +1 -0
  348. package/dist/esm/Issues/IssueView/SupportSessions.d.ts +7 -0
  349. package/dist/esm/Issues/IssueView/SupportSessions.d.ts.map +1 -0
  350. package/dist/esm/Issues/IssueView/SupportSessions.js +60 -0
  351. package/dist/esm/Issues/IssueView/SupportSessions.js.map +1 -0
  352. package/dist/esm/Issues/IssueView/index.d.ts +13 -0
  353. package/dist/esm/Issues/IssueView/index.d.ts.map +1 -0
  354. package/dist/esm/Issues/IssueView/index.js +13 -0
  355. package/dist/esm/Issues/IssueView/index.js.map +1 -0
  356. package/dist/esm/Issues/MyIssues/IssueList.d.ts +7 -0
  357. package/dist/esm/Issues/MyIssues/IssueList.d.ts.map +1 -0
  358. package/dist/esm/Issues/MyIssues/IssueList.js +90 -0
  359. package/dist/esm/Issues/MyIssues/IssueList.js.map +1 -0
  360. package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts +7 -0
  361. package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts.map +1 -0
  362. package/dist/esm/Issues/MyIssues/MyIssuesDialog.js +77 -0
  363. package/dist/esm/Issues/MyIssues/MyIssuesDialog.js.map +1 -0
  364. package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts +21 -0
  365. package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts.map +1 -0
  366. package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js +49 -0
  367. package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js.map +1 -0
  368. package/dist/esm/Issues/MyIssues/index.d.ts +4 -0
  369. package/dist/esm/Issues/MyIssues/index.d.ts.map +1 -0
  370. package/dist/esm/Issues/MyIssues/index.js +4 -0
  371. package/dist/esm/Issues/MyIssues/index.js.map +1 -0
  372. package/dist/esm/Issues/MyIssuesList.d.ts +7 -0
  373. package/dist/esm/Issues/MyIssuesList.d.ts.map +1 -0
  374. package/dist/esm/Issues/MyIssuesList.js +29 -0
  375. package/dist/esm/Issues/MyIssuesList.js.map +1 -0
  376. package/dist/esm/Issues/accessStatus.d.ts +13 -0
  377. package/dist/esm/Issues/accessStatus.d.ts.map +1 -0
  378. package/dist/esm/Issues/accessStatus.js +54 -0
  379. package/dist/esm/Issues/accessStatus.js.map +1 -0
  380. package/dist/esm/Issues/conversationMessages.d.ts +14 -0
  381. package/dist/esm/Issues/conversationMessages.d.ts.map +1 -0
  382. package/dist/esm/Issues/conversationMessages.js +125 -0
  383. package/dist/esm/Issues/conversationMessages.js.map +1 -0
  384. package/dist/esm/Issues/index.d.ts +10 -0
  385. package/dist/esm/Issues/index.d.ts.map +1 -0
  386. package/dist/esm/Issues/index.js +10 -0
  387. package/dist/esm/Issues/index.js.map +1 -0
  388. package/dist/esm/Issues/issueStates.d.ts +12 -0
  389. package/dist/esm/Issues/issueStates.d.ts.map +1 -0
  390. package/dist/esm/Issues/issueStates.js +81 -0
  391. package/dist/esm/Issues/issueStates.js.map +1 -0
  392. package/dist/esm/Issues/sessionActivity.d.ts +8 -0
  393. package/dist/esm/Issues/sessionActivity.d.ts.map +1 -0
  394. package/dist/esm/Issues/sessionActivity.js +37 -0
  395. package/dist/esm/Issues/sessionActivity.js.map +1 -0
  396. package/dist/esm/Issues/useAccessStatus.d.ts +4 -0
  397. package/dist/esm/Issues/useAccessStatus.d.ts.map +1 -0
  398. package/dist/esm/Issues/useAccessStatus.js +28 -0
  399. package/dist/esm/Issues/useAccessStatus.js.map +1 -0
  400. package/dist/esm/Issues/webAddress.d.ts +2 -0
  401. package/dist/esm/Issues/webAddress.d.ts.map +1 -0
  402. package/dist/esm/Issues/webAddress.js +22 -0
  403. package/dist/esm/Issues/webAddress.js.map +1 -0
  404. package/dist/esm/Labels/UsherLabels.d.ts +177 -0
  405. package/dist/esm/Labels/UsherLabels.d.ts.map +1 -0
  406. package/dist/esm/Labels/UsherLabels.js +2 -0
  407. package/dist/esm/Labels/UsherLabels.js.map +1 -0
  408. package/dist/esm/Labels/defaultUsherLabels.d.ts +3 -0
  409. package/dist/esm/Labels/defaultUsherLabels.d.ts.map +1 -0
  410. package/dist/esm/Labels/defaultUsherLabels.js +177 -0
  411. package/dist/esm/Labels/defaultUsherLabels.js.map +1 -0
  412. package/dist/esm/Labels/format.d.ts +2 -0
  413. package/dist/esm/Labels/format.d.ts.map +1 -0
  414. package/dist/esm/Labels/format.js +13 -0
  415. package/dist/esm/Labels/format.js.map +1 -0
  416. package/dist/esm/Labels/index.d.ts +5 -0
  417. package/dist/esm/Labels/index.d.ts.map +1 -0
  418. package/dist/esm/Labels/index.js +5 -0
  419. package/dist/esm/Labels/index.js.map +1 -0
  420. package/dist/esm/Labels/resolveLabels.d.ts +3 -0
  421. package/dist/esm/Labels/resolveLabels.d.ts.map +1 -0
  422. package/dist/esm/Labels/resolveLabels.js +33 -0
  423. package/dist/esm/Labels/resolveLabels.js.map +1 -0
  424. package/dist/esm/Provider/UsherBoundary.d.ts +6 -0
  425. package/dist/esm/Provider/UsherBoundary.d.ts.map +1 -0
  426. package/dist/esm/Provider/UsherBoundary.js +22 -0
  427. package/dist/esm/Provider/UsherBoundary.js.map +1 -0
  428. package/dist/esm/Provider/UsherContext.d.ts +24 -0
  429. package/dist/esm/Provider/UsherContext.d.ts.map +1 -0
  430. package/dist/esm/Provider/UsherContext.js +36 -0
  431. package/dist/esm/Provider/UsherContext.js.map +1 -0
  432. package/dist/esm/Provider/UsherProvider.d.ts +14 -0
  433. package/dist/esm/Provider/UsherProvider.d.ts.map +1 -0
  434. package/dist/esm/Provider/UsherProvider.js +120 -0
  435. package/dist/esm/Provider/UsherProvider.js.map +1 -0
  436. package/dist/esm/Provider/index.d.ts +5 -0
  437. package/dist/esm/Provider/index.d.ts.map +1 -0
  438. package/dist/esm/Provider/index.js +5 -0
  439. package/dist/esm/Provider/index.js.map +1 -0
  440. package/dist/esm/Provider/useUsher.d.ts +13 -0
  441. package/dist/esm/Provider/useUsher.d.ts.map +1 -0
  442. package/dist/esm/Provider/useUsher.js +29 -0
  443. package/dist/esm/Provider/useUsher.js.map +1 -0
  444. package/dist/esm/Reporting/AccessChoice.d.ts +13 -0
  445. package/dist/esm/Reporting/AccessChoice.d.ts.map +1 -0
  446. package/dist/esm/Reporting/AccessChoice.js +106 -0
  447. package/dist/esm/Reporting/AccessChoice.js.map +1 -0
  448. package/dist/esm/Reporting/AccessFields.d.ts +12 -0
  449. package/dist/esm/Reporting/AccessFields.d.ts.map +1 -0
  450. package/dist/esm/Reporting/AccessFields.js +77 -0
  451. package/dist/esm/Reporting/AccessFields.js.map +1 -0
  452. package/dist/esm/Reporting/AccessNotice.d.ts +7 -0
  453. package/dist/esm/Reporting/AccessNotice.d.ts.map +1 -0
  454. package/dist/esm/Reporting/AccessNotice.js +26 -0
  455. package/dist/esm/Reporting/AccessNotice.js.map +1 -0
  456. package/dist/esm/Reporting/ReportErrorDialog.d.ts +9 -0
  457. package/dist/esm/Reporting/ReportErrorDialog.d.ts.map +1 -0
  458. package/dist/esm/Reporting/ReportErrorDialog.js +85 -0
  459. package/dist/esm/Reporting/ReportErrorDialog.js.map +1 -0
  460. package/dist/esm/Reporting/ReportIssueDialog.d.ts +8 -0
  461. package/dist/esm/Reporting/ReportIssueDialog.d.ts.map +1 -0
  462. package/dist/esm/Reporting/ReportIssueDialog.js +79 -0
  463. package/dist/esm/Reporting/ReportIssueDialog.js.map +1 -0
  464. package/dist/esm/Reporting/ReportLimits.d.ts +8 -0
  465. package/dist/esm/Reporting/ReportLimits.d.ts.map +1 -0
  466. package/dist/esm/Reporting/ReportLimits.js +17 -0
  467. package/dist/esm/Reporting/ReportLimits.js.map +1 -0
  468. package/dist/esm/Reporting/ReportSent.d.ts +5 -0
  469. package/dist/esm/Reporting/ReportSent.d.ts.map +1 -0
  470. package/dist/esm/Reporting/ReportSent.js +2 -0
  471. package/dist/esm/Reporting/ReportSent.js.map +1 -0
  472. package/dist/esm/Reporting/SentWithReport.d.ts +7 -0
  473. package/dist/esm/Reporting/SentWithReport.d.ts.map +1 -0
  474. package/dist/esm/Reporting/SentWithReport.js +38 -0
  475. package/dist/esm/Reporting/SentWithReport.js.map +1 -0
  476. package/dist/esm/Reporting/TechnicalDetails.d.ts +9 -0
  477. package/dist/esm/Reporting/TechnicalDetails.d.ts.map +1 -0
  478. package/dist/esm/Reporting/TechnicalDetails.js +73 -0
  479. package/dist/esm/Reporting/TechnicalDetails.js.map +1 -0
  480. package/dist/esm/Reporting/durationOptions.d.ts +9 -0
  481. package/dist/esm/Reporting/durationOptions.d.ts.map +1 -0
  482. package/dist/esm/Reporting/durationOptions.js +27 -0
  483. package/dist/esm/Reporting/durationOptions.js.map +1 -0
  484. package/dist/esm/Reporting/formatLocation.d.ts +7 -0
  485. package/dist/esm/Reporting/formatLocation.d.ts.map +1 -0
  486. package/dist/esm/Reporting/formatLocation.js +21 -0
  487. package/dist/esm/Reporting/formatLocation.js.map +1 -0
  488. package/dist/esm/Reporting/index.d.ts +14 -0
  489. package/dist/esm/Reporting/index.d.ts.map +1 -0
  490. package/dist/esm/Reporting/index.js +14 -0
  491. package/dist/esm/Reporting/index.js.map +1 -0
  492. package/dist/esm/Reporting/reportValues.d.ts +22 -0
  493. package/dist/esm/Reporting/reportValues.d.ts.map +1 -0
  494. package/dist/esm/Reporting/reportValues.js +116 -0
  495. package/dist/esm/Reporting/reportValues.js.map +1 -0
  496. package/dist/esm/Reporting/useAccessChoice.d.ts +13 -0
  497. package/dist/esm/Reporting/useAccessChoice.d.ts.map +1 -0
  498. package/dist/esm/Reporting/useAccessChoice.js +39 -0
  499. package/dist/esm/Reporting/useAccessChoice.js.map +1 -0
  500. package/dist/esm/index.d.ts +8 -0
  501. package/dist/esm/index.d.ts.map +1 -0
  502. package/dist/esm/index.js +48 -0
  503. package/dist/esm/index.js.map +1 -0
  504. package/dist/esm/package.json +3 -0
  505. package/index.ts +10 -0
  506. package/package.json +85 -0
  507. package/styles.css +320 -0
@@ -0,0 +1,78 @@
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
+ import { Button, IconButton } from '@cratis/components/Common';
5
+ import { Badge } from '@cratis/components/Display';
6
+ import { MyIssues } from '@cratis/showrunner.usher';
7
+ import { InboxIcon } from '../Icons.js';
8
+ import { waitingCount } from '../Issues/MyIssuesList.js';
9
+ import { UsherBoundary } from '../Provider/UsherBoundary.js';
10
+ import { useUsher } from '../Provider/useUsher.js';
11
+ import { myIssuesButtonModel, UsherButtonSize } from './buttonModels.js';
12
+
13
+ /**
14
+ * Props for {@link MyIssuesButton}.
15
+ */
16
+ export interface MyIssuesButtonProps {
17
+ /** `large` shows the icon and the text; `small` shows the icon, with the text as tooltip and accessible name. Defaults to `large`. */
18
+ size?: UsherButtonSize;
19
+
20
+ /** Additional class name for the button. */
21
+ className?: string;
22
+ }
23
+
24
+ /**
25
+ * Opens the my issues side sheet. A badge counts the issues support waits for the user on, and the accessible name
26
+ * says how many.
27
+ */
28
+ export const MyIssuesButton = (props: MyIssuesButtonProps) => {
29
+ const usher = useUsher();
30
+
31
+ return (
32
+ <UsherBoundary>
33
+ <MyIssuesButtonContent {...props} onOpen={usher.showMyIssues} />
34
+ </UsherBoundary>
35
+ );
36
+ };
37
+
38
+ const MyIssuesButtonContent = ({ size = 'large', className, onOpen }: MyIssuesButtonProps & { onOpen: () => void }) => {
39
+ const usher = useUsher();
40
+ const [result] = MyIssues.use();
41
+
42
+ return <MyIssuesButtonView size={size} className={className} waiting={waitingCount(result.data ?? [])} labels={usher.labels} onOpen={onOpen} />;
43
+ };
44
+
45
+ /**
46
+ * Props for {@link MyIssuesButtonView}.
47
+ */
48
+ export interface MyIssuesButtonViewProps extends MyIssuesButtonProps {
49
+ /** How many issues support waits for the user on. */
50
+ waiting: number;
51
+
52
+ /** The labels to show. */
53
+ labels: ReturnType<typeof useUsher>['labels'];
54
+
55
+ /** Opens the my issues side sheet. */
56
+ onOpen: () => void;
57
+ }
58
+
59
+ /**
60
+ * Renders the my issues button for a given number of issues support waits for the user on.
61
+ */
62
+ export const MyIssuesButtonView = ({ size = 'large', className, waiting, labels, onOpen }: MyIssuesButtonViewProps) => {
63
+ const model = myIssuesButtonModel(size, waiting, labels);
64
+ const badge = waiting > 0 && (
65
+ <span className='usher-my-issues-button__badge' aria-hidden='true'>
66
+ <Badge value={waiting} severity='warn' size='small' />
67
+ </span>
68
+ );
69
+
70
+ return (
71
+ <span className={['usher-my-issues-button', className].filter(Boolean).join(' ')} data-size={size}>
72
+ {size === 'small'
73
+ ? <IconButton variant='ghost' icon={<InboxIcon />} aria-label={model.accessibleName} tooltip={model.tooltip} onClick={onOpen} />
74
+ : <Button variant='outline' icon={<InboxIcon />} label={model.text} aria-label={model.accessibleName} onClick={onOpen} />}
75
+ {badge}
76
+ </span>
77
+ );
78
+ };
@@ -0,0 +1,51 @@
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
+ import { Button, IconButton } from '@cratis/components/Common';
5
+ import { BugIcon } from '../Icons.js';
6
+ import { useUsher } from '../Provider/useUsher.js';
7
+ import { reportButtonModel, UsherButtonSize } from './buttonModels.js';
8
+
9
+ /**
10
+ * Props for {@link ReportButton}.
11
+ */
12
+ export interface ReportButtonProps {
13
+ /** `large` shows the icon and the text; `small` shows the icon, with the text as tooltip and accessible name. Defaults to `large`. */
14
+ size?: UsherButtonSize;
15
+
16
+ /** The error to report: `ErrorDetails` from `@cratis/showrunner.usher`, or anything thrown. The button reports a problem described by hand when not given. */
17
+ error?: unknown;
18
+
19
+ /** Additional class name for the button. */
20
+ className?: string;
21
+ }
22
+
23
+ /**
24
+ * Opens the report a problem dialog, or the report this error dialog when given an error, with where in the
25
+ * application the button is.
26
+ */
27
+ export const ReportButton = ({ size = 'large', error, className }: ReportButtonProps) => {
28
+ const usher = useUsher();
29
+ const reportsError = error !== undefined;
30
+ const model = reportButtonModel(size, reportsError, usher.labels);
31
+ const report = () => reportsError ? usher.reportError(error) : usher.reportIssue();
32
+
33
+ return size === 'small'
34
+ ? (
35
+ <IconButton
36
+ className={className}
37
+ variant='ghost'
38
+ icon={<BugIcon />}
39
+ aria-label={model.accessibleName}
40
+ tooltip={model.tooltip}
41
+ onClick={report} />
42
+ )
43
+ : (
44
+ <Button
45
+ className={className}
46
+ variant='outline'
47
+ icon={<BugIcon />}
48
+ label={model.text}
49
+ onClick={report} />
50
+ );
51
+ };
@@ -0,0 +1,55 @@
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
+ import { format, UsherLabels } from '../Labels/index.js';
5
+
6
+ /**
7
+ * The sizes of the Usher buttons: `large` shows the icon and the text; `small` shows the icon, with the text as the
8
+ * tooltip and the accessible name.
9
+ */
10
+ export type UsherButtonSize = 'large' | 'small';
11
+
12
+ /**
13
+ * What an Usher button shows and announces.
14
+ */
15
+ export interface ButtonModel {
16
+ /** The visible text; empty for a small button. */
17
+ readonly text: string;
18
+
19
+ /** The accessible name. */
20
+ readonly accessibleName: string;
21
+
22
+ /** The tooltip; empty for a large button, whose text says it all. */
23
+ readonly tooltip: string;
24
+ }
25
+
26
+ /**
27
+ * Gets what the report button shows and announces.
28
+ * @param size The {@link UsherButtonSize}.
29
+ * @param reportsError Whether the button reports an error rather than a problem described by hand.
30
+ * @param labels The labels to show.
31
+ * @returns The {@link ButtonModel}.
32
+ */
33
+ export function reportButtonModel(size: UsherButtonSize, reportsError: boolean, labels: UsherLabels): ButtonModel {
34
+ const label = reportsError ? labels.reportButton.reportError : labels.reportButton.reportProblem;
35
+ return modelFor(size, label, label);
36
+ }
37
+
38
+ /**
39
+ * Gets what the my issues button shows and announces.
40
+ * @param size The {@link UsherButtonSize}.
41
+ * @param waiting How many issues support waits for the user on.
42
+ * @param labels The labels to show.
43
+ * @returns The {@link ButtonModel}.
44
+ */
45
+ export function myIssuesButtonModel(size: UsherButtonSize, waiting: number, labels: UsherLabels): ButtonModel {
46
+ const label = labels.myIssuesButton.label;
47
+ const accessibleName = waiting > 0 ? `${label}, ${format(labels.myIssuesButton.waiting, { count: waiting })}` : label;
48
+ return modelFor(size, label, accessibleName);
49
+ }
50
+
51
+ function modelFor(size: UsherButtonSize, label: string, accessibleName: string): ButtonModel {
52
+ return size === 'small'
53
+ ? { text: '', accessibleName, tooltip: accessibleName }
54
+ : { text: label, accessibleName, tooltip: '' };
55
+ }
@@ -0,0 +1,6 @@
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
+ export * from './buttonModels.js';
5
+ export * from './MyIssuesButton.js';
6
+ export * from './ReportButton.js';
@@ -0,0 +1,51 @@
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
+ import { Guid } from '@cratis/fundamentals';
5
+
6
+ /**
7
+ * Keeps the correlation ids of the last few Arc commands and queries, so a report can carry them.
8
+ */
9
+ export class CorrelationTracker {
10
+ private _correlationIds: Guid[] = [];
11
+
12
+ /**
13
+ * Initializes a new instance of {@link CorrelationTracker}.
14
+ * @param capacity How many correlation ids to keep; the oldest is dropped when one more is tracked.
15
+ */
16
+ constructor(readonly capacity: number = 5) {
17
+ }
18
+
19
+ /**
20
+ * Gets the correlation ids kept, oldest first.
21
+ */
22
+ get correlationIds(): Guid[] {
23
+ return [...this._correlationIds];
24
+ }
25
+
26
+ /**
27
+ * Tracks a correlation id. A correlation id already kept moves to the end instead of being kept twice; an
28
+ * empty one is ignored.
29
+ * @param correlationId The correlation id, as a {@link Guid} or its string form.
30
+ */
31
+ track(correlationId: Guid | string): void {
32
+ const parsed = typeof correlationId === 'string' ? parseGuid(correlationId) : correlationId;
33
+ if (!parsed || parsed.equals(Guid.empty)) {
34
+ return;
35
+ }
36
+
37
+ this._correlationIds = [...this._correlationIds.filter(existing => !existing.equals(parsed)), parsed]
38
+ .slice(-Math.max(this.capacity, 0));
39
+ }
40
+
41
+ /**
42
+ * Forgets every correlation id kept.
43
+ */
44
+ clear(): void {
45
+ this._correlationIds = [];
46
+ }
47
+ }
48
+
49
+ function parseGuid(value: string): Guid | undefined {
50
+ return Guid.isGuid(value) ? Guid.parse(value) : undefined;
51
+ }
@@ -0,0 +1,5 @@
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
+ export * from './CorrelationTracker.js';
5
+ export * from './withCorrelationIdHeader.js';
@@ -0,0 +1,44 @@
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
+ import { GetHttpHeaders } from '@cratis/arc';
5
+ import { Guid } from '@cratis/fundamentals';
6
+ import { CorrelationTracker } from './CorrelationTracker.js';
7
+
8
+ /**
9
+ * The HTTP header Arc reads the correlation id of a command or query from, unless the backend configures another.
10
+ */
11
+ export const defaultCorrelationIdHeader = 'X-Correlation-ID';
12
+
13
+ /**
14
+ * Wraps the HTTP headers callback Arc calls for every command and query request, so each request carries a
15
+ * correlation id the tracker knows.
16
+ * @remarks
17
+ * Arc uses the correlation id a request carries in its correlation id header, so the id tracked is the id the
18
+ * backend records for the command or query. A correlation id the headers already carry is kept and tracked;
19
+ * otherwise a new one is added.
20
+ * @param headersCallback The callback to wrap; nothing for none.
21
+ * @param tracker The {@link CorrelationTracker} to track the correlation ids in.
22
+ * @param header The name of the correlation id header.
23
+ * @param createCorrelationId Creates a new correlation id.
24
+ * @returns The wrapping callback.
25
+ */
26
+ export function withCorrelationIdHeader(
27
+ headersCallback: GetHttpHeaders | undefined,
28
+ tracker: CorrelationTracker,
29
+ header: string = defaultCorrelationIdHeader,
30
+ createCorrelationId: () => Guid = () => Guid.create()): GetHttpHeaders {
31
+ return () => {
32
+ const headers = new Headers(headersCallback?.() ?? {});
33
+ const existing = headers.get(header);
34
+ const correlationId = existing && Guid.isGuid(existing) ? existing : createCorrelationId().toString();
35
+ headers.set(header, correlationId);
36
+ tracker.track(correlationId);
37
+
38
+ const record: Record<string, string> = {};
39
+ headers.forEach((value, name) => {
40
+ record[name] = value;
41
+ });
42
+ return record;
43
+ };
44
+ }
package/Icons.tsx ADDED
@@ -0,0 +1,29 @@
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
+ /**
5
+ * The bug icon of the report button. Decorative: the button carries the accessible name.
6
+ */
7
+ export const BugIcon = () => (
8
+ <svg className='usher-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
9
+ <path fill='currentColor' d='M20 8h-2.81a5.985 5.985 0 0 0-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 0 0-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z' />
10
+ </svg>
11
+ );
12
+
13
+ /**
14
+ * The inbox icon of the my issues button. Decorative: the button carries the accessible name.
15
+ */
16
+ export const InboxIcon = () => (
17
+ <svg className='usher-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
18
+ <path fill='currentColor' d='M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm0 12h-4a3 3 0 0 1-6 0H5V5h14v10z' />
19
+ </svg>
20
+ );
21
+
22
+ /**
23
+ * The back arrow of the issue view. Decorative: the button carries the accessible name.
24
+ */
25
+ export const BackIcon = () => (
26
+ <svg className='usher-icon' viewBox='0 0 24 24' width='1em' height='1em' aria-hidden='true' focusable='false'>
27
+ <path fill='currentColor' d='M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z' />
28
+ </svg>
29
+ );
@@ -0,0 +1,85 @@
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
+ import { DialogButtons, DialogResult, useConfirmationDialog, useDialog } from '@cratis/arc.react/dialogs';
5
+ import { Button } from '@cratis/components/Common';
6
+ import { toastCommandResult } from '@cratis/components/Notifications';
7
+ import { IssueConversation, IssueState, RevokeAccess } from '@cratis/showrunner.usher';
8
+ import { useId, useState } from 'react';
9
+ import { format } from '../../Labels/index.js';
10
+ import { useUsherContext } from '../../Provider/UsherContext.js';
11
+ import { formatTime } from '../../Reporting/AccessChoice.js';
12
+ import { AccessStatus } from '../accessStatus.js';
13
+ import { useAccessStatus } from '../useAccessStatus.js';
14
+ import { GrantAccessDialog } from './GrantAccessDialog.js';
15
+ import { SupportSessions } from './SupportSessions.js';
16
+
17
+ /**
18
+ * Props for {@link AccessPanel}.
19
+ */
20
+ export interface AccessPanelProps {
21
+ /** The issue. */
22
+ issue: IssueConversation;
23
+ }
24
+
25
+ /**
26
+ * Shows whether support may sign in as the reporter, lets them grant or revoke it, highlights support's pending
27
+ * request, and lists the sessions in which support signed in.
28
+ */
29
+ export const AccessPanel = ({ issue }: AccessPanelProps) => {
30
+ const { labels, locale } = useUsherContext();
31
+ const headingId = useId();
32
+ const [GrantDialog, showGrantDialog] = useDialog(GrantAccessDialog);
33
+ const [confirm] = useConfirmationDialog();
34
+ const [revokeAccess] = RevokeAccess.use();
35
+ const [requestDismissed, setRequestDismissed] = useState(false);
36
+ const [status] = useAccessStatus(issue.access);
37
+ const isWithdrawn = issue.state === IssueState.withdrawn;
38
+ const showsRequest = status === AccessStatus.requested && !requestDismissed && !isWithdrawn;
39
+ const validUntil = issue.access?.validUntil instanceof Date ? issue.access.validUntil : new Date(issue.access?.validUntil);
40
+
41
+ const heading = status === AccessStatus.granted
42
+ ? labels.accessPanel.grantedHeading
43
+ : showsRequest ? labels.accessPanel.requestedHeading : labels.accessPanel.notGrantedHeading;
44
+
45
+ const revoke = async () => {
46
+ const answer = await confirm(labels.accessPanel.revokeTitle, labels.accessPanel.revokeMessage, DialogButtons.YesNo);
47
+ if (answer !== DialogResult.Yes) {
48
+ return;
49
+ }
50
+
51
+ revokeAccess.issueId = issue.id;
52
+ toastCommandResult(await revokeAccess.execute(), { showSuccess: false });
53
+ };
54
+
55
+ const grant = () => void showGrantDialog({ issueId: issue.id });
56
+
57
+ return (
58
+ <section className='usher-panel' data-highlighted={showsRequest || undefined} aria-labelledby={headingId}>
59
+ <h4 id={headingId} className='usher-panel__heading'>{heading}</h4>
60
+ {status === AccessStatus.granted && (
61
+ <>
62
+ <p className='usher-panel__text'>{format(labels.accessPanel.grantedUntil, { time: formatTime(validUntil, locale) })}</p>
63
+ <Button variant='outline' tone='critical' size='small' label={labels.accessPanel.revoke} onClick={() => void revoke()} />
64
+ </>
65
+ )}
66
+ {showsRequest && (
67
+ <>
68
+ <p className='usher-panel__text'>{format(labels.accessPanel.requestReason, { reason: issue.access.request.reason })}</p>
69
+ <div className='usher-panel__actions'>
70
+ <Button variant='solid' tone='accent' size='small' label={labels.accessPanel.grant} onClick={grant} />
71
+ <Button variant='ghost' size='small' label={labels.accessPanel.notNow} onClick={() => setRequestDismissed(true)} />
72
+ </div>
73
+ </>
74
+ )}
75
+ {status !== AccessStatus.granted && !showsRequest && (
76
+ <>
77
+ <p className='usher-panel__text'>{labels.accessPanel.notGranted}</p>
78
+ {!isWithdrawn && <Button variant='outline' size='small' label={labels.accessPanel.grant} onClick={grant} />}
79
+ </>
80
+ )}
81
+ <SupportSessions sessions={issue.access?.sessions ?? []} entries={issue.entries ?? []} />
82
+ <GrantDialog />
83
+ </section>
84
+ );
85
+ };
@@ -0,0 +1,56 @@
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
+ import { CommandDialog } from '@cratis/components/CommandDialog';
5
+ import { DropdownField } from '@cratis/components/CommandForm';
6
+ import { DialogInitialFocus } from '@cratis/components/Dialogs';
7
+ import { Guid } from '@cratis/fundamentals';
8
+ import { AccessDuration, GrantAccess } from '@cratis/showrunner.usher';
9
+ import { useId, useState } from 'react';
10
+ import { useUsherLabels } from '../../Provider/UsherContext.js';
11
+ import { AccessNotice } from '../../Reporting/AccessNotice.js';
12
+ import { durationOptions } from '../../Reporting/durationOptions.js';
13
+
14
+ /**
15
+ * Props for {@link GrantAccessDialog}.
16
+ */
17
+ export interface GrantAccessDialogProps {
18
+ /** The issue. */
19
+ issueId: Guid;
20
+ }
21
+
22
+ /**
23
+ * Lets the reporter grant support access to sign in as them on an issue for a while, stating until when.
24
+ */
25
+ export const GrantAccessDialog = ({ issueId }: GrantAccessDialogProps) => {
26
+ const labels = useUsherLabels();
27
+ const noticeId = useId();
28
+ const [duration, setDuration] = useState(AccessDuration.oneDay);
29
+
30
+ return (
31
+ <CommandDialog<GrantAccess>
32
+ command={GrantAccess}
33
+ title={labels.accessPanel.grantTitle}
34
+ okLabel={labels.accessPanel.grantConfirm}
35
+ cancelLabel={labels.common.cancel}
36
+ closeAriaLabel={labels.common.close}
37
+ initialFocus={DialogInitialFocus.Content}
38
+ initialValues={{ issueId, accessDuration: AccessDuration.oneDay }}
39
+ onFieldChange={(_command, fieldName, _oldValue, newValue) => {
40
+ if (fieldName === 'accessDuration') {
41
+ setDuration(Number(newValue) as AccessDuration);
42
+ }
43
+ }}>
44
+ <div className='usher-report-form'>
45
+ <DropdownField<GrantAccess>
46
+ value={command => command.accessDuration}
47
+ title={labels.access.duration}
48
+ aria-describedby={noticeId}
49
+ options={durationOptions(labels)}
50
+ optionValue='value'
51
+ optionLabel='label' />
52
+ <AccessNotice id={noticeId} duration={duration} />
53
+ </div>
54
+ </CommandDialog>
55
+ );
56
+ };
@@ -0,0 +1,38 @@
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
+ import { useDialog } from '@cratis/arc.react/dialogs';
5
+ import { Button } from '@cratis/components/Common';
6
+ import { IssueConversation, IssueState } from '@cratis/showrunner.usher';
7
+ import { useId } from 'react';
8
+ import { useUsherLabels } from '../../Provider/UsherContext.js';
9
+ import { ShareIdentityDialog } from './ShareIdentityDialog.js';
10
+
11
+ /**
12
+ * Props for {@link IdentityPanel}.
13
+ */
14
+ export interface IdentityPanelProps {
15
+ /** The issue. */
16
+ issue: IssueConversation;
17
+ }
18
+
19
+ /**
20
+ * Shows whether support knows who the reporter is, and lets them share it when it does not.
21
+ */
22
+ export const IdentityPanel = ({ issue }: IdentityPanelProps) => {
23
+ const labels = useUsherLabels();
24
+ const headingId = useId();
25
+ const [ShareDialog, showShareDialog] = useDialog(ShareIdentityDialog);
26
+ const canShare = !issue.identityShared && issue.state !== IssueState.withdrawn;
27
+
28
+ return (
29
+ <section className='usher-panel' aria-labelledby={headingId}>
30
+ <h4 id={headingId} className='usher-panel__heading'>{labels.identity.heading}</h4>
31
+ <p className='usher-panel__text'>{issue.identityShared ? labels.identity.known : labels.identity.unknown}</p>
32
+ {canShare && (
33
+ <Button variant='outline' size='small' label={labels.identity.share} onClick={() => void showShareDialog({ issueId: issue.id })} />
34
+ )}
35
+ <ShareDialog />
36
+ </section>
37
+ );
38
+ };
@@ -0,0 +1,52 @@
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
+ import { DialogButtons, DialogResult, useConfirmationDialog, useDialog } from '@cratis/arc.react/dialogs';
5
+ import { Button } from '@cratis/components/Common';
6
+ import { toastCommandResult } from '@cratis/components/Notifications';
7
+ import { IssueConversation, IssueState, WithdrawIssue } from '@cratis/showrunner.usher';
8
+ import { useUsherLabels } from '../../Provider/UsherContext.js';
9
+ import { isClosed } from '../issueStates.js';
10
+ import { ReopenIssueDialog } from './ReopenIssueDialog.js';
11
+
12
+ /**
13
+ * Props for {@link IssueActions}.
14
+ */
15
+ export interface IssueActionsProps {
16
+ /** The issue. */
17
+ issue: IssueConversation;
18
+ }
19
+
20
+ /**
21
+ * What the reporter can do with an issue: reopen it once resolved, and withdraw it while it is open.
22
+ */
23
+ export const IssueActions = ({ issue }: IssueActionsProps) => {
24
+ const labels = useUsherLabels();
25
+ const [ReopenDialog, showReopenDialog] = useDialog(ReopenIssueDialog);
26
+ const [confirm] = useConfirmationDialog();
27
+ const [withdrawIssue] = WithdrawIssue.use();
28
+ const canReopen = issue.state === IssueState.resolved;
29
+ const canWithdraw = !isClosed(issue.state);
30
+
31
+ const withdraw = async () => {
32
+ const answer = await confirm(labels.actions.withdrawTitle, labels.actions.withdrawMessage, DialogButtons.YesNo);
33
+ if (answer !== DialogResult.Yes) {
34
+ return;
35
+ }
36
+
37
+ withdrawIssue.issueId = issue.id;
38
+ toastCommandResult(await withdrawIssue.execute(), { showSuccess: false });
39
+ };
40
+
41
+ if (!canReopen && !canWithdraw) {
42
+ return null;
43
+ }
44
+
45
+ return (
46
+ <div className='usher-issue-actions'>
47
+ {canReopen && <Button variant='outline' size='small' label={labels.actions.reopen} onClick={() => void showReopenDialog({ issueId: issue.id })} />}
48
+ {canWithdraw && <Button variant='ghost' tone='critical' size='small' label={labels.actions.withdraw} onClick={() => void withdraw()} />}
49
+ <ReopenDialog />
50
+ </div>
51
+ );
52
+ };
@@ -0,0 +1,89 @@
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
+ import { ChatConversation } from '@cratis/components/Chat';
5
+ import { Message, Tag } from '@cratis/components/Display';
6
+ import { toastCommandResult } from '@cratis/components/Notifications';
7
+ import { AddDetails, AnswerQuestion, ConversationEntryKind, IssueConversation, IssueState } from '@cratis/showrunner.usher';
8
+ import { useMemo } from 'react';
9
+ import { useUsherLabels } from '../../Provider/UsherContext.js';
10
+ import { authorOf, ConversationMessage, conversationMessages, isOpenQuestion } from '../conversationMessages.js';
11
+
12
+ /**
13
+ * Props for {@link IssueConversationPanel}.
14
+ */
15
+ export interface IssueConversationPanelProps {
16
+ /** The issue. */
17
+ issue: IssueConversation;
18
+ }
19
+
20
+ /**
21
+ * The conversation on an issue. A message the reporter sends answers support's open question, or adds details when
22
+ * there is none. Once the reporter withdrew the issue, the composer is disabled: nothing more can be added to it.
23
+ */
24
+ export const IssueConversationPanel = ({ issue }: IssueConversationPanelProps) => {
25
+ const labels = useUsherLabels();
26
+ const [addDetails] = AddDetails.use();
27
+ const [answerQuestion] = AnswerQuestion.use();
28
+ const messages = useMemo(() => conversationMessages(issue.id, issue.entries ?? [], labels), [issue.id, issue.entries, labels]);
29
+ const openQuestionId = issue.openQuestion?.questionId;
30
+ const isWithdrawn = issue.state === IssueState.withdrawn;
31
+
32
+ const send = async (body: string) => {
33
+ if (isWithdrawn) {
34
+ return;
35
+ }
36
+
37
+ if (isOpenQuestion(openQuestionId)) {
38
+ answerQuestion.issueId = issue.id;
39
+ answerQuestion.questionId = openQuestionId;
40
+ answerQuestion.answer = body;
41
+ toastCommandResult(await answerQuestion.execute(), { showSuccess: false });
42
+ return;
43
+ }
44
+
45
+ addDetails.issueId = issue.id;
46
+ addDetails.details = body;
47
+ toastCommandResult(await addDetails.execute(), { showSuccess: false });
48
+ };
49
+
50
+ const renderMessageExtra = (message: ConversationMessage) => {
51
+ if (message.kind !== ConversationEntryKind.questionAsked) {
52
+ return undefined;
53
+ }
54
+
55
+ const isOpen = isOpenQuestion(openQuestionId) && openQuestionId.equals(message.questionId);
56
+ return (
57
+ <span className='usher-conversation__question-state'>
58
+ <Tag value={isOpen ? labels.issue.waitingForAnswer : labels.issue.answered} severity={isOpen ? 'warn' : 'success'} />
59
+ </span>
60
+ );
61
+ };
62
+
63
+ return (
64
+ <section className='usher-conversation' data-closed={isWithdrawn || undefined} aria-label={issue.title}>
65
+ <fieldset className='usher-conversation__fieldset' disabled={isWithdrawn}>
66
+ <ChatConversation<ConversationMessage>
67
+ messages={messages}
68
+ onSendMessage={body => void send(body)}
69
+ authorOf={authorId => authorOf(authorId, labels)}
70
+ renderMessageExtra={renderMessageExtra}
71
+ quickReply={false}
72
+ labels={{
73
+ empty: labels.conversation.empty,
74
+ timestamps: {
75
+ justNow: labels.conversation.justNow,
76
+ minutesAgo: labels.conversation.minutesAgo,
77
+ hoursAgo: labels.conversation.hoursAgo
78
+ },
79
+ composer: {
80
+ placeholder: isWithdrawn ? labels.issue.withdrawnPlaceholder : labels.issue.composerPlaceholder,
81
+ send: labels.conversation.send,
82
+ sendMessage: labels.conversation.send
83
+ }
84
+ }} />
85
+ </fieldset>
86
+ {isWithdrawn && <Message severity='secondary' text={labels.issue.withdrawnNotice} live={false} />}
87
+ </section>
88
+ );
89
+ };