@cratis/showrunner.usher.react 0.0.0-bootstrap.0 → 0.0.0-stage
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -71
- package/package.json +4 -83
- package/Buttons/MyIssuesButton.tsx +0 -78
- package/Buttons/ReportButton.tsx +0 -51
- package/Buttons/buttonModels.ts +0 -55
- package/Buttons/index.ts +0 -6
- package/Correlation/CorrelationTracker.ts +0 -51
- package/Correlation/index.ts +0 -5
- package/Correlation/withCorrelationIdHeader.ts +0 -44
- package/Icons.tsx +0 -29
- package/Issues/IssueView/AccessPanel.tsx +0 -85
- package/Issues/IssueView/GrantAccessDialog.tsx +0 -56
- package/Issues/IssueView/IdentityPanel.tsx +0 -38
- package/Issues/IssueView/IssueActions.tsx +0 -52
- package/Issues/IssueView/IssueConversationPanel.tsx +0 -89
- package/Issues/IssueView/IssueHeader.tsx +0 -69
- package/Issues/IssueView/IssueView.tsx +0 -74
- package/Issues/IssueView/QuestionBanner.tsx +0 -27
- package/Issues/IssueView/ReopenIssueDialog.tsx +0 -37
- package/Issues/IssueView/ShareIdentityDialog.tsx +0 -37
- package/Issues/IssueView/StatusStrip.tsx +0 -42
- package/Issues/IssueView/SupportSessions.tsx +0 -59
- package/Issues/IssueView/index.ts +0 -15
- package/Issues/MyIssues/IssueList.tsx +0 -78
- package/Issues/MyIssues/MyIssuesDialog.tsx +0 -64
- package/Issues/MyIssues/MyIssuesNavigation.ts +0 -61
- package/Issues/MyIssues/index.ts +0 -6
- package/Issues/MyIssuesList.ts +0 -33
- package/Issues/accessStatus.ts +0 -68
- package/Issues/conversationMessages.ts +0 -136
- package/Issues/index.ts +0 -12
- package/Issues/issueStates.ts +0 -69
- package/Issues/sessionActivity.ts +0 -43
- package/Issues/useAccessStatus.ts +0 -24
- package/Issues/webAddress.ts +0 -22
- package/Labels/UsherLabels.ts +0 -365
- package/Labels/defaultUsherLabels.ts +0 -178
- package/Labels/format.ts +0 -13
- package/Labels/index.ts +0 -7
- package/Labels/resolveLabels.ts +0 -36
- package/Provider/UsherBoundary.tsx +0 -30
- package/Provider/UsherContext.ts +0 -109
- package/Provider/UsherProvider.tsx +0 -134
- package/Provider/index.ts +0 -7
- package/Provider/useUsher.ts +0 -72
- package/Reporting/AccessChoice.ts +0 -107
- package/Reporting/AccessFields.tsx +0 -74
- package/Reporting/AccessNotice.tsx +0 -33
- package/Reporting/ReportErrorDialog.tsx +0 -94
- package/Reporting/ReportIssueDialog.tsx +0 -80
- package/Reporting/ReportLimits.ts +0 -24
- package/Reporting/ReportSent.ts +0 -12
- package/Reporting/SentWithReport.tsx +0 -37
- package/Reporting/TechnicalDetails.tsx +0 -60
- package/Reporting/durationOptions.ts +0 -31
- package/Reporting/formatLocation.ts +0 -27
- package/Reporting/index.ts +0 -16
- package/Reporting/reportValues.ts +0 -150
- package/Reporting/useAccessChoice.ts +0 -53
- package/dist/cjs/Buttons/MyIssuesButton.d.ts +0 -14
- package/dist/cjs/Buttons/MyIssuesButton.d.ts.map +0 -1
- package/dist/cjs/Buttons/MyIssuesButton.js +0 -76
- package/dist/cjs/Buttons/MyIssuesButton.js.map +0 -1
- package/dist/cjs/Buttons/ReportButton.d.ts +0 -8
- package/dist/cjs/Buttons/ReportButton.d.ts.map +0 -1
- package/dist/cjs/Buttons/ReportButton.js +0 -34
- package/dist/cjs/Buttons/ReportButton.js.map +0 -1
- package/dist/cjs/Buttons/buttonModels.d.ts +0 -10
- package/dist/cjs/Buttons/buttonModels.d.ts.map +0 -1
- package/dist/cjs/Buttons/buttonModels.js +0 -44
- package/dist/cjs/Buttons/buttonModels.js.map +0 -1
- package/dist/cjs/Buttons/index.d.ts +0 -4
- package/dist/cjs/Buttons/index.d.ts.map +0 -1
- package/dist/cjs/Correlation/CorrelationTracker.d.ts +0 -10
- package/dist/cjs/Correlation/CorrelationTracker.d.ts.map +0 -1
- package/dist/cjs/Correlation/CorrelationTracker.js +0 -50
- package/dist/cjs/Correlation/CorrelationTracker.js.map +0 -1
- package/dist/cjs/Correlation/index.d.ts +0 -3
- package/dist/cjs/Correlation/index.d.ts.map +0 -1
- package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts +0 -6
- package/dist/cjs/Correlation/withCorrelationIdHeader.d.ts.map +0 -1
- package/dist/cjs/Correlation/withCorrelationIdHeader.js +0 -39
- package/dist/cjs/Correlation/withCorrelationIdHeader.js.map +0 -1
- package/dist/cjs/Icons.d.ts +0 -4
- package/dist/cjs/Icons.d.ts.map +0 -1
- package/dist/cjs/Icons.js +0 -53
- package/dist/cjs/Icons.js.map +0 -1
- package/dist/cjs/Issues/IssueView/AccessPanel.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/AccessPanel.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/AccessPanel.js +0 -124
- package/dist/cjs/Issues/IssueView/AccessPanel.js.map +0 -1
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.js +0 -56
- package/dist/cjs/Issues/IssueView/GrantAccessDialog.js.map +0 -1
- package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/IdentityPanel.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/IdentityPanel.js +0 -45
- package/dist/cjs/Issues/IssueView/IdentityPanel.js.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueActions.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/IssueActions.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueActions.js +0 -58
- package/dist/cjs/Issues/IssueView/IssueActions.js.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.js +0 -97
- package/dist/cjs/Issues/IssueView/IssueConversationPanel.js.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueHeader.d.ts +0 -7
- package/dist/cjs/Issues/IssueView/IssueHeader.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueHeader.js +0 -94
- package/dist/cjs/Issues/IssueView/IssueHeader.js.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueView.d.ts +0 -7
- package/dist/cjs/Issues/IssueView/IssueView.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/IssueView.js +0 -85
- package/dist/cjs/Issues/IssueView/IssueView.js.map +0 -1
- package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts +0 -5
- package/dist/cjs/Issues/IssueView/QuestionBanner.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/QuestionBanner.js +0 -24
- package/dist/cjs/Issues/IssueView/QuestionBanner.js.map +0 -1
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js +0 -34
- package/dist/cjs/Issues/IssueView/ReopenIssueDialog.js.map +0 -1
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js +0 -32
- package/dist/cjs/Issues/IssueView/ShareIdentityDialog.js.map +0 -1
- package/dist/cjs/Issues/IssueView/StatusStrip.d.ts +0 -6
- package/dist/cjs/Issues/IssueView/StatusStrip.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/StatusStrip.js +0 -31
- package/dist/cjs/Issues/IssueView/StatusStrip.js.map +0 -1
- package/dist/cjs/Issues/IssueView/SupportSessions.d.ts +0 -7
- package/dist/cjs/Issues/IssueView/SupportSessions.d.ts.map +0 -1
- package/dist/cjs/Issues/IssueView/SupportSessions.js +0 -62
- package/dist/cjs/Issues/IssueView/SupportSessions.js.map +0 -1
- package/dist/cjs/Issues/IssueView/index.d.ts +0 -13
- package/dist/cjs/Issues/IssueView/index.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssues/IssueList.d.ts +0 -7
- package/dist/cjs/Issues/MyIssues/IssueList.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssues/IssueList.js +0 -92
- package/dist/cjs/Issues/MyIssues/IssueList.js.map +0 -1
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts +0 -7
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js +0 -79
- package/dist/cjs/Issues/MyIssues/MyIssuesDialog.js.map +0 -1
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts +0 -21
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js +0 -52
- package/dist/cjs/Issues/MyIssues/MyIssuesNavigation.js.map +0 -1
- package/dist/cjs/Issues/MyIssues/index.d.ts +0 -4
- package/dist/cjs/Issues/MyIssues/index.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssuesList.d.ts +0 -7
- package/dist/cjs/Issues/MyIssuesList.d.ts.map +0 -1
- package/dist/cjs/Issues/MyIssuesList.js +0 -33
- package/dist/cjs/Issues/MyIssuesList.js.map +0 -1
- package/dist/cjs/Issues/accessStatus.d.ts +0 -13
- package/dist/cjs/Issues/accessStatus.d.ts.map +0 -1
- package/dist/cjs/Issues/accessStatus.js +0 -60
- package/dist/cjs/Issues/accessStatus.js.map +0 -1
- package/dist/cjs/Issues/conversationMessages.d.ts +0 -14
- package/dist/cjs/Issues/conversationMessages.d.ts.map +0 -1
- package/dist/cjs/Issues/conversationMessages.js +0 -131
- package/dist/cjs/Issues/conversationMessages.js.map +0 -1
- package/dist/cjs/Issues/index.d.ts +0 -10
- package/dist/cjs/Issues/index.d.ts.map +0 -1
- package/dist/cjs/Issues/issueStates.d.ts +0 -12
- package/dist/cjs/Issues/issueStates.d.ts.map +0 -1
- package/dist/cjs/Issues/issueStates.js +0 -86
- package/dist/cjs/Issues/issueStates.js.map +0 -1
- package/dist/cjs/Issues/sessionActivity.d.ts +0 -8
- package/dist/cjs/Issues/sessionActivity.d.ts.map +0 -1
- package/dist/cjs/Issues/sessionActivity.js +0 -39
- package/dist/cjs/Issues/sessionActivity.js.map +0 -1
- package/dist/cjs/Issues/useAccessStatus.d.ts +0 -4
- package/dist/cjs/Issues/useAccessStatus.d.ts.map +0 -1
- package/dist/cjs/Issues/useAccessStatus.js +0 -30
- package/dist/cjs/Issues/useAccessStatus.js.map +0 -1
- package/dist/cjs/Issues/webAddress.d.ts +0 -2
- package/dist/cjs/Issues/webAddress.d.ts.map +0 -1
- package/dist/cjs/Issues/webAddress.js +0 -24
- package/dist/cjs/Issues/webAddress.js.map +0 -1
- package/dist/cjs/Labels/UsherLabels.d.ts +0 -177
- package/dist/cjs/Labels/UsherLabels.d.ts.map +0 -1
- package/dist/cjs/Labels/defaultUsherLabels.d.ts +0 -3
- package/dist/cjs/Labels/defaultUsherLabels.d.ts.map +0 -1
- package/dist/cjs/Labels/defaultUsherLabels.js +0 -179
- package/dist/cjs/Labels/defaultUsherLabels.js.map +0 -1
- package/dist/cjs/Labels/format.d.ts +0 -2
- package/dist/cjs/Labels/format.d.ts.map +0 -1
- package/dist/cjs/Labels/format.js +0 -15
- package/dist/cjs/Labels/format.js.map +0 -1
- package/dist/cjs/Labels/index.d.ts +0 -5
- package/dist/cjs/Labels/index.d.ts.map +0 -1
- package/dist/cjs/Labels/resolveLabels.d.ts +0 -3
- package/dist/cjs/Labels/resolveLabels.d.ts.map +0 -1
- package/dist/cjs/Labels/resolveLabels.js +0 -35
- package/dist/cjs/Labels/resolveLabels.js.map +0 -1
- package/dist/cjs/Provider/UsherBoundary.d.ts +0 -6
- package/dist/cjs/Provider/UsherBoundary.d.ts.map +0 -1
- package/dist/cjs/Provider/UsherBoundary.js +0 -24
- package/dist/cjs/Provider/UsherBoundary.js.map +0 -1
- package/dist/cjs/Provider/UsherContext.d.ts +0 -24
- package/dist/cjs/Provider/UsherContext.d.ts.map +0 -1
- package/dist/cjs/Provider/UsherContext.js +0 -41
- package/dist/cjs/Provider/UsherContext.js.map +0 -1
- package/dist/cjs/Provider/UsherProvider.d.ts +0 -14
- package/dist/cjs/Provider/UsherProvider.d.ts.map +0 -1
- package/dist/cjs/Provider/UsherProvider.js +0 -122
- package/dist/cjs/Provider/UsherProvider.js.map +0 -1
- package/dist/cjs/Provider/index.d.ts +0 -5
- package/dist/cjs/Provider/index.d.ts.map +0 -1
- package/dist/cjs/Provider/useUsher.d.ts +0 -13
- package/dist/cjs/Provider/useUsher.d.ts.map +0 -1
- package/dist/cjs/Provider/useUsher.js +0 -31
- package/dist/cjs/Provider/useUsher.js.map +0 -1
- package/dist/cjs/Reporting/AccessChoice.d.ts +0 -13
- package/dist/cjs/Reporting/AccessChoice.d.ts.map +0 -1
- package/dist/cjs/Reporting/AccessChoice.js +0 -113
- package/dist/cjs/Reporting/AccessChoice.js.map +0 -1
- package/dist/cjs/Reporting/AccessFields.d.ts +0 -12
- package/dist/cjs/Reporting/AccessFields.d.ts.map +0 -1
- package/dist/cjs/Reporting/AccessFields.js +0 -79
- package/dist/cjs/Reporting/AccessFields.js.map +0 -1
- package/dist/cjs/Reporting/AccessNotice.d.ts +0 -7
- package/dist/cjs/Reporting/AccessNotice.d.ts.map +0 -1
- package/dist/cjs/Reporting/AccessNotice.js +0 -28
- package/dist/cjs/Reporting/AccessNotice.js.map +0 -1
- package/dist/cjs/Reporting/ReportErrorDialog.d.ts +0 -9
- package/dist/cjs/Reporting/ReportErrorDialog.d.ts.map +0 -1
- package/dist/cjs/Reporting/ReportErrorDialog.js +0 -87
- package/dist/cjs/Reporting/ReportErrorDialog.js.map +0 -1
- package/dist/cjs/Reporting/ReportIssueDialog.d.ts +0 -8
- package/dist/cjs/Reporting/ReportIssueDialog.d.ts.map +0 -1
- package/dist/cjs/Reporting/ReportIssueDialog.js +0 -81
- package/dist/cjs/Reporting/ReportIssueDialog.js.map +0 -1
- package/dist/cjs/Reporting/ReportLimits.d.ts +0 -8
- package/dist/cjs/Reporting/ReportLimits.d.ts.map +0 -1
- package/dist/cjs/Reporting/ReportLimits.js +0 -19
- package/dist/cjs/Reporting/ReportLimits.js.map +0 -1
- package/dist/cjs/Reporting/ReportSent.d.ts +0 -5
- package/dist/cjs/Reporting/ReportSent.d.ts.map +0 -1
- package/dist/cjs/Reporting/SentWithReport.d.ts +0 -7
- package/dist/cjs/Reporting/SentWithReport.d.ts.map +0 -1
- package/dist/cjs/Reporting/SentWithReport.js +0 -40
- package/dist/cjs/Reporting/SentWithReport.js.map +0 -1
- package/dist/cjs/Reporting/TechnicalDetails.d.ts +0 -9
- package/dist/cjs/Reporting/TechnicalDetails.d.ts.map +0 -1
- package/dist/cjs/Reporting/TechnicalDetails.js +0 -75
- package/dist/cjs/Reporting/TechnicalDetails.js.map +0 -1
- package/dist/cjs/Reporting/durationOptions.d.ts +0 -9
- package/dist/cjs/Reporting/durationOptions.d.ts.map +0 -1
- package/dist/cjs/Reporting/durationOptions.js +0 -29
- package/dist/cjs/Reporting/durationOptions.js.map +0 -1
- package/dist/cjs/Reporting/formatLocation.d.ts +0 -7
- package/dist/cjs/Reporting/formatLocation.d.ts.map +0 -1
- package/dist/cjs/Reporting/formatLocation.js +0 -23
- package/dist/cjs/Reporting/formatLocation.js.map +0 -1
- package/dist/cjs/Reporting/index.d.ts +0 -14
- package/dist/cjs/Reporting/index.d.ts.map +0 -1
- package/dist/cjs/Reporting/reportValues.d.ts +0 -22
- package/dist/cjs/Reporting/reportValues.d.ts.map +0 -1
- package/dist/cjs/Reporting/reportValues.js +0 -124
- package/dist/cjs/Reporting/reportValues.js.map +0 -1
- package/dist/cjs/Reporting/useAccessChoice.d.ts +0 -13
- package/dist/cjs/Reporting/useAccessChoice.d.ts.map +0 -1
- package/dist/cjs/Reporting/useAccessChoice.js +0 -41
- package/dist/cjs/Reporting/useAccessChoice.js.map +0 -1
- package/dist/cjs/index.d.ts +0 -8
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -133
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/package.json +0 -3
- package/dist/esm/Buttons/MyIssuesButton.d.ts +0 -14
- package/dist/esm/Buttons/MyIssuesButton.d.ts.map +0 -1
- package/dist/esm/Buttons/MyIssuesButton.js +0 -73
- package/dist/esm/Buttons/MyIssuesButton.js.map +0 -1
- package/dist/esm/Buttons/ReportButton.d.ts +0 -8
- package/dist/esm/Buttons/ReportButton.d.ts.map +0 -1
- package/dist/esm/Buttons/ReportButton.js +0 -32
- package/dist/esm/Buttons/ReportButton.js.map +0 -1
- package/dist/esm/Buttons/buttonModels.d.ts +0 -10
- package/dist/esm/Buttons/buttonModels.d.ts.map +0 -1
- package/dist/esm/Buttons/buttonModels.js +0 -41
- package/dist/esm/Buttons/buttonModels.js.map +0 -1
- package/dist/esm/Buttons/index.d.ts +0 -4
- package/dist/esm/Buttons/index.d.ts.map +0 -1
- package/dist/esm/Buttons/index.js +0 -4
- package/dist/esm/Buttons/index.js.map +0 -1
- package/dist/esm/Correlation/CorrelationTracker.d.ts +0 -10
- package/dist/esm/Correlation/CorrelationTracker.d.ts.map +0 -1
- package/dist/esm/Correlation/CorrelationTracker.js +0 -48
- package/dist/esm/Correlation/CorrelationTracker.js.map +0 -1
- package/dist/esm/Correlation/index.d.ts +0 -3
- package/dist/esm/Correlation/index.d.ts.map +0 -1
- package/dist/esm/Correlation/index.js +0 -3
- package/dist/esm/Correlation/index.js.map +0 -1
- package/dist/esm/Correlation/withCorrelationIdHeader.d.ts +0 -6
- package/dist/esm/Correlation/withCorrelationIdHeader.d.ts.map +0 -1
- package/dist/esm/Correlation/withCorrelationIdHeader.js +0 -36
- package/dist/esm/Correlation/withCorrelationIdHeader.js.map +0 -1
- package/dist/esm/Icons.d.ts +0 -4
- package/dist/esm/Icons.d.ts.map +0 -1
- package/dist/esm/Icons.js +0 -49
- package/dist/esm/Icons.js.map +0 -1
- package/dist/esm/Issues/IssueView/AccessPanel.d.ts +0 -6
- package/dist/esm/Issues/IssueView/AccessPanel.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/AccessPanel.js +0 -122
- package/dist/esm/Issues/IssueView/AccessPanel.js.map +0 -1
- package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts +0 -6
- package/dist/esm/Issues/IssueView/GrantAccessDialog.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/GrantAccessDialog.js +0 -54
- package/dist/esm/Issues/IssueView/GrantAccessDialog.js.map +0 -1
- package/dist/esm/Issues/IssueView/IdentityPanel.d.ts +0 -6
- package/dist/esm/Issues/IssueView/IdentityPanel.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/IdentityPanel.js +0 -43
- package/dist/esm/Issues/IssueView/IdentityPanel.js.map +0 -1
- package/dist/esm/Issues/IssueView/IssueActions.d.ts +0 -6
- package/dist/esm/Issues/IssueView/IssueActions.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/IssueActions.js +0 -56
- package/dist/esm/Issues/IssueView/IssueActions.js.map +0 -1
- package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts +0 -6
- package/dist/esm/Issues/IssueView/IssueConversationPanel.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/IssueConversationPanel.js +0 -95
- package/dist/esm/Issues/IssueView/IssueConversationPanel.js.map +0 -1
- package/dist/esm/Issues/IssueView/IssueHeader.d.ts +0 -7
- package/dist/esm/Issues/IssueView/IssueHeader.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/IssueHeader.js +0 -92
- package/dist/esm/Issues/IssueView/IssueHeader.js.map +0 -1
- package/dist/esm/Issues/IssueView/IssueView.d.ts +0 -7
- package/dist/esm/Issues/IssueView/IssueView.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/IssueView.js +0 -83
- package/dist/esm/Issues/IssueView/IssueView.js.map +0 -1
- package/dist/esm/Issues/IssueView/QuestionBanner.d.ts +0 -5
- package/dist/esm/Issues/IssueView/QuestionBanner.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/QuestionBanner.js +0 -22
- package/dist/esm/Issues/IssueView/QuestionBanner.js.map +0 -1
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts +0 -6
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.js +0 -32
- package/dist/esm/Issues/IssueView/ReopenIssueDialog.js.map +0 -1
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts +0 -6
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.js +0 -30
- package/dist/esm/Issues/IssueView/ShareIdentityDialog.js.map +0 -1
- package/dist/esm/Issues/IssueView/StatusStrip.d.ts +0 -6
- package/dist/esm/Issues/IssueView/StatusStrip.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/StatusStrip.js +0 -29
- package/dist/esm/Issues/IssueView/StatusStrip.js.map +0 -1
- package/dist/esm/Issues/IssueView/SupportSessions.d.ts +0 -7
- package/dist/esm/Issues/IssueView/SupportSessions.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/SupportSessions.js +0 -60
- package/dist/esm/Issues/IssueView/SupportSessions.js.map +0 -1
- package/dist/esm/Issues/IssueView/index.d.ts +0 -13
- package/dist/esm/Issues/IssueView/index.d.ts.map +0 -1
- package/dist/esm/Issues/IssueView/index.js +0 -13
- package/dist/esm/Issues/IssueView/index.js.map +0 -1
- package/dist/esm/Issues/MyIssues/IssueList.d.ts +0 -7
- package/dist/esm/Issues/MyIssues/IssueList.d.ts.map +0 -1
- package/dist/esm/Issues/MyIssues/IssueList.js +0 -90
- package/dist/esm/Issues/MyIssues/IssueList.js.map +0 -1
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts +0 -7
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.d.ts.map +0 -1
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.js +0 -77
- package/dist/esm/Issues/MyIssues/MyIssuesDialog.js.map +0 -1
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts +0 -21
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.d.ts.map +0 -1
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js +0 -49
- package/dist/esm/Issues/MyIssues/MyIssuesNavigation.js.map +0 -1
- package/dist/esm/Issues/MyIssues/index.d.ts +0 -4
- package/dist/esm/Issues/MyIssues/index.d.ts.map +0 -1
- package/dist/esm/Issues/MyIssues/index.js +0 -4
- package/dist/esm/Issues/MyIssues/index.js.map +0 -1
- package/dist/esm/Issues/MyIssuesList.d.ts +0 -7
- package/dist/esm/Issues/MyIssuesList.d.ts.map +0 -1
- package/dist/esm/Issues/MyIssuesList.js +0 -29
- package/dist/esm/Issues/MyIssuesList.js.map +0 -1
- package/dist/esm/Issues/accessStatus.d.ts +0 -13
- package/dist/esm/Issues/accessStatus.d.ts.map +0 -1
- package/dist/esm/Issues/accessStatus.js +0 -54
- package/dist/esm/Issues/accessStatus.js.map +0 -1
- package/dist/esm/Issues/conversationMessages.d.ts +0 -14
- package/dist/esm/Issues/conversationMessages.d.ts.map +0 -1
- package/dist/esm/Issues/conversationMessages.js +0 -125
- package/dist/esm/Issues/conversationMessages.js.map +0 -1
- package/dist/esm/Issues/index.d.ts +0 -10
- package/dist/esm/Issues/index.d.ts.map +0 -1
- package/dist/esm/Issues/index.js +0 -10
- package/dist/esm/Issues/index.js.map +0 -1
- package/dist/esm/Issues/issueStates.d.ts +0 -12
- package/dist/esm/Issues/issueStates.d.ts.map +0 -1
- package/dist/esm/Issues/issueStates.js +0 -81
- package/dist/esm/Issues/issueStates.js.map +0 -1
- package/dist/esm/Issues/sessionActivity.d.ts +0 -8
- package/dist/esm/Issues/sessionActivity.d.ts.map +0 -1
- package/dist/esm/Issues/sessionActivity.js +0 -37
- package/dist/esm/Issues/sessionActivity.js.map +0 -1
- package/dist/esm/Issues/useAccessStatus.d.ts +0 -4
- package/dist/esm/Issues/useAccessStatus.d.ts.map +0 -1
- package/dist/esm/Issues/useAccessStatus.js +0 -28
- package/dist/esm/Issues/useAccessStatus.js.map +0 -1
- package/dist/esm/Issues/webAddress.d.ts +0 -2
- package/dist/esm/Issues/webAddress.d.ts.map +0 -1
- package/dist/esm/Issues/webAddress.js +0 -22
- package/dist/esm/Issues/webAddress.js.map +0 -1
- package/dist/esm/Labels/UsherLabels.d.ts +0 -177
- package/dist/esm/Labels/UsherLabels.d.ts.map +0 -1
- package/dist/esm/Labels/UsherLabels.js +0 -2
- package/dist/esm/Labels/UsherLabels.js.map +0 -1
- package/dist/esm/Labels/defaultUsherLabels.d.ts +0 -3
- package/dist/esm/Labels/defaultUsherLabels.d.ts.map +0 -1
- package/dist/esm/Labels/defaultUsherLabels.js +0 -177
- package/dist/esm/Labels/defaultUsherLabels.js.map +0 -1
- package/dist/esm/Labels/format.d.ts +0 -2
- package/dist/esm/Labels/format.d.ts.map +0 -1
- package/dist/esm/Labels/format.js +0 -13
- package/dist/esm/Labels/format.js.map +0 -1
- package/dist/esm/Labels/index.d.ts +0 -5
- package/dist/esm/Labels/index.d.ts.map +0 -1
- package/dist/esm/Labels/index.js +0 -5
- package/dist/esm/Labels/index.js.map +0 -1
- package/dist/esm/Labels/resolveLabels.d.ts +0 -3
- package/dist/esm/Labels/resolveLabels.d.ts.map +0 -1
- package/dist/esm/Labels/resolveLabels.js +0 -33
- package/dist/esm/Labels/resolveLabels.js.map +0 -1
- package/dist/esm/Provider/UsherBoundary.d.ts +0 -6
- package/dist/esm/Provider/UsherBoundary.d.ts.map +0 -1
- package/dist/esm/Provider/UsherBoundary.js +0 -22
- package/dist/esm/Provider/UsherBoundary.js.map +0 -1
- package/dist/esm/Provider/UsherContext.d.ts +0 -24
- package/dist/esm/Provider/UsherContext.d.ts.map +0 -1
- package/dist/esm/Provider/UsherContext.js +0 -36
- package/dist/esm/Provider/UsherContext.js.map +0 -1
- package/dist/esm/Provider/UsherProvider.d.ts +0 -14
- package/dist/esm/Provider/UsherProvider.d.ts.map +0 -1
- package/dist/esm/Provider/UsherProvider.js +0 -120
- package/dist/esm/Provider/UsherProvider.js.map +0 -1
- package/dist/esm/Provider/index.d.ts +0 -5
- package/dist/esm/Provider/index.d.ts.map +0 -1
- package/dist/esm/Provider/index.js +0 -5
- package/dist/esm/Provider/index.js.map +0 -1
- package/dist/esm/Provider/useUsher.d.ts +0 -13
- package/dist/esm/Provider/useUsher.d.ts.map +0 -1
- package/dist/esm/Provider/useUsher.js +0 -29
- package/dist/esm/Provider/useUsher.js.map +0 -1
- package/dist/esm/Reporting/AccessChoice.d.ts +0 -13
- package/dist/esm/Reporting/AccessChoice.d.ts.map +0 -1
- package/dist/esm/Reporting/AccessChoice.js +0 -106
- package/dist/esm/Reporting/AccessChoice.js.map +0 -1
- package/dist/esm/Reporting/AccessFields.d.ts +0 -12
- package/dist/esm/Reporting/AccessFields.d.ts.map +0 -1
- package/dist/esm/Reporting/AccessFields.js +0 -77
- package/dist/esm/Reporting/AccessFields.js.map +0 -1
- package/dist/esm/Reporting/AccessNotice.d.ts +0 -7
- package/dist/esm/Reporting/AccessNotice.d.ts.map +0 -1
- package/dist/esm/Reporting/AccessNotice.js +0 -26
- package/dist/esm/Reporting/AccessNotice.js.map +0 -1
- package/dist/esm/Reporting/ReportErrorDialog.d.ts +0 -9
- package/dist/esm/Reporting/ReportErrorDialog.d.ts.map +0 -1
- package/dist/esm/Reporting/ReportErrorDialog.js +0 -85
- package/dist/esm/Reporting/ReportErrorDialog.js.map +0 -1
- package/dist/esm/Reporting/ReportIssueDialog.d.ts +0 -8
- package/dist/esm/Reporting/ReportIssueDialog.d.ts.map +0 -1
- package/dist/esm/Reporting/ReportIssueDialog.js +0 -79
- package/dist/esm/Reporting/ReportIssueDialog.js.map +0 -1
- package/dist/esm/Reporting/ReportLimits.d.ts +0 -8
- package/dist/esm/Reporting/ReportLimits.d.ts.map +0 -1
- package/dist/esm/Reporting/ReportLimits.js +0 -17
- package/dist/esm/Reporting/ReportLimits.js.map +0 -1
- package/dist/esm/Reporting/ReportSent.d.ts +0 -5
- package/dist/esm/Reporting/ReportSent.d.ts.map +0 -1
- package/dist/esm/Reporting/ReportSent.js +0 -2
- package/dist/esm/Reporting/ReportSent.js.map +0 -1
- package/dist/esm/Reporting/SentWithReport.d.ts +0 -7
- package/dist/esm/Reporting/SentWithReport.d.ts.map +0 -1
- package/dist/esm/Reporting/SentWithReport.js +0 -38
- package/dist/esm/Reporting/SentWithReport.js.map +0 -1
- package/dist/esm/Reporting/TechnicalDetails.d.ts +0 -9
- package/dist/esm/Reporting/TechnicalDetails.d.ts.map +0 -1
- package/dist/esm/Reporting/TechnicalDetails.js +0 -73
- package/dist/esm/Reporting/TechnicalDetails.js.map +0 -1
- package/dist/esm/Reporting/durationOptions.d.ts +0 -9
- package/dist/esm/Reporting/durationOptions.d.ts.map +0 -1
- package/dist/esm/Reporting/durationOptions.js +0 -27
- package/dist/esm/Reporting/durationOptions.js.map +0 -1
- package/dist/esm/Reporting/formatLocation.d.ts +0 -7
- package/dist/esm/Reporting/formatLocation.d.ts.map +0 -1
- package/dist/esm/Reporting/formatLocation.js +0 -21
- package/dist/esm/Reporting/formatLocation.js.map +0 -1
- package/dist/esm/Reporting/index.d.ts +0 -14
- package/dist/esm/Reporting/index.d.ts.map +0 -1
- package/dist/esm/Reporting/index.js +0 -14
- package/dist/esm/Reporting/index.js.map +0 -1
- package/dist/esm/Reporting/reportValues.d.ts +0 -22
- package/dist/esm/Reporting/reportValues.d.ts.map +0 -1
- package/dist/esm/Reporting/reportValues.js +0 -116
- package/dist/esm/Reporting/reportValues.js.map +0 -1
- package/dist/esm/Reporting/useAccessChoice.d.ts +0 -13
- package/dist/esm/Reporting/useAccessChoice.d.ts.map +0 -1
- package/dist/esm/Reporting/useAccessChoice.js +0 -39
- package/dist/esm/Reporting/useAccessChoice.js.map +0 -1
- package/dist/esm/index.d.ts +0 -8
- package/dist/esm/index.d.ts.map +0 -1
- package/dist/esm/index.js +0 -48
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/package.json +0 -3
- package/index.ts +0 -10
- package/styles.css +0 -320
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../Labels/format.ts"],"names":[],"mappings":"AASA,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAGxF"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
* Fills the placeholders of a label, such as `{count}`, with values. A placeholder without a value is left as it is.
|
|
5
|
-
* @param template The label.
|
|
6
|
-
* @param values The values by placeholder name.
|
|
7
|
-
* @returns The label with its placeholders filled in.
|
|
8
|
-
*/ function format(template, values) {
|
|
9
|
-
return template.replace(/\{(\w+)\}/g, (placeholder, name)=>Object.hasOwn(values, name) ? String(values[name]) : placeholder);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export { format };
|
|
13
|
-
//# sourceMappingURL=format.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sources":["../../../Labels/format.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * Fills the placeholders of a label, such as `{count}`, with values. A placeholder without a value is left as it is.\n * @param template The label.\n * @param values The values by placeholder name.\n * @returns The label with its placeholders filled in.\n */\nexport function format(template: string, values: Record<string, string | number>): string {\n return template.replace(/\\{(\\w+)\\}/g, (placeholder, name: string) =>\n Object.hasOwn(values, name) ? String(values[name]) : placeholder);\n}\n"],"names":["format","template","values","replace","placeholder","name","Object","hasOwn","String"],"mappings":"AAAA;AACA;AAEA;;;;;AAKC,IACM,SAASA,MAAAA,CAAOC,QAAgB,EAAEC,MAAuC,EAAA;AAC5E,IAAA,OAAOD,SAASE,OAAO,CAAC,YAAA,EAAc,CAACC,aAAaC,IAAAA,GAChDC,MAAAA,CAAOC,MAAM,CAACL,QAAQG,IAAAA,CAAAA,GAAQG,MAAAA,CAAON,MAAM,CAACG,KAAK,CAAA,GAAID,WAAAA,CAAAA;AAC7D;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../Labels/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
package/dist/esm/Labels/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Labels/index.ts"],"names":[],"mappings":"AAGA,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLabels.d.ts","sourceRoot":"","sources":["../../../Labels/resolveLabels.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAOpE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,WAAW,CAE1E"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { defaultUsherLabels } from './defaultUsherLabels.js';
|
|
2
|
-
|
|
3
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
-
/**
|
|
6
|
-
* Resolves the labels to show: the overrides given, and the English default for every label left out.
|
|
7
|
-
* @param overrides The labels a solution replaces.
|
|
8
|
-
* @returns The {@link UsherLabels}.
|
|
9
|
-
*/ function resolveLabels(overrides) {
|
|
10
|
-
return merge(defaultUsherLabels, overrides);
|
|
11
|
-
}
|
|
12
|
-
function merge(defaults, overrides) {
|
|
13
|
-
if (!overrides) {
|
|
14
|
-
return defaults;
|
|
15
|
-
}
|
|
16
|
-
const merged = {
|
|
17
|
-
...defaults
|
|
18
|
-
};
|
|
19
|
-
for (const [key, value] of Object.entries(overrides)){
|
|
20
|
-
if (value === undefined) {
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const defaultValue = defaults[key];
|
|
24
|
-
merged[key] = isObject(defaultValue) && isObject(value) ? merge(defaultValue, value) : value;
|
|
25
|
-
}
|
|
26
|
-
return merged;
|
|
27
|
-
}
|
|
28
|
-
function isObject(value) {
|
|
29
|
-
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { resolveLabels };
|
|
33
|
-
//# sourceMappingURL=resolveLabels.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveLabels.js","sources":["../../../Labels/resolveLabels.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { defaultUsherLabels } from './defaultUsherLabels.js';\nimport { UsherLabelOverrides, UsherLabels } from './UsherLabels.js';\n\n/**\n * Resolves the labels to show: the overrides given, and the English default for every label left out.\n * @param overrides The labels a solution replaces.\n * @returns The {@link UsherLabels}.\n */\nexport function resolveLabels(overrides?: UsherLabelOverrides): UsherLabels {\n return merge(defaultUsherLabels, overrides) as UsherLabels;\n}\n\nfunction merge(defaults: object, overrides?: object): object {\n if (!overrides) {\n return defaults;\n }\n\n const merged: Record<string, unknown> = { ...defaults };\n for (const [key, value] of Object.entries(overrides)) {\n if (value === undefined) {\n continue;\n }\n\n const defaultValue = (defaults as Record<string, unknown>)[key];\n merged[key] = isObject(defaultValue) && isObject(value) ? merge(defaultValue, value) : value;\n }\n\n return merged;\n}\n\nfunction isObject(value: unknown): value is object {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n"],"names":["resolveLabels","overrides","merge","defaultUsherLabels","defaults","merged","key","value","Object","entries","undefined","defaultValue","isObject","Array","isArray"],"mappings":";;AAAA;AACA;AAKA;;;;IAKO,SAASA,aAAAA,CAAcC,SAA+B,EAAA;AACzD,IAAA,OAAOC,MAAMC,kBAAAA,EAAoBF,SAAAA,CAAAA;AACrC;AAEA,SAASC,KAAAA,CAAME,QAAgB,EAAEH,SAAkB,EAAA;AAC/C,IAAA,IAAI,CAACA,SAAAA,EAAW;QACZ,OAAOG,QAAAA;AACX,IAAA;AAEA,IAAA,MAAMC,MAAAA,GAAkC;AAAE,QAAA,GAAGD;AAAS,KAAA;IACtD,KAAK,MAAM,CAACE,GAAAA,EAAKC,KAAAA,CAAM,IAAIC,MAAAA,CAAOC,OAAO,CAACR,SAAAA,CAAAA,CAAY;AAClD,QAAA,IAAIM,UAAUG,SAAAA,EAAW;AACrB,YAAA;AACJ,QAAA;AAEA,QAAA,MAAMC,YAAAA,GAAgBP,QAAoC,CAACE,GAAAA,CAAI;QAC/DD,MAAM,CAACC,IAAI,GAAGM,QAAAA,CAASD,iBAAiBC,QAAAA,CAASL,KAAAA,CAAAA,GAASL,KAAAA,CAAMS,YAAAA,EAAcJ,KAAAA,CAAAA,GAASA,KAAAA;AAC3F,IAAA;IAEA,OAAOF,MAAAA;AACX;AAEA,SAASO,SAASL,KAAc,EAAA;IAC5B,OAAO,OAAOA,UAAU,QAAA,IAAYA,KAAAA,KAAU,QAAQ,CAACM,KAAAA,CAAMC,OAAO,CAACP,KAAAA,CAAAA;AACzE;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UsherBoundary.d.ts","sourceRoot":"","sources":["../../../Provider/UsherBoundary.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAM9C,MAAM,WAAW,kBAAkB;IAE/B,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAMD,eAAO,MAAM,aAAa,GAAI,cAAc,kBAAkB,gCAS7D,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ArcContext } from '@cratis/arc.react';
|
|
3
|
-
import { Slice } from '@cratis/arc.react/slices';
|
|
4
|
-
import { useContext } from 'react';
|
|
5
|
-
import { UsherContext } from './UsherContext.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Keeps Usher's own commands and queries out of what a report carries: they run without correlation tracking, and
|
|
9
|
-
* do not change the slice location of the solution's components around them.
|
|
10
|
-
*/ const UsherBoundary = ({ children })=>{
|
|
11
|
-
const usher = useContext(UsherContext);
|
|
12
|
-
const arc = useContext(ArcContext);
|
|
13
|
-
return /*#__PURE__*/ jsx(ArcContext.Provider, {
|
|
14
|
-
value: usher.untrackedArc ?? arc,
|
|
15
|
-
children: /*#__PURE__*/ jsx(Slice, {
|
|
16
|
-
children: children
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export { UsherBoundary };
|
|
22
|
-
//# sourceMappingURL=UsherBoundary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UsherBoundary.js","sources":["../../../Provider/UsherBoundary.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 { Slice } from '@cratis/arc.react/slices';\nimport { ReactNode, useContext } from 'react';\nimport { UsherContext } from './UsherContext.js';\n\n/**\n * Props for {@link UsherBoundary}.\n */\nexport interface UsherBoundaryProps {\n /** What Usher renders. */\n children?: ReactNode;\n}\n\n/**\n * Keeps Usher's own commands and queries out of what a report carries: they run without correlation tracking, and\n * do not change the slice location of the solution's components around them.\n */\nexport const UsherBoundary = ({ children }: UsherBoundaryProps) => {\n const usher = useContext(UsherContext);\n const arc = useContext(ArcContext);\n\n return (\n <ArcContext.Provider value={usher.untrackedArc ?? arc}>\n <Slice>{children}</Slice>\n </ArcContext.Provider>\n );\n};\n"],"names":["UsherBoundary","children","usher","useContext","UsherContext","arc","ArcContext","_jsx","Provider","value","untrackedArc","Slice"],"mappings":";;;;;;AAgBA;;;AAGC,IACM,MAAMA,aAAAA,GAAgB,CAAC,EAAEC,QAAQ,EAAsB,GAAA;AAC1D,IAAA,MAAMC,QAAQC,UAAAA,CAAWC,YAAAA,CAAAA;AACzB,IAAA,MAAMC,MAAMF,UAAAA,CAAWG,UAAAA,CAAAA;IAEvB,qBACIC,GAAA,CAACD,WAAWE,QAAQ,EAAA;QAACC,KAAAA,EAAOP,KAAAA,CAAMQ,YAAY,IAAIL,GAAAA;AAC9C,QAAA,QAAA,gBAAAE,GAAA,CAACI,KAAAA,EAAAA;AAAOV,YAAAA,QAAAA,EAAAA;;;AAGpB;;"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ArcConfiguration } from '@cratis/arc.react';
|
|
2
|
-
import { SliceLocation } from '@cratis/arc/reflection';
|
|
3
|
-
import { Guid } from '@cratis/fundamentals';
|
|
4
|
-
import { UsherLabels } from '../Labels/index.js';
|
|
5
|
-
export interface UsherContextValue {
|
|
6
|
-
readonly isProvided: boolean;
|
|
7
|
-
readonly labels: UsherLabels;
|
|
8
|
-
readonly applicationName: string;
|
|
9
|
-
readonly applicationVersion: string;
|
|
10
|
-
readonly shareIdentityByDefault: boolean;
|
|
11
|
-
readonly locale?: string;
|
|
12
|
-
readonly untrackedArc?: ArcConfiguration;
|
|
13
|
-
recentCorrelationIds(): Guid[];
|
|
14
|
-
trackCorrelationId(correlationId: Guid | string): void;
|
|
15
|
-
reportIssue(location: SliceLocation): void;
|
|
16
|
-
reportError(error: unknown, location: SliceLocation): void;
|
|
17
|
-
showMyIssues(location: SliceLocation): void;
|
|
18
|
-
showIssue(issueId: Guid): void;
|
|
19
|
-
}
|
|
20
|
-
export declare const defaultUsherContextValue: UsherContextValue;
|
|
21
|
-
export declare const UsherContext: import("react").Context<UsherContextValue>;
|
|
22
|
-
export declare const useUsherContext: () => UsherContextValue;
|
|
23
|
-
export declare const useUsherLabels: () => UsherLabels;
|
|
24
|
-
//# sourceMappingURL=UsherContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UsherContext.d.ts","sourceRoot":"","sources":["../../../Provider/UsherContext.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,EAAiB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKhE,MAAM,WAAW,iBAAiB;IAE9B,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAG7B,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAG7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IAGjC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAGpC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IAGzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAGzB,QAAQ,CAAC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAMzC,oBAAoB,IAAI,IAAI,EAAE,CAAC;IAM/B,kBAAkB,CAAC,aAAa,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAMvD,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAO3C,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAM3D,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAC;IAM5C,SAAS,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CAClC;AASD,eAAO,MAAM,wBAAwB,EAAE,iBAYtC,CAAC;AAKF,eAAO,MAAM,YAAY,4CAA6D,CAAC;AAMvF,eAAO,MAAM,eAAe,QAAO,iBAA6C,CAAC;AAMjF,eAAO,MAAM,cAAc,QAAO,WAA8C,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
2
|
-
import { resolveLabels } from '../Labels/resolveLabels.js';
|
|
3
|
-
|
|
4
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
5
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
6
|
-
const noop = ()=>{
|
|
7
|
-
/* Without an UsherProvider there are no dialogs to open. */ };
|
|
8
|
-
/**
|
|
9
|
-
* The value without an {@link UsherProvider}: English labels, and nothing to open.
|
|
10
|
-
*/ const defaultUsherContextValue = {
|
|
11
|
-
isProvided: false,
|
|
12
|
-
labels: resolveLabels(),
|
|
13
|
-
applicationName: '',
|
|
14
|
-
applicationVersion: '',
|
|
15
|
-
shareIdentityByDefault: false,
|
|
16
|
-
recentCorrelationIds: ()=>[],
|
|
17
|
-
trackCorrelationId: noop,
|
|
18
|
-
reportIssue: noop,
|
|
19
|
-
reportError: noop,
|
|
20
|
-
showMyIssues: noop,
|
|
21
|
-
showIssue: noop
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* The React context {@link UsherProvider} provides.
|
|
25
|
-
*/ const UsherContext = createContext(defaultUsherContextValue);
|
|
26
|
-
/**
|
|
27
|
-
* Gets what {@link UsherProvider} provides, or the defaults outside one.
|
|
28
|
-
* @returns The {@link UsherContextValue}.
|
|
29
|
-
*/ const useUsherContext = ()=>useContext(UsherContext);
|
|
30
|
-
/**
|
|
31
|
-
* Gets the labels to show.
|
|
32
|
-
* @returns The {@link UsherLabels}.
|
|
33
|
-
*/ const useUsherLabels = ()=>useContext(UsherContext).labels;
|
|
34
|
-
|
|
35
|
-
export { UsherContext, defaultUsherContextValue, useUsherContext, useUsherLabels };
|
|
36
|
-
//# sourceMappingURL=UsherContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UsherContext.js","sources":["../../../Provider/UsherContext.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 { ArcConfiguration } from '@cratis/arc.react';\nimport { SliceLocation } from '@cratis/arc/reflection';\nimport { Guid } from '@cratis/fundamentals';\nimport { createContext, useContext } from 'react';\nimport { resolveLabels, UsherLabels } from '../Labels/index.js';\n\n/**\n * What {@link UsherProvider} gives the Usher components.\n */\nexport interface UsherContextValue {\n /** Whether an {@link UsherProvider} provides the value; the defaults otherwise. */\n readonly isProvided: boolean;\n\n /** The labels to show. */\n readonly labels: UsherLabels;\n\n /** The name of the application, shown with what a report sends; empty when not given. */\n readonly applicationName: string;\n\n /** The version of the application, sent with every report; empty when not given. */\n readonly applicationVersion: string;\n\n /** Whether the report dialogs let support know who the reporter is unless they choose otherwise. */\n readonly shareIdentityByDefault: boolean;\n\n /** The locale to format dates and times for; the browser's when not given. */\n readonly locale?: string;\n\n /** The Arc configuration without correlation tracking, for Usher's own commands and queries. */\n readonly untrackedArc?: ArcConfiguration;\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 run, such as one from a `CommandResult`.\n * @param correlationId The correlation id.\n */\n trackCorrelationId(correlationId: Guid | string): void;\n\n /**\n * Opens the report a problem dialog.\n * @param location Where in the application the reporter is.\n */\n reportIssue(location: SliceLocation): void;\n\n /**\n * Opens the report this error dialog.\n * @param error The error: `ErrorDetails` from `@cratis/showrunner.usher`, or anything thrown.\n * @param location Where in the application the reporter is.\n */\n reportError(error: unknown, location: SliceLocation): void;\n\n /**\n * Opens the my issues side sheet with the list of issues.\n * @param location Where in the application the user is, for a problem they report from the side sheet.\n */\n showMyIssues(location: SliceLocation): 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\nconst noop = () => {\n /* Without an UsherProvider there are no dialogs to open. */\n};\n\n/**\n * The value without an {@link UsherProvider}: English labels, and nothing to open.\n */\nexport const defaultUsherContextValue: UsherContextValue = {\n isProvided: false,\n labels: resolveLabels(),\n applicationName: '',\n applicationVersion: '',\n shareIdentityByDefault: false,\n recentCorrelationIds: () => [],\n trackCorrelationId: noop,\n reportIssue: noop,\n reportError: noop,\n showMyIssues: noop,\n showIssue: noop\n};\n\n/**\n * The React context {@link UsherProvider} provides.\n */\nexport const UsherContext = createContext<UsherContextValue>(defaultUsherContextValue);\n\n/**\n * Gets what {@link UsherProvider} provides, or the defaults outside one.\n * @returns The {@link UsherContextValue}.\n */\nexport const useUsherContext = (): UsherContextValue => useContext(UsherContext);\n\n/**\n * Gets the labels to show.\n * @returns The {@link UsherLabels}.\n */\nexport const useUsherLabels = (): UsherLabels => useContext(UsherContext).labels;\n"],"names":["noop","defaultUsherContextValue","isProvided","labels","resolveLabels","applicationName","applicationVersion","shareIdentityByDefault","recentCorrelationIds","trackCorrelationId","reportIssue","reportError","showMyIssues","showIssue","UsherContext","createContext","useUsherContext","useContext","useUsherLabels"],"mappings":";;;AAAA;AACA;AAuEA,MAAMA,IAAAA,GAAO,IAAA;AACT,6DACJ,CAAA;AAEA;;UAGaC,wBAAAA,GAA8C;IACvDC,UAAAA,EAAY,KAAA;IACZC,MAAAA,EAAQC,aAAAA,EAAAA;IACRC,eAAAA,EAAiB,EAAA;IACjBC,kBAAAA,EAAoB,EAAA;IACpBC,sBAAAA,EAAwB,KAAA;AACxBC,IAAAA,oBAAAA,EAAsB,IAAM,EAAE;IAC9BC,kBAAAA,EAAoBT,IAAAA;IACpBU,WAAAA,EAAaV,IAAAA;IACbW,WAAAA,EAAaX,IAAAA;IACbY,YAAAA,EAAcZ,IAAAA;IACda,SAAAA,EAAWb;AACf;AAEA;;AAEC,IACM,MAAMc,YAAAA,GAAeC,aAAAA,CAAiCd,wBAAAA;AAE7D;;;AAGC,IACM,MAAMe,eAAAA,GAAkB,IAAyBC,WAAWH,YAAAA;AAEnE;;;AAGC,IACM,MAAMI,cAAAA,GAAiB,IAAmBD,UAAAA,CAAWH,YAAAA,CAAAA,CAAcX;;"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { UsherLabelOverrides } from '../Labels/index.js';
|
|
3
|
-
export interface UsherProviderProps {
|
|
4
|
-
applicationVersion?: string;
|
|
5
|
-
applicationName?: string;
|
|
6
|
-
shareIdentityByDefault?: boolean;
|
|
7
|
-
labels?: UsherLabelOverrides;
|
|
8
|
-
locale?: string;
|
|
9
|
-
correlationIdCount?: number;
|
|
10
|
-
correlationIdHeader?: string;
|
|
11
|
-
children?: ReactNode;
|
|
12
|
-
}
|
|
13
|
-
export declare const UsherProvider: ({ applicationVersion, applicationName, shareIdentityByDefault, labels, locale, correlationIdCount, correlationIdHeader, children }: UsherProviderProps) => import("react").JSX.Element;
|
|
14
|
-
//# sourceMappingURL=UsherProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { ArcContext } from '@cratis/arc.react';
|
|
3
|
-
import { useDialog, DialogResult } from '@cratis/arc.react/dialogs';
|
|
4
|
-
import { SliceLocation } from '@cratis/arc/reflection';
|
|
5
|
-
import { toast } from '@cratis/components/Notifications';
|
|
6
|
-
import { useContext, useRef, useMemo } from 'react';
|
|
7
|
-
import { CorrelationTracker } from '../Correlation/CorrelationTracker.js';
|
|
8
|
-
import { withCorrelationIdHeader, defaultCorrelationIdHeader } from '../Correlation/withCorrelationIdHeader.js';
|
|
9
|
-
import { MyIssuesDialog } from '../Issues/MyIssues/MyIssuesDialog.js';
|
|
10
|
-
import { resolveLabels } from '../Labels/resolveLabels.js';
|
|
11
|
-
import { ReportErrorDialog } from '../Reporting/ReportErrorDialog.js';
|
|
12
|
-
import { ReportIssueDialog } from '../Reporting/ReportIssueDialog.js';
|
|
13
|
-
import { toErrorDetails } from '../Reporting/reportValues.js';
|
|
14
|
-
import { UsherContext } from './UsherContext.js';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Slots Usher into an application: renders the report and my issues dialogs once, gives {@link useUsher} and the
|
|
18
|
-
* Usher buttons what they need, and tracks the correlation ids of the Arc commands and queries the application runs.
|
|
19
|
-
* Render it inside `<Arc>`, the `DialogComponents` registration and a `CratisComponentsProvider` with a toaster.
|
|
20
|
-
*/ const UsherProvider = ({ applicationVersion = '', applicationName = '', shareIdentityByDefault = false, labels, locale, correlationIdCount = 5, correlationIdHeader = defaultCorrelationIdHeader, children })=>{
|
|
21
|
-
const arc = useContext(ArcContext);
|
|
22
|
-
const tracker = useRef(undefined);
|
|
23
|
-
if (!tracker.current || tracker.current.capacity !== correlationIdCount) {
|
|
24
|
-
tracker.current = new CorrelationTracker(correlationIdCount);
|
|
25
|
-
}
|
|
26
|
-
const correlationTracker = tracker.current;
|
|
27
|
-
const lastLocation = useRef(SliceLocation.empty);
|
|
28
|
-
const trackedArc = useMemo(()=>({
|
|
29
|
-
...arc,
|
|
30
|
-
httpHeadersCallback: withCorrelationIdHeader(arc.httpHeadersCallback, correlationTracker, correlationIdHeader)
|
|
31
|
-
}), [
|
|
32
|
-
arc,
|
|
33
|
-
correlationTracker,
|
|
34
|
-
correlationIdHeader
|
|
35
|
-
]);
|
|
36
|
-
const [ReportIssueDialogWrapper, showReportIssueDialog] = useDialog(ReportIssueDialog);
|
|
37
|
-
const [ReportErrorDialogWrapper, showReportErrorDialog] = useDialog(ReportErrorDialog);
|
|
38
|
-
const [MyIssuesDialogWrapper, showMyIssuesDialog] = useDialog(MyIssuesDialog);
|
|
39
|
-
const resolvedLabels = useMemo(()=>resolveLabels(labels), [
|
|
40
|
-
labels
|
|
41
|
-
]);
|
|
42
|
-
const value = useMemo(()=>{
|
|
43
|
-
const reportIssue = (location)=>{
|
|
44
|
-
lastLocation.current = location;
|
|
45
|
-
void showReportIssueDialog({
|
|
46
|
-
location,
|
|
47
|
-
correlationIds: correlationTracker.correlationIds
|
|
48
|
-
}).then(reportSent);
|
|
49
|
-
};
|
|
50
|
-
const showIssue = (issueId)=>void showMyIssuesDialog({
|
|
51
|
-
issueId,
|
|
52
|
-
onReportIssue: ()=>reportIssue(lastLocation.current)
|
|
53
|
-
});
|
|
54
|
-
const reportSent = ([result, response])=>{
|
|
55
|
-
if (result !== DialogResult.Ok || !response) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
toast.success({
|
|
59
|
-
title: resolvedLabels.reportSent.title,
|
|
60
|
-
action: {
|
|
61
|
-
children: resolvedLabels.reportSent.view,
|
|
62
|
-
onClick: ()=>showIssue(response.issueId)
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
return {
|
|
67
|
-
isProvided: true,
|
|
68
|
-
labels: resolvedLabels,
|
|
69
|
-
applicationName,
|
|
70
|
-
applicationVersion,
|
|
71
|
-
shareIdentityByDefault,
|
|
72
|
-
locale,
|
|
73
|
-
untrackedArc: arc,
|
|
74
|
-
recentCorrelationIds: ()=>correlationTracker.correlationIds,
|
|
75
|
-
trackCorrelationId: (correlationId)=>correlationTracker.track(correlationId),
|
|
76
|
-
reportIssue,
|
|
77
|
-
reportError: (error, location)=>{
|
|
78
|
-
lastLocation.current = location;
|
|
79
|
-
void showReportErrorDialog({
|
|
80
|
-
error: toErrorDetails(error, location),
|
|
81
|
-
location,
|
|
82
|
-
correlationIds: correlationTracker.correlationIds
|
|
83
|
-
}).then(reportSent);
|
|
84
|
-
},
|
|
85
|
-
showMyIssues: (location)=>{
|
|
86
|
-
lastLocation.current = location;
|
|
87
|
-
void showMyIssuesDialog({
|
|
88
|
-
onReportIssue: ()=>reportIssue(location)
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
showIssue
|
|
92
|
-
};
|
|
93
|
-
}, [
|
|
94
|
-
resolvedLabels,
|
|
95
|
-
applicationName,
|
|
96
|
-
applicationVersion,
|
|
97
|
-
shareIdentityByDefault,
|
|
98
|
-
locale,
|
|
99
|
-
arc,
|
|
100
|
-
correlationTracker,
|
|
101
|
-
showReportIssueDialog,
|
|
102
|
-
showReportErrorDialog,
|
|
103
|
-
showMyIssuesDialog
|
|
104
|
-
]);
|
|
105
|
-
return /*#__PURE__*/ jsxs(UsherContext.Provider, {
|
|
106
|
-
value: value,
|
|
107
|
-
children: [
|
|
108
|
-
/*#__PURE__*/ jsx(ArcContext.Provider, {
|
|
109
|
-
value: trackedArc,
|
|
110
|
-
children: children
|
|
111
|
-
}),
|
|
112
|
-
/*#__PURE__*/ jsx(ReportIssueDialogWrapper, {}),
|
|
113
|
-
/*#__PURE__*/ jsx(ReportErrorDialogWrapper, {}),
|
|
114
|
-
/*#__PURE__*/ jsx(MyIssuesDialogWrapper, {})
|
|
115
|
-
]
|
|
116
|
-
});
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export { UsherProvider };
|
|
120
|
-
//# sourceMappingURL=UsherProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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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"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../Provider/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useSliceContext } from '@cratis/arc.react/slices';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useUsherContext } from './UsherContext.js';
|
|
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
|
-
* Uses Usher from any component inside an {@link UsherProvider}. Reports carry the slice location of the component
|
|
9
|
-
* that calls this hook.
|
|
10
|
-
* @returns The {@link Usher}.
|
|
11
|
-
*/ function useUsher() {
|
|
12
|
-
const context = useUsherContext();
|
|
13
|
-
const location = useSliceContext();
|
|
14
|
-
return useMemo(()=>({
|
|
15
|
-
labels: context.labels,
|
|
16
|
-
reportIssue: ()=>context.reportIssue(location),
|
|
17
|
-
reportError: (error)=>context.reportError(error, location),
|
|
18
|
-
showMyIssues: ()=>context.showMyIssues(location),
|
|
19
|
-
showIssue: (issueId)=>context.showIssue(issueId),
|
|
20
|
-
recentCorrelationIds: ()=>context.recentCorrelationIds(),
|
|
21
|
-
trackCorrelationId: (correlationId)=>context.trackCorrelationId(correlationId)
|
|
22
|
-
}), [
|
|
23
|
-
context,
|
|
24
|
-
location
|
|
25
|
-
]);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { useUsher };
|
|
29
|
-
//# sourceMappingURL=useUsher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,eAAAA,EAAAA;AAChB,IAAA,MAAMC,QAAAA,GAAWC,eAAAA,EAAAA;IAEjB,OAAOC,OAAAA,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;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { AccessDuration } from '@cratis/showrunner.usher';
|
|
2
|
-
|
|
3
|
-
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
-
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
-
/**
|
|
6
|
-
* Gets the choice before the reporter has chosen anything: no access, for one day once they grant it.
|
|
7
|
-
* @param shareIdentity Whether to let support know who the reporter is unless they choose otherwise.
|
|
8
|
-
* @returns The {@link AccessChoice}.
|
|
9
|
-
*/ function initialAccessChoice(shareIdentity) {
|
|
10
|
-
return {
|
|
11
|
-
shareIdentity,
|
|
12
|
-
grantAccess: false,
|
|
13
|
-
accessDuration: AccessDuration.oneDay
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
const durationsInMilliseconds = {
|
|
17
|
-
[AccessDuration.oneHour]: 60 * 60 * 1000,
|
|
18
|
-
[AccessDuration.oneDay]: 24 * 60 * 60 * 1000,
|
|
19
|
-
[AccessDuration.sevenDays]: 7 * 24 * 60 * 60 * 1000
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Applies a change of a command field to the access choice; changes of other fields leave it as it is. While access is
|
|
23
|
-
* granted, sharing who the reporter is is forced, so a change of it is not the reporter's own choice.
|
|
24
|
-
* @param choice The current {@link AccessChoice}.
|
|
25
|
-
* @param fieldName The name of the command field that changed.
|
|
26
|
-
* @param value Its new value.
|
|
27
|
-
* @returns The new {@link AccessChoice}.
|
|
28
|
-
*/ function changeAccessChoice(choice, fieldName, value) {
|
|
29
|
-
if (fieldName === 'shareIdentity' && !choice.grantAccess) {
|
|
30
|
-
return {
|
|
31
|
-
...choice,
|
|
32
|
-
shareIdentity: value === true
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (fieldName === 'grantAccess') {
|
|
36
|
-
return {
|
|
37
|
-
...choice,
|
|
38
|
-
grantAccess: value === true
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
const duration = typeof value === 'string' && value.length > 0 ? Number(value) : value;
|
|
42
|
-
if (fieldName === 'accessDuration' && isAccessDuration(duration)) {
|
|
43
|
-
return {
|
|
44
|
-
...choice,
|
|
45
|
-
accessDuration: duration
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
return choice;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Gets whether the command shares who the reporter is: always while access is granted, as granting access always
|
|
52
|
-
* shares who the reporter is, and otherwise as the reporter chose.
|
|
53
|
-
* @param choice The {@link AccessChoice}.
|
|
54
|
-
* @returns The value of the command's `shareIdentity`.
|
|
55
|
-
*/ function sharesIdentity(choice) {
|
|
56
|
-
return choice.grantAccess || choice.shareIdentity;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Gets when access granted now would end. The backend fixes the end itself when it records the grant; this is what
|
|
60
|
-
* the reporter is told before they send.
|
|
61
|
-
* @param duration The {@link AccessDuration}.
|
|
62
|
-
* @param now What time it is.
|
|
63
|
-
* @returns When access would end.
|
|
64
|
-
*/ function validUntilFor(duration, now) {
|
|
65
|
-
return new Date(now.getTime() + durationsInMilliseconds[duration]);
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Formats a point in time for the access notice and the access panel, such as `27 Oct, 18:10`.
|
|
69
|
-
* @param time The point in time.
|
|
70
|
-
* @param locale The locale to format for; the browser's when not given.
|
|
71
|
-
* @param timeZone The time zone to format in; the browser's when not given.
|
|
72
|
-
* @returns The formatted point in time.
|
|
73
|
-
*/ function formatTime(time, locale, timeZone) {
|
|
74
|
-
const date = new Intl.DateTimeFormat(locale, {
|
|
75
|
-
day: 'numeric',
|
|
76
|
-
month: 'short',
|
|
77
|
-
timeZone
|
|
78
|
-
}).format(time);
|
|
79
|
-
const clock = new Intl.DateTimeFormat(locale, {
|
|
80
|
-
hour: '2-digit',
|
|
81
|
-
minute: '2-digit',
|
|
82
|
-
hourCycle: 'h23',
|
|
83
|
-
timeZone
|
|
84
|
-
}).format(time);
|
|
85
|
-
return `${date}, ${clock}`;
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Formats the time of day only, such as `18:10`.
|
|
89
|
-
* @param time The point in time.
|
|
90
|
-
* @param locale The locale to format for; the browser's when not given.
|
|
91
|
-
* @param timeZone The time zone to format in; the browser's when not given.
|
|
92
|
-
* @returns The formatted time of day.
|
|
93
|
-
*/ function formatClock(time, locale, timeZone) {
|
|
94
|
-
return new Intl.DateTimeFormat(locale, {
|
|
95
|
-
hour: '2-digit',
|
|
96
|
-
minute: '2-digit',
|
|
97
|
-
hourCycle: 'h23',
|
|
98
|
-
timeZone
|
|
99
|
-
}).format(time);
|
|
100
|
-
}
|
|
101
|
-
function isAccessDuration(value) {
|
|
102
|
-
return typeof value === 'number' && Object.hasOwn(durationsInMilliseconds, value);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export { changeAccessChoice, formatClock, formatTime, initialAccessChoice, sharesIdentity, validUntilFor };
|
|
106
|
-
//# sourceMappingURL=AccessChoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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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"}
|