@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 @@
1
+ {"version":3,"file":"UsherProvider.d.ts","sourceRoot":"","sources":["../../../Provider/UsherProvider.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/D,OAAO,EAAiB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAUxE,MAAM,WAAW,kBAAkB;IAE/B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAGjC,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAG7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAG5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAG7B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAOD,eAAO,MAAM,aAAa,GAAI,oIAS3B,kBAAkB,gCAwEpB,CAAC"}
@@ -0,0 +1,122 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var arc_react = require('@cratis/arc.react');
5
+ var dialogs = require('@cratis/arc.react/dialogs');
6
+ var reflection = require('@cratis/arc/reflection');
7
+ var Notifications = require('@cratis/components/Notifications');
8
+ var react = require('react');
9
+ var CorrelationTracker = require('../Correlation/CorrelationTracker.js');
10
+ var withCorrelationIdHeader = require('../Correlation/withCorrelationIdHeader.js');
11
+ var MyIssuesDialog = require('../Issues/MyIssues/MyIssuesDialog.js');
12
+ var resolveLabels = require('../Labels/resolveLabels.js');
13
+ var ReportErrorDialog = require('../Reporting/ReportErrorDialog.js');
14
+ var ReportIssueDialog = require('../Reporting/ReportIssueDialog.js');
15
+ var reportValues = require('../Reporting/reportValues.js');
16
+ var UsherContext = require('./UsherContext.js');
17
+
18
+ /**
19
+ * Slots Usher into an application: renders the report and my issues dialogs once, gives {@link useUsher} and the
20
+ * Usher buttons what they need, and tracks the correlation ids of the Arc commands and queries the application runs.
21
+ * Render it inside `<Arc>`, the `DialogComponents` registration and a `CratisComponentsProvider` with a toaster.
22
+ */ const UsherProvider = ({ applicationVersion = '', applicationName = '', shareIdentityByDefault = false, labels, locale, correlationIdCount = 5, correlationIdHeader = withCorrelationIdHeader.defaultCorrelationIdHeader, children })=>{
23
+ const arc = react.useContext(arc_react.ArcContext);
24
+ const tracker = react.useRef(undefined);
25
+ if (!tracker.current || tracker.current.capacity !== correlationIdCount) {
26
+ tracker.current = new CorrelationTracker.CorrelationTracker(correlationIdCount);
27
+ }
28
+ const correlationTracker = tracker.current;
29
+ const lastLocation = react.useRef(reflection.SliceLocation.empty);
30
+ const trackedArc = react.useMemo(()=>({
31
+ ...arc,
32
+ httpHeadersCallback: withCorrelationIdHeader.withCorrelationIdHeader(arc.httpHeadersCallback, correlationTracker, correlationIdHeader)
33
+ }), [
34
+ arc,
35
+ correlationTracker,
36
+ correlationIdHeader
37
+ ]);
38
+ const [ReportIssueDialogWrapper, showReportIssueDialog] = dialogs.useDialog(ReportIssueDialog.ReportIssueDialog);
39
+ const [ReportErrorDialogWrapper, showReportErrorDialog] = dialogs.useDialog(ReportErrorDialog.ReportErrorDialog);
40
+ const [MyIssuesDialogWrapper, showMyIssuesDialog] = dialogs.useDialog(MyIssuesDialog.MyIssuesDialog);
41
+ const resolvedLabels = react.useMemo(()=>resolveLabels.resolveLabels(labels), [
42
+ labels
43
+ ]);
44
+ const value = react.useMemo(()=>{
45
+ const reportIssue = (location)=>{
46
+ lastLocation.current = location;
47
+ void showReportIssueDialog({
48
+ location,
49
+ correlationIds: correlationTracker.correlationIds
50
+ }).then(reportSent);
51
+ };
52
+ const showIssue = (issueId)=>void showMyIssuesDialog({
53
+ issueId,
54
+ onReportIssue: ()=>reportIssue(lastLocation.current)
55
+ });
56
+ const reportSent = ([result, response])=>{
57
+ if (result !== dialogs.DialogResult.Ok || !response) {
58
+ return;
59
+ }
60
+ Notifications.toast.success({
61
+ title: resolvedLabels.reportSent.title,
62
+ action: {
63
+ children: resolvedLabels.reportSent.view,
64
+ onClick: ()=>showIssue(response.issueId)
65
+ }
66
+ });
67
+ };
68
+ return {
69
+ isProvided: true,
70
+ labels: resolvedLabels,
71
+ applicationName,
72
+ applicationVersion,
73
+ shareIdentityByDefault,
74
+ locale,
75
+ untrackedArc: arc,
76
+ recentCorrelationIds: ()=>correlationTracker.correlationIds,
77
+ trackCorrelationId: (correlationId)=>correlationTracker.track(correlationId),
78
+ reportIssue,
79
+ reportError: (error, location)=>{
80
+ lastLocation.current = location;
81
+ void showReportErrorDialog({
82
+ error: reportValues.toErrorDetails(error, location),
83
+ location,
84
+ correlationIds: correlationTracker.correlationIds
85
+ }).then(reportSent);
86
+ },
87
+ showMyIssues: (location)=>{
88
+ lastLocation.current = location;
89
+ void showMyIssuesDialog({
90
+ onReportIssue: ()=>reportIssue(location)
91
+ });
92
+ },
93
+ showIssue
94
+ };
95
+ }, [
96
+ resolvedLabels,
97
+ applicationName,
98
+ applicationVersion,
99
+ shareIdentityByDefault,
100
+ locale,
101
+ arc,
102
+ correlationTracker,
103
+ showReportIssueDialog,
104
+ showReportErrorDialog,
105
+ showMyIssuesDialog
106
+ ]);
107
+ return /*#__PURE__*/ jsxRuntime.jsxs(UsherContext.UsherContext.Provider, {
108
+ value: value,
109
+ children: [
110
+ /*#__PURE__*/ jsxRuntime.jsx(arc_react.ArcContext.Provider, {
111
+ value: trackedArc,
112
+ children: children
113
+ }),
114
+ /*#__PURE__*/ jsxRuntime.jsx(ReportIssueDialogWrapper, {}),
115
+ /*#__PURE__*/ jsxRuntime.jsx(ReportErrorDialogWrapper, {}),
116
+ /*#__PURE__*/ jsxRuntime.jsx(MyIssuesDialogWrapper, {})
117
+ ]
118
+ });
119
+ };
120
+
121
+ exports.UsherProvider = UsherProvider;
122
+ //# sourceMappingURL=UsherProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UsherProvider.js","sources":["../../../Provider/UsherProvider.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 { ArcContext } from '@cratis/arc.react';\nimport { DialogResult, useDialog } from '@cratis/arc.react/dialogs';\nimport { SliceLocation } from '@cratis/arc/reflection';\nimport { toast } from '@cratis/components/Notifications';\nimport { Guid } from '@cratis/fundamentals';\nimport { ReactNode, useContext, useMemo, useRef } from 'react';\nimport { CorrelationTracker, defaultCorrelationIdHeader, withCorrelationIdHeader } from '../Correlation/index.js';\nimport { MyIssuesDialog } from '../Issues/MyIssues/MyIssuesDialog.js';\nimport { resolveLabels, UsherLabelOverrides } from '../Labels/index.js';\nimport { ReportErrorDialog } from '../Reporting/ReportErrorDialog.js';\nimport { ReportIssueDialog } from '../Reporting/ReportIssueDialog.js';\nimport { ReportSent } from '../Reporting/ReportSent.js';\nimport { toErrorDetails } from '../Reporting/reportValues.js';\nimport { UsherContext, UsherContextValue } from './UsherContext.js';\n\n/**\n * Props for {@link UsherProvider}.\n */\nexport interface UsherProviderProps {\n /** The version of the application, sent with every report. */\n applicationVersion?: string;\n\n /** The name of the application, shown with what a report sends. */\n applicationName?: string;\n\n /** Whether the report dialogs let support know who the reporter is unless they choose otherwise. Defaults to false. */\n shareIdentityByDefault?: boolean;\n\n /** The labels that replace the English defaults, for instance to localize them. */\n labels?: UsherLabelOverrides;\n\n /** The locale to format dates and times for; the browser's when not given. */\n locale?: string;\n\n /** How many recent correlation ids of Arc commands and queries a report carries. Defaults to 5. */\n correlationIdCount?: number;\n\n /** The HTTP header the backend reads the correlation id from. Defaults to `X-Correlation-ID`, as Arc does. */\n correlationIdHeader?: string;\n\n /** The application. */\n children?: ReactNode;\n}\n\n/**\n * Slots Usher into an application: renders the report and my issues dialogs once, gives {@link useUsher} and the\n * Usher buttons what they need, and tracks the correlation ids of the Arc commands and queries the application runs.\n * Render it inside `<Arc>`, the `DialogComponents` registration and a `CratisComponentsProvider` with a toaster.\n */\nexport const UsherProvider = ({\n applicationVersion = '',\n applicationName = '',\n shareIdentityByDefault = false,\n labels,\n locale,\n correlationIdCount = 5,\n correlationIdHeader = defaultCorrelationIdHeader,\n children\n}: UsherProviderProps) => {\n const arc = useContext(ArcContext);\n const tracker = useRef<CorrelationTracker>(undefined);\n if (!tracker.current || tracker.current.capacity !== correlationIdCount) {\n tracker.current = new CorrelationTracker(correlationIdCount);\n }\n const correlationTracker = tracker.current;\n const lastLocation = useRef<SliceLocation>(SliceLocation.empty);\n\n const trackedArc = useMemo(() => ({\n ...arc,\n httpHeadersCallback: withCorrelationIdHeader(arc.httpHeadersCallback, correlationTracker, correlationIdHeader)\n }), [arc, correlationTracker, correlationIdHeader]);\n\n const [ReportIssueDialogWrapper, showReportIssueDialog] = useDialog<ReportSent, Parameters<typeof ReportIssueDialog>[0]>(ReportIssueDialog);\n const [ReportErrorDialogWrapper, showReportErrorDialog] = useDialog<ReportSent, Parameters<typeof ReportErrorDialog>[0]>(ReportErrorDialog);\n const [MyIssuesDialogWrapper, showMyIssuesDialog] = useDialog<object, Parameters<typeof MyIssuesDialog>[0]>(MyIssuesDialog);\n\n const resolvedLabels = useMemo(() => resolveLabels(labels), [labels]);\n\n const value = useMemo<UsherContextValue>(() => {\n const reportIssue = (location: SliceLocation) => {\n lastLocation.current = location;\n void showReportIssueDialog({ location, correlationIds: correlationTracker.correlationIds }).then(reportSent);\n };\n\n const showIssue = (issueId: Guid) => void showMyIssuesDialog({ issueId, onReportIssue: () => reportIssue(lastLocation.current) });\n\n const reportSent = ([result, response]: [DialogResult, ReportSent?]) => {\n if (result !== DialogResult.Ok || !response) {\n return;\n }\n\n toast.success({\n title: resolvedLabels.reportSent.title,\n action: { children: resolvedLabels.reportSent.view, onClick: () => showIssue(response.issueId) }\n });\n };\n\n return {\n isProvided: true,\n labels: resolvedLabels,\n applicationName,\n applicationVersion,\n shareIdentityByDefault,\n locale,\n untrackedArc: arc,\n recentCorrelationIds: () => correlationTracker.correlationIds,\n trackCorrelationId: correlationId => correlationTracker.track(correlationId),\n reportIssue,\n reportError: (error, location) => {\n lastLocation.current = location;\n void showReportErrorDialog({ error: toErrorDetails(error, location), location, correlationIds: correlationTracker.correlationIds }).then(reportSent);\n },\n showMyIssues: location => {\n lastLocation.current = location;\n void showMyIssuesDialog({ onReportIssue: () => reportIssue(location) });\n },\n showIssue\n };\n }, [resolvedLabels, applicationName, applicationVersion, shareIdentityByDefault, locale, arc, correlationTracker, showReportIssueDialog, showReportErrorDialog, showMyIssuesDialog]);\n\n return (\n <UsherContext.Provider value={value}>\n <ArcContext.Provider value={trackedArc}>\n {children}\n </ArcContext.Provider>\n <ReportIssueDialogWrapper />\n <ReportErrorDialogWrapper />\n <MyIssuesDialogWrapper />\n </UsherContext.Provider>\n );\n};\n"],"names":["UsherProvider","applicationVersion","applicationName","shareIdentityByDefault","labels","locale","correlationIdCount","correlationIdHeader","defaultCorrelationIdHeader","children","arc","useContext","ArcContext","tracker","useRef","undefined","current","capacity","CorrelationTracker","correlationTracker","lastLocation","SliceLocation","empty","trackedArc","useMemo","httpHeadersCallback","withCorrelationIdHeader","ReportIssueDialogWrapper","showReportIssueDialog","useDialog","ReportIssueDialog","ReportErrorDialogWrapper","showReportErrorDialog","ReportErrorDialog","MyIssuesDialogWrapper","showMyIssuesDialog","MyIssuesDialog","resolvedLabels","resolveLabels","value","reportIssue","location","correlationIds","then","reportSent","showIssue","issueId","onReportIssue","result","response","DialogResult","Ok","toast","success","title","action","view","onClick","isProvided","untrackedArc","recentCorrelationIds","trackCorrelationId","correlationId","track","reportError","error","toErrorDetails","showMyIssues","_jsxs","UsherContext","Provider","_jsx"],"mappings":"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"}
@@ -0,0 +1,5 @@
1
+ export * from './UsherBoundary.js';
2
+ export * from './UsherContext.js';
3
+ export * from './UsherProvider.js';
4
+ export * from './useUsher.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Provider/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Guid } from '@cratis/fundamentals';
2
+ import { UsherLabels } from '../Labels/index.js';
3
+ export interface Usher {
4
+ readonly labels: UsherLabels;
5
+ reportIssue(): void;
6
+ reportError(error: unknown): void;
7
+ showMyIssues(): void;
8
+ showIssue(issueId: Guid): void;
9
+ recentCorrelationIds(): Guid[];
10
+ trackCorrelationId(correlationId: Guid | string): void;
11
+ }
12
+ export declare function useUsher(): Usher;
13
+ //# sourceMappingURL=useUsher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUsher.d.ts","sourceRoot":"","sources":["../../../Provider/useUsher.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,MAAM,WAAW,KAAK;IAElB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAK7B,WAAW,IAAI,IAAI,CAAC;IAOpB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAKlC,YAAY,IAAI,IAAI,CAAC;IAMrB,SAAS,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IAM/B,oBAAoB,IAAI,IAAI,EAAE,CAAC;IAO/B,kBAAkB,CAAC,aAAa,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CAC1D;AAOD,wBAAgB,QAAQ,IAAI,KAAK,CAahC"}
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var slices = require('@cratis/arc.react/slices');
4
+ var react = require('react');
5
+ var UsherContext = require('./UsherContext.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
+ * Uses Usher from any component inside an {@link UsherProvider}. Reports carry the slice location of the component
11
+ * that calls this hook.
12
+ * @returns The {@link Usher}.
13
+ */ function useUsher() {
14
+ const context = UsherContext.useUsherContext();
15
+ const location = slices.useSliceContext();
16
+ return react.useMemo(()=>({
17
+ labels: context.labels,
18
+ reportIssue: ()=>context.reportIssue(location),
19
+ reportError: (error)=>context.reportError(error, location),
20
+ showMyIssues: ()=>context.showMyIssues(location),
21
+ showIssue: (issueId)=>context.showIssue(issueId),
22
+ recentCorrelationIds: ()=>context.recentCorrelationIds(),
23
+ trackCorrelationId: (correlationId)=>context.trackCorrelationId(correlationId)
24
+ }), [
25
+ context,
26
+ location
27
+ ]);
28
+ }
29
+
30
+ exports.useUsher = useUsher;
31
+ //# sourceMappingURL=useUsher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUsher.js","sources":["../../../Provider/useUsher.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 { useSliceContext } from '@cratis/arc.react/slices';\nimport { Guid } from '@cratis/fundamentals';\nimport { useMemo } from 'react';\nimport { UsherLabels } from '../Labels/index.js';\nimport { useUsherContext } from './UsherContext.js';\n\n/**\n * What {@link useUsher} gives a component.\n */\nexport interface Usher {\n /** The labels Usher shows. */\n readonly labels: UsherLabels;\n\n /**\n * Opens the report a problem dialog, with where in the application the component is.\n */\n reportIssue(): void;\n\n /**\n * Opens the report this error dialog.\n * @param error The error: `ErrorDetails` from `@cratis/showrunner.usher`, such as `errorDetailsFromCommandResult`\n * gives for a failed command, or anything thrown.\n */\n reportError(error: unknown): void;\n\n /**\n * Opens the my issues side sheet.\n */\n showMyIssues(): void;\n\n /**\n * Opens the my issues side sheet on one issue.\n * @param issueId The issue.\n */\n showIssue(issueId: Guid): void;\n\n /**\n * Gets the correlation ids of the last few Arc commands and queries run, oldest first.\n * @returns The correlation ids.\n */\n recentCorrelationIds(): Guid[];\n\n /**\n * Tracks the correlation id of a command or query, such as one from a `CommandResult` of a command run outside\n * the application's `<Arc>` context.\n * @param correlationId The correlation id.\n */\n trackCorrelationId(correlationId: Guid | string): void;\n}\n\n/**\n * Uses Usher from any component inside an {@link UsherProvider}. Reports carry the slice location of the component\n * that calls this hook.\n * @returns The {@link Usher}.\n */\nexport function useUsher(): Usher {\n const context = useUsherContext();\n const location = useSliceContext();\n\n return useMemo(() => ({\n labels: context.labels,\n reportIssue: () => context.reportIssue(location),\n reportError: (error: unknown) => context.reportError(error, location),\n showMyIssues: () => context.showMyIssues(location),\n showIssue: (issueId: Guid) => context.showIssue(issueId),\n recentCorrelationIds: () => context.recentCorrelationIds(),\n trackCorrelationId: (correlationId: Guid | string) => context.trackCorrelationId(correlationId)\n }), [context, location]);\n}\n"],"names":["useUsher","context","useUsherContext","location","useSliceContext","useMemo","labels","reportIssue","reportError","error","showMyIssues","showIssue","issueId","recentCorrelationIds","trackCorrelationId","correlationId"],"mappings":";;;;;;AAAA;AACA;AAoDA;;;;AAIC,IACM,SAASA,QAAAA,GAAAA;AACZ,IAAA,MAAMC,OAAAA,GAAUC,4BAAAA,EAAAA;AAChB,IAAA,MAAMC,QAAAA,GAAWC,sBAAAA,EAAAA;IAEjB,OAAOC,aAAAA,CAAQ,KAAO;AAClBC,YAAAA,MAAAA,EAAQL,QAAQK,MAAM;YACtBC,WAAAA,EAAa,IAAMN,OAAAA,CAAQM,WAAW,CAACJ,QAAAA,CAAAA;AACvCK,YAAAA,WAAAA,EAAa,CAACC,KAAAA,GAAmBR,OAAAA,CAAQO,WAAW,CAACC,KAAAA,EAAON,QAAAA,CAAAA;YAC5DO,YAAAA,EAAc,IAAMT,OAAAA,CAAQS,YAAY,CAACP,QAAAA,CAAAA;AACzCQ,YAAAA,SAAAA,EAAW,CAACC,OAAAA,GAAkBX,OAAAA,CAAQU,SAAS,CAACC,OAAAA,CAAAA;YAChDC,oBAAAA,EAAsB,IAAMZ,QAAQY,oBAAoB,EAAA;AACxDC,YAAAA,kBAAAA,EAAoB,CAACC,aAAAA,GAAiCd,OAAAA,CAAQa,kBAAkB,CAACC,aAAAA;AACrF,SAAA,CAAA,EAAI;AAACd,QAAAA,OAAAA;AAASE,QAAAA;AAAS,KAAA,CAAA;AAC3B;;"}
@@ -0,0 +1,13 @@
1
+ import { AccessDuration } from '@cratis/showrunner.usher';
2
+ export interface AccessChoice {
3
+ readonly shareIdentity: boolean;
4
+ readonly grantAccess: boolean;
5
+ readonly accessDuration: AccessDuration;
6
+ }
7
+ export declare function initialAccessChoice(shareIdentity: boolean): AccessChoice;
8
+ export declare function changeAccessChoice(choice: AccessChoice, fieldName: string, value: unknown): AccessChoice;
9
+ export declare function sharesIdentity(choice: AccessChoice): boolean;
10
+ export declare function validUntilFor(duration: AccessDuration, now: Date): Date;
11
+ export declare function formatTime(time: Date, locale?: string, timeZone?: string): string;
12
+ export declare function formatClock(time: Date, locale?: string, timeZone?: string): string;
13
+ //# sourceMappingURL=AccessChoice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessChoice.d.ts","sourceRoot":"","sources":["../../../Reporting/AccessChoice.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAK1D,MAAM,WAAW,YAAY;IAEzB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAGhC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAG9B,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CAC3C;AAOD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,OAAO,GAAG,YAAY,CAExE;AAgBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,YAAY,CAexG;AAQD,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE5D;AASD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,CAEvE;AASD,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAIjF;AASD,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAElF"}
@@ -0,0 +1,113 @@
1
+ 'use strict';
2
+
3
+ var showrunner_usher = require('@cratis/showrunner.usher');
4
+
5
+ // Copyright (c) Cratis. All rights reserved.
6
+ // Licensed under the MIT license. See LICENSE file in the project root for full license information.
7
+ /**
8
+ * Gets the choice before the reporter has chosen anything: no access, for one day once they grant it.
9
+ * @param shareIdentity Whether to let support know who the reporter is unless they choose otherwise.
10
+ * @returns The {@link AccessChoice}.
11
+ */ function initialAccessChoice(shareIdentity) {
12
+ return {
13
+ shareIdentity,
14
+ grantAccess: false,
15
+ accessDuration: showrunner_usher.AccessDuration.oneDay
16
+ };
17
+ }
18
+ const durationsInMilliseconds = {
19
+ [showrunner_usher.AccessDuration.oneHour]: 60 * 60 * 1000,
20
+ [showrunner_usher.AccessDuration.oneDay]: 24 * 60 * 60 * 1000,
21
+ [showrunner_usher.AccessDuration.sevenDays]: 7 * 24 * 60 * 60 * 1000
22
+ };
23
+ /**
24
+ * Applies a change of a command field to the access choice; changes of other fields leave it as it is. While access is
25
+ * granted, sharing who the reporter is is forced, so a change of it is not the reporter's own choice.
26
+ * @param choice The current {@link AccessChoice}.
27
+ * @param fieldName The name of the command field that changed.
28
+ * @param value Its new value.
29
+ * @returns The new {@link AccessChoice}.
30
+ */ function changeAccessChoice(choice, fieldName, value) {
31
+ if (fieldName === 'shareIdentity' && !choice.grantAccess) {
32
+ return {
33
+ ...choice,
34
+ shareIdentity: value === true
35
+ };
36
+ }
37
+ if (fieldName === 'grantAccess') {
38
+ return {
39
+ ...choice,
40
+ grantAccess: value === true
41
+ };
42
+ }
43
+ const duration = typeof value === 'string' && value.length > 0 ? Number(value) : value;
44
+ if (fieldName === 'accessDuration' && isAccessDuration(duration)) {
45
+ return {
46
+ ...choice,
47
+ accessDuration: duration
48
+ };
49
+ }
50
+ return choice;
51
+ }
52
+ /**
53
+ * Gets whether the command shares who the reporter is: always while access is granted, as granting access always
54
+ * shares who the reporter is, and otherwise as the reporter chose.
55
+ * @param choice The {@link AccessChoice}.
56
+ * @returns The value of the command's `shareIdentity`.
57
+ */ function sharesIdentity(choice) {
58
+ return choice.grantAccess || choice.shareIdentity;
59
+ }
60
+ /**
61
+ * Gets when access granted now would end. The backend fixes the end itself when it records the grant; this is what
62
+ * the reporter is told before they send.
63
+ * @param duration The {@link AccessDuration}.
64
+ * @param now What time it is.
65
+ * @returns When access would end.
66
+ */ function validUntilFor(duration, now) {
67
+ return new Date(now.getTime() + durationsInMilliseconds[duration]);
68
+ }
69
+ /**
70
+ * Formats a point in time for the access notice and the access panel, such as `27 Oct, 18:10`.
71
+ * @param time The point in time.
72
+ * @param locale The locale to format for; the browser's when not given.
73
+ * @param timeZone The time zone to format in; the browser's when not given.
74
+ * @returns The formatted point in time.
75
+ */ function formatTime(time, locale, timeZone) {
76
+ const date = new Intl.DateTimeFormat(locale, {
77
+ day: 'numeric',
78
+ month: 'short',
79
+ timeZone
80
+ }).format(time);
81
+ const clock = new Intl.DateTimeFormat(locale, {
82
+ hour: '2-digit',
83
+ minute: '2-digit',
84
+ hourCycle: 'h23',
85
+ timeZone
86
+ }).format(time);
87
+ return `${date}, ${clock}`;
88
+ }
89
+ /**
90
+ * Formats the time of day only, such as `18:10`.
91
+ * @param time The point in time.
92
+ * @param locale The locale to format for; the browser's when not given.
93
+ * @param timeZone The time zone to format in; the browser's when not given.
94
+ * @returns The formatted time of day.
95
+ */ function formatClock(time, locale, timeZone) {
96
+ return new Intl.DateTimeFormat(locale, {
97
+ hour: '2-digit',
98
+ minute: '2-digit',
99
+ hourCycle: 'h23',
100
+ timeZone
101
+ }).format(time);
102
+ }
103
+ function isAccessDuration(value) {
104
+ return typeof value === 'number' && Object.hasOwn(durationsInMilliseconds, value);
105
+ }
106
+
107
+ exports.changeAccessChoice = changeAccessChoice;
108
+ exports.formatClock = formatClock;
109
+ exports.formatTime = formatTime;
110
+ exports.initialAccessChoice = initialAccessChoice;
111
+ exports.sharesIdentity = sharesIdentity;
112
+ exports.validUntilFor = validUntilFor;
113
+ //# sourceMappingURL=AccessChoice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessChoice.js","sources":["../../../Reporting/AccessChoice.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 { AccessDuration } from '@cratis/showrunner.usher';\n\n/**\n * What the reporter chose about letting support sign in as them.\n */\nexport interface AccessChoice {\n /** Whether the reporter chose to let support know who they are, apart from granting access. */\n readonly shareIdentity: boolean;\n\n /** Whether the reporter lets support sign in as them. */\n readonly grantAccess: boolean;\n\n /** For how long. */\n readonly accessDuration: AccessDuration;\n}\n\n/**\n * Gets the choice before the reporter has chosen anything: no access, for one day once they grant it.\n * @param shareIdentity Whether to let support know who the reporter is unless they choose otherwise.\n * @returns The {@link AccessChoice}.\n */\nexport function initialAccessChoice(shareIdentity: boolean): AccessChoice {\n return { shareIdentity, grantAccess: false, accessDuration: AccessDuration.oneDay };\n}\n\nconst durationsInMilliseconds: Record<AccessDuration, number> = {\n [AccessDuration.oneHour]: 60 * 60 * 1000,\n [AccessDuration.oneDay]: 24 * 60 * 60 * 1000,\n [AccessDuration.sevenDays]: 7 * 24 * 60 * 60 * 1000\n};\n\n/**\n * Applies a change of a command field to the access choice; changes of other fields leave it as it is. While access is\n * granted, sharing who the reporter is is forced, so a change of it is not the reporter's own choice.\n * @param choice The current {@link AccessChoice}.\n * @param fieldName The name of the command field that changed.\n * @param value Its new value.\n * @returns The new {@link AccessChoice}.\n */\nexport function changeAccessChoice(choice: AccessChoice, fieldName: string, value: unknown): AccessChoice {\n if (fieldName === 'shareIdentity' && !choice.grantAccess) {\n return { ...choice, shareIdentity: value === true };\n }\n\n if (fieldName === 'grantAccess') {\n return { ...choice, grantAccess: value === true };\n }\n\n const duration = typeof value === 'string' && value.length > 0 ? Number(value) : value;\n if (fieldName === 'accessDuration' && isAccessDuration(duration)) {\n return { ...choice, accessDuration: duration };\n }\n\n return choice;\n}\n\n/**\n * Gets whether the command shares who the reporter is: always while access is granted, as granting access always\n * shares who the reporter is, and otherwise as the reporter chose.\n * @param choice The {@link AccessChoice}.\n * @returns The value of the command's `shareIdentity`.\n */\nexport function sharesIdentity(choice: AccessChoice): boolean {\n return choice.grantAccess || choice.shareIdentity;\n}\n\n/**\n * Gets when access granted now would end. The backend fixes the end itself when it records the grant; this is what\n * the reporter is told before they send.\n * @param duration The {@link AccessDuration}.\n * @param now What time it is.\n * @returns When access would end.\n */\nexport function validUntilFor(duration: AccessDuration, now: Date): Date {\n return new Date(now.getTime() + durationsInMilliseconds[duration]);\n}\n\n/**\n * Formats a point in time for the access notice and the access panel, such as `27 Oct, 18:10`.\n * @param time The point in time.\n * @param locale The locale to format for; the browser's when not given.\n * @param timeZone The time zone to format in; the browser's when not given.\n * @returns The formatted point in time.\n */\nexport function formatTime(time: Date, locale?: string, timeZone?: string): string {\n const date = new Intl.DateTimeFormat(locale, { day: 'numeric', month: 'short', timeZone }).format(time);\n const clock = new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23', timeZone }).format(time);\n return `${date}, ${clock}`;\n}\n\n/**\n * Formats the time of day only, such as `18:10`.\n * @param time The point in time.\n * @param locale The locale to format for; the browser's when not given.\n * @param timeZone The time zone to format in; the browser's when not given.\n * @returns The formatted time of day.\n */\nexport function formatClock(time: Date, locale?: string, timeZone?: string): string {\n return new Intl.DateTimeFormat(locale, { hour: '2-digit', minute: '2-digit', hourCycle: 'h23', timeZone }).format(time);\n}\n\nfunction isAccessDuration(value: unknown): value is AccessDuration {\n return typeof value === 'number' && Object.hasOwn(durationsInMilliseconds, value);\n}\n"],"names":["initialAccessChoice","shareIdentity","grantAccess","accessDuration","AccessDuration","oneDay","durationsInMilliseconds","oneHour","sevenDays","changeAccessChoice","choice","fieldName","value","duration","length","Number","isAccessDuration","sharesIdentity","validUntilFor","now","Date","getTime","formatTime","time","locale","timeZone","date","Intl","DateTimeFormat","day","month","format","clock","hour","minute","hourCycle","formatClock","Object","hasOwn"],"mappings":"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"}
@@ -0,0 +1,12 @@
1
+ import { AccessDuration } from '@cratis/showrunner.usher';
2
+ import { AccessChoice } from './AccessChoice.js';
3
+ export interface IdentityAndAccess {
4
+ shareIdentity: boolean;
5
+ grantAccess: boolean;
6
+ accessDuration: AccessDuration;
7
+ }
8
+ export interface AccessFieldsProps {
9
+ choice: AccessChoice;
10
+ }
11
+ export declare const AccessFields: <TCommand extends IdentityAndAccess>({ choice }: AccessFieldsProps) => import("react").JSX.Element;
12
+ //# sourceMappingURL=AccessFields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessFields.d.ts","sourceRoot":"","sources":["../../../Reporting/AccessFields.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,MAAM,WAAW,iBAAiB;IAE9B,aAAa,EAAE,OAAO,CAAC;IAEvB,WAAW,EAAE,OAAO,CAAC;IAErB,cAAc,EAAE,cAAc,CAAC;CAClC;AAKD,MAAM,WAAW,iBAAiB;IAE9B,MAAM,EAAE,YAAY,CAAC;CACxB;AAOD,eAAO,MAAM,YAAY,GAAI,QAAQ,SAAS,iBAAiB,EAAE,YAAY,iBAAiB,gCAqC7F,CAAC"}
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var CommandForm = require('@cratis/components/CommandForm');
5
+ var react = require('react');
6
+ var UsherContext = require('../Provider/UsherContext.js');
7
+ var AccessNotice = require('./AccessNotice.js');
8
+ var durationOptions = require('./durationOptions.js');
9
+
10
+ /**
11
+ * The identity and access choices of a report: let support know who the reporter is, and let support sign in as
12
+ * them for a while. Granting access always shares who the reporter is, so the checkbox is checked and disabled while
13
+ * access is granted, and the notice says until when support can act as the reporter.
14
+ */ const AccessFields = ({ choice })=>{
15
+ const labels = UsherContext.useUsherLabels();
16
+ const shareDescriptionId = react.useId();
17
+ const grantDescriptionId = react.useId();
18
+ const noticeId = react.useId();
19
+ return /*#__PURE__*/ jsxRuntime.jsxs("div", {
20
+ className: "usher-access-fields",
21
+ children: [
22
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
23
+ className: "usher-access-fields__choice",
24
+ children: [
25
+ /*#__PURE__*/ jsxRuntime.jsx(CommandForm.CheckboxField, {
26
+ value: (command)=>command.shareIdentity,
27
+ label: labels.access.shareIdentity,
28
+ "aria-describedby": choice.grantAccess ? `${shareDescriptionId} ${noticeId}` : shareDescriptionId,
29
+ pt: {
30
+ input: {
31
+ disabled: choice.grantAccess
32
+ }
33
+ }
34
+ }),
35
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
36
+ id: shareDescriptionId,
37
+ className: "usher-access-fields__description",
38
+ children: labels.access.shareIdentityDescription
39
+ })
40
+ ]
41
+ }),
42
+ /*#__PURE__*/ jsxRuntime.jsxs("div", {
43
+ className: "usher-access-fields__choice",
44
+ children: [
45
+ /*#__PURE__*/ jsxRuntime.jsx(CommandForm.ToggleSwitchField, {
46
+ value: (command)=>command.grantAccess,
47
+ label: labels.access.grantAccess,
48
+ "aria-describedby": grantDescriptionId
49
+ }),
50
+ /*#__PURE__*/ jsxRuntime.jsx("p", {
51
+ id: grantDescriptionId,
52
+ className: "usher-access-fields__description",
53
+ children: labels.access.grantAccessDescription
54
+ })
55
+ ]
56
+ }),
57
+ choice.grantAccess && /*#__PURE__*/ jsxRuntime.jsxs("div", {
58
+ className: "usher-access-fields__duration",
59
+ children: [
60
+ /*#__PURE__*/ jsxRuntime.jsx(CommandForm.DropdownField, {
61
+ value: (command)=>command.accessDuration,
62
+ title: labels.access.duration,
63
+ "aria-describedby": noticeId,
64
+ options: durationOptions.durationOptions(labels),
65
+ optionValue: "value",
66
+ optionLabel: "label"
67
+ }),
68
+ /*#__PURE__*/ jsxRuntime.jsx(AccessNotice.AccessNotice, {
69
+ id: noticeId,
70
+ duration: choice.accessDuration
71
+ })
72
+ ]
73
+ })
74
+ ]
75
+ });
76
+ };
77
+
78
+ exports.AccessFields = AccessFields;
79
+ //# sourceMappingURL=AccessFields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessFields.js","sources":["../../../Reporting/AccessFields.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 { CheckboxField, DropdownField, ToggleSwitchField } from '@cratis/components/CommandForm';\nimport { AccessDuration } from '@cratis/showrunner.usher';\nimport { useId } from 'react';\nimport { useUsherLabels } from '../Provider/UsherContext.js';\nimport { AccessChoice } from './AccessChoice.js';\nimport { AccessNotice } from './AccessNotice.js';\nimport { durationOptions } from './durationOptions.js';\n\n/**\n * The command values {@link AccessFields} bind to.\n */\nexport interface IdentityAndAccess {\n /** Whether to let support know who the reporter is. */\n shareIdentity: boolean;\n /** Whether to let support sign in as the reporter. */\n grantAccess: boolean;\n /** For how long. */\n accessDuration: AccessDuration;\n}\n\n/**\n * Props for {@link AccessFields}.\n */\nexport interface AccessFieldsProps {\n /** The reporter's {@link AccessChoice}, as the form follows it. */\n choice: AccessChoice;\n}\n\n/**\n * The identity and access choices of a report: let support know who the reporter is, and let support sign in as\n * them for a while. Granting access always shares who the reporter is, so the checkbox is checked and disabled while\n * access is granted, and the notice says until when support can act as the reporter.\n */\nexport const AccessFields = <TCommand extends IdentityAndAccess>({ choice }: AccessFieldsProps) => {\n const labels = useUsherLabels();\n const shareDescriptionId = useId();\n const grantDescriptionId = useId();\n const noticeId = useId();\n\n return (\n <div className='usher-access-fields'>\n <div className='usher-access-fields__choice'>\n <CheckboxField<TCommand>\n value={command => command.shareIdentity}\n label={labels.access.shareIdentity}\n aria-describedby={choice.grantAccess ? `${shareDescriptionId} ${noticeId}` : shareDescriptionId}\n pt={{ input: { disabled: choice.grantAccess } }} />\n <p id={shareDescriptionId} className='usher-access-fields__description'>{labels.access.shareIdentityDescription}</p>\n </div>\n <div className='usher-access-fields__choice'>\n <ToggleSwitchField<TCommand>\n value={command => command.grantAccess}\n label={labels.access.grantAccess}\n aria-describedby={grantDescriptionId} />\n <p id={grantDescriptionId} className='usher-access-fields__description'>{labels.access.grantAccessDescription}</p>\n </div>\n {choice.grantAccess && (\n <div className='usher-access-fields__duration'>\n <DropdownField<TCommand>\n value={command => command.accessDuration}\n title={labels.access.duration}\n aria-describedby={noticeId}\n options={durationOptions(labels)}\n optionValue='value'\n optionLabel='label' />\n <AccessNotice id={noticeId} duration={choice.accessDuration} />\n </div>\n )}\n </div>\n );\n};\n"],"names":["AccessFields","choice","labels","useUsherLabels","shareDescriptionId","useId","grantDescriptionId","noticeId","_jsxs","div","className","_jsx","CheckboxField","value","command","shareIdentity","label","access","aria-describedby","grantAccess","pt","input","disabled","p","id","shareIdentityDescription","ToggleSwitchField","grantAccessDescription","DropdownField","accessDuration","title","duration","options","durationOptions","optionValue","optionLabel","AccessNotice"],"mappings":";;;;;;;;;AA+BA;;;;AAIC,IACM,MAAMA,YAAAA,GAAe,CAAqC,EAAEC,MAAM,EAAqB,GAAA;AAC1F,IAAA,MAAMC,MAAAA,GAASC,2BAAAA,EAAAA;AACf,IAAA,MAAMC,kBAAAA,GAAqBC,WAAAA,EAAAA;AAC3B,IAAA,MAAMC,kBAAAA,GAAqBD,WAAAA,EAAAA;AAC3B,IAAA,MAAME,QAAAA,GAAWF,WAAAA,EAAAA;AAEjB,IAAA,qBACIG,eAAA,CAACC,KAAAA,EAAAA;QAAIC,SAAAA,EAAU,qBAAA;;0BACXF,eAAA,CAACC,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,6BAAA;;kCACXC,cAAA,CAACC,yBAAAA,EAAAA;wBACGC,KAAAA,EAAOC,CAAAA,OAAAA,GAAWA,OAAAA,CAAQC,aAAa;wBACvCC,KAAAA,EAAOd,MAAAA,CAAOe,MAAM,CAACF,aAAa;wBAClCG,kBAAAA,EAAkBjB,MAAAA,CAAOkB,WAAW,GAAG,CAAA,EAAGf,mBAAmB,CAAC,EAAEG,UAAU,GAAGH,kBAAAA;wBAC7EgB,EAAAA,EAAI;4BAAEC,KAAAA,EAAO;AAAEC,gCAAAA,QAAAA,EAAUrB,OAAOkB;AAAY;AAAE;;kCAClDR,cAAA,CAACY,GAAAA,EAAAA;wBAAEC,EAAAA,EAAIpB,kBAAAA;wBAAoBM,SAAAA,EAAU,kCAAA;kCAAoCR,MAAAA,CAAOe,MAAM,CAACQ;;;;0BAE3FjB,eAAA,CAACC,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,6BAAA;;kCACXC,cAAA,CAACe,6BAAAA,EAAAA;wBACGb,KAAAA,EAAOC,CAAAA,OAAAA,GAAWA,OAAAA,CAAQK,WAAW;wBACrCH,KAAAA,EAAOd,MAAAA,CAAOe,MAAM,CAACE,WAAW;wBAChCD,kBAAAA,EAAkBZ;;kCACtBK,cAAA,CAACY,GAAAA,EAAAA;wBAAEC,EAAAA,EAAIlB,kBAAAA;wBAAoBI,SAAAA,EAAU,kCAAA;kCAAoCR,MAAAA,CAAOe,MAAM,CAACU;;;;YAE1F1B,MAAAA,CAAOkB,WAAW,kBACfX,eAAA,CAACC,KAAAA,EAAAA;gBAAIC,SAAAA,EAAU,+BAAA;;kCACXC,cAAA,CAACiB,yBAAAA,EAAAA;wBACGf,KAAAA,EAAOC,CAAAA,OAAAA,GAAWA,OAAAA,CAAQe,cAAc;wBACxCC,KAAAA,EAAO5B,MAAAA,CAAOe,MAAM,CAACc,QAAQ;wBAC7Bb,kBAAAA,EAAkBX,QAAAA;AAClByB,wBAAAA,OAAAA,EAASC,+BAAAA,CAAgB/B,MAAAA,CAAAA;wBACzBgC,WAAAA,EAAY,OAAA;wBACZC,WAAAA,EAAY;;kCAChBxB,cAAA,CAACyB,yBAAAA,EAAAA;wBAAaZ,EAAAA,EAAIjB,QAAAA;AAAUwB,wBAAAA,QAAAA,EAAU9B,OAAO4B;;;;;;AAKjE;;"}
@@ -0,0 +1,7 @@
1
+ import { AccessDuration } from '@cratis/showrunner.usher';
2
+ export interface AccessNoticeProps {
3
+ id: string;
4
+ duration: AccessDuration;
5
+ }
6
+ export declare const AccessNotice: ({ id, duration }: AccessNoticeProps) => import("react").JSX.Element;
7
+ //# sourceMappingURL=AccessNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessNotice.d.ts","sourceRoot":"","sources":["../../../Reporting/AccessNotice.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAQ1D,MAAM,WAAW,iBAAiB;IAE9B,EAAE,EAAE,MAAM,CAAC;IAGX,QAAQ,EAAE,cAAc,CAAC;CAC5B;AAKD,eAAO,MAAM,YAAY,GAAI,kBAAkB,iBAAiB,gCAS/D,CAAC"}
@@ -0,0 +1,28 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var Display = require('@cratis/components/Display');
5
+ var format = require('../Labels/format.js');
6
+ var UsherContext = require('../Provider/UsherContext.js');
7
+ var AccessChoice = require('./AccessChoice.js');
8
+
9
+ /**
10
+ * States plainly what granting access means: support sees who the reporter is and can act as them until a given time.
11
+ */ const AccessNotice = ({ id, duration })=>{
12
+ const { labels, locale } = UsherContext.useUsherContext();
13
+ const time = AccessChoice.formatTime(AccessChoice.validUntilFor(duration, new Date()), locale);
14
+ return /*#__PURE__*/ jsxRuntime.jsx("div", {
15
+ id: id,
16
+ className: "usher-access-notice",
17
+ children: /*#__PURE__*/ jsxRuntime.jsx(Display.Message, {
18
+ severity: "info",
19
+ live: false,
20
+ text: format.format(labels.access.notice, {
21
+ time
22
+ })
23
+ })
24
+ });
25
+ };
26
+
27
+ exports.AccessNotice = AccessNotice;
28
+ //# sourceMappingURL=AccessNotice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AccessNotice.js","sources":["../../../Reporting/AccessNotice.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 { Message } from '@cratis/components/Display';\nimport { AccessDuration } from '@cratis/showrunner.usher';\nimport { format } from '../Labels/index.js';\nimport { useUsherContext } from '../Provider/UsherContext.js';\nimport { formatTime, validUntilFor } from './AccessChoice.js';\n\n/**\n * Props for {@link AccessNotice}.\n */\nexport interface AccessNoticeProps {\n /** The id of the notice, for the controls it describes. */\n id: string;\n\n /** For how long access would be granted. */\n duration: AccessDuration;\n}\n\n/**\n * States plainly what granting access means: support sees who the reporter is and can act as them until a given time.\n */\nexport const AccessNotice = ({ id, duration }: AccessNoticeProps) => {\n const { labels, locale } = useUsherContext();\n const time = formatTime(validUntilFor(duration, new Date()), locale);\n\n return (\n <div id={id} className='usher-access-notice'>\n <Message severity='info' live={false} text={format(labels.access.notice, { time })} />\n </div>\n );\n};\n"],"names":["AccessNotice","id","duration","labels","locale","useUsherContext","time","formatTime","validUntilFor","Date","_jsx","div","className","Message","severity","live","text","format","access","notice"],"mappings":";;;;;;;;AAoBA;;UAGaA,YAAAA,GAAe,CAAC,EAAEC,EAAE,EAAEC,QAAQ,EAAqB,GAAA;AAC5D,IAAA,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGC,4BAAAA,EAAAA;AAC3B,IAAA,MAAMC,IAAAA,GAAOC,uBAAAA,CAAWC,0BAAAA,CAAcN,QAAAA,EAAU,IAAIO,IAAAA,EAAAA,CAAAA,EAASL,MAAAA,CAAAA;AAE7D,IAAA,qBACIM,cAAA,CAACC,KAAAA,EAAAA;QAAIV,EAAAA,EAAIA,EAAAA;QAAIW,SAAAA,EAAU,qBAAA;AACnB,QAAA,QAAA,gBAAAF,cAAA,CAACG,eAAAA,EAAAA;YAAQC,QAAAA,EAAS,MAAA;YAAOC,IAAAA,EAAM,KAAA;AAAOC,YAAAA,IAAAA,EAAMC,aAAAA,CAAOd,MAAAA,CAAOe,MAAM,CAACC,MAAM,EAAE;AAAEb,gBAAAA;AAAK,aAAA;;;AAG5F;;"}
@@ -0,0 +1,9 @@
1
+ import { SliceLocation as ArcSliceLocation } from '@cratis/arc/reflection';
2
+ import { Guid } from '@cratis/fundamentals';
3
+ export interface ReportErrorDialogProps {
4
+ error?: unknown;
5
+ location?: ArcSliceLocation;
6
+ correlationIds?: Guid[];
7
+ }
8
+ export declare const ReportErrorDialog: ({ error, location, correlationIds }: ReportErrorDialogProps) => import("react").JSX.Element;
9
+ //# sourceMappingURL=ReportErrorDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReportErrorDialog.d.ts","sourceRoot":"","sources":["../../../Reporting/ReportErrorDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAI3E,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAe5C,MAAM,WAAW,sBAAsB;IAEnC,KAAK,CAAC,EAAE,OAAO,CAAC;IAGhB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAG5B,cAAc,CAAC,EAAE,IAAI,EAAE,CAAC;CAC3B;AAOD,eAAO,MAAM,iBAAiB,GAAI,qCAAqC,sBAAsB,gCAgB5F,CAAC"}