@mpen/jsxhtml 0.3.0 → 0.4.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.
Files changed (167) hide show
  1. package/dist/classnames.d.ts +11 -0
  2. package/dist/custom/C.d.ts +6 -0
  3. package/dist/custom/Checkbox.d.ts +5 -0
  4. package/dist/custom/ColorInput.d.ts +5 -0
  5. package/dist/custom/DateInput.d.ts +5 -0
  6. package/dist/custom/DocType.d.ts +6 -0
  7. package/dist/custom/EmailInput.d.ts +5 -0
  8. package/dist/custom/Empty.d.ts +4 -0
  9. package/dist/custom/FileInput.d.ts +5 -0
  10. package/dist/custom/HtmlDocument.d.ts +5 -0
  11. package/dist/custom/NumberInput.d.ts +5 -0
  12. package/dist/custom/PasswordInput.d.ts +5 -0
  13. package/dist/custom/RadioButton.d.ts +5 -0
  14. package/dist/custom/RangeInput.d.ts +5 -0
  15. package/dist/custom/RawHtml.d.ts +6 -0
  16. package/dist/custom/SearchInput.d.ts +5 -0
  17. package/dist/custom/TelephoneInput.d.ts +5 -0
  18. package/dist/custom/TextInput.d.ts +5 -0
  19. package/dist/custom/TimeInput.d.ts +5 -0
  20. package/dist/custom/UrlInput.d.ts +5 -0
  21. package/dist/custom/WeekInput.d.ts +5 -0
  22. package/dist/custom/index.d.ts +20 -0
  23. package/dist/custom-components.d.ts +1 -23
  24. package/dist/htmlspec/IntrinsicElements.d.ts +240 -398
  25. package/dist/htmlspec/attributes/AriaAttributes.d.ts +11 -0
  26. package/dist/htmlspec/attributes/ElementAttributes.d.ts +28 -0
  27. package/dist/htmlspec/attributes/EventHandlers.d.ts +102 -0
  28. package/dist/htmlspec/attributes/GlobalAttributes.d.ts +11 -0
  29. package/dist/htmlspec/{GlobalAttributes.d.ts → attributes/StandardGlobalAttributes.d.ts} +26 -107
  30. package/dist/htmlspec/attributes/index.d.ts +7 -0
  31. package/dist/htmlspec/elements/a.d.ts +71 -0
  32. package/dist/htmlspec/elements/abbr.d.ts +4 -0
  33. package/dist/htmlspec/elements/address.d.ts +4 -0
  34. package/dist/htmlspec/elements/area.d.ts +66 -0
  35. package/dist/htmlspec/elements/article.d.ts +4 -0
  36. package/dist/htmlspec/elements/aside.d.ts +4 -0
  37. package/dist/htmlspec/elements/audio.d.ts +45 -0
  38. package/dist/htmlspec/elements/b.d.ts +4 -0
  39. package/dist/htmlspec/elements/base.d.ts +18 -0
  40. package/dist/htmlspec/elements/bdi.d.ts +4 -0
  41. package/dist/htmlspec/elements/bdo.d.ts +4 -0
  42. package/dist/htmlspec/elements/blockquote.d.ts +8 -0
  43. package/dist/htmlspec/elements/body.d.ts +92 -0
  44. package/dist/htmlspec/elements/br.d.ts +4 -0
  45. package/dist/htmlspec/elements/button.d.ts +103 -0
  46. package/dist/htmlspec/elements/canvas.d.ts +13 -0
  47. package/dist/htmlspec/elements/caption.d.ts +4 -0
  48. package/dist/htmlspec/elements/cite.d.ts +4 -0
  49. package/dist/htmlspec/elements/code.d.ts +4 -0
  50. package/dist/htmlspec/elements/col.d.ts +9 -0
  51. package/dist/htmlspec/elements/colgroup.d.ts +9 -0
  52. package/dist/htmlspec/elements/data.d.ts +9 -0
  53. package/dist/htmlspec/elements/datalist.d.ts +4 -0
  54. package/dist/htmlspec/elements/dd.d.ts +4 -0
  55. package/dist/htmlspec/elements/del.d.ts +12 -0
  56. package/dist/htmlspec/elements/details.d.ts +12 -0
  57. package/dist/htmlspec/elements/dfn.d.ts +4 -0
  58. package/dist/htmlspec/elements/dialog.d.ts +17 -0
  59. package/dist/htmlspec/elements/div.d.ts +4 -0
  60. package/dist/htmlspec/elements/dl.d.ts +4 -0
  61. package/dist/htmlspec/elements/dt.d.ts +4 -0
  62. package/dist/htmlspec/elements/element-types.d.ts +1 -0
  63. package/dist/htmlspec/elements/em.d.ts +4 -0
  64. package/dist/htmlspec/elements/embed.d.ts +21 -0
  65. package/dist/htmlspec/elements/fencedframe.d.ts +23 -0
  66. package/dist/htmlspec/elements/fieldset.d.ts +16 -0
  67. package/dist/htmlspec/elements/figcaption.d.ts +4 -0
  68. package/dist/htmlspec/elements/figure.d.ts +4 -0
  69. package/dist/htmlspec/elements/footer.d.ts +4 -0
  70. package/dist/htmlspec/elements/form.d.ts +61 -0
  71. package/dist/htmlspec/elements/h1.d.ts +4 -0
  72. package/dist/htmlspec/elements/h2.d.ts +4 -0
  73. package/dist/htmlspec/elements/h3.d.ts +4 -0
  74. package/dist/htmlspec/elements/h4.d.ts +4 -0
  75. package/dist/htmlspec/elements/h5.d.ts +4 -0
  76. package/dist/htmlspec/elements/h6.d.ts +4 -0
  77. package/dist/htmlspec/elements/head.d.ts +4 -0
  78. package/dist/htmlspec/elements/header.d.ts +4 -0
  79. package/dist/htmlspec/elements/hgroup.d.ts +4 -0
  80. package/dist/htmlspec/elements/hr.d.ts +4 -0
  81. package/dist/htmlspec/elements/html.d.ts +8 -0
  82. package/dist/htmlspec/elements/i.d.ts +4 -0
  83. package/dist/htmlspec/elements/iframe.d.ts +82 -0
  84. package/dist/htmlspec/elements/img.d.ts +90 -0
  85. package/dist/htmlspec/elements/index.d.ts +114 -0
  86. package/dist/htmlspec/elements/input.d.ts +189 -0
  87. package/dist/htmlspec/elements/ins.d.ts +12 -0
  88. package/dist/htmlspec/elements/kbd.d.ts +4 -0
  89. package/dist/htmlspec/elements/label.d.ts +8 -0
  90. package/dist/htmlspec/elements/legend.d.ts +4 -0
  91. package/dist/htmlspec/elements/li.d.ts +19 -0
  92. package/dist/htmlspec/elements/link.d.ts +77 -0
  93. package/dist/htmlspec/elements/main.d.ts +4 -0
  94. package/dist/htmlspec/elements/map.d.ts +8 -0
  95. package/dist/htmlspec/elements/mark.d.ts +4 -0
  96. package/dist/htmlspec/elements/menu.d.ts +4 -0
  97. package/dist/htmlspec/elements/meta.d.ts +24 -0
  98. package/dist/htmlspec/elements/meter.d.ts +29 -0
  99. package/dist/htmlspec/elements/nav.d.ts +4 -0
  100. package/dist/htmlspec/elements/noscript.d.ts +4 -0
  101. package/dist/htmlspec/elements/object.d.ts +29 -0
  102. package/dist/htmlspec/elements/ol.d.ts +24 -0
  103. package/dist/htmlspec/elements/optgroup.d.ts +12 -0
  104. package/dist/htmlspec/elements/option.d.ts +21 -0
  105. package/dist/htmlspec/elements/output.d.ts +16 -0
  106. package/dist/htmlspec/elements/p.d.ts +4 -0
  107. package/dist/htmlspec/elements/picture.d.ts +4 -0
  108. package/dist/htmlspec/elements/pre.d.ts +4 -0
  109. package/dist/htmlspec/elements/progress.d.ts +13 -0
  110. package/dist/htmlspec/elements/q.d.ts +8 -0
  111. package/dist/htmlspec/elements/rp.d.ts +4 -0
  112. package/dist/htmlspec/elements/rt.d.ts +4 -0
  113. package/dist/htmlspec/elements/ruby.d.ts +4 -0
  114. package/dist/htmlspec/elements/s.d.ts +4 -0
  115. package/dist/htmlspec/elements/samp.d.ts +4 -0
  116. package/dist/htmlspec/elements/script.d.ts +57 -0
  117. package/dist/htmlspec/elements/search.d.ts +4 -0
  118. package/dist/htmlspec/elements/section.d.ts +4 -0
  119. package/dist/htmlspec/elements/select.d.ts +37 -0
  120. package/dist/htmlspec/elements/selectedcontent.d.ts +7 -0
  121. package/dist/htmlspec/elements/slot.d.ts +8 -0
  122. package/dist/htmlspec/elements/small.d.ts +4 -0
  123. package/dist/htmlspec/elements/source.d.ts +33 -0
  124. package/dist/htmlspec/elements/span.d.ts +4 -0
  125. package/dist/htmlspec/elements/strong.d.ts +4 -0
  126. package/dist/htmlspec/elements/style.d.ts +21 -0
  127. package/dist/htmlspec/elements/sub.d.ts +4 -0
  128. package/dist/htmlspec/elements/summary.d.ts +4 -0
  129. package/dist/htmlspec/elements/sup.d.ts +4 -0
  130. package/dist/htmlspec/elements/table.d.ts +4 -0
  131. package/dist/htmlspec/elements/tbody.d.ts +4 -0
  132. package/dist/htmlspec/elements/td.d.ts +17 -0
  133. package/dist/htmlspec/elements/template.d.ts +29 -0
  134. package/dist/htmlspec/elements/textarea.d.ts +66 -0
  135. package/dist/htmlspec/elements/tfoot.d.ts +4 -0
  136. package/dist/htmlspec/elements/th.d.ts +31 -0
  137. package/dist/htmlspec/elements/thead.d.ts +4 -0
  138. package/dist/htmlspec/elements/time.d.ts +8 -0
  139. package/dist/htmlspec/elements/title.d.ts +4 -0
  140. package/dist/htmlspec/elements/tr.d.ts +4 -0
  141. package/dist/htmlspec/elements/track.d.ts +31 -0
  142. package/dist/htmlspec/elements/u.d.ts +4 -0
  143. package/dist/htmlspec/elements/ul.d.ts +12 -0
  144. package/dist/htmlspec/elements/var.d.ts +4 -0
  145. package/dist/htmlspec/elements/video.d.ts +66 -0
  146. package/dist/htmlspec/elements/wbr.d.ts +4 -0
  147. package/dist/index.cjs +142 -7
  148. package/dist/index.mjs +114 -9
  149. package/dist/internal/dev.d.ts +1 -0
  150. package/dist/internal/kitchen-sink-dev.d.ts +7 -0
  151. package/dist/internal/kitchen-sink.d.ts +2 -0
  152. package/dist/internal/type-assert.d.ts +39 -0
  153. package/dist/jsx-dev-runtime.cjs +1 -2
  154. package/dist/jsx-dev-runtime.mjs +2 -3
  155. package/dist/{jsx-runtime-cimCxEOU.js → jsx-runtime-BQPDXeiv.js} +27 -13
  156. package/dist/{jsx-runtime-Dh9PxNQe.js → jsx-runtime-DlHYwToA.js} +28 -14
  157. package/dist/jsx-runtime.cjs +1 -1
  158. package/dist/jsx-runtime.mjs +1 -1
  159. package/dist/jsx-types.d.ts +6 -26
  160. package/package.json +93 -86
  161. package/dist/htmlspec/AnchorElement.d.ts +0 -83
  162. package/dist/htmlspec/ButtonElement.d.ts +0 -55
  163. package/dist/htmlspec/InputAttributes.d.ts +0 -221
  164. package/dist/htmlspec/ScriptElement.d.ts +0 -38
  165. package/dist/htmlspec/StyleAttributes.d.ts +0 -19
  166. /package/dist/{dev.d.ts → classnames.test.d.ts} +0 -0
  167. /package/dist/{log.d.ts → internal/log.d.ts} +0 -0
@@ -1,10 +1,9 @@
1
- import { b as jsx, l as isJsxComponent, e as JsxComment, h as JsxFragment } from "./jsx-runtime-Dh9PxNQe.js";
1
+ import { j as jsx, l as isJsxComponent, e as JsxComment, h as JsxFragment } from "./jsx-runtime-DlHYwToA.js";
2
2
 
3
- export { F as Fragment, m as JSX } from "./jsx-runtime-Dh9PxNQe.js";
3
+ export { F as Fragment, m as JSX } from "./jsx-runtime-DlHYwToA.js";
4
4
 
5
5
  function jsxDEV(tag, props, key, isStaticChildren, source, self) {
6
6
  let node = jsx(...arguments);
7
- if (process.env.JSXHTML_DEV) return node;
8
7
  if (isJsxComponent(tag) && !(node instanceof JsxComment)) {
9
8
  const name = tag.displayName ?? tag.name ?? "Unknown";
10
9
  node = new JsxFragment([ new JsxComment(`<${name}>`), node, new JsxComment(`</${name}>`) ]);
@@ -1318,21 +1318,35 @@ const entityMap = {
1318
1318
  ffl: "ffllig"
1319
1319
  };
1320
1320
 
1321
- function cc(names) {
1322
- if (typeof names === "string" || typeof names === "number") return "" + names;
1323
- let out = "";
1324
- if (Array.isArray(names)) {
1325
- for (let i = 0, tmp; i < names.length; i++) {
1326
- if ((tmp = cc(names[i])) !== "") {
1327
- out += (out && " ") + tmp;
1328
- }
1321
+ function pushClassNames(value, classes) {
1322
+ if (value == null || value === false || value === true) return;
1323
+ if (typeof value === "string") {
1324
+ if (value) classes.push(value);
1325
+ return;
1326
+ }
1327
+ if (typeof value === "number" || typeof value === "bigint") {
1328
+ classes.push(String(value));
1329
+ return;
1330
+ }
1331
+ if (Array.isArray(value)) {
1332
+ for (const item of value) {
1333
+ pushClassNames(item, classes);
1329
1334
  }
1330
- } else {
1331
- for (let k in names) {
1332
- if (names[k]) out += (out && " ") + k;
1335
+ return;
1336
+ }
1337
+ for (const key of Object.keys(value)) {
1338
+ if (value[key]) {
1339
+ classes.push(key);
1333
1340
  }
1334
1341
  }
1335
- return out;
1342
+ }
1343
+
1344
+ function classCat(...values) {
1345
+ const classes = [];
1346
+ for (const value of values) {
1347
+ pushClassNames(value, classes);
1348
+ }
1349
+ return classes.join(" ");
1336
1350
  }
1337
1351
 
1338
1352
  function isFunction$1(obj) {
@@ -1446,7 +1460,7 @@ function attrKvPair(rawAttr, rawVal) {
1446
1460
  return null;
1447
1461
  }
1448
1462
  if (rawAttr === "class" && !isString$1(rawVal)) {
1449
- rawVal = cc(rawVal);
1463
+ rawVal = classCat(rawVal);
1450
1464
  }
1451
1465
  if (rawAttr === "style" && isPlainObject(rawVal)) {
1452
1466
  rawVal = styleObjectToString(rawVal);
@@ -1316,21 +1316,35 @@ const entityMap = {
1316
1316
  ffl: "ffllig"
1317
1317
  };
1318
1318
 
1319
- function cc(names) {
1320
- if (typeof names === "string" || typeof names === "number") return "" + names;
1321
- let out = "";
1322
- if (Array.isArray(names)) {
1323
- for (let i = 0, tmp; i < names.length; i++) {
1324
- if ((tmp = cc(names[i])) !== "") {
1325
- out += (out && " ") + tmp;
1326
- }
1319
+ function pushClassNames(value, classes) {
1320
+ if (value == null || value === false || value === true) return;
1321
+ if (typeof value === "string") {
1322
+ if (value) classes.push(value);
1323
+ return;
1324
+ }
1325
+ if (typeof value === "number" || typeof value === "bigint") {
1326
+ classes.push(String(value));
1327
+ return;
1328
+ }
1329
+ if (Array.isArray(value)) {
1330
+ for (const item of value) {
1331
+ pushClassNames(item, classes);
1327
1332
  }
1328
- } else {
1329
- for (let k in names) {
1330
- if (names[k]) out += (out && " ") + k;
1333
+ return;
1334
+ }
1335
+ for (const key of Object.keys(value)) {
1336
+ if (value[key]) {
1337
+ classes.push(key);
1331
1338
  }
1332
1339
  }
1333
- return out;
1340
+ }
1341
+
1342
+ function classCat(...values) {
1343
+ const classes = [];
1344
+ for (const value of values) {
1345
+ pushClassNames(value, classes);
1346
+ }
1347
+ return classes.join(" ");
1334
1348
  }
1335
1349
 
1336
1350
  function isFunction$1(obj) {
@@ -1444,7 +1458,7 @@ function attrKvPair(rawAttr, rawVal) {
1444
1458
  return null;
1445
1459
  }
1446
1460
  if (rawAttr === "class" && !isString$1(rawVal)) {
1447
- rawVal = cc(rawVal);
1461
+ rawVal = classCat(rawVal);
1448
1462
  }
1449
1463
  if (rawAttr === "style" && isPlainObject(rawVal)) {
1450
1464
  rawVal = styleObjectToString(rawVal);
@@ -2336,4 +2350,4 @@ function Fragment({children}) {
2336
2350
  return new JsxFragment(children);
2337
2351
  }
2338
2352
 
2339
- export { EMPTY as E, Fragment as F, JsxRawHtml as J, JsxDocType as a, jsx as b, js as c, JsxElement as d, JsxComment as e, flattenString as f, JsxEmpty as g, JsxFragment as h, isJsxNode as i, jsxs as j, JsxNode as k, isJsxComponent as l, JSX as m };
2353
+ export { EMPTY as E, Fragment as F, JsxDocType as J, jsxs as a, JsxRawHtml as b, js as c, JsxElement as d, JsxComment as e, flattenString as f, JsxEmpty as g, JsxFragment as h, isJsxNode as i, jsx as j, JsxNode as k, isJsxComponent as l, JSX as m };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- var jsxRuntime = require("./jsx-runtime-cimCxEOU.js");
3
+ var jsxRuntime = require("./jsx-runtime-BQPDXeiv.js");
4
4
 
5
5
  exports.Fragment = jsxRuntime.Fragment;
6
6
 
@@ -1 +1 @@
1
- export { F as Fragment, m as JSX, b as jsx, j as jsxs } from "./jsx-runtime-Dh9PxNQe.js";
1
+ export { F as Fragment, m as JSX, j as jsx, a as jsxs } from "./jsx-runtime-DlHYwToA.js";
@@ -1,36 +1,16 @@
1
1
  import type { JsxNode } from './jsx-node';
2
- import type { AllGlobalAttributes } from './htmlspec/GlobalAttributes';
3
- import type { Override } from './util-types';
4
- import type { Class } from 'classcat';
5
- import type { Properties, PropertiesHyphen } from 'csstype';
6
- export interface Stringable {
7
- toString(): string;
8
- }
2
+ import type { AnyAttributes, AttrArr, AttrKvPair, AttrObj, AttributeValue, Attributes, ClassNames, CommonAttributes, JsxChildren, JsxRenderable, SpecialAttributes, Stringable, StyleObject } from './htmlspec/attributes/ElementAttributes';
3
+ export type { Stringable };
9
4
  export type PlainObject = Record<PropertyKey, unknown>;
10
- export type ClassNames = Class;
11
- export type StyleObject = Properties | PropertiesHyphen;
12
- export type AttributeValue = Stringable | StyleObject | ClassNames;
13
- export type AttrKvPair = [name: string, value: AttributeValue];
14
- export type AttrArr = AttrKvPair[];
15
- export type AttrObj = Record<string, AttributeValue>;
16
- export type Attributes = AttrObj | AttrArr;
5
+ export type { ClassNames, StyleObject, AttributeValue, AttrKvPair, AttrArr, AttrObj, Attributes };
17
6
  export type UnkFn = (...args: unknown[]) => unknown;
18
7
  export type AnyFn = (...args: any[]) => any;
19
8
  export type HtmlSafe = {
20
9
  __html: string;
21
10
  };
22
- export type JsxRenderable = any;
23
- export type JsxChildren = JsxRenderable | Iterable<JsxRenderable>;
24
- export type SpecialProps = {
25
- children?: JsxChildren;
26
- style?: StyleObject | string;
27
- /**
28
- * CSS class.
29
- */
30
- class?: ClassNames;
31
- };
32
- export type CommonProps<E = HTMLElement> = Override<AllGlobalAttributes<E>, SpecialProps>;
33
- export type AnyAttributes<E = HTMLElement> = Override<AttrObj, CommonProps<E>>;
11
+ export type { JsxRenderable, JsxChildren };
12
+ export type { SpecialAttributes };
13
+ export type { CommonAttributes, AnyAttributes };
34
14
  export type JsxComponent<P = AnyAttributes> = ((props: P) => JsxNode) & {
35
15
  displayName?: string;
36
16
  name?: string;
package/package.json CHANGED
@@ -1,90 +1,97 @@
1
1
  {
2
- "name": "@mpen/jsxhtml",
3
- "version": "0.3.0",
4
- "packageManager": "bun@1.2.9",
5
- "exports": {
6
- ".": {
7
- "import": "./dist/index.mjs",
8
- "require": "./dist/index.cjs",
9
- "types": "./dist/index.d.ts"
2
+ "name": "@mpen/jsxhtml",
3
+ "version": "0.4.0",
4
+ "packageManager": "bun@1.3.7",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.mjs",
8
+ "require": "./dist/index.cjs",
9
+ "types": "./dist/index.d.ts"
10
+ },
11
+ "./jsx-runtime": {
12
+ "import": "./dist/jsx-runtime.mjs",
13
+ "require": "./dist/jsx-runtime.cjs",
14
+ "types": "./dist/jsx-runtime.d.ts"
15
+ },
16
+ "./jsx-dev-runtime": {
17
+ "import": "./dist/jsx-dev-runtime.mjs",
18
+ "require": "./dist/jsx-dev-runtime.cjs",
19
+ "types": "./dist/jsx-dev-runtime.d.ts"
20
+ }
10
21
  },
11
- "./jsx-runtime": {
12
- "import": "./dist/jsx-runtime.mjs",
13
- "require": "./dist/jsx-runtime.cjs",
14
- "types": "./dist/jsx-runtime.d.ts"
22
+ "type": "module",
23
+ "files": [
24
+ "dist"
25
+ ],
26
+ "private": false,
27
+ "sideEffects": false,
28
+ "author": {
29
+ "name": "Mark Penner",
30
+ "email": "npm@mpen.ca",
31
+ "url": "https://github.com/mnpenner"
15
32
  },
16
- "./jsx-dev-runtime": {
17
- "import": "./dist/jsx-dev-runtime.mjs",
18
- "require": "./dist/jsx-dev-runtime.cjs",
19
- "types": "./dist/jsx-dev-runtime.d.ts"
20
- }
21
- },
22
- "type": "module",
23
- "files": [
24
- "dist"
25
- ],
26
- "private": false,
27
- "sideEffects": false,
28
- "author": {
29
- "name": "Mark Penner",
30
- "email": "npm@mpen.ca",
31
- "url": "https://github.com/mnpenner"
32
- },
33
- "keywords": [
34
- "jsx",
35
- "tsx",
36
- "html",
37
- "render",
38
- "server",
39
- "ssr"
40
- ],
41
- "scripts": {
42
- "_dev:build": "rollup -cw",
43
- "_dev:serve": "serve -l tcp://0.0.0.0:8080",
44
- "dev": "run-p \"dev:**\"",
45
- "dev:run": "NODE_ENV=production bun --watch run --jsx=react-jsx --jsx-import-source=. src/dev.tsx",
46
- "dev:build": "NODE_ENV=production bun --watch --no-clear-screen build src/dev.tsx --outdir=dist --packages=external --external '*'",
47
- "typecheck": "tsc --noEmit src/dev.tsx --jsx react-jsx --jsxImportSource . --moduleResolution bundler --module esnext --lib dom,esnext --target esnext",
48
- "test": "NODE_ENV=production bun test --jsx-import-source=@mpen/jsxhtml",
49
- "bundle:clean": "rm -rf dist/",
50
- "bundle:build": "NODE_ENV=production rollup -c",
51
- "bundle": "run-s bundle:clean bundle:build",
52
- "commit": "VER=$(jq -r '.version' package.json) && hg ci -m \"Commit v$VER\" && hg tag \"v$VER\"",
53
- "bumpver": "npm version patch",
54
- "release": "run-s test bundle bumpver commit && npm publish --access=public && hg pushall",
55
- "lint": "sh -c 'eslint --quiet --fix --fix-type problem,suggestion,layout,directive -- \"${@:-.}\"' --"
56
- },
57
- "devDependencies": {
58
- "@mpen/is-type": "^0.1.15",
59
- "@rollup/plugin-commonjs": "^28.0.3",
60
- "@rollup/plugin-node-resolve": "^16.0.1",
61
- "@rollup/plugin-replace": "^5.0.7",
62
- "@rollup/plugin-terser": "^0.4.4",
63
- "@rollup/plugin-typescript": "^11.1.6",
64
- "@types/eslint": "^8.56.12",
65
- "@typescript-eslint/eslint-plugin": "^8.29.1",
66
- "@typescript-eslint/parser": "^8.29.1",
67
- "bun-types": "^1.2.15",
68
- "classnames": "^2.5.1",
69
- "csstype": "^3.1.3",
70
- "elysia": ">=1.2.25",
71
- "eslint": "^8.57.1",
72
- "eslint-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
73
- "eslint-plugin-react-hooks": "^5.2.0",
74
- "eslint-plugin-react-refresh": "^0.4.19",
75
- "eslint-plugin-unused-imports": "^4.1.4",
76
- "js-serialize": "^0.6.0",
77
- "npm-run-all": "^4.1.5",
78
- "rimraf": "^5.0.10",
79
- "rollup": "^4.40.0",
80
- "serve": "^14.2.4",
81
- "tslib": "^2.8.1",
82
- "typescript": "^5.8.3"
83
- },
84
- "optionalDependencies": {
85
- "elysia": ">=1.2.25"
86
- },
87
- "dependencies": {
88
- "classcat": "^5.0.5"
89
- }
33
+ "keywords": [
34
+ "jsx",
35
+ "tsx",
36
+ "html",
37
+ "render",
38
+ "server",
39
+ "ssr"
40
+ ],
41
+ "scripts": {
42
+ "_dev:build": "rollup -cw",
43
+ "_dev:serve": "serve -l tcp://0.0.0.0:8080",
44
+ "dev": "run-p \"dev:**\"",
45
+ "dev:run": "NODE_ENV=production bun --watch run --jsx=react-jsx --jsx-import-source=. src/internal/dev.tsx",
46
+ "dev:build": "NODE_ENV=production bun --watch --no-clear-screen build src/internal/dev.tsx --outdir=dist --packages=external --external '*'",
47
+ "typecheck": "tsc --noEmit src/internal/dev.tsx --jsx react-jsx --jsxImportSource . --moduleResolution bundler --module esnext --lib dom,esnext --target esnext",
48
+ "test:types": "tsc --noEmit && echo \"tsc: no errors\"",
49
+ "test:unit": "NODE_ENV=production bun test --jsx-import-source=@mpen/jsxhtml",
50
+ "test": "run-p 'test:*'",
51
+ "bundle:clean": "rm -rf dist/",
52
+ "bundle:build": "NODE_ENV=production rollup -c",
53
+ "bundle": "run-s bundle:clean bundle:build",
54
+ "commit": "VER=$(jq -r '.version' package.json) && hg ci -m \"Commit v$VER\" && hg tag \"v$VER\"",
55
+ "bumpver": "npm version patch",
56
+ "release": "run-s test bundle bumpver commit && npm publish --access=public && hg pushall",
57
+ "lint": "bun run --bun eslint --fix --"
58
+ },
59
+ "devDependencies": {
60
+ "@mpen/is-type": "^0.1.15",
61
+ "@rollup/plugin-commonjs": "^28.0.3",
62
+ "@rollup/plugin-node-resolve": "^16.0.1",
63
+ "@rollup/plugin-replace": "^5.0.7",
64
+ "@rollup/plugin-terser": "^0.4.4",
65
+ "@rollup/plugin-typescript": "^11.1.6",
66
+ "@types/eslint": "^8.56.12",
67
+ "@typescript-eslint/eslint-plugin": "^8.29.1",
68
+ "@typescript-eslint/parser": "^8.29.1",
69
+ "bun-types": "^1.2.15",
70
+ "elysia": "^1.2.25",
71
+ "eslint": "^8.57.1",
72
+ "eslint-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
73
+ "eslint-plugin-react-hooks": "^5.2.0",
74
+ "eslint-plugin-react-refresh": "^0.4.19",
75
+ "eslint-plugin-unused-imports": "^4.1.4",
76
+ "js-serialize": "^0.6.0",
77
+ "npm-run-all": "^4.1.5",
78
+ "rimraf": "^5.0.10",
79
+ "rollup": "^4.40.0",
80
+ "serve": "^14.2.4",
81
+ "tslib": "^2.8.1",
82
+ "typescript": "^5.8.3"
83
+ },
84
+ "peerDependencies": {
85
+ "csstype": "3.x",
86
+ "elysia": "1.x"
87
+ },
88
+ "peerDependenciesMeta": {
89
+ "elysia": {
90
+ "optional": true
91
+ },
92
+ "csstype": {
93
+ "optional": false
94
+ }
95
+ },
96
+ "dependencies": {}
90
97
  }
@@ -1,83 +0,0 @@
1
- export type AnchorElement = {
2
- /**
3
- * Causes the browser to treat the linked URL as a download. Can be used with or without a filename value:
4
- *
5
- * - Without a value, the browser will suggest a filename/extension, generated from various sources:
6
- * - The `Content-Disposition` HTTP header
7
- * - The final segment in the URL path
8
- * - The media type (from the Content-Type header, the start of a data: URL, or Blob.type for a blob: URL)
9
- * - `filename`: defining a value suggests it as the filename. / and \ characters are converted to underscores
10
- * (_). Filesystems may forbid other characters in filenames, so browsers will adjust the suggested name if
11
- * necessary.
12
- */
13
- download?: true | string;
14
- /**
15
- * The URL that the hyperlink points to. Links are not restricted to HTTP-based URLs — they can use any URL scheme
16
- * supported by browsers:
17
- *
18
- * - Sections of a page with document fragments
19
- * - Specific text portions with text fragments
20
- * - Pieces of media files with media fragments
21
- * - Telephone numbers with tel: URLs
22
- * - Email addresses with mailto: URLs
23
- * - SMS text messages with sms: URLs
24
- * - While web browsers may not support other URL schemes, websites can with registerProtocolHandler()
25
- */
26
- href?: string;
27
- /**
28
- * Hints at the human language of the linked URL. No built-in functionality. Allowed values are the same as the
29
- * global lang attribute.
30
- */
31
- hreflang?: string;
32
- /**
33
- * A space-separated list of URLs. When the link is followed, the browser will send POST requests with the body
34
- * PING to the URLs. Typically for tracking.
35
- */
36
- ping?: string;
37
- /**
38
- * How much of the referrer to send when following the link.
39
- */
40
- referrerpolicy?: ReferrerPolicy | string;
41
- /**
42
- * The relationship of the linked URL as space-separated link types.
43
- */
44
- rel?: string;
45
- /**
46
- * Where to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
47
- */
48
- target?: '_self' | '_blank' | '_parent' | '_top' | string;
49
- /**
50
- * Hints at the linked URL's format with a MIME type. No built-in functionality.
51
- */
52
- type?: string;
53
- /**
54
- * @deprecated
55
- */
56
- charset?: string;
57
- /**
58
- * @deprecated
59
- */
60
- coords?: string;
61
- /**
62
- * @deprecated
63
- */
64
- name?: string;
65
- /**
66
- * @deprecated
67
- */
68
- rev?: string;
69
- /**
70
- * @deprecated
71
- */
72
- shape?: string;
73
- };
74
- export declare const enum ReferrerPolicy {
75
- NoReferrer = "no-referrer",
76
- NoReferrerWhenDowngrade = "no-referrer-when-downgrade",
77
- Origin = "origin",
78
- OriginWhenCrossOrigin = "origin-when-cross-origin",
79
- SameOrigin = "same-origin",
80
- StrictOrigin = "strict-origin",
81
- StrictOriginWhenCrossOrigin = "strict-origin-when-cross-origin",
82
- UnsafeUrl = "unsafe-url"
83
- }
@@ -1,55 +0,0 @@
1
- /**
2
- * All standard attributes for the `<button>` HTML element.
3
- */
4
- export type ButtonAttributes = {
5
- /** Automatically focus the button when the page loads. */
6
- autofocus?: boolean;
7
- /**
8
- * Action to perform on the controlled element:
9
- * - "show-modal" | "close" | "request-close"
10
- * - "show-popover" | "hide-popover" | "toggle-popover"
11
- * - "--custom": custom command (must start with `--`)
12
- */
13
- command?: string;
14
- /** ID of the element this button controls as a command button. */
15
- commandfor?: string;
16
- /** Whether the button is disabled and non-interactive. */
17
- disabled?: boolean;
18
- /** Associates the button with a `<form>` by ID. */
19
- form?: string;
20
- /** URL to submit to when clicked. Overrides form’s `action`. */
21
- formaction?: string;
22
- /**
23
- * Encoding type for submitted data:
24
- * - "application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"
25
- */
26
- formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
27
- /**
28
- * Method for submitting the form:
29
- * - "get" | "post" | "dialog"
30
- */
31
- formmethod?: 'get' | 'post' | 'dialog';
32
- /** Skip form validation on submit. */
33
- formnovalidate?: boolean;
34
- /**
35
- * Browsing context for the response:
36
- * - "_self" | "_blank" | "_parent" | "_top" | custom target
37
- */
38
- formtarget?: string;
39
- /** Name of the button, submitted as name=value with the form. */
40
- name?: string;
41
- /** ID of the popover element controlled by this button. */
42
- popovertarget?: string;
43
- /**
44
- * Action to perform on the popover:
45
- * - "show" | "hide" | "toggle"
46
- */
47
- popovertargetaction?: 'show' | 'hide' | 'toggle';
48
- /**
49
- * Button type:
50
- * - "submit" (default), "reset", or "button"
51
- */
52
- type?: 'submit' | 'reset' | 'button';
53
- /** Value submitted with the form when using this button. */
54
- value?: string;
55
- };