@flowgram.ai/fixed-layout-core 1.0.2 → 1.0.6

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/index.js CHANGED
@@ -298,8 +298,18 @@ var InlineBlocksRegistry = {
298
298
  hidden: true,
299
299
  spacing: (node) => (0, import_document5.getDefaultSpacing)(node.entity, import_document5.ConstantKeys.NODE_SPACING),
300
300
  isInlineBlocks: true,
301
- inlineSpacingPre: (node) => (0, import_document5.getDefaultSpacing)(node.entity, import_document5.ConstantKeys.INLINE_BLOCKS_PADDING_TOP) || import_document5.DEFAULT_SPACING.INLINE_BLOCKS_PADDING_TOP,
302
- inlineSpacingAfter: (node) => (0, import_document5.getDefaultSpacing)(node.entity, import_document5.ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM)
301
+ inlineSpacingPre: (transform) => {
302
+ if (transform.entity.blocks.length === 0) {
303
+ return 0;
304
+ }
305
+ return (0, import_document5.getDefaultSpacing)(transform.entity, import_document5.ConstantKeys.INLINE_BLOCKS_PADDING_TOP) || import_document5.DEFAULT_SPACING.INLINE_BLOCKS_PADDING_TOP;
306
+ },
307
+ inlineSpacingAfter: (transform) => {
308
+ if (transform.entity.blocks.length === 0) {
309
+ return 0;
310
+ }
311
+ return (0, import_document5.getDefaultSpacing)(transform.entity, import_document5.ConstantKeys.INLINE_BLOCKS_PADDING_BOTTOM);
312
+ }
303
313
  },
304
314
  /**
305
315
  * 控制子分支的间距
@@ -1418,7 +1428,7 @@ var RootRegistry = {
1418
1428
  return transform.firstChild?.inputPoint || transform.bounds.topCenter;
1419
1429
  },
1420
1430
  getOutputPoint(transform) {
1421
- return transform.firstChild?.outputPoint || transform.bounds.bottomCenter;
1431
+ return transform.lastChild?.outputPoint || transform.bounds.bottomCenter;
1422
1432
  }
1423
1433
  };
1424
1434