@faber1999/axon.js 0.3.0 → 0.4.1
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 +4 -1
- package/dist/{chunk-HYNBHCGU.js → chunk-RKZYBE62.js} +31 -2
- package/dist/index.js +1 -1
- package/dist/jsx.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./logo.svg" width="80" alt="axon.js logo" />
|
|
3
|
+
<h1>axon.js</h1>
|
|
4
|
+
</div>
|
|
2
5
|
|
|
3
6
|
A fine-grained reactive frontend framework built from scratch.
|
|
4
7
|
JSX syntax · Signals reactivity · Router · Store · No Virtual DOM · Zero dependencies.
|
|
@@ -93,6 +93,35 @@ function disposeOwner(owner) {
|
|
|
93
93
|
|
|
94
94
|
// src/dom/h.ts
|
|
95
95
|
var Fragment = /* @__PURE__ */ Symbol("Fragment");
|
|
96
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
97
|
+
var SVG_ELEMENTS = /* @__PURE__ */ new Set([
|
|
98
|
+
"svg",
|
|
99
|
+
"path",
|
|
100
|
+
"circle",
|
|
101
|
+
"rect",
|
|
102
|
+
"ellipse",
|
|
103
|
+
"line",
|
|
104
|
+
"polyline",
|
|
105
|
+
"polygon",
|
|
106
|
+
"g",
|
|
107
|
+
"defs",
|
|
108
|
+
"use",
|
|
109
|
+
"symbol",
|
|
110
|
+
"text",
|
|
111
|
+
"tspan",
|
|
112
|
+
"image",
|
|
113
|
+
"clipPath",
|
|
114
|
+
"mask",
|
|
115
|
+
"filter",
|
|
116
|
+
"linearGradient",
|
|
117
|
+
"radialGradient",
|
|
118
|
+
"stop",
|
|
119
|
+
"marker",
|
|
120
|
+
"pattern",
|
|
121
|
+
"foreignObject",
|
|
122
|
+
"animate",
|
|
123
|
+
"animateTransform"
|
|
124
|
+
]);
|
|
96
125
|
var BOOLEAN_ATTRS = /* @__PURE__ */ new Set([
|
|
97
126
|
"checked",
|
|
98
127
|
"disabled",
|
|
@@ -117,7 +146,7 @@ var BOOLEAN_ATTRS = /* @__PURE__ */ new Set([
|
|
|
117
146
|
]);
|
|
118
147
|
function applyProp(el, key, value) {
|
|
119
148
|
if (key === "class" || key === "className") {
|
|
120
|
-
el.
|
|
149
|
+
el.setAttribute("class", value ?? "");
|
|
121
150
|
} else if (key === "style") {
|
|
122
151
|
if (typeof value === "string") {
|
|
123
152
|
el.style.cssText = value;
|
|
@@ -196,7 +225,7 @@ function h(type, props, ...children) {
|
|
|
196
225
|
else if (children.length > 1) componentProps.children = children.flat();
|
|
197
226
|
return runWithOwner(type, componentProps);
|
|
198
227
|
}
|
|
199
|
-
const el = document.createElement(type);
|
|
228
|
+
const el = SVG_ELEMENTS.has(type) ? document.createElementNS(SVG_NS, type) : document.createElement(type);
|
|
200
229
|
if (props) {
|
|
201
230
|
for (const key of Object.keys(props)) {
|
|
202
231
|
const value = props[key];
|
package/dist/index.js
CHANGED
package/dist/jsx.js
CHANGED
package/package.json
CHANGED