@pairdraw/design-jsx 0.16.2 → 0.18.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/chunks/component-properties.js +2 -2
- package/dist/chunks/effects.js +6 -1
- package/dist/chunks/effects.js.map +1 -1
- package/dist/chunks/export/index.js +4 -4
- package/dist/chunks/export/index.js.map +1 -1
- package/dist/chunks/fields.js +152 -9
- package/dist/chunks/fields.js.map +1 -1
- package/dist/chunks/index.js +3 -3
- package/dist/chunks/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/tree.d.ts +1 -1
- package/package.json +3 -3
- package/src/effects.ts +10 -2
- package/src/overrides/effects.ts +101 -12
- package/src/reference/authoring.md +1 -1
- package/src/render.ts +82 -1
- package/src/streaming/projection.ts +6 -2
|
@@ -134,9 +134,13 @@ export function projectPreview(root: SyntaxNode, source: string): JSXPreviewSnap
|
|
|
134
134
|
defer(opening, 'incomplete')
|
|
135
135
|
return null
|
|
136
136
|
}
|
|
137
|
-
|
|
137
|
+
// A Reka part such as `Switch.Root` is named by a member expression.
|
|
138
|
+
const tagName =
|
|
139
|
+
opening.getChild('JSXIdentifier') ??
|
|
140
|
+
opening.getChild('JSXBuiltin') ??
|
|
141
|
+
opening.getChild('JSXMemberExpression')
|
|
138
142
|
const fragment = raw(opening) === '<>'
|
|
139
|
-
const name = tagName ? raw(tagName) : ''
|
|
143
|
+
const name = tagName ? raw(tagName).replace(/\s+/g, '') : ''
|
|
140
144
|
const type = fragment
|
|
141
145
|
? FRAGMENT
|
|
142
146
|
: (ELEMENT_TYPES.get(name) ?? (/^[a-z][\w-]*$/.test(name) ? name : null))
|