@uniweb/kit 0.7.18 → 0.7.20
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/kit",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.20",
|
|
4
4
|
"description": "Standard component library for Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"fuse.js": "^7.0.0",
|
|
39
39
|
"shiki": "^3.0.0",
|
|
40
40
|
"tailwind-merge": "^2.6.0",
|
|
41
|
-
"@uniweb/core": "0.5.
|
|
41
|
+
"@uniweb/core": "0.5.18"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -247,7 +247,7 @@ function RenderNode({ node, block, ...props }) {
|
|
|
247
247
|
if (!insetBlock) return null
|
|
248
248
|
|
|
249
249
|
const InsetRenderer = getChildBlockRenderer()
|
|
250
|
-
return <InsetRenderer blocks={[insetBlock]}
|
|
250
|
+
return <InsetRenderer blocks={[insetBlock]} />
|
|
251
251
|
}
|
|
252
252
|
|
|
253
253
|
case 'button': {
|
|
@@ -37,7 +37,8 @@ import { getChildBlockRenderer } from "../../utils/index.js";
|
|
|
37
37
|
export function Visual({ inset, video, image, className, fallback = null }) {
|
|
38
38
|
if (inset) {
|
|
39
39
|
const Renderer = getChildBlockRenderer();
|
|
40
|
-
|
|
40
|
+
const rendered = <Renderer blocks={[inset]} />;
|
|
41
|
+
return className ? <div className={className}>{rendered}</div> : rendered;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
if (video) {
|
package/src/utils/index.js
CHANGED
|
@@ -149,15 +149,19 @@ export function getChildBlockRenderer() {
|
|
|
149
149
|
/**
|
|
150
150
|
* Renders child blocks or insets. Wrapper that defers runtime lookup to render time.
|
|
151
151
|
*
|
|
152
|
+
* By default renders each child as a bare component (no wrapper, no section chrome).
|
|
153
|
+
* Pass `wrapAs` to opt into full section treatment.
|
|
154
|
+
*
|
|
152
155
|
* @param {Object} props
|
|
153
156
|
* @param {Object} props.from - Parent block (renders block.childBlocks)
|
|
154
157
|
* @param {Array} props.blocks - Explicit array of blocks to render
|
|
158
|
+
* @param {string} [props.wrapAs] - Wrapper element tag for section treatment ('div', 'article', etc.)
|
|
155
159
|
*
|
|
156
160
|
* @example
|
|
157
161
|
* import { ChildBlocks } from '@uniweb/kit'
|
|
158
162
|
*
|
|
159
163
|
* <ChildBlocks from={block} />
|
|
160
|
-
* <ChildBlocks
|
|
164
|
+
* <ChildBlocks from={block} wrapAs="div" />
|
|
161
165
|
*/
|
|
162
166
|
export function ChildBlocks(props) {
|
|
163
167
|
const Renderer = globalThis.uniweb.childBlockRenderer
|