@danielwh2/contribution-graph 1.0.14
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/LICENSE +21 -0
- package/README.md +327 -0
- package/dist/contributionGraph.d.ts +150 -0
- package/dist/contributionGraph.js +328 -0
- package/dist/github.d.ts +19 -0
- package/dist/github.js +109 -0
- package/dist/htmlGraph.d.ts +13 -0
- package/dist/htmlGraph.js +199 -0
- package/dist/hudGraph.d.ts +25 -0
- package/dist/hudGraph.js +194 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.js +109 -0
- package/dist/profileGraph.d.ts +7 -0
- package/dist/profileGraph.js +81 -0
- package/dist/react.d.ts +7 -0
- package/dist/react.js +22 -0
- package/dist/solid.d.ts +14 -0
- package/dist/solid.js +13 -0
- package/dist/svelte.d.ts +9 -0
- package/dist/svelte.js +12 -0
- package/dist/tooltip.d.ts +2 -0
- package/dist/tooltip.js +84 -0
- package/dist/vue.d.ts +25 -0
- package/dist/vue.js +33 -0
- package/package.json +101 -0
- package/style.css +610 -0
- package/style.css.d.ts +2 -0
package/dist/vue.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineComponent, h, onBeforeUnmount, onMounted, ref, watch, } from "vue";
|
|
2
|
+
import { contributionGraph, } from "./index.js";
|
|
3
|
+
export const ContributionGraph = defineComponent({
|
|
4
|
+
name: "ContributionGraph",
|
|
5
|
+
inheritAttrs: false,
|
|
6
|
+
props: {
|
|
7
|
+
data: {
|
|
8
|
+
type: Array,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
options: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: undefined,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
setup(props, { attrs }) {
|
|
17
|
+
const element = ref(null);
|
|
18
|
+
let controller = null;
|
|
19
|
+
onMounted(() => {
|
|
20
|
+
if (element.value) {
|
|
21
|
+
controller = contributionGraph(element.value, props.data, props.options);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
watch(() => [props.data, props.options], ([data, options]) => {
|
|
25
|
+
controller?.set(data, options);
|
|
26
|
+
}, { deep: true });
|
|
27
|
+
onBeforeUnmount(() => {
|
|
28
|
+
controller?.destroy();
|
|
29
|
+
controller = null;
|
|
30
|
+
});
|
|
31
|
+
return () => h("div", { ...attrs, ref: element });
|
|
32
|
+
},
|
|
33
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@danielwh2/contribution-graph",
|
|
3
|
+
"version": "1.0.14",
|
|
4
|
+
"description": "Framework-agnostic GitHub-style contribution heatmap for any app.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Daniel Belyi",
|
|
8
|
+
"sideEffects": [
|
|
9
|
+
"./style.css"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"style.css",
|
|
14
|
+
"style.css.d.ts",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./react": {
|
|
24
|
+
"types": "./dist/react.d.ts",
|
|
25
|
+
"import": "./dist/react.js"
|
|
26
|
+
},
|
|
27
|
+
"./vue": {
|
|
28
|
+
"types": "./dist/vue.d.ts",
|
|
29
|
+
"import": "./dist/vue.js"
|
|
30
|
+
},
|
|
31
|
+
"./solid": {
|
|
32
|
+
"types": "./dist/solid.d.ts",
|
|
33
|
+
"import": "./dist/solid.js"
|
|
34
|
+
},
|
|
35
|
+
"./svelte": {
|
|
36
|
+
"types": "./dist/svelte.d.ts",
|
|
37
|
+
"import": "./dist/svelte.js"
|
|
38
|
+
},
|
|
39
|
+
"./github": {
|
|
40
|
+
"types": "./dist/github.d.ts",
|
|
41
|
+
"import": "./dist/github.js"
|
|
42
|
+
},
|
|
43
|
+
"./style.css": {
|
|
44
|
+
"types": "./style.css.d.ts",
|
|
45
|
+
"default": "./style.css"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"types": "./dist/index.d.ts",
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"dayjs": "^1.11.21",
|
|
51
|
+
"slot-text": "^0.3.1"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": ">=18 <20",
|
|
55
|
+
"solid-js": ">=1.8 <2",
|
|
56
|
+
"svelte": ">=4 <6",
|
|
57
|
+
"vue": ">=3.4 <4"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"react": {
|
|
61
|
+
"optional": true
|
|
62
|
+
},
|
|
63
|
+
"vue": {
|
|
64
|
+
"optional": true
|
|
65
|
+
},
|
|
66
|
+
"solid-js": {
|
|
67
|
+
"optional": true
|
|
68
|
+
},
|
|
69
|
+
"svelte": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"prepublishOnly": "npm run build",
|
|
75
|
+
"build": "tsc -p tsconfig.json",
|
|
76
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
77
|
+
"pack:check": "npm pack --dry-run",
|
|
78
|
+
"test": "vitest run"
|
|
79
|
+
},
|
|
80
|
+
"devDependencies": {
|
|
81
|
+
"@types/react": "^19.2.17",
|
|
82
|
+
"happy-dom": "^20.10.2",
|
|
83
|
+
"react": "^19.2.7",
|
|
84
|
+
"solid-js": "^1.9.13",
|
|
85
|
+
"svelte": "^5.56.3",
|
|
86
|
+
"typescript": "^5.8.3",
|
|
87
|
+
"vitest": "^4.1.8",
|
|
88
|
+
"vue": "^3.5.35"
|
|
89
|
+
},
|
|
90
|
+
"keywords": [
|
|
91
|
+
"contribution-graph",
|
|
92
|
+
"heatmap",
|
|
93
|
+
"github",
|
|
94
|
+
"calendar",
|
|
95
|
+
"activity",
|
|
96
|
+
"react",
|
|
97
|
+
"vue",
|
|
98
|
+
"solid",
|
|
99
|
+
"svelte"
|
|
100
|
+
]
|
|
101
|
+
}
|