create-murasaki 0.3.0 → 0.4.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/package.json
CHANGED
|
@@ -95,3 +95,30 @@ code {
|
|
|
95
95
|
|
|
96
96
|
.counter button:hover { background: rgba(168, 85, 247, 0.15); }
|
|
97
97
|
.counter button:active { transform: scale(0.94); }
|
|
98
|
+
|
|
99
|
+
.actions {
|
|
100
|
+
margin-top: 24px;
|
|
101
|
+
display: flex;
|
|
102
|
+
gap: 12px;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.actions button {
|
|
108
|
+
padding: 10px 18px;
|
|
109
|
+
border-radius: 10px;
|
|
110
|
+
border: 1px solid rgba(168, 85, 247, 0.25);
|
|
111
|
+
background: rgba(168, 85, 247, 0.05);
|
|
112
|
+
color: #5B21B6;
|
|
113
|
+
font-size: 14px;
|
|
114
|
+
font-weight: 600;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
transition: background 0.12s, transform 0.06s;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (prefers-color-scheme: dark) {
|
|
120
|
+
.actions button { color: #d8b4fe; }
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.actions button:hover { background: rgba(168, 85, 247, 0.15); }
|
|
124
|
+
.actions button:active { transform: scale(0.97); }
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
// src/app/page.tsx — the "/" route.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
3
|
+
// Demonstrates client-side hooks (useState) and the native bridge
|
|
4
|
+
// (useNotification / useClipboard / useShell) from murasaki/jsx/dom.
|
|
5
5
|
|
|
6
6
|
import { Link } from 'murasaki'
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
useClipboard,
|
|
9
|
+
useNotification,
|
|
10
|
+
useShell,
|
|
11
|
+
useState,
|
|
12
|
+
} from 'murasaki/jsx/dom'
|
|
8
13
|
|
|
9
14
|
export default function HomePage() {
|
|
10
15
|
const [count, setCount] = useState(0)
|
|
16
|
+
const notify = useNotification()
|
|
17
|
+
const clipboard = useClipboard()
|
|
18
|
+
const shell = useShell()
|
|
19
|
+
|
|
11
20
|
return (
|
|
12
21
|
<main>
|
|
13
22
|
<h1>Hello, Murasaki 🦋</h1>
|
|
@@ -25,9 +34,19 @@ export default function HomePage() {
|
|
|
25
34
|
</button>
|
|
26
35
|
</div>
|
|
27
36
|
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
<div className="actions">
|
|
38
|
+
<button onClick={() => notify({ title: 'Hello', body: `Count: ${count}` })}>
|
|
39
|
+
🔔 Notify
|
|
40
|
+
</button>
|
|
41
|
+
<button onClick={() => clipboard.write(`Count: ${count}`)}>
|
|
42
|
+
📋 Copy to clipboard
|
|
43
|
+
</button>
|
|
44
|
+
<button onClick={() => shell.openExternal('https://github.com/murasakijs/murasaki')}>
|
|
45
|
+
🔗 Open repo
|
|
46
|
+
</button>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<p className="hint">Edit this file — the window reloads instantly.</p>
|
|
31
50
|
|
|
32
51
|
<nav className="links">
|
|
33
52
|
<Link href="/about">About →</Link>
|