mono-jsx 0.3.1 → 0.3.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/jsx-runtime.mjs CHANGED
@@ -644,10 +644,10 @@ function render(node, renderOptions = {}) {
644
644
  write("<script>(()=>{" + js + "})()<\/script>");
645
645
  }
646
646
  if (htmx) {
647
- write(`<script src="https://raw.esm.sh/htmx.org${htmx === true ? "" : "@" + htmx}/dist/htmx.min.js"><\/script>`);
648
- for (const [name, version] of Object.entries(renderOptions)) {
649
- if (name.startsWith("html-ext-")) {
650
- write(`<script src="https://raw.esm.sh/${name}${version === true ? "" : "@" + version}"><\/script>`);
647
+ write(`<script src="https://raw.esm.sh/htmx.org${htmx === true ? "" : escapeHTML("@" + htmx)}/dist/htmx.min.js"><\/script>`);
648
+ for (const [key, value] of Object.entries(renderOptions)) {
649
+ if (key.startsWith("htmx-ext-") && value) {
650
+ write(`<script src="https://raw.esm.sh/${key}${value === true ? "" : escapeHTML("@" + value)}"><\/script>`);
651
651
  }
652
652
  }
653
653
  }
@@ -676,7 +676,7 @@ var jsx = (tag, props = /* @__PURE__ */ Object.create(null), key) => {
676
676
  const renderOptions = /* @__PURE__ */ Object.create(null);
677
677
  const optionsKeys = /* @__PURE__ */ new Set(["appState", "context", "request", "status", "headers", "rendering", "htmx"]);
678
678
  for (const [key2, value] of Object.entries(props)) {
679
- if (optionsKeys.has(key2) || key2.startsWith("html-ext-")) {
679
+ if (optionsKeys.has(key2) || key2.startsWith("htmx-ext-")) {
680
680
  renderOptions[key2] = value;
681
681
  delete props[key2];
682
682
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mono-jsx",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "`<html>` as a `Response`.",
5
5
  "type": "module",
6
6
  "module": "./index.mjs",
package/types/render.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * @see https://htmx.org/docs/#extensions
4
4
  */
5
5
  type HtmxExts = {
6
- [key in `html-ext-${JSX.HtmxExtensions[keyof JSX.HtmxExtensions]}`]:
6
+ [key in `htmx-ext-${JSX.HtmxExtensions[keyof JSX.HtmxExtensions]}`]:
7
7
  | number
8
8
  | string
9
9
  | boolean;