Skip to content

Commit 85ef2d7

Browse files
committed
Fix filter
1 parent 56e3f25 commit 85ef2d7

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

src/codegen/render/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ export function renderNode(
1010
deps: number = 0,
1111
childrenCodes: string[],
1212
): string {
13+
console.log('renderNode', props)
1314
const filteredProps = filterProps(props)
15+
16+
console.log('filteredProps', filteredProps)
1417
const propsString = propsToString(
1518
filterPropsWithComponent(component, filteredProps),
1619
)

src/codegen/render/text.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ export async function renderText(node: TextNode): Promise<{
124124
),
125125
)
126126
const resultChildren = children.flat()
127+
127128
if (resultChildren.length === 1)
128129
return {
129130
children: resultChildren[0].children,
130131
props: {
131132
...defaultProps,
132-
...(defaultProps.typography
133-
? { typography: defaultProps.typography }
134-
: resultChildren[0].props),
133+
...resultChildren[0].props,
135134
},
136135
}
137136

src/codegen/utils/is-default-prop.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
const DEFAULT_PROPS_MAP = {
2-
p: /\b0(px)?\b/,
3-
pr: /\b0(px)?\b/,
4-
pt: /\b0(px)?\b/,
5-
pb: /\b0(px)?\b/,
6-
px: /\b0(px)?\b/,
7-
py: /\b0(px)?\b/,
8-
pl: /\b0(px)?\b/,
9-
m: /\b0(px)?\b/,
10-
mt: /\b0(px)?\b/,
11-
mb: /\b0(px)?\b/,
12-
mr: /\b0(px)?\b/,
13-
ml: /\b0(px)?\b/,
14-
mx: /\b0(px)?\b/,
15-
my: /\b0(px)?\b/,
2+
// p: /\b0(px)?\b/,
3+
// pr: /\b0(px)?\b/,
4+
// pt: /\b0(px)?\b/,
5+
// pb: /\b0(px)?\b/,
6+
// px: /\b0(px)?\b/,
7+
// py: /\b0(px)?\b/,
8+
// pl: /\b0(px)?\b/,
9+
// m: /\b0(px)?\b/,
10+
// mt: /\b0(px)?\b/,
11+
// mb: /\b0(px)?\b/,
12+
// mr: /\b0(px)?\b/,
13+
// ml: /\b0(px)?\b/,
14+
// mx: /\b0(px)?\b/,
15+
// my: /\b0(px)?\b/,
1616
textDecorationSkipInk: /\bauto\b/,
1717
textDecorationThickness: /\bauto\b/,
1818
textDecorationStyle: /\bsolid\b/,

0 commit comments

Comments
 (0)