@mpen/jsxhtml 0.2.1 → 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.
- package/dist/css-escape.d.ts +25 -0
- package/dist/custom-components.d.ts +1 -1
- package/dist/dev.d.ts +1 -0
- package/dist/htmlspec/ButtonElement.d.ts +55 -0
- package/dist/htmlspec/GlobalAttributes.d.ts +75 -5
- package/dist/htmlspec/InputAttributes.d.ts +221 -0
- package/dist/htmlspec/IntrinsicElements.d.ts +663 -84
- package/dist/htmlspec/ScriptElement.d.ts +38 -0
- package/dist/htmlspec/StyleAttributes.d.ts +19 -0
- package/dist/index.cjs +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +2 -2
- package/dist/jsx-dev-runtime.cjs +3 -1
- package/dist/jsx-dev-runtime.d.ts +1 -0
- package/dist/jsx-dev-runtime.mjs +2 -2
- package/dist/{jsx-runtime-CsQM2fQb.js → jsx-runtime-Dh9PxNQe.js} +645 -20
- package/dist/{jsx-runtime-DpEMYmD9.js → jsx-runtime-cimCxEOU.js} +648 -19
- package/dist/jsx-runtime.cjs +3 -1
- package/dist/jsx-runtime.d.ts +1 -0
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/jsx-types.d.ts +6 -4
- package/dist/jsx.d.ts +30 -4
- package/dist/jsx.test.d.ts +1 -0
- package/dist/log.d.ts +2 -0
- package/dist/template-strings.d.ts +12 -0
- package/dist/template-strings.test.d.ts +6 -0
- package/package.json +11 -7
package/dist/jsx-runtime.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require("./jsx-runtime-
|
|
3
|
+
var jsxRuntime = require("./jsx-runtime-cimCxEOU.js");
|
|
4
4
|
|
|
5
5
|
exports.Fragment = jsxRuntime.Fragment;
|
|
6
6
|
|
|
7
|
+
exports.JSX = jsxRuntime.JSX;
|
|
8
|
+
|
|
7
9
|
exports.jsx = jsxRuntime.jsx;
|
|
8
10
|
|
|
9
11
|
exports.jsxs = jsxRuntime.jsxs;
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ import type { JsxNode } from './jsx-node';
|
|
|
4
4
|
export declare function jsx(tag: string | JsxComponent, props: AnyAttributes, key?: unknown, isStaticChildren?: unknown, source?: unknown, self?: unknown): JsxNode;
|
|
5
5
|
export declare function jsxs(...args: Parameters<typeof jsx>): JsxNode;
|
|
6
6
|
export declare function Fragment({ children }: ChildrenOnly): JsxFragment;
|
|
7
|
+
export { JSX } from './jsx';
|
package/dist/jsx-runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { F as Fragment, b as jsx, j as jsxs } from "./jsx-runtime-
|
|
1
|
+
export { F as Fragment, m as JSX, b as jsx, j as jsxs } from "./jsx-runtime-Dh9PxNQe.js";
|
package/dist/jsx-types.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { JsxNode } from './jsx-node';
|
|
2
2
|
import type { AllGlobalAttributes } from './htmlspec/GlobalAttributes';
|
|
3
3
|
import type { Override } from './util-types';
|
|
4
|
+
import type { Class } from 'classcat';
|
|
5
|
+
import type { Properties, PropertiesHyphen } from 'csstype';
|
|
4
6
|
export interface Stringable {
|
|
5
7
|
toString(): string;
|
|
6
8
|
}
|
|
7
9
|
export type PlainObject = Record<PropertyKey, unknown>;
|
|
8
|
-
export type ClassNames =
|
|
9
|
-
export type StyleObject =
|
|
10
|
+
export type ClassNames = Class;
|
|
11
|
+
export type StyleObject = Properties | PropertiesHyphen;
|
|
10
12
|
export type AttributeValue = Stringable | StyleObject | ClassNames;
|
|
11
13
|
export type AttrKvPair = [name: string, value: AttributeValue];
|
|
12
14
|
export type AttrArr = AttrKvPair[];
|
|
@@ -27,8 +29,8 @@ export type SpecialProps = {
|
|
|
27
29
|
*/
|
|
28
30
|
class?: ClassNames;
|
|
29
31
|
};
|
|
30
|
-
export type CommonProps = Override<AllGlobalAttributes
|
|
31
|
-
export type AnyAttributes = Override<AttrObj, CommonProps
|
|
32
|
+
export type CommonProps<E = HTMLElement> = Override<AllGlobalAttributes<E>, SpecialProps>;
|
|
33
|
+
export type AnyAttributes<E = HTMLElement> = Override<AttrObj, CommonProps<E>>;
|
|
32
34
|
export type JsxComponent<P = AnyAttributes> = ((props: P) => JsxNode) & {
|
|
33
35
|
displayName?: string;
|
|
34
36
|
name?: string;
|
package/dist/jsx.d.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
/// <reference no-default-lib="true"/>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { JsxNode } from './jsx-node';
|
|
3
|
+
import type * as instrinsic from './htmlspec/IntrinsicElements';
|
|
4
|
+
export type ComponentType<P = {}> = FunctionComponent<P>;
|
|
5
|
+
export type JsxChild = string | number | boolean | null | undefined | JsxNode | JsxNode[];
|
|
6
|
+
export interface FunctionComponent<P = {}> {
|
|
7
|
+
(props: P): JsxChild;
|
|
8
|
+
displayName?: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace JSX {
|
|
11
|
+
type ElementType<P = any, Tag extends keyof IntrinsicElements = keyof IntrinsicElements> = {
|
|
12
|
+
[K in Tag]: P extends IntrinsicElements[K] ? K : never;
|
|
13
|
+
}[Tag] | ComponentType<P>;
|
|
14
|
+
interface Element extends JsxNode {
|
|
15
|
+
}
|
|
16
|
+
type ElementClass = never;
|
|
17
|
+
interface ElementAttributesProperty {
|
|
18
|
+
props: {};
|
|
19
|
+
}
|
|
5
20
|
interface ElementChildrenAttribute {
|
|
6
|
-
children:
|
|
21
|
+
children: {};
|
|
22
|
+
}
|
|
23
|
+
type LibraryManagedAttributes<Component, Props> = Props;
|
|
24
|
+
interface IntrinsicAttributes {
|
|
25
|
+
}
|
|
26
|
+
interface IntrinsicClassAttributes<T> {
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Attributes specific to intrinsic elements (lowercase tags).
|
|
30
|
+
*/
|
|
31
|
+
interface IntrinsicElements extends instrinsic.IntrinsicElements {
|
|
7
32
|
}
|
|
8
33
|
}
|
|
34
|
+
export declare const JSX: {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/log.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class JsFrag {
|
|
2
|
+
private readonly str;
|
|
3
|
+
constructor(str: string);
|
|
4
|
+
toString(): string;
|
|
5
|
+
}
|
|
6
|
+
export declare function js(strings: TemplateStringsArray, ...values: any[]): JsFrag;
|
|
7
|
+
export declare class CssFrag {
|
|
8
|
+
private readonly str;
|
|
9
|
+
constructor(str: string);
|
|
10
|
+
toString(): string;
|
|
11
|
+
}
|
|
12
|
+
export declare function css(strings: TemplateStringsArray, ...values: any[]): CssFrag;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mpen/jsxhtml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"packageManager": "bun@1.2.9",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -32,17 +32,20 @@
|
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"jsx",
|
|
35
|
+
"tsx",
|
|
35
36
|
"html",
|
|
36
37
|
"render",
|
|
37
|
-
"server
|
|
38
|
-
"
|
|
38
|
+
"server",
|
|
39
|
+
"ssr"
|
|
39
40
|
],
|
|
40
41
|
"scripts": {
|
|
41
|
-
"
|
|
42
|
+
"_dev:build": "rollup -cw",
|
|
42
43
|
"_dev:serve": "serve -l tcp://0.0.0.0:8080",
|
|
43
44
|
"dev": "run-p \"dev:**\"",
|
|
44
|
-
"dev:
|
|
45
|
-
"
|
|
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",
|
|
46
49
|
"bundle:clean": "rm -rf dist/",
|
|
47
50
|
"bundle:build": "NODE_ENV=production rollup -c",
|
|
48
51
|
"bundle": "run-s bundle:clean bundle:build",
|
|
@@ -61,7 +64,7 @@
|
|
|
61
64
|
"@types/eslint": "^8.56.12",
|
|
62
65
|
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
63
66
|
"@typescript-eslint/parser": "^8.29.1",
|
|
64
|
-
"bun-types": "^1.2.
|
|
67
|
+
"bun-types": "^1.2.15",
|
|
65
68
|
"classnames": "^2.5.1",
|
|
66
69
|
"csstype": "^3.1.3",
|
|
67
70
|
"elysia": ">=1.2.25",
|
|
@@ -70,6 +73,7 @@
|
|
|
70
73
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
71
74
|
"eslint-plugin-react-refresh": "^0.4.19",
|
|
72
75
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
76
|
+
"js-serialize": "^0.6.0",
|
|
73
77
|
"npm-run-all": "^4.1.5",
|
|
74
78
|
"rimraf": "^5.0.10",
|
|
75
79
|
"rollup": "^4.40.0",
|