@axel669/zephyr 1.0.0-dev.0 → 1.0.0-dev.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/compiler/parser.js +3238 -2960
- package/compiler/transpiler.js +7 -2
- package/dist/zephyr-unstyled.js +82 -9
- package/dist/zephyr-unstyled.min.js +1 -1
- package/dist/zephyr.js +130 -24
- package/dist/zephyr.min.js +7 -7
- package/package.json +50 -50
- package/readme.md +26 -4
package/package.json
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@axel669/zephyr",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rollup -c lib/rollup.config.js",
|
|
8
|
-
"build.test": "rollup -c test/rollup.config.js"
|
|
9
|
-
},
|
|
10
|
-
"keywords": [],
|
|
11
|
-
"author": "",
|
|
12
|
-
"license": "ISC",
|
|
13
|
-
"packageManager": "pnpm@
|
|
14
|
-
"type": "module",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"fs-jetpack": "^5.1.0",
|
|
17
|
-
"prettier": "^3.9.4"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@axel669/rollup-html-input": "^0.1.2",
|
|
21
|
-
"@axel669/windstorm": "1.0.0-beta.
|
|
22
|
-
"@rollup/plugin-commonjs": "^29.0.3",
|
|
23
|
-
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
24
|
-
"@rollup/plugin-replace": "^6.0.3",
|
|
25
|
-
"@rollup/plugin-terser": "^1.0.0",
|
|
26
|
-
"peggy": "^5.1.0",
|
|
27
|
-
"preact": "10.29.3",
|
|
28
|
-
"preact-render-to-string": "6.7.0",
|
|
29
|
-
"preact-transitioning": "^1.5.3",
|
|
30
|
-
"rolldown": "1.1.5",
|
|
31
|
-
"rollup": "^4.62.2",
|
|
32
|
-
"valtio": "2.3.2"
|
|
33
|
-
},
|
|
34
|
-
"imports": {
|
|
35
|
-
"#core": "./lib/main.js",
|
|
36
|
-
"#styled": "./lib/styled.js",
|
|
37
|
-
"#state/*": "./test/state/*.js"
|
|
38
|
-
},
|
|
39
|
-
"exports": {
|
|
40
|
-
".": "./dist/zephyr.min.js",
|
|
41
|
-
"./dev": "./dist/zephyr.js",
|
|
42
|
-
"./unstyled": "./dist/zephyr-unstyled.min.js",
|
|
43
|
-
"./unstyled-dev": "./dist/zephyr-unstyled.js",
|
|
44
|
-
"./rollup": "./compiler/rollup.js"
|
|
45
|
-
},
|
|
46
|
-
"files": [
|
|
47
|
-
"compiler",
|
|
48
|
-
"dist/"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@axel669/zephyr",
|
|
3
|
+
"version": "1.0.0-dev.2",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rollup -c lib/rollup.config.js",
|
|
8
|
+
"build.test": "rollup -c test/rollup.config.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [],
|
|
11
|
+
"author": "",
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"packageManager": "pnpm@12.9.1",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"fs-jetpack": "^5.1.0",
|
|
17
|
+
"prettier": "^3.9.4"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@axel669/rollup-html-input": "^0.1.2",
|
|
21
|
+
"@axel669/windstorm": "1.0.0-beta.10",
|
|
22
|
+
"@rollup/plugin-commonjs": "^29.0.3",
|
|
23
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
24
|
+
"@rollup/plugin-replace": "^6.0.3",
|
|
25
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
26
|
+
"peggy": "^5.1.0",
|
|
27
|
+
"preact": "10.29.3",
|
|
28
|
+
"preact-render-to-string": "6.7.0",
|
|
29
|
+
"preact-transitioning": "^1.5.3",
|
|
30
|
+
"rolldown": "1.1.5",
|
|
31
|
+
"rollup": "^4.62.2",
|
|
32
|
+
"valtio": "2.3.2"
|
|
33
|
+
},
|
|
34
|
+
"imports": {
|
|
35
|
+
"#core": "./lib/main.js",
|
|
36
|
+
"#styled": "./lib/styled.js",
|
|
37
|
+
"#state/*": "./test/state/*.js"
|
|
38
|
+
},
|
|
39
|
+
"exports": {
|
|
40
|
+
".": "./dist/zephyr.min.js",
|
|
41
|
+
"./dev": "./dist/zephyr.js",
|
|
42
|
+
"./unstyled": "./dist/zephyr-unstyled.min.js",
|
|
43
|
+
"./unstyled-dev": "./dist/zephyr-unstyled.js",
|
|
44
|
+
"./rollup": "./compiler/rollup.js"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"compiler",
|
|
48
|
+
"dist/"
|
|
49
|
+
]
|
|
50
|
+
}
|
package/readme.md
CHANGED
|
@@ -86,9 +86,12 @@ is processed and sent to the update function, and handle things like numeric
|
|
|
86
86
|
inputs and date inputs. Custom behavior can also be registered for this step
|
|
87
87
|
using the `registerInputValue` function.
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
Two shorthands exist to help this process further:
|
|
90
|
+
- `#bind:` + the variable that holds the value can be used to have zephyr
|
|
91
|
+
automagically create the right object to send downward.
|
|
92
|
+
- `#group:` + the vaariable that holds the value can be used to bind the value
|
|
93
|
+
in the same way that svelte's `bind:group` works for radio and checkbox
|
|
94
|
+
inputs.
|
|
92
95
|
|
|
93
96
|
```jsx
|
|
94
97
|
import * as zephyr from "@axel669/zephyr"
|
|
@@ -113,7 +116,26 @@ const state = ze.proxy({
|
|
|
113
116
|
})
|
|
114
117
|
// this will be expanded to:
|
|
115
118
|
// value={state.text} oninput={(next) => state.text = next}
|
|
116
|
-
const thing2 = <input type="text" $$value={#state.text} />
|
|
119
|
+
const thing2 = <input type="text" $$value={#bind:state.text} />
|
|
120
|
+
|
|
121
|
+
const state = ze.proxy({
|
|
122
|
+
checks: [],
|
|
123
|
+
radio: "first"
|
|
124
|
+
})
|
|
125
|
+
// this will add/remove values from the array corresponding to the value
|
|
126
|
+
// of each checkbox
|
|
127
|
+
const checks = <#frag>
|
|
128
|
+
<input type="checkbox" value="first" $$checked={#group:state.checks} />
|
|
129
|
+
<input type="checkbox" value="second" $$checked={#group:state.checks} />
|
|
130
|
+
<input type="checkbox" value="third" $$checked={#group:state.checks} />
|
|
131
|
+
<//>
|
|
132
|
+
// this will set the state.radio value to the string values of the selected
|
|
133
|
+
// radio input instead of a true/false like normal
|
|
134
|
+
const radios = <#frag>
|
|
135
|
+
<input type="radio" value="first" $$checked={#group:state.radio} />
|
|
136
|
+
<input type="radio" value="second" $$checked={#group:state.radio} />
|
|
137
|
+
<input type="radio" value="third" $$checked={#group:state.radio} />
|
|
138
|
+
<//>
|
|
117
139
|
```
|
|
118
140
|
|
|
119
141
|
### $: Render
|