@rue-js/jsx-runtime 0.0.20

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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @rue-js/jsx-runtime v0.0.20
3
+ * (c) 2025-present Xiangmin Liu and Rue contributors
4
+ * @license MIT
5
+ **/
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var rueJs = require('rue-js');
11
+
12
+ function jsx(type, props, key) {
13
+ const p = key !== void 0 ? (() => {
14
+ const o = {};
15
+ if (props) {
16
+ for (const k in props) o[k] = props[k];
17
+ }
18
+ o.key = key;
19
+ return o;
20
+ })() : props ? props : null;
21
+ const c = props ? props.children : void 0;
22
+ return Array.isArray(c) ? rueJs.h(type, p, ...c) : c !== void 0 ? rueJs.h(type, p, c) : rueJs.h(type, p);
23
+ }
24
+ const jsxs = jsx;
25
+
26
+ exports.Fragment = rueJs.Fragment;
27
+ exports.jsx = jsx;
28
+ exports.jsxs = jsxs;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @rue-js/jsx-runtime v0.0.20
3
+ * (c) 2025-present Xiangmin Liu and Rue contributors
4
+ * @license MIT
5
+ **/
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ var rueJs = require('rue-js');
11
+
12
+ function jsx(type, props, key) {
13
+ const p = key !== void 0 ? (() => {
14
+ const o = {};
15
+ if (props) {
16
+ for (const k in props) o[k] = props[k];
17
+ }
18
+ o.key = key;
19
+ return o;
20
+ })() : props ? props : null;
21
+ const c = props ? props.children : void 0;
22
+ return Array.isArray(c) ? rueJs.h(type, p, ...c) : c !== void 0 ? rueJs.h(type, p, c) : rueJs.h(type, p);
23
+ }
24
+ const jsxs = jsx;
25
+
26
+ exports.Fragment = rueJs.Fragment;
27
+ exports.jsx = jsx;
28
+ exports.jsxs = jsxs;
@@ -0,0 +1,12 @@
1
+ export { Fragment } from 'rue-js';
2
+
3
+ /** 生成单子元素或无子元素的 VNode
4
+ * @param type 组件类型或标签名
5
+ * @param props 属性对象
6
+ * @param key 可选 key,将合并进 props
7
+ * @returns VNode
8
+ */
9
+ export declare function jsx(type: any, props: any, key?: any): any;
10
+ /** 生成多子元素的 VNode(与 jsx 等价,保持 API 对齐) */
11
+ export declare const jsxs: typeof jsx;
12
+
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @rue-js/jsx-runtime v0.0.20
3
+ * (c) 2025-present Xiangmin Liu and Rue contributors
4
+ * @license MIT
5
+ **/
6
+ import { h } from 'rue-js';
7
+ export { Fragment } from 'rue-js';
8
+
9
+ function jsx(type, props, key) {
10
+ const p = key !== void 0 ? (() => {
11
+ const o = {};
12
+ if (props) {
13
+ for (const k in props) o[k] = props[k];
14
+ }
15
+ o.key = key;
16
+ return o;
17
+ })() : props ? props : null;
18
+ const c = props ? props.children : void 0;
19
+ return Array.isArray(c) ? h(type, p, ...c) : c !== void 0 ? h(type, p, c) : h(type, p);
20
+ }
21
+ const jsxs = jsx;
22
+
23
+ export { jsx, jsxs };
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ 'use strict'
2
+
3
+ if (process.env.NODE_ENV === 'production') {
4
+ module.exports = require('./dist/jsx-runtime.cjs.prod.js')
5
+ } else {
6
+ module.exports = require('./dist/jsx-runtime.cjs.js')
7
+ }
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@rue-js/jsx-runtime",
3
+ "version": "0.0.20",
4
+ "description": "@rue-js/jsx-runtime",
5
+ "keywords": [
6
+ "rue"
7
+ ],
8
+ "homepage": "https://github.com/hunzhiwange/ruejs/tree/main/packages/runtime#readme",
9
+ "bugs": {
10
+ "url": "https://github.com/hunzhiwange/ruejs/issues"
11
+ },
12
+ "license": "MIT",
13
+ "author": "Xiangmin Liu",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/hunzhiwange/ruejs.git",
17
+ "directory": "packages/jsx-runtime"
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "dist"
22
+ ],
23
+ "sideEffects": false,
24
+ "main": "index.js",
25
+ "module": "dist/jsx-runtime.esm-bundler.js",
26
+ "types": "dist/jsx-runtime.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/jsx-runtime.d.ts",
30
+ "development": "./src/index.ts",
31
+ "node": {
32
+ "production": "./dist/jsx-runtime.cjs.prod.js",
33
+ "development": "./dist/jsx-runtime.cjs.js",
34
+ "default": "./index.js"
35
+ },
36
+ "module": "./dist/jsx-runtime.esm-bundler.js",
37
+ "import": "./dist/jsx-runtime.esm-bundler.js",
38
+ "require": "./index.js"
39
+ },
40
+ "./*": "./*"
41
+ },
42
+ "dependencies": {
43
+ "rue-js": "0.0.20"
44
+ },
45
+ "buildOptions": {
46
+ "name": "RueJsxDevRuntimeCore",
47
+ "formats": [
48
+ "esm-bundler",
49
+ "cjs"
50
+ ]
51
+ }
52
+ }