@oneuptime/common 14.0.2 → 14.0.5
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/Models/DatabaseModels/Alert.ts +55 -0
- package/Models/DatabaseModels/AlertFeed.ts +2 -0
- package/Models/DatabaseModels/DatabaseServer.ts +1650 -0
- package/Models/DatabaseModels/DatabaseServerEndpoint.ts +540 -0
- package/Models/DatabaseModels/DatabaseServerFeed.ts +625 -0
- package/Models/DatabaseModels/DatabaseServerLabelRule.ts +514 -0
- package/Models/DatabaseModels/DatabaseServerOwnerRule.ts +596 -0
- package/Models/DatabaseModels/DatabaseServerOwnerTeam.ts +491 -0
- package/Models/DatabaseModels/DatabaseServerOwnerUser.ts +490 -0
- package/Models/DatabaseModels/Incident.ts +55 -0
- package/Models/DatabaseModels/IncidentAlert.ts +540 -0
- package/Models/DatabaseModels/IncidentFeed.ts +2 -0
- package/Models/DatabaseModels/Index.ts +18 -0
- package/Models/DatabaseModels/NetworkDeviceDiscoveryScan.ts +26 -0
- package/Models/DatabaseModels/Project.ts +60 -0
- package/Models/DatabaseModels/RumApplication.ts +52 -1
- package/Models/DatabaseModels/ScheduledMaintenance.ts +55 -0
- package/Models/DatabaseModels/TelemetryException.ts +2 -0
- package/Models/DatabaseModels/UserProjectSsoConsent.ts +146 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.ts +28 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.ts +89 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.ts +673 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.ts +51 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +8 -0
- package/Server/Middleware/MultipartFormData.ts +1 -1
- package/Server/Middleware/TelemetryIngest.ts +15 -8
- package/Server/Services/AlertReminderRuleService.ts +100 -24
- package/Server/Services/DatabaseServerEndpointService.ts +895 -0
- package/Server/Services/DatabaseServerFeedService.ts +128 -0
- package/Server/Services/DatabaseServerLabelRuleEngineService.ts +340 -0
- package/Server/Services/DatabaseServerLabelRuleService.ts +14 -0
- package/Server/Services/DatabaseServerOwnerRuleEngineService.ts +425 -0
- package/Server/Services/DatabaseServerOwnerRuleService.ts +14 -0
- package/Server/Services/DatabaseServerOwnerTeamService.ts +180 -0
- package/Server/Services/DatabaseServerOwnerUserService.ts +173 -0
- package/Server/Services/DatabaseServerService.ts +4546 -0
- package/Server/Services/DatabaseService.ts +14 -8
- package/Server/Services/DockerResourceService.ts +43 -2
- package/Server/Services/IncidentAlertService.ts +1811 -0
- package/Server/Services/IncidentReminderRuleService.ts +103 -23
- package/Server/Services/IncidentService.ts +210 -10
- package/Server/Services/IncidentStateTimelineService.ts +24 -0
- package/Server/Services/Index.ts +18 -0
- package/Server/Services/InventoryItemService.ts +113 -5
- package/Server/Services/IoTDeviceService.ts +145 -37
- package/Server/Services/OpenTelemetryIngestService.ts +19 -0
- package/Server/Services/PodmanResourceService.ts +43 -2
- package/Server/Services/ScheduledMaintenanceReminderRuleService.ts +107 -23
- package/Server/Services/ServiceService.ts +1 -1
- package/Server/Services/TelemetryUsageBillingService.ts +29 -2
- package/Server/Services/UserProjectSsoConsentService.ts +74 -0
- package/Server/Services/UserService.ts +14 -1
- package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +18 -0
- package/Server/Types/Database/QueryHelper.ts +30 -1
- package/Server/Utils/AI/Toolbox/ResourceTools.ts +69 -1
- package/Server/Utils/Database/AffectedResourceRelations.ts +6 -0
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +188 -6
- package/Server/Utils/Monitor/MonitorAlert.ts +28 -1
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +2262 -755
- package/Server/Utils/Monitor/MonitorIncident.ts +28 -1
- package/Server/Utils/Monitor/MonitorMaintenanceSuppression.ts +268 -6
- package/Server/Utils/Monitor/MonitorResource.ts +47 -11
- package/Server/Utils/Monitor/MonitorResourceContext.ts +1 -0
- package/Server/Utils/Monitor/MonitorStepResourceIdentity.ts +239 -21
- package/Server/Utils/Monitor/PerSeriesResolutionRootCause.ts +43 -0
- package/Server/Utils/Monitor/SeriesResourceLabels.ts +291 -0
- package/Server/Utils/Monitor/SeriesResourceLinker.ts +111 -12
- package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
- package/Server/Utils/SessionReplay/SessionReplayGateCache.ts +24 -2
- package/Server/Utils/StartServer.ts +26 -6
- package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
- package/Server/Utils/Telemetry/DatabaseEndpointDiscovery.ts +688 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +5 -1
- package/Server/Utils/Telemetry/LogExceptionExtractor.ts +18 -1
- package/Server/Utils/Telemetry/ResourceEntityFilter.ts +175 -12
- package/Server/Utils/Telemetry/ResourceFacetResolver.ts +12 -0
- package/Server/Utils/Telemetry/ServiceDependencyDiscovery.ts +606 -36
- package/Server/Utils/Telemetry/Telemetry.ts +16 -0
- package/Server/Utils/Telemetry/TelemetryEntity.ts +22 -22
- package/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.ts +16 -10
- package/Tests/App/Accounts/SignedInRedirect.test.tsx +241 -0
- package/Tests/App/AdminDashboard/AdminHeaderSmallScreens.test.tsx +221 -4
- package/Tests/App/Dashboard/AIInsightsResourcePageContext.test.ts +42 -0
- package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +100 -0
- package/Tests/App/Dashboard/AffectedResourcesPicker.test.tsx +86 -0
- package/Tests/App/Dashboard/AffectedResourcesPickerHiddenTypes.test.tsx +2 -0
- package/Tests/App/Dashboard/AffectedResourcesSummaryStep.test.tsx +19 -0
- package/Tests/App/Dashboard/BreadcrumbCoverage.test.tsx +14 -0
- package/Tests/App/Dashboard/BulkIncidentLinkActions.test.tsx +869 -0
- package/Tests/App/Dashboard/CephMetricTooltips.test.tsx +1777 -0
- package/Tests/App/Dashboard/CloudFleetSummary.test.ts +8 -0
- package/Tests/App/Dashboard/CloudMetricTooltips.test.tsx +887 -0
- package/Tests/App/Dashboard/ContainerHostMetricTooltips.test.tsx +1309 -0
- package/Tests/App/Dashboard/CorrelateFilterBuilder.test.tsx +26 -1
- package/Tests/App/Dashboard/DashboardAppSsoError.test.tsx +501 -0
- package/Tests/App/Dashboard/DashboardHeaderRequests.test.tsx +64 -1
- package/Tests/App/Dashboard/DashboardHeaderSmallScreens.test.tsx +178 -18
- package/Tests/App/Dashboard/DashboardMasterPageSsoRedirect.test.tsx +444 -0
- package/Tests/App/Dashboard/DashboardNavBarForeignHiddenRule.test.tsx +573 -0
- package/Tests/App/Dashboard/DatabaseChartAxes.test.tsx +431 -0
- package/Tests/App/Dashboard/DatabaseContainerDetailBadge.test.tsx +249 -0
- package/Tests/App/Dashboard/DatabaseDashboardE2EFixes.test.ts +681 -0
- package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +1801 -0
- package/Tests/App/Dashboard/DatabaseFleetSummaryRefresh.test.tsx +280 -0
- package/Tests/App/Dashboard/DatabaseFormHelpers.test.tsx +321 -0
- package/Tests/App/Dashboard/DatabaseMetricMonitorLink.test.tsx +795 -0
- package/Tests/App/Dashboard/DatabaseOverviewHeader.test.tsx +580 -0
- package/Tests/App/Dashboard/DatabaseRecommendationsEngineMetrics.test.ts +270 -0
- package/Tests/App/Dashboard/DatabaseServerComponents.test.tsx +1486 -0
- package/Tests/App/Dashboard/DatabaseServerEngineMetricsFilter.test.ts +223 -0
- package/Tests/App/Dashboard/DatabaseServerPresentation.test.ts +435 -0
- package/Tests/App/Dashboard/DatabaseServerSummary.test.ts +186 -0
- package/Tests/App/Dashboard/DatabaseServerTelemetryQueries.test.ts +1553 -0
- package/Tests/App/Dashboard/DatabaseTableTruncation.test.tsx +326 -0
- package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +512 -0
- package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +774 -0
- package/Tests/App/Dashboard/DatabaseViewLayout.test.tsx +233 -0
- package/Tests/App/Dashboard/DatabaseWorkloadBadge.test.tsx +972 -0
- package/Tests/App/Dashboard/DiscoveryReviewInventoryRefresh.test.tsx +5 -0
- package/Tests/App/Dashboard/DiscoveryReviewUnnamedHostHint.test.tsx +1061 -0
- package/Tests/App/Dashboard/DiscoveryScanLivePage.test.tsx +39 -0
- package/Tests/App/Dashboard/DockerSwarmClustersListTooltips.test.tsx +414 -0
- package/Tests/App/Dashboard/DockerSwarmMetricTooltips.test.ts +796 -0
- package/Tests/App/Dashboard/DockerSwarmOverviewTooltips.test.tsx +747 -0
- package/Tests/App/Dashboard/EventOverlayScope.test.ts +147 -0
- package/Tests/App/Dashboard/EventOverlayScopeHook.test.tsx +1 -0
- package/Tests/App/Dashboard/ExceptionMonitorEnvironmentFilter.test.tsx +38 -18
- package/Tests/App/Dashboard/HostDetailViewTooltips.test.tsx +725 -0
- package/Tests/App/Dashboard/HostListColumnTooltips.test.tsx +472 -0
- package/Tests/App/Dashboard/HostMetricTooltips.test.ts +709 -0
- package/Tests/App/Dashboard/HostOverviewTooltips.test.tsx +698 -0
- package/Tests/App/Dashboard/HostTooltipHarness.ts +124 -0
- package/Tests/App/Dashboard/HostsListTooltips.test.tsx +395 -0
- package/Tests/App/Dashboard/IncidentAlertLinkDialog.test.tsx +691 -0
- package/Tests/App/Dashboard/IncidentAlertLinkHelpers.test.ts +458 -0
- package/Tests/App/Dashboard/IncidentAlertLinkPages.test.tsx +828 -0
- package/Tests/App/Dashboard/IncidentAlertLinkSideMenus.test.tsx +231 -0
- package/Tests/App/Dashboard/IncidentCreateFromAlerts.test.tsx +689 -0
- package/Tests/App/Dashboard/IoTMetricTooltips.test.tsx +1123 -0
- package/Tests/App/Dashboard/KubernetesClusterMetricTooltips.test.ts +837 -0
- package/Tests/App/Dashboard/KubernetesClusterOverviewTooltips.test.tsx +699 -0
- package/Tests/App/Dashboard/KubernetesContainersTabTooltips.test.tsx +320 -0
- package/Tests/App/Dashboard/KubernetesCostTooltips.test.tsx +502 -0
- package/Tests/App/Dashboard/KubernetesInsightsTooltips.test.tsx +222 -0
- package/Tests/App/Dashboard/KubernetesResourceMetricTooltips.test.ts +561 -0
- package/Tests/App/Dashboard/KubernetesResourcePagesTooltips.test.tsx +1168 -0
- package/Tests/App/Dashboard/LinkIncidentAlertModal.test.tsx +154 -0
- package/Tests/App/Dashboard/LogsResourceFacetChips.test.tsx +1 -0
- package/Tests/App/Dashboard/MetricDescriptionRules.ts +170 -0
- package/Tests/App/Dashboard/MetricDescriptionsCatalog.test.ts +206 -0
- package/Tests/App/Dashboard/MetricDescriptionsConsistency.test.ts +275 -0
- package/Tests/App/Dashboard/MetricsViewerDrillDown.test.tsx +310 -0
- package/Tests/App/Dashboard/MetricsViewerEntityScopedRows.test.tsx +495 -0
- package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +132 -1
- package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +5 -0
- package/Tests/App/Dashboard/NetworkDeviceTooltips.test.tsx +852 -0
- package/Tests/App/Dashboard/NetworkDiagnosticsTooltips.test.tsx +556 -0
- package/Tests/App/Dashboard/NetworkMetricTooltips.test.ts +1348 -0
- package/Tests/App/Dashboard/NetworkSiteTooltips.test.tsx +679 -0
- package/Tests/App/Dashboard/ProductOrientation.test.tsx +4 -3
- package/Tests/App/Dashboard/ProxmoxMetricTooltips.test.ts +592 -0
- package/Tests/App/Dashboard/ProxmoxOverviewTooltips.test.tsx +1002 -0
- package/Tests/App/Dashboard/ProxmoxResourcePageTooltips.test.tsx +923 -0
- package/Tests/App/Dashboard/RecommendationsLoadedContext.test.tsx +349 -0
- package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +62 -0
- package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +8 -1
- package/Tests/App/Dashboard/ResourceFeedPagesFilterSort.test.tsx +14 -0
- package/Tests/App/Dashboard/ResourceOverviewTileTooltips.test.tsx +1066 -0
- package/Tests/App/Dashboard/RumOverviewPage.test.tsx +1195 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +2 -0
- package/Tests/App/Dashboard/ServerlessMetricTooltips.test.tsx +474 -0
- package/Tests/App/Dashboard/ServiceMapDatabaseLink.test.tsx +1085 -0
- package/Tests/App/Dashboard/ServiceMetricTooltips.test.tsx +772 -0
- package/Tests/App/Dashboard/SessionReplayAuditTable.test.tsx +56 -1
- package/Tests/App/Dashboard/TelemetryMetricsSignals.test.ts +1207 -0
- package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +10 -0
- package/Tests/App/Dashboard/TelemetryResourceTabTooltips.test.tsx +437 -0
- package/Tests/App/Dashboard/TracesResourceFacets.test.tsx +2 -1
- package/Tests/App/Dashboard/VMwareMetricTooltips.test.ts +801 -0
- package/Tests/App/Dashboard/VMwareOverviewTooltips.test.tsx +601 -0
- package/Tests/App/Dashboard/VMwareResourcePagesTooltips.test.tsx +646 -0
- package/Tests/App/Dashboard/VMwareTooltipHarness.ts +145 -0
- package/Tests/App/StatusPage/StatusPageHeaderForeignHiddenRule.test.tsx +284 -0
- package/Tests/ClassStrings.ts +178 -0
- package/Tests/Fixtures/MobilePasskeyUser.json +1 -2
- package/Tests/ForeignHiddenRuleGuard.ts +2152 -0
- package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +2250 -0
- package/Tests/Models/DatabaseModels/IncidentAlertModel.test.ts +554 -0
- package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +24 -5
- package/Tests/Models/DatabaseModels/SessionReplayModels.test.ts +117 -0
- package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
- package/Tests/RenderedMarkup.ts +518 -0
- package/Tests/ResponsiveVisibility.test.ts +490 -4
- package/Tests/ResponsiveVisibility.ts +505 -52
- package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
- package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +541 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentAlertMigration.test.ts +341 -0
- package/Tests/Server/Infrastructure/Postgres/AddSessionReplaySameOriginTracePropagationMigration.test.ts +247 -0
- package/Tests/Server/Infrastructure/Postgres/AddUserProjectSsoConsentMigration.test.ts +234 -0
- package/Tests/Server/Services/ContainerSnapshotUpsertPostgres.test.ts +319 -0
- package/Tests/Server/Services/CrossProjectRelationWriteGuard.test.ts +13 -0
- package/Tests/Server/Services/DatabaseServerEndpointService.test.ts +2033 -0
- package/Tests/Server/Services/DatabaseServerFeedAndOwnerServices.test.ts +529 -0
- package/Tests/Server/Services/DatabaseServerLifecycle.test.ts +3302 -0
- package/Tests/Server/Services/DatabaseServerRegistries.test.ts +603 -0
- package/Tests/Server/Services/DatabaseServerRuleEngines.test.ts +754 -0
- package/Tests/Server/Services/DatabaseServerService.test.ts +3558 -0
- package/Tests/Server/Services/DatabaseServerSqlPostgres.test.ts +2045 -0
- package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedPostgres.test.ts +362 -0
- package/Tests/Server/Services/DatabaseServiceUpdateColumnsIfUnlockedReply.test.ts +210 -0
- package/Tests/Server/Services/HookFreeWriteLengthClamp.test.ts +18 -0
- package/Tests/Server/Services/IncidentAlertPostgres.test.ts +903 -0
- package/Tests/Server/Services/IncidentAlertRegistration.test.ts +96 -0
- package/Tests/Server/Services/IncidentAlertService.test.ts +2225 -0
- package/Tests/Server/Services/IncidentAlertSloLinkSurvivesEdit.test.ts +2 -0
- package/Tests/Server/Services/IncidentAlertStateCascade.test.ts +970 -0
- package/Tests/Server/Services/IncidentCreateFromAlerts.test.ts +1284 -0
- package/Tests/Server/Services/IncomingCallPolicyEscalationRuleTarget.test.ts +225 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +280 -2
- package/Tests/Server/Services/InventoryUpsertSchemaParity.test.ts +8 -2
- package/Tests/Server/Services/IoTDeviceLatestMetricsPostgres.test.ts +689 -0
- package/Tests/Server/Services/IoTDeviceService.test.ts +379 -0
- package/Tests/Server/Services/LatestMetricsValuesShape.test.ts +360 -0
- package/Tests/Server/Services/LlmModelPriceService.test.ts +402 -0
- package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +7 -1
- package/Tests/Server/Services/OwnerRowUniqueness.test.ts +61 -9
- package/Tests/Server/Services/ReminderRuleLookupPostgres.test.ts +2250 -0
- package/Tests/Server/Services/ReminderRuleRefreshOpenSubjectsPaging.test.ts +653 -0
- package/Tests/Server/Services/ResourceUpdateLastSeenLivenessFallback.test.ts +68 -20
- package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
- package/Tests/Server/Services/TelemetryResourceFacetCounting.test.ts +9 -0
- package/Tests/Server/Services/UserProjectSsoConsentPostgres.test.ts +153 -0
- package/Tests/Server/Services/UserProjectSsoConsentService.test.ts +192 -0
- package/Tests/Server/Services/UserServiceFirstMasterAdminElection.test.ts +71 -0
- package/Tests/Server/Services/UserSignupIdTakeoverPostgres.test.ts +238 -0
- package/Tests/Server/Services/WorkspaceNotificationSummaryHelpers.test.ts +592 -0
- package/Tests/Server/Types/Billing/PayAsYouGoMeteredAuthorization.test.ts +3 -0
- package/Tests/Server/Types/Database/EventOverlayScopePostgres.test.ts +1 -0
- package/Tests/Server/Types/Database/FeedEventTypeFilterQuery.test.ts +11 -0
- package/Tests/Server/Types/Database/Permissions/InfrastructureOwnershipScope.test.ts +8 -0
- package/Tests/Server/Types/Database/QueryHelperBooleanForCriteriaBackedRule.test.ts +1094 -0
- package/Tests/Server/Utils/AI/ResourceTools.test.ts +134 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.test.ts +41 -0
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +279 -9
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaDisplayContext.test.ts +933 -0
- package/Tests/Server/Utils/Monitor/DatabaseMaintenanceSuppression.test.ts +582 -0
- package/Tests/Server/Utils/Monitor/DatabaseServerMonitorLinking.test.ts +753 -0
- package/Tests/Server/Utils/Monitor/MonitorActionTimestamps.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertCriteriaReferences.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorAlertResourceLinking.test.ts +119 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +60 -25
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorAffectedResourceEdgeCases.test.ts +1719 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesAffectedResources.test.ts +1447 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorKubernetesRatioEmail.test.ts +352 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformMetricUnits.test.ts +717 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformRawScan.test.ts +2125 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorPlatformSeriesAffectedResources.test.ts +1288 -0
- package/Tests/Server/Utils/Monitor/MonitorDependencySuppressionCreatorSkip.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentCriteriaReferences.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentMemberRoleMembership.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/MonitorIncidentResourceLinking.test.ts +88 -0
- package/Tests/Server/Utils/Monitor/MonitorMaintenanceSuppression.test.ts +205 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceContext.test.ts +62 -0
- package/Tests/Server/Utils/Monitor/MonitorResourceDatabaseMaintenance.test.ts +803 -0
- package/Tests/Server/Utils/Monitor/MonitorStepResourceIdentity.test.ts +133 -3
- package/Tests/Server/Utils/Monitor/MonitorSummaryPersistence.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/PerSeriesRecoveryResolution.test.ts +472 -1
- package/Tests/Server/Utils/Monitor/PerSeriesSecondEntityAlerting.test.ts +1 -0
- package/Tests/Server/Utils/Monitor/SeriesResourceLinker.test.ts +236 -2
- package/Tests/Server/Utils/SeriesResourceLabels.test.ts +70 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayGateCachePolicy.test.ts +103 -0
- package/Tests/Server/Utils/StartServerProtobufContentType.test.ts +54 -0
- package/Tests/Server/Utils/Telemetry/DatabaseEndpointDiscovery.test.ts +1895 -0
- package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +7 -0
- package/Tests/Server/Utils/Telemetry/LogExceptionExtractorSeverityGate.test.ts +90 -0
- package/Tests/Server/Utils/Telemetry/ResourceEntityFilter.test.ts +570 -0
- package/Tests/Server/Utils/Telemetry/ResourceFacetResolver.test.ts +97 -2
- package/Tests/Server/Utils/Telemetry/ServiceDependencyDiscovery.test.ts +1337 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +295 -0
- package/Tests/Types/AI/AIResourceContext.test.ts +30 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerClassifier.test.ts +3644 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommand.test.ts +340 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommandCorpus.ts +826 -0
- package/Tests/Types/DatabaseServer/DatabaseContainerCommandPostgres.test.ts +150 -0
- package/Tests/Types/DatabaseServer/DatabaseEndpoint.test.ts +2657 -0
- package/Tests/Types/DatabaseServer/DatabaseServerDiscoverySource.test.ts +64 -0
- package/Tests/Types/DatabaseServer/DatabaseServerEntityKeys.test.ts +952 -0
- package/Tests/Types/DatabaseServer/DatabaseServerMetricCatalog.test.ts +1161 -0
- package/Tests/Types/DatabaseServer/DatabaseSystem.test.ts +1514 -0
- package/Tests/Types/DatabaseServer/DatabaseTelemetryResolver.test.ts +1558 -0
- package/Tests/Types/Monitor/CephAlertTemplates.test.ts +255 -6
- package/Tests/Types/Monitor/DatabaseAlertTemplates.test.ts +2254 -0
- package/Tests/Types/Monitor/KubernetesAlertTemplates.test.ts +298 -0
- package/Tests/Types/Monitor/KubernetesMetricCatalog.test.ts +271 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +253 -9
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCoverage.test.ts +13 -5
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationNotificationMode.test.ts +4 -2
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +111 -2
- package/Tests/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.test.ts +61 -0
- package/Tests/Types/Monitor/SeriesContext/SeriesLabelDisplay.test.ts +114 -0
- package/Tests/Types/Monitor/Utils/KubernetesAgentEmittedMetrics.ts +181 -0
- package/Tests/Types/NetworkDevice/DiscoveredHostNamingStatus.test.ts +401 -0
- package/Tests/Types/Rum/WebVitals.test.ts +173 -0
- package/Tests/Types/Telemetry/ResourceEntityFacet.test.ts +4 -1
- package/Tests/Types/Telemetry/ResourceFacetCatalog.test.ts +24 -2
- package/Tests/UI/Components/Card.test.tsx +93 -2
- package/Tests/UI/Components/FeedOptions.test.ts +6 -0
- package/Tests/UI/Components/FeedOptionsButton.test.tsx +8 -1
- package/Tests/UI/Components/FieldLabelInfoCardTooltip.test.tsx +413 -0
- package/Tests/UI/Components/ForeignHiddenRuleResilience.test.tsx +1147 -0
- package/Tests/UI/Components/HeaderRightRail.test.tsx +41 -1
- package/Tests/UI/Components/InfoTooltip.test.tsx +242 -0
- package/Tests/UI/Components/LogsEntityNames.test.ts +16 -1
- package/Tests/UI/Components/LogsFacetSidebarHiddenFacets.test.tsx +7 -3
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDelete.test.tsx +207 -3
- package/Tests/UI/Components/ModelTable/BaseModelTableBulkDeleteVerb.test.tsx +367 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableCreateButtonTitle.test.tsx +275 -0
- package/Tests/UI/Components/ResourceFacetConfigs.test.ts +2 -1
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
- package/Tests/UI/Components/SrOnlyForeignRule.test.tsx +994 -0
- package/Tests/UI/Components/StatusPage/ResourceListSelection.test.tsx +34 -1
- package/Tests/UI/Components/TableHeaderTooltip.test.tsx +662 -0
- package/Tests/UI/Components/TelemetryFacetSidebarHiddenFacets.test.tsx +4 -1
- package/Tests/UI/ForeignHiddenRuleGuard.test.ts +1951 -0
- package/Tests/UI/Rum/PrivacySummaryCard.test.tsx +166 -9
- package/Tests/UI/Rum/RecordingHealthTooltips.test.tsx +447 -0
- package/Tests/UI/Rum/ReplayCorrelationPanel.test.tsx +164 -0
- package/Tests/UI/Rum/ReplayFrameCapture.test.ts +6750 -0
- package/Tests/UI/Rum/ReplayPlayerChrome.test.tsx +19 -1
- package/Tests/UI/Rum/ReplayRail.test.tsx +723 -12
- package/Tests/UI/Rum/ReplayRailDetail.test.tsx +86 -0
- package/Tests/UI/Rum/ReplayScreenshot.test.ts +2124 -0
- package/Tests/UI/Rum/ReplayScreenshotActions.test.tsx +3288 -0
- package/Tests/UI/Rum/ReplayStage.test.tsx +62 -0
- package/Tests/UI/Rum/ReplayStageOverlays.test.tsx +983 -2
- package/Tests/UI/Rum/ReplayTabSwitcher.test.tsx +19 -1
- package/Tests/UI/Rum/SessionReplaySettingsPolicyLoading.test.tsx +149 -0
- package/Tests/UI/Rum/SessionReplaySetupGuide.test.tsx +107 -6
- package/Tests/UI/Rum/SessionReplayUsersTableTooltips.test.tsx +330 -0
- package/Tests/UI/Rum/UserFlowTooltips.test.tsx +886 -0
- package/Tests/UI/TailwindPlayCdnForeignHiddenRule.test.ts +1005 -0
- package/Tests/UI/ThemeGroupHoverReveal.test.ts +847 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +80 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +23 -0
- package/Tests/UI/Utils/ModelAPISsoRedirect.test.ts +127 -0
- package/Tests/UI/Utils/Navigation.test.ts +102 -0
- package/Tests/UI/Utils/PermissionGate.test.ts +76 -0
- package/Tests/UI/Utils/Telemetry/TelemetryEntityNames.test.ts +23 -0
- package/Tests/Utils/Incident/IncidentFromAlerts.test.ts +696 -0
- package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
- package/Tests/Utils/MetricUnitUtil.test.ts +227 -2
- package/Tests/Utils/Monitor/MetricValueFormatter.test.ts +288 -2
- package/Tests/Utils/Monitor/PlatformResourceIdentityAndUnits.test.ts +1559 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.test.ts +2546 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveredHostUtil.test.ts +315 -0
- package/Tests/Utils/NetworkDiscovery/DiscoveryReverseDnsChain.test.ts +336 -1
- package/Tests/Utils/NetworkDiscovery/NetbiosNameUtil.test.ts +244 -0
- package/Tests/Utils/Rum/SessionTraceState.test.ts +239 -0
- package/Tests/Utils/ValueFormatter.test.ts +50 -0
- package/Tests/tsconfig.json +16 -0
- package/Types/AI/AIResourceContext.ts +7 -0
- package/Types/Dashboard/DashboardTemplates.ts +2 -1
- package/Types/DatabaseServer/DatabaseConnectionSpan.ts +77 -0
- package/Types/DatabaseServer/DatabaseContainerClassifier.ts +2068 -0
- package/Types/DatabaseServer/DatabaseContainerCommand.ts +801 -0
- package/Types/DatabaseServer/DatabaseEndpoint.ts +1943 -0
- package/Types/DatabaseServer/DatabaseServerDiscoverySource.ts +68 -0
- package/Types/DatabaseServer/DatabaseServerMetricCatalog.ts +966 -0
- package/Types/DatabaseServer/DatabaseSystem.ts +2124 -0
- package/Types/DatabaseServer/DatabaseTelemetryResolver.ts +555 -0
- package/Types/Email/EmailTemplateType.ts +1 -0
- package/Types/Incident/IncidentAlertLink.ts +38 -0
- package/Types/Monitor/CephAlertTemplates.ts +18 -0
- package/Types/Monitor/DatabaseAlertTemplates.ts +2020 -0
- package/Types/Monitor/KubernetesAlertTemplates.ts +64 -24
- package/Types/Monitor/KubernetesMetricCatalog.ts +118 -19
- package/Types/Monitor/MetricMonitor/MetricCriteriaContext.ts +14 -0
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +93 -10
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +109 -8
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +36 -7
- package/Types/Monitor/Recommendation/MonitorRecommendationUtil.ts +43 -2
- package/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.ts +41 -6
- package/Types/Monitor/SeriesContext/SeriesLabelDisplay.ts +26 -0
- package/Types/NetworkDevice/DiscoveredHostNamingStatus.ts +147 -0
- package/Types/Permission.ts +315 -0
- package/Types/Probe/ProbeApiIngestResponse.ts +8 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.ts +10 -0
- package/Types/Rules/RuleRun.ts +12 -0
- package/Types/Rum/SessionReplay.ts +25 -6
- package/Types/Rum/WebVitals.ts +52 -0
- package/Types/Telemetry/EntityType.ts +23 -0
- package/Types/Telemetry/ResourceFacetCatalog.ts +14 -0
- package/Types/Telemetry/ServiceType.ts +8 -0
- package/UI/Components/Banner/Banner.tsx +1 -1
- package/UI/Components/Card/Card.tsx +1 -1
- package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +2 -2
- package/UI/Components/Charts/Line/LineChart.tsx +7 -0
- package/UI/Components/CommandPalette/CommandPalette.tsx +1 -1
- package/UI/Components/Date/StartAndEndDate.tsx +5 -5
- package/UI/Components/Detail/FieldLabel.tsx +8 -0
- package/UI/Components/Diagram/HorizontalStepChain.tsx +1 -1
- package/UI/Components/Feed/FeedOptionsButton.tsx +1 -1
- package/UI/Components/Forms/BasicForm.tsx +1 -1
- package/UI/Components/Header/Header.tsx +1 -1
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +1 -1
- package/UI/Components/HeaderAlert/HeaderAlert.tsx +1 -1
- package/UI/Components/InfoCard/InfoCard.tsx +47 -1
- package/UI/Components/LogsViewer/components/FacetValueRow.tsx +1 -1
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +1 -1
- package/UI/Components/Modal/ModalFooter.tsx +1 -1
- package/UI/Components/ModelDetail/CardModelDetail.tsx +2 -2
- package/UI/Components/ModelTable/BaseModelTable.tsx +99 -21
- package/UI/Components/ModelTable/Column.ts +5 -0
- package/UI/Components/Navbar/NavBar.tsx +9 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +2 -2
- package/UI/Components/Page/Page.tsx +1 -1
- package/UI/Components/Pagination/Pagination.tsx +3 -3
- package/UI/Components/ProgressButtons/ProgressButtonItem.tsx +1 -1
- package/UI/Components/SideMenu/SideMenu.tsx +4 -1
- package/UI/Components/StatusPage/ResourceGroupNavigator.tsx +4 -2
- package/UI/Components/StatusPage/ResourceList.tsx +6 -6
- package/UI/Components/Table/TableHeader.tsx +47 -2
- package/UI/Components/Table/Types/Column.ts +7 -0
- package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +1 -1
- package/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.tsx +1 -1
- package/UI/Components/Tooltip/InfoTooltip.tsx +78 -0
- package/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.tsx +1 -1
- package/UI/Components/Workflow/ComponentsModal.tsx +2 -2
- package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
- package/UI/Styles/Theme.css +8 -1
- package/UI/Utils/Navigation.ts +89 -42
- package/UI/Utils/PermissionGate.ts +11 -2
- package/UI/Utils/Telemetry/TelemetryEntityNames.ts +7 -0
- package/UI/Utils/TelemetryService.ts +4 -3
- package/Utils/Incident/IncidentFromAlerts.ts +516 -0
- package/Utils/LabelRuleImportExport.ts +2 -0
- package/Utils/MetricUnitUtil.ts +103 -11
- package/Utils/Monitor/MetricValueFormatter.ts +66 -13
- package/Utils/Monitor/PlatformMetricUnitUtil.ts +215 -0
- package/Utils/Monitor/PlatformResourceIdentity.ts +514 -0
- package/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.ts +425 -0
- package/Utils/NetworkDiscovery/DiscoveredHostUtil.ts +32 -0
- package/Utils/NetworkDiscovery/NetbiosNameUtil.ts +73 -0
- package/Utils/Rum/SessionTraceState.ts +212 -0
- package/Utils/Telemetry/DatabaseServerEntityKeys.ts +275 -0
- package/Utils/Telemetry/EntityKey.ts +176 -0
- package/Utils/ValueFormatter.ts +16 -0
- package/build/dist/Models/DatabaseModels/Alert.js +54 -0
- package/build/dist/Models/DatabaseModels/Alert.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/AlertFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseServer.js +1683 -0
- package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js +559 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerEndpoint.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js +648 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerFeed.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js +522 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js +603 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js +506 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js +505 -0
- package/build/dist/Models/DatabaseModels/DatabaseServerOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/Incident.js +54 -0
- package/build/dist/Models/DatabaseModels/Incident.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentAlert.js +553 -0
- package/build/dist/Models/DatabaseModels/IncidentAlert.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/IncidentFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +18 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceDiscoveryScan.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +62 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js +53 -1
- package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js +54 -0
- package/build/dist/Models/DatabaseModels/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryException.js +2 -0
- package/build/dist/Models/DatabaseModels/TelemetryException.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js +162 -0
- package/build/dist/Models/DatabaseModels/UserProjectSsoConsent.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794800000000-AddSessionReplaySameOriginTracePropagation.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js +42 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794900000000-AddIncidentAlert.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js +240 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795000000000-AddDatabaseServerTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1795100000000-AddUserProjectSsoConsent.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +8 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/MultipartFormData.js +1 -1
- package/build/dist/Server/Middleware/TelemetryIngest.js +15 -8
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Services/AlertReminderRuleService.js +72 -23
- package/build/dist/Server/Services/AlertReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseServerEndpointService.js +694 -0
- package/build/dist/Server/Services/DatabaseServerEndpointService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerFeedService.js +110 -0
- package/build/dist/Server/Services/DatabaseServerFeedService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js +272 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleService.js +13 -0
- package/build/dist/Server/Services/DatabaseServerLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js +340 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/DatabaseServerOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js +160 -0
- package/build/dist/Server/Services/DatabaseServerOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerOwnerUserService.js +153 -0
- package/build/dist/Server/Services/DatabaseServerOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseServerService.js +3272 -0
- package/build/dist/Server/Services/DatabaseServerService.js.map +1 -0
- package/build/dist/Server/Services/DatabaseService.js +8 -4
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/DockerResourceService.js +30 -3
- package/build/dist/Server/Services/DockerResourceService.js.map +1 -1
- package/build/dist/Server/Services/IncidentAlertService.js +1370 -0
- package/build/dist/Server/Services/IncidentAlertService.js.map +1 -0
- package/build/dist/Server/Services/IncidentReminderRuleService.js +73 -23
- package/build/dist/Server/Services/IncidentReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +164 -12
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentStateTimelineService.js +21 -0
- package/build/dist/Server/Services/IncidentStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +18 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemService.js +88 -5
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -1
- package/build/dist/Server/Services/IoTDeviceService.js +111 -24
- package/build/dist/Server/Services/IoTDeviceService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +24 -9
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/PodmanResourceService.js +30 -3
- package/build/dist/Server/Services/PodmanResourceService.js.map +1 -1
- package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js +75 -23
- package/build/dist/Server/Services/ScheduledMaintenanceReminderRuleService.js.map +1 -1
- package/build/dist/Server/Services/ServiceService.js +1 -1
- package/build/dist/Server/Services/ServiceService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +23 -2
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/UserProjectSsoConsentService.js +79 -0
- package/build/dist/Server/Services/UserProjectSsoConsentService.js.map +1 -0
- package/build/dist/Server/Services/UserService.js +13 -1
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +18 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
- package/build/dist/Server/Types/Database/QueryHelper.js +26 -1
- package/build/dist/Server/Types/Database/QueryHelper.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js +46 -0
- package/build/dist/Server/Utils/AI/Toolbox/ResourceTools.js.map +1 -1
- package/build/dist/Server/Utils/Database/AffectedResourceRelations.js +6 -0
- package/build/dist/Server/Utils/Database/AffectedResourceRelations.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +134 -13
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js +22 -6
- package/build/dist/Server/Utils/Monitor/MonitorAlert.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +1489 -524
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js +22 -6
- package/build/dist/Server/Utils/Monitor/MonitorIncident.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js +196 -6
- package/build/dist/Server/Utils/Monitor/MonitorMaintenanceSuppression.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResource.js +36 -9
- package/build/dist/Server/Utils/Monitor/MonitorResource.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js +1 -0
- package/build/dist/Server/Utils/Monitor/MonitorResourceContext.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js +175 -17
- package/build/dist/Server/Utils/Monitor/MonitorStepResourceIdentity.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js +29 -0
- package/build/dist/Server/Utils/Monitor/PerSeriesResolutionRootCause.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js +211 -0
- package/build/dist/Server/Utils/Monitor/SeriesResourceLabels.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js +82 -10
- package/build/dist/Server/Utils/Monitor/SeriesResourceLinker.js.map +1 -1
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js +8 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayGateCache.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +20 -4
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js +442 -0
- package/build/dist/Server/Utils/Telemetry/DatabaseEndpointDiscovery.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +5 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js +15 -1
- package/build/dist/Server/Utils/Telemetry/LogExceptionExtractor.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +121 -5
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js +12 -0
- package/build/dist/Server/Utils/Telemetry/ResourceFacetResolver.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js +438 -36
- package/build/dist/Server/Utils/Telemetry/ServiceDependencyDiscovery.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/Telemetry.js +12 -0
- package/build/dist/Server/Utils/Telemetry/Telemetry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +17 -18
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js +16 -10
- package/build/dist/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.js.map +1 -1
- package/build/dist/Types/AI/AIResourceContext.js +7 -0
- package/build/dist/Types/AI/AIResourceContext.js.map +1 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js +2 -1
- package/build/dist/Types/Dashboard/DashboardTemplates.js.map +1 -1
- package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js +71 -0
- package/build/dist/Types/DatabaseServer/DatabaseConnectionSpan.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js +1462 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerClassifier.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js +691 -0
- package/build/dist/Types/DatabaseServer/DatabaseContainerCommand.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js +1407 -0
- package/build/dist/Types/DatabaseServer/DatabaseEndpoint.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js +60 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerDiscoverySource.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js +804 -0
- package/build/dist/Types/DatabaseServer/DatabaseServerMetricCatalog.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseSystem.js +1860 -0
- package/build/dist/Types/DatabaseServer/DatabaseSystem.js.map +1 -0
- package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js +406 -0
- package/build/dist/Types/DatabaseServer/DatabaseTelemetryResolver.js.map +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js +1 -0
- package/build/dist/Types/Email/EmailTemplateType.js.map +1 -1
- package/build/dist/Types/Incident/IncidentAlertLink.js +34 -0
- package/build/dist/Types/Incident/IncidentAlertLink.js.map +1 -0
- package/build/dist/Types/Monitor/CephAlertTemplates.js +18 -0
- package/build/dist/Types/Monitor/CephAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/DatabaseAlertTemplates.js +1518 -0
- package/build/dist/Types/Monitor/DatabaseAlertTemplates.js.map +1 -0
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js +57 -24
- package/build/dist/Types/Monitor/KubernetesAlertTemplates.js.map +1 -1
- package/build/dist/Types/Monitor/KubernetesMetricCatalog.js +104 -18
- package/build/dist/Types/Monitor/KubernetesMetricCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +80 -3
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +10 -3
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js +29 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationUtil.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js +21 -6
- package/build/dist/Types/Monitor/Recommendation/RecommendationCriteriaBuilder.js.map +1 -1
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js +25 -0
- package/build/dist/Types/Monitor/SeriesContext/SeriesLabelDisplay.js.map +1 -1
- package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js +136 -0
- package/build/dist/Types/NetworkDevice/DiscoveredHostNamingStatus.js.map +1 -0
- package/build/dist/Types/Permission.js +276 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +10 -0
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
- package/build/dist/Types/Rules/RuleRun.js +4 -0
- package/build/dist/Types/Rules/RuleRun.js.map +1 -1
- package/build/dist/Types/Rum/WebVitals.js +25 -0
- package/build/dist/Types/Rum/WebVitals.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +23 -0
- package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js +14 -0
- package/build/dist/Types/Telemetry/ResourceFacetCatalog.js.map +1 -1
- package/build/dist/Types/Telemetry/ServiceType.js +8 -0
- package/build/dist/Types/Telemetry/ServiceType.js.map +1 -1
- package/build/dist/UI/Components/Banner/Banner.js +1 -1
- package/build/dist/UI/Components/Banner/Banner.js.map +1 -1
- package/build/dist/UI/Components/Card/Card.js +1 -1
- package/build/dist/UI/Components/Card/Card.js.map +1 -1
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +2 -2
- package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js +1 -1
- package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js +1 -1
- package/build/dist/UI/Components/CommandPalette/CommandPalette.js.map +1 -1
- package/build/dist/UI/Components/Date/StartAndEndDate.js +5 -5
- package/build/dist/UI/Components/Date/StartAndEndDate.js.map +1 -1
- package/build/dist/UI/Components/Detail/FieldLabel.js +2 -0
- package/build/dist/UI/Components/Detail/FieldLabel.js.map +1 -1
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js +1 -1
- package/build/dist/UI/Components/Diagram/HorizontalStepChain.js.map +1 -1
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js +1 -1
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js.map +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js +1 -1
- package/build/dist/UI/Components/Forms/BasicForm.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js +1 -1
- package/build/dist/UI/Components/HeaderAlert/HeaderAlert.js.map +1 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js +22 -1
- package/build/dist/UI/Components/InfoCard/InfoCard.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/FacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js +1 -1
- package/build/dist/UI/Components/Modal/ModalFooter.js.map +1 -1
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js +2 -2
- package/build/dist/UI/Components/ModelDetail/CardModelDetail.js.map +1 -1
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +70 -18
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBar.js +9 -2
- package/build/dist/UI/Components/Navbar/NavBar.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +2 -2
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/Page/Page.js +1 -1
- package/build/dist/UI/Components/Page/Page.js.map +1 -1
- package/build/dist/UI/Components/Pagination/Pagination.js +3 -3
- package/build/dist/UI/Components/Pagination/Pagination.js.map +1 -1
- package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js +1 -1
- package/build/dist/UI/Components/ProgressButtons/ProgressButtonItem.js.map +1 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js +4 -1
- package/build/dist/UI/Components/SideMenu/SideMenu.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js +3 -1
- package/build/dist/UI/Components/StatusPage/ResourceGroupNavigator.js.map +1 -1
- package/build/dist/UI/Components/StatusPage/ResourceList.js +6 -6
- package/build/dist/UI/Components/StatusPage/ResourceList.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +18 -2
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetValueRow.js.map +1 -1
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js +28 -0
- package/build/dist/UI/Components/Tooltip/InfoTooltip.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js +1 -1
- package/build/dist/UI/Components/Workflow/ColumnEditor/ModelQueryBuilder.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +2 -2
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
- package/build/dist/UI/Utils/Navigation.js +66 -33
- package/build/dist/UI/Utils/Navigation.js.map +1 -1
- package/build/dist/UI/Utils/PermissionGate.js +4 -2
- package/build/dist/UI/Utils/PermissionGate.js.map +1 -1
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js +7 -0
- package/build/dist/UI/Utils/Telemetry/TelemetryEntityNames.js.map +1 -1
- package/build/dist/UI/Utils/TelemetryService.js +3 -2
- package/build/dist/UI/Utils/TelemetryService.js.map +1 -1
- package/build/dist/Utils/Incident/IncidentFromAlerts.js +306 -0
- package/build/dist/Utils/Incident/IncidentFromAlerts.js.map +1 -0
- package/build/dist/Utils/LabelRuleImportExport.js +2 -0
- package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
- package/build/dist/Utils/MetricUnitUtil.js +77 -13
- package/build/dist/Utils/MetricUnitUtil.js.map +1 -1
- package/build/dist/Utils/Monitor/MetricValueFormatter.js +58 -13
- package/build/dist/Utils/Monitor/MetricValueFormatter.js.map +1 -1
- package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js +161 -0
- package/build/dist/Utils/Monitor/PlatformMetricUnitUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/PlatformResourceIdentity.js +323 -0
- package/build/dist/Utils/Monitor/PlatformResourceIdentity.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js +270 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostNamingDiagnosis.js.map +1 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js +23 -0
- package/build/dist/Utils/NetworkDiscovery/DiscoveredHostUtil.js.map +1 -1
- package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js +61 -0
- package/build/dist/Utils/NetworkDiscovery/NetbiosNameUtil.js.map +1 -1
- package/build/dist/Utils/Rum/SessionTraceState.js +154 -0
- package/build/dist/Utils/Rum/SessionTraceState.js.map +1 -0
- package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js +178 -0
- package/build/dist/Utils/Telemetry/DatabaseServerEntityKeys.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +133 -0
- package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
- package/build/dist/Utils/ValueFormatter.js +15 -0
- package/build/dist/Utils/ValueFormatter.js.map +1 -1
- package/package.json +1 -1
- package/tsconfig.tests.json +7 -5
|
@@ -2,18 +2,29 @@
|
|
|
2
2
|
* Answers "would a browser paint this element at viewport width W?" for markup
|
|
3
3
|
* styled with Tailwind display utilities.
|
|
4
4
|
*
|
|
5
|
-
* jsdom has no stylesheet, so `toBeVisible()` cannot see a `
|
|
5
|
+
* jsdom has no stylesheet, so `toBeVisible()` cannot see a `max-lg:hidden`
|
|
6
6
|
* wrapper: to jsdom the element is present and visible at every width, which is
|
|
7
7
|
* exactly the blind spot that let the header ship with its whole right rail —
|
|
8
|
-
* profile button included — wrapped in
|
|
9
|
-
* on every phone and tablet. These helpers read the class attribute
|
|
10
|
-
* resolve the display the same way the cascade would.
|
|
8
|
+
* profile button included — wrapped in a lg-only container and therefore
|
|
9
|
+
* missing on every phone and tablet. These helpers read the class attribute
|
|
10
|
+
* instead and resolve the display the same way the cascade would.
|
|
11
11
|
*
|
|
12
|
-
* Scope: `display` only,
|
|
13
|
-
* utilities. State variants (hover:,
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
12
|
+
* Scope: `display` only, from unprefixed, min-width (`md:`) and max-width
|
|
13
|
+
* (`max-md:`) utilities. State and arbitrary variants (hover:, group-hover:,
|
|
14
|
+
* dark:, group-[...]:, [...]: ...) are ignored on purpose — they cannot answer
|
|
15
|
+
* a layout question.
|
|
16
|
+
*
|
|
17
|
+
* The precedence mirrors the stylesheet the vendored Tailwind 3.4.5 Play CDN
|
|
18
|
+
* actually emits (checked against its output): unprefixed utilities first,
|
|
19
|
+
* then `max-*` from the widest screen down (max-2xl ... max-sm), then the
|
|
20
|
+
* min-width screens from the narrowest up (sm ... 2xl). Every one of those
|
|
21
|
+
* selectors has the same specificity, so the later rule wins — and inside one
|
|
22
|
+
* group the display utilities keep their own emit order, which puts `hidden`
|
|
23
|
+
* last (so `flex hidden` is hidden, whatever order the classes are written in).
|
|
24
|
+
*
|
|
25
|
+
* The bottom of the file answers the same question for `sr-only`, whose
|
|
26
|
+
* foreign twin loses to state variants and beats media-query ones - see
|
|
27
|
+
* isMediaQueryVariant and isVisuallyCollapsed.
|
|
17
28
|
*/
|
|
18
29
|
|
|
19
30
|
export const TAILWIND_BREAKPOINTS_IN_PX: Record<string, number> = {
|
|
@@ -28,7 +39,30 @@ export const TAILWIND_BREAKPOINTS_IN_PX: Record<string, number> = {
|
|
|
28
39
|
export const PHONE_WIDTH_IN_PX: number = 375;
|
|
29
40
|
export const TABLET_WIDTH_IN_PX: number = 768;
|
|
30
41
|
export const LAPTOP_WIDTH_IN_PX: number = 1280;
|
|
42
|
+
// The customer's screenshot that exposed the foreign `.hidden` rule.
|
|
43
|
+
export const WIDE_DESKTOP_WIDTH_IN_PX: number = 1917;
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* A rule the app does not ship but a browser can carry anyway: Bootstrap 3 and
|
|
47
|
+
* HTML5 Boilerplate both define exactly this, and browser extensions and user
|
|
48
|
+
* stylesheets inject them into every page they touch. `!important` (or merely
|
|
49
|
+
* being appended after Tailwind's <style>) makes it beat every responsive
|
|
50
|
+
* display utility on an element that carries the bare `hidden` class — which
|
|
51
|
+
* is how a customer lost the whole dashboard navigation bar.
|
|
52
|
+
*/
|
|
53
|
+
export const FOREIGN_HIDDEN_RULE_CSS: string =
|
|
54
|
+
".hidden{display:none !important}";
|
|
31
55
|
|
|
56
|
+
export interface VisibilityOptions {
|
|
57
|
+
/*
|
|
58
|
+
* Resolve as if the page also carried FOREIGN_HIDDEN_RULE_CSS. Markup that is
|
|
59
|
+
* only on screen because a responsive utility overrides a bare `hidden`
|
|
60
|
+
* reads as hidden at every width under this option.
|
|
61
|
+
*/
|
|
62
|
+
withForeignHiddenRule?: boolean | undefined;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Tailwind's emit order for display utilities; later wins inside one group.
|
|
32
66
|
const DISPLAY_UTILITIES: Array<string> = [
|
|
33
67
|
"block",
|
|
34
68
|
"inline-block",
|
|
@@ -53,8 +87,60 @@ const DISPLAY_UTILITIES: Array<string> = [
|
|
|
53
87
|
"hidden",
|
|
54
88
|
];
|
|
55
89
|
|
|
90
|
+
/*
|
|
91
|
+
* `block`, `flex`, `hidden` ... - any of Tailwind's display utilities, for
|
|
92
|
+
* callers that read class attributes without resolving them.
|
|
93
|
+
*/
|
|
94
|
+
export function isDisplayUtility(utility: string): boolean {
|
|
95
|
+
return DISPLAY_UTILITIES.includes(utility);
|
|
96
|
+
}
|
|
97
|
+
|
|
56
98
|
const BREAKPOINT_ORDER: Array<string> = ["sm", "md", "lg", "xl", "2xl"];
|
|
57
99
|
|
|
100
|
+
/*
|
|
101
|
+
* Precedence of each group in the emitted stylesheet. Unprefixed is 0, then
|
|
102
|
+
* max-2xl (1) ... max-sm (5), then sm (6) ... 2xl (10).
|
|
103
|
+
*/
|
|
104
|
+
const UNPREFIXED_PRECEDENCE: number = 0;
|
|
105
|
+
|
|
106
|
+
function maxVariantPrecedence(breakpointIndex: number): number {
|
|
107
|
+
return BREAKPOINT_ORDER.length - breakpointIndex;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function minVariantPrecedence(breakpointIndex: number): number {
|
|
111
|
+
return BREAKPOINT_ORDER.length + 1 + breakpointIndex;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Split a class token into its variants and utility on the `:` separators
|
|
116
|
+
* that are not inside an arbitrary value, so `group-[:not(:hover)]:hidden`
|
|
117
|
+
* reads as one (arbitrary) variant plus `hidden`, not four pieces.
|
|
118
|
+
*/
|
|
119
|
+
export function splitVariants(token: string): Array<string> {
|
|
120
|
+
const parts: Array<string> = [];
|
|
121
|
+
let depth: number = 0;
|
|
122
|
+
let current: string = "";
|
|
123
|
+
|
|
124
|
+
for (const character of token) {
|
|
125
|
+
if (character === "[" || character === "(") {
|
|
126
|
+
depth++;
|
|
127
|
+
} else if (character === "]" || character === ")") {
|
|
128
|
+
depth = Math.max(0, depth - 1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (character === ":" && depth === 0) {
|
|
132
|
+
parts.push(current);
|
|
133
|
+
current = "";
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
current += character;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
parts.push(current);
|
|
141
|
+
return parts;
|
|
142
|
+
}
|
|
143
|
+
|
|
58
144
|
/**
|
|
59
145
|
* The `display` Tailwind resolves for one class attribute at a given viewport
|
|
60
146
|
* width, or null when the markup sets no display at all (the element then keeps
|
|
@@ -63,63 +149,72 @@ const BREAKPOINT_ORDER: Array<string> = ["sm", "md", "lg", "xl", "2xl"];
|
|
|
63
149
|
export function resolveDisplay(
|
|
64
150
|
classAttribute: string | null | undefined,
|
|
65
151
|
viewportWidthInPx: number,
|
|
152
|
+
options?: VisibilityOptions,
|
|
66
153
|
): string | null {
|
|
154
|
+
const tokens: Array<string> = (classAttribute || "")
|
|
155
|
+
.split(/\s+/)
|
|
156
|
+
.filter(Boolean);
|
|
157
|
+
|
|
158
|
+
if (options?.withForeignHiddenRule && tokens.includes("hidden")) {
|
|
159
|
+
// The foreign rule matches the bare class and outranks everything we emit.
|
|
160
|
+
return "hidden";
|
|
161
|
+
}
|
|
162
|
+
|
|
67
163
|
let winner: string | null = null;
|
|
68
164
|
// -1 so an unprefixed utility (precedence 0) always beats "nothing yet".
|
|
69
165
|
let winningPrecedence: number = -1;
|
|
166
|
+
let winningOrder: number = -1;
|
|
70
167
|
|
|
71
|
-
for (const token of
|
|
72
|
-
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const parts: Array<string> = token.split(":");
|
|
168
|
+
for (const token of tokens) {
|
|
169
|
+
const parts: Array<string> = splitVariants(token);
|
|
77
170
|
const utility: string = parts[parts.length - 1]!;
|
|
171
|
+
const order: number = DISPLAY_UTILITIES.indexOf(utility);
|
|
78
172
|
|
|
79
|
-
if (
|
|
173
|
+
if (order === -1) {
|
|
80
174
|
continue;
|
|
81
175
|
}
|
|
82
176
|
|
|
83
|
-
|
|
84
|
-
if (parts.length === 1) {
|
|
85
|
-
if (winningPrecedence <= 0) {
|
|
86
|
-
winner = utility;
|
|
87
|
-
winningPrecedence = 0;
|
|
88
|
-
}
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
177
|
+
let precedence: number;
|
|
91
178
|
|
|
92
|
-
if (parts.length
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (variant.startsWith("max-")) {
|
|
100
|
-
throw new Error(
|
|
101
|
-
`resolveDisplay does not model max-width variants, and "${token}" is one. ` +
|
|
102
|
-
`Teach it the reverse-ordered cascade before using it on this markup.`,
|
|
103
|
-
);
|
|
104
|
-
}
|
|
179
|
+
if (parts.length === 1) {
|
|
180
|
+
precedence = UNPREFIXED_PRECEDENCE;
|
|
181
|
+
} else if (parts.length === 2) {
|
|
182
|
+
const variant: string = parts[0]!;
|
|
183
|
+
const isMaxVariant: boolean = variant.startsWith("max-");
|
|
184
|
+
const breakpoint: string = isMaxVariant ? variant.slice(4) : variant;
|
|
185
|
+
const breakpointIndex: number = BREAKPOINT_ORDER.indexOf(breakpoint);
|
|
105
186
|
|
|
106
|
-
|
|
187
|
+
if (breakpointIndex === -1) {
|
|
188
|
+
// A state, arbitrary or other non-breakpoint variant.
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
107
191
|
|
|
108
|
-
|
|
109
|
-
// A state or other non-breakpoint variant.
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
192
|
+
const breakpointInPx: number = TAILWIND_BREAKPOINTS_IN_PX[breakpoint]!;
|
|
112
193
|
|
|
113
|
-
|
|
114
|
-
|
|
194
|
+
if (isMaxVariant) {
|
|
195
|
+
// `max-md:` is `@media not all and (min-width: 768px)`.
|
|
196
|
+
if (viewportWidthInPx >= breakpointInPx) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
precedence = maxVariantPrecedence(breakpointIndex);
|
|
200
|
+
} else {
|
|
201
|
+
if (viewportWidthInPx < breakpointInPx) {
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
precedence = minVariantPrecedence(breakpointIndex);
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
// e.g. lg:hover:flex — a state variant, which says nothing about layout.
|
|
115
208
|
continue;
|
|
116
209
|
}
|
|
117
210
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
211
|
+
if (
|
|
212
|
+
precedence > winningPrecedence ||
|
|
213
|
+
(precedence === winningPrecedence && order > winningOrder)
|
|
214
|
+
) {
|
|
121
215
|
winner = utility;
|
|
122
216
|
winningPrecedence = precedence;
|
|
217
|
+
winningOrder = order;
|
|
123
218
|
}
|
|
124
219
|
}
|
|
125
220
|
|
|
@@ -133,12 +228,14 @@ export function resolveDisplay(
|
|
|
133
228
|
export function findHidingElement(
|
|
134
229
|
element: Element | null,
|
|
135
230
|
viewportWidthInPx: number,
|
|
231
|
+
options?: VisibilityOptions,
|
|
136
232
|
): Element | null {
|
|
137
233
|
let node: Element | null = element;
|
|
138
234
|
|
|
139
235
|
while (node) {
|
|
140
236
|
if (
|
|
141
|
-
resolveDisplay(node.getAttribute("class"), viewportWidthInPx) ===
|
|
237
|
+
resolveDisplay(node.getAttribute("class"), viewportWidthInPx, options) ===
|
|
238
|
+
"hidden"
|
|
142
239
|
) {
|
|
143
240
|
return node;
|
|
144
241
|
}
|
|
@@ -153,9 +250,11 @@ export function findHidingElement(
|
|
|
153
250
|
export function isVisibleAtWidth(
|
|
154
251
|
element: Element | null,
|
|
155
252
|
viewportWidthInPx: number,
|
|
253
|
+
options?: VisibilityOptions,
|
|
156
254
|
): boolean {
|
|
157
255
|
return (
|
|
158
|
-
Boolean(element) &&
|
|
256
|
+
Boolean(element) &&
|
|
257
|
+
findHidingElement(element, viewportWidthInPx, options) === null
|
|
159
258
|
);
|
|
160
259
|
}
|
|
161
260
|
|
|
@@ -166,18 +265,372 @@ export function isVisibleAtWidth(
|
|
|
166
265
|
export function describeVisibility(
|
|
167
266
|
element: Element | null,
|
|
168
267
|
viewportWidthInPx: number,
|
|
268
|
+
options?: VisibilityOptions,
|
|
169
269
|
): string {
|
|
170
270
|
if (!element) {
|
|
171
271
|
return "the element was never rendered";
|
|
172
272
|
}
|
|
173
273
|
|
|
174
|
-
const hiding: Element | null = findHidingElement(
|
|
274
|
+
const hiding: Element | null = findHidingElement(
|
|
275
|
+
element,
|
|
276
|
+
viewportWidthInPx,
|
|
277
|
+
options,
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
const suffix: string = options?.withForeignHiddenRule
|
|
281
|
+
? " with a foreign .hidden rule on the page"
|
|
282
|
+
: "";
|
|
175
283
|
|
|
176
284
|
if (!hiding) {
|
|
177
|
-
return `visible at ${viewportWidthInPx}px`;
|
|
285
|
+
return `visible at ${viewportWidthInPx}px${suffix}`;
|
|
178
286
|
}
|
|
179
287
|
|
|
180
|
-
return `hidden at ${viewportWidthInPx}px by <${hiding.tagName.toLowerCase()} class="${hiding.getAttribute(
|
|
288
|
+
return `hidden at ${viewportWidthInPx}px${suffix} by <${hiding.tagName.toLowerCase()} class="${hiding.getAttribute(
|
|
181
289
|
"class",
|
|
182
290
|
)}">`;
|
|
183
291
|
}
|
|
292
|
+
|
|
293
|
+
// A max-width hide, e.g. `max-lg:hidden` — the form the foreign-rule fix introduced.
|
|
294
|
+
export const MAX_WIDTH_HIDDEN_CLASS: RegExp = /^max-(sm|md|lg|xl|2xl):hidden$/;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Put the pre-fix idiom back on everything rendered under `root`: every
|
|
298
|
+
* `max-<breakpoint>:hidden` becomes the bare `hidden` it replaced. Nothing in
|
|
299
|
+
* the UI used a max-width hide before that fix, so this rebuilds the old class
|
|
300
|
+
* strings exactly — and lets a test show that its own assertion fails against
|
|
301
|
+
* them, rather than passing whatever the markup says.
|
|
302
|
+
*/
|
|
303
|
+
export function restorePreFixMarkup(root: ParentNode = document): void {
|
|
304
|
+
for (const element of Array.from(root.querySelectorAll("[class]"))) {
|
|
305
|
+
const tokens: Array<string> = (element.getAttribute("class") || "").split(
|
|
306
|
+
/\s+/,
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
element.setAttribute(
|
|
310
|
+
"class",
|
|
311
|
+
tokens
|
|
312
|
+
.map((token: string): string => {
|
|
313
|
+
return MAX_WIDTH_HIDDEN_CLASS.test(token) ? "hidden" : token;
|
|
314
|
+
})
|
|
315
|
+
.join(" "),
|
|
316
|
+
);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/*
|
|
321
|
+
* ---------------------------------------------------------------------------
|
|
322
|
+
* The `sr-only` sibling of the foreign rule.
|
|
323
|
+
*
|
|
324
|
+
* Bootstrap 3 and HTML5 Boilerplate - the two stylesheets that ship the
|
|
325
|
+
* foreign `.hidden` - also ship `.sr-only`, the visually-hidden pattern, and
|
|
326
|
+
* that one is NOT !important. So what decides it is specificity, then source
|
|
327
|
+
* order. Appended after Tailwind's <style>, the foreign `.sr-only`, (0,1,0),
|
|
328
|
+
* ties with any utility whose selector is one class - an unprefixed one, or
|
|
329
|
+
* one behind a media-query variant, since an @media wrapper adds nothing -
|
|
330
|
+
* and wins on order: `sr-only sm:not-sr-only` collapses to 1px at every width.
|
|
331
|
+
* A variant that adds to the selector out-specifies it wherever it sits:
|
|
332
|
+
* `.focus\:not-sr-only:focus` (a skip link), `.group:hover
|
|
333
|
+
* .group-hover\:not-sr-only`, `[aria-expanded="true"]`, `[data-state=...]`,
|
|
334
|
+
* and `.dark\:not-sr-only:is(.dark *)` under darkMode "class" all show the
|
|
335
|
+
* element whatever the foreign sheet says.
|
|
336
|
+
*
|
|
337
|
+
* isMediaQueryVariant below is the suite's one definition of "adds no
|
|
338
|
+
* specificity". This file is the source of truth for it: the resolver here
|
|
339
|
+
* gives it meaning, and ForeignHiddenRuleGuard's sr-only check imports it
|
|
340
|
+
* rather than keeping a list of its own, so the guard flags exactly the
|
|
341
|
+
* `not-sr-only` variants this resolver lets a foreign `.sr-only` beat.
|
|
342
|
+
* ---------------------------------------------------------------------------
|
|
343
|
+
*/
|
|
344
|
+
|
|
345
|
+
/*
|
|
346
|
+
* The media-query variants that do not test the width, and where Tailwind
|
|
347
|
+
* 3.4.5 emits each one (checked against the vendored Play CDN's variant
|
|
348
|
+
* order under darkMode "class": motion, contrast, dark, the screens,
|
|
349
|
+
* orientation, direction, forced-colors, print). The screens sit between 3
|
|
350
|
+
* and 5 - see screenPrecedence.
|
|
351
|
+
*/
|
|
352
|
+
const NON_WIDTH_MEDIA_PRECEDENCE: ReadonlyMap<string, number> = new Map<
|
|
353
|
+
string,
|
|
354
|
+
number
|
|
355
|
+
>([
|
|
356
|
+
["motion-safe", 1],
|
|
357
|
+
["motion-reduce", 1],
|
|
358
|
+
["contrast-more", 2],
|
|
359
|
+
["contrast-less", 2],
|
|
360
|
+
["portrait", 5],
|
|
361
|
+
["landscape", 5],
|
|
362
|
+
["forced-colors", 6],
|
|
363
|
+
["print", 7],
|
|
364
|
+
]);
|
|
365
|
+
|
|
366
|
+
export const NON_WIDTH_MEDIA_VARIANTS: ReadonlyArray<string> = Array.from(
|
|
367
|
+
NON_WIDTH_MEDIA_PRECEDENCE.keys(),
|
|
368
|
+
);
|
|
369
|
+
|
|
370
|
+
// `min-[900px]`, `max-[62rem]` ...: an arbitrary screen.
|
|
371
|
+
const ARBITRARY_SCREEN_VARIANT: RegExp = /^(min|max)-\[([^\]]+)\]$/;
|
|
372
|
+
const PIXEL_LENGTH: RegExp = /^(\d+(?:\.\d+)?)px$/;
|
|
373
|
+
|
|
374
|
+
// Keeps every real screen width between two whole precedence steps.
|
|
375
|
+
const SCREEN_WIDTH_SCALE_IN_PX: number = 100000;
|
|
376
|
+
|
|
377
|
+
interface ScreenCondition {
|
|
378
|
+
direction: "min" | "max";
|
|
379
|
+
/*
|
|
380
|
+
* null for an arbitrary screen not written in px: with the px `screens`
|
|
381
|
+
* this app configures, the CDN warns about mixed units and emits nothing
|
|
382
|
+
* for it, so it never applies.
|
|
383
|
+
*/
|
|
384
|
+
widthInPx: number | null;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// The width a screen variant tests, or null when it is not a screen variant.
|
|
388
|
+
function screenConditionOf(variant: string): ScreenCondition | null {
|
|
389
|
+
if (BREAKPOINT_ORDER.includes(variant)) {
|
|
390
|
+
return {
|
|
391
|
+
direction: "min",
|
|
392
|
+
widthInPx: TAILWIND_BREAKPOINTS_IN_PX[variant]!,
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const maxBreakpoint: string = variant.slice(4);
|
|
397
|
+
|
|
398
|
+
if (variant.startsWith("max-") && BREAKPOINT_ORDER.includes(maxBreakpoint)) {
|
|
399
|
+
return {
|
|
400
|
+
direction: "max",
|
|
401
|
+
widthInPx: TAILWIND_BREAKPOINTS_IN_PX[maxBreakpoint]!,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const arbitrary: RegExpMatchArray | null = variant.match(
|
|
406
|
+
ARBITRARY_SCREEN_VARIANT,
|
|
407
|
+
);
|
|
408
|
+
|
|
409
|
+
if (!arbitrary) {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
const pixels: RegExpMatchArray | null = arbitrary[2]!.match(PIXEL_LENGTH);
|
|
414
|
+
|
|
415
|
+
return {
|
|
416
|
+
direction: arbitrary[1] === "min" ? "min" : "max",
|
|
417
|
+
widthInPx: pixels ? parseFloat(pixels[1]!) : null,
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/*
|
|
422
|
+
* Tailwind emits every max-width screen, widest first, before every
|
|
423
|
+
* min-width one, narrowest first - the named screens and arbitrary ones
|
|
424
|
+
* interleaved by width (they share one sort in the CDN).
|
|
425
|
+
*/
|
|
426
|
+
function screenPrecedence(screen: ScreenCondition, widthInPx: number): number {
|
|
427
|
+
return screen.direction === "max"
|
|
428
|
+
? 3 + (1 - widthInPx / SCREEN_WIDTH_SCALE_IN_PX)
|
|
429
|
+
: 4 + widthInPx / SCREEN_WIDTH_SCALE_IN_PX;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Whether a variant wraps its utility in an @media query and nothing else,
|
|
434
|
+
* so it adds no specificity: the screens (sm ... 2xl, max-sm ... max-2xl,
|
|
435
|
+
* min-[...], max-[...]), print, motion-safe / motion-reduce, contrast-more /
|
|
436
|
+
* contrast-less, portrait / landscape and forced-colors. State and pseudo
|
|
437
|
+
* variants (hover:, focus:, group-*, peer-*, aria-*, data-*, dark: under
|
|
438
|
+
* darkMode "class", [&...]) add a selector and are not media queries.
|
|
439
|
+
*/
|
|
440
|
+
export function isMediaQueryVariant(variant: string): boolean {
|
|
441
|
+
return (
|
|
442
|
+
screenConditionOf(variant) !== null ||
|
|
443
|
+
NON_WIDTH_MEDIA_VARIANTS.includes(variant)
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
export interface ScreenReaderOnlyOptions {
|
|
448
|
+
/*
|
|
449
|
+
* Resolve as if the page also carried Bootstrap 3's / HTML5 Boilerplate's
|
|
450
|
+
* `.sr-only{position:absolute;width:1px;height:1px;clip:rect(0,0,0,0);...}`
|
|
451
|
+
* appended after Tailwind: one class, later in the cascade than any
|
|
452
|
+
* utility.
|
|
453
|
+
*/
|
|
454
|
+
withForeignSrOnlyRule?: boolean | undefined;
|
|
455
|
+
// A hypothetical !important version of that rule. Neither library ships it.
|
|
456
|
+
foreignSrOnlyRuleIsImportant?: boolean | undefined;
|
|
457
|
+
// Whether the element has keyboard focus, for `focus:` variants.
|
|
458
|
+
isFocused?: boolean | undefined;
|
|
459
|
+
/*
|
|
460
|
+
* The non-width media variants whose query holds (`print`,
|
|
461
|
+
* `motion-reduce` ...). None by default: a screen, default preferences.
|
|
462
|
+
*/
|
|
463
|
+
mediaConditions?: ReadonlyArray<string> | undefined;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
interface SrOnlyContender {
|
|
467
|
+
collapses: boolean;
|
|
468
|
+
important: boolean;
|
|
469
|
+
// Classes plus pseudo-classes: `.sr-only` is 1, `.focus\:x:focus` is 2.
|
|
470
|
+
specificity: number;
|
|
471
|
+
// Stylesheet position; the appended foreign sheet comes after all of it.
|
|
472
|
+
precedence: number;
|
|
473
|
+
// Inside one group Tailwind emits sr-only before not-sr-only.
|
|
474
|
+
order: number;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// The state variants the resolver models: a pseudo-class that holds while focused.
|
|
478
|
+
const SR_ONLY_FOCUS_VARIANTS: ReadonlySet<string> = new Set<string>([
|
|
479
|
+
"focus",
|
|
480
|
+
"focus-visible",
|
|
481
|
+
]);
|
|
482
|
+
|
|
483
|
+
/*
|
|
484
|
+
* The stylesheet position a media-query variant puts its utility at, or
|
|
485
|
+
* null when its query does not hold here - or it is not a media query at all.
|
|
486
|
+
*/
|
|
487
|
+
function applicableMediaPrecedence(
|
|
488
|
+
variant: string,
|
|
489
|
+
viewportWidthInPx: number,
|
|
490
|
+
options: ScreenReaderOnlyOptions | undefined,
|
|
491
|
+
): number | null {
|
|
492
|
+
const screen: ScreenCondition | null = screenConditionOf(variant);
|
|
493
|
+
|
|
494
|
+
if (screen) {
|
|
495
|
+
if (screen.widthInPx === null) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
// `max-sm:` is `@media not all and (min-width: 640px)`.
|
|
500
|
+
const holds: boolean =
|
|
501
|
+
screen.direction === "max"
|
|
502
|
+
? viewportWidthInPx < screen.widthInPx
|
|
503
|
+
: viewportWidthInPx >= screen.widthInPx;
|
|
504
|
+
|
|
505
|
+
return holds ? screenPrecedence(screen, screen.widthInPx) : null;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const precedence: number | undefined =
|
|
509
|
+
NON_WIDTH_MEDIA_PRECEDENCE.get(variant);
|
|
510
|
+
|
|
511
|
+
if (
|
|
512
|
+
precedence === undefined ||
|
|
513
|
+
!(options?.mediaConditions || []).includes(variant)
|
|
514
|
+
) {
|
|
515
|
+
return null;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return precedence;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/*
|
|
522
|
+
* The contender a class token puts into the cascade at this width, or null
|
|
523
|
+
* when it does not apply (a query that does not hold, focus not held) or
|
|
524
|
+
* carries a state the resolver does not model (hover:, group-*:, dark: ...).
|
|
525
|
+
* Leaving those out is exact for the foreign-rule question: like focus:,
|
|
526
|
+
* they add specificity, so a foreign `.sr-only` never decides them. A stack
|
|
527
|
+
* of media queries must all hold, and sorts by the latest in Tailwind's order.
|
|
528
|
+
*/
|
|
529
|
+
function srOnlyContenderOf(
|
|
530
|
+
token: string,
|
|
531
|
+
viewportWidthInPx: number,
|
|
532
|
+
options: ScreenReaderOnlyOptions | undefined,
|
|
533
|
+
): SrOnlyContender | null {
|
|
534
|
+
const parts: Array<string> = splitVariants(token);
|
|
535
|
+
const utility: string = parts.pop()!;
|
|
536
|
+
|
|
537
|
+
if (utility !== "sr-only" && utility !== "not-sr-only") {
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
let specificity: number = 1;
|
|
542
|
+
let precedence: number = UNPREFIXED_PRECEDENCE;
|
|
543
|
+
|
|
544
|
+
for (const variant of parts) {
|
|
545
|
+
if (SR_ONLY_FOCUS_VARIANTS.has(variant)) {
|
|
546
|
+
if (!options?.isFocused) {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
specificity++;
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
const mediaPrecedence: number | null = applicableMediaPrecedence(
|
|
555
|
+
variant,
|
|
556
|
+
viewportWidthInPx,
|
|
557
|
+
options,
|
|
558
|
+
);
|
|
559
|
+
|
|
560
|
+
if (mediaPrecedence === null) {
|
|
561
|
+
return null;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
precedence = Math.max(precedence, mediaPrecedence);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
return {
|
|
568
|
+
collapses: utility === "sr-only",
|
|
569
|
+
important: false,
|
|
570
|
+
specificity: specificity,
|
|
571
|
+
precedence: precedence,
|
|
572
|
+
order: utility === "sr-only" ? 0 : 1,
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function beats(challenger: SrOnlyContender, holder: SrOnlyContender): boolean {
|
|
577
|
+
if (challenger.important !== holder.important) {
|
|
578
|
+
return challenger.important;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
if (challenger.specificity !== holder.specificity) {
|
|
582
|
+
return challenger.specificity > holder.specificity;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
if (challenger.precedence !== holder.precedence) {
|
|
586
|
+
return challenger.precedence > holder.precedence;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
return challenger.order > holder.order;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
/**
|
|
593
|
+
* Whether the element is collapsed to a 1px clip (read to screen readers
|
|
594
|
+
* only) at the given width. Only the bare `sr-only` token can pull in the
|
|
595
|
+
* foreign rule: with it present, the label is collapsed at every width
|
|
596
|
+
* unless a more specific (focus) undo applies; `max-<bp>:sr-only` collapses
|
|
597
|
+
* only below the breakpoint, foreign rule or not.
|
|
598
|
+
*/
|
|
599
|
+
export function isVisuallyCollapsed(
|
|
600
|
+
classAttribute: string | null | undefined,
|
|
601
|
+
viewportWidthInPx: number,
|
|
602
|
+
options?: ScreenReaderOnlyOptions,
|
|
603
|
+
): boolean {
|
|
604
|
+
const tokens: Array<string> = (classAttribute || "")
|
|
605
|
+
.split(/\s+/)
|
|
606
|
+
.filter(Boolean);
|
|
607
|
+
let winner: SrOnlyContender | null = null;
|
|
608
|
+
|
|
609
|
+
for (const token of tokens) {
|
|
610
|
+
const contender: SrOnlyContender | null = srOnlyContenderOf(
|
|
611
|
+
token,
|
|
612
|
+
viewportWidthInPx,
|
|
613
|
+
options,
|
|
614
|
+
);
|
|
615
|
+
|
|
616
|
+
if (contender && (!winner || beats(contender, winner))) {
|
|
617
|
+
winner = contender;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
if (options?.withForeignSrOnlyRule && tokens.includes("sr-only")) {
|
|
622
|
+
const foreign: SrOnlyContender = {
|
|
623
|
+
collapses: true,
|
|
624
|
+
important: Boolean(options.foreignSrOnlyRuleIsImportant),
|
|
625
|
+
specificity: 1,
|
|
626
|
+
precedence: Number.POSITIVE_INFINITY,
|
|
627
|
+
order: 0,
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
if (!winner || beats(foreign, winner)) {
|
|
631
|
+
winner = foreign;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
return winner ? winner.collapses : false;
|
|
636
|
+
}
|
|
@@ -28,6 +28,9 @@ const RULE_MODELS_INTRODUCED_AFTER_MIGRATION: ReadonlyArray<string> = [
|
|
|
28
28
|
// 1794100000000-AddSloLabelAndOwnerRules
|
|
29
29
|
"ServiceLevelObjectiveLabelRule",
|
|
30
30
|
"ServiceLevelObjectiveOwnerRule",
|
|
31
|
+
// 1795000000000-AddDatabaseServerTables
|
|
32
|
+
"DatabaseServerLabelRule",
|
|
33
|
+
"DatabaseServerOwnerRule",
|
|
31
34
|
];
|
|
32
35
|
|
|
33
36
|
type IsCoveredByMigrationFunction = (modelName: string) => boolean;
|