doe-sdk 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 +509 -0
- package/dist/cli/index.d.ts +17 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +118 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +25 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +100 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/login.d.ts +52 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +571 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/publish.d.ts +27 -0
- package/dist/cli/publish.d.ts.map +1 -0
- package/dist/cli/publish.js +531 -0
- package/dist/cli/publish.js.map +1 -0
- package/dist/cli/scaffold.d.ts +18 -0
- package/dist/cli/scaffold.d.ts.map +1 -0
- package/dist/cli/scaffold.js +252 -0
- package/dist/cli/scaffold.js.map +1 -0
- package/dist/cli/ui.d.ts +57 -0
- package/dist/cli/ui.d.ts.map +1 -0
- package/dist/cli/ui.js +339 -0
- package/dist/cli/ui.js.map +1 -0
- package/dist/cli/validate.d.ts +28 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +1270 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/compat/legacy-adapter.d.ts +198 -0
- package/dist/compat/legacy-adapter.d.ts.map +1 -0
- package/dist/compat/legacy-adapter.js +318 -0
- package/dist/compat/legacy-adapter.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/dist/runtime/client.d.ts +370 -0
- package/dist/runtime/client.d.ts.map +1 -0
- package/dist/runtime/client.js +470 -0
- package/dist/runtime/client.js.map +1 -0
- package/dist/runtime/index.d.ts +8 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/types/api.d.ts +564 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +11 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +10 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/manifest.d.ts +412 -0
- package/dist/types/manifest.d.ts.map +1 -0
- package/dist/types/manifest.js +42 -0
- package/dist/types/manifest.js.map +1 -0
- package/dist/types/marketplace-categories.d.ts +9 -0
- package/dist/types/marketplace-categories.d.ts.map +1 -0
- package/dist/types/marketplace-categories.js +16 -0
- package/dist/types/marketplace-categories.js.map +1 -0
- package/dist/types/permissions.d.ts +86 -0
- package/dist/types/permissions.d.ts.map +1 -0
- package/dist/types/permissions.js +295 -0
- package/dist/types/permissions.js.map +1 -0
- package/dist/types/theme/index.d.ts +7 -0
- package/dist/types/theme/index.d.ts.map +1 -0
- package/dist/types/theme/index.js +7 -0
- package/dist/types/theme/index.js.map +1 -0
- package/dist/types/theme/schema.d.ts +1205 -0
- package/dist/types/theme/schema.d.ts.map +1 -0
- package/dist/types/theme/schema.js +325 -0
- package/dist/types/theme/schema.js.map +1 -0
- package/dist/types/theme/types.d.ts +648 -0
- package/dist/types/theme/types.d.ts.map +1 -0
- package/dist/types/theme/types.js +8 -0
- package/dist/types/theme/types.js.map +1 -0
- package/package.json +75 -0
- package/templates/extension/README.md +254 -0
- package/templates/extension/icon.png +0 -0
- package/templates/extension/index.html +42 -0
- package/templates/extension/manifest.json +57 -0
- package/templates/extension/package.json +24 -0
- package/templates/extension/src/App.tsx +252 -0
- package/templates/extension/src/components/OnboardingComplete.tsx +190 -0
- package/templates/extension/src/components/OnboardingProgress.tsx +82 -0
- package/templates/extension/src/components/OnboardingWelcome.tsx +166 -0
- package/templates/extension/src/components/StepContainer.tsx +217 -0
- package/templates/extension/src/components/playground/CanvasTab.tsx +24 -0
- package/templates/extension/src/components/playground/ConfigTab.tsx +24 -0
- package/templates/extension/src/components/playground/EventsTab.tsx +24 -0
- package/templates/extension/src/components/playground/InfoTab.tsx +89 -0
- package/templates/extension/src/components/playground/NetworkTab.tsx +24 -0
- package/templates/extension/src/components/playground/PlaygroundContainer.tsx +184 -0
- package/templates/extension/src/components/playground/ResultDisplay.tsx +30 -0
- package/templates/extension/src/components/playground/StorageTab.tsx +24 -0
- package/templates/extension/src/components/playground/UITab.tsx +24 -0
- package/templates/extension/src/components/shared/CanvasControls.tsx +130 -0
- package/templates/extension/src/components/shared/ConfigControls.tsx +154 -0
- package/templates/extension/src/components/shared/EventsControls.tsx +232 -0
- package/templates/extension/src/components/shared/InfoControls.tsx +281 -0
- package/templates/extension/src/components/shared/NetworkControls.tsx +328 -0
- package/templates/extension/src/components/shared/StorageControls.tsx +203 -0
- package/templates/extension/src/components/shared/UIControls.tsx +199 -0
- package/templates/extension/src/components/shared/index.ts +15 -0
- package/templates/extension/src/components/steps/CanvasStep.tsx +67 -0
- package/templates/extension/src/components/steps/ClipboardStep.tsx +167 -0
- package/templates/extension/src/components/steps/ConfigStep.tsx +63 -0
- package/templates/extension/src/components/steps/EventsStep.tsx +69 -0
- package/templates/extension/src/components/steps/InfoStep.tsx +70 -0
- package/templates/extension/src/components/steps/NetworkStep.tsx +70 -0
- package/templates/extension/src/components/steps/StorageStep.tsx +61 -0
- package/templates/extension/src/components/steps/UIStep.tsx +70 -0
- package/templates/extension/src/hooks/useDoe.ts +93 -0
- package/templates/extension/src/hooks/useOnboarding.ts +264 -0
- package/templates/extension/src/hooks/usePointerHandlers.ts +105 -0
- package/templates/extension/src/main.tsx +18 -0
- package/templates/extension/src/styles.ts +265 -0
- package/templates/extension/tsconfig.json +28 -0
- package/templates/extension/vite.config.ts +32 -0
- package/templates/theme/README.md +132 -0
- package/templates/theme/manifest.json +19 -0
- package/templates/theme/package.json +16 -0
- package/templates/theme/styles/.gitkeep +2 -0
- package/templates/theme/themes/theme.json +32 -0
- package/templates/theme/vite-plugin-doe-theme.ts +53 -0
- package/templates/theme/vite.config.ts +10 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# {{displayName}}
|
|
2
|
+
|
|
3
|
+
A custom theme for DOE.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install from the DOE marketplace or load locally during development.
|
|
8
|
+
|
|
9
|
+
## Development
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# Install dependencies
|
|
13
|
+
pnpm install
|
|
14
|
+
|
|
15
|
+
# Start development server with hot reload
|
|
16
|
+
pnpm dev
|
|
17
|
+
|
|
18
|
+
# Validate theme
|
|
19
|
+
pnpm validate
|
|
20
|
+
|
|
21
|
+
# Build for production
|
|
22
|
+
pnpm build
|
|
23
|
+
|
|
24
|
+
# Publish to marketplace
|
|
25
|
+
pnpm publish
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Theme Customization
|
|
29
|
+
|
|
30
|
+
Edit `themes/theme.json` to customize the theme. The theme system supports:
|
|
31
|
+
|
|
32
|
+
### Colors (Required)
|
|
33
|
+
|
|
34
|
+
- `background` - Main app background
|
|
35
|
+
- `surface` - Panel and card backgrounds
|
|
36
|
+
- `text` - Primary text color
|
|
37
|
+
- `textMuted` - Secondary/muted text
|
|
38
|
+
- `accent` - Brand/accent color
|
|
39
|
+
- `border` - Borders and dividers
|
|
40
|
+
|
|
41
|
+
### Typography (Optional)
|
|
42
|
+
|
|
43
|
+
- `fontFamily` - Primary font stack
|
|
44
|
+
- `fontFamilyMono` - Monospace font stack
|
|
45
|
+
- `scale` - Font size scale (minor-second, major-second, minor-third, major-third, perfect-fourth)
|
|
46
|
+
|
|
47
|
+
### Effects (Optional)
|
|
48
|
+
|
|
49
|
+
- `shadows` - Shadow style (none, subtle, soft, medium, hard, neon)
|
|
50
|
+
- `glassEnabled` - Enable glassmorphism effects
|
|
51
|
+
|
|
52
|
+
### Shapes (Optional)
|
|
53
|
+
|
|
54
|
+
- `borderRadius` - Corner radius preset (none, xs, sm, md, lg, xl, full)
|
|
55
|
+
|
|
56
|
+
### Motion (Optional)
|
|
57
|
+
|
|
58
|
+
- `easing` - Animation easing (linear, ease, spring, bounce, snappy, smooth)
|
|
59
|
+
- `durationScale` - Animation duration multiplier (0.5-2)
|
|
60
|
+
|
|
61
|
+
## Adding Custom CSS
|
|
62
|
+
|
|
63
|
+
For advanced styling beyond color tokens, use custom CSS with semantic theme parts:
|
|
64
|
+
|
|
65
|
+
1. Create a CSS file in `styles/`:
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
/* styles/my-theme.css */
|
|
69
|
+
[data-theme-part="titlebar"] {
|
|
70
|
+
background: linear-gradient(#fff, #ccc);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
[data-theme-part="sidebar"] {
|
|
74
|
+
border-right: 2px solid var(--color-accent);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
2. Reference it in your `themes/theme.json`:
|
|
79
|
+
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"customCSS": "./styles/my-theme.css",
|
|
83
|
+
"colors": { ... }
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
3. The CSS file will be automatically copied to `dist/themes/` during build.
|
|
88
|
+
|
|
89
|
+
### Available Theme Parts
|
|
90
|
+
|
|
91
|
+
Use `data-theme-part` selectors for stable CSS targeting:
|
|
92
|
+
|
|
93
|
+
**Layout:**
|
|
94
|
+
- `sidebar`, `topbar`, `statusbar`, `panel`
|
|
95
|
+
|
|
96
|
+
**Window (ExtensionShape):**
|
|
97
|
+
- `window`, `titlebar`, `titlebar-title`, `titlebar-controls`
|
|
98
|
+
- `titlebar-minimize`, `titlebar-maximize`, `titlebar-close`
|
|
99
|
+
- `window-content`
|
|
100
|
+
|
|
101
|
+
**Controls:**
|
|
102
|
+
- `button`, `button-primary`, `button-icon`
|
|
103
|
+
- `input`, `select`, `checkbox`, `switch`, `tab`
|
|
104
|
+
|
|
105
|
+
**Feedback:**
|
|
106
|
+
- `modal`, `modal-backdrop`, `tooltip`, `menu`, `menu-item`, `popover`
|
|
107
|
+
|
|
108
|
+
**Canvas (tldraw wrapper):**
|
|
109
|
+
- `toolbar`, `toolbar-button`, `style-panel`
|
|
110
|
+
|
|
111
|
+
## Adding Custom Assets
|
|
112
|
+
|
|
113
|
+
Place custom fonts in an `assets/fonts/` directory and reference them in your theme:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"assets": {
|
|
118
|
+
"fonts": [
|
|
119
|
+
{
|
|
120
|
+
"family": "MyCustomFont",
|
|
121
|
+
"weight": "400",
|
|
122
|
+
"style": "normal",
|
|
123
|
+
"url": "./assets/fonts/MyCustomFont-Regular.woff2"
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "@{{slug}}/{{name}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"name": "{{displayName}}",
|
|
5
|
+
"description": "A custom theme for DOE",
|
|
6
|
+
"author": "{{author}}",
|
|
7
|
+
"permissions": [],
|
|
8
|
+
"categories": ["theme"],
|
|
9
|
+
"keywords": ["theme"],
|
|
10
|
+
"minDOEVersion": "1.0.0",
|
|
11
|
+
"contributes": {
|
|
12
|
+
"themes": [
|
|
13
|
+
{
|
|
14
|
+
"path": "./themes/theme.json",
|
|
15
|
+
"label": "{{displayName}}"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite build --watch",
|
|
8
|
+
"build": "vite build && doe-sdk validate",
|
|
9
|
+
"validate": "doe-sdk validate",
|
|
10
|
+
"publish": "doe-sdk publish"
|
|
11
|
+
},
|
|
12
|
+
"devDependencies": {
|
|
13
|
+
"doe-sdk": "{{sdkDependency}}",
|
|
14
|
+
"vite": "^6.2.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "{{name}}",
|
|
3
|
+
"name": "{{displayName}}",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"author": "{{author}}",
|
|
6
|
+
"type": "dark",
|
|
7
|
+
"tags": ["custom"],
|
|
8
|
+
"colors": {
|
|
9
|
+
"background": "#1a1a2e",
|
|
10
|
+
"surface": "#252541",
|
|
11
|
+
"text": "#eaeaea",
|
|
12
|
+
"textMuted": "#a0a0a0",
|
|
13
|
+
"accent": "#e94560",
|
|
14
|
+
"border": "#3d3d5c"
|
|
15
|
+
},
|
|
16
|
+
"typography": {
|
|
17
|
+
"fontFamily": "Inter, system-ui, sans-serif",
|
|
18
|
+
"fontFamilyMono": "JetBrains Mono, monospace",
|
|
19
|
+
"scale": "minor-third"
|
|
20
|
+
},
|
|
21
|
+
"effects": {
|
|
22
|
+
"shadows": "soft",
|
|
23
|
+
"glassEnabled": false
|
|
24
|
+
},
|
|
25
|
+
"shapes": {
|
|
26
|
+
"borderRadius": "md"
|
|
27
|
+
},
|
|
28
|
+
"motion": {
|
|
29
|
+
"easing": "smooth",
|
|
30
|
+
"durationScale": 1
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Plugin } from "vite";
|
|
2
|
+
import * as fs from "node:fs/promises";
|
|
3
|
+
import * as path from "node:path";
|
|
4
|
+
|
|
5
|
+
export function doeThemePlugin(): Plugin {
|
|
6
|
+
return {
|
|
7
|
+
name: "doe-theme",
|
|
8
|
+
async buildStart() {
|
|
9
|
+
// Copy manifest.json
|
|
10
|
+
const manifest = await fs.readFile("manifest.json", "utf-8");
|
|
11
|
+
this.emitFile({
|
|
12
|
+
type: "asset",
|
|
13
|
+
fileName: "manifest.json",
|
|
14
|
+
source: manifest,
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
async generateBundle() {
|
|
18
|
+
// Copy theme JSON files
|
|
19
|
+
const themesDir = path.resolve("themes");
|
|
20
|
+
const files = await fs.readdir(themesDir);
|
|
21
|
+
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
if (file.endsWith(".json")) {
|
|
24
|
+
const content = await fs.readFile(
|
|
25
|
+
path.join(themesDir, file),
|
|
26
|
+
"utf-8"
|
|
27
|
+
);
|
|
28
|
+
const theme = JSON.parse(content);
|
|
29
|
+
|
|
30
|
+
this.emitFile({
|
|
31
|
+
type: "asset",
|
|
32
|
+
fileName: `themes/${file}`,
|
|
33
|
+
source: content,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// Copy customCSS if referenced
|
|
37
|
+
if (theme.customCSS) {
|
|
38
|
+
const cssPath = path.resolve(
|
|
39
|
+
path.dirname(path.join(themesDir, file)),
|
|
40
|
+
theme.customCSS
|
|
41
|
+
);
|
|
42
|
+
const cssContent = await fs.readFile(cssPath, "utf-8");
|
|
43
|
+
this.emitFile({
|
|
44
|
+
type: "asset",
|
|
45
|
+
fileName: `themes/${theme.customCSS}`,
|
|
46
|
+
source: cssContent,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|