@bendyline/squisq 2.7.0 → 2.8.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.
@@ -9171,7 +9171,8 @@ function expandDocBlocks(blocks, options = {}) {
9171
9171
  customTemplates,
9172
9172
  failureMode = "fallback",
9173
9173
  onDiagnostic,
9174
- splitLongBlocks = true
9174
+ splitLongBlocks = true,
9175
+ mergeShortBlocks = true
9175
9176
  } = opts;
9176
9177
  const totalBlocks = blocks.length;
9177
9178
  const registry = customTemplates && customTemplates.length > 0 ? buildRegistry(customTemplates) : templateRegistry;
@@ -9325,7 +9326,7 @@ function expandDocBlocks(blocks, options = {}) {
9325
9326
  while (segmentExpandedBlocks.length > 1) {
9326
9327
  const lastBlock = segmentExpandedBlocks[segmentExpandedBlocks.length - 1];
9327
9328
  const timeFromLastToEnd = segmentEnd - lastBlock.startTime;
9328
- if (timeFromLastToEnd < MIN_TRANSITION_GAP && lastBlock.template !== "sectionHeader") {
9329
+ if (mergeShortBlocks && timeFromLastToEnd < MIN_TRANSITION_GAP && lastBlock.template !== "sectionHeader") {
9329
9330
  const prevBlock = segmentExpandedBlocks[segmentExpandedBlocks.length - 2];
9330
9331
  prevBlock.duration = segmentEnd - prevBlock.startTime;
9331
9332
  lastBlock.duration = 0;
@@ -9344,7 +9345,7 @@ function expandDocBlocks(blocks, options = {}) {
9344
9345
  onlyBlock.duration = segmentEnd - onlyBlock.startTime;
9345
9346
  }
9346
9347
  }
9347
- let changed = true;
9348
+ let changed = mergeShortBlocks;
9348
9349
  while (changed) {
9349
9350
  changed = false;
9350
9351
  for (let i = segmentExpandedBlocks.length - 1; i >= 1; i--) {
@@ -9390,7 +9391,7 @@ function expandDocBlocks(blocks, options = {}) {
9390
9391
  }
9391
9392
  }
9392
9393
  }
9393
- return expandedBlocks.filter((block) => block && block.duration > 0);
9394
+ return mergeShortBlocks ? expandedBlocks.filter((block) => block && block.duration > 0) : expandedBlocks.filter(Boolean);
9394
9395
  }
9395
9396
  function getAvailableTemplates() {
9396
9397
  return Object.keys(templateRegistry);
@@ -11078,7 +11079,9 @@ export {
11078
11079
  fallbackBlockLayers,
11079
11080
  BLOCK_MEDIA_LAYOUT_POLICIES,
11080
11081
  getBlockMediaLayoutPolicy,
11082
+ placeLayersInRect,
11081
11083
  materializeBlockLayers,
11084
+ materializeBlockLayersWithRuntime,
11082
11085
  TEMPLATE_METADATA,
11083
11086
  TEMPLATE_AUTHORING_METADATA,
11084
11087
  coverBlock,