@canyonjs/report-component 0.0.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +15 -0
- package/dist/index.js +44 -0
- package/package.json +55 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/types.d.ts
|
|
4
|
+
|
|
5
|
+
interface CanyonReportProps {
|
|
6
|
+
/** 报告名称 */
|
|
7
|
+
name: string;
|
|
8
|
+
/** 当前选中的文件 */
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/CanyonReport.d.ts
|
|
13
|
+
declare const CanyonReport: FC<CanyonReportProps>;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CanyonReport, CanyonReport as default, type CanyonReportProps };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { initCanyonReportCore } from "@canyonjs/report-core";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/widgets/CoverageDetail.tsx
|
|
6
|
+
function CanyonReport$1() {
|
|
7
|
+
const ref = useRef(null);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (ref.current) initCanyonReportCore(ref.current, {
|
|
10
|
+
value: "const a = 1",
|
|
11
|
+
language: "javascript",
|
|
12
|
+
theme: "vs-dark"
|
|
13
|
+
});
|
|
14
|
+
}, []);
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", { children: ["乌鸦坐飞机", /* @__PURE__ */ jsx("div", {
|
|
16
|
+
ref,
|
|
17
|
+
style: {
|
|
18
|
+
height: "300px",
|
|
19
|
+
border: "1px solid #000"
|
|
20
|
+
}
|
|
21
|
+
})] });
|
|
22
|
+
}
|
|
23
|
+
var CoverageDetail_default = CanyonReport$1;
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/helpers/add.ts
|
|
27
|
+
function add(a, b) {
|
|
28
|
+
return a + b;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/CanyonReport.tsx
|
|
33
|
+
const CanyonReport = ({ value, name }) => {
|
|
34
|
+
console.log(add(1, 2));
|
|
35
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
36
|
+
/* @__PURE__ */ jsx("h1", { children: name }),
|
|
37
|
+
/* @__PURE__ */ jsxs("p", { children: ["Selected file: ", value] }),
|
|
38
|
+
/* @__PURE__ */ jsx(CoverageDetail_default, {})
|
|
39
|
+
] });
|
|
40
|
+
};
|
|
41
|
+
var CanyonReport_default = CanyonReport;
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { CanyonReport, CanyonReport_default as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@canyonjs/report-component",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1-beta.1",
|
|
5
|
+
"description": "A starter for creating a React component library.",
|
|
6
|
+
"author": "Author Name <author.name@mail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://github.com/author/library#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/author/library.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/author/library/issues"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": "./dist/index.js",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"module": "./dist/index.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": "^19.2.0",
|
|
31
|
+
"react-dom": "^19.2.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@tsconfig/strictest": "^2.0.8",
|
|
35
|
+
"@types/node": "^24.10.1",
|
|
36
|
+
"@types/react": "^19.2.7",
|
|
37
|
+
"@types/react-dom": "^19.2.3",
|
|
38
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
39
|
+
"istanbul-lib-coverage": "^3.2.2",
|
|
40
|
+
"tsdown": "^0.17.0",
|
|
41
|
+
"typescript": "^5.9.3",
|
|
42
|
+
"vite": "^7.2.6"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"antd": "^6.1.0",
|
|
46
|
+
"@canyonjs/report-core": "^0.0.9-beta.2"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsdown",
|
|
50
|
+
"dev": "tsdown --watch",
|
|
51
|
+
"play": "vite",
|
|
52
|
+
"test": "vitest",
|
|
53
|
+
"typecheck": "tsc --noEmit"
|
|
54
|
+
}
|
|
55
|
+
}
|