@shipfox/client-workflows 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/main.ts +1 -0
- package/.storybook/preview.css +10 -0
- package/.storybook/preview.tsx +97 -0
- package/.swcrc +42 -0
- package/.turbo/turbo-build.log +2 -0
- package/.turbo/turbo-type$colon$emit.log +1 -0
- package/.turbo/turbo-type.log +1 -0
- package/CHANGELOG.md +162 -0
- package/LICENSE +21 -0
- package/dist/components/identifier/identifier.d.ts +6 -0
- package/dist/components/identifier/identifier.d.ts.map +1 -0
- package/dist/components/identifier/identifier.js +144 -0
- package/dist/components/identifier/identifier.js.map +1 -0
- package/dist/components/identifier/index.d.ts +2 -0
- package/dist/components/identifier/index.d.ts.map +1 -0
- package/dist/components/identifier/index.js +3 -0
- package/dist/components/identifier/index.js.map +1 -0
- package/dist/components/job-graph/graph-model.d.ts +27 -0
- package/dist/components/job-graph/graph-model.d.ts.map +1 -0
- package/dist/components/job-graph/graph-model.js +107 -0
- package/dist/components/job-graph/graph-model.js.map +1 -0
- package/dist/components/job-graph/index.d.ts +3 -0
- package/dist/components/job-graph/index.d.ts.map +1 -0
- package/dist/components/job-graph/index.js +3 -0
- package/dist/components/job-graph/index.js.map +1 -0
- package/dist/components/job-graph/job-duration-format.d.ts +4 -0
- package/dist/components/job-graph/job-duration-format.d.ts.map +1 -0
- package/dist/components/job-graph/job-duration-format.js +41 -0
- package/dist/components/job-graph/job-duration-format.js.map +1 -0
- package/dist/components/job-graph/job-duration-label.d.ts +5 -0
- package/dist/components/job-graph/job-duration-label.d.ts.map +1 -0
- package/dist/components/job-graph/job-duration-label.js +33 -0
- package/dist/components/job-graph/job-duration-label.js.map +1 -0
- package/dist/components/job-graph/job-graph-content.d.ts +9 -0
- package/dist/components/job-graph/job-graph-content.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph-content.js +181 -0
- package/dist/components/job-graph/job-graph-content.js.map +1 -0
- package/dist/components/job-graph/job-graph-view.d.ts +11 -0
- package/dist/components/job-graph/job-graph-view.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph-view.js +24 -0
- package/dist/components/job-graph/job-graph-view.js.map +1 -0
- package/dist/components/job-graph/job-graph.d.ts +3 -0
- package/dist/components/job-graph/job-graph.d.ts.map +1 -0
- package/dist/components/job-graph/job-graph.js +21 -0
- package/dist/components/job-graph/job-graph.js.map +1 -0
- package/dist/components/job-graph/job-node.d.ts +16 -0
- package/dist/components/job-graph/job-node.d.ts.map +1 -0
- package/dist/components/job-graph/job-node.js +196 -0
- package/dist/components/job-graph/job-node.js.map +1 -0
- package/dist/components/job-graph/types.d.ts +9 -0
- package/dist/components/job-graph/types.d.ts.map +1 -0
- package/dist/components/job-graph/types.js +3 -0
- package/dist/components/job-graph/types.js.map +1 -0
- package/dist/components/step-list/index.d.ts +3 -0
- package/dist/components/step-list/index.d.ts.map +1 -0
- package/dist/components/step-list/index.js +3 -0
- package/dist/components/step-list/index.js.map +1 -0
- package/dist/components/step-list/step-list-model.d.ts +36 -0
- package/dist/components/step-list/step-list-model.d.ts.map +1 -0
- package/dist/components/step-list/step-list-model.js +135 -0
- package/dist/components/step-list/step-list-model.js.map +1 -0
- package/dist/components/step-list/step-list.d.ts +32 -0
- package/dist/components/step-list/step-list.d.ts.map +1 -0
- package/dist/components/step-list/step-list.js +409 -0
- package/dist/components/step-list/step-list.js.map +1 -0
- package/dist/components/workflow-run-duration-label.d.ts +8 -0
- package/dist/components/workflow-run-duration-label.d.ts.map +1 -0
- package/dist/components/workflow-run-duration-label.js +84 -0
- package/dist/components/workflow-run-duration-label.js.map +1 -0
- package/dist/components/workflow-run-list/index.d.ts +2 -0
- package/dist/components/workflow-run-list/index.d.ts.map +1 -0
- package/dist/components/workflow-run-list/index.js +3 -0
- package/dist/components/workflow-run-list/index.js.map +1 -0
- package/dist/components/workflow-run-list/run-display.d.ts +5 -0
- package/dist/components/workflow-run-list/run-display.d.ts.map +1 -0
- package/dist/components/workflow-run-list/run-display.js +19 -0
- package/dist/components/workflow-run-list/run-display.js.map +1 -0
- package/dist/components/workflow-run-list/types.d.ts +21 -0
- package/dist/components/workflow-run-list/types.d.ts.map +1 -0
- package/dist/components/workflow-run-list/types.js +3 -0
- package/dist/components/workflow-run-list/types.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts +14 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.js +37 -0
- package/dist/components/workflow-run-list/workflow-run-list-content.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts +10 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.js +55 -0
- package/dist/components/workflow-run-list/workflow-run-list-header.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts +15 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.js +103 -0
- package/dist/components/workflow-run-list/workflow-run-list-states.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts +3 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.js +46 -0
- package/dist/components/workflow-run-list/workflow-run-list-view.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list.d.ts +3 -0
- package/dist/components/workflow-run-list/workflow-run-list.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-list.js +20 -0
- package/dist/components/workflow-run-list/workflow-run-list.js.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-row.d.ts +14 -0
- package/dist/components/workflow-run-list/workflow-run-row.d.ts.map +1 -0
- package/dist/components/workflow-run-list/workflow-run-row.js +172 -0
- package/dist/components/workflow-run-list/workflow-run-row.js.map +1 -0
- package/dist/components/workflow-run-summary/index.d.ts +2 -0
- package/dist/components/workflow-run-summary/index.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/index.js +3 -0
- package/dist/components/workflow-run-summary/index.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts +9 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js +138 -0
- package/dist/components/workflow-run-summary/workflow-run-attempt-switcher.js.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts +20 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.d.ts.map +1 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.js +252 -0
- package/dist/components/workflow-run-summary/workflow-run-summary.js.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts +7 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.d.ts.map +1 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.js +84 -0
- package/dist/components/workflow-run-view/agent-config-failure-callout.js.map +1 -0
- package/dist/components/workflow-run-view/index.d.ts +3 -0
- package/dist/components/workflow-run-view/index.d.ts.map +1 -0
- package/dist/components/workflow-run-view/index.js +4 -0
- package/dist/components/workflow-run-view/index.js.map +1 -0
- package/dist/components/workflow-run-view/job-card.d.ts +17 -0
- package/dist/components/workflow-run-view/job-card.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-card.js +476 -0
- package/dist/components/workflow-run-view/job-card.js.map +1 -0
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts +10 -0
- package/dist/components/workflow-run-view/job-execution-switcher.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-execution-switcher.js +171 -0
- package/dist/components/workflow-run-view/job-execution-switcher.js.map +1 -0
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts +6 -0
- package/dist/components/workflow-run-view/job-execution-time-text.d.ts.map +1 -0
- package/dist/components/workflow-run-view/job-execution-time-text.js +24 -0
- package/dist/components/workflow-run-view/job-execution-time-text.js.map +1 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts +9 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.d.ts.map +1 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.js +152 -0
- package/dist/components/workflow-run-view/step-attempt-log-panel.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts +14 -0
- package/dist/components/workflow-run-view/workflow-run-selection.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-selection.js +56 -0
- package/dist/components/workflow-run-view/workflow-run-selection.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts +12 -0
- package/dist/components/workflow-run-view/workflow-run-states.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-states.js +91 -0
- package/dist/components/workflow-run-view/workflow-run-states.js.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-view.d.ts +15 -0
- package/dist/components/workflow-run-view/workflow-run-view.d.ts.map +1 -0
- package/dist/components/workflow-run-view/workflow-run-view.js +285 -0
- package/dist/components/workflow-run-view/workflow-run-view.js.map +1 -0
- package/dist/components/workflow-source-panel/index.d.ts +2 -0
- package/dist/components/workflow-source-panel/index.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/index.js +3 -0
- package/dist/components/workflow-source-panel/index.js.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts +13 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.d.ts.map +1 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.js +91 -0
- package/dist/components/workflow-source-panel/workflow-source-panel.js.map +1 -0
- package/dist/components/workflow-status/status-visuals.d.ts +12 -0
- package/dist/components/workflow-status/status-visuals.d.ts.map +1 -0
- package/dist/components/workflow-status/status-visuals.js +54 -0
- package/dist/components/workflow-status/status-visuals.js.map +1 -0
- package/dist/components/workflow-status/workflow-status-icon.d.ts +22 -0
- package/dist/components/workflow-status/workflow-status-icon.d.ts.map +1 -0
- package/dist/components/workflow-status/workflow-status-icon.js +100 -0
- package/dist/components/workflow-status/workflow-status-icon.js.map +1 -0
- package/dist/core/entities/job-execution.d.ts +69 -0
- package/dist/core/entities/job-execution.d.ts.map +1 -0
- package/dist/core/entities/job-execution.js +83 -0
- package/dist/core/entities/job-execution.js.map +1 -0
- package/dist/core/entities/job.d.ts +56 -0
- package/dist/core/entities/job.d.ts.map +1 -0
- package/dist/core/entities/job.js +71 -0
- package/dist/core/entities/job.js.map +1 -0
- package/dist/core/entities/step-attempt.d.ts +49 -0
- package/dist/core/entities/step-attempt.d.ts.map +1 -0
- package/dist/core/entities/step-attempt.js +48 -0
- package/dist/core/entities/step-attempt.js.map +1 -0
- package/dist/core/entities/step.d.ts +41 -0
- package/dist/core/entities/step.d.ts.map +1 -0
- package/dist/core/entities/step.js +51 -0
- package/dist/core/entities/step.js.map +1 -0
- package/dist/core/entities/workflow-run-attempt.d.ts +44 -0
- package/dist/core/entities/workflow-run-attempt.d.ts.map +1 -0
- package/dist/core/entities/workflow-run-attempt.js +51 -0
- package/dist/core/entities/workflow-run-attempt.js.map +1 -0
- package/dist/core/entities/workflow-run.d.ts +61 -0
- package/dist/core/entities/workflow-run.d.ts.map +1 -0
- package/dist/core/entities/workflow-run.js +104 -0
- package/dist/core/entities/workflow-run.js.map +1 -0
- package/dist/core/workflow-run-url-state.d.ts +13 -0
- package/dist/core/workflow-run-url-state.d.ts.map +1 -0
- package/dist/core/workflow-run-url-state.js +43 -0
- package/dist/core/workflow-run-url-state.js.map +1 -0
- package/dist/core/workflow-run.d.ts +13 -0
- package/dist/core/workflow-run.d.ts.map +1 -0
- package/dist/core/workflow-run.js +8 -0
- package/dist/core/workflow-run.js.map +1 -0
- package/dist/env.d.js +2 -0
- package/dist/env.d.js.map +1 -0
- package/dist/feature.d.ts +20 -0
- package/dist/feature.d.ts.map +1 -0
- package/dist/feature.js +27 -0
- package/dist/feature.js.map +1 -0
- package/dist/hooks/api/workflow-runs.d.ts +109 -0
- package/dist/hooks/api/workflow-runs.d.ts.map +1 -0
- package/dist/hooks/api/workflow-runs.js +394 -0
- package/dist/hooks/api/workflow-runs.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/pages/workflow-run-first-time-use.d.ts +6 -0
- package/dist/pages/workflow-run-first-time-use.d.ts.map +1 -0
- package/dist/pages/workflow-run-first-time-use.js +17 -0
- package/dist/pages/workflow-run-first-time-use.js.map +1 -0
- package/dist/pages/workflow-run-page.d.ts +8 -0
- package/dist/pages/workflow-run-page.d.ts.map +1 -0
- package/dist/pages/workflow-run-page.js +83 -0
- package/dist/pages/workflow-run-page.js.map +1 -0
- package/dist/routes/run-detail.d.ts +8 -0
- package/dist/routes/run-detail.d.ts.map +1 -0
- package/dist/routes/run-detail.js +21 -0
- package/dist/routes/run-detail.js.map +1 -0
- package/dist/routes/runs.d.ts +8 -0
- package/dist/routes/runs.d.ts.map +1 -0
- package/dist/routes/runs.js +20 -0
- package/dist/routes/runs.js.map +1 -0
- package/dist/tsconfig.test.tsbuildinfo +1 -0
- package/package.json +114 -0
- package/src/components/identifier/identifier.tsx +178 -0
- package/src/components/identifier/index.ts +1 -0
- package/src/components/job-graph/graph-model.test.ts +189 -0
- package/src/components/job-graph/graph-model.ts +178 -0
- package/src/components/job-graph/index.ts +2 -0
- package/src/components/job-graph/job-duration-format.ts +54 -0
- package/src/components/job-graph/job-duration-label.tsx +29 -0
- package/src/components/job-graph/job-graph-content.tsx +225 -0
- package/src/components/job-graph/job-graph-view.test.tsx +298 -0
- package/src/components/job-graph/job-graph-view.tsx +45 -0
- package/src/components/job-graph/job-graph.stories.tsx +182 -0
- package/src/components/job-graph/job-graph.tsx +24 -0
- package/src/components/job-graph/job-node.stories.tsx +364 -0
- package/src/components/job-graph/job-node.test.tsx +347 -0
- package/src/components/job-graph/job-node.tsx +202 -0
- package/src/components/job-graph/types.ts +9 -0
- package/src/components/step-list/index.ts +6 -0
- package/src/components/step-list/step-list-model.test.ts +369 -0
- package/src/components/step-list/step-list-model.ts +205 -0
- package/src/components/step-list/step-list.stories.tsx +419 -0
- package/src/components/step-list/step-list.test.tsx +566 -0
- package/src/components/step-list/step-list.tsx +494 -0
- package/src/components/workflow-run-duration-label.tsx +118 -0
- package/src/components/workflow-run-list/index.ts +1 -0
- package/src/components/workflow-run-list/run-display.test.ts +53 -0
- package/src/components/workflow-run-list/run-display.ts +22 -0
- package/src/components/workflow-run-list/types.ts +22 -0
- package/src/components/workflow-run-list/workflow-run-list-content.tsx +58 -0
- package/src/components/workflow-run-list/workflow-run-list-header.tsx +53 -0
- package/src/components/workflow-run-list/workflow-run-list-states.tsx +86 -0
- package/src/components/workflow-run-list/workflow-run-list-view.test.tsx +178 -0
- package/src/components/workflow-run-list/workflow-run-list-view.tsx +57 -0
- package/src/components/workflow-run-list/workflow-run-list.stories.tsx +111 -0
- package/src/components/workflow-run-list/workflow-run-list.tsx +29 -0
- package/src/components/workflow-run-list/workflow-run-row.tsx +176 -0
- package/src/components/workflow-run-summary/index.ts +1 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.test.tsx +230 -0
- package/src/components/workflow-run-summary/workflow-run-attempt-switcher.tsx +146 -0
- package/src/components/workflow-run-summary/workflow-run-summary.stories.tsx +414 -0
- package/src/components/workflow-run-summary/workflow-run-summary.test.tsx +354 -0
- package/src/components/workflow-run-summary/workflow-run-summary.tsx +295 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.stories.tsx +140 -0
- package/src/components/workflow-run-view/agent-config-failure-callout.tsx +93 -0
- package/src/components/workflow-run-view/index.ts +2 -0
- package/src/components/workflow-run-view/job-card.stories.tsx +788 -0
- package/src/components/workflow-run-view/job-card.tsx +566 -0
- package/src/components/workflow-run-view/job-execution-switcher.tsx +170 -0
- package/src/components/workflow-run-view/job-execution-time-text.tsx +34 -0
- package/src/components/workflow-run-view/step-attempt-log-panel.test.tsx +290 -0
- package/src/components/workflow-run-view/step-attempt-log-panel.tsx +152 -0
- package/src/components/workflow-run-view/workflow-run-selection.test.ts +280 -0
- package/src/components/workflow-run-view/workflow-run-selection.ts +89 -0
- package/src/components/workflow-run-view/workflow-run-states.tsx +70 -0
- package/src/components/workflow-run-view/workflow-run-view.test.tsx +1214 -0
- package/src/components/workflow-run-view/workflow-run-view.tsx +341 -0
- package/src/components/workflow-source-panel/index.ts +1 -0
- package/src/components/workflow-source-panel/workflow-source-panel.stories.tsx +110 -0
- package/src/components/workflow-source-panel/workflow-source-panel.test.tsx +96 -0
- package/src/components/workflow-source-panel/workflow-source-panel.tsx +136 -0
- package/src/components/workflow-status/status-visuals.test.ts +38 -0
- package/src/components/workflow-status/status-visuals.ts +36 -0
- package/src/components/workflow-status/workflow-status-icon.stories.tsx +90 -0
- package/src/components/workflow-status/workflow-status-icon.tsx +135 -0
- package/src/core/entities/job-execution.ts +139 -0
- package/src/core/entities/job.ts +149 -0
- package/src/core/entities/step-attempt.ts +89 -0
- package/src/core/entities/step.ts +105 -0
- package/src/core/entities/workflow-run-attempt.ts +87 -0
- package/src/core/entities/workflow-run.ts +183 -0
- package/src/core/workflow-run-url-state.ts +61 -0
- package/src/core/workflow-run.test.ts +640 -0
- package/src/core/workflow-run.ts +66 -0
- package/src/env.d.ts +8 -0
- package/src/feature.ts +26 -0
- package/src/hooks/api/workflow-runs.test.tsx +410 -0
- package/src/hooks/api/workflow-runs.ts +485 -0
- package/src/index.ts +45 -0
- package/src/page-harness-budget.test.ts +33 -0
- package/src/pages/workflow-run-first-time-use.tsx +17 -0
- package/src/pages/workflow-run-page.test.tsx +517 -0
- package/src/pages/workflow-run-page.tsx +89 -0
- package/src/routes/run-detail.tsx +15 -0
- package/src/routes/runs.tsx +11 -0
- package/test/fixtures/logs.ts +13 -0
- package/test/fixtures/workflow-run.ts +311 -0
- package/test/pages.tsx +79 -0
- package/test/render.tsx +40 -0
- package/test/setup.ts +3 -0
- package/tsconfig.build.json +9 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +3 -0
- package/tsconfig.test.json +8 -0
- package/vercel.json +8 -0
- package/vitest.config.ts +70 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TriggerSourceIcon } from '@shipfox/client-triggers';
|
|
3
|
+
import { Badge } from '@shipfox/react-ui/badge';
|
|
4
|
+
import { useIsTextTruncated } from '@shipfox/react-ui/hooks';
|
|
5
|
+
import { Icon } from '@shipfox/react-ui/icon';
|
|
6
|
+
import { useTimeTick } from '@shipfox/react-ui/time-ticker';
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '@shipfox/react-ui/tooltip';
|
|
8
|
+
import { Code } from '@shipfox/react-ui/typography';
|
|
9
|
+
import { cn } from '@shipfox/react-ui/utils';
|
|
10
|
+
import { getWorkflowStatusVisual } from '#components/workflow-status/status-visuals.js';
|
|
11
|
+
import { WorkflowStatusIcon } from '#components/workflow-status/workflow-status-icon.js';
|
|
12
|
+
import { formatJobDurationAccessibleLabel } from './job-duration-format.js';
|
|
13
|
+
import { JobDurationLabel } from './job-duration-label.js';
|
|
14
|
+
const TRIGGER_SIZE = 36;
|
|
15
|
+
export function TriggerNode({ trigger }) {
|
|
16
|
+
const label = trigger.triggerDisplayLabel || 'trigger';
|
|
17
|
+
const tooltip = trigger.triggerLabel || label;
|
|
18
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
21
|
+
asChild: true,
|
|
22
|
+
children: /*#__PURE__*/ _jsx("button", {
|
|
23
|
+
type: "button",
|
|
24
|
+
"aria-label": label,
|
|
25
|
+
className: "flex items-center justify-center rounded-full border border-border-neutral-base bg-background-components-base transition-colors hover:bg-background-components-hover focus-visible:shadow-border-interactive-with-active focus-visible:outline-none",
|
|
26
|
+
style: {
|
|
27
|
+
width: TRIGGER_SIZE,
|
|
28
|
+
height: TRIGGER_SIZE
|
|
29
|
+
},
|
|
30
|
+
children: /*#__PURE__*/ _jsx(TriggerSourceIcon, {
|
|
31
|
+
provider: trigger.triggerProvider,
|
|
32
|
+
source: trigger.triggerSource,
|
|
33
|
+
"aria-hidden": true,
|
|
34
|
+
className: "size-14 shrink-0 text-foreground-neutral-muted"
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
39
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
40
|
+
children: tooltip
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export function JobNode({ node, selected, onSelect, onKeyDown, onHoverStart, onHoverEnd, ref }) {
|
|
47
|
+
useTimeTick();
|
|
48
|
+
const visual = getWorkflowStatusVisual(node.status);
|
|
49
|
+
const accessibleLabel = [
|
|
50
|
+
node.displayName,
|
|
51
|
+
visual.label,
|
|
52
|
+
formatJobDurationAccessibleLabel(node.displayDuration),
|
|
53
|
+
node.executionCountVisible ? executionCountAccessibleLabel(node.jobExecutions.length) : undefined,
|
|
54
|
+
node.carriedOver ? 'reused' : undefined
|
|
55
|
+
].filter((part)=>Boolean(part)).join(', ');
|
|
56
|
+
return /*#__PURE__*/ _jsxs("button", {
|
|
57
|
+
ref: ref,
|
|
58
|
+
type: "button",
|
|
59
|
+
"aria-pressed": selected,
|
|
60
|
+
"aria-label": accessibleLabel,
|
|
61
|
+
"data-job-id": node.id,
|
|
62
|
+
onClick: onSelect,
|
|
63
|
+
onKeyDown: onKeyDown,
|
|
64
|
+
onPointerEnter: onHoverStart,
|
|
65
|
+
onPointerLeave: onHoverEnd,
|
|
66
|
+
className: cn('group relative flex h-48 w-208 items-center gap-8 rounded-8 border border-border-neutral-base bg-background-components-base px-10 text-left transition-colors hover:bg-background-components-hover focus-visible:shadow-border-interactive-with-active focus-visible:outline-none', selected && 'bg-background-components-hover', node.carriedOver && 'opacity-[0.55]'),
|
|
67
|
+
children: [
|
|
68
|
+
selected ? /*#__PURE__*/ _jsx("span", {
|
|
69
|
+
"aria-hidden": "true",
|
|
70
|
+
className: "absolute inset-y-6 left-0 w-3 rounded-full bg-border-highlights-interactive"
|
|
71
|
+
}) : null,
|
|
72
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
73
|
+
className: "flex min-w-0 flex-1 items-center gap-8",
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ _jsx(WorkflowStatusIcon, {
|
|
76
|
+
status: node.status,
|
|
77
|
+
jobMode: node.mode,
|
|
78
|
+
size: 14
|
|
79
|
+
}),
|
|
80
|
+
/*#__PURE__*/ _jsx(JobLabel, {
|
|
81
|
+
label: node.displayName
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx(JobDurationLabel, {
|
|
86
|
+
duration: node.displayDuration
|
|
87
|
+
}),
|
|
88
|
+
node.executionCountVisible ? /*#__PURE__*/ _jsx(ExecutionCountText, {
|
|
89
|
+
executions: node.jobExecutions
|
|
90
|
+
}) : null,
|
|
91
|
+
node.carriedOver ? /*#__PURE__*/ _jsx(CarriedOverBadge, {}) : null
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function ExecutionCountText({ executions }) {
|
|
96
|
+
const count = executions.length;
|
|
97
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
98
|
+
children: [
|
|
99
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
100
|
+
asChild: true,
|
|
101
|
+
children: /*#__PURE__*/ _jsxs("span", {
|
|
102
|
+
"aria-hidden": "true",
|
|
103
|
+
className: "inline-flex h-20 min-w-28 shrink-0 items-center justify-end gap-4 text-foreground-neutral-muted",
|
|
104
|
+
children: [
|
|
105
|
+
/*#__PURE__*/ _jsx(Icon, {
|
|
106
|
+
name: "loopRightLine",
|
|
107
|
+
className: "size-12"
|
|
108
|
+
}),
|
|
109
|
+
/*#__PURE__*/ _jsx(Code, {
|
|
110
|
+
as: "span",
|
|
111
|
+
variant: "label",
|
|
112
|
+
className: "text-current",
|
|
113
|
+
children: count
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
})
|
|
117
|
+
}),
|
|
118
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
119
|
+
children: executionCountTooltip(executions)
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function CarriedOverBadge() {
|
|
125
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
126
|
+
children: [
|
|
127
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
128
|
+
asChild: true,
|
|
129
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
130
|
+
className: "shrink-0",
|
|
131
|
+
children: /*#__PURE__*/ _jsx(Badge, {
|
|
132
|
+
variant: "neutral",
|
|
133
|
+
size: "2xs",
|
|
134
|
+
children: "reused"
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
/*#__PURE__*/ _jsx(TooltipContent, {
|
|
139
|
+
children: "Carried over from a previous attempt; did not run in this attempt"
|
|
140
|
+
})
|
|
141
|
+
]
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
function JobLabel({ label }) {
|
|
145
|
+
const { ref: labelRef, isTruncated } = useIsTextTruncated(label);
|
|
146
|
+
return /*#__PURE__*/ _jsxs(Tooltip, {
|
|
147
|
+
children: [
|
|
148
|
+
/*#__PURE__*/ _jsx(TooltipTrigger, {
|
|
149
|
+
asChild: true,
|
|
150
|
+
children: /*#__PURE__*/ _jsx("span", {
|
|
151
|
+
ref: labelRef,
|
|
152
|
+
className: "block min-w-0 truncate",
|
|
153
|
+
children: /*#__PURE__*/ _jsx(Code, {
|
|
154
|
+
as: "span",
|
|
155
|
+
variant: "label",
|
|
156
|
+
bold: true,
|
|
157
|
+
className: "text-foreground-neutral-base",
|
|
158
|
+
children: label
|
|
159
|
+
})
|
|
160
|
+
})
|
|
161
|
+
}),
|
|
162
|
+
isTruncated ? /*#__PURE__*/ _jsx(TooltipContent, {
|
|
163
|
+
children: label
|
|
164
|
+
}) : null
|
|
165
|
+
]
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
function executionCountAccessibleLabel(count) {
|
|
169
|
+
return `${count} ${count === 1 ? 'execution' : 'executions'}`;
|
|
170
|
+
}
|
|
171
|
+
function executionCountTooltip(executions) {
|
|
172
|
+
const counts = executionStatusCounts(executions);
|
|
173
|
+
const parts = EXECUTION_STATUSES.map((status)=>counts[status] > 0 ? `${counts[status]} ${status}` : undefined).filter((part)=>part !== undefined);
|
|
174
|
+
return parts.length > 0 ? parts.join(', ') : 'No executions';
|
|
175
|
+
}
|
|
176
|
+
const EXECUTION_STATUSES = [
|
|
177
|
+
'pending',
|
|
178
|
+
'running',
|
|
179
|
+
'succeeded',
|
|
180
|
+
'failed',
|
|
181
|
+
'cancelled'
|
|
182
|
+
];
|
|
183
|
+
function executionStatusCounts(executions) {
|
|
184
|
+
return executions.reduce((counts, execution)=>{
|
|
185
|
+
counts[execution.status] += 1;
|
|
186
|
+
return counts;
|
|
187
|
+
}, {
|
|
188
|
+
pending: 0,
|
|
189
|
+
running: 0,
|
|
190
|
+
succeeded: 0,
|
|
191
|
+
failed: 0,
|
|
192
|
+
cancelled: 0
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
//# sourceMappingURL=job-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/job-graph/job-node.tsx"],"sourcesContent":["import {TriggerSourceIcon} from '@shipfox/client-triggers';\nimport {Badge} from '@shipfox/react-ui/badge';\nimport {useIsTextTruncated} from '@shipfox/react-ui/hooks';\nimport {Icon} from '@shipfox/react-ui/icon';\nimport {useTimeTick} from '@shipfox/react-ui/time-ticker';\nimport {Tooltip, TooltipContent, TooltipTrigger} from '@shipfox/react-ui/tooltip';\nimport {Code} from '@shipfox/react-ui/typography';\nimport {cn} from '@shipfox/react-ui/utils';\nimport type {KeyboardEventHandler, Ref} from 'react';\nimport {getWorkflowStatusVisual} from '#components/workflow-status/status-visuals.js';\nimport {WorkflowStatusIcon} from '#components/workflow-status/workflow-status-icon.js';\nimport type {JobExecution, JobExecutionStatus, WorkflowRunDetail} from '#core/workflow-run.js';\nimport type {JobGraphNode} from './graph-model.js';\nimport {formatJobDurationAccessibleLabel} from './job-duration-format.js';\nimport {JobDurationLabel} from './job-duration-label.js';\n\nconst TRIGGER_SIZE = 36;\n\nexport function TriggerNode({\n trigger,\n}: {\n trigger: Pick<\n WorkflowRunDetail,\n 'triggerDisplayLabel' | 'triggerLabel' | 'triggerProvider' | 'triggerSource'\n >;\n}) {\n const label = trigger.triggerDisplayLabel || 'trigger';\n const tooltip = trigger.triggerLabel || label;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={label}\n className=\"flex items-center justify-center rounded-full border border-border-neutral-base bg-background-components-base transition-colors hover:bg-background-components-hover focus-visible:shadow-border-interactive-with-active focus-visible:outline-none\"\n style={{width: TRIGGER_SIZE, height: TRIGGER_SIZE}}\n >\n <TriggerSourceIcon\n provider={trigger.triggerProvider}\n source={trigger.triggerSource}\n aria-hidden\n className=\"size-14 shrink-0 text-foreground-neutral-muted\"\n />\n </button>\n </TooltipTrigger>\n <TooltipContent>\n <span>{tooltip}</span>\n </TooltipContent>\n </Tooltip>\n );\n}\n\nexport function JobNode({\n node,\n selected,\n onSelect,\n onKeyDown,\n onHoverStart,\n onHoverEnd,\n ref,\n}: {\n node: JobGraphNode;\n selected: boolean;\n onSelect: () => void;\n onKeyDown: KeyboardEventHandler<HTMLButtonElement>;\n onHoverStart: () => void;\n onHoverEnd: () => void;\n ref?: Ref<HTMLButtonElement>;\n}) {\n useTimeTick();\n const visual = getWorkflowStatusVisual(node.status);\n const accessibleLabel = [\n node.displayName,\n visual.label,\n formatJobDurationAccessibleLabel(node.displayDuration),\n node.executionCountVisible\n ? executionCountAccessibleLabel(node.jobExecutions.length)\n : undefined,\n node.carriedOver ? 'reused' : undefined,\n ]\n .filter((part): part is string => Boolean(part))\n .join(', ');\n\n return (\n <button\n ref={ref}\n type=\"button\"\n aria-pressed={selected}\n aria-label={accessibleLabel}\n data-job-id={node.id}\n onClick={onSelect}\n onKeyDown={onKeyDown}\n onPointerEnter={onHoverStart}\n onPointerLeave={onHoverEnd}\n className={cn(\n 'group relative flex h-48 w-208 items-center gap-8 rounded-8 border border-border-neutral-base bg-background-components-base px-10 text-left transition-colors hover:bg-background-components-hover focus-visible:shadow-border-interactive-with-active focus-visible:outline-none',\n selected && 'bg-background-components-hover',\n node.carriedOver && 'opacity-[0.55]',\n )}\n >\n {selected ? (\n <span\n aria-hidden=\"true\"\n className=\"absolute inset-y-6 left-0 w-3 rounded-full bg-border-highlights-interactive\"\n />\n ) : null}\n <div className=\"flex min-w-0 flex-1 items-center gap-8\">\n <WorkflowStatusIcon status={node.status} jobMode={node.mode} size={14} />\n <JobLabel label={node.displayName} />\n </div>\n <JobDurationLabel duration={node.displayDuration} />\n {node.executionCountVisible ? <ExecutionCountText executions={node.jobExecutions} /> : null}\n {node.carriedOver ? <CarriedOverBadge /> : null}\n </button>\n );\n}\n\nfunction ExecutionCountText({executions}: {executions: JobExecution[]}) {\n const count = executions.length;\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span\n aria-hidden=\"true\"\n className=\"inline-flex h-20 min-w-28 shrink-0 items-center justify-end gap-4 text-foreground-neutral-muted\"\n >\n <Icon name=\"loopRightLine\" className=\"size-12\" />\n <Code as=\"span\" variant=\"label\" className=\"text-current\">\n {count}\n </Code>\n </span>\n </TooltipTrigger>\n <TooltipContent>{executionCountTooltip(executions)}</TooltipContent>\n </Tooltip>\n );\n}\n\nfunction CarriedOverBadge() {\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"shrink-0\">\n <Badge variant=\"neutral\" size=\"2xs\">\n reused\n </Badge>\n </span>\n </TooltipTrigger>\n <TooltipContent>\n Carried over from a previous attempt; did not run in this attempt\n </TooltipContent>\n </Tooltip>\n );\n}\n\nfunction JobLabel({label}: {label: string}) {\n const {ref: labelRef, isTruncated} = useIsTextTruncated<HTMLSpanElement>(label);\n\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span ref={labelRef} className=\"block min-w-0 truncate\">\n <Code as=\"span\" variant=\"label\" bold className=\"text-foreground-neutral-base\">\n {label}\n </Code>\n </span>\n </TooltipTrigger>\n {isTruncated ? <TooltipContent>{label}</TooltipContent> : null}\n </Tooltip>\n );\n}\n\nfunction executionCountAccessibleLabel(count: number): string {\n return `${count} ${count === 1 ? 'execution' : 'executions'}`;\n}\n\nfunction executionCountTooltip(executions: JobExecution[]): string {\n const counts = executionStatusCounts(executions);\n const parts = EXECUTION_STATUSES.map((status) =>\n counts[status] > 0 ? `${counts[status]} ${status}` : undefined,\n ).filter((part): part is string => part !== undefined);\n return parts.length > 0 ? parts.join(', ') : 'No executions';\n}\n\nconst EXECUTION_STATUSES = [\n 'pending',\n 'running',\n 'succeeded',\n 'failed',\n 'cancelled',\n] as const satisfies readonly JobExecutionStatus[];\n\nfunction executionStatusCounts(executions: JobExecution[]) {\n return executions.reduce(\n (counts, execution) => {\n counts[execution.status] += 1;\n return counts;\n },\n {pending: 0, running: 0, succeeded: 0, failed: 0, cancelled: 0},\n );\n}\n"],"names":["TriggerSourceIcon","Badge","useIsTextTruncated","Icon","useTimeTick","Tooltip","TooltipContent","TooltipTrigger","Code","cn","getWorkflowStatusVisual","WorkflowStatusIcon","formatJobDurationAccessibleLabel","JobDurationLabel","TRIGGER_SIZE","TriggerNode","trigger","label","triggerDisplayLabel","tooltip","triggerLabel","asChild","button","type","aria-label","className","style","width","height","provider","triggerProvider","source","triggerSource","aria-hidden","span","JobNode","node","selected","onSelect","onKeyDown","onHoverStart","onHoverEnd","ref","visual","status","accessibleLabel","displayName","displayDuration","executionCountVisible","executionCountAccessibleLabel","jobExecutions","length","undefined","carriedOver","filter","part","Boolean","join","aria-pressed","data-job-id","id","onClick","onPointerEnter","onPointerLeave","div","jobMode","mode","size","JobLabel","duration","ExecutionCountText","executions","CarriedOverBadge","count","name","as","variant","executionCountTooltip","labelRef","isTruncated","bold","counts","executionStatusCounts","parts","EXECUTION_STATUSES","map","reduce","execution","pending","running","succeeded","failed","cancelled"],"mappings":";AAAA,SAAQA,iBAAiB,QAAO,2BAA2B;AAC3D,SAAQC,KAAK,QAAO,0BAA0B;AAC9C,SAAQC,kBAAkB,QAAO,0BAA0B;AAC3D,SAAQC,IAAI,QAAO,yBAAyB;AAC5C,SAAQC,WAAW,QAAO,gCAAgC;AAC1D,SAAQC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAO,4BAA4B;AAClF,SAAQC,IAAI,QAAO,+BAA+B;AAClD,SAAQC,EAAE,QAAO,0BAA0B;AAE3C,SAAQC,uBAAuB,QAAO,gDAAgD;AACtF,SAAQC,kBAAkB,QAAO,sDAAsD;AAGvF,SAAQC,gCAAgC,QAAO,2BAA2B;AAC1E,SAAQC,gBAAgB,QAAO,0BAA0B;AAEzD,MAAMC,eAAe;AAErB,OAAO,SAASC,YAAY,EAC1BC,OAAO,EAMR;IACC,MAAMC,QAAQD,QAAQE,mBAAmB,IAAI;IAC7C,MAAMC,UAAUH,QAAQI,YAAY,IAAIH;IAExC,qBACE,MAACZ;;0BACC,KAACE;gBAAec,OAAO;0BACrB,cAAA,KAACC;oBACCC,MAAK;oBACLC,cAAYP;oBACZQ,WAAU;oBACVC,OAAO;wBAACC,OAAOb;wBAAcc,QAAQd;oBAAY;8BAEjD,cAAA,KAACd;wBACC6B,UAAUb,QAAQc,eAAe;wBACjCC,QAAQf,QAAQgB,aAAa;wBAC7BC,aAAW;wBACXR,WAAU;;;;0BAIhB,KAACnB;0BACC,cAAA,KAAC4B;8BAAMf;;;;;AA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AAsBX,UAA0B;IACvD,OAAOA,WAAWe,MAAM,CACtB,CAACL,QAAQM;QACPN,MAAM,CAACM,UAAU3C,MAAM,CAAC,IAAI;QAC5B,OAAOqC;IACT,GACA;QAACO,SAAS;QAAGC,SAAS;QAAGC,WAAW;QAAGC,QAAQ;QAAGC,WAAW;IAAC;AAElE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkflowRunDetail } from '#core/workflow-run.js';
|
|
2
|
+
export interface JobGraphProps {
|
|
3
|
+
run: WorkflowRunDetail;
|
|
4
|
+
selectedJobId?: string | undefined;
|
|
5
|
+
defaultSelectedJobId?: string | undefined;
|
|
6
|
+
onSelectedJobChange?: ((jobId: string | undefined) => void) | undefined;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/job-graph/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,iBAAiB,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,mBAAmB,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/job-graph/types.ts"],"sourcesContent":["import type {WorkflowRunDetail} from '#core/workflow-run.js';\n\nexport interface JobGraphProps {\n run: WorkflowRunDetail;\n selectedJobId?: string | undefined;\n defaultSelectedJobId?: string | undefined;\n onSelectedJobChange?: ((jobId: string | undefined) => void) | undefined;\n className?: string | undefined;\n}\n"],"names":[],"mappings":"AAEA,WAMC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/step-list/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,aAAa,GACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/step-list/index.ts"],"sourcesContent":["export type {\n StepExpandedContext,\n StepListEmptyState,\n StepListProps,\n} from './step-list.js';\nexport {StepList} from './step-list.js';\n"],"names":["StepList"],"mappings":"AAKA,SAAQA,QAAQ,QAAO,iBAAiB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type WorkflowStatusVisual } from '#components/workflow-status/status-visuals.js';
|
|
2
|
+
import { type Job, JobExecution, type Step, type StepAttempt, type StepAttemptDisplayDuration } from '#core/workflow-run.js';
|
|
3
|
+
export interface StepStatusVisual extends Omit<WorkflowStatusVisual, 'kind'> {
|
|
4
|
+
kind: string;
|
|
5
|
+
ripple: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface StepAttemptModel extends StepAttempt {
|
|
8
|
+
displayDuration: StepAttemptDisplayDuration | null;
|
|
9
|
+
statusVisual: StepStatusVisual;
|
|
10
|
+
carriedOver: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface StepModel extends Omit<Step, 'attempts'> {
|
|
13
|
+
index: number;
|
|
14
|
+
label: string;
|
|
15
|
+
attempts: StepAttemptModel[];
|
|
16
|
+
}
|
|
17
|
+
export interface StepListEntryModel extends StepAttemptModel {
|
|
18
|
+
step: StepModel;
|
|
19
|
+
}
|
|
20
|
+
export interface StepListModel {
|
|
21
|
+
jobId: string;
|
|
22
|
+
jobName: string;
|
|
23
|
+
jobExecutionId: string;
|
|
24
|
+
stepCount: number;
|
|
25
|
+
activeEntryId: string | undefined;
|
|
26
|
+
entries: StepListEntryModel[];
|
|
27
|
+
}
|
|
28
|
+
export declare function buildStepListModel({ job, jobExecution, }: {
|
|
29
|
+
job: Job;
|
|
30
|
+
jobExecution?: JobExecution | undefined;
|
|
31
|
+
}): StepListModel;
|
|
32
|
+
export declare function defaultStepListJobExecution(job: Job): JobExecution;
|
|
33
|
+
export declare function emptyJobExecutionForJob(job: Job): JobExecution;
|
|
34
|
+
export declare function getStepStatusVisual(status: string): StepStatusVisual;
|
|
35
|
+
export declare function humanizeStatus(status: string): string;
|
|
36
|
+
//# sourceMappingURL=step-list-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-list-model.d.ts","sourceRoot":"","sources":["../../../src/components/step-list/step-list-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGL,KAAK,GAAG,EACR,YAAY,EACZ,KAAK,IAAI,EACT,KAAK,WAAW,EAChB,KAAK,0BAA0B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAC1E,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,eAAe,EAAE,0BAA0B,GAAG,IAAI,CAAC;IACnD,YAAY,EAAE,gBAAgB,CAAC;IAC/B,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,IAAI,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,wBAAgB,kBAAkB,CAAC,EACjC,GAAG,EACH,YAAY,GACb,EAAE;IACD,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACzC,GAAG,aAAa,CAehB;AAED,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAElE;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,GAAG,GAAG,YAAY,CAiB9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAepE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKrD"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { getWorkflowStatusVisual } from '#components/workflow-status/status-visuals.js';
|
|
2
|
+
import { defaultJobExecution, isWorkflowStatus as isKnownWorkflowStatus, JobExecution } from '#core/workflow-run.js';
|
|
3
|
+
export function buildStepListModel({ job, jobExecution }) {
|
|
4
|
+
const selectedJobExecution = jobExecution ?? defaultStepListJobExecution(job);
|
|
5
|
+
const steps = [
|
|
6
|
+
...selectedJobExecution.steps
|
|
7
|
+
].sort(compareSteps).map(toStepModel);
|
|
8
|
+
const entries = steps.flatMap((step)=>toStepEntries(step, job.carriedOver)).sort(compareEntries);
|
|
9
|
+
return {
|
|
10
|
+
jobId: job.id,
|
|
11
|
+
jobName: job.name ?? job.key,
|
|
12
|
+
jobExecutionId: selectedJobExecution.id,
|
|
13
|
+
stepCount: steps.length,
|
|
14
|
+
activeEntryId: latestRunningEntryId(entries),
|
|
15
|
+
entries
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function defaultStepListJobExecution(job) {
|
|
19
|
+
return defaultJobExecution(job) ?? emptyJobExecutionForJob(job);
|
|
20
|
+
}
|
|
21
|
+
export function emptyJobExecutionForJob(job) {
|
|
22
|
+
return new JobExecution({
|
|
23
|
+
id: `missing:${job.id}`,
|
|
24
|
+
jobId: job.id,
|
|
25
|
+
sequence: 1,
|
|
26
|
+
name: job.name ?? job.key,
|
|
27
|
+
status: job.status === 'skipped' ? 'cancelled' : job.status,
|
|
28
|
+
statusReason: job.statusReason,
|
|
29
|
+
triggerEvents: [],
|
|
30
|
+
queuedAt: null,
|
|
31
|
+
startedAt: null,
|
|
32
|
+
finishedAt: null,
|
|
33
|
+
timedOutAt: null,
|
|
34
|
+
createdAt: job.createdAt,
|
|
35
|
+
updatedAt: job.updatedAt,
|
|
36
|
+
steps: []
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
export function getStepStatusVisual(status) {
|
|
40
|
+
const normalized = normalizeStatus(status);
|
|
41
|
+
if (isKnownWorkflowStatus(normalized)) {
|
|
42
|
+
const visual = getWorkflowStatusVisual(normalized);
|
|
43
|
+
return {
|
|
44
|
+
...visual,
|
|
45
|
+
ripple: normalized === 'running'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
kind: status,
|
|
50
|
+
label: humanizeStatus(status),
|
|
51
|
+
dot: 'neutral',
|
|
52
|
+
badge: 'neutral',
|
|
53
|
+
ripple: false
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function humanizeStatus(status) {
|
|
57
|
+
const words = status.trim().replace(/[_-]+/g, ' ').replace(/\s+/g, ' ').toLowerCase();
|
|
58
|
+
if (!words) return 'Unknown';
|
|
59
|
+
const firstLetter = words.at(0);
|
|
60
|
+
return firstLetter === undefined ? 'Unknown' : firstLetter.toUpperCase() + words.slice(1);
|
|
61
|
+
}
|
|
62
|
+
function toStepModel(step, index) {
|
|
63
|
+
const attempts = [
|
|
64
|
+
...step.attempts
|
|
65
|
+
].sort(compareAttempts).map((attempt)=>({
|
|
66
|
+
...attempt,
|
|
67
|
+
displayDuration: attempt.displayDuration,
|
|
68
|
+
statusVisual: getStepStatusVisual(attempt.status),
|
|
69
|
+
carriedOver: false
|
|
70
|
+
}));
|
|
71
|
+
return {
|
|
72
|
+
...step,
|
|
73
|
+
index: index + 1,
|
|
74
|
+
label: stepLabel(step, index),
|
|
75
|
+
attempts
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function stepLabel(step, index) {
|
|
79
|
+
const name = step.name.trim();
|
|
80
|
+
if (name) return name;
|
|
81
|
+
const key = step.key?.trim();
|
|
82
|
+
if (key) return key;
|
|
83
|
+
return `Step ${index + 1}`;
|
|
84
|
+
}
|
|
85
|
+
function toStepEntries(step, carriedOverJob) {
|
|
86
|
+
if (step.attempts.length > 0) {
|
|
87
|
+
return step.attempts.map((attempt)=>({
|
|
88
|
+
...attempt,
|
|
89
|
+
step
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
if (!carriedOverJob) return [];
|
|
93
|
+
return [
|
|
94
|
+
{
|
|
95
|
+
id: `carried-over:${step.id}`,
|
|
96
|
+
stepId: step.id,
|
|
97
|
+
jobExecutionId: step.jobExecutionId,
|
|
98
|
+
attempt: step.currentAttempt,
|
|
99
|
+
executionOrder: step.position,
|
|
100
|
+
status: step.status,
|
|
101
|
+
exitCode: null,
|
|
102
|
+
output: null,
|
|
103
|
+
error: null,
|
|
104
|
+
gateResult: null,
|
|
105
|
+
restartFeedback: null,
|
|
106
|
+
startedAt: step.createdAt,
|
|
107
|
+
finishedAt: null,
|
|
108
|
+
displayDuration: null,
|
|
109
|
+
statusVisual: getStepStatusVisual(step.status),
|
|
110
|
+
carriedOver: true,
|
|
111
|
+
step
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
}
|
|
115
|
+
function compareSteps(left, right) {
|
|
116
|
+
return left.position - right.position || (left.name ?? '').localeCompare(right.name ?? '') || left.id.localeCompare(right.id);
|
|
117
|
+
}
|
|
118
|
+
function compareAttempts(left, right) {
|
|
119
|
+
return left.attempt - right.attempt || left.id.localeCompare(right.id);
|
|
120
|
+
}
|
|
121
|
+
function compareEntries(left, right) {
|
|
122
|
+
return left.executionOrder - right.executionOrder || left.step.index - right.step.index || left.attempt - right.attempt || left.id.localeCompare(right.id);
|
|
123
|
+
}
|
|
124
|
+
function latestRunningEntryId(entries) {
|
|
125
|
+
for(let index = entries.length - 1; index >= 0; index -= 1){
|
|
126
|
+
const entry = entries[index];
|
|
127
|
+
if (entry?.statusVisual.kind === 'running') return entry.id;
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
function normalizeStatus(status) {
|
|
132
|
+
return status.trim().toLowerCase().replace(/-/g, '_');
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
//# sourceMappingURL=step-list-model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/step-list/step-list-model.ts"],"sourcesContent":["import {\n getWorkflowStatusVisual,\n type WorkflowStatusVisual,\n} from '#components/workflow-status/status-visuals.js';\nimport {\n defaultJobExecution,\n isWorkflowStatus as isKnownWorkflowStatus,\n type Job,\n JobExecution,\n type Step,\n type StepAttempt,\n type StepAttemptDisplayDuration,\n} from '#core/workflow-run.js';\n\nexport interface StepStatusVisual extends Omit<WorkflowStatusVisual, 'kind'> {\n kind: string;\n ripple: boolean;\n}\n\nexport interface StepAttemptModel extends StepAttempt {\n displayDuration: StepAttemptDisplayDuration | null;\n statusVisual: StepStatusVisual;\n carriedOver: boolean;\n}\n\nexport interface StepModel extends Omit<Step, 'attempts'> {\n index: number;\n label: string;\n attempts: StepAttemptModel[];\n}\n\nexport interface StepListEntryModel extends StepAttemptModel {\n step: StepModel;\n}\n\nexport interface StepListModel {\n jobId: string;\n jobName: string;\n jobExecutionId: string;\n stepCount: number;\n activeEntryId: string | undefined;\n entries: StepListEntryModel[];\n}\n\nexport function buildStepListModel({\n job,\n jobExecution,\n}: {\n job: Job;\n jobExecution?: JobExecution | undefined;\n}): StepListModel {\n const selectedJobExecution = jobExecution ?? defaultStepListJobExecution(job);\n const steps = [...selectedJobExecution.steps].sort(compareSteps).map(toStepModel);\n const entries = steps\n .flatMap((step) => toStepEntries(step, job.carriedOver))\n .sort(compareEntries);\n\n return {\n jobId: job.id,\n jobName: job.name ?? job.key,\n jobExecutionId: selectedJobExecution.id,\n stepCount: steps.length,\n activeEntryId: latestRunningEntryId(entries),\n entries,\n };\n}\n\nexport function defaultStepListJobExecution(job: Job): JobExecution {\n return defaultJobExecution(job) ?? emptyJobExecutionForJob(job);\n}\n\nexport function emptyJobExecutionForJob(job: Job): JobExecution {\n return new JobExecution({\n id: `missing:${job.id}`,\n jobId: job.id,\n sequence: 1,\n name: job.name ?? job.key,\n status: job.status === 'skipped' ? 'cancelled' : job.status,\n statusReason: job.statusReason,\n triggerEvents: [],\n queuedAt: null,\n startedAt: null,\n finishedAt: null,\n timedOutAt: null,\n createdAt: job.createdAt,\n updatedAt: job.updatedAt,\n steps: [],\n });\n}\n\nexport function getStepStatusVisual(status: string): StepStatusVisual {\n const normalized = normalizeStatus(status);\n\n if (isKnownWorkflowStatus(normalized)) {\n const visual = getWorkflowStatusVisual(normalized);\n return {...visual, ripple: normalized === 'running'};\n }\n\n return {\n kind: status,\n label: humanizeStatus(status),\n dot: 'neutral',\n badge: 'neutral',\n ripple: false,\n };\n}\n\nexport function humanizeStatus(status: string): string {\n const words = status.trim().replace(/[_-]+/g, ' ').replace(/\\s+/g, ' ').toLowerCase();\n if (!words) return 'Unknown';\n const firstLetter = words.at(0);\n return firstLetter === undefined ? 'Unknown' : firstLetter.toUpperCase() + words.slice(1);\n}\n\nfunction toStepModel(step: Step, index: number): StepModel {\n const attempts = [...step.attempts].sort(compareAttempts).map((attempt) => ({\n ...attempt,\n displayDuration: attempt.displayDuration,\n statusVisual: getStepStatusVisual(attempt.status),\n carriedOver: false,\n }));\n\n return {\n ...step,\n index: index + 1,\n label: stepLabel(step, index),\n attempts,\n };\n}\n\nfunction stepLabel(step: Step, index: number): string {\n const name = step.name.trim();\n if (name) return name;\n\n const key = step.key?.trim();\n if (key) return key;\n\n return `Step ${index + 1}`;\n}\n\nfunction toStepEntries(step: StepModel, carriedOverJob: boolean): StepListEntryModel[] {\n if (step.attempts.length > 0) {\n return step.attempts.map((attempt) => ({\n ...attempt,\n step,\n }));\n }\n\n if (!carriedOverJob) return [];\n\n return [\n {\n id: `carried-over:${step.id}`,\n stepId: step.id,\n jobExecutionId: step.jobExecutionId,\n attempt: step.currentAttempt,\n executionOrder: step.position,\n status: step.status,\n exitCode: null,\n output: null,\n error: null,\n gateResult: null,\n restartFeedback: null,\n startedAt: step.createdAt,\n finishedAt: null,\n displayDuration: null,\n statusVisual: getStepStatusVisual(step.status),\n carriedOver: true,\n step,\n },\n ];\n}\n\nfunction compareSteps(left: Step, right: Step): number {\n return (\n left.position - right.position ||\n (left.name ?? '').localeCompare(right.name ?? '') ||\n left.id.localeCompare(right.id)\n );\n}\n\nfunction compareAttempts(left: Step['attempts'][number], right: Step['attempts'][number]) {\n return left.attempt - right.attempt || left.id.localeCompare(right.id);\n}\n\nfunction compareEntries(left: StepListEntryModel, right: StepListEntryModel): number {\n return (\n left.executionOrder - right.executionOrder ||\n left.step.index - right.step.index ||\n left.attempt - right.attempt ||\n left.id.localeCompare(right.id)\n );\n}\n\nfunction latestRunningEntryId(entries: readonly StepListEntryModel[]): string | undefined {\n for (let index = entries.length - 1; index >= 0; index -= 1) {\n const entry = entries[index];\n if (entry?.statusVisual.kind === 'running') return entry.id;\n }\n return undefined;\n}\n\nfunction normalizeStatus(status: string): string {\n return status.trim().toLowerCase().replace(/-/g, '_');\n}\n"],"names":["getWorkflowStatusVisual","defaultJobExecution","isWorkflowStatus","isKnownWorkflowStatus","JobExecution","buildStepListModel","job","jobExecution","selectedJobExecution","defaultStepListJobExecution","steps","sort","compareSteps","map","toStepModel","entries","flatMap","step","toStepEntries","carriedOver","compareEntries","jobId","id","jobName","name","key","jobExecutionId","stepCount","length","activeEntryId","latestRunningEntryId","emptyJobExecutionForJob","sequence","status","statusReason","triggerEvents","queuedAt","startedAt","finishedAt","timedOutAt","createdAt","updatedAt","getStepStatusVisual","normalized","normalizeStatus","visual","ripple","kind","label","humanizeStatus","dot","badge","words","trim","replace","toLowerCase","firstLetter","at","undefined","toUpperCase","slice","index","attempts","compareAttempts","attempt","displayDuration","statusVisual","stepLabel","carriedOverJob","stepId","currentAttempt","executionOrder","position","exitCode","output","error","gateResult","restartFeedback","left","right","localeCompare","entry"],"mappings":"AAAA,SACEA,uBAAuB,QAElB,gDAAgD;AACvD,SACEC,mBAAmB,EACnBC,oBAAoBC,qBAAqB,EAEzCC,YAAY,QAIP,wBAAwB;AAgC/B,OAAO,SAASC,mBAAmB,EACjCC,GAAG,EACHC,YAAY,EAIb;IACC,MAAMC,uBAAuBD,gBAAgBE,4BAA4BH;IACzE,MAAMI,QAAQ;WAAIF,qBAAqBE,KAAK;KAAC,CAACC,IAAI,CAACC,cAAcC,GAAG,CAACC;IACrE,MAAMC,UAAUL,MACbM,OAAO,CAAC,CAACC,OAASC,cAAcD,MAAMX,IAAIa,WAAW,GACrDR,IAAI,CAACS;IAER,OAAO;QACLC,OAAOf,IAAIgB,EAAE;QACbC,SAASjB,IAAIkB,IAAI,IAAIlB,IAAImB,GAAG;QAC5BC,gBAAgBlB,qBAAqBc,EAAE;QACvCK,WAAWjB,MAAMkB,MAAM;QACvBC,eAAeC,qBAAqBf;QACpCA;IACF;AACF;AAEA,OAAO,SAASN,4BAA4BH,GAAQ;IAClD,OAAOL,oBAAoBK,QAAQyB,wBAAwBzB;AAC7D;AAEA,OAAO,SAASyB,wBAAwBzB,GAAQ;IAC9C,OAAO,IAAIF,aAAa;QACtBkB,IAAI,CAAC,QAAQ,EAAEhB,IAAIgB,EAAE,EA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AAElC;AAEA,SAASyC,gBAAgBe,IAA8B,EAAEC,KAA+B;IACtF,OAAOD,KAAKd,OAAO,GAAGe,MAAMf,OAAO,IAAIc,KAAKxD,EAAE,CAAC0D,aAAa,CAACD,MAAMzD,EAAE;AACvE;AAEA,SAASF,eAAe0D,IAAwB,EAAEC,KAAyB;IACzE,OACED,KAAKP,cAAc,GAAGQ,MAAMR,cAAc,IAC1CO,KAAK7D,IAAI,CAAC4C,KAAK,GAAGkB,MAAM9D,IAAI,CAAC4C,KAAK,IAClCiB,KAAKd,OAAO,GAAGe,MAAMf,OAAO,IAC5Bc,KAAKxD,EAAE,CAAC0D,aAAa,CAACD,MAAMzD,EAAE;AAElC;AAEA,SAASQ,qBAAqBf,OAAsC;IAClE,IAAK,IAAI8C,QAAQ9C,QAAQa,MAAM,GAAG,GAAGiC,SAAS,GAAGA,SAAS,EAAG;QAC3D,MAAMoB,QAAQlE,OAAO,CAAC8C,MAAM;QAC5B,IAAIoB,OAAOf,aAAanB,SAAS,WAAW,OAAOkC,MAAM3D,EAAE;IAC7D;IACA,OAAOoC;AACT;AAEA,SAASd,gBAAgBX,MAAc;IACrC,OAAOA,OAAOoB,IAAI,GAAGE,WAAW,GAAGD,OAAO,CAAC,MAAM;AACnD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type Job, type JobExecution, type Step, type StepSourceLocation } from '#core/workflow-run.js';
|
|
3
|
+
export interface StepExpandedContext {
|
|
4
|
+
step: Step;
|
|
5
|
+
stepId: string;
|
|
6
|
+
stepLabel: string;
|
|
7
|
+
sourceLocation: StepSourceLocation | null;
|
|
8
|
+
attempt: number;
|
|
9
|
+
attemptId: string;
|
|
10
|
+
attemptError: Record<string, unknown> | null;
|
|
11
|
+
attemptStatus: string;
|
|
12
|
+
carriedOver: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface StepListEmptyState {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
status?: Job['status'] | undefined;
|
|
18
|
+
}
|
|
19
|
+
export interface StepListProps {
|
|
20
|
+
job: Job;
|
|
21
|
+
jobExecution?: JobExecution | undefined;
|
|
22
|
+
selectedAttemptId?: string | null | undefined;
|
|
23
|
+
defaultSelectedAttemptId?: string | undefined;
|
|
24
|
+
onSelectedAttemptChange?: ((attemptId: string | undefined) => void) | undefined;
|
|
25
|
+
autoSelectActiveAttempt?: boolean | undefined;
|
|
26
|
+
emptyState?: StepListEmptyState | undefined;
|
|
27
|
+
renderExpandedStep?: ((context: StepExpandedContext) => ReactNode) | undefined;
|
|
28
|
+
showHeader?: boolean | undefined;
|
|
29
|
+
className?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare function StepList({ job, jobExecution, selectedAttemptId, defaultSelectedAttemptId, onSelectedAttemptChange, autoSelectActiveAttempt, emptyState, renderExpandedStep, showHeader, className, }: StepListProps): import("react").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=step-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-list.d.ts","sourceRoot":"","sources":["../../../src/components/step-list/step-list.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGrC,OAAO,EAEL,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,IAAI,EACT,KAAK,kBAAkB,EACxB,MAAM,uBAAuB,CAAC;AAW/B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW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