@blender-ui/react 0.2.0 → 0.2.1
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/README.md +171 -171
- package/hooks.js +397 -397
- package/index.d.ts +110 -110
- package/index.js +370 -370
- package/jsx-dev-runtime.d.ts +2 -2
- package/jsx-dev-runtime.js +9 -9
- package/jsx-runtime.d.ts +26 -26
- package/jsx-runtime.js +11 -11
- package/package.json +1 -1
package/jsx-dev-runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Fragment, jsxDEV } from 'react/jsx-dev-runtime'
|
|
2
|
-
export type { JSX } from './jsx-runtime'
|
|
1
|
+
export { Fragment, jsxDEV } from 'react/jsx-dev-runtime'
|
|
2
|
+
export type { JSX } from './jsx-runtime'
|
package/jsx-dev-runtime.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
2
|
-
'use strict'
|
|
3
|
-
const runtime = require('react/jsx-dev-runtime')
|
|
4
|
-
const { track } = require('./hooks')
|
|
5
|
-
|
|
6
|
-
exports.Fragment = runtime.Fragment
|
|
7
|
-
// undefined in React's production build, as in React
|
|
8
|
-
exports.jsxDEV = runtime.jsxDEV && ((type, props, key, isStatic, source, self) =>
|
|
9
|
-
runtime.jsxDEV(track(type), props, key, isStatic, source, self))
|
|
1
|
+
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
2
|
+
'use strict'
|
|
3
|
+
const runtime = require('react/jsx-dev-runtime')
|
|
4
|
+
const { track } = require('./hooks')
|
|
5
|
+
|
|
6
|
+
exports.Fragment = runtime.Fragment
|
|
7
|
+
// undefined in React's production build, as in React
|
|
8
|
+
exports.jsxDEV = runtime.jsxDEV && ((type, props, key, isStatic, source, self) =>
|
|
9
|
+
runtime.jsxDEV(track(type), props, key, isStatic, source, self))
|
package/jsx-runtime.d.ts
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// With `"jsxImportSource": "@blender-ui/react"` in tsconfig, host elements'
|
|
2
|
-
// props accept signals: `<div style={styleMemo} className={cls}>`.
|
|
3
|
-
import type * as React from 'react'
|
|
4
|
-
import type { ReadSignal } from '@blender-ui/native'
|
|
5
|
-
export { Fragment, jsx, jsxs } from 'react/jsx-runtime'
|
|
6
|
-
|
|
7
|
-
type Fixed = 'children' | 'key' | 'ref' | 'dangerouslySetInnerHTML'
|
|
8
|
-
/** Each prop also takes a signal of its value (event handlers stay functions). */
|
|
9
|
-
export type Bindable<P> = {
|
|
10
|
-
[K in keyof P]: K extends Fixed | `on${string}` ? P[K]
|
|
11
|
-
: K extends 'style' ? P[K] | string | ReadSignal<Exclude<P[K], undefined> | string>
|
|
12
|
-
: P[K] | ReadSignal<Exclude<P[K], undefined>>
|
|
13
|
-
}
|
|
14
|
-
type Intrinsic = { [K in keyof React.JSX.IntrinsicElements]: Bindable<React.JSX.IntrinsicElements[K]> }
|
|
15
|
-
|
|
16
|
-
export namespace JSX {
|
|
17
|
-
type ElementType = React.JSX.ElementType
|
|
18
|
-
interface Element extends React.JSX.Element {}
|
|
19
|
-
interface ElementClass extends React.JSX.ElementClass {}
|
|
20
|
-
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
|
21
|
-
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
|
22
|
-
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>
|
|
23
|
-
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
|
24
|
-
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
|
25
|
-
interface IntrinsicElements extends Intrinsic {}
|
|
26
|
-
}
|
|
1
|
+
// With `"jsxImportSource": "@blender-ui/react"` in tsconfig, host elements'
|
|
2
|
+
// props accept signals: `<div style={styleMemo} className={cls}>`.
|
|
3
|
+
import type * as React from 'react'
|
|
4
|
+
import type { ReadSignal } from '@blender-ui/native'
|
|
5
|
+
export { Fragment, jsx, jsxs } from 'react/jsx-runtime'
|
|
6
|
+
|
|
7
|
+
type Fixed = 'children' | 'key' | 'ref' | 'dangerouslySetInnerHTML'
|
|
8
|
+
/** Each prop also takes a signal of its value (event handlers stay functions). */
|
|
9
|
+
export type Bindable<P> = {
|
|
10
|
+
[K in keyof P]: K extends Fixed | `on${string}` ? P[K]
|
|
11
|
+
: K extends 'style' ? P[K] | string | ReadSignal<Exclude<P[K], undefined> | string>
|
|
12
|
+
: P[K] | ReadSignal<Exclude<P[K], undefined>>
|
|
13
|
+
}
|
|
14
|
+
type Intrinsic = { [K in keyof React.JSX.IntrinsicElements]: Bindable<React.JSX.IntrinsicElements[K]> }
|
|
15
|
+
|
|
16
|
+
export namespace JSX {
|
|
17
|
+
type ElementType = React.JSX.ElementType
|
|
18
|
+
interface Element extends React.JSX.Element {}
|
|
19
|
+
interface ElementClass extends React.JSX.ElementClass {}
|
|
20
|
+
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
|
|
21
|
+
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
|
|
22
|
+
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>
|
|
23
|
+
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
|
|
24
|
+
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
|
|
25
|
+
interface IntrinsicElements extends Intrinsic {}
|
|
26
|
+
}
|
package/jsx-runtime.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// `"jsxImportSource": "@blender-ui/react"`: React's JSX runtime. Components
|
|
2
|
-
// get render tracking (they re-render when a signal their render read
|
|
3
|
-
// changes); the types let every host-element prop take a signal.
|
|
4
|
-
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
5
|
-
'use strict'
|
|
6
|
-
const runtime = require('react/jsx-runtime')
|
|
7
|
-
const { track } = require('./hooks')
|
|
8
|
-
|
|
9
|
-
exports.Fragment = runtime.Fragment
|
|
10
|
-
exports.jsx = (type, props, key) => runtime.jsx(track(type), props, key)
|
|
11
|
-
exports.jsxs = (type, props, key) => runtime.jsxs(track(type), props, key)
|
|
1
|
+
// `"jsxImportSource": "@blender-ui/react"`: React's JSX runtime. Components
|
|
2
|
+
// get render tracking (they re-render when a signal their render read
|
|
3
|
+
// changes); the types let every host-element prop take a signal.
|
|
4
|
+
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
5
|
+
'use strict'
|
|
6
|
+
const runtime = require('react/jsx-runtime')
|
|
7
|
+
const { track } = require('./hooks')
|
|
8
|
+
|
|
9
|
+
exports.Fragment = runtime.Fragment
|
|
10
|
+
exports.jsx = (type, props, key) => runtime.jsx(track(type), props, key)
|
|
11
|
+
exports.jsxs = (type, props, key) => runtime.jsxs(track(type), props, key)
|
package/package.json
CHANGED