From fb7e5622a59c9cd9f1b92d71d51f9818115528c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Tue, 8 Oct 2024 10:43:04 +0800 Subject: [PATCH] feat: update --- packages/canyon-report/index.html | 130 +- .../mock/dynamic-data/App.tsx.js | 229 ++ .../assets/icons/EpTopRight.tsx.js | 52 + .../components/CanyonReport/Control.tsx.js | 326 +++ .../CanyonReport/CoverageDetail.tsx.js | 287 +++ .../components/CanyonReport/ListTable.tsx.js | 415 +++ .../components/CanyonReport/Overview.tsx.js | 564 ++++ .../components/CanyonReport/PhTreeView.tsx.js | 52 + .../CanyonReport/PrepareProdFn.tsx.js | 606 +++++ .../CanyonReport/ShikiDetail.tsx.js | 1552 +++++++++++ .../components/CanyonReport/TreeTable.tsx.js | 495 ++++ .../components/CanyonReport/helper.tsx.js | 2033 +++++++++++++++ .../components/CanyonReport/index.tsx.js | 1165 +++++++++ .../CanyonReport/line/coverage.tsx.js | 476 ++++ .../components/CanyonReport/line/new.tsx.js | 152 ++ .../CanyonReport/line/number.tsx.js | 323 +++ .../components/CanyonReport/loadShiki.ts.js | 63 + .../dynamic-data/components/LineChart.tsx.js | 392 +++ .../components/app/CopyCode.tsx.js | 226 ++ .../app/ProjectRecordDetailDrawer.tsx.js | 624 +++++ .../app/getting-started-content.ts.js | 25 + .../icons/MaterialSymbolsCommitSharp.tsx.js | 52 + .../old-ui/components/card/Primary.tsx.js | 85 + .../old-ui/components/card/index.ts.js | 12 + .../components/old-ui/components/index.ts.js | 12 + .../old-ui/components/layout/Base.tsx.js | 438 ++++ .../layout/ScrollBasedLayout.tsx.js | 468 ++++ .../old-ui/components/layout/footer.tsx.js | 63 + .../old-ui/components/layout/index.ts.js | 12 + .../components/modal/GlobalSearch.tsx.js | 240 ++ .../old-ui/components/modal/index.ts.js | 12 + .../old-ui/components/page/Oauth.tsx.js | 366 +++ .../old-ui/components/page/index.ts.js | 12 + .../components/page/login/LoginBtn.tsx.js | 63 + .../components/page/login/LoginForm.tsx.js | 467 ++++ .../old-ui/components/page/login/index.tsx.js | 116 + .../components/old-ui/index.ts.js | 12 + .../components/ui/components/form/index.ts.js | 12 + .../ui/components/form/region.tsx.js | 105 + .../components/ui/components/index.ts.js | 12 + .../ui/components/typography/index.ts.js | 12 + .../ui/components/typography/text.tsx.js | 63 + .../dynamic-data/components/ui/index.ts.js | 12 + .../helpers/backend/gen/graphql.ts.js | 201 ++ .../helpers/gitprovider/genOAuthUrl.ts.js | 287 +++ .../dynamic-data/helpers/utils/common.ts.js | 359 +++ .../helpers/utils/getViewLineHeight.tsx.js | 63 + .../mock/dynamic-data/i18n.ts.js | 78 + .../layouts/genBreadcrumbItems.tsx.js | 764 ++++++ .../mock/dynamic-data/layouts/genTitle.ts.js | 439 ++++ .../mock/dynamic-data/lib/utils.ts.js | 52 + .../mock/dynamic-data/main.tsx.js | 477 ++++ .../packages/canyon-platform/src/App.tsx.js | 8 - .../src/assets/icons/EpTopRight.tsx.js | 1 - .../components/CanyonReport/Control.tsx.js | 1 - .../CanyonReport/CoverageDetail.tsx.js | 1 - .../components/CanyonReport/ListTable.tsx.js | 1 - .../components/CanyonReport/Overview.tsx.js | 1 - .../CanyonReport/PrepareProdFn.tsx.js | 1 - .../CanyonReport/ShikiDetail.tsx.js | 1 - .../components/CanyonReport/TreeTable.tsx.js | 1 - .../src/components/CanyonReport/helper.tsx.js | 1 - .../src/components/CanyonReport/index.tsx.js | 1 - .../CanyonReport/line/coverage.tsx.js | 1 - .../components/CanyonReport/line/new.tsx.js | 1 - .../CanyonReport/line/number.tsx.js | 1 - .../src/components/app/CopyCode.tsx.js | 1 - .../app/ProjectRecordDetailDrawer.tsx.js | 1 - .../app/getting-started-content.ts.js | 1 - .../icons/MaterialSymbolsCommitSharp.tsx.js | 1 - .../old-ui/components/card/Primary.tsx.js | 1 - .../old-ui/components/card/index.ts.js | 1 - .../components/old-ui/components/index.ts.js | 1 - .../old-ui/components/layout/Base.tsx.js | 1 - .../layout/ScrollBasedLayout.tsx.js | 1 - .../old-ui/components/layout/footer.tsx.js | 1 - .../old-ui/components/layout/index.ts.js | 1 - .../components/modal/GlobalSearch.tsx.js | 1 - .../old-ui/components/modal/index.ts.js | 1 - .../old-ui/components/page/Oauth.tsx.js | 1 - .../old-ui/components/page/index.ts.js | 1 - .../components/page/login/LoginBtn.tsx.js | 1 - .../components/page/login/LoginForm.tsx.js | 1 - .../old-ui/components/page/login/index.tsx.js | 1 - .../src/components/old-ui/index.ts.js | 1 - .../components/ui/components/form/index.ts.js | 1 - .../ui/components/form/region.tsx.js | 1 - .../src/components/ui/components/index.ts.js | 1 - .../ui/components/typography/index.ts.js | 1 - .../ui/components/typography/text.tsx.js | 1 - .../src/components/ui/index.ts.js | 1 - .../src/helpers/backend/gen/graphql.ts.js | 1 - .../src/helpers/gitprovider/genOAuthUrl.ts.js | 1 - .../src/helpers/utils/common.ts.js | 1 - .../helpers/utils/getViewLineHeight.tsx.js | 1 - .../packages/canyon-platform/src/i18n.ts.js | 1 - .../src/layouts/genBreadcrumbItems.tsx.js | 1 - .../src/layouts/genTitle.ts.js | 1 - .../canyon-platform/src/lib/utils.ts.js | 1 - .../packages/canyon-platform/src/main.tsx.js | 1 - .../canyon-platform/src/pages/index.tsx.js | 1 - .../index/projects/[id]/commits/[sha].tsx.js | 1 - .../projects/[id]/commits/helper/index.ts.js | 1 - .../[id]/configure/helper/BasicForms.tsx.js | 1 - .../[id]/configure/helper/MemberTable.tsx.js | 1 - .../[id]/configure/helper/TagTable.tsx.js | 1 - .../[id]/configure/helper/crud.tsx.js | 1 - .../helper/icons/SolarUserIdLinear.tsx.js | 1 - .../projects/[id]/configure/index.tsx.js | 1 - .../projects/[id]/getting-started.tsx.js | 1 - .../pages/index/projects/[id]/index.tsx.js | 2185 ---------------- .../src/pages/index/projects/index.tsx.js | 1 - .../src/pages/index/projects/new.tsx.js | 1 - .../src/pages/index/reports.tsx.js | 1 - .../components/BindGitProvider.tsx.js | 1 - .../src/pages/index/settings/index.tsx.js | 1 - .../canyon-platform/src/useWorker.ts.js | 1 - .../mock/dynamic-data/pages/index.tsx.js | 878 +++++++ .../index/projects/[id]/commits/[sha].tsx.js | 1057 ++++++++ .../projects/[id]/commits/helper/index.ts.js | 582 +++++ .../[id]/configure/helper/BasicForms.tsx.js | 359 +++ .../[id]/configure/helper/MemberTable.tsx.js | 1084 ++++++++ .../[id]/configure/helper/TagTable.tsx.js | 1090 ++++++++ .../[id]/configure/helper/crud.tsx.js | 718 ++++++ .../helper/icons/SolarUserIdLinear.tsx.js | 52 + .../projects/[id]/configure/index.tsx.js | 829 ++++++ .../projects/[id]/getting-started.tsx.js | 240 ++ .../pages/index/projects/[id]/index.tsx.js | 2238 ++++++++++++++++ .../index/projects/[id]/logs/index.tsx.js | 246 ++ .../pages/index/projects/index.tsx.js | 2288 +++++++++++++++++ .../pages/index/projects/new.tsx.js | 597 +++++ .../dynamic-data/pages/index/reports.tsx.js | 818 ++++++ .../components/BindGitProvider.tsx.js | 271 ++ .../pages/index/settings/index.tsx.js | 685 +++++ .../dynamic-data/pages/login/index.tsx.js | 276 ++ .../dynamic-data/pages/oauth/index.tsx.js | 132 + .../dynamic-data/pages/open-reports.tsx.js | 63 + .../mock/dynamic-data/pages/test.tsx.js | 129 + .../mock/dynamic-data/useWorker.ts.js | 25 + 139 files changed, 30145 insertions(+), 2321 deletions(-) create mode 100644 packages/canyon-report/mock/dynamic-data/App.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/assets/icons/EpTopRight.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/Control.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/CoverageDetail.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/ListTable.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/Overview.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/PhTreeView.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/PrepareProdFn.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/ShikiDetail.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/TreeTable.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/helper.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/coverage.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/new.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/number.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/CanyonReport/loadShiki.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/LineChart.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/app/CopyCode.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/app/ProjectRecordDetailDrawer.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/app/getting-started-content.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/icons/MaterialSymbolsCommitSharp.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/Primary.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/Base.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/ScrollBasedLayout.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/footer.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/modal/GlobalSearch.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/modal/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/page/Oauth.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/page/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/page/login/LoginBtn.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/page/login/LoginForm.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/components/page/login/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/old-ui/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/components/form/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/components/form/region.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/components/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/components/typography/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/components/typography/text.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/components/ui/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/helpers/backend/gen/graphql.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/helpers/gitprovider/genOAuthUrl.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/helpers/utils/common.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/helpers/utils/getViewLineHeight.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/i18n.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/layouts/genBreadcrumbItems.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/layouts/genTitle.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/lib/utils.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/main.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/App.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/assets/icons/EpTopRight.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/Control.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/ListTable.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/Overview.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/PrepareProdFn.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/TreeTable.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/helper.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/line/coverage.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/line/new.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/CanyonReport/line/number.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/app/CopyCode.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/app/ProjectRecordDetailDrawer.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/app/getting-started-content.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/icons/MaterialSymbolsCommitSharp.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/card/Primary.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/card/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/layout/Base.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/layout/ScrollBasedLayout.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/layout/footer.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/layout/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/modal/GlobalSearch.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/modal/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/page/Oauth.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/page/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/page/login/LoginBtn.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/page/login/LoginForm.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/components/page/login/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/old-ui/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/components/form/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/components/form/region.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/components/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/components/typography/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/components/typography/text.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/components/ui/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/helpers/backend/gen/graphql.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/helpers/gitprovider/genOAuthUrl.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/helpers/utils/common.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/helpers/utils/getViewLineHeight.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/i18n.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/layouts/genBreadcrumbItems.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/layouts/genTitle.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/lib/utils.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/main.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/commits/helper/index.ts.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/BasicForms.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/MemberTable.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/crud.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/icons/SolarUserIdLinear.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/getting-started.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/[id]/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/projects/new.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/reports.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/settings/components/BindGitProvider.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/pages/index/settings/index.tsx.js delete mode 100644 packages/canyon-report/mock/dynamic-data/packages/canyon-platform/src/useWorker.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/commits/[sha].tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/commits/helper/index.ts.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/helper/BasicForms.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/helper/MemberTable.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/helper/TagTable.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/helper/crud.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/helper/icons/SolarUserIdLinear.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/configure/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/getting-started.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/[id]/logs/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/projects/new.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/reports.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/settings/components/BindGitProvider.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/index/settings/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/login/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/oauth/index.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/open-reports.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/pages/test.tsx.js create mode 100644 packages/canyon-report/mock/dynamic-data/useWorker.ts.js diff --git a/packages/canyon-report/index.html b/packages/canyon-report/index.html index 1454e6d3..ff6f17c1 100755 --- a/packages/canyon-report/index.html +++ b/packages/canyon-report/index.html @@ -36,7 +36,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/useWorker.ts" + "path": "useWorker.ts" }, { "lines": { @@ -63,7 +63,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/i18n.ts" + "path": "i18n.ts" }, { "lines": { @@ -90,7 +90,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/card/Primary.tsx" + "path": "components/old-ui/components/card/Primary.tsx" }, { "lines": { @@ -117,7 +117,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/card/index.ts" + "path": "components/old-ui/components/card/index.ts" }, { "lines": { @@ -144,7 +144,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/layout/footer.tsx" + "path": "components/old-ui/components/layout/footer.tsx" }, { "lines": { @@ -171,7 +171,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/layout/ScrollBasedLayout.tsx" + "path": "components/old-ui/components/layout/ScrollBasedLayout.tsx" }, { "lines": { @@ -198,7 +198,7 @@ "skipped": 0, "pct": 55.55 }, - "path": "packages/canyon-platform/src/components/old-ui/components/layout/Base.tsx" + "path": "components/old-ui/components/layout/Base.tsx" }, { "lines": { @@ -225,7 +225,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/layout/index.ts" + "path": "components/old-ui/components/layout/index.ts" }, { "lines": { @@ -252,7 +252,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/modal/GlobalSearch.tsx" + "path": "components/old-ui/components/modal/GlobalSearch.tsx" }, { "lines": { @@ -279,7 +279,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/modal/index.ts" + "path": "components/old-ui/components/modal/index.ts" }, { "lines": { @@ -306,7 +306,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/assets/icons/EpTopRight.tsx" + "path": "assets/icons/EpTopRight.tsx" }, { "lines": { @@ -333,7 +333,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/page/login/LoginBtn.tsx" + "path": "components/old-ui/components/page/login/LoginBtn.tsx" }, { "lines": { @@ -360,7 +360,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/old-ui/components/page/login/LoginForm.tsx" + "path": "components/old-ui/components/page/login/LoginForm.tsx" }, { "lines": { @@ -387,7 +387,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/old-ui/components/page/login/index.tsx" + "path": "components/old-ui/components/page/login/index.tsx" }, { "lines": { @@ -414,7 +414,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/old-ui/components/page/Oauth.tsx" + "path": "components/old-ui/components/page/Oauth.tsx" }, { "lines": { @@ -441,7 +441,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/page/index.ts" + "path": "components/old-ui/components/page/index.ts" }, { "lines": { @@ -468,7 +468,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/components/index.ts" + "path": "components/old-ui/components/index.ts" }, { "lines": { @@ -495,7 +495,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/old-ui/index.ts" + "path": "components/old-ui/index.ts" }, { "lines": { @@ -522,7 +522,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/helpers/backend/gen/graphql.ts" + "path": "helpers/backend/gen/graphql.ts" }, { "lines": { @@ -549,7 +549,7 @@ "skipped": 0, "pct": 73.33 }, - "path": "packages/canyon-platform/src/layouts/genBreadcrumbItems.tsx" + "path": "layouts/genBreadcrumbItems.tsx" }, { "lines": { @@ -576,7 +576,7 @@ "skipped": 0, "pct": 84.61 }, - "path": "packages/canyon-platform/src/layouts/genTitle.ts" + "path": "layouts/genTitle.ts" }, { "lines": { @@ -603,7 +603,7 @@ "skipped": 0, "pct": 83.33 }, - "path": "packages/canyon-platform/src/pages/index.tsx" + "path": "pages/index.tsx" }, { "lines": { @@ -630,7 +630,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/reports.tsx" + "path": "pages/index/reports.tsx" }, { "lines": { @@ -657,7 +657,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/ui/components/form/region.tsx" + "path": "components/ui/components/form/region.tsx" }, { "lines": { @@ -684,7 +684,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/ui/components/form/index.ts" + "path": "components/ui/components/form/index.ts" }, { "lines": { @@ -711,7 +711,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/lib/utils.ts" + "path": "lib/utils.ts" }, { "lines": { @@ -738,7 +738,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/ui/components/typography/text.tsx" + "path": "components/ui/components/typography/text.tsx" }, { "lines": { @@ -765,7 +765,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/ui/components/typography/index.ts" + "path": "components/ui/components/typography/index.ts" }, { "lines": { @@ -792,7 +792,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/ui/components/index.ts" + "path": "components/ui/components/index.ts" }, { "lines": { @@ -819,7 +819,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/ui/index.ts" + "path": "components/ui/index.ts" }, { "lines": { @@ -846,7 +846,7 @@ "skipped": 0, "pct": 64.81 }, - "path": "packages/canyon-platform/src/pages/index/projects/index.tsx" + "path": "pages/index/projects/index.tsx" }, { "lines": { @@ -873,7 +873,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/new.tsx" + "path": "pages/index/projects/new.tsx" }, { "lines": { @@ -900,7 +900,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/app/CopyCode.tsx" + "path": "components/app/CopyCode.tsx" }, { "lines": { @@ -927,7 +927,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/app/getting-started-content.ts" + "path": "components/app/getting-started-content.ts" }, { "lines": { @@ -954,7 +954,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/getting-started.tsx" + "path": "pages/index/projects/[id]/getting-started.tsx" }, { "lines": { @@ -981,7 +981,7 @@ "skipped": 0, "pct": 50 }, - "path": "packages/canyon-platform/src/components/app/ProjectRecordDetailDrawer.tsx" + "path": "components/app/ProjectRecordDetailDrawer.tsx" }, { "lines": { @@ -1008,7 +1008,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/icons/MaterialSymbolsCommitSharp.tsx" + "path": "components/icons/MaterialSymbolsCommitSharp.tsx" }, { "lines": { @@ -1035,7 +1035,7 @@ "skipped": 0, "pct": 61.11 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/index.tsx" + "path": "pages/index/projects/[id]/index.tsx" }, { "lines": { @@ -1062,7 +1062,7 @@ "skipped": 0, "pct": 62.5 }, - "path": "packages/canyon-platform/src/components/CanyonReport/PrepareProdFn.tsx" + "path": "components/CanyonReport/PrepareProdFn.tsx" }, { "lines": { @@ -1089,7 +1089,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/components/CanyonReport/Control.tsx" + "path": "components/CanyonReport/Control.tsx" }, { "lines": { @@ -1116,7 +1116,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/helper.tsx" + "path": "components/CanyonReport/helper.tsx" }, { "lines": { @@ -1143,7 +1143,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/helpers/utils/getViewLineHeight.tsx" + "path": "helpers/utils/getViewLineHeight.tsx" }, { "lines": { @@ -1170,7 +1170,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/line/coverage.tsx" + "path": "components/CanyonReport/line/coverage.tsx" }, { "lines": { @@ -1197,7 +1197,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/line/new.tsx" + "path": "components/CanyonReport/line/new.tsx" }, { "lines": { @@ -1224,7 +1224,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/line/number.tsx" + "path": "components/CanyonReport/line/number.tsx" }, { "lines": { @@ -1251,7 +1251,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx" + "path": "components/CanyonReport/ShikiDetail.tsx" }, { "lines": { @@ -1278,7 +1278,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/CoverageDetail.tsx" + "path": "components/CanyonReport/CoverageDetail.tsx" }, { "lines": { @@ -1305,7 +1305,7 @@ "skipped": 0, "pct": 50 }, - "path": "packages/canyon-platform/src/helpers/utils/common.ts" + "path": "helpers/utils/common.ts" }, { "lines": { @@ -1332,7 +1332,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/components/CanyonReport/ListTable.tsx" + "path": "components/CanyonReport/ListTable.tsx" }, { "lines": { @@ -1359,7 +1359,7 @@ "skipped": 0, "pct": 50 }, - "path": "packages/canyon-platform/src/components/CanyonReport/Overview.tsx" + "path": "components/CanyonReport/Overview.tsx" }, { "lines": { @@ -1386,7 +1386,7 @@ "skipped": 0, "pct": 50 }, - "path": "packages/canyon-platform/src/components/CanyonReport/TreeTable.tsx" + "path": "components/CanyonReport/TreeTable.tsx" }, { "lines": { @@ -1413,7 +1413,7 @@ "skipped": 0, "pct": 52.17 }, - "path": "packages/canyon-platform/src/components/CanyonReport/index.tsx" + "path": "components/CanyonReport/index.tsx" }, { "lines": { @@ -1440,7 +1440,7 @@ "skipped": 0, "pct": 50 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/commits/helper/index.ts" + "path": "pages/index/projects/[id]/commits/helper/index.ts" }, { "lines": { @@ -1467,7 +1467,7 @@ "skipped": 0, "pct": 39.28 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/commits/[sha].tsx" + "path": "pages/index/projects/[id]/commits/[sha].tsx" }, { "lines": { @@ -1494,7 +1494,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/BasicForms.tsx" + "path": "pages/index/projects/[id]/configure/helper/BasicForms.tsx" }, { "lines": { @@ -1521,7 +1521,7 @@ "skipped": 0, "pct": 100 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/icons/SolarUserIdLinear.tsx" + "path": "pages/index/projects/[id]/configure/helper/icons/SolarUserIdLinear.tsx" }, { "lines": { @@ -1548,7 +1548,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/crud.tsx" + "path": "pages/index/projects/[id]/configure/helper/crud.tsx" }, { "lines": { @@ -1575,7 +1575,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/MemberTable.tsx" + "path": "pages/index/projects/[id]/configure/helper/MemberTable.tsx" }, { "lines": { @@ -1602,7 +1602,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/helper/TagTable.tsx" + "path": "pages/index/projects/[id]/configure/helper/TagTable.tsx" }, { "lines": { @@ -1629,7 +1629,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/projects/[id]/configure/index.tsx" + "path": "pages/index/projects/[id]/configure/index.tsx" }, { "lines": { @@ -1656,7 +1656,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/helpers/gitprovider/genOAuthUrl.ts" + "path": "helpers/gitprovider/genOAuthUrl.ts" }, { "lines": { @@ -1683,7 +1683,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/settings/components/BindGitProvider.tsx" + "path": "pages/index/settings/components/BindGitProvider.tsx" }, { "lines": { @@ -1710,7 +1710,7 @@ "skipped": 0, "pct": 0 }, - "path": "packages/canyon-platform/src/pages/index/settings/index.tsx" + "path": "pages/index/settings/index.tsx" }, { "lines": { @@ -1737,7 +1737,7 @@ "skipped": 0, "pct": 66.66 }, - "path": "packages/canyon-platform/src/App.tsx" + "path": "App.tsx" }, { "lines": { @@ -1764,7 +1764,7 @@ "skipped": 0, "pct": 15.38 }, - "path": "packages/canyon-platform/src/main.tsx" + "path": "main.tsx" } ] window.reportName = 'canyon' diff --git a/packages/canyon-report/mock/dynamic-data/App.tsx.js b/packages/canyon-report/mock/dynamic-data/App.tsx.js new file mode 100644 index 00000000..7fde3184 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/App.tsx.js @@ -0,0 +1,229 @@ +window["App.tsx"] = { + "content": "import enUS from \"antd/es/locale/en_US\";\nimport jaJP from \"antd/es/locale/ja_JP\";\nimport zhCN from \"antd/es/locale/zh_CN\";\nimport { useRoutes } from \"react-router-dom\";\n\nimport routes from \"~react-pages\";\n\nconst languages = {\n cn: zhCN,\n en: enUS,\n ja: jaJP,\n};\n\nconst lng = (localStorage.getItem(\"language\") ||\n \"cn\") as keyof typeof languages;\n\nconst { darkAlgorithm } = theme;\nconst App = () => {\n const isDark = localStorage.getItem(\"theme\")\n ? localStorage.getItem(\"theme\") === \"dark\"\n : false;\n return (\n
\n \n {useRoutes(routes)}\n \n
\n );\n};\n\nexport default App;\n", + "coverage": { + "path": "App.tsx", + "b": { + "0": [ + 8, + 8 + ], + "1": [ + 0, + 32 + ], + "2": [ + 0, + 32 + ] + }, + "f": { + "0": 32 + }, + "s": { + "0": 8, + "1": 8, + "2": 8, + "3": 8, + "4": 32, + "5": 32 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 15, + "column": 6 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 14, + "column": 13 + }, + "end": { + "line": 14, + "column": 45 + } + }, + { + "start": { + "line": 15, + "column": 2 + }, + "end": { + "line": 15, + "column": 6 + } + } + ], + "line": 14 + }, + "1": { + "loc": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 21, + "column": 11 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 20, + "column": 6 + }, + "end": { + "line": 20, + "column": 46 + } + }, + { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 21, + "column": 11 + } + } + ], + "line": 19 + }, + "2": { + "loc": { + "start": { + "line": 30, + "column": 21 + }, + "end": { + "line": 30, + "column": 50 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 30, + "column": 30 + }, + "end": { + "line": 30, + "column": 45 + } + }, + { + "start": { + "line": 30, + "column": 48 + }, + "end": { + "line": 30, + "column": 50 + } + } + ], + "line": 30 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 18, + "column": 13 + } + }, + "loc": { + "start": { + "line": 18, + "column": 18 + }, + "end": { + "line": 37, + "column": 1 + } + }, + "line": 18 + } + }, + "statementMap": { + "0": { + "start": { + "line": 8, + "column": 18 + }, + "end": { + "line": 12, + "column": 1 + } + }, + "1": { + "start": { + "line": 14, + "column": 12 + }, + "end": { + "line": 15, + "column": 33 + } + }, + "2": { + "start": { + "line": 17, + "column": 26 + }, + "end": { + "line": 17, + "column": 31 + } + }, + "3": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 37, + "column": 1 + } + }, + "4": { + "start": { + "line": 19, + "column": 17 + }, + "end": { + "line": 21, + "column": 11 + } + }, + "5": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 36, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/assets/icons/EpTopRight.tsx.js b/packages/canyon-report/mock/dynamic-data/assets/icons/EpTopRight.tsx.js new file mode 100644 index 00000000..0f1e6f0a --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/assets/icons/EpTopRight.tsx.js @@ -0,0 +1,52 @@ +window["assets/icons/EpTopRight.tsx"] = { + "content": "// import React from 'react';\nimport type { SVGProps } from \"react\";\n\nexport function EpTopRight(props: SVGProps) {\n return (\n \n \n \n \n );\n}\n", + "coverage": { + "path": "assets/icons/EpTopRight.tsx", + "b": {}, + "f": { + "0": 0 + }, + "s": { + "0": 0 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "EpTopRight", + "decl": { + "start": { + "line": 4, + "column": 16 + }, + "end": { + "line": 4, + "column": 26 + } + }, + "loc": { + "start": { + "line": 4, + "column": 59 + }, + "end": { + "line": 23, + "column": 1 + } + }, + "line": 4 + } + }, + "statementMap": { + "0": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 22, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Control.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Control.tsx.js new file mode 100644 index 00000000..fc1b105b --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Control.tsx.js @@ -0,0 +1,326 @@ +window["components/CanyonReport/Control.tsx"] = { + "content": "import Icon, { BarsOutlined, SearchOutlined } from \"@ant-design/icons\";\nimport PrepareProdFn from \"@/components/CanyonReport/PrepareProdFn.tsx\";\nimport PhTreeView from \"@/components/CanyonReport/PhTreeView.tsx\";\nimport { Divider, SliderSingleProps } from \"antd\";\nimport { getCOlor } from \"@/helpers/utils/common.ts\";\n\nconst marks: SliderSingleProps[\"marks\"] = {\n 50: {\n style: {\n fontSize: \"10px\",\n },\n label: <>50,\n },\n 80: {\n style: {\n fontSize: \"10px\",\n },\n label: <>80,\n },\n};\nfunction returnPositiveNumbers(num) {\n if (num < 0) {\n return 0;\n } else {\n return num;\n }\n}\nfunction genBackground(range) {\n const a = range[0];\n const b = range[1];\n return `linear-gradient(to right, ${getCOlor(0)} 0%, ${getCOlor(0)} ${(returnPositiveNumbers(50 - a) * 100) / (b - a)}%, ${getCOlor(60)} ${(returnPositiveNumbers(50 - a) * 100) / (b - a)}%, ${getCOlor(60)} ${(returnPositiveNumbers(80 - a) * 100) / (b - a)}%, ${getCOlor(90)} ${((80 - a) * 100) / (b - a)}%, ${getCOlor(90)} 100%)`;\n}\n\nconst CanyonReportControl = ({\n numberFiles,\n onChangeOnlyChange,\n onChangeOnlyChangeKeywords,\n keywords,\n onlyChange,\n onChangeShowMode,\n onChangeRange,\n showMode,\n range,\n}) => {\n const { t } = useTranslation();\n // TODO 暂时不能删除prm\n const prm = useParams();\n // const [range, setRange] = useState([0, 100]);\n return (\n <>\n
\n
\n \n {\n onChangeShowMode(v);\n }}\n options={[\n {\n label: t(\"projects.detail.code.tree\"),\n value: \"tree\",\n icon: ,\n },\n {\n label: t(\"projects.detail.file.list\"),\n value: \"list\",\n icon: ,\n },\n ]}\n />\n\n \n {/*{numberFiles}*/}\n {t(\"projects.detail.total.files\", { msg: numberFiles })}\n {/*覆盖率提升优先级列表*/}\n {/*转换生产流量为测试用例*/}\n \n \n \n
\n\n
\n
\n \n {t(\"projects.detail.only.changed\")}:{\" \"}\n \n }\n />\n
\n \n
\n \n 范围:\n \n {/*style={{ transform: \"translateY(10px)\" }}*/}\n
\n {\n onChangeRange(va);\n }}\n styles={{\n rail: {\n // background: `linear-gradient(to right, ${getCOlor(0)} 0%, ${getCOlor(0)} 50.00%, ${getCOlor(60)} 50.00%, ${getCOlor(60)} 80.00%, ${getCOlor(100)} 80.00%, ${getCOlor(100)} 100%)`,\n },\n track: {\n background: \"transparent\",\n // background: \"#0071c2\",\n },\n tracks: {\n // background: \"#0071c2\",\n background: genBackground(range),\n },\n }}\n />\n
\n
\n \n }\n placeholder={t(\"projects.detail.search.placeholder\")}\n className={\"w-[240px]\"}\n size={\"small\"}\n onChange={onChangeOnlyChangeKeywords}\n />\n
\n
\n \n );\n};\n\nexport default CanyonReportControl;\n", + "coverage": { + "path": "components/CanyonReport/Control.tsx", + "b": { + "0": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 8, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 26, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 26, + "column": 3 + } + }, + { + "start": { + "line": 24, + "column": 9 + }, + "end": { + "line": 26, + "column": 3 + } + } + ], + "line": 22 + } + }, + "fnMap": { + "0": { + "name": "returnPositiveNumbers", + "decl": { + "start": { + "line": 21, + "column": 9 + }, + "end": { + "line": 21, + "column": 30 + } + }, + "loc": { + "start": { + "line": 21, + "column": 36 + }, + "end": { + "line": 27, + "column": 1 + } + }, + "line": 21 + }, + "1": { + "name": "genBackground", + "decl": { + "start": { + "line": 28, + "column": 9 + }, + "end": { + "line": 28, + "column": 22 + } + }, + "loc": { + "start": { + "line": 28, + "column": 30 + }, + "end": { + "line": 32, + "column": 1 + } + }, + "line": 28 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 34, + "column": 28 + }, + "end": { + "line": 34, + "column": 29 + } + }, + "loc": { + "start": { + "line": 44, + "column": 6 + }, + "end": { + "line": 153, + "column": 1 + } + }, + "line": 44 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 57, + "column": 24 + }, + "end": { + "line": 57, + "column": 25 + } + }, + "loc": { + "start": { + "line": 57, + "column": 31 + }, + "end": { + "line": 59, + "column": 15 + } + }, + "line": 57 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 121, + "column": 26 + }, + "end": { + "line": 121, + "column": 27 + } + }, + "loc": { + "start": { + "line": 121, + "column": 34 + }, + "end": { + "line": 123, + "column": 17 + } + }, + "line": 121 + } + }, + "statementMap": { + "0": { + "start": { + "line": 7, + "column": 42 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "1": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 26, + "column": 3 + } + }, + "2": { + "start": { + "line": 23, + "column": 4 + }, + "end": { + "line": 23, + "column": 13 + } + }, + "3": { + "start": { + "line": 25, + "column": 4 + }, + "end": { + "line": 25, + "column": 15 + } + }, + "4": { + "start": { + "line": 29, + "column": 12 + }, + "end": { + "line": 29, + "column": 20 + } + }, + "5": { + "start": { + "line": 30, + "column": 12 + }, + "end": { + "line": 30, + "column": 20 + } + }, + "6": { + "start": { + "line": 31, + "column": 2 + }, + "end": { + "line": 31, + "column": 332 + } + }, + "7": { + "start": { + "line": 34, + "column": 28 + }, + "end": { + "line": 153, + "column": 1 + } + }, + "8": { + "start": { + "line": 45, + "column": 16 + }, + "end": { + "line": 45, + "column": 32 + } + }, + "9": { + "start": { + "line": 47, + "column": 14 + }, + "end": { + "line": 47, + "column": 25 + } + }, + "10": { + "start": { + "line": 49, + "column": 2 + }, + "end": { + "line": 152, + "column": 4 + } + }, + "11": { + "start": { + "line": 58, + "column": 16 + }, + "end": { + "line": 58, + "column": 36 + } + }, + "12": { + "start": { + "line": 122, + "column": 18 + }, + "end": { + "line": 122, + "column": 36 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/CoverageDetail.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/CoverageDetail.tsx.js new file mode 100644 index 00000000..daa84ec9 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/CoverageDetail.tsx.js @@ -0,0 +1,287 @@ +window["components/CanyonReport/CoverageDetail.tsx"] = { + "content": "import { coreFn } from \"./helper.tsx\";\nimport LineCoverage from \"./line/coverage.tsx\";\nimport LineNew from \"./line/new.tsx\";\nimport LineNumber from \"./line/number.tsx\";\nimport ShikiDetail from \"./ShikiDetail.tsx\";\n\nconst CanyonReportCoverageDetail = ({ data, theme }: any) => {\n const code = data.sourcecode;\n const { lines } = coreFn(data.coverage, code);\n return (\n <>\n \n \n \n {\n if (i.executionNumber > 0) {\n return {\n covered: \"yes\",\n hits: i.executionNumber,\n };\n } else if (i.executionNumber === 0) {\n return {\n covered: \"no\",\n hits: i.executionNumber,\n };\n } else {\n return {\n covered: \"neutral\",\n hits: 0,\n };\n }\n })}\n />\n \n \n \n );\n};\n\nexport default CanyonReportCoverageDetail;\n", + "coverage": { + "path": "components/CanyonReport/CoverageDetail.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 36 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 24, + "column": 16 + }, + "end": { + "line": 24, + "column": 30 + } + }, + { + "start": { + "line": 24, + "column": 34 + }, + "end": { + "line": 24, + "column": 36 + } + } + ], + "line": 24 + }, + "1": { + "loc": { + "start": { + "line": 29, + "column": 12 + }, + "end": { + "line": 44, + "column": 13 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 29, + "column": 12 + }, + "end": { + "line": 44, + "column": 13 + } + }, + { + "start": { + "line": 34, + "column": 19 + }, + "end": { + "line": 44, + "column": 13 + } + } + ], + "line": 29 + }, + "2": { + "loc": { + "start": { + "line": 34, + "column": 19 + }, + "end": { + "line": 44, + "column": 13 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 34, + "column": 19 + }, + "end": { + "line": 44, + "column": 13 + } + }, + { + "start": { + "line": 39, + "column": 19 + }, + "end": { + "line": 44, + "column": 13 + } + } + ], + "line": 34 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 7, + "column": 36 + } + }, + "loc": { + "start": { + "line": 7, + "column": 61 + }, + "end": { + "line": 55, + "column": 1 + } + }, + "line": 7 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 28, + "column": 28 + }, + "end": { + "line": 28, + "column": 29 + } + }, + "loc": { + "start": { + "line": 28, + "column": 35 + }, + "end": { + "line": 45, + "column": 11 + } + }, + "line": 28 + } + }, + "statementMap": { + "0": { + "start": { + "line": 7, + "column": 35 + }, + "end": { + "line": 55, + "column": 1 + } + }, + "1": { + "start": { + "line": 8, + "column": 15 + }, + "end": { + "line": 8, + "column": 30 + } + }, + "2": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 47 + } + }, + "3": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 54, + "column": 4 + } + }, + "4": { + "start": { + "line": 29, + "column": 12 + }, + "end": { + "line": 44, + "column": 13 + } + }, + "5": { + "start": { + "line": 30, + "column": 14 + }, + "end": { + "line": 33, + "column": 16 + } + }, + "6": { + "start": { + "line": 34, + "column": 19 + }, + "end": { + "line": 44, + "column": 13 + } + }, + "7": { + "start": { + "line": 35, + "column": 14 + }, + "end": { + "line": 38, + "column": 16 + } + }, + "8": { + "start": { + "line": 40, + "column": 14 + }, + "end": { + "line": 43, + "column": 16 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ListTable.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ListTable.tsx.js new file mode 100644 index 00000000..aa77be16 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ListTable.tsx.js @@ -0,0 +1,415 @@ +window["components/CanyonReport/ListTable.tsx"] = { + "content": "import Highlighter from \"react-highlight-words\";\n\nimport { getCOlor, percent } from \"../../helpers/utils/common.ts\";\nconst CanyonReportListTable = ({\n dataSource,\n loading,\n keywords,\n onSelect,\n onlyChange,\n}) => {\n const { t } = useTranslation();\n const newlinesColumns = onlyChange\n ? [\n {\n title: t(\"projects.newlines\"),\n width: \"240px\",\n sorter: (a, b) => {\n return (\n percent(a.newlines.covered, a.newlines.total) -\n percent(b.newlines.covered, b.newlines.total)\n );\n },\n // key: 'total',\n dataIndex: [\"newlines\", \"total\"],\n render(text, record) {\n return (\n \n \n \n ({record.newlines.covered}/{record.newlines.total})\n \n \n );\n },\n },\n // {\n // title: 'covered',\n // key: 'covered',\n // dataIndex: ['summary', 'newlines', 'covered'],\n // },\n ]\n : [];\n return (\n
\n \n {\" \"}\n {\n onSelect({\n path: text,\n });\n }}\n >\n \n \n );\n },\n },\n {\n title: t(\"common.total\"),\n key: \"total\",\n dataIndex: [\"statements\", \"total\"],\n sorter(a, b) {\n return a.statements.total - b.statements.total;\n },\n },\n {\n title: t(\"common.covered\"),\n key: \"covered\",\n dataIndex: [\"statements\", \"covered\"],\n sorter(a, b) {\n return a.statements.covered - b.statements.covered;\n },\n },\n ]\n .concat(newlinesColumns)\n .concat([\n {\n title: t(\"projects.config.coverage\") + \" %\",\n width: \"300px\",\n key: \"c\",\n sorter: (a, b) => {\n return a.statements.pct - b.statements.pct;\n },\n dataIndex: [\"statements\", \"pct\"],\n render(text) {\n return (\n \n );\n },\n },\n ])}\n />\n \n
\n );\n};\n\nexport default CanyonReportListTable;\n", + "coverage": { + "path": "components/CanyonReport/ListTable.tsx", + "b": { + "0": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 55, + "column": 8 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 54, + "column": 7 + } + }, + { + "start": { + "line": 55, + "column": 6 + }, + "end": { + "line": 55, + "column": 8 + } + } + ], + "line": 12 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 4, + "column": 31 + } + }, + "loc": { + "start": { + "line": 10, + "column": 6 + }, + "end": { + "line": 146, + "column": 1 + } + }, + "line": 10 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 17, + "column": 18 + }, + "end": { + "line": 17, + "column": 19 + } + }, + "loc": { + "start": { + "line": 17, + "column": 28 + }, + "end": { + "line": 22, + "column": 11 + } + }, + "line": 17 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 25, + "column": 10 + }, + "end": { + "line": 25, + "column": 11 + } + }, + "loc": { + "start": { + "line": 25, + "column": 31 + }, + "end": { + "line": 47, + "column": 11 + } + }, + "line": 25 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 81, + "column": 14 + }, + "end": { + "line": 81, + "column": 15 + } + }, + "loc": { + "start": { + "line": 81, + "column": 27 + }, + "end": { + "line": 99, + "column": 15 + } + }, + "line": 81 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 85, + "column": 29 + }, + "end": { + "line": 85, + "column": 30 + } + }, + "loc": { + "start": { + "line": 85, + "column": 35 + }, + "end": { + "line": 89, + "column": 21 + } + }, + "line": 85 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 105, + "column": 14 + }, + "end": { + "line": 105, + "column": 15 + } + }, + "loc": { + "start": { + "line": 105, + "column": 27 + }, + "end": { + "line": 107, + "column": 15 + } + }, + "line": 105 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 113, + "column": 14 + }, + "end": { + "line": 113, + "column": 15 + } + }, + "loc": { + "start": { + "line": 113, + "column": 27 + }, + "end": { + "line": 115, + "column": 15 + } + }, + "line": 113 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 124, + "column": 24 + }, + "end": { + "line": 124, + "column": 25 + } + }, + "loc": { + "start": { + "line": 124, + "column": 34 + }, + "end": { + "line": 126, + "column": 17 + } + }, + "line": 124 + }, + "8": { + "name": "(anonymous_8)", + "decl": { + "start": { + "line": 128, + "column": 16 + }, + "end": { + "line": 128, + "column": 17 + } + }, + "loc": { + "start": { + "line": 128, + "column": 29 + }, + "end": { + "line": 139, + "column": 17 + } + }, + "line": 128 + } + }, + "statementMap": { + "0": { + "start": { + "line": 4, + "column": 30 + }, + "end": { + "line": 146, + "column": 1 + } + }, + "1": { + "start": { + "line": 11, + "column": 16 + }, + "end": { + "line": 11, + "column": 32 + } + }, + "2": { + "start": { + "line": 12, + "column": 26 + }, + "end": { + "line": 55, + "column": 8 + } + }, + "3": { + "start": { + "line": 18, + "column": 12 + }, + "end": { + "line": 21, + "column": 14 + } + }, + "4": { + "start": { + "line": 26, + "column": 12 + }, + "end": { + "line": 46, + "column": 14 + } + }, + "5": { + "start": { + "line": 56, + "column": 2 + }, + "end": { + "line": 145, + "column": 4 + } + }, + "6": { + "start": { + "line": 82, + "column": 16 + }, + "end": { + "line": 98, + "column": 18 + } + }, + "7": { + "start": { + "line": 86, + "column": 22 + }, + "end": { + "line": 88, + "column": 25 + } + }, + "8": { + "start": { + "line": 106, + "column": 16 + }, + "end": { + "line": 106, + "column": 63 + } + }, + "9": { + "start": { + "line": 114, + "column": 16 + }, + "end": { + "line": 114, + "column": 67 + } + }, + "10": { + "start": { + "line": 125, + "column": 18 + }, + "end": { + "line": 125, + "column": 61 + } + }, + "11": { + "start": { + "line": 129, + "column": 18 + }, + "end": { + "line": 138, + "column": 20 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Overview.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Overview.tsx.js new file mode 100644 index 00000000..22430521 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/Overview.tsx.js @@ -0,0 +1,564 @@ +window["components/CanyonReport/Overview.tsx"] = { + "content": "import { CopyOutlined, ShareAltOutlined } from \"@ant-design/icons\";\n// @ts-ignore\nimport { CopyToClipboard } from \"react-copy-to-clipboard\";\nimport { useSearchParams } from \"react-router-dom\";\n\nimport { getCOlor } from \"../../helpers/utils/common.ts\";\nimport { capitalizeFirstLetter } from \"./helper.tsx\";\nconst obj = {\n statements: 0,\n branches: 1,\n functions: 2,\n lines: 3,\n newlines: 4,\n};\nconst { Text } = Typography;\nconst CanyonReportOverview = ({\n activatedPath,\n pathWithNamespace,\n onSelect,\n summaryTreeItem,\n}) => {\n const [sprm] = useSearchParams();\n const { t } = useTranslation();\n return (\n
\n {/*{JSON.stringify(summaryTreeItem.summary)}*/}\n
\n {\n onSelect({ path: \"\" });\n }}\n >\n {pathWithNamespace}\n \n {/* / */}\n {activatedPath?.split(\"/\").map((i, index, arr) => {\n return (\n <>\n {activatedPath !== \"\" ? / : null}\n {\n const newpath = arr\n .filter((i, index3) => index3 < index + 1)\n .reduce((c, p, index) => {\n return c + (index === 0 ? \"\" : \"/\") + p;\n }, \"\");\n onSelect({ path: newpath });\n }}\n >\n {i.replace(\"~\", pathWithNamespace)}\n \n \n );\n })}\n \n {\n message.success(\"复制路径成功\");\n }}\n >\n \n \n \n \n\n {\n message.success(\"复制分享链接成功\");\n }}\n >\n \n \n \n \n
\n\n
\n {Object.entries(summaryTreeItem.summary)\n .sort((a, b) => {\n return obj[a[0]] - obj[b[0]];\n })\n .map(([key, value]) => {\n return (\n
\n \n {value.pct}%\n \n \n {t(\"projects.\" + key)}:\n \n \n {value.covered}/{value.total}\n \n
\n );\n })}\n
\n
\n \n );\n};\n\nexport default CanyonReportOverview;\n", + "coverage": { + "path": "components/CanyonReport/Overview.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0 + }, + "s": { + "0": 8, + "1": 8, + "2": 8, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 40, + "column": 15 + }, + "end": { + "line": 40, + "column": 61 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 40, + "column": 38 + }, + "end": { + "line": 40, + "column": 54 + } + }, + { + "start": { + "line": 40, + "column": 57 + }, + "end": { + "line": 40, + "column": 61 + } + } + ], + "line": 40 + }, + "1": { + "loc": { + "start": { + "line": 47, + "column": 34 + }, + "end": { + "line": 47, + "column": 56 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 47, + "column": 48 + }, + "end": { + "line": 47, + "column": 50 + } + }, + { + "start": { + "line": 47, + "column": 53 + }, + "end": { + "line": 47, + "column": 56 + } + } + ], + "line": 47 + }, + "2": { + "loc": { + "start": { + "line": 59, + "column": 16 + }, + "end": { + "line": 59, + "column": 39 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 59, + "column": 16 + }, + "end": { + "line": 59, + "column": 29 + } + }, + { + "start": { + "line": 59, + "column": 33 + }, + "end": { + "line": 59, + "column": 39 + } + } + ], + "line": 59 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 16, + "column": 30 + } + }, + "loc": { + "start": { + "line": 21, + "column": 6 + }, + "end": { + "line": 112, + "column": 1 + } + }, + "line": 21 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 30, + "column": 19 + }, + "end": { + "line": 30, + "column": 20 + } + }, + "loc": { + "start": { + "line": 30, + "column": 25 + }, + "end": { + "line": 32, + "column": 11 + } + }, + "line": 30 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 37, + "column": 39 + }, + "end": { + "line": 37, + "column": 40 + } + }, + "loc": { + "start": { + "line": 37, + "column": 58 + }, + "end": { + "line": 56, + "column": 9 + } + }, + "line": 37 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 43, + "column": 25 + }, + "end": { + "line": 43, + "column": 26 + } + }, + "loc": { + "start": { + "line": 43, + "column": 31 + }, + "end": { + "line": 50, + "column": 17 + } + }, + "line": 43 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 45, + "column": 28 + }, + "end": { + "line": 45, + "column": 29 + } + }, + "loc": { + "start": { + "line": 45, + "column": 43 + }, + "end": { + "line": 45, + "column": 61 + } + }, + "line": 45 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 46, + "column": 28 + }, + "end": { + "line": 46, + "column": 29 + } + }, + "loc": { + "start": { + "line": 46, + "column": 45 + }, + "end": { + "line": 48, + "column": 21 + } + }, + "line": 46 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 60, + "column": 18 + }, + "end": { + "line": 60, + "column": 19 + } + }, + "loc": { + "start": { + "line": 60, + "column": 24 + }, + "end": { + "line": 62, + "column": 11 + } + }, + "line": 60 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 71, + "column": 18 + }, + "end": { + "line": 71, + "column": 19 + } + }, + "loc": { + "start": { + "line": 71, + "column": 24 + }, + "end": { + "line": 73, + "column": 11 + } + }, + "line": 71 + }, + "8": { + "name": "(anonymous_8)", + "decl": { + "start": { + "line": 85, + "column": 16 + }, + "end": { + "line": 85, + "column": 17 + } + }, + "loc": { + "start": { + "line": 85, + "column": 26 + }, + "end": { + "line": 87, + "column": 11 + } + }, + "line": 85 + }, + "9": { + "name": "(anonymous_9)", + "decl": { + "start": { + "line": 88, + "column": 15 + }, + "end": { + "line": 88, + "column": 16 + } + }, + "loc": { + "start": { + "line": 88, + "column": 33 + }, + "end": { + "line": 102, + "column": 11 + } + }, + "line": 88 + } + }, + "statementMap": { + "0": { + "start": { + "line": 8, + "column": 12 + }, + "end": { + "line": 14, + "column": 1 + } + }, + "1": { + "start": { + "line": 15, + "column": 17 + }, + "end": { + "line": 15, + "column": 27 + } + }, + "2": { + "start": { + "line": 16, + "column": 29 + }, + "end": { + "line": 112, + "column": 1 + } + }, + "3": { + "start": { + "line": 22, + "column": 17 + }, + "end": { + "line": 22, + "column": 34 + } + }, + "4": { + "start": { + "line": 23, + "column": 16 + }, + "end": { + "line": 23, + "column": 32 + } + }, + "5": { + "start": { + "line": 24, + "column": 2 + }, + "end": { + "line": 111, + "column": 4 + } + }, + "6": { + "start": { + "line": 31, + "column": 12 + }, + "end": { + "line": 31, + "column": 35 + } + }, + "7": { + "start": { + "line": 38, + "column": 10 + }, + "end": { + "line": 55, + "column": 12 + } + }, + "8": { + "start": { + "line": 44, + "column": 34 + }, + "end": { + "line": 48, + "column": 26 + } + }, + "9": { + "start": { + "line": 45, + "column": 43 + }, + "end": { + "line": 45, + "column": 61 + } + }, + "10": { + "start": { + "line": 47, + "column": 22 + }, + "end": { + "line": 47, + "column": 62 + } + }, + "11": { + "start": { + "line": 49, + "column": 18 + }, + "end": { + "line": 49, + "column": 46 + } + }, + "12": { + "start": { + "line": 61, + "column": 12 + }, + "end": { + "line": 61, + "column": 38 + } + }, + "13": { + "start": { + "line": 72, + "column": 12 + }, + "end": { + "line": 72, + "column": 40 + } + }, + "14": { + "start": { + "line": 86, + "column": 12 + }, + "end": { + "line": 86, + "column": 41 + } + }, + "15": { + "start": { + "line": 89, + "column": 12 + }, + "end": { + "line": 101, + "column": 14 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PhTreeView.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PhTreeView.tsx.js new file mode 100644 index 00000000..59ff0935 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PhTreeView.tsx.js @@ -0,0 +1,52 @@ +window["components/CanyonReport/PhTreeView.tsx"] = { + "content": "import type { SVGProps } from \"react\";\n\nexport default function PhTreeView(props: SVGProps) {\n return (\n \n \n \n );\n}\n", + "coverage": { + "path": "components/CanyonReport/PhTreeView.tsx", + "b": {}, + "f": { + "0": 0 + }, + "s": { + "0": 0 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "PhTreeView", + "decl": { + "start": { + "line": 3, + "column": 24 + }, + "end": { + "line": 3, + "column": 34 + } + }, + "loc": { + "start": { + "line": 3, + "column": 67 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "line": 3 + } + }, + "statementMap": { + "0": { + "start": { + "line": 4, + "column": 2 + }, + "end": { + "line": 17, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PrepareProdFn.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PrepareProdFn.tsx.js new file mode 100644 index 00000000..7825f203 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/PrepareProdFn.tsx.js @@ -0,0 +1,606 @@ +window["components/CanyonReport/PrepareProdFn.tsx"] = { + "content": "import React, { useState } from \"react\";\nimport { Alert, Button, Drawer } from \"antd\";\nimport { Editor } from \"@monaco-editor/react\";\nimport { useRequest } from \"ahooks\";\nimport axios from \"axios\";\n\nconst PrepareProdFn: React.FC = () => {\n const [open, setOpen] = useState(false);\n const prm = useParams();\n const [spams] = useSearchParams();\n const { data, loading, run } = useRequest(\n () =>\n axios\n .post(\n atob(`aHR0cHM6Ly90cmlwY2FueW9uLmZ3cy5xYS5udC5jdHJpcGNvcnAuY29t`) +\n \"/api/coverage/prepareProdFn\",\n {\n projectID: prm.id,\n sha: prm.sha,\n username: localStorage.getItem(\"username\"),\n path: spams.get(\"path\"),\n },\n )\n .then(({ data }) => data),\n {\n manual: true,\n },\n );\n\n const {\n data: da1,\n run: run1,\n loading: loading1,\n } = useRequest(\n () =>\n axios\n .post(\n atob(`aHR0cHM6Ly90cmlwY2FueW9uLmZ3cy5xYS5udC5jdHJpcGNvcnAuY29t`) +\n \"/flytest-api-ctrip-coffeebean-transfer/api/task/triggerPullTrafficByFn\",\n data,\n )\n .then(({ data }) => data),\n {\n manual: true,\n onSuccess() {\n message.success(\"开始转换,请留意后续Flybirds消息推送\");\n },\n },\n );\n\n const showDrawer = () => {\n setOpen(true);\n };\n\n const onClose = () => {\n setOpen(false);\n };\n\n useEffect(() => {\n if (open) {\n run();\n }\n }, [open]);\n\n return (\n <>\n {[\n \"tripgl-37885-auto\",\n \"tripgl-62594-auto\",\n \"tripgl-108960-auto\",\n ].includes(prm.id || \"\") && (\n \n )}\n\n \n \n \n
\n \n
\n \n \n \n \n );\n};\n\nexport default PrepareProdFn;\n", + "coverage": { + "path": "components/CanyonReport/PrepareProdFn.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ], + "3": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 60, + "column": 4 + }, + "end": { + "line": 62, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 60, + "column": 4 + }, + "end": { + "line": 62, + "column": 5 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 60 + }, + "1": { + "loc": { + "start": { + "line": 67, + "column": 7 + }, + "end": { + "line": 75, + "column": 7 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 67, + "column": 7 + }, + "end": { + "line": 71, + "column": 30 + } + }, + { + "start": { + "line": 72, + "column": 8 + }, + "end": { + "line": 74, + "column": 17 + } + } + ], + "line": 67 + }, + "2": { + "loc": { + "start": { + "line": 71, + "column": 17 + }, + "end": { + "line": 71, + "column": 29 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 71, + "column": 17 + }, + "end": { + "line": 71, + "column": 23 + } + }, + { + "start": { + "line": 71, + "column": 27 + }, + "end": { + "line": 71, + "column": 29 + } + } + ], + "line": 71 + }, + "3": { + "loc": { + "start": { + "line": 97, + "column": 34 + }, + "end": { + "line": 97, + "column": 44 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 97, + "column": 34 + }, + "end": { + "line": 97, + "column": 38 + } + }, + { + "start": { + "line": 97, + "column": 42 + }, + "end": { + "line": 97, + "column": 44 + } + } + ], + "line": 97 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 7, + "column": 32 + }, + "end": { + "line": 7, + "column": 33 + } + }, + "loc": { + "start": { + "line": 7, + "column": 38 + }, + "end": { + "line": 104, + "column": 1 + } + }, + "line": 7 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 12, + "column": 4 + }, + "end": { + "line": 12, + "column": 5 + } + }, + "loc": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "line": 13 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 24, + "column": 14 + }, + "end": { + "line": 24, + "column": 15 + } + }, + "loc": { + "start": { + "line": 24, + "column": 28 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "line": 24 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 35, + "column": 4 + }, + "end": { + "line": 35, + "column": 5 + } + }, + "loc": { + "start": { + "line": 36, + "column": 6 + }, + "end": { + "line": 42, + "column": 33 + } + }, + "line": 36 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 42, + "column": 14 + }, + "end": { + "line": 42, + "column": 15 + } + }, + "loc": { + "start": { + "line": 42, + "column": 28 + }, + "end": { + "line": 42, + "column": 32 + } + }, + "line": 42 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 45, + "column": 6 + }, + "end": { + "line": 45, + "column": 7 + } + }, + "loc": { + "start": { + "line": 45, + "column": 18 + }, + "end": { + "line": 47, + "column": 7 + } + }, + "line": 45 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 51, + "column": 21 + }, + "end": { + "line": 51, + "column": 22 + } + }, + "loc": { + "start": { + "line": 51, + "column": 27 + }, + "end": { + "line": 53, + "column": 3 + } + }, + "line": 51 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 55, + "column": 18 + }, + "end": { + "line": 55, + "column": 19 + } + }, + "loc": { + "start": { + "line": 55, + "column": 24 + }, + "end": { + "line": 57, + "column": 3 + } + }, + "line": 55 + }, + "8": { + "name": "(anonymous_8)", + "decl": { + "start": { + "line": 59, + "column": 12 + }, + "end": { + "line": 59, + "column": 13 + } + }, + "loc": { + "start": { + "line": 59, + "column": 18 + }, + "end": { + "line": 63, + "column": 3 + } + }, + "line": 59 + } + }, + "statementMap": { + "0": { + "start": { + "line": 7, + "column": 32 + }, + "end": { + "line": 104, + "column": 1 + } + }, + "1": { + "start": { + "line": 8, + "column": 26 + }, + "end": { + "line": 8, + "column": 41 + } + }, + "2": { + "start": { + "line": 9, + "column": 14 + }, + "end": { + "line": 9, + "column": 25 + } + }, + "3": { + "start": { + "line": 10, + "column": 18 + }, + "end": { + "line": 10, + "column": 35 + } + }, + "4": { + "start": { + "line": 11, + "column": 33 + }, + "end": { + "line": 28, + "column": 3 + } + }, + "5": { + "start": { + "line": 13, + "column": 6 + }, + "end": { + "line": 24, + "column": 33 + } + }, + "6": { + "start": { + "line": 24, + "column": 28 + }, + "end": { + "line": 24, + "column": 32 + } + }, + "7": { + "start": { + "line": 34, + "column": 6 + }, + "end": { + "line": 49, + "column": 3 + } + }, + "8": { + "start": { + "line": 36, + "column": 6 + }, + "end": { + "line": 42, + "column": 33 + } + }, + "9": { + "start": { + "line": 42, + "column": 28 + }, + "end": { + "line": 42, + "column": 32 + } + }, + "10": { + "start": { + "line": 46, + "column": 8 + }, + "end": { + "line": 46, + "column": 50 + } + }, + "11": { + "start": { + "line": 51, + "column": 21 + }, + "end": { + "line": 53, + "column": 3 + } + }, + "12": { + "start": { + "line": 52, + "column": 4 + }, + "end": { + "line": 52, + "column": 18 + } + }, + "13": { + "start": { + "line": 55, + "column": 18 + }, + "end": { + "line": 57, + "column": 3 + } + }, + "14": { + "start": { + "line": 56, + "column": 4 + }, + "end": { + "line": 56, + "column": 19 + } + }, + "15": { + "start": { + "line": 59, + "column": 2 + }, + "end": { + "line": 63, + "column": 13 + } + }, + "16": { + "start": { + "line": 60, + "column": 4 + }, + "end": { + "line": 62, + "column": 5 + } + }, + "17": { + "start": { + "line": 61, + "column": 6 + }, + "end": { + "line": 61, + "column": 12 + } + }, + "18": { + "start": { + "line": 65, + "column": 2 + }, + "end": { + "line": 103, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ShikiDetail.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ShikiDetail.tsx.js new file mode 100644 index 00000000..1e0f8770 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/ShikiDetail.tsx.js @@ -0,0 +1,1552 @@ +window["components/CanyonReport/ShikiDetail.tsx"] = { + "content": "import { mergeIntervals } from \"./helper.tsx\";\nimport { createHighlighterCoreInstance } from \"@/components/CanyonReport/loadShiki.ts\";\n\nconst ShikiDetail = ({ defaultValue, filecoverage, theme }) => {\n const [content, setContent] = useState(\"\");\n\n const statementStats = filecoverage.s;\n const statementMeta = filecoverage.statementMap;\n const structuredText = defaultValue\n .split(\"\\n\")\n .reduce((previousValue, currentValue, currentIndex) => {\n return {\n ...previousValue,\n [currentIndex]: currentValue,\n };\n }, {});\n const statementDecorations = [];\n\n Object.entries(statementStats).forEach(([stName, count]) => {\n const meta = statementMeta[stName];\n if (meta) {\n const type = count > 0 ? \"yes\" : \"no\";\n const startCol = meta.start.column;\n let endCol = meta.end.column + 1;\n const startLine = meta.start.line;\n const endLine = meta.end.line;\n\n if (type === \"no\" && structuredText[startLine]) {\n if (endLine !== startLine) {\n endCol = structuredText[startLine].length;\n }\n // 转化为字符的起始\n\n let start = 0;\n let end = 0;\n\n for (let i = 0; i < startLine - 1; i++) {\n start += structuredText[i].length + 1;\n }\n for (let i = 0; i < endLine - 1; i++) {\n end += structuredText[i].length + 1;\n }\n\n start += startCol;\n end += endCol;\n statementDecorations.push([start, end]);\n }\n }\n });\n\n const fnDecorations = [];\n const fnStats = filecoverage.f;\n const fnMeta = filecoverage.fnMap;\n Object.entries(fnStats).forEach(([fName, count]) => {\n const meta = fnMeta[fName];\n if (meta) {\n const type = count > 0 ? \"yes\" : \"no\";\n // Some versions of the instrumenter in the wild populate 'func'\n // but not 'decl':\n const decl = meta.decl || meta.loc;\n const startCol = decl.start.column;\n let endCol = decl.end.column + 1;\n const startLine = decl.start.line;\n const endLine = decl.end.line;\n\n if (type === \"no\" && structuredText[startLine]) {\n if (endLine !== startLine) {\n endCol = structuredText[startLine].length;\n }\n\n // 转化为字符的起始\n\n let start = 0;\n let end = 0;\n\n for (let i = 0; i < startLine - 1; i++) {\n start += structuredText[i].length + 1;\n }\n for (let i = 0; i < endLine - 1; i++) {\n end += structuredText[i].length + 1;\n }\n\n start += startCol;\n end += endCol;\n fnDecorations.push([start, end]);\n }\n }\n });\n\n useEffect(() => {\n createHighlighterCoreInstance().then(({ codeToHtml }) => {\n try {\n const res = codeToHtml(defaultValue, {\n lang: \"javascript\",\n theme: theme === \"light\" ? \"light-plus\" : \"tokyo-night\",\n decorations: mergeIntervals(\n [...statementDecorations, ...fnDecorations].filter((item) => {\n // defaultValue\n if (item[0] >= item[1]) {\n return false;\n } else if (item[1] > defaultValue.length) {\n return false;\n } else {\n return item[0] < item[1];\n }\n }),\n ).map(([start, end]) => {\n return {\n start,\n end,\n properties: { class: \"content-class-no-found\" },\n };\n }),\n });\n setContent(res);\n } catch (err) {\n console.log(\"覆盖率着色失败\", err);\n const r = codeToHtml(defaultValue, {\n lang: \"javascript\",\n theme: theme === \"light\" ? \"light-plus\" : \"tokyo-night\",\n });\n\n setContent(r);\n }\n });\n }, []);\n\n return (\n
\n
\n
\n );\n};\n\nexport default ShikiDetail;\n", + "coverage": { + "path": "components/CanyonReport/ShikiDetail.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ], + "3": [ + 0, + 0 + ], + "4": [ + 0, + 0 + ], + "5": [ + 0, + 0 + ], + "6": [ + 0, + 0 + ], + "7": [ + 0, + 0 + ], + "8": [ + 0, + 0 + ], + "9": [ + 0, + 0 + ], + "10": [ + 0, + 0 + ], + "11": [ + 0, + 0 + ], + "12": [ + 0, + 0 + ], + "13": [ + 0, + 0 + ], + "14": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0, + "19": 0, + "20": 0, + "21": 0, + "22": 0, + "23": 0, + "24": 0, + "25": 0, + "26": 0, + "27": 0, + "28": 0, + "29": 0, + "30": 0, + "31": 0, + "32": 0, + "33": 0, + "34": 0, + "35": 0, + "36": 0, + "37": 0, + "38": 0, + "39": 0, + "40": 0, + "41": 0, + "42": 0, + "43": 0, + "44": 0, + "45": 0, + "46": 0, + "47": 0, + "48": 0, + "49": 0, + "50": 0, + "51": 0, + "52": 0, + "53": 0, + "54": 0, + "55": 0, + "56": 0, + "57": 0, + "58": 0, + "59": 0, + "60": 0, + "61": 0, + "62": 0, + "63": 0, + "64": 0, + "65": 0, + "66": 0, + "67": 0, + "68": 0, + "69": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 21, + "column": 4 + }, + "end": { + "line": 48, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 21, + "column": 4 + }, + "end": { + "line": 48, + "column": 5 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 21 + }, + "1": { + "loc": { + "start": { + "line": 22, + "column": 19 + }, + "end": { + "line": 22, + "column": 43 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 22, + "column": 31 + }, + "end": { + "line": 22, + "column": 36 + } + }, + { + "start": { + "line": 22, + "column": 39 + }, + "end": { + "line": 22, + "column": 43 + } + } + ], + "line": 22 + }, + "2": { + "loc": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 47, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 47, + "column": 7 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 28 + }, + "3": { + "loc": { + "start": { + "line": 28, + "column": 10 + }, + "end": { + "line": 28, + "column": 52 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 28, + "column": 10 + }, + "end": { + "line": 28, + "column": 23 + } + }, + { + "start": { + "line": 28, + "column": 27 + }, + "end": { + "line": 28, + "column": 52 + } + } + ], + "line": 28 + }, + "4": { + "loc": { + "start": { + "line": 29, + "column": 8 + }, + "end": { + "line": 31, + "column": 9 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 29, + "column": 8 + }, + "end": { + "line": 31, + "column": 9 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 29 + }, + "5": { + "loc": { + "start": { + "line": 56, + "column": 4 + }, + "end": { + "line": 87, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 56, + "column": 4 + }, + "end": { + "line": 87, + "column": 5 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 56 + }, + "6": { + "loc": { + "start": { + "line": 57, + "column": 19 + }, + "end": { + "line": 57, + "column": 43 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 57, + "column": 31 + }, + "end": { + "line": 57, + "column": 36 + } + }, + { + "start": { + "line": 57, + "column": 39 + }, + "end": { + "line": 57, + "column": 43 + } + } + ], + "line": 57 + }, + "7": { + "loc": { + "start": { + "line": 60, + "column": 19 + }, + "end": { + "line": 60, + "column": 40 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 60, + "column": 19 + }, + "end": { + "line": 60, + "column": 28 + } + }, + { + "start": { + "line": 60, + "column": 32 + }, + "end": { + "line": 60, + "column": 40 + } + } + ], + "line": 60 + }, + "8": { + "loc": { + "start": { + "line": 66, + "column": 6 + }, + "end": { + "line": 86, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 66, + "column": 6 + }, + "end": { + "line": 86, + "column": 7 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 66 + }, + "9": { + "loc": { + "start": { + "line": 66, + "column": 10 + }, + "end": { + "line": 66, + "column": 52 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 66, + "column": 10 + }, + "end": { + "line": 66, + "column": 23 + } + }, + { + "start": { + "line": 66, + "column": 27 + }, + "end": { + "line": 66, + "column": 52 + } + } + ], + "line": 66 + }, + "10": { + "loc": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 9 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 9 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 67 + }, + "11": { + "loc": { + "start": { + "line": 95, + "column": 17 + }, + "end": { + "line": 95, + "column": 65 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 95, + "column": 37 + }, + "end": { + "line": 95, + "column": 49 + } + }, + { + "start": { + "line": 95, + "column": 52 + }, + "end": { + "line": 95, + "column": 65 + } + } + ], + "line": 95 + }, + "12": { + "loc": { + "start": { + "line": 99, + "column": 14 + }, + "end": { + "line": 105, + "column": 15 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 99, + "column": 14 + }, + "end": { + "line": 105, + "column": 15 + } + }, + { + "start": { + "line": 101, + "column": 21 + }, + "end": { + "line": 105, + "column": 15 + } + } + ], + "line": 99 + }, + "13": { + "loc": { + "start": { + "line": 101, + "column": 21 + }, + "end": { + "line": 105, + "column": 15 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 101, + "column": 21 + }, + "end": { + "line": 105, + "column": 15 + } + }, + { + "start": { + "line": 103, + "column": 21 + }, + "end": { + "line": 105, + "column": 15 + } + } + ], + "line": 101 + }, + "14": { + "loc": { + "start": { + "line": 120, + "column": 17 + }, + "end": { + "line": 120, + "column": 65 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 120, + "column": 37 + }, + "end": { + "line": 120, + "column": 49 + } + }, + { + "start": { + "line": 120, + "column": 52 + }, + "end": { + "line": 120, + "column": 65 + } + } + ], + "line": 120 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 4, + "column": 21 + } + }, + "loc": { + "start": { + "line": 4, + "column": 63 + }, + "end": { + "line": 133, + "column": 1 + } + }, + "line": 4 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 11, + "column": 12 + }, + "end": { + "line": 11, + "column": 13 + } + }, + "loc": { + "start": { + "line": 11, + "column": 59 + }, + "end": { + "line": 16, + "column": 5 + } + }, + "line": 11 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 19, + "column": 41 + }, + "end": { + "line": 19, + "column": 42 + } + }, + "loc": { + "start": { + "line": 19, + "column": 62 + }, + "end": { + "line": 49, + "column": 3 + } + }, + "line": 19 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 54, + "column": 34 + }, + "end": { + "line": 54, + "column": 35 + } + }, + "loc": { + "start": { + "line": 54, + "column": 54 + }, + "end": { + "line": 88, + "column": 3 + } + }, + "line": 54 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 90, + "column": 12 + }, + "end": { + "line": 90, + "column": 13 + } + }, + "loc": { + "start": { + "line": 90, + "column": 18 + }, + "end": { + "line": 126, + "column": 3 + } + }, + "line": 90 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 91, + "column": 41 + }, + "end": { + "line": 91, + "column": 42 + } + }, + "loc": { + "start": { + "line": 91, + "column": 61 + }, + "end": { + "line": 125, + "column": 5 + } + }, + "line": 91 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 97, + "column": 63 + }, + "end": { + "line": 97, + "column": 64 + } + }, + "loc": { + "start": { + "line": 97, + "column": 73 + }, + "end": { + "line": 106, + "column": 13 + } + }, + "line": 97 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 107, + "column": 16 + }, + "end": { + "line": 107, + "column": 17 + } + }, + "loc": { + "start": { + "line": 107, + "column": 34 + }, + "end": { + "line": 113, + "column": 11 + } + }, + "line": 107 + } + }, + "statementMap": { + "0": { + "start": { + "line": 4, + "column": 20 + }, + "end": { + "line": 133, + "column": 1 + } + }, + "1": { + "start": { + "line": 5, + "column": 32 + }, + "end": { + "line": 5, + "column": 44 + } + }, + "2": { + "start": { + "line": 7, + "column": 25 + }, + "end": { + "line": 7, + "column": 39 + } + }, + "3": { + "start": { + "line": 8, + "column": 24 + }, + "end": { + "line": 8, + "column": 49 + } + }, + "4": { + "start": { + "line": 9, + "column": 25 + }, + "end": { + "line": 16, + "column": 10 + } + }, + "5": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 15, + "column": 8 + } + }, + "6": { + "start": { + "line": 17, + "column": 31 + }, + "end": { + "line": 17, + "column": 33 + } + }, + "7": { + "start": { + "line": 19, + "column": 2 + }, + "end": { + "line": 49, + "column": 5 + } + }, + "8": { + "start": { + "line": 20, + "column": 17 + }, + "end": { + "line": 20, + "column": 38 + } + }, + "9": { + "start": { + "line": 21, + "column": 4 + }, + "end": { + "line": 48, + "column": 5 + } + }, + "10": { + "start": { + "line": 22, + "column": 19 + }, + "end": { + "line": 22, + "column": 43 + } + }, + "11": { + "start": { + "line": 23, + "column": 23 + }, + "end": { + "line": 23, + "column": 40 + } + }, + "12": { + "start": { + "line": 24, + "column": 19 + }, + "end": { + "line": 24, + "column": 38 + } + }, + "13": { + "start": { + "line": 25, + "column": 24 + }, + "end": { + "line": 25, + "column": 39 + } + }, + "14": { + "start": { + "line": 26, + "column": 22 + }, + "end": { + "line": 26, + "column": 35 + } + }, + "15": { + "start": { + "line": 28, + "column": 6 + }, + "end": { + "line": 47, + "column": 7 + } + }, + "16": { + "start": { + "line": 29, + "column": 8 + }, + "end": { + "line": 31, + "column": 9 + } + }, + "17": { + "start": { + "line": 30, + "column": 10 + }, + "end": { + "line": 30, + "column": 52 + } + }, + "18": { + "start": { + "line": 34, + "column": 20 + }, + "end": { + "line": 34, + "column": 21 + } + }, + "19": { + "start": { + "line": 35, + "column": 18 + }, + "end": { + "line": 35, + "column": 19 + } + }, + "20": { + "start": { + "line": 37, + "column": 8 + }, + "end": { + "line": 39, + "column": 9 + } + }, + "21": { + "start": { + "line": 37, + "column": 21 + }, + "end": { + "line": 37, + "column": 22 + } + }, + "22": { + "start": { + "line": 38, + "column": 10 + }, + "end": { + "line": 38, + "column": 48 + } + }, + "23": { + "start": { + "line": 40, + "column": 8 + }, + "end": { + "line": 42, + "column": 9 + } + }, + "24": { + "start": { + "line": 40, + "column": 21 + }, + "end": { + "line": 40, + "column": 22 + } + }, + "25": { + "start": { + "line": 41, + "column": 10 + }, + "end": { + "line": 41, + "column": 46 + } + }, + "26": { + "start": { + "line": 44, + "column": 8 + }, + "end": { + "line": 44, + "column": 26 + } + }, + "27": { + "start": { + "line": 45, + "column": 8 + }, + "end": { + "line": 45, + "column": 22 + } + }, + "28": { + "start": { + "line": 46, + "column": 8 + }, + "end": { + "line": 46, + "column": 48 + } + }, + "29": { + "start": { + "line": 51, + "column": 24 + }, + "end": { + "line": 51, + "column": 26 + } + }, + "30": { + "start": { + "line": 52, + "column": 18 + }, + "end": { + "line": 52, + "column": 32 + } + }, + "31": { + "start": { + "line": 53, + "column": 17 + }, + "end": { + "line": 53, + "column": 35 + } + }, + "32": { + "start": { + "line": 54, + "column": 2 + }, + "end": { + "line": 88, + "column": 5 + } + }, + "33": { + "start": { + "line": 55, + "column": 17 + }, + "end": { + "line": 55, + "column": 30 + } + }, + "34": { + "start": { + "line": 56, + "column": 4 + }, + "end": { + "line": 87, + "column": 5 + } + }, + "35": { + "start": { + "line": 57, + "column": 19 + }, + "end": { + "line": 57, + "column": 43 + } + }, + "36": { + "start": { + "line": 60, + "column": 19 + }, + "end": { + "line": 60, + "column": 40 + } + }, + "37": { + "start": { + "line": 61, + "column": 23 + }, + "end": { + "line": 61, + "column": 40 + } + }, + "38": { + "start": { + "line": 62, + "column": 19 + }, + "end": { + "line": 62, + "column": 38 + } + }, + "39": { + "start": { + "line": 63, + "column": 24 + }, + "end": { + "line": 63, + "column": 39 + } + }, + "40": { + "start": { + "line": 64, + "column": 22 + }, + "end": { + "line": 64, + "column": 35 + } + }, + "41": { + "start": { + "line": 66, + "column": 6 + }, + "end": { + "line": 86, + "column": 7 + } + }, + "42": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 9 + } + }, + "43": { + "start": { + "line": 68, + "column": 10 + }, + "end": { + "line": 68, + "column": 52 + } + }, + "44": { + "start": { + "line": 73, + "column": 20 + }, + "end": { + "line": 73, + "column": 21 + } + }, + "45": { + "start": { + "line": 74, + "column": 18 + }, + "end": { + "line": 74, + "column": 19 + } + }, + "46": { + "start": { + "line": 76, + "column": 8 + }, + "end": { + "line": 78, + "column": 9 + } + }, + "47": { + "start": { + "line": 76, + "column": 21 + }, + "end": { + "line": 76, + "column": 22 + } + }, + "48": { + "start": { + "line": 77, + "column": 10 + }, + "end": { + "line": 77, + "column": 48 + } + }, + "49": { + "start": { + "line": 79, + "column": 8 + }, + "end": { + "line": 81, + "column": 9 + } + }, + "50": { + "start": { + "line": 79, + "column": 21 + }, + "end": { + "line": 79, + "column": 22 + } + }, + "51": { + "start": { + "line": 80, + "column": 10 + }, + "end": { + "line": 80, + "column": 46 + } + }, + "52": { + "start": { + "line": 83, + "column": 8 + }, + "end": { + "line": 83, + "column": 26 + } + }, + "53": { + "start": { + "line": 84, + "column": 8 + }, + "end": { + "line": 84, + "column": 22 + } + }, + "54": { + "start": { + "line": 85, + "column": 8 + }, + "end": { + "line": 85, + "column": 41 + } + }, + "55": { + "start": { + "line": 90, + "column": 2 + }, + "end": { + "line": 126, + "column": 9 + } + }, + "56": { + "start": { + "line": 91, + "column": 4 + }, + "end": { + "line": 125, + "column": 7 + } + }, + "57": { + "start": { + "line": 92, + "column": 6 + }, + "end": { + "line": 124, + "column": 7 + } + }, + "58": { + "start": { + "line": 93, + "column": 20 + }, + "end": { + "line": 114, + "column": 10 + } + }, + "59": { + "start": { + "line": 99, + "column": 14 + }, + "end": { + "line": 105, + "column": 15 + } + }, + "60": { + "start": { + "line": 100, + "column": 16 + }, + "end": { + "line": 100, + "column": 29 + } + }, + "61": { + "start": { + "line": 101, + "column": 21 + }, + "end": { + "line": 105, + "column": 15 + } + }, + "62": { + "start": { + "line": 102, + "column": 16 + }, + "end": { + "line": 102, + "column": 29 + } + }, + "63": { + "start": { + "line": 104, + "column": 16 + }, + "end": { + "line": 104, + "column": 41 + } + }, + "64": { + "start": { + "line": 108, + "column": 12 + }, + "end": { + "line": 112, + "column": 14 + } + }, + "65": { + "start": { + "line": 115, + "column": 8 + }, + "end": { + "line": 115, + "column": 24 + } + }, + "66": { + "start": { + "line": 117, + "column": 8 + }, + "end": { + "line": 117, + "column": 36 + } + }, + "67": { + "start": { + "line": 118, + "column": 18 + }, + "end": { + "line": 121, + "column": 10 + } + }, + "68": { + "start": { + "line": 123, + "column": 8 + }, + "end": { + "line": 123, + "column": 22 + } + }, + "69": { + "start": { + "line": 128, + "column": 2 + }, + "end": { + "line": 132, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/TreeTable.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/TreeTable.tsx.js new file mode 100644 index 00000000..64622d5f --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/TreeTable.tsx.js @@ -0,0 +1,495 @@ +window["components/CanyonReport/TreeTable.tsx"] = { + "content": "import { FileOutlined, FolderFilled } from \"@ant-design/icons\";\n\nimport { getCOlor, percent } from \"../../helpers/utils/common.ts\";\nimport { checkSuffix } from \"./helper.tsx\";\n\nconst CanyonReportTreeTable = ({\n dataSource,\n loading,\n activatedPath,\n onSelect,\n onlyChange,\n}) => {\n const { t } = useTranslation();\n const newlinesColumns = onlyChange\n ? [\n {\n title: t(\"projects.newlines\"),\n width: \"200px\",\n sorter: (a, b) => {\n return a.summary.newlines.pct - b.summary.newlines.pct;\n },\n dataIndex: [\"summary\", \"newlines\", \"total\"],\n render(text, record) {\n return (\n \n \n \n ({record.summary.newlines.covered}/\n {record.summary.newlines.total})\n \n {/*{record.summary.newlines.covered}%*/}\n \n );\n },\n },\n ]\n : [];\n // const newlinesColumns = [];\n return (\n
\n \n {\n // return {\n // onClick: (event) => {\n // console.log(record);\n // onSelect(record);\n // }, // click row\n // };\n // }}\n columns={[\n {\n title: t(\"projects.detail.files\"),\n key: \"path\",\n dataIndex: \"path\",\n render(text, record) {\n return (\n {\n onSelect(record);\n }}\n >\n {text.includes(\".\") && checkSuffix(text) ? (\n \n ) : (\n \n )}\n {text.split(\"/\").at(-1)}\n \n );\n },\n },\n\n {\n title: t(\"common.total\"),\n key: \"total\",\n dataIndex: [\"summary\", \"statements\", \"total\"],\n sorter(a, b) {\n return a.summary.statements.total - b.summary.statements.total;\n },\n },\n {\n title: t(\"common.covered\"),\n key: \"covered\",\n dataIndex: [\"summary\", \"statements\", \"covered\"],\n sorter(a, b) {\n return (\n a.summary.statements.covered - b.summary.statements.covered\n );\n },\n },\n ]\n .concat(newlinesColumns)\n .concat([\n {\n title: t(\"projects.config.coverage\") + \" %\",\n width: \"300px\",\n key: \"c\",\n dataIndex: [\"summary\", \"statements\", \"pct\"],\n sorter(a, b) {\n return a.summary.statements.pct - b.summary.statements.pct;\n },\n render(text) {\n return (\n \n );\n },\n },\n ])}\n />\n \n
\n );\n};\n\nexport default CanyonReportTreeTable;\n", + "coverage": { + "path": "components/CanyonReport/TreeTable.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 45, + "column": 8 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 44, + "column": 7 + } + }, + { + "start": { + "line": 45, + "column": 6 + }, + "end": { + "line": 45, + "column": 8 + } + } + ], + "line": 14 + }, + "1": { + "loc": { + "start": { + "line": 84, + "column": 21 + }, + "end": { + "line": 88, + "column": 21 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 85, + "column": 22 + }, + "end": { + "line": 85, + "column": 67 + } + }, + { + "start": { + "line": 87, + "column": 22 + }, + "end": { + "line": 87, + "column": 67 + } + } + ], + "line": 84 + }, + "2": { + "loc": { + "start": { + "line": 84, + "column": 21 + }, + "end": { + "line": 84, + "column": 60 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 84, + "column": 21 + }, + "end": { + "line": 84, + "column": 39 + } + }, + { + "start": { + "line": 84, + "column": 43 + }, + "end": { + "line": 84, + "column": 60 + } + } + ], + "line": 84 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 6, + "column": 31 + } + }, + "loc": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 142, + "column": 1 + } + }, + "line": 12 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 19, + "column": 18 + }, + "end": { + "line": 19, + "column": 19 + } + }, + "loc": { + "start": { + "line": 19, + "column": 28 + }, + "end": { + "line": 21, + "column": 11 + } + }, + "line": 19 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 23, + "column": 10 + }, + "end": { + "line": 23, + "column": 11 + } + }, + "loc": { + "start": { + "line": 23, + "column": 31 + }, + "end": { + "line": 42, + "column": 11 + } + }, + "line": 23 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 76, + "column": 14 + }, + "end": { + "line": 76, + "column": 15 + } + }, + "loc": { + "start": { + "line": 76, + "column": 35 + }, + "end": { + "line": 92, + "column": 15 + } + }, + "line": 76 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 80, + "column": 29 + }, + "end": { + "line": 80, + "column": 30 + } + }, + "loc": { + "start": { + "line": 80, + "column": 35 + }, + "end": { + "line": 82, + "column": 21 + } + }, + "line": 80 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 99, + "column": 14 + }, + "end": { + "line": 99, + "column": 15 + } + }, + "loc": { + "start": { + "line": 99, + "column": 27 + }, + "end": { + "line": 101, + "column": 15 + } + }, + "line": 99 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 107, + "column": 14 + }, + "end": { + "line": 107, + "column": 15 + } + }, + "loc": { + "start": { + "line": 107, + "column": 27 + }, + "end": { + "line": 111, + "column": 15 + } + }, + "line": 107 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 121, + "column": 16 + }, + "end": { + "line": 121, + "column": 17 + } + }, + "loc": { + "start": { + "line": 121, + "column": 29 + }, + "end": { + "line": 123, + "column": 17 + } + }, + "line": 121 + }, + "8": { + "name": "(anonymous_8)", + "decl": { + "start": { + "line": 124, + "column": 16 + }, + "end": { + "line": 124, + "column": 17 + } + }, + "loc": { + "start": { + "line": 124, + "column": 29 + }, + "end": { + "line": 135, + "column": 17 + } + }, + "line": 124 + } + }, + "statementMap": { + "0": { + "start": { + "line": 6, + "column": 30 + }, + "end": { + "line": 142, + "column": 1 + } + }, + "1": { + "start": { + "line": 13, + "column": 16 + }, + "end": { + "line": 13, + "column": 32 + } + }, + "2": { + "start": { + "line": 14, + "column": 26 + }, + "end": { + "line": 45, + "column": 8 + } + }, + "3": { + "start": { + "line": 20, + "column": 12 + }, + "end": { + "line": 20, + "column": 67 + } + }, + "4": { + "start": { + "line": 24, + "column": 12 + }, + "end": { + "line": 41, + "column": 14 + } + }, + "5": { + "start": { + "line": 47, + "column": 2 + }, + "end": { + "line": 141, + "column": 4 + } + }, + "6": { + "start": { + "line": 77, + "column": 16 + }, + "end": { + "line": 91, + "column": 18 + } + }, + "7": { + "start": { + "line": 81, + "column": 22 + }, + "end": { + "line": 81, + "column": 39 + } + }, + "8": { + "start": { + "line": 100, + "column": 16 + }, + "end": { + "line": 100, + "column": 79 + } + }, + "9": { + "start": { + "line": 108, + "column": 16 + }, + "end": { + "line": 110, + "column": 18 + } + }, + "10": { + "start": { + "line": 122, + "column": 18 + }, + "end": { + "line": 122, + "column": 77 + } + }, + "11": { + "start": { + "line": 125, + "column": 18 + }, + "end": { + "line": 134, + "column": 20 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/helper.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/helper.tsx.js new file mode 100644 index 00000000..6e6b7e79 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/helper.tsx.js @@ -0,0 +1,2033 @@ +window["components/CanyonReport/helper.tsx"] = { + "content": "export function coreFn(\n fileCoverage: any,\n fileDetail: string,\n): {\n times: {\n lineNumber: number;\n count: number;\n }[];\n rows: string[];\n maxWidth: number;\n lines: {\n executionNumber: number;\n }[];\n} {\n const nullData = {\n times: [],\n rows: [],\n maxWidth: 0,\n lines: [],\n };\n if (!fileCoverage.s) {\n return nullData;\n }\n\n const content = fileDetail;\n // 1.转换成数组\n const rows = [\"\"];\n let index = 0;\n for (let i = 0; i < content.length; i++) {\n if (content[i] === \"\\n\") {\n index += 1;\n rows.push(\"\");\n } else {\n rows[index] += content[i];\n }\n }\n const maxWidth = JSON.parse(JSON.stringify(rows)).sort(\n (a: string, b: string) => -(a.length - b.length),\n )[0].length;\n\n // 获取numberOfRows\n // 获取行覆盖率\n function getLineCoverage(data: any) {\n const statementMap = data.statementMap;\n const statements = data.s;\n const lineMap = Object.create(null);\n Object.entries(statements).forEach(([st, count]: any) => {\n if (!statementMap[st]) {\n return;\n }\n const { line } = statementMap[st].start;\n const prevVal = lineMap[line];\n if (prevVal === undefined || prevVal < count) {\n lineMap[line] = count;\n }\n });\n return lineMap;\n }\n\n // 计算行\n const lineStats = getLineCoverage(fileCoverage);\n if (!lineStats) {\n return nullData;\n }\n // numberOfRows\n const numberOfRows: any[] = [];\n Object.entries(lineStats).forEach(([lineNumber, count]) => {\n numberOfRows.push({ lineNumber, count });\n // 这边计算出了行的次数!!!!!!\n });\n\n const lines = [];\n for (let i = 0; i < rows.length; i++) {\n if (numberOfRows.find((n) => Number(n.lineNumber) === i + 1)) {\n lines.push({\n executionNumber: numberOfRows.find(\n (n) => Number(n.lineNumber) === i + 1,\n ).count,\n });\n } else {\n lines.push({\n executionNumber: -1,\n });\n }\n }\n return {\n times: numberOfRows,\n rows,\n lines,\n maxWidth,\n };\n}\n\nexport function genDecorationsLv2Array(code, startends) {\n const lines = code.split(\"\\n\");\n function convertRanges(arr) {\n const result = [];\n arr.forEach((data) => {\n const start = data.start;\n const end = data.end;\n\n for (let i = start[0]; i <= end[0]; i++) {\n const intervalStart = i === start[0] ? start[1] : 0;\n const intervalEnd = lines[i].length;\n result.push([i, intervalStart, intervalEnd]);\n }\n });\n // 输出每一行的区间值\n return result;\n }\n\n const convertedData = convertRanges(startends);\n function mergeRanges(ranges) {\n // 对区间按照起始位置进行排序\n ranges.sort((a, b) => a[0] - b[0]);\n\n const merged = [];\n\n let currentRange = ranges[0];\n for (let i = 1; i < ranges.length; i++) {\n const nextRange = ranges[i];\n\n // 如果当前区间和下一个区间有重叠,则合并它们\n if (currentRange[1] >= nextRange[0]) {\n currentRange[1] = Math.max(currentRange[1], nextRange[1]);\n } else {\n merged.push(currentRange);\n currentRange = nextRange;\n }\n }\n\n merged.push(currentRange);\n\n return merged;\n }\n\n function mergeRows(array) {\n const groupedRows = {};\n\n // 将相同行的元素分组\n array.forEach(([row, col, value]) => {\n if (!groupedRows[row]) {\n groupedRows[row] = [];\n }\n groupedRows[row].push([col, value]);\n });\n\n const mergedArray = [];\n\n // 对每个分组合并区间\n for (const row in groupedRows) {\n const mergedRanges = mergeRanges(groupedRows[row]);\n mergedRanges.forEach((range) => {\n mergedArray.push([parseInt(row), range[0], range[1]]);\n });\n }\n\n return mergedArray;\n }\n\n const mergedArray = mergeRows(convertedData);\n return mergedArray;\n}\n\nexport function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nexport function checkSuffix(path) {\n // 只要path里含有vue、js、jsx等就返回true\n return (\n path.includes(\".vue\") ||\n path.includes(\".js\") ||\n path.includes(\".jsx\") ||\n path.includes(\".ts\") ||\n path.includes(\".tsx\")\n );\n}\n\nexport function mergeIntervals(intervals) {\n // 如果输入为空,直接返回空列表\n if (intervals.length === 0) {\n return [];\n }\n\n // 将所有线段按起始位置进行排序\n intervals.sort((a, b) => a[0] - b[0]);\n\n // 初始化结果列表\n const merged = [];\n let [currentStart, currentEnd] = intervals[0];\n\n for (const [start, end] of intervals.slice(1)) {\n if (start <= currentEnd) {\n // 当前线段与前一个线段有重叠\n currentEnd = Math.max(currentEnd, end); // 更新结束位置\n } else {\n // 当前线段与前一个线段没有重叠\n merged.push([currentStart, currentEnd]); // 将前一个线段加入结果列表\n [currentStart, currentEnd] = [start, end]; // 更新当前线段的起始和结束位置\n }\n }\n\n // 添加最后一个线段\n merged.push([currentStart, currentEnd]);\n\n return merged;\n}\n", + "coverage": { + "path": "components/CanyonReport/helper.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ], + "3": [ + 0, + 0 + ], + "4": [ + 0, + 0 + ], + "5": [ + 0, + 0 + ], + "6": [ + 0, + 0 + ], + "7": [ + 0, + 0 + ], + "8": [ + 0, + 0 + ], + "9": [ + 0, + 0 + ], + "10": [ + 0, + 0, + 0, + 0, + 0 + ], + "11": [ + 0, + 0 + ], + "12": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0 + }, + "s": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0, + "19": 0, + "20": 0, + "21": 0, + "22": 0, + "23": 0, + "24": 0, + "25": 0, + "26": 0, + "27": 0, + "28": 0, + "29": 0, + "30": 0, + "31": 0, + "32": 0, + "33": 0, + "34": 0, + "35": 0, + "36": 0, + "37": 0, + "38": 0, + "39": 0, + "40": 0, + "41": 0, + "42": 0, + "43": 0, + "44": 0, + "45": 0, + "46": 0, + "47": 0, + "48": 0, + "49": 0, + "50": 0, + "51": 0, + "52": 0, + "53": 0, + "54": 0, + "55": 0, + "56": 0, + "57": 0, + "58": 0, + "59": 0, + "60": 0, + "61": 0, + "62": 0, + "63": 0, + "64": 0, + "65": 0, + "66": 0, + "67": 0, + "68": 0, + "69": 0, + "70": 0, + "71": 0, + "72": 0, + "73": 0, + "74": 0, + "75": 0, + "76": 0, + "77": 0, + "78": 0, + "79": 0, + "80": 0, + "81": 0, + "82": 0, + "83": 0, + "84": 0, + "85": 0, + "86": 0, + "87": 0, + "88": 0, + "89": 0, + "90": 0, + "91": 0, + "92": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 23, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 23, + "column": 3 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 21 + }, + "1": { + "loc": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 35, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 35, + "column": 5 + } + }, + { + "start": { + "line": 33, + "column": 11 + }, + "end": { + "line": 35, + "column": 5 + } + } + ], + "line": 30 + }, + "2": { + "loc": { + "start": { + "line": 48, + "column": 6 + }, + "end": { + "line": 50, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 48, + "column": 6 + }, + "end": { + "line": 50, + "column": 7 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 48 + }, + "3": { + "loc": { + "start": { + "line": 53, + "column": 6 + }, + "end": { + "line": 55, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 53, + "column": 6 + }, + "end": { + "line": 55, + "column": 7 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 53 + }, + "4": { + "loc": { + "start": { + "line": 53, + "column": 10 + }, + "end": { + "line": 53, + "column": 50 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 53, + "column": 10 + }, + "end": { + "line": 53, + "column": 31 + } + }, + { + "start": { + "line": 53, + "column": 35 + }, + "end": { + "line": 53, + "column": 50 + } + } + ], + "line": 53 + }, + "5": { + "loc": { + "start": { + "line": 62, + "column": 2 + }, + "end": { + "line": 64, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 62, + "column": 2 + }, + "end": { + "line": 64, + "column": 3 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 62 + }, + "6": { + "loc": { + "start": { + "line": 74, + "column": 4 + }, + "end": { + "line": 84, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 74, + "column": 4 + }, + "end": { + "line": 84, + "column": 5 + } + }, + { + "start": { + "line": 80, + "column": 11 + }, + "end": { + "line": 84, + "column": 5 + } + } + ], + "line": 74 + }, + "7": { + "loc": { + "start": { + "line": 103, + "column": 30 + }, + "end": { + "line": 103, + "column": 59 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 103, + "column": 47 + }, + "end": { + "line": 103, + "column": 55 + } + }, + { + "start": { + "line": 103, + "column": 58 + }, + "end": { + "line": 103, + "column": 59 + } + } + ], + "line": 103 + }, + "8": { + "loc": { + "start": { + "line": 124, + "column": 6 + }, + "end": { + "line": 129, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 124, + "column": 6 + }, + "end": { + "line": 129, + "column": 7 + } + }, + { + "start": { + "line": 126, + "column": 13 + }, + "end": { + "line": 129, + "column": 7 + } + } + ], + "line": 124 + }, + "9": { + "loc": { + "start": { + "line": 142, + "column": 6 + }, + "end": { + "line": 144, + "column": 7 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 142, + "column": 6 + }, + "end": { + "line": 144, + "column": 7 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 142 + }, + "10": { + "loc": { + "start": { + "line": 172, + "column": 4 + }, + "end": { + "line": 176, + "column": 25 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 172, + "column": 4 + }, + "end": { + "line": 172, + "column": 25 + } + }, + { + "start": { + "line": 173, + "column": 4 + }, + "end": { + "line": 173, + "column": 24 + } + }, + { + "start": { + "line": 174, + "column": 4 + }, + "end": { + "line": 174, + "column": 25 + } + }, + { + "start": { + "line": 175, + "column": 4 + }, + "end": { + "line": 175, + "column": 24 + } + }, + { + "start": { + "line": 176, + "column": 4 + }, + "end": { + "line": 176, + "column": 25 + } + } + ], + "line": 172 + }, + "11": { + "loc": { + "start": { + "line": 182, + "column": 2 + }, + "end": { + "line": 184, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 182, + "column": 2 + }, + "end": { + "line": 184, + "column": 3 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 182 + }, + "12": { + "loc": { + "start": { + "line": 194, + "column": 4 + }, + "end": { + "line": 201, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 194, + "column": 4 + }, + "end": { + "line": 201, + "column": 5 + } + }, + { + "start": { + "line": 197, + "column": 11 + }, + "end": { + "line": 201, + "column": 5 + } + } + ], + "line": 194 + } + }, + "fnMap": { + "0": { + "name": "coreFn", + "decl": { + "start": { + "line": 1, + "column": 16 + }, + "end": { + "line": 1, + "column": 22 + } + }, + "loc": { + "start": { + "line": 14, + "column": 2 + }, + "end": { + "line": 92, + "column": 1 + } + }, + "line": 14 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 38, + "column": 4 + }, + "end": { + "line": 38, + "column": 5 + } + }, + "loc": { + "start": { + "line": 38, + "column": 30 + }, + "end": { + "line": 38, + "column": 52 + } + }, + "line": 38 + }, + "2": { + "name": "getLineCoverage", + "decl": { + "start": { + "line": 43, + "column": 11 + }, + "end": { + "line": 43, + "column": 26 + } + }, + "loc": { + "start": { + "line": 43, + "column": 38 + }, + "end": { + "line": 58, + "column": 3 + } + }, + "line": 43 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 47, + "column": 39 + }, + "end": { + "line": 47, + "column": 40 + } + }, + "loc": { + "start": { + "line": 47, + "column": 61 + }, + "end": { + "line": 56, + "column": 5 + } + }, + "line": 47 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 67, + "column": 36 + }, + "end": { + "line": 67, + "column": 37 + } + }, + "loc": { + "start": { + "line": 67, + "column": 61 + }, + "end": { + "line": 70, + "column": 3 + } + }, + "line": 67 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 74, + "column": 26 + }, + "end": { + "line": 74, + "column": 27 + } + }, + "loc": { + "start": { + "line": 74, + "column": 33 + }, + "end": { + "line": 74, + "column": 63 + } + }, + "line": 74 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 77, + "column": 10 + }, + "end": { + "line": 77, + "column": 11 + } + }, + "loc": { + "start": { + "line": 77, + "column": 17 + }, + "end": { + "line": 77, + "column": 47 + } + }, + "line": 77 + }, + "7": { + "name": "genDecorationsLv2Array", + "decl": { + "start": { + "line": 94, + "column": 16 + }, + "end": { + "line": 94, + "column": 38 + } + }, + "loc": { + "start": { + "line": 94, + "column": 56 + }, + "end": { + "line": 163, + "column": 1 + } + }, + "line": 94 + }, + "8": { + "name": "convertRanges", + "decl": { + "start": { + "line": 96, + "column": 11 + }, + "end": { + "line": 96, + "column": 24 + } + }, + "loc": { + "start": { + "line": 96, + "column": 30 + }, + "end": { + "line": 110, + "column": 3 + } + }, + "line": 96 + }, + "9": { + "name": "(anonymous_9)", + "decl": { + "start": { + "line": 98, + "column": 16 + }, + "end": { + "line": 98, + "column": 17 + } + }, + "loc": { + "start": { + "line": 98, + "column": 26 + }, + "end": { + "line": 107, + "column": 5 + } + }, + "line": 98 + }, + "10": { + "name": "mergeRanges", + "decl": { + "start": { + "line": 113, + "column": 11 + }, + "end": { + "line": 113, + "column": 22 + } + }, + "loc": { + "start": { + "line": 113, + "column": 31 + }, + "end": { + "line": 135, + "column": 3 + } + }, + "line": 113 + }, + "11": { + "name": "(anonymous_11)", + "decl": { + "start": { + "line": 115, + "column": 16 + }, + "end": { + "line": 115, + "column": 17 + } + }, + "loc": { + "start": { + "line": 115, + "column": 26 + }, + "end": { + "line": 115, + "column": 37 + } + }, + "line": 115 + }, + "12": { + "name": "mergeRows", + "decl": { + "start": { + "line": 137, + "column": 11 + }, + "end": { + "line": 137, + "column": 20 + } + }, + "loc": { + "start": { + "line": 137, + "column": 28 + }, + "end": { + "line": 159, + "column": 3 + } + }, + "line": 137 + }, + "13": { + "name": "(anonymous_13)", + "decl": { + "start": { + "line": 141, + "column": 18 + }, + "end": { + "line": 141, + "column": 19 + } + }, + "loc": { + "start": { + "line": 141, + "column": 41 + }, + "end": { + "line": 146, + "column": 5 + } + }, + "line": 141 + }, + "14": { + "name": "(anonymous_14)", + "decl": { + "start": { + "line": 153, + "column": 27 + }, + "end": { + "line": 153, + "column": 28 + } + }, + "loc": { + "start": { + "line": 153, + "column": 38 + }, + "end": { + "line": 155, + "column": 7 + } + }, + "line": 153 + }, + "15": { + "name": "capitalizeFirstLetter", + "decl": { + "start": { + "line": 165, + "column": 16 + }, + "end": { + "line": 165, + "column": 37 + } + }, + "loc": { + "start": { + "line": 165, + "column": 46 + }, + "end": { + "line": 167, + "column": 1 + } + }, + "line": 165 + }, + "16": { + "name": "checkSuffix", + "decl": { + "start": { + "line": 169, + "column": 16 + }, + "end": { + "line": 169, + "column": 27 + } + }, + "loc": { + "start": { + "line": 169, + "column": 34 + }, + "end": { + "line": 178, + "column": 1 + } + }, + "line": 169 + }, + "17": { + "name": "mergeIntervals", + "decl": { + "start": { + "line": 180, + "column": 16 + }, + "end": { + "line": 180, + "column": 30 + } + }, + "loc": { + "start": { + "line": 180, + "column": 42 + }, + "end": { + "line": 208, + "column": 1 + } + }, + "line": 180 + }, + "18": { + "name": "(anonymous_18)", + "decl": { + "start": { + "line": 187, + "column": 17 + }, + "end": { + "line": 187, + "column": 18 + } + }, + "loc": { + "start": { + "line": 187, + "column": 27 + }, + "end": { + "line": 187, + "column": 38 + } + }, + "line": 187 + } + }, + "statementMap": { + "0": { + "start": { + "line": 15, + "column": 19 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "1": { + "start": { + "line": 21, + "column": 2 + }, + "end": { + "line": 23, + "column": 3 + } + }, + "2": { + "start": { + "line": 22, + "column": 4 + }, + "end": { + "line": 22, + "column": 20 + } + }, + "3": { + "start": { + "line": 25, + "column": 18 + }, + "end": { + "line": 25, + "column": 28 + } + }, + "4": { + "start": { + "line": 27, + "column": 15 + }, + "end": { + "line": 27, + "column": 19 + } + }, + "5": { + "start": { + "line": 28, + "column": 14 + }, + "end": { + "line": 28, + "column": 15 + } + }, + "6": { + "start": { + "line": 29, + "column": 2 + }, + "end": { + "line": 36, + "column": 3 + } + }, + "7": { + "start": { + "line": 29, + "column": 15 + }, + "end": { + "line": 29, + "column": 16 + } + }, + "8": { + "start": { + "line": 30, + "column": 4 + }, + "end": { + "line": 35, + "column": 5 + } + }, + "9": { + "start": { + "line": 31, + "column": 6 + }, + "end": { + "line": 31, + "column": 17 + } + }, + "10": { + "start": { + "line": 32, + "column": 6 + }, + "end": { + "line": 32, + "column": 20 + } + }, + "11": { + "start": { + "line": 34, + "column": 6 + }, + "end": { + "line": 34, + "column": 32 + } + }, + "12": { + "start": { + "line": 37, + "column": 19 + }, + "end": { + "line": 39, + "column": 13 + } + }, + "13": { + "start": { + "line": 38, + "column": 30 + }, + "end": { + "line": 38, + "column": 52 + } + }, + "14": { + "start": { + "line": 44, + "column": 25 + }, + "end": { + "line": 44, + "column": 42 + } + }, + "15": { + "start": { + "line": 45, + "column": 23 + }, + "end": { + "line": 45, + "column": 29 + } + }, + "16": { + "start": { + "line": 46, + "column": 20 + }, + "end": { + "line": 46, + "column": 39 + } + }, + "17": { + "start": { + "line": 47, + "column": 4 + }, + "end": { + "line": 56, + "column": 7 + } + }, + "18": { + "start": { + "line": 48, + "column": 6 + }, + "end": { + "line": 50, + "column": 7 + } + }, + "19": { + "start": { + "line": 49, + "column": 8 + }, + "end": { + "line": 49, + "column": 15 + } + }, + "20": { + "start": { + "line": 51, + "column": 23 + }, + "end": { + "line": 51, + "column": 45 + } + }, + "21": { + "start": { + "line": 52, + "column": 22 + }, + "end": { + "line": 52, + "column": 35 + } + }, + "22": { + "start": { + "line": 53, + "column": 6 + }, + "end": { + "line": 55, + "column": 7 + } + }, + "23": { + "start": { + "line": 54, + "column": 8 + }, + "end": { + "line": 54, + "column": 30 + } + }, + "24": { + "start": { + "line": 57, + "column": 4 + }, + "end": { + "line": 57, + "column": 19 + } + }, + "25": { + "start": { + "line": 61, + "column": 20 + }, + "end": { + "line": 61, + "column": 49 + } + }, + "26": { + "start": { + "line": 62, + "column": 2 + }, + "end": { + "line": 64, + "column": 3 + } + }, + "27": { + "start": { + "line": 63, + "column": 4 + }, + "end": { + "line": 63, + "column": 20 + } + }, + "28": { + "start": { + "line": 66, + "column": 30 + }, + "end": { + "line": 66, + "column": 32 + } + }, + "29": { + "start": { + "line": 67, + "column": 2 + }, + "end": { + "line": 70, + "column": 5 + } + }, + "30": { + "start": { + "line": 68, + "column": 4 + }, + "end": { + "line": 68, + "column": 45 + } + }, + "31": { + "start": { + "line": 72, + "column": 16 + }, + "end": { + "line": 72, + "column": 18 + } + }, + "32": { + "start": { + "line": 73, + "column": 2 + }, + "end": { + "line": 85, + "column": 3 + } + }, + "33": { + "start": { + "line": 73, + "column": 15 + }, + "end": { + "line": 73, + "column": 16 + } + }, + "34": { + "start": { + "line": 74, + "column": 4 + }, + "end": { + "line": 84, + "column": 5 + } + }, + "35": { + "start": { + "line": 74, + "column": 33 + }, + "end": { + "line": 74, + "column": 63 + } + }, + "36": { + "start": { + "line": 75, + "column": 6 + }, + "end": { + "line": 79, + "column": 9 + } + }, + "37": { + "start": { + "line": 77, + "column": 17 + }, + "end": { + "line": 77, + "column": 47 + } + }, + "38": { + "start": { + "line": 81, + "column": 6 + }, + "end": { + "line": 83, + "column": 9 + } + }, + "39": { + "start": { + "line": 86, + "column": 2 + }, + "end": { + "line": 91, + "column": 4 + } + }, + "40": { + "start": { + "line": 95, + "column": 16 + }, + "end": { + "line": 95, + "column": 32 + } + }, + "41": { + "start": { + "line": 97, + "column": 19 + }, + "end": { + "line": 97, + "column": 21 + } + }, + "42": { + "start": { + "line": 98, + "column": 4 + }, + "end": { + "line": 107, + "column": 7 + } + }, + "43": { + "start": { + "line": 99, + "column": 20 + }, + "end": { + "line": 99, + "column": 30 + } + }, + "44": { + "start": { + "line": 100, + "column": 18 + }, + "end": { + "line": 100, + "column": 26 + } + }, + "45": { + "start": { + "line": 102, + "column": 6 + }, + "end": { + "line": 106, + "column": 7 + } + }, + "46": { + "start": { + "line": 102, + "column": 19 + }, + "end": { + "line": 102, + "column": 27 + } + }, + "47": { + "start": { + "line": 103, + "column": 30 + }, + "end": { + "line": 103, + "column": 59 + } + }, + "48": { + "start": { + "line": 104, + "column": 28 + }, + "end": { + "line": 104, + "column": 43 + } + }, + "49": { + "start": { + "line": 105, + "column": 8 + }, + "end": { + "line": 105, + "column": 53 + } + }, + "50": { + "start": { + "line": 109, + "column": 4 + }, + "end": { + "line": 109, + "column": 18 + } + }, + "51": { + "start": { + "line": 112, + "column": 24 + }, + "end": { + "line": 112, + "column": 48 + } + }, + "52": { + "start": { + "line": 115, + "column": 4 + }, + "end": { + "line": 115, + "column": 39 + } + }, + "53": { + "start": { + "line": 115, + "column": 26 + }, + "end": { + "line": 115, + "column": 37 + } + }, + "54": { + "start": { + "line": 117, + "column": 19 + }, + "end": { + "line": 117, + "column": 21 + } + }, + "55": { + "start": { + "line": 119, + "column": 23 + }, + "end": { + "line": 119, + "column": 32 + } + }, + "56": { + "start": { + "line": 120, + "column": 4 + }, + "end": { + "line": 130, + "column": 5 + } + }, + "57": { + "start": { + "line": 120, + "column": 17 + }, + "end": { + "line": 120, + "column": 18 + } + }, + "58": { + "start": { + "line": 121, + "column": 24 + }, + "end": { + "line": 121, + "column": 33 + } + }, + "59": { + "start": { + "line": 124, + "column": 6 + }, + "end": { + "line": 129, + "column": 7 + } + }, + "60": { + "start": { + "line": 125, + "column": 8 + }, + "end": { + "line": 125, + "column": 66 + } + }, + "61": { + "start": { + "line": 127, + "column": 8 + }, + "end": { + "line": 127, + "column": 34 + } + }, + "62": { + "start": { + "line": 128, + "column": 8 + }, + "end": { + "line": 128, + "column": 33 + } + }, + "63": { + "start": { + "line": 132, + "column": 4 + }, + "end": { + "line": 132, + "column": 30 + } + }, + "64": { + "start": { + "line": 134, + "column": 4 + }, + "end": { + "line": 134, + "column": 18 + } + }, + "65": { + "start": { + "line": 138, + "column": 24 + }, + "end": { + "line": 138, + "column": 26 + } + }, + "66": { + "start": { + "line": 141, + "column": 4 + }, + "end": { + "line": 146, + "column": 7 + } + }, + "67": { + "start": { + "line": 142, + "column": 6 + }, + "end": { + "line": 144, + "column": 7 + } + }, + "68": { + "start": { + "line": 143, + "column": 8 + }, + "end": { + "line": 143, + "column": 30 + } + }, + "69": { + "start": { + "line": 145, + "column": 6 + }, + "end": { + "line": 145, + "column": 42 + } + }, + "70": { + "start": { + "line": 148, + "column": 24 + }, + "end": { + "line": 148, + "column": 26 + } + }, + "71": { + "start": { + "line": 151, + "column": 4 + }, + "end": { + "line": 156, + "column": 5 + } + }, + "72": { + "start": { + "line": 152, + "column": 27 + }, + "end": { + "line": 152, + "column": 56 + } + }, + "73": { + "start": { + "line": 153, + "column": 6 + }, + "end": { + "line": 155, + "column": 9 + } + }, + "74": { + "start": { + "line": 154, + "column": 8 + }, + "end": { + "line": 154, + "column": 62 + } + }, + "75": { + "start": { + "line": 158, + "column": 4 + }, + "end": { + "line": 158, + "column": 23 + } + }, + "76": { + "start": { + "line": 161, + "column": 22 + }, + "end": { + "line": 161, + "column": 46 + } + }, + "77": { + "start": { + "line": 162, + "column": 2 + }, + "end": { + "line": 162, + "column": 21 + } + }, + "78": { + "start": { + "line": 166, + "column": 2 + }, + "end": { + "line": 166, + "column": 58 + } + }, + "79": { + "start": { + "line": 171, + "column": 2 + }, + "end": { + "line": 177, + "column": 4 + } + }, + "80": { + "start": { + "line": 182, + "column": 2 + }, + "end": { + "line": 184, + "column": 3 + } + }, + "81": { + "start": { + "line": 183, + "column": 4 + }, + "end": { + "line": 183, + "column": 14 + } + }, + "82": { + "start": { + "line": 187, + "column": 2 + }, + "end": { + "line": 187, + "column": 40 + } + }, + "83": { + "start": { + "line": 187, + "column": 27 + }, + "end": { + "line": 187, + "column": 38 + } + }, + "84": { + "start": { + "line": 190, + "column": 17 + }, + "end": { + "line": 190, + "column": 19 + } + }, + "85": { + "start": { + "line": 191, + "column": 35 + }, + "end": { + "line": 191, + "column": 47 + } + }, + "86": { + "start": { + "line": 193, + "column": 2 + }, + "end": { + "line": 202, + "column": 3 + } + }, + "87": { + "start": { + "line": 194, + "column": 4 + }, + "end": { + "line": 201, + "column": 5 + } + }, + "88": { + "start": { + "line": 196, + "column": 6 + }, + "end": { + "line": 196, + "column": 45 + } + }, + "89": { + "start": { + "line": 199, + "column": 6 + }, + "end": { + "line": 199, + "column": 46 + } + }, + "90": { + "start": { + "line": 200, + "column": 6 + }, + "end": { + "line": 200, + "column": 48 + } + }, + "91": { + "start": { + "line": 205, + "column": 2 + }, + "end": { + "line": 205, + "column": 42 + } + }, + "92": { + "start": { + "line": 207, + "column": 2 + }, + "end": { + "line": 207, + "column": 16 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/index.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/index.tsx.js new file mode 100644 index 00000000..6c5ca59a --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/index.tsx.js @@ -0,0 +1,1165 @@ +window["components/CanyonReport/index.tsx"] = { + "content": "import { genSummaryTreeItem } from \"canyon-data\";\n\nimport CanyonReportControl from \"./Control.tsx\";\nimport CanyonReportCoverageDetail from \"./CoverageDetail.tsx\";\nimport { checkSuffix } from \"./helper.tsx\";\nimport CanyonReportListTable from \"./ListTable.tsx\";\nimport CanyonReportOverview from \"./Overview.tsx\";\nimport CanyonReportTreeTable from \"./TreeTable.tsx\";\n\nfunction checkSummaryOnlyChange(item, onlyChange) {\n // 如果只看改变的为false,就返回全部\n if (onlyChange === false) {\n return true;\n }\n // 不然就检查item.change\n if (onlyChange && item.change) {\n return true;\n } else {\n return false;\n }\n}\nfunction checkSummaryKeywords(item, keywords) {\n return item.path.toLowerCase().includes(keywords.toLowerCase());\n}\nfunction checkSummaryRange(item, range) {\n const pct = item.statements.pct;\n return pct >= range[0] && pct <= range[1];\n}\n\n// 1.summary最主要的数据,有外面传入\n// 2.当前默认defaultPath = sprm.get('path'),锚点\nconst CanyonReport = ({\n // summary,\n activatedPath,\n pathWithNamespace,\n coverageSummaryMapData,\n loading,\n onSelect,\n mainData,\n theme,\n}) => {\n // 几个状态\n // 1.展示模式//tree||list\n const [showMode, setShowMode] = useState(\"tree\");\n // 2.当前是文件还是文件夹\n const fMode = useMemo(() => {\n // return 获取当前path,判断是否含有 .\n return activatedPath.includes(\".\") && checkSuffix(activatedPath)\n ? \"file\"\n : \"folder\";\n }, [activatedPath]);\n // 3.是否只展示变更文件\n // 4.其他的放在各自的状态里\n\n // 5.文件路径关键字搜索\n const [keywords, setKeywords] = useState(\"\");\n const [onlyChange, setOnlyChange] = useState(false);\n const [range, setRange] = useState([0, 100]);\n\n // useEffect(()=>{\n // document.querySelector(\"#nihao\").scrollIntoView(true);\n // },[])\n\n const coverageSummaryMapDataFiltered = useMemo(() => {\n return coverageSummaryMapData.filter(\n (item) =>\n checkSummaryOnlyChange(item, onlyChange) &&\n checkSummaryKeywords(item, keywords) &&\n checkSummaryRange(item, range),\n );\n }, [coverageSummaryMapData, onlyChange, keywords, range]);\n\n const summary = coverageSummaryMapDataFiltered.reduce(\n (acc: any, cur: any) => {\n acc[cur.path] = cur;\n return acc;\n },\n {},\n );\n const summaryTreeItem = genSummaryTreeItem(activatedPath, summary);\n function onChangeOnlyChangeKeywords(v) {\n setKeywords(v.target.value);\n }\n\n function onChangeOnlyChange(v) {\n // console.log(v,'v')\n setOnlyChange(v);\n }\n function onChangeShowMode(mode) {\n setShowMode(mode);\n }\n function onChangeRange(va) {\n setRange(va);\n }\n return (\n
\n \n item.path.includes(activatedPath),\n ).length\n }\n keywords={keywords}\n range={range}\n onlyChange={onlyChange}\n onChangeOnlyChange={onChangeOnlyChange}\n onChangeOnlyChangeKeywords={onChangeOnlyChangeKeywords}\n onChangeShowMode={onChangeShowMode}\n onChangeRange={onChangeRange}\n />\n \n \n {showMode === \"tree\" && fMode === \"folder\" && (\n \n )}\n {showMode === \"list\" && fMode === \"folder\" && (\n \n item.path.includes(activatedPath),\n )}\n />\n )}\n \n {fMode === \"file\" && mainData && (\n \n )}\n \n\n \n
\n );\n};\n\nexport default CanyonReport;\n", + "coverage": { + "path": "components/CanyonReport/index.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ], + "3": [ + 0, + 0 + ], + "4": [ + 0, + 0 + ], + "5": [ + 0, + 0 + ], + "6": [ + 0, + 0, + 0 + ], + "7": [ + 0, + 0, + 0 + ], + "8": [ + 0, + 0, + 0 + ], + "9": [ + 0, + 0 + ], + "10": [ + 0, + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0 + }, + "s": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 8, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0, + "16": 0, + "17": 0, + "18": 0, + "19": 0, + "20": 0, + "21": 0, + "22": 0, + "23": 0, + "24": 0, + "25": 0, + "26": 0, + "27": 0, + "28": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 12 + }, + "1": { + "loc": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + { + "start": { + "line": 18, + "column": 9 + }, + "end": { + "line": 20, + "column": 3 + } + } + ], + "line": 16 + }, + "2": { + "loc": { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 31 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 16, + "column": 6 + }, + "end": { + "line": 16, + "column": 16 + } + }, + { + "start": { + "line": 16, + "column": 20 + }, + "end": { + "line": 16, + "column": 31 + } + } + ], + "line": 16 + }, + "3": { + "loc": { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 43 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 27, + "column": 9 + }, + "end": { + "line": 27, + "column": 24 + } + }, + { + "start": { + "line": 27, + "column": 28 + }, + "end": { + "line": 27, + "column": 43 + } + } + ], + "line": 27 + }, + "4": { + "loc": { + "start": { + "line": 48, + "column": 11 + }, + "end": { + "line": 50, + "column": 16 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 49, + "column": 8 + }, + "end": { + "line": 49, + "column": 14 + } + }, + { + "start": { + "line": 50, + "column": 8 + }, + "end": { + "line": 50, + "column": 16 + } + } + ], + "line": 48 + }, + "5": { + "loc": { + "start": { + "line": 48, + "column": 11 + }, + "end": { + "line": 48, + "column": 68 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 48, + "column": 11 + }, + "end": { + "line": 48, + "column": 38 + } + }, + { + "start": { + "line": 48, + "column": 42 + }, + "end": { + "line": 48, + "column": 68 + } + } + ], + "line": 48 + }, + "6": { + "loc": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 38 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 67, + "column": 48 + } + }, + { + "start": { + "line": 68, + "column": 8 + }, + "end": { + "line": 68, + "column": 44 + } + }, + { + "start": { + "line": 69, + "column": 8 + }, + "end": { + "line": 69, + "column": 38 + } + } + ], + "line": 67 + }, + "7": { + "loc": { + "start": { + "line": 119, + "column": 7 + }, + "end": { + "line": 127, + "column": 7 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 119, + "column": 7 + }, + "end": { + "line": 119, + "column": 26 + } + }, + { + "start": { + "line": 119, + "column": 30 + }, + "end": { + "line": 119, + "column": 48 + } + }, + { + "start": { + "line": 120, + "column": 8 + }, + "end": { + "line": 126, + "column": 10 + } + } + ], + "line": 119 + }, + "8": { + "loc": { + "start": { + "line": 128, + "column": 7 + }, + "end": { + "line": 138, + "column": 7 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 128, + "column": 7 + }, + "end": { + "line": 128, + "column": 26 + } + }, + { + "start": { + "line": 128, + "column": 30 + }, + "end": { + "line": 128, + "column": 48 + } + }, + { + "start": { + "line": 129, + "column": 8 + }, + "end": { + "line": 137, + "column": 10 + } + } + ], + "line": 128 + }, + "9": { + "loc": { + "start": { + "line": 139, + "column": 22 + }, + "end": { + "line": 139, + "column": 51 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 139, + "column": 22 + }, + "end": { + "line": 139, + "column": 31 + } + }, + { + "start": { + "line": 139, + "column": 35 + }, + "end": { + "line": 139, + "column": 51 + } + } + ], + "line": 139 + }, + "10": { + "loc": { + "start": { + "line": 140, + "column": 9 + }, + "end": { + "line": 149, + "column": 9 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 140, + "column": 9 + }, + "end": { + "line": 140, + "column": 25 + } + }, + { + "start": { + "line": 140, + "column": 29 + }, + "end": { + "line": 140, + "column": 37 + } + }, + { + "start": { + "line": 141, + "column": 10 + }, + "end": { + "line": 148, + "column": 12 + } + } + ], + "line": 140 + } + }, + "fnMap": { + "0": { + "name": "checkSummaryOnlyChange", + "decl": { + "start": { + "line": 10, + "column": 9 + }, + "end": { + "line": 10, + "column": 31 + } + }, + "loc": { + "start": { + "line": 10, + "column": 50 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "line": 10 + }, + "1": { + "name": "checkSummaryKeywords", + "decl": { + "start": { + "line": 22, + "column": 9 + }, + "end": { + "line": 22, + "column": 29 + } + }, + "loc": { + "start": { + "line": 22, + "column": 46 + }, + "end": { + "line": 24, + "column": 1 + } + }, + "line": 22 + }, + "2": { + "name": "checkSummaryRange", + "decl": { + "start": { + "line": 25, + "column": 9 + }, + "end": { + "line": 25, + "column": 26 + } + }, + "loc": { + "start": { + "line": 25, + "column": 40 + }, + "end": { + "line": 28, + "column": 1 + } + }, + "line": 25 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 32, + "column": 21 + }, + "end": { + "line": 32, + "column": 22 + } + }, + "loc": { + "start": { + "line": 41, + "column": 6 + }, + "end": { + "line": 155, + "column": 1 + } + }, + "line": 41 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 46, + "column": 24 + }, + "end": { + "line": 46, + "column": 25 + } + }, + "loc": { + "start": { + "line": 46, + "column": 30 + }, + "end": { + "line": 51, + "column": 3 + } + }, + "line": 46 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 64, + "column": 49 + }, + "end": { + "line": 64, + "column": 50 + } + }, + "loc": { + "start": { + "line": 64, + "column": 55 + }, + "end": { + "line": 71, + "column": 3 + } + }, + "line": 64 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 66, + "column": 6 + }, + "end": { + "line": 66, + "column": 7 + } + }, + "loc": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 38 + } + }, + "line": 67 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 74, + "column": 4 + }, + "end": { + "line": 74, + "column": 5 + } + }, + "loc": { + "start": { + "line": 74, + "column": 28 + }, + "end": { + "line": 77, + "column": 5 + } + }, + "line": 74 + }, + "8": { + "name": "onChangeOnlyChangeKeywords", + "decl": { + "start": { + "line": 81, + "column": 11 + }, + "end": { + "line": 81, + "column": 37 + } + }, + "loc": { + "start": { + "line": 81, + "column": 41 + }, + "end": { + "line": 83, + "column": 3 + } + }, + "line": 81 + }, + "9": { + "name": "onChangeOnlyChange", + "decl": { + "start": { + "line": 85, + "column": 11 + }, + "end": { + "line": 85, + "column": 29 + } + }, + "loc": { + "start": { + "line": 85, + "column": 33 + }, + "end": { + "line": 88, + "column": 3 + } + }, + "line": 85 + }, + "10": { + "name": "onChangeShowMode", + "decl": { + "start": { + "line": 89, + "column": 11 + }, + "end": { + "line": 89, + "column": 27 + } + }, + "loc": { + "start": { + "line": 89, + "column": 34 + }, + "end": { + "line": 91, + "column": 3 + } + }, + "line": 89 + }, + "11": { + "name": "onChangeRange", + "decl": { + "start": { + "line": 92, + "column": 11 + }, + "end": { + "line": 92, + "column": 24 + } + }, + "loc": { + "start": { + "line": 92, + "column": 29 + }, + "end": { + "line": 94, + "column": 3 + } + }, + "line": 92 + }, + "12": { + "name": "(anonymous_12)", + "decl": { + "start": { + "line": 100, + "column": 48 + }, + "end": { + "line": 100, + "column": 49 + } + }, + "loc": { + "start": { + "line": 101, + "column": 12 + }, + "end": { + "line": 101, + "column": 45 + } + }, + "line": 101 + }, + "13": { + "name": "(anonymous_13)", + "decl": { + "start": { + "line": 134, + "column": 60 + }, + "end": { + "line": 134, + "column": 61 + } + }, + "loc": { + "start": { + "line": 135, + "column": 12 + }, + "end": { + "line": 135, + "column": 45 + } + }, + "line": 135 + } + }, + "statementMap": { + "0": { + "start": { + "line": 12, + "column": 2 + }, + "end": { + "line": 14, + "column": 3 + } + }, + "1": { + "start": { + "line": 13, + "column": 4 + }, + "end": { + "line": 13, + "column": 16 + } + }, + "2": { + "start": { + "line": 16, + "column": 2 + }, + "end": { + "line": 20, + "column": 3 + } + }, + "3": { + "start": { + "line": 17, + "column": 4 + }, + "end": { + "line": 17, + "column": 16 + } + }, + "4": { + "start": { + "line": 19, + "column": 4 + }, + "end": { + "line": 19, + "column": 17 + } + }, + "5": { + "start": { + "line": 23, + "column": 2 + }, + "end": { + "line": 23, + "column": 66 + } + }, + "6": { + "start": { + "line": 26, + "column": 14 + }, + "end": { + "line": 26, + "column": 33 + } + }, + "7": { + "start": { + "line": 27, + "column": 2 + }, + "end": { + "line": 27, + "column": 44 + } + }, + "8": { + "start": { + "line": 32, + "column": 21 + }, + "end": { + "line": 155, + "column": 1 + } + }, + "9": { + "start": { + "line": 44, + "column": 34 + }, + "end": { + "line": 44, + "column": 50 + } + }, + "10": { + "start": { + "line": 46, + "column": 16 + }, + "end": { + "line": 51, + "column": 21 + } + }, + "11": { + "start": { + "line": 48, + "column": 4 + }, + "end": { + "line": 50, + "column": 17 + } + }, + "12": { + "start": { + "line": 56, + "column": 34 + }, + "end": { + "line": 56, + "column": 46 + } + }, + "13": { + "start": { + "line": 57, + "column": 38 + }, + "end": { + "line": 57, + "column": 53 + } + }, + "14": { + "start": { + "line": 58, + "column": 28 + }, + "end": { + "line": 58, + "column": 46 + } + }, + "15": { + "start": { + "line": 64, + "column": 41 + }, + "end": { + "line": 71, + "column": 59 + } + }, + "16": { + "start": { + "line": 65, + "column": 4 + }, + "end": { + "line": 70, + "column": 6 + } + }, + "17": { + "start": { + "line": 67, + "column": 8 + }, + "end": { + "line": 69, + "column": 38 + } + }, + "18": { + "start": { + "line": 73, + "column": 18 + }, + "end": { + "line": 79, + "column": 3 + } + }, + "19": { + "start": { + "line": 75, + "column": 6 + }, + "end": { + "line": 75, + "column": 26 + } + }, + "20": { + "start": { + "line": 76, + "column": 6 + }, + "end": { + "line": 76, + "column": 17 + } + }, + "21": { + "start": { + "line": 80, + "column": 26 + }, + "end": { + "line": 80, + "column": 68 + } + }, + "22": { + "start": { + "line": 82, + "column": 4 + }, + "end": { + "line": 82, + "column": 32 + } + }, + "23": { + "start": { + "line": 87, + "column": 4 + }, + "end": { + "line": 87, + "column": 21 + } + }, + "24": { + "start": { + "line": 90, + "column": 4 + }, + "end": { + "line": 90, + "column": 22 + } + }, + "25": { + "start": { + "line": 93, + "column": 4 + }, + "end": { + "line": 93, + "column": 17 + } + }, + "26": { + "start": { + "line": 95, + "column": 2 + }, + "end": { + "line": 154, + "column": 4 + } + }, + "27": { + "start": { + "line": 101, + "column": 12 + }, + "end": { + "line": 101, + "column": 45 + } + }, + "28": { + "start": { + "line": 135, + "column": 12 + }, + "end": { + "line": 135, + "column": 45 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/coverage.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/coverage.tsx.js new file mode 100644 index 00000000..8e828364 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/coverage.tsx.js @@ -0,0 +1,476 @@ +window["components/CanyonReport/line/coverage.tsx"] = { + "content": "// import { CSSProperties } from 'react';\n\nimport { getViewLineHeight } from \"../../../helpers/utils/getViewLineHeight.tsx\";\n\nconst LineCoverage = ({ covers, theme }) => {\n const viewLineHeight = getViewLineHeight();\n return (\n
\n {covers.map(({ covered, hits }, index) => {\n if (covered === \"yes\") {\n return (\n \n {hits}x\n
\n );\n } else if (covered === \"no\") {\n return (\n
\n );\n } else {\n return (\n
\n );\n }\n })}\n \n );\n};\n\nexport default LineCoverage;\n", + "coverage": { + "path": "components/CanyonReport/line/coverage.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ], + "3": [ + 0, + 0 + ], + "4": [ + 0, + 0 + ], + "5": [ + 0, + 0 + ], + "6": [ + 0, + 0 + ], + "7": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 51, + "column": 9 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 51, + "column": 9 + } + }, + { + "start": { + "line": 26, + "column": 15 + }, + "end": { + "line": 51, + "column": 9 + } + } + ], + "line": 10 + }, + "1": { + "loc": { + "start": { + "line": 16, + "column": 18 + }, + "end": { + "line": 16, + "column": 68 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 16, + "column": 38 + }, + "end": { + "line": 16, + "column": 56 + } + }, + { + "start": { + "line": 16, + "column": 59 + }, + "end": { + "line": 16, + "column": 68 + } + } + ], + "line": 16 + }, + "2": { + "loc": { + "start": { + "line": 17, + "column": 23 + }, + "end": { + "line": 17, + "column": 72 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 17, + "column": 43 + }, + "end": { + "line": 17, + "column": 60 + } + }, + { + "start": { + "line": 17, + "column": 63 + }, + "end": { + "line": 17, + "column": 72 + } + } + ], + "line": 17 + }, + "3": { + "loc": { + "start": { + "line": 26, + "column": 15 + }, + "end": { + "line": 51, + "column": 9 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 26, + "column": 15 + }, + "end": { + "line": 51, + "column": 9 + } + }, + { + "start": { + "line": 38, + "column": 15 + }, + "end": { + "line": 51, + "column": 9 + } + } + ], + "line": 26 + }, + "4": { + "loc": { + "start": { + "line": 31, + "column": 33 + }, + "end": { + "line": 31, + "column": 74 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 31, + "column": 53 + }, + "end": { + "line": 31, + "column": 62 + } + }, + { + "start": { + "line": 31, + "column": 65 + }, + "end": { + "line": 31, + "column": 74 + } + } + ], + "line": 31 + }, + "5": { + "loc": { + "start": { + "line": 32, + "column": 23 + }, + "end": { + "line": 32, + "column": 72 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 32, + "column": 43 + }, + "end": { + "line": 32, + "column": 60 + } + }, + { + "start": { + "line": 32, + "column": 63 + }, + "end": { + "line": 32, + "column": 72 + } + } + ], + "line": 32 + }, + "6": { + "loc": { + "start": { + "line": 44, + "column": 18 + }, + "end": { + "line": 44, + "column": 76 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 44, + "column": 38 + }, + "end": { + "line": 44, + "column": 56 + } + }, + { + "start": { + "line": 44, + "column": 59 + }, + "end": { + "line": 44, + "column": 76 + } + } + ], + "line": 44 + }, + "7": { + "loc": { + "start": { + "line": 45, + "column": 23 + }, + "end": { + "line": 45, + "column": 72 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 45, + "column": 43 + }, + "end": { + "line": 45, + "column": 60 + } + }, + { + "start": { + "line": 45, + "column": 63 + }, + "end": { + "line": 45, + "column": 72 + } + } + ], + "line": 45 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 5, + "column": 22 + } + }, + "loc": { + "start": { + "line": 5, + "column": 44 + }, + "end": { + "line": 55, + "column": 1 + } + }, + "line": 5 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 9, + "column": 18 + }, + "end": { + "line": 9, + "column": 19 + } + }, + "loc": { + "start": { + "line": 9, + "column": 48 + }, + "end": { + "line": 52, + "column": 7 + } + }, + "line": 9 + } + }, + "statementMap": { + "0": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 55, + "column": 1 + } + }, + "1": { + "start": { + "line": 6, + "column": 25 + }, + "end": { + "line": 6, + "column": 44 + } + }, + "2": { + "start": { + "line": 7, + "column": 2 + }, + "end": { + "line": 54, + "column": 4 + } + }, + "3": { + "start": { + "line": 10, + "column": 8 + }, + "end": { + "line": 51, + "column": 9 + } + }, + "4": { + "start": { + "line": 11, + "column": 10 + }, + "end": { + "line": 25, + "column": 12 + } + }, + "5": { + "start": { + "line": 26, + "column": 15 + }, + "end": { + "line": 51, + "column": 9 + } + }, + "6": { + "start": { + "line": 27, + "column": 10 + }, + "end": { + "line": 37, + "column": 12 + } + }, + "7": { + "start": { + "line": 39, + "column": 10 + }, + "end": { + "line": 50, + "column": 12 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/new.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/new.tsx.js new file mode 100644 index 00000000..1ca3e276 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/new.tsx.js @@ -0,0 +1,152 @@ +window["components/CanyonReport/line/new.tsx"] = { + "content": "import { getViewLineHeight } from \"../../../helpers/utils/getViewLineHeight.tsx\";\n\nconst LineNew = ({ news, count }) => {\n const viewLineHeight = getViewLineHeight();\n return (\n
\n {[...Array(count)].map((line, index) => {\n return (\n \n {/*{news.includes(index + 1) ? '+' : ''}*/}\n
\n );\n })}\n \n );\n};\n\nexport default LineNew;\n", + "coverage": { + "path": "components/CanyonReport/line/new.tsx", + "b": { + "0": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 12, + "column": 31 + }, + "end": { + "line": 14, + "column": 33 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 13, + "column": 34 + } + }, + { + "start": { + "line": 14, + "column": 18 + }, + "end": { + "line": 14, + "column": 33 + } + } + ], + "line": 12 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 3, + "column": 17 + } + }, + "loc": { + "start": { + "line": 3, + "column": 37 + }, + "end": { + "line": 24, + "column": 1 + } + }, + "line": 3 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 7, + "column": 29 + }, + "end": { + "line": 7, + "column": 30 + } + }, + "loc": { + "start": { + "line": 7, + "column": 46 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "line": 7 + } + }, + "statementMap": { + "0": { + "start": { + "line": 3, + "column": 16 + }, + "end": { + "line": 24, + "column": 1 + } + }, + "1": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 44 + } + }, + "2": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 23, + "column": 4 + } + }, + "3": { + "start": { + "line": 8, + "column": 8 + }, + "end": { + "line": 20, + "column": 10 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/number.tsx.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/number.tsx.js new file mode 100644 index 00000000..5ffb4801 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/line/number.tsx.js @@ -0,0 +1,323 @@ +window["components/CanyonReport/line/number.tsx"] = { + "content": "import { getViewLineHeight } from \"../../../helpers/utils/getViewLineHeight.tsx\";\n\nconst LineNumber = ({ count, theme }) => {\n const viewLineHeight = getViewLineHeight();\n const style: any = {\n color: theme === \"light\" ? \"#0074D9\" : \"#0074D9\",\n textAlign: \"right\",\n padding: \"0 5px 0 20px\",\n };\n setTimeout(() => {\n try {\n document\n .getElementById(`${window.location.hash.replace(\"#\", \"\")}`)\n .scrollIntoView();\n window.scrollBy(0, -160); // 向上滚动160px\n } catch (e) {\n // console.error(e);\n }\n }, 0);\n\n const activeLine = Number(window.location.hash.replace(\"#L\", \"\")) - 1;\n return (\n
\n {[...Array(count)].map((i, index) => {\n return (\n \n {index + 1}\n \n );\n })}\n
\n );\n};\n\nexport default LineNumber;\n", + "coverage": { + "path": "components/CanyonReport/line/number.tsx", + "b": { + "0": [ + 0, + 0 + ], + "1": [ + 0, + 0 + ], + "2": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 6, + "column": 11 + }, + "end": { + "line": 6, + "column": 52 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 6, + "column": 31 + }, + "end": { + "line": 6, + "column": 40 + } + }, + { + "start": { + "line": 6, + "column": 43 + }, + "end": { + "line": 6, + "column": 52 + } + } + ], + "line": 6 + }, + "1": { + "loc": { + "start": { + "line": 33, + "column": 21 + }, + "end": { + "line": 33, + "column": 59 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 33, + "column": 44 + }, + "end": { + "line": 33, + "column": 49 + } + }, + { + "start": { + "line": 33, + "column": 52 + }, + "end": { + "line": 33, + "column": 59 + } + } + ], + "line": 33 + }, + "2": { + "loc": { + "start": { + "line": 34, + "column": 30 + }, + "end": { + "line": 34, + "column": 74 + } + }, + "type": "cond-expr", + "locations": [ + { + "start": { + "line": 34, + "column": 53 + }, + "end": { + "line": 34, + "column": 64 + } + }, + { + "start": { + "line": 34, + "column": 67 + }, + "end": { + "line": 34, + "column": 74 + } + } + ], + "line": 34 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 3, + "column": 20 + } + }, + "loc": { + "start": { + "line": 3, + "column": 41 + }, + "end": { + "line": 44, + "column": 1 + } + }, + "line": 3 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 10, + "column": 13 + }, + "end": { + "line": 10, + "column": 14 + } + }, + "loc": { + "start": { + "line": 10, + "column": 19 + }, + "end": { + "line": 19, + "column": 3 + } + }, + "line": 10 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 24, + "column": 29 + }, + "end": { + "line": 24, + "column": 30 + } + }, + "loc": { + "start": { + "line": 24, + "column": 43 + }, + "end": { + "line": 41, + "column": 7 + } + }, + "line": 24 + } + }, + "statementMap": { + "0": { + "start": { + "line": 3, + "column": 19 + }, + "end": { + "line": 44, + "column": 1 + } + }, + "1": { + "start": { + "line": 4, + "column": 25 + }, + "end": { + "line": 4, + "column": 44 + } + }, + "2": { + "start": { + "line": 5, + "column": 21 + }, + "end": { + "line": 9, + "column": 3 + } + }, + "3": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 19, + "column": 8 + } + }, + "4": { + "start": { + "line": 11, + "column": 4 + }, + "end": { + "line": 18, + "column": 5 + } + }, + "5": { + "start": { + "line": 12, + "column": 6 + }, + "end": { + "line": 14, + "column": 26 + } + }, + "6": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 15, + "column": 31 + } + }, + "7": { + "start": { + "line": 21, + "column": 21 + }, + "end": { + "line": 21, + "column": 71 + } + }, + "8": { + "start": { + "line": 22, + "column": 2 + }, + "end": { + "line": 43, + "column": 4 + } + }, + "9": { + "start": { + "line": 25, + "column": 8 + }, + "end": { + "line": 40, + "column": 10 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/CanyonReport/loadShiki.ts.js b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/loadShiki.ts.js new file mode 100644 index 00000000..28d9b822 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/CanyonReport/loadShiki.ts.js @@ -0,0 +1,63 @@ +window["components/CanyonReport/loadShiki.ts"] = { + "content": "import { createHighlighterCore } from \"shiki/core\";\nimport getWasm from \"shiki/wasm\";\nimport lightplus from \"shiki/themes/light-plus.mjs\";\nimport css from \"shiki/langs/css.mjs\";\nimport jscss from \"shiki/langs/javascript.mjs\";\nimport { createOnigurumaEngine } from \"shiki/engine/oniguruma\";\n\nexport const createHighlighterCoreInstance = async () => {\n return await createHighlighterCore({\n themes: [\n // 传入导入的包,而不是字符串\n lightplus,\n ],\n langs: [css, jscss],\n // `shiki/wasm` contains the wasm binary inlined as base64 string.\n engine: createOnigurumaEngine(getWasm),\n });\n};\n", + "coverage": { + "path": "components/CanyonReport/loadShiki.ts", + "b": {}, + "f": { + "0": 0 + }, + "s": { + "0": 8, + "1": 0 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 8, + "column": 45 + }, + "end": { + "line": 8, + "column": 46 + } + }, + "loc": { + "start": { + "line": 8, + "column": 57 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "line": 8 + } + }, + "statementMap": { + "0": { + "start": { + "line": 8, + "column": 45 + }, + "end": { + "line": 18, + "column": 1 + } + }, + "1": { + "start": { + "line": 9, + "column": 2 + }, + "end": { + "line": 17, + "column": 5 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/LineChart.tsx.js b/packages/canyon-report/mock/dynamic-data/components/LineChart.tsx.js new file mode 100644 index 00000000..fc967cf9 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/LineChart.tsx.js @@ -0,0 +1,392 @@ +window["components/LineChart.tsx"] = { + "content": "import EChartsReact from \"echarts-for-react\";\nimport { CanyonCardPrimary } from \"@/components/old-ui\";\n\nconst coreData = [\n {\n month: 0,\n year: 2024,\n uiTestBranchCoverage: 50.59,\n uiTestLineCoverage: 56.08,\n uiTestChangedLineCoverage: 100,\n utBranchCoverage: 64.96,\n utLineCoverage: 62.56,\n },\n {\n month: 1,\n year: 2024,\n uiTestBranchCoverage: 51.45,\n uiTestLineCoverage: 59.19,\n uiTestChangedLineCoverage: 93.76,\n utBranchCoverage: 64.74,\n utLineCoverage: 64,\n },\n {\n month: 2,\n year: 2024,\n uiTestBranchCoverage: 50.05,\n uiTestLineCoverage: 63.23,\n uiTestChangedLineCoverage: 93.95,\n utBranchCoverage: 64.68,\n utLineCoverage: 64.38,\n },\n {\n month: 3,\n year: 2024,\n uiTestBranchCoverage: 55.15,\n uiTestLineCoverage: 66.47,\n uiTestChangedLineCoverage: 95.49,\n utBranchCoverage: 64.62,\n utLineCoverage: 65.61,\n },\n {\n month: 4,\n year: 2024,\n uiTestBranchCoverage: 57.84,\n uiTestLineCoverage: 71.61,\n uiTestChangedLineCoverage: 95.1,\n utBranchCoverage: 64.69,\n utLineCoverage: 66.15,\n },\n {\n month: 5,\n year: 2024,\n uiTestBranchCoverage: 62.84,\n uiTestLineCoverage: 77.23,\n uiTestChangedLineCoverage: 96.13,\n utBranchCoverage: 65.21,\n utLineCoverage: 68.91,\n },\n {\n month: 6,\n year: 2024,\n uiTestBranchCoverage: 63.22,\n uiTestLineCoverage: 77.66,\n uiTestChangedLineCoverage: 95.35,\n utBranchCoverage: 66.81,\n utLineCoverage: 69.34,\n },\n {\n month: 7,\n year: 2024,\n uiTestBranchCoverage: 63.43,\n uiTestLineCoverage: 77.92,\n uiTestChangedLineCoverage: 95.61,\n utBranchCoverage: 67.1,\n utLineCoverage: 69.83,\n },\n];\n\nconst data = {\n Month: coreData.map((item) => `${item.month + 1}月`),\n \"Branch Coverage (%)\": coreData.map((item) => item.uiTestBranchCoverage),\n \"Line Coverage (%)\": coreData.map((item) => item.uiTestLineCoverage),\n \"Changed Line Coverage (%)\": coreData.map(\n (item) => item.uiTestChangedLineCoverage,\n ),\n};\nconst d1 = coreData.map((item) => item.utBranchCoverage);\nconst d2 = coreData.map((item) => item.utLineCoverage);\nconst data1 = {\n Month: coreData.map((item) => `${item.month + 1}月`),\n \"Branch Coverage (%)\": d1,\n \"Line Coverage (%)\": d2,\n};\n\nconst option = {\n title: {\n text: \"UI自动化覆盖率\",\n },\n tooltip: {\n trigger: \"axis\",\n },\n legend: {\n data: [\n \"Branch Coverage (%)\",\n \"Line Coverage (%)\",\n \"Changed Line Coverage (%)\",\n ],\n right: 10,\n },\n grid: {\n left: \"3%\",\n right: \"4%\",\n bottom: \"3%\",\n containLabel: true,\n },\n // toolbox: {\n // feature: {\n // saveAsImage: {},\n // },\n // },\n xAxis: {\n type: \"category\",\n boundaryGap: true,\n data: data.Month,\n },\n yAxis: {\n type: \"value\",\n max: 100,\n },\n series: [\n {\n name: \"Branch Coverage (%)\",\n type: \"line\",\n data: data[\"Branch Coverage (%)\"],\n // 线上加文字\n label: {\n show: true,\n position: \"bottom\",\n },\n },\n {\n name: \"Line Coverage (%)\",\n type: \"line\",\n data: data[\"Line Coverage (%)\"],\n // 线上加文字\n label: {\n show: true,\n position: \"top\",\n },\n },\n {\n name: \"Changed Line Coverage (%)\",\n type: \"line\",\n data: data[\"Changed Line Coverage (%)\"],\n // 线上加文字\n label: {\n show: true,\n position: \"top\",\n },\n },\n ],\n};\n\nconst option1 = {\n title: {\n text: \"UT覆盖率\",\n },\n tooltip: {\n trigger: \"axis\",\n },\n legend: {\n data: [\n \"Branch Coverage (%)\",\n \"Line Coverage (%)\",\n \"Changed Line Coverage (%)\",\n ],\n right: 10,\n },\n grid: {\n left: \"3%\",\n right: \"4%\",\n bottom: \"3%\",\n containLabel: true,\n },\n // toolbox: {\n // feature: {\n // saveAsImage: {},\n // },\n // },\n xAxis: {\n type: \"category\",\n boundaryGap: true,\n data: data.Month,\n },\n yAxis: {\n type: \"value\",\n max: 100,\n },\n series: [\n {\n name: \"Branch Coverage (%)\",\n type: \"line\",\n data: data1[\"Branch Coverage (%)\"],\n label: {\n show: true,\n position: \"top\",\n color: \"blue\",\n },\n },\n {\n name: \"Line Coverage (%)\",\n type: \"line\",\n data: data1[\"Line Coverage (%)\"],\n label: {\n show: true,\n position: \"bottom\",\n color: \"green\",\n },\n },\n ],\n};\nconst LineChart = () => {\n return (\n \n
\n \n \n
\n
\n );\n};\n\nexport default LineChart;\n", + "coverage": { + "path": "components/LineChart.tsx", + "b": {}, + "f": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0 + }, + "s": { + "0": 0, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 0 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 80, + "column": 22 + }, + "end": { + "line": 80, + "column": 23 + } + }, + "loc": { + "start": { + "line": 80, + "column": 32 + }, + "end": { + "line": 80, + "column": 52 + } + }, + "line": 80 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 81, + "column": 38 + }, + "end": { + "line": 81, + "column": 39 + } + }, + "loc": { + "start": { + "line": 81, + "column": 48 + }, + "end": { + "line": 81, + "column": 73 + } + }, + "line": 81 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 82, + "column": 36 + }, + "end": { + "line": 82, + "column": 37 + } + }, + "loc": { + "start": { + "line": 82, + "column": 46 + }, + "end": { + "line": 82, + "column": 69 + } + }, + "line": 82 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 84, + "column": 4 + }, + "end": { + "line": 84, + "column": 5 + } + }, + "loc": { + "start": { + "line": 84, + "column": 14 + }, + "end": { + "line": 84, + "column": 44 + } + }, + "line": 84 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 87, + "column": 24 + }, + "end": { + "line": 87, + "column": 25 + } + }, + "loc": { + "start": { + "line": 87, + "column": 34 + }, + "end": { + "line": 87, + "column": 55 + } + }, + "line": 87 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 88, + "column": 24 + }, + "end": { + "line": 88, + "column": 25 + } + }, + "loc": { + "start": { + "line": 88, + "column": 34 + }, + "end": { + "line": 88, + "column": 53 + } + }, + "line": 88 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 90, + "column": 22 + }, + "end": { + "line": 90, + "column": 23 + } + }, + "loc": { + "start": { + "line": 90, + "column": 32 + }, + "end": { + "line": 90, + "column": 52 + } + }, + "line": 90 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 222, + "column": 18 + }, + "end": { + "line": 222, + "column": 19 + } + }, + "loc": { + "start": { + "line": 222, + "column": 24 + }, + "end": { + "line": 239, + "column": 1 + } + }, + "line": 222 + } + }, + "statementMap": { + "0": { + "start": { + "line": 4, + "column": 17 + }, + "end": { + "line": 77, + "column": 1 + } + }, + "1": { + "start": { + "line": 79, + "column": 13 + }, + "end": { + "line": 86, + "column": 1 + } + }, + "2": { + "start": { + "line": 80, + "column": 32 + }, + "end": { + "line": 80, + "column": 52 + } + }, + "3": { + "start": { + "line": 81, + "column": 48 + }, + "end": { + "line": 81, + "column": 73 + } + }, + "4": { + "start": { + "line": 82, + "column": 46 + }, + "end": { + "line": 82, + "column": 69 + } + }, + "5": { + "start": { + "line": 84, + "column": 14 + }, + "end": { + "line": 84, + "column": 44 + } + }, + "6": { + "start": { + "line": 87, + "column": 11 + }, + "end": { + "line": 87, + "column": 56 + } + }, + "7": { + "start": { + "line": 87, + "column": 34 + }, + "end": { + "line": 87, + "column": 55 + } + }, + "8": { + "start": { + "line": 88, + "column": 11 + }, + "end": { + "line": 88, + "column": 54 + } + }, + "9": { + "start": { + "line": 88, + "column": 34 + }, + "end": { + "line": 88, + "column": 53 + } + }, + "10": { + "start": { + "line": 89, + "column": 14 + }, + "end": { + "line": 93, + "column": 1 + } + }, + "11": { + "start": { + "line": 90, + "column": 32 + }, + "end": { + "line": 90, + "column": 52 + } + }, + "12": { + "start": { + "line": 95, + "column": 15 + }, + "end": { + "line": 162, + "column": 1 + } + }, + "13": { + "start": { + "line": 164, + "column": 16 + }, + "end": { + "line": 221, + "column": 1 + } + }, + "14": { + "start": { + "line": 222, + "column": 18 + }, + "end": { + "line": 239, + "column": 1 + } + }, + "15": { + "start": { + "line": 223, + "column": 2 + }, + "end": { + "line": 238, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/app/CopyCode.tsx.js b/packages/canyon-report/mock/dynamic-data/components/app/CopyCode.tsx.js new file mode 100644 index 00000000..64d5bb0f --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/app/CopyCode.tsx.js @@ -0,0 +1,226 @@ +window["components/app/CopyCode.tsx"] = { + "content": "import \"./CopyCode.css\";\n\nimport { CopyOutlined } from \"@ant-design/icons\";\nimport { FC, useEffect } from \"react\";\n// @ts-ignore\nimport { CopyToClipboard } from \"react-copy-to-clipboard\";\nimport { createHighlighterCoreInstance } from \"@/components/CanyonReport/loadShiki.ts\";\n\nconst CopyCode: FC<{ code: string }> = ({ code }) => {\n const fileContent = code;\n const [content, setContent] = useState(\"\");\n\n useEffect(() => {\n if (fileContent) {\n createHighlighterCoreInstance().then(({ codeToHtml }) => {\n const html = codeToHtml(fileContent, {\n lang: \"json\",\n theme: \"tokyo-night\",\n });\n setContent(html);\n });\n }\n }, [fileContent]);\n return (\n
\n
\n \n }\n />\n \n
\n\n
\n
\n
\n
\n );\n};\n\nexport default CopyCode;\n", + "coverage": { + "path": "components/app/CopyCode.tsx", + "b": { + "0": [ + 0, + 0 + ] + }, + "f": { + "0": 0, + "1": 0, + "2": 0 + }, + "s": { + "0": 8, + "1": 0, + "2": 0, + "3": 0, + "4": 0, + "5": 0, + "6": 0, + "7": 0, + "8": 0 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 22, + "column": 5 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 22, + "column": 5 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 14 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 9, + "column": 39 + }, + "end": { + "line": 9, + "column": 40 + } + }, + "loc": { + "start": { + "line": 9, + "column": 53 + }, + "end": { + "line": 41, + "column": 1 + } + }, + "line": 9 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 13, + "column": 12 + }, + "end": { + "line": 13, + "column": 13 + } + }, + "loc": { + "start": { + "line": 13, + "column": 18 + }, + "end": { + "line": 23, + "column": 3 + } + }, + "line": 13 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 15, + "column": 43 + }, + "end": { + "line": 15, + "column": 44 + } + }, + "loc": { + "start": { + "line": 15, + "column": 63 + }, + "end": { + "line": 21, + "column": 7 + } + }, + "line": 15 + } + }, + "statementMap": { + "0": { + "start": { + "line": 9, + "column": 39 + }, + "end": { + "line": 41, + "column": 1 + } + }, + "1": { + "start": { + "line": 10, + "column": 22 + }, + "end": { + "line": 10, + "column": 26 + } + }, + "2": { + "start": { + "line": 11, + "column": 32 + }, + "end": { + "line": 11, + "column": 44 + } + }, + "3": { + "start": { + "line": 13, + "column": 2 + }, + "end": { + "line": 23, + "column": 20 + } + }, + "4": { + "start": { + "line": 14, + "column": 4 + }, + "end": { + "line": 22, + "column": 5 + } + }, + "5": { + "start": { + "line": 15, + "column": 6 + }, + "end": { + "line": 21, + "column": 9 + } + }, + "6": { + "start": { + "line": 16, + "column": 21 + }, + "end": { + "line": 19, + "column": 10 + } + }, + "7": { + "start": { + "line": 20, + "column": 8 + }, + "end": { + "line": 20, + "column": 25 + } + }, + "8": { + "start": { + "line": 24, + "column": 2 + }, + "end": { + "line": 40, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/app/ProjectRecordDetailDrawer.tsx.js b/packages/canyon-report/mock/dynamic-data/components/app/ProjectRecordDetailDrawer.tsx.js new file mode 100644 index 00000000..71f75447 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/app/ProjectRecordDetailDrawer.tsx.js @@ -0,0 +1,624 @@ +window["components/app/ProjectRecordDetailDrawer.tsx"] = { + "content": "import { useQuery } from \"@apollo/client\";\nimport dayjs from \"dayjs\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link, useParams } from \"react-router-dom\";\n\nimport { GetProjectRecordDetailByShaDocument } from \"../../helpers/backend/gen/graphql.ts\";\nconst { Text } = Typography;\nimport { useRequest } from \"ahooks\";\nimport axios from \"axios\";\nconsole.log(useRequest, axios);\nconst ProjectRecordDetailDrawer = ({ open, onClose, sha }: any) => {\n const pam = useParams();\n const { data, loading } = useQuery(GetProjectRecordDetailByShaDocument, {\n variables: {\n projectID: pam.id as string,\n sha: sha,\n },\n });\n\n const { t } = useTranslation();\n // const pam = useParams();\n const columns = [\n {\n title: t(\"projects.report_id\"),\n dataIndex: \"reportID\",\n render(_: any): JSX.Element {\n // 标识位(勿动)\n return
{_}
;\n },\n },\n {\n title: t(\"projects.statements\"),\n dataIndex: \"statements\",\n render(_: any): JSX.Element {\n return {_}%;\n },\n },\n {\n title: t(\"projects.newlines\"),\n dataIndex: \"newlines\",\n render(_: any): JSX.Element {\n return {_}%;\n },\n },\n {\n title: t(\"projects.reporter\"),\n dataIndex: \"reporterUsername\",\n render(_: any, t: any): any {\n return (\n
\n \n {t.reporterUsername}\n
\n );\n },\n },\n {\n title: t(\"projects.report_time\"),\n dataIndex: \"lastReportTime\",\n render(_: any) {\n return dayjs(_).format(\"MM-DD HH:mm\");\n },\n },\n {\n title: t(\"common.option\"),\n render(_: any) {\n return (\n
\n \n {t(\"common.detail\")}\n \n
\n );\n },\n },\n ];\n\n return (\n <>\n \n \n \n \n );\n};\n\nexport default ProjectRecordDetailDrawer;\n", + "coverage": { + "path": "components/app/ProjectRecordDetailDrawer.tsx", + "b": { + "0": [ + 0, + 10 + ], + "1": [ + 0, + 0 + ], + "2": [ + 54, + 27 + ] + }, + "f": { + "0": 54, + "1": 10, + "2": 0, + "3": 0, + "4": 0, + "5": 10, + "6": 10, + "7": 10, + "8": 10, + "9": 10 + }, + "s": { + "0": 8, + "1": 8, + "2": 8, + "3": 54, + "4": 54, + "5": 54, + "6": 54, + "7": 10, + "8": 0, + "9": 0, + "10": 0, + "11": 0, + "12": 0, + "13": 0, + "14": 0, + "15": 10, + "16": 10, + "17": 10, + "18": 10, + "19": 10, + "20": 10, + "21": 54 + }, + "branchMap": { + "0": { + "loc": { + "start": { + "line": 27, + "column": 16 + }, + "end": { + "line": 70, + "column": 9 + } + }, + "type": "if", + "locations": [ + { + "start": { + "line": 27, + "column": 16 + }, + "end": { + "line": 70, + "column": 9 + } + }, + { + "start": {}, + "end": {} + } + ], + "line": 27 + }, + "1": { + "loc": { + "start": { + "line": 54, + "column": 7 + }, + "end": { + "line": 61, + "column": 13 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 54, + "column": 7 + }, + "end": { + "line": 54, + "column": 23 + } + }, + { + "start": { + "line": 55, + "column": 8 + }, + "end": { + "line": 61, + "column": 13 + } + } + ], + "line": 54 + }, + "2": { + "loc": { + "start": { + "line": 140, + "column": 22 + }, + "end": { + "line": 140, + "column": 61 + } + }, + "type": "binary-expr", + "locations": [ + { + "start": { + "line": 140, + "column": 22 + }, + "end": { + "line": 140, + "column": 55 + } + }, + { + "start": { + "line": 140, + "column": 59 + }, + "end": { + "line": 140, + "column": 61 + } + } + ], + "line": 140 + } + }, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 11, + "column": 34 + }, + "end": { + "line": 11, + "column": 35 + } + }, + "loc": { + "start": { + "line": 11, + "column": 67 + }, + "end": { + "line": 145, + "column": 1 + } + }, + "line": 11 + }, + "1": { + "name": "(anonymous_1)", + "decl": { + "start": { + "line": 26, + "column": 6 + }, + "end": { + "line": 26, + "column": 7 + } + }, + "loc": { + "start": { + "line": 26, + "column": 34 + }, + "end": { + "line": 72, + "column": 7 + } + }, + "line": 26 + }, + "2": { + "name": "(anonymous_2)", + "decl": { + "start": { + "line": 30, + "column": 26 + }, + "end": { + "line": 30, + "column": 27 + } + }, + "loc": { + "start": { + "line": 30, + "column": 44 + }, + "end": { + "line": 64, + "column": 1 + } + }, + "line": 30 + }, + "3": { + "name": "(anonymous_3)", + "decl": { + "start": { + "line": 32, + "column": 30 + }, + "end": { + "line": 32, + "column": 31 + } + }, + "loc": { + "start": { + "line": 33, + "column": 4 + }, + "end": { + "line": 39, + "column": 8 + } + }, + "line": 33 + }, + "4": { + "name": "(anonymous_4)", + "decl": { + "start": { + "line": 37, + "column": 12 + }, + "end": { + "line": 37, + "column": 13 + } + }, + "loc": { + "start": { + "line": 37, + "column": 19 + }, + "end": { + "line": 39, + "column": 7 + } + }, + "line": 37 + }, + "5": { + "name": "(anonymous_5)", + "decl": { + "start": { + "line": 77, + "column": 6 + }, + "end": { + "line": 77, + "column": 7 + } + }, + "loc": { + "start": { + "line": 77, + "column": 34 + }, + "end": { + "line": 79, + "column": 7 + } + }, + "line": 77 + }, + "6": { + "name": "(anonymous_6)", + "decl": { + "start": { + "line": 84, + "column": 6 + }, + "end": { + "line": 84, + "column": 7 + } + }, + "loc": { + "start": { + "line": 84, + "column": 34 + }, + "end": { + "line": 86, + "column": 7 + } + }, + "line": 84 + }, + "7": { + "name": "(anonymous_7)", + "decl": { + "start": { + "line": 91, + "column": 6 + }, + "end": { + "line": 91, + "column": 7 + } + }, + "loc": { + "start": { + "line": 91, + "column": 34 + }, + "end": { + "line": 98, + "column": 7 + } + }, + "line": 91 + }, + "8": { + "name": "(anonymous_8)", + "decl": { + "start": { + "line": 103, + "column": 6 + }, + "end": { + "line": 103, + "column": 7 + } + }, + "loc": { + "start": { + "line": 103, + "column": 21 + }, + "end": { + "line": 105, + "column": 7 + } + }, + "line": 103 + }, + "9": { + "name": "(anonymous_9)", + "decl": { + "start": { + "line": 109, + "column": 6 + }, + "end": { + "line": 109, + "column": 7 + } + }, + "loc": { + "start": { + "line": 109, + "column": 21 + }, + "end": { + "line": 122, + "column": 7 + } + }, + "line": 109 + } + }, + "statementMap": { + "0": { + "start": { + "line": 7, + "column": 17 + }, + "end": { + "line": 7, + "column": 27 + } + }, + "1": { + "start": { + "line": 10, + "column": 0 + }, + "end": { + "line": 10, + "column": 31 + } + }, + "2": { + "start": { + "line": 11, + "column": 34 + }, + "end": { + "line": 145, + "column": 1 + } + }, + "3": { + "start": { + "line": 12, + "column": 14 + }, + "end": { + "line": 12, + "column": 25 + } + }, + "4": { + "start": { + "line": 13, + "column": 28 + }, + "end": { + "line": 18, + "column": 4 + } + }, + "5": { + "start": { + "line": 20, + "column": 16 + }, + "end": { + "line": 20, + "column": 32 + } + }, + "6": { + "start": { + "line": 22, + "column": 18 + }, + "end": { + "line": 124, + "column": 3 + } + }, + "7": { + "start": { + "line": 27, + "column": 16 + }, + "end": { + "line": 70, + "column": 9 + } + }, + "8": { + "start": { + "line": 30, + "column": 26 + }, + "end": { + "line": 64, + "column": 1 + } + }, + "9": { + "start": { + "line": 31, + "column": 17 + }, + "end": { + "line": 31, + "column": 39 + } + }, + "10": { + "start": { + "line": 32, + "column": 19 + }, + "end": { + "line": 40, + "column": 3 + } + }, + "11": { + "start": { + "line": 33, + "column": 4 + }, + "end": { + "line": 39, + "column": 8 + } + }, + "12": { + "start": { + "line": 38, + "column": 8 + }, + "end": { + "line": 38, + "column": 41 + } + }, + "13": { + "start": { + "line": 41, + "column": 2 + }, + "end": { + "line": 63, + "column": 4 + } + }, + "14": { + "start": { + "line": 67, + "column": 10 + }, + "end": { + "line": 69, + "column": 12 + } + }, + "15": { + "start": { + "line": 71, + "column": 8 + }, + "end": { + "line": 71, + "column": 68 + } + }, + "16": { + "start": { + "line": 78, + "column": 8 + }, + "end": { + "line": 78, + "column": 33 + } + }, + "17": { + "start": { + "line": 85, + "column": 8 + }, + "end": { + "line": 85, + "column": 33 + } + }, + "18": { + "start": { + "line": 92, + "column": 8 + }, + "end": { + "line": 97, + "column": 10 + } + }, + "19": { + "start": { + "line": 104, + "column": 8 + }, + "end": { + "line": 104, + "column": 46 + } + }, + "20": { + "start": { + "line": 110, + "column": 8 + }, + "end": { + "line": 121, + "column": 10 + } + }, + "21": { + "start": { + "line": 126, + "column": 2 + }, + "end": { + "line": 144, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/app/getting-started-content.ts.js b/packages/canyon-report/mock/dynamic-data/components/app/getting-started-content.ts.js new file mode 100644 index 00000000..a5f43be7 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/app/getting-started-content.ts.js @@ -0,0 +1,25 @@ +window["components/app/getting-started-content.ts"] = { + "content": "export const gettingStartedContent = {\n babel: `npm i babel-plugin-istanbul babel-plugin-canyon -D `,\n webpack: `{\n \"plugins\": [\n \"istanbul\",\n \"canyon\"\n ]\n} `,\n};\n", + "coverage": { + "path": "components/app/getting-started-content.ts", + "b": {}, + "f": {}, + "s": { + "0": 8 + }, + "branchMap": {}, + "fnMap": {}, + "statementMap": { + "0": { + "start": { + "line": 1, + "column": 37 + }, + "end": { + "line": 9, + "column": 1 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/icons/MaterialSymbolsCommitSharp.tsx.js b/packages/canyon-report/mock/dynamic-data/components/icons/MaterialSymbolsCommitSharp.tsx.js new file mode 100644 index 00000000..b1ca0e22 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/icons/MaterialSymbolsCommitSharp.tsx.js @@ -0,0 +1,52 @@ +window["components/icons/MaterialSymbolsCommitSharp.tsx"] = { + "content": "import type { SVGProps } from \"react\";\n\nexport default function MaterialSymbolsCommitSharp(\n props: SVGProps,\n) {\n return (\n \n \n \n );\n}\n", + "coverage": { + "path": "components/icons/MaterialSymbolsCommitSharp.tsx", + "b": {}, + "f": { + "0": 40 + }, + "s": { + "0": 40 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "MaterialSymbolsCommitSharp", + "decl": { + "start": { + "line": 3, + "column": 24 + }, + "end": { + "line": 3, + "column": 50 + } + }, + "loc": { + "start": { + "line": 5, + "column": 2 + }, + "end": { + "line": 20, + "column": 1 + } + }, + "line": 5 + } + }, + "statementMap": { + "0": { + "start": { + "line": 6, + "column": 2 + }, + "end": { + "line": 19, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/Primary.tsx.js b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/Primary.tsx.js new file mode 100644 index 00000000..10535bf9 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/Primary.tsx.js @@ -0,0 +1,85 @@ +window["components/old-ui/components/card/Primary.tsx"] = { + "content": "import { FC } from \"react\";\n\nconst { useToken } = theme;\nconst CanyonCardPrimary: FC<{\n theme?: any;\n language?: any;\n children: any;\n}> = ({ theme, language, children }) => {\n const { token } = useToken();\n return (\n \n {children}\n
\n );\n};\n\nexport default CanyonCardPrimary;\n", + "coverage": { + "path": "components/old-ui/components/card/Primary.tsx", + "b": {}, + "f": { + "0": 89 + }, + "s": { + "0": 8, + "1": 8, + "2": 89, + "3": 89 + }, + "branchMap": {}, + "fnMap": { + "0": { + "name": "(anonymous_0)", + "decl": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 8, + "column": 6 + } + }, + "loc": { + "start": { + "line": 8, + "column": 40 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "line": 8 + } + }, + "statementMap": { + "0": { + "start": { + "line": 3, + "column": 21 + }, + "end": { + "line": 3, + "column": 26 + } + }, + "1": { + "start": { + "line": 8, + "column": 5 + }, + "end": { + "line": 21, + "column": 1 + } + }, + "2": { + "start": { + "line": 9, + "column": 20 + }, + "end": { + "line": 9, + "column": 30 + } + }, + "3": { + "start": { + "line": 10, + "column": 2 + }, + "end": { + "line": 20, + "column": 4 + } + } + } + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/index.ts.js b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/index.ts.js new file mode 100644 index 00000000..b3578d8b --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/card/index.ts.js @@ -0,0 +1,12 @@ +window["components/old-ui/components/card/index.ts"] = { + "content": "export { default as CanyonCardPrimary } from \"./Primary\";\n", + "coverage": { + "path": "components/old-ui/components/card/index.ts", + "b": {}, + "f": {}, + "s": {}, + "branchMap": {}, + "fnMap": {}, + "statementMap": {} + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/old-ui/components/index.ts.js b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/index.ts.js new file mode 100644 index 00000000..ab2c5519 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/index.ts.js @@ -0,0 +1,12 @@ +window["components/old-ui/components/index.ts"] = { + "content": "export * from \"./card\";\nexport * from \"./layout\";\nexport * from \"./modal\";\nexport * from \"./page\";\n", + "coverage": { + "path": "components/old-ui/components/index.ts", + "b": {}, + "f": {}, + "s": {}, + "branchMap": {}, + "fnMap": {}, + "statementMap": {} + } +} \ No newline at end of file diff --git a/packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/Base.tsx.js b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/Base.tsx.js new file mode 100644 index 00000000..d4b7fa61 --- /dev/null +++ b/packages/canyon-report/mock/dynamic-data/components/old-ui/components/layout/Base.tsx.js @@ -0,0 +1,438 @@ +window["components/old-ui/components/layout/Base.tsx"] = { + "content": "import { MoreOutlined, SearchOutlined } from \"@ant-design/icons\";\nimport { FC, ReactNode } from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\nimport { CanyonCardPrimary } from \"../card\";\nimport Footer from \"./footer.tsx\";\nimport ScrollBasedLayout from \"./ScrollBasedLayout.tsx\";\n\nconst { useToken } = theme;\nconst { Text, Title } = Typography;\ninterface CanyonLayoutBaseProps {\n title?: string;\n logo?: ReactNode;\n mainTitleRightNode?: ReactNode;\n menuSelectedKey?: string;\n onSelectMenu?: (selectInfo: { key: string }) => void;\n menuItems: MenuProps[\"items\"];\n renderMainContent?: ReactNode;\n onClickGlobalSearch?: () => void;\n MeData: any;\n itemsDropdown: any;\n search: any;\n account: any;\n breadcrumb: any;\n footerName?: string;\n}\nconst CanyonLayoutBase: FC = ({\n title = \"Canyon\",\n logo,\n mainTitleRightNode,\n menuSelectedKey = \"\",\n onSelectMenu,\n menuItems,\n renderMainContent,\n onClickGlobalSearch,\n MeData,\n itemsDropdown,\n search,\n account,\n breadcrumb,\n footerName = \"CANYON\",\n}) => {\n const { token } = useToken();\n\n return (\n
\n <>\n \n
\n
\n {\n window.location.href = \"/\";\n }}\n >\n {logo}\n \n {title}\n \n
\n\n
{mainTitleRightNode}
\n
\n
\n {search && (\n
\n \n {\n onClickGlobalSearch?.();\n }}\n >\n
\n \n Search\n\n
\n \n ⌘\n \n \n K\n \n
\n
\n \n
\n
\n )}\n\n {account && (\n
\n \n Account\n \n \n \n \n
\n )}\n\n \n\n {\n onSelectMenu?.(selectInfo);\n }}\n selectedKeys={[menuSelectedKey]}\n items={menuItems}\n className={\"dark:bg-[#151718] px-1\"}\n style={{ flex: \"1\" }}\n />\n\n {},\n }}\n >\n \n \n
\n \n {MeData?.me.nickname}\n \n \n {MeData?.me.email || \"\"}\n \n
\n \n \n \n \n }\n mainContent={\n \n
\n {breadcrumb}\n
\n
\n ⚠️Something went wrong

}>\n {renderMainContent}\n
\n
\n \n }\n footer={