@plateerlab/xgen-gallery 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/dist/index.d.mts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +571 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +534 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# xgen-gallery
|
|
2
|
+
|
|
3
|
+
GitHub organization의 레포지토리를 보여주는 React 컴포넌트.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install xgen-gallery
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { XgenGallery } from 'xgen-gallery';
|
|
15
|
+
|
|
16
|
+
function App() {
|
|
17
|
+
return (
|
|
18
|
+
<XgenGallery
|
|
19
|
+
org="PlateerLab"
|
|
20
|
+
token="ghp_xxx" // optional, raises rate limit
|
|
21
|
+
theme="dark" // "dark" | "light"
|
|
22
|
+
/>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Props
|
|
28
|
+
|
|
29
|
+
| Prop | Type | Default | Description |
|
|
30
|
+
|------|------|---------|-------------|
|
|
31
|
+
| `org` | `string` | required | GitHub organization name |
|
|
32
|
+
| `token` | `string` | - | GitHub personal access token |
|
|
33
|
+
| `theme` | `"dark" \| "light"` | `"dark"` | Color theme |
|
|
34
|
+
| `limit` | `number` | - | Max repos to show |
|
|
35
|
+
| `onRepoClick` | `(repo: Repo) => void` | - | Custom click handler (overrides built-in detail view) |
|
|
36
|
+
|
|
37
|
+
## Features
|
|
38
|
+
|
|
39
|
+
- Repo list with search & language filter
|
|
40
|
+
- Repo detail with README rendering
|
|
41
|
+
- Demo tab: auto-extracts Python code blocks from README, `examples/`, or `demo.json`
|
|
42
|
+
- Dark/Light theme
|
|
43
|
+
- Zero config — just pass `org`
|
|
44
|
+
|
|
45
|
+
## Demo Data Convention
|
|
46
|
+
|
|
47
|
+
Repos can provide curated demos by adding `.xgen-gallery/demo.json`:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"snippets": [
|
|
52
|
+
{
|
|
53
|
+
"label": "Basic Usage",
|
|
54
|
+
"code": "from my_package import hello\nprint(hello())",
|
|
55
|
+
"expectedOutput": "Hello, World!"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Priority: `demo.json` > `examples/*.py` > README python blocks
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface Repo {
|
|
4
|
+
name: string;
|
|
5
|
+
full_name: string;
|
|
6
|
+
description: string | null;
|
|
7
|
+
html_url: string;
|
|
8
|
+
language: string | null;
|
|
9
|
+
stargazers_count: number;
|
|
10
|
+
forks_count: number;
|
|
11
|
+
topics: string[];
|
|
12
|
+
fork: boolean;
|
|
13
|
+
archived: boolean;
|
|
14
|
+
updated_at: string;
|
|
15
|
+
homepage: string | null;
|
|
16
|
+
}
|
|
17
|
+
interface GalleryProps {
|
|
18
|
+
/** GitHub organization name */
|
|
19
|
+
org: string;
|
|
20
|
+
/** GitHub personal access token (optional, raises rate limit) */
|
|
21
|
+
token?: string;
|
|
22
|
+
/** Theme: dark or light */
|
|
23
|
+
theme?: "dark" | "light";
|
|
24
|
+
/** Max repos to show */
|
|
25
|
+
limit?: number;
|
|
26
|
+
/** Callback when a repo card is clicked */
|
|
27
|
+
onRepoClick?: (repo: Repo) => void;
|
|
28
|
+
}
|
|
29
|
+
interface DemoSnippet {
|
|
30
|
+
label: string;
|
|
31
|
+
code: string;
|
|
32
|
+
expectedOutput?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare function XgenGallery({ org, token, theme: themeName, limit, onRepoClick }: GalleryProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
export { type DemoSnippet, type GalleryProps, type Repo, XgenGallery };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
interface Repo {
|
|
4
|
+
name: string;
|
|
5
|
+
full_name: string;
|
|
6
|
+
description: string | null;
|
|
7
|
+
html_url: string;
|
|
8
|
+
language: string | null;
|
|
9
|
+
stargazers_count: number;
|
|
10
|
+
forks_count: number;
|
|
11
|
+
topics: string[];
|
|
12
|
+
fork: boolean;
|
|
13
|
+
archived: boolean;
|
|
14
|
+
updated_at: string;
|
|
15
|
+
homepage: string | null;
|
|
16
|
+
}
|
|
17
|
+
interface GalleryProps {
|
|
18
|
+
/** GitHub organization name */
|
|
19
|
+
org: string;
|
|
20
|
+
/** GitHub personal access token (optional, raises rate limit) */
|
|
21
|
+
token?: string;
|
|
22
|
+
/** Theme: dark or light */
|
|
23
|
+
theme?: "dark" | "light";
|
|
24
|
+
/** Max repos to show */
|
|
25
|
+
limit?: number;
|
|
26
|
+
/** Callback when a repo card is clicked */
|
|
27
|
+
onRepoClick?: (repo: Repo) => void;
|
|
28
|
+
}
|
|
29
|
+
interface DemoSnippet {
|
|
30
|
+
label: string;
|
|
31
|
+
code: string;
|
|
32
|
+
expectedOutput?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare function XgenGallery({ org, token, theme: themeName, limit, onRepoClick }: GalleryProps): react_jsx_runtime.JSX.Element;
|
|
36
|
+
|
|
37
|
+
export { type DemoSnippet, type GalleryProps, type Repo, XgenGallery };
|