@zeus-js/zeus 0.0.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/dist/zeus.cjs.js +77 -0
- package/dist/zeus.cjs.prod.js +77 -0
- package/dist/zeus.d.mts +1307 -0
- package/dist/zeus.d.ts +1307 -0
- package/dist/zeus.esm-browser.js +2190 -0
- package/dist/zeus.esm-browser.prod.js +1 -0
- package/dist/zeus.esm-bundler.js +51 -0
- package/dist/zeus.global.js +2216 -0
- package/dist/zeus.global.prod.js +1 -0
- package/index.js +7 -0
- package/jsx-dev-runtime.d.ts +1 -0
- package/jsx-dev-runtime.js +1 -0
- package/jsx-runtime.d.ts +1 -0
- package/jsx-runtime.js +1 -0
- package/package.json +73 -0
- package/src/jsx.d.ts +211 -0
package/dist/zeus.cjs.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zeus v0.0.2
|
|
3
|
+
* (c) 2026 baicie
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
**/
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
10
|
+
let _zeus_js_signal = require("@zeus-js/signal");
|
|
11
|
+
let _zeus_js_runtime_dom = require("@zeus-js/runtime-dom");
|
|
12
|
+
//#region packages/zeus/src/jsx-runtime.ts
|
|
13
|
+
const Fragment = Symbol.for("zeus.fragment");
|
|
14
|
+
function jsx(type, props) {
|
|
15
|
+
return createJSXNode(type, props);
|
|
16
|
+
}
|
|
17
|
+
function jsxs(type, props) {
|
|
18
|
+
return createJSXNode(type, props);
|
|
19
|
+
}
|
|
20
|
+
function jsxDEV(type, props) {
|
|
21
|
+
return createJSXNode(type, props);
|
|
22
|
+
}
|
|
23
|
+
function createJSXNode(type, props) {
|
|
24
|
+
if (typeof type === "function") return (0, _zeus_js_runtime_dom.createComponent)(type, props !== null && props !== void 0 ? props : {});
|
|
25
|
+
if (typeof type !== "string") return null;
|
|
26
|
+
const el = document.createElement(type);
|
|
27
|
+
if (props) {
|
|
28
|
+
const children = props.children;
|
|
29
|
+
for (const key of Object.keys(props)) {
|
|
30
|
+
if (key === "children") continue;
|
|
31
|
+
const value = props[key];
|
|
32
|
+
if (key.startsWith("on") && typeof value === "function") el.addEventListener(key.slice(2).toLowerCase(), value);
|
|
33
|
+
else if (key === "ref") setFallbackRef(value, el);
|
|
34
|
+
else if (value != null && value !== false) el.setAttribute(key === "className" ? "class" : key, String(value));
|
|
35
|
+
}
|
|
36
|
+
if (children !== void 0) (0, _zeus_js_runtime_dom.insert)(el, children);
|
|
37
|
+
}
|
|
38
|
+
return el;
|
|
39
|
+
}
|
|
40
|
+
function setFallbackRef(target, el) {
|
|
41
|
+
if (target == null) return;
|
|
42
|
+
if (typeof target === "function") {
|
|
43
|
+
target(el);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (typeof target === "object") {
|
|
47
|
+
if ("value" in target) {
|
|
48
|
+
target.value = el;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if ("current" in target) target.current = el;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.For = _zeus_js_runtime_dom.For;
|
|
56
|
+
exports.Fragment = Fragment;
|
|
57
|
+
exports.Host = _zeus_js_runtime_dom.Host;
|
|
58
|
+
exports.Show = _zeus_js_runtime_dom.Show;
|
|
59
|
+
exports.Slot = _zeus_js_runtime_dom.Slot;
|
|
60
|
+
exports.batch = _zeus_js_signal.batch;
|
|
61
|
+
exports.computed = _zeus_js_signal.computed;
|
|
62
|
+
exports.createContext = _zeus_js_runtime_dom.createContext;
|
|
63
|
+
exports.defineElement = _zeus_js_runtime_dom.defineElement;
|
|
64
|
+
exports.effect = _zeus_js_signal.effect;
|
|
65
|
+
exports.inject = _zeus_js_runtime_dom.inject;
|
|
66
|
+
exports.jsx = jsx;
|
|
67
|
+
exports.jsxDEV = jsxDEV;
|
|
68
|
+
exports.jsxs = jsxs;
|
|
69
|
+
exports.nextTick = _zeus_js_signal.nextTick;
|
|
70
|
+
exports.onCleanup = _zeus_js_signal.onCleanup;
|
|
71
|
+
exports.provide = _zeus_js_runtime_dom.provide;
|
|
72
|
+
exports.render = _zeus_js_runtime_dom.render;
|
|
73
|
+
exports.scope = _zeus_js_signal.scope;
|
|
74
|
+
exports.state = _zeus_js_signal.state;
|
|
75
|
+
exports.untrack = _zeus_js_signal.untrack;
|
|
76
|
+
exports.useContext = _zeus_js_runtime_dom.useContext;
|
|
77
|
+
exports.watch = _zeus_js_signal.watch;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zeus v0.0.2
|
|
3
|
+
* (c) 2026 baicie
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
**/
|
|
6
|
+
Object.defineProperties(exports, {
|
|
7
|
+
__esModule: { value: true },
|
|
8
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
9
|
+
});
|
|
10
|
+
let _zeus_js_signal = require("@zeus-js/signal");
|
|
11
|
+
let _zeus_js_runtime_dom = require("@zeus-js/runtime-dom");
|
|
12
|
+
//#region packages/zeus/src/jsx-runtime.ts
|
|
13
|
+
const Fragment = Symbol.for("zeus.fragment");
|
|
14
|
+
function jsx(type, props) {
|
|
15
|
+
return createJSXNode(type, props);
|
|
16
|
+
}
|
|
17
|
+
function jsxs(type, props) {
|
|
18
|
+
return createJSXNode(type, props);
|
|
19
|
+
}
|
|
20
|
+
function jsxDEV(type, props) {
|
|
21
|
+
return createJSXNode(type, props);
|
|
22
|
+
}
|
|
23
|
+
function createJSXNode(type, props) {
|
|
24
|
+
if (typeof type === "function") return (0, _zeus_js_runtime_dom.createComponent)(type, props !== null && props !== void 0 ? props : {});
|
|
25
|
+
if (typeof type !== "string") return null;
|
|
26
|
+
const el = document.createElement(type);
|
|
27
|
+
if (props) {
|
|
28
|
+
const children = props.children;
|
|
29
|
+
for (const key of Object.keys(props)) {
|
|
30
|
+
if (key === "children") continue;
|
|
31
|
+
const value = props[key];
|
|
32
|
+
if (key.startsWith("on") && typeof value === "function") el.addEventListener(key.slice(2).toLowerCase(), value);
|
|
33
|
+
else if (key === "ref") setFallbackRef(value, el);
|
|
34
|
+
else if (value != null && value !== false) el.setAttribute(key === "className" ? "class" : key, String(value));
|
|
35
|
+
}
|
|
36
|
+
if (children !== void 0) (0, _zeus_js_runtime_dom.insert)(el, children);
|
|
37
|
+
}
|
|
38
|
+
return el;
|
|
39
|
+
}
|
|
40
|
+
function setFallbackRef(target, el) {
|
|
41
|
+
if (target == null) return;
|
|
42
|
+
if (typeof target === "function") {
|
|
43
|
+
target(el);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (typeof target === "object") {
|
|
47
|
+
if ("value" in target) {
|
|
48
|
+
target.value = el;
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if ("current" in target) target.current = el;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
exports.For = _zeus_js_runtime_dom.For;
|
|
56
|
+
exports.Fragment = Fragment;
|
|
57
|
+
exports.Host = _zeus_js_runtime_dom.Host;
|
|
58
|
+
exports.Show = _zeus_js_runtime_dom.Show;
|
|
59
|
+
exports.Slot = _zeus_js_runtime_dom.Slot;
|
|
60
|
+
exports.batch = _zeus_js_signal.batch;
|
|
61
|
+
exports.computed = _zeus_js_signal.computed;
|
|
62
|
+
exports.createContext = _zeus_js_runtime_dom.createContext;
|
|
63
|
+
exports.defineElement = _zeus_js_runtime_dom.defineElement;
|
|
64
|
+
exports.effect = _zeus_js_signal.effect;
|
|
65
|
+
exports.inject = _zeus_js_runtime_dom.inject;
|
|
66
|
+
exports.jsx = jsx;
|
|
67
|
+
exports.jsxDEV = jsxDEV;
|
|
68
|
+
exports.jsxs = jsxs;
|
|
69
|
+
exports.nextTick = _zeus_js_signal.nextTick;
|
|
70
|
+
exports.onCleanup = _zeus_js_signal.onCleanup;
|
|
71
|
+
exports.provide = _zeus_js_runtime_dom.provide;
|
|
72
|
+
exports.render = _zeus_js_runtime_dom.render;
|
|
73
|
+
exports.scope = _zeus_js_signal.scope;
|
|
74
|
+
exports.state = _zeus_js_signal.state;
|
|
75
|
+
exports.untrack = _zeus_js_signal.untrack;
|
|
76
|
+
exports.useContext = _zeus_js_runtime_dom.useContext;
|
|
77
|
+
exports.watch = _zeus_js_signal.watch;
|