@mpen/jsxhtml 0.2.2 → 0.3.0

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,38 @@
1
+ import type { JsFrag } from '../template-strings';
2
+ /**
3
+ * All valid properties for a <script> HTML element.
4
+ */
5
+ export type ScriptElementAttributes = {
6
+ /** Fetches script asynchronously if present. Only works with `src`. */
7
+ async?: boolean;
8
+ /** Specifies one or more URLs for Attribution Reporting. Can also be a boolean attribute. */
9
+ attributionsrc?: string | boolean;
10
+ /** Space-separated list of operations blocked until script is fetched, e.g., 'render'. */
11
+ blocking?: string;
12
+ /** Indicates the CORS setting for error reporting. */
13
+ crossorigin?: '' | 'anonymous' | 'use-credentials';
14
+ /** Defers script execution until after parsing. Only works with `src`. */
15
+ defer?: boolean;
16
+ /** Hint about the fetch priority: 'high', 'low', or 'auto' (default). */
17
+ fetchpriority?: 'high' | 'low' | 'auto';
18
+ /** Inline metadata for Subresource Integrity checking. Requires `src`. */
19
+ integrity?: string;
20
+ /** Indicates this script is not for module-supporting browsers (fallback). */
21
+ nomodule?: boolean;
22
+ /** A cryptographic nonce used for Content Security Policy validation. */
23
+ nonce?: string;
24
+ /** Referrer policy to apply when fetching the script. */
25
+ referrerpolicy?: '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
26
+ /** URL of the external script to load. */
27
+ src?: string;
28
+ /** Type of script: omitted or JS MIME type for classic scripts; 'module', 'importmap', etc. for others. */
29
+ type?: '' | 'module' | 'importmap' | 'speculationrules' | string;
30
+ /**
31
+ * JavaScript script content. Use the js`` tagged template literal.
32
+ *
33
+ * @example
34
+ * const world="World"
35
+ * const script = <script>{js`const hello=${world}`}</script>
36
+ */
37
+ children?: JsFrag;
38
+ };
@@ -0,0 +1,19 @@
1
+ import type { CssFrag } from '../template-strings';
2
+ /**
3
+ * Represents the attributes of a <style> HTML element.
4
+ */
5
+ export type StyleHTMLAttributes = {
6
+ /** Space-separated list of blocking operations, e.g., "render" */
7
+ blocking?: string;
8
+ /** Media query determining when the styles apply, defaults to "all" */
9
+ media?: string;
10
+ /** Cryptographic nonce for CSP compliance */
11
+ nonce?: string;
12
+ /** Title of the style sheet set */
13
+ title?: string;
14
+ /**
15
+ * @deprecated Only allowed value is "text/css" or empty string.
16
+ */
17
+ type?: '' | 'text/css';
18
+ children?: CssFrag;
19
+ };
package/dist/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-DpEMYmD9.js");
7
+ var jsxRuntime = require("./jsx-runtime-cimCxEOU.js");
8
8
 
9
9
  function RawHtml({children}) {
10
10
  return new jsxRuntime.JsxRawHtml(jsxRuntime.flattenString(children));
@@ -81,6 +81,8 @@ exports.JsxRawHtml = jsxRuntime.JsxRawHtml;
81
81
 
82
82
  exports.isJsxNode = jsxRuntime.isJsxNode;
83
83
 
84
+ exports.js = jsxRuntime.js;
85
+
84
86
  exports.C = C;
85
87
 
86
88
  exports.DocType = DocType;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './jsx-elements';
2
2
  export * from './custom-components';
3
3
  export * from './elysia-plugin';
4
4
  export * from './jsx-node';
5
+ export { js } from './template-strings';
5
6
  import type { AnyAttributes, JsxComponent, JsxRenderable } from './jsx-types';
6
7
  import { Fragment as _Fragment } from './jsx-runtime';
7
8
  declare namespace React {
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { J as JsxRawHtml, f as flattenString, E as EMPTY, a as JsxDocType, j as jsxs, b as jsx, F as Fragment, i as isJsxNode } from "./jsx-runtime-CsQM2fQb.js";
1
+ import { J as JsxRawHtml, f as flattenString, E as EMPTY, a as JsxDocType, j as jsxs, b as jsx, F as Fragment, i as isJsxNode } from "./jsx-runtime-Dh9PxNQe.js";
2
2
 
3
- export { d as JsxComment, c as JsxElement, e as JsxEmpty, g as JsxFragment, h as JsxNode } from "./jsx-runtime-CsQM2fQb.js";
3
+ export { e as JsxComment, d as JsxElement, g as JsxEmpty, h as JsxFragment, k as JsxNode, c as js } from "./jsx-runtime-Dh9PxNQe.js";
4
4
 
5
5
  function RawHtml({children}) {
6
6
  return new JsxRawHtml(flattenString(children));
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var jsxRuntime = require("./jsx-runtime-DpEMYmD9.js");
3
+ var jsxRuntime = require("./jsx-runtime-cimCxEOU.js");
4
4
 
5
5
  function jsxDEV(tag, props, key, isStaticChildren, source, self) {
6
6
  let node = jsxRuntime.jsx(...arguments);
@@ -14,6 +14,8 @@ function jsxDEV(tag, props, key, isStaticChildren, source, self) {
14
14
 
15
15
  exports.Fragment = jsxRuntime.Fragment;
16
16
 
17
+ exports.JSX = jsxRuntime.JSX;
18
+
17
19
  exports.jsx = jsxRuntime.jsx;
18
20
 
19
21
  exports.jsxDEV = jsxDEV;
@@ -1,6 +1,6 @@
1
- import { b as jsx, k as isJsxComponent, d as JsxComment, g as JsxFragment } from "./jsx-runtime-CsQM2fQb.js";
1
+ import { b as jsx, l as isJsxComponent, e as JsxComment, h as JsxFragment } from "./jsx-runtime-Dh9PxNQe.js";
2
2
 
3
- export { F as Fragment } from "./jsx-runtime-CsQM2fQb.js";
3
+ export { F as Fragment, m as JSX } from "./jsx-runtime-Dh9PxNQe.js";
4
4
 
5
5
  function jsxDEV(tag, props, key, isStaticChildren, source, self) {
6
6
  let node = jsx(...arguments);