@flow-os/router 0.0.51-dev.1772056059 → 0.0.51-dev.1772056339
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/package.json
CHANGED
package/src/jsx-runtime/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference path="./types.d.ts" />
|
|
2
2
|
/** Minimal JSX runtime: creates DOM nodes. No React. */
|
|
3
|
+
import { applyStyleProps } from '@flow-os/style/features/elements';
|
|
4
|
+
|
|
3
5
|
export const Fragment = Symbol.for('flow.fragment');
|
|
4
6
|
|
|
5
7
|
type Props = Record<string, unknown> & { children?: unknown };
|
|
@@ -31,7 +33,7 @@ function appendChildren(el: Node, children: unknown): void {
|
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
function applyProps(el: HTMLElement, props: Props): void {
|
|
34
|
-
const { children, class: classProp, className: classNameProp, style: styleProp, ...rest } = props;
|
|
36
|
+
const { children, class: classProp, className: classNameProp, style: styleProp, s, styleFlow, ...rest } = props;
|
|
35
37
|
if (classProp != null) el.className = Array.isArray(classProp) ? classProp.join(' ') : String(classProp);
|
|
36
38
|
if (classNameProp != null) el.className = String(classNameProp);
|
|
37
39
|
if (styleProp != null && typeof styleProp === 'object') {
|
|
@@ -39,6 +41,9 @@ function applyProps(el: HTMLElement, props: Props): void {
|
|
|
39
41
|
if (v != null) (el.style as unknown as Record<string, string>)[k] = String(v);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
44
|
+
if (s != null || styleFlow != null) {
|
|
45
|
+
applyStyleProps(el, { s, styleFlow } as Parameters<typeof applyStyleProps>[1]);
|
|
46
|
+
}
|
|
42
47
|
for (const [k, v] of Object.entries(rest)) {
|
|
43
48
|
if (v == null) continue;
|
|
44
49
|
if (k === 'href' && typeof v === 'string') (el as HTMLAnchorElement).href = v;
|
|
@@ -8,6 +8,8 @@ declare global {
|
|
|
8
8
|
class?: string;
|
|
9
9
|
className?: string;
|
|
10
10
|
style?: Record<string, string | number>;
|
|
11
|
+
s?: string | Record<string, string | number | undefined>;
|
|
12
|
+
styleFlow?: Record<string, unknown> | string;
|
|
11
13
|
href?: string;
|
|
12
14
|
children?: unknown;
|
|
13
15
|
[key: string]: unknown;
|