@bendyline/squisq-react 2.11.25 → 2.12.1

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.
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-T7NVETOH.js";
9
9
  import {
10
10
  BlockRenderer
11
- } from "./chunk-TN3NQAFM.js";
11
+ } from "./chunk-XSSIHHDY.js";
12
12
  import {
13
13
  useMediaUrl
14
14
  } from "./chunk-HCKL2AFN.js";
@@ -665,7 +665,7 @@ function RichTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
665
665
  const target = event.target;
666
666
  if (target?.closest?.("[data-squisq-table-scroll]")) event.stopPropagation();
667
667
  };
668
- const scopedCss = `.${cls}{margin:0}.${cls} p{margin:0 0 .4em}.${cls} h1,.${cls} h2,.${cls} h3,.${cls} h4,.${cls} h5,.${cls} h6{margin:0 0 .3em;line-height:1.2}.${cls} ul,.${cls} ol{margin:0 0 .7em;padding-left:1.2em;list-style-position:${listStylePosition}}.${cls} li{margin:0}.${cls} li>p{display:inline;margin:0}.${cls} [data-squisq-table-scroll]{width:100%;max-height:20em;margin:.35em 0;overflow:auto;overscroll-behavior:contain;box-sizing:border-box}.${cls} table{width:100%;min-width:48em;margin:0;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:.76em;line-height:1.2}.${cls} th,.${cls} td{box-sizing:border-box;padding:.28em .45em;border:1px solid rgba(127,127,127,.55);border-color:color-mix(in srgb,currentColor 32%,transparent);vertical-align:top;white-space:normal;overflow-wrap:anywhere}.${cls} th{position:sticky;top:0;z-index:1;background:rgba(127,127,127,.16);background:color-mix(in srgb,currentColor 12%,transparent);font-weight:600}.${cls} tbody tr:nth-child(even){background:rgba(127,127,127,.07);background:color-mix(in srgb,currentColor 5%,transparent)}.${cls} *:first-child{margin-top:0}.${cls} *:last-child{margin-bottom:0}.${cls} a{color:inherit;text-decoration:underline}`;
668
+ const scopedCss = `.${cls}{margin:0}.${cls} p{margin:0 0 .4em}.${cls} h1,.${cls} h2,.${cls} h3,.${cls} h4,.${cls} h5,.${cls} h6{margin:0 0 .3em;line-height:1.2}.${cls} ul,.${cls} ol{margin:0 0 .7em;padding-left:1.2em;list-style-position:${listStylePosition}}.${cls} li{margin:0}.${cls} li[data-squisq-build-item]{list-style:none}.${cls} [data-squisq-build-row]{display:flex;gap:.35em}.${cls} [data-squisq-build-row]>span{flex:0 0 1.4em;text-align:right;margin-left:-1.75em}.${cls} [data-squisq-build-row]>div{min-width:0;flex:1}.${cls} li>p{display:inline;margin:0}.${cls} [data-squisq-table-scroll]{width:100%;max-height:20em;margin:.35em 0;overflow:auto;overscroll-behavior:contain;box-sizing:border-box}.${cls} table{width:100%;min-width:48em;margin:0;border-collapse:separate;border-spacing:0;table-layout:fixed;font-size:.76em;line-height:1.2}.${cls} th,.${cls} td{box-sizing:border-box;padding:.28em .45em;border:1px solid rgba(127,127,127,.55);border-color:color-mix(in srgb,currentColor 32%,transparent);vertical-align:top;white-space:normal;overflow-wrap:anywhere}.${cls} th{position:sticky;top:0;z-index:1;background:rgba(127,127,127,.16);background:color-mix(in srgb,currentColor 12%,transparent);font-weight:600}.${cls} tbody tr:nth-child(even){background:rgba(127,127,127,.07);background:color-mix(in srgb,currentColor 5%,transparent)}.${cls} *:first-child{margin-top:0}.${cls} *:last-child{margin-bottom:0}.${cls} a{color:inherit;text-decoration:underline}`;
669
669
  return /* @__PURE__ */ jsx3(
670
670
  "g",
671
671
  {
@@ -534,6 +534,7 @@ function useAudioSync(audioRef, track, basePath = "", enabled = true, mode = "me
534
534
  }
535
535
 
536
536
  // src/hooks/useDocPlayback.ts
537
+ import { resolveDocBuildTiming } from "@bendyline/squisq/doc";
537
538
  import { useMemo as useMemo4, useCallback as useCallback2, useRef as useRef2 } from "react";
538
539
  import { resolveMotionForDoc } from "@bendyline/squisq/schemas";
539
540
  import {
@@ -732,25 +733,13 @@ function useDocPlayback(script, currentTime, options = {}) {
732
733
  // resolve through the user's design.
733
734
  customTemplates: script.customTemplates
734
735
  });
735
- return expanded;
736
+ return resolveDocBuildTiming(script, expanded);
736
737
  }
737
738
  return flatBlocks.map((block, index) => {
738
739
  const transition = resolveBlockTransition(block, resolvedTheme, index);
739
740
  return transition !== block.transition ? { ...block, transition } : block;
740
741
  });
741
- }, [
742
- script?.blocks,
743
- script?.audio?.segments,
744
- script?.persistentLayers,
745
- script?.customTemplates,
746
- script?.motion,
747
- script?.frontmatter,
748
- motionOverride,
749
- mediaAspectRatios,
750
- viewport,
751
- theme,
752
- useAudioSegmentTiming
753
- ]);
742
+ }, [script, motionOverride, mediaAspectRatios, viewport, theme, useAudioSegmentTiming]);
754
743
  const currentBlock = useMemo4(() => getBlockAtTime(blocks, currentTime), [blocks, currentTime]);
755
744
  const currentBlockIndex = useMemo4(
756
745
  () => currentBlock ? blocks.indexOf(currentBlock) : -1,