@contember/bindx-repeater 0.1.20 → 0.1.21
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": "@contember/bindx-repeater",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Repeater components for has-many list management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"react": ">=18.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@contember/bindx": "0.1.
|
|
19
|
-
"@contember/bindx-react": "0.1.
|
|
18
|
+
"@contember/bindx": "0.1.21",
|
|
19
|
+
"@contember/bindx-react": "0.1.21"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
@@ -218,14 +218,7 @@ blockRepeaterWithSelection.getSelection = (
|
|
|
218
218
|
const scope = new SelectionScope()
|
|
219
219
|
const collectorEntity = createCollectorProxy<unknown>(scope)
|
|
220
220
|
|
|
221
|
-
// Collect block render/form JSX so the collector proxy records field accesses.
|
|
222
|
-
// Done inside mockItems.map callback to survive Rolldown dead-code elimination
|
|
223
|
-
// (the callback is invoked by props.children which Rolldown cannot analyze).
|
|
224
221
|
const blockJsx: ReactNode[] = []
|
|
225
|
-
for (const blockDef of Object.values(props.blocks) as BlockDefinition[]) {
|
|
226
|
-
if (blockDef.render) blockJsx.push(blockDef.render(collectorEntity as EntityAccessor<object>))
|
|
227
|
-
if (blockDef.form) blockJsx.push(blockDef.form(collectorEntity as EntityAccessor<object>))
|
|
228
|
-
}
|
|
229
222
|
|
|
230
223
|
const mockItems: BlockRepeaterItems<unknown> = {
|
|
231
224
|
map: (fn) => {
|
|
@@ -239,6 +232,13 @@ blockRepeaterWithSelection.getSelection = (
|
|
|
239
232
|
blockType: null,
|
|
240
233
|
block: undefined,
|
|
241
234
|
})
|
|
235
|
+
// Call block render/form functions inside the map callback so the
|
|
236
|
+
// collector proxy records field accesses. This code must execute inside
|
|
237
|
+
// a callback passed through props.children() to survive Rolldown DCE.
|
|
238
|
+
for (const blockDef of Object.values(props.blocks) as BlockDefinition[]) {
|
|
239
|
+
if (blockDef.render) blockJsx.push(blockDef.render(collectorEntity as EntityAccessor<object>))
|
|
240
|
+
if (blockDef.form) blockJsx.push(blockDef.form(collectorEntity as EntityAccessor<object>))
|
|
241
|
+
}
|
|
242
242
|
return []
|
|
243
243
|
},
|
|
244
244
|
length: 0,
|