@uniweb/kit 0.9.38 → 0.9.39
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.9.
|
|
3
|
+
"version": "0.9.39",
|
|
4
4
|
"description": "Standard component library for Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"fuse.js": "^7.0.0",
|
|
41
41
|
"shiki": "^3.0.0",
|
|
42
42
|
"tailwind-merge": "^3.6.0",
|
|
43
|
-
"@uniweb/core": "0.7.
|
|
43
|
+
"@uniweb/core": "0.7.31",
|
|
44
44
|
"@uniweb/scene": "0.1.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
@@ -170,6 +170,32 @@ function SequenceElement({ element, block }) {
|
|
|
170
170
|
)
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
case 'inset_block': {
|
|
174
|
+
// A component reference that carries block content — the block form of
|
|
175
|
+
// an inset. Children recurse; flattening them to text is what the
|
|
176
|
+
// sequence's default branch used to do, and it lost the body.
|
|
177
|
+
//
|
|
178
|
+
// Reaching this case means the container was NOT lifted — `@uniweb/core`
|
|
179
|
+
// rewrites `inset_block` to `inset_placeholder` when it builds the render
|
|
180
|
+
// graph, and the `inset` case resolves that against the foundation. This
|
|
181
|
+
// is the fallback for a document rendered without a Block behind it.
|
|
182
|
+
//
|
|
183
|
+
// kit does NOT map the name to one of its own components — see the longer
|
|
184
|
+
// note in Section/Render. A visible generic box; never a drop.
|
|
185
|
+
const body = element.children?.map((el, i) => (
|
|
186
|
+
<SequenceElement key={i} element={el} block={block} />
|
|
187
|
+
))
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<div
|
|
191
|
+
data-inset-block={element.component || 'unknown'}
|
|
192
|
+
className="border border-border rounded-md p-4 my-4"
|
|
193
|
+
>
|
|
194
|
+
{body}
|
|
195
|
+
</div>
|
|
196
|
+
)
|
|
197
|
+
}
|
|
198
|
+
|
|
173
199
|
case 'link': {
|
|
174
200
|
const { href, label, role } = element.attrs || {}
|
|
175
201
|
// Standalone links promoted from paragraphs
|
|
@@ -225,6 +225,43 @@ function RenderNode({ node, block, ...props }) {
|
|
|
225
225
|
)
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
case 'inset_block': {
|
|
229
|
+
// The block form of an inset: a fenced `@Component{params}` container
|
|
230
|
+
// whose body is real block content, recursed like a blockquote's rather
|
|
231
|
+
// than flattened to a string.
|
|
232
|
+
//
|
|
233
|
+
// NOTE: a container reaching this case means it was NOT lifted.
|
|
234
|
+
// `@uniweb/core`'s Block rewrites every `inset_block` to an
|
|
235
|
+
// `inset_placeholder` when it builds the render graph, so the normal
|
|
236
|
+
// path is the `inset_placeholder` case below — which resolves the
|
|
237
|
+
// component against the FOUNDATION. This branch is what is left for a
|
|
238
|
+
// document rendered without a Block behind it.
|
|
239
|
+
//
|
|
240
|
+
// `@Component` names foundation vocabulary, so kit must not answer for
|
|
241
|
+
// it. kit's own Details and Alert are not reachable through
|
|
242
|
+
// `getInset()` and must not become reachable here, or a foundation
|
|
243
|
+
// shipping its own Alert would be shadowed by ours. (kit still renders
|
|
244
|
+
// `details` / `alert` above — those are the editor's DOCUMENT node
|
|
245
|
+
// types, a different mechanism that happens to share a name.)
|
|
246
|
+
//
|
|
247
|
+
// So: no name dispatch. A VISIBLE generic box that keeps its body.
|
|
248
|
+
// Never a drop — an unmapped node taking its subtree with it is the
|
|
249
|
+
// failure this container exists to fix.
|
|
250
|
+
const component = attrs?.component
|
|
251
|
+
const body = content?.map((child, i) => (
|
|
252
|
+
<RenderNode key={i} node={child} block={block} />
|
|
253
|
+
))
|
|
254
|
+
|
|
255
|
+
return (
|
|
256
|
+
<div
|
|
257
|
+
data-inset-block={component || 'unknown'}
|
|
258
|
+
className="border border-border rounded-md p-4 my-4"
|
|
259
|
+
>
|
|
260
|
+
{body}
|
|
261
|
+
</div>
|
|
262
|
+
)
|
|
263
|
+
}
|
|
264
|
+
|
|
228
265
|
case 'horizontalRule':
|
|
229
266
|
case 'divider': {
|
|
230
267
|
return <Divider type={attrs?.type} className="my-6" />
|