@taterboom/shiteki 0.1.0 → 0.1.2
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/README.md +102 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +375 -148
- package/dist/index.mjs +357 -130
- package/dist/standalone.global.js +9 -9
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Shiteki (指摘)
|
|
2
|
+
|
|
3
|
+
Lightweight visual annotation widget that turns user feedback into GitHub Issues.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @taterboom/shiteki
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or via CDN (no build step):
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<script src="https://unpkg.com/@taterboom/shiteki/dist/standalone.global.js"></script>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### React
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { ShitekiWidget } from "@taterboom/shiteki";
|
|
23
|
+
|
|
24
|
+
function App() {
|
|
25
|
+
return (
|
|
26
|
+
<ShitekiWidget
|
|
27
|
+
endpoint="https://your-api.workers.dev"
|
|
28
|
+
owner="your-github-username"
|
|
29
|
+
repo="your-repo"
|
|
30
|
+
labels={["feedback"]}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Standalone (CDN with auto-mount)
|
|
37
|
+
|
|
38
|
+
Add a `data-shiteki` attribute with a JSON config:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<script
|
|
42
|
+
src="https://unpkg.com/@taterboom/shiteki/dist/standalone.global.js"
|
|
43
|
+
data-shiteki='{"endpoint":"https://your-api.workers.dev","owner":"your-github-username","repo":"your-repo"}'
|
|
44
|
+
></script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can also mount with no config — the widget will load with annotation & copy features enabled, but send will be disabled until configured via settings:
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<script
|
|
51
|
+
src="https://unpkg.com/@taterboom/shiteki/dist/standalone.global.js"
|
|
52
|
+
data-shiteki
|
|
53
|
+
></script>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Imperative mount
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<script src="https://unpkg.com/@taterboom/shiteki/dist/standalone.global.js"></script>
|
|
60
|
+
<script>
|
|
61
|
+
Shiteki.mount({
|
|
62
|
+
endpoint: "https://your-api.workers.dev",
|
|
63
|
+
owner: "your-github-username",
|
|
64
|
+
repo: "your-repo",
|
|
65
|
+
});
|
|
66
|
+
</script>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
`Shiteki.mount()` can also be called with no arguments.
|
|
70
|
+
|
|
71
|
+
## Config
|
|
72
|
+
|
|
73
|
+
| Property | Type | Required | Description |
|
|
74
|
+
| ------------- | ---------- | -------- | -------------------------------- |
|
|
75
|
+
| `mode` | `string` | No | `"endpoint"` or `"direct"` |
|
|
76
|
+
| `endpoint` | `string` | Yes* | URL of the deployed API |
|
|
77
|
+
| `githubToken` | `string` | Yes* | GitHub PAT (direct mode only) |
|
|
78
|
+
| `owner` | `string` | Yes | GitHub repository owner |
|
|
79
|
+
| `repo` | `string` | Yes | GitHub repository name |
|
|
80
|
+
| `labels` | `string[]` | No | Labels to add to the issue |
|
|
81
|
+
|
|
82
|
+
\* `endpoint` is required for endpoint mode, `githubToken` for direct mode.
|
|
83
|
+
|
|
84
|
+
## Theming
|
|
85
|
+
|
|
86
|
+
Override CSS custom properties on `.shiteki-root`:
|
|
87
|
+
|
|
88
|
+
```css
|
|
89
|
+
.shiteki-root {
|
|
90
|
+
--shiteki-primary: #6366f1;
|
|
91
|
+
--shiteki-primary-hover: #4f46e5;
|
|
92
|
+
--shiteki-bg: #ffffff;
|
|
93
|
+
--shiteki-border: #e5e7eb;
|
|
94
|
+
--shiteki-text: #111827;
|
|
95
|
+
--shiteki-text-secondary: #6b7280;
|
|
96
|
+
--shiteki-radius: 8px;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
MIT
|
package/dist/index.d.mts
CHANGED