@mpen/jsxhtml 0.1.7 → 0.1.10

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/index.cjs CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var jsxRuntime = require("./jsx-runtime-4PMznGfu.js");
7
+ var jsxRuntime = require("./jsx-runtime-NqHz6WEo.js");
8
8
 
9
9
  function RawHtml({children}) {
10
10
  return new jsxRuntime.JsxRawHtml(jsxRuntime.flattenString(children));
@@ -33,6 +33,19 @@ function Empty() {
33
33
  return jsxRuntime.EMPTY;
34
34
  }
35
35
 
36
+ function elysiaJsx() {
37
+ const {Elysia} = require("elysia");
38
+ return (new Elysia).onAfterHandle((({response}) => {
39
+ if (jsxRuntime.isJsxNode(response)) {
40
+ return new Response(String(response), {
41
+ headers: {
42
+ "content-type": "text/html; charset=utf8"
43
+ }
44
+ });
45
+ }
46
+ }));
47
+ }
48
+
36
49
  var React;
37
50
 
38
51
  (function(React) {
@@ -60,8 +73,6 @@ exports.JsxEmpty = jsxRuntime.JsxEmpty;
60
73
 
61
74
  exports.JsxFragment = jsxRuntime.JsxFragment;
62
75
 
63
- exports.JsxNode = jsxRuntime.JsxNode;
64
-
65
76
  exports.JsxRawHtml = jsxRuntime.JsxRawHtml;
66
77
 
67
78
  exports.isJsxNode = jsxRuntime.isJsxNode;
@@ -77,3 +88,5 @@ exports.HtmlDocument = HtmlDocument;
77
88
  exports.RawHtml = RawHtml;
78
89
 
79
90
  exports.default = React$1;
91
+
92
+ exports.elysiaJsx = elysiaJsx;
package/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export * from './jsx-elements';
2
2
  export * from './custom-components';
3
+ export * from './elysia-plugin';
3
4
  export { isJsxNode } from './jsx-node';
4
- export { JsxNode } from './jsx-node';
5
5
  import type { CommonProps, JsxComponent, JsxRenderable } from './types';
6
6
  import { Fragment as _Fragment } from './jsx-runtime';
7
7
  declare namespace React {
package/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { J as JsxRawHtml, f as flattenString, a as JsxComment, b as JsxDocType, j as jsxs, c as jsx, F as Fragment, E as EMPTY } from "./jsx-runtime-q-6Bf1zl.js";
1
+ import { J as JsxRawHtml, f as flattenString, a as JsxComment, b as JsxDocType, j as jsxs, c as jsx, F as Fragment, E as EMPTY, i as isJsxNode } from "./jsx-runtime-xIDZYHgS.js";
2
2
 
3
- export { e as JsxElement, g as JsxEmpty, h as JsxFragment, d as JsxNode, i as isJsxNode } from "./jsx-runtime-q-6Bf1zl.js";
3
+ export { d as JsxElement, e as JsxEmpty, g as JsxFragment } from "./jsx-runtime-xIDZYHgS.js";
4
4
 
5
5
  function RawHtml({children}) {
6
6
  return new JsxRawHtml(flattenString(children));
@@ -29,6 +29,19 @@ function Empty() {
29
29
  return EMPTY;
30
30
  }
31
31
 
32
+ function elysiaJsx() {
33
+ const {Elysia} = require("elysia");
34
+ return (new Elysia).onAfterHandle((({response}) => {
35
+ if (isJsxNode(response)) {
36
+ return new Response(String(response), {
37
+ headers: {
38
+ "content-type": "text/html; charset=utf8"
39
+ }
40
+ });
41
+ }
42
+ }));
43
+ }
44
+
32
45
  var React;
33
46
 
34
47
  (function(React) {
@@ -44,4 +57,4 @@ var React;
44
57
 
45
58
  var React$1 = React;
46
59
 
47
- export { Comment, DocType, EMPTY, Empty, HtmlDocument, JsxComment, JsxDocType, JsxRawHtml, RawHtml, React$1 as default };
60
+ export { Comment, DocType, EMPTY, Empty, HtmlDocument, JsxComment, JsxDocType, JsxRawHtml, RawHtml, React$1 as default, elysiaJsx, isJsxNode };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var jsxRuntime = require("./jsx-runtime-4PMznGfu.js");
3
+ var jsxRuntime = require("./jsx-runtime-NqHz6WEo.js");
4
4
 
5
5
  function jsxDEV(tag, props, key, isStaticChildren, source, self) {
6
6
  let node = jsxRuntime.jsx(...arguments);
@@ -1,6 +1,6 @@
1
- import { c as jsx, k as isJsxComponent, a as JsxComment, h as JsxFragment } from "./jsx-runtime-q-6Bf1zl.js";
1
+ import { c as jsx, h as isJsxComponent, a as JsxComment, g as JsxFragment } from "./jsx-runtime-xIDZYHgS.js";
2
2
 
3
- export { F as Fragment } from "./jsx-runtime-q-6Bf1zl.js";
3
+ export { F as Fragment } from "./jsx-runtime-xIDZYHgS.js";
4
4
 
5
5
  function jsxDEV(tag, props, key, isStaticChildren, source, self) {
6
6
  let node = jsx(...arguments);
@@ -1783,8 +1783,6 @@ exports.JsxEmpty = JsxEmpty;
1783
1783
 
1784
1784
  exports.JsxFragment = JsxFragment;
1785
1785
 
1786
- exports.JsxNode = JsxNode;
1787
-
1788
1786
  exports.JsxRawHtml = JsxRawHtml;
1789
1787
 
1790
1788
  exports.flattenString = flattenString;
@@ -1767,4 +1767,4 @@ function Fragment({children}) {
1767
1767
  return new JsxFragment(children);
1768
1768
  }
1769
1769
 
1770
- export { EMPTY as E, Fragment as F, JsxRawHtml as J, JsxComment as a, JsxDocType as b, jsx as c, JsxNode as d, JsxElement as e, flattenString as f, JsxEmpty as g, JsxFragment as h, isJsxNode as i, jsxs as j, isJsxComponent as k };
1770
+ export { EMPTY as E, Fragment as F, JsxRawHtml as J, JsxComment as a, JsxDocType as b, jsx as c, JsxElement as d, JsxEmpty as e, flattenString as f, JsxFragment as g, isJsxComponent as h, isJsxNode as i, jsxs as j };
package/jsx-runtime.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var jsxRuntime = require("./jsx-runtime-4PMznGfu.js");
3
+ var jsxRuntime = require("./jsx-runtime-NqHz6WEo.js");
4
4
 
5
5
  exports.Fragment = jsxRuntime.Fragment;
6
6
 
package/jsx-runtime.mjs CHANGED
@@ -1 +1 @@
1
- export { F as Fragment, c as jsx, j as jsxs } from "./jsx-runtime-q-6Bf1zl.js";
1
+ export { F as Fragment, c as jsx, j as jsxs } from "./jsx-runtime-xIDZYHgS.js";
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@mpen/jsxhtml",
3
- "version": "0.1.7",
3
+ "version": "0.1.10",
4
4
  "packageManager": "bun@1.0.7",
5
- "exports": "./bundle.cjs",
6
- "module": "./bundle.mjs",
7
- "types": "./bundle.d.ts",
5
+ "exports": "./index.cjs",
6
+ "module": "./index.mjs",
7
+ "types": "./index.d.ts",
8
8
  "type": "module",
9
9
  "keywords": [
10
10
  "jsx",