nesquick 0.0.21 → 0.0.22
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/lib/NesquickComponent.js +0 -9
- package/lib/types/jsx-runtime.d.ts +14 -10
- package/package.json +5 -2
package/lib/NesquickComponent.js
CHANGED
|
@@ -2,14 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NesquickComponent = void 0;
|
|
4
4
|
const State_1 = require("./State");
|
|
5
|
-
function functionizeProps(props) {
|
|
6
|
-
for (const k in props) {
|
|
7
|
-
if (typeof props[k] !== "function") {
|
|
8
|
-
const v = props[k];
|
|
9
|
-
props[k] = () => v;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
5
|
const SVGNamespaces = new Map([
|
|
14
6
|
["xlink", "http://www.w3.org/1999/xlink"],
|
|
15
7
|
["xml", "http://www.w3.org/XML/1998/namespace"]
|
|
@@ -27,7 +19,6 @@ class NesquickComponent {
|
|
|
27
19
|
render(document) {
|
|
28
20
|
State_1.subscriptions.set(this._subscriptions);
|
|
29
21
|
if (typeof this._render === "function") {
|
|
30
|
-
functionizeProps(this.props);
|
|
31
22
|
const element = this._render(this.props);
|
|
32
23
|
if (this._xmlns) {
|
|
33
24
|
element.setXmlns(this._xmlns);
|
|
@@ -3,19 +3,24 @@ import { NesquickFragment } from "./NesquickFragment";
|
|
|
3
3
|
export declare const Fragment: unique symbol;
|
|
4
4
|
export declare function jsxs<P extends ComponentProps>(type: string | FunctionComponent<P> | typeof Fragment, props: P, key?: string | number | null): NesquickFragment | NesquickComponent<P>;
|
|
5
5
|
export declare const jsx: typeof jsxs;
|
|
6
|
+
type HasUndefined<T, K extends keyof T> = {
|
|
7
|
+
[L in K]-?: T[K] | undefined;
|
|
8
|
+
} extends {
|
|
9
|
+
[L in K]?: T[K];
|
|
10
|
+
} ? undefined extends T[K] ? true : false : false;
|
|
6
11
|
declare const WrappedFunctionType: unique symbol;
|
|
7
12
|
type WrappedFunction<T> = (() => T) & {
|
|
8
13
|
readonly [WrappedFunctionType]?: T;
|
|
9
14
|
};
|
|
10
|
-
type UserProp<T> = T extends (...args:
|
|
11
|
-
type ComponentProp<T> = T extends {
|
|
12
|
-
readonly [WrappedFunctionType]?: infer R;
|
|
13
|
-
} ? (T | R) : T extends (...args: any[]) => any ? T : (T | (() => T));
|
|
15
|
+
type UserProp<T> = T extends (...args: any[]) => any ? T : WrappedFunction<T>;
|
|
14
16
|
type UserProps<T> = {
|
|
15
|
-
[K in keyof T]: UserProp<T[K]
|
|
17
|
+
readonly [K in keyof T]: HasUndefined<T, K> extends true ? UserProp<T[K] | undefined> : UserProp<Exclude<T[K], undefined>>;
|
|
16
18
|
};
|
|
19
|
+
type JSXProp<T> = T extends {
|
|
20
|
+
readonly [WrappedFunctionType]?: infer R;
|
|
21
|
+
} ? R : T;
|
|
17
22
|
type JSXProps<T> = keyof T extends never ? {} : {
|
|
18
|
-
[K in keyof T]:
|
|
23
|
+
[K in keyof T]: JSXProp<T[K]>;
|
|
19
24
|
};
|
|
20
25
|
export type Generic<T> = T extends (...args: any) => infer R ? R : T;
|
|
21
26
|
export { UserProps as Props };
|
|
@@ -32,23 +37,22 @@ export declare namespace JSX {
|
|
|
32
37
|
};
|
|
33
38
|
export interface Props<T extends EventTarget = HTMLElement> extends JSXHTMLEvent<T>, JSXSVGEvent<T> {
|
|
34
39
|
[k: string]: any;
|
|
35
|
-
style?:
|
|
40
|
+
style?: Style;
|
|
36
41
|
xmlns?: string | null;
|
|
37
42
|
ref?: ((el: T) => void) | null;
|
|
38
43
|
}
|
|
44
|
+
export type Style = StyleProps | string;
|
|
39
45
|
export type StyleProps = {
|
|
40
46
|
[K in keyof CSSStyleDeclaration]?: CSSStyleDeclaration[K] extends Function ? never : CSSStyleDeclaration[K] | (() => CSSStyleDeclaration[K]);
|
|
41
47
|
};
|
|
42
48
|
export type HTMLProps<T extends HTMLElement = HTMLElement> = Props<T>;
|
|
43
49
|
export type SVGProps<T extends SVGElement = SVGElement> = Props<T>;
|
|
44
|
-
export type
|
|
50
|
+
export type IntrinsicElements = {
|
|
45
51
|
[K in keyof HTMLElementTagNameMap]: HTMLProps<HTMLElementTagNameMap[K]>;
|
|
46
52
|
} & {
|
|
47
53
|
[K in keyof SVGElementTagNameMap]: SVGProps<SVGElementTagNameMap[K]>;
|
|
48
54
|
};
|
|
49
55
|
export type Element = NesquickComponent<any>;
|
|
50
|
-
export interface IntrinsicElements extends JSXElements {
|
|
51
|
-
}
|
|
52
56
|
export type ElementType = keyof IntrinsicElements | Component<any> | typeof NesquickComponent<any>;
|
|
53
57
|
const NotEmptyObject: unique symbol;
|
|
54
58
|
export type IntrinsicAttributes = {
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nesquick",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "React-like library with focus on drawing performance",
|
|
5
5
|
"types": "./lib/types",
|
|
6
6
|
"main": "./lib",
|
|
7
7
|
"typesVersions": {
|
|
8
8
|
"*": {
|
|
9
9
|
"jsx-runtime": ["./lib/types/jsx-runtime.d.ts"],
|
|
10
|
-
"jsx-dev-runtime": ["./lib/types/jsx-dev-runtime.d.ts"]
|
|
10
|
+
"jsx-dev-runtime": ["./lib/types/jsx-dev-runtime.d.ts"],
|
|
11
|
+
"no-transformer/jsx-runtime": ["./lib/types/no-transformer/jsx-runtime.d.ts"],
|
|
12
|
+
"no-transformer/jsx-dev-runtime": ["./lib/types/no-transformer/jsx-dev-runtime.d.ts"]
|
|
11
13
|
}
|
|
12
14
|
},
|
|
13
15
|
"bin": {
|
|
@@ -17,6 +19,7 @@
|
|
|
17
19
|
"sideEffects": false,
|
|
18
20
|
"files": [
|
|
19
21
|
"lib/",
|
|
22
|
+
"no-transformer/",
|
|
20
23
|
"jsx-runtime.js",
|
|
21
24
|
"jsx-dev-runtime.js"
|
|
22
25
|
],
|