@bendyline/squisq-editor-react 2.13.15 → 2.13.17

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.
@@ -19,7 +19,7 @@ import {
19
19
  useDictationState,
20
20
  useEditorContext,
21
21
  useEditorContextOptional
22
- } from "./chunk-UQUYPT5P.js";
22
+ } from "./chunk-EJNCUVPU.js";
23
23
  import {
24
24
  monacoLanguageRequestKey,
25
25
  monacoLanguagesForDocument,
@@ -46,13 +46,12 @@ import {
46
46
  ShapePalette
47
47
  } from "./chunk-HLU6ZBS7.js";
48
48
  import {
49
- BlockThumbnail,
50
49
  RecorderPanel,
51
50
  buildPreviewDoc,
52
51
  documentTitleFromFileName,
53
52
  resolveBlockVisual,
54
53
  useModalDialog
55
- } from "./chunk-FOKUOC7E.js";
54
+ } from "./chunk-ECS2FFXA.js";
56
55
  import {
57
56
  Icon
58
57
  } from "./chunk-UYB5CPRE.js";
@@ -30620,7 +30619,7 @@ async function ingestSidecarBytes(bytes, ext, params2) {
30620
30619
 
30621
30620
  // src/blockTagActivity.ts
30622
30621
  import { Extension as Extension11 } from "@tiptap/core";
30623
- import { Plugin as Plugin11, PluginKey as PluginKey11 } from "@tiptap/pm/state";
30622
+ import { Plugin as Plugin11, PluginKey as PluginKey11, TextSelection as TextSelection3 } from "@tiptap/pm/state";
30624
30623
  import { Decoration as Decoration10, DecorationSet as DecorationSet10 } from "@tiptap/pm/view";
30625
30624
  var BLOCK_TAG_SELECTED_CLASS = "squisq-block-tags--selected";
30626
30625
  var BLOCK_TAG_HOVERED_CLASS = "squisq-block-tags--hovered";
@@ -30720,11 +30719,44 @@ function headingPositionForTarget(view, target, clientY) {
30720
30719
  return null;
30721
30720
  }
30722
30721
  }
30722
+ function isEditableDomPosition(view, node2) {
30723
+ const element = node2.nodeType === Node.ELEMENT_NODE ? node2 : node2.parentElement;
30724
+ if (!element || !view.dom.contains(element)) return false;
30725
+ const island = element.closest('[contenteditable="false"]');
30726
+ return !island || !view.dom.contains(island);
30727
+ }
30728
+ function withPendingDomSelection(view, transaction) {
30729
+ const { selection } = view.state;
30730
+ if (view.composing || !view.hasFocus() || !(selection instanceof TextSelection3)) {
30731
+ return transaction;
30732
+ }
30733
+ const domSelection = view.dom.ownerDocument.getSelection();
30734
+ const anchorNode = domSelection?.anchorNode;
30735
+ const focusNode = domSelection?.focusNode;
30736
+ if (!domSelection || !anchorNode || !focusNode) return transaction;
30737
+ if (!isEditableDomPosition(view, anchorNode) || !isEditableDomPosition(view, focusNode)) {
30738
+ return transaction;
30739
+ }
30740
+ let anchor;
30741
+ let head;
30742
+ try {
30743
+ anchor = view.posAtDOM(anchorNode, domSelection.anchorOffset);
30744
+ head = view.posAtDOM(focusNode, domSelection.focusOffset);
30745
+ } catch {
30746
+ return transaction;
30747
+ }
30748
+ if (anchor === selection.anchor && head === selection.head) return transaction;
30749
+ const { doc } = transaction;
30750
+ return transaction.setSelection(TextSelection3.between(doc.resolve(anchor), doc.resolve(head)));
30751
+ }
30723
30752
  function setHoveredPosition(view, hoveredPosition) {
30724
30753
  const current = BLOCK_TAG_ACTIVITY_KEY.getState(view.state)?.hoveredPosition ?? null;
30725
30754
  if (current === hoveredPosition) return;
30726
30755
  view.dispatch(
30727
- view.state.tr.setMeta(BLOCK_TAG_ACTIVITY_KEY, { hoveredPosition }).setMeta("addToHistory", false)
30756
+ withPendingDomSelection(
30757
+ view,
30758
+ view.state.tr.setMeta(BLOCK_TAG_ACTIVITY_KEY, { hoveredPosition }).setMeta("addToHistory", false)
30759
+ )
30728
30760
  );
30729
30761
  }
30730
30762
  var BlockTagActivityExtension = Extension11.create({
@@ -31772,7 +31804,7 @@ import { videoEmbedIframeAttributes } from "@bendyline/squisq/markdown";
31772
31804
 
31773
31805
  // src/documentTray/DocumentTrayExtension.ts
31774
31806
  import { Extension as Extension13 } from "@tiptap/core";
31775
- import { NodeSelection as NodeSelection2, Plugin as Plugin13, PluginKey as PluginKey13, Selection, TextSelection as TextSelection3 } from "@tiptap/pm/state";
31807
+ import { NodeSelection as NodeSelection2, Plugin as Plugin13, PluginKey as PluginKey13, Selection, TextSelection as TextSelection4 } from "@tiptap/pm/state";
31776
31808
  import { Decoration as Decoration12, DecorationSet as DecorationSet12 } from "@tiptap/pm/view";
31777
31809
 
31778
31810
  // src/documentTray/documentTrayMedia.ts
@@ -31871,7 +31903,7 @@ function rangeInTray(state, from, to) {
31871
31903
  function startBody(state) {
31872
31904
  const pos = state.doc.content.size;
31873
31905
  const tr = state.tr.insert(pos, state.schema.nodes.paragraph.create());
31874
- return tr.setSelection(TextSelection3.create(tr.doc, pos + 1));
31906
+ return tr.setSelection(TextSelection4.create(tr.doc, pos + 1));
31875
31907
  }
31876
31908
  function buildState2(doc, enabled, prev, tr) {
31877
31909
  let seq = prev?.seq ?? 0;
@@ -32116,7 +32148,7 @@ var VideoEmbedExtension = Extension14.create({
32116
32148
  });
32117
32149
 
32118
32150
  // src/videoEmbed/videoEmbedPaste.ts
32119
- import { TextSelection as TextSelection4 } from "@tiptap/pm/state";
32151
+ import { TextSelection as TextSelection5 } from "@tiptap/pm/state";
32120
32152
  import { parseVideoEmbedInput as parseVideoEmbedInput3 } from "@bendyline/squisq/markdown";
32121
32153
  function looksLikeEmbedCode(text) {
32122
32154
  return /^<(?!https?:)/i.test(text) && /<iframe\b/i.test(text);
@@ -32138,7 +32170,7 @@ function insertTopLevelBlock(state, node2) {
32138
32170
  tr.insert(start, node2);
32139
32171
  }
32140
32172
  }
32141
- tr.setSelection(TextSelection4.near(tr.doc.resolve(start + node2.nodeSize - 1), -1));
32173
+ tr.setSelection(TextSelection5.near(tr.doc.resolve(start + node2.nodeSize - 1), -1));
32142
32174
  return tr.scrollIntoView();
32143
32175
  }
32144
32176
  function pasteVideoEmbedCode(view, text) {
@@ -34554,7 +34586,7 @@ function persistFromWrite(bodyMd, state) {
34554
34586
  import { useCallback as useCallback43, useEffect as useEffect56, useMemo as useMemo42, useRef as useRef51, useState as useState67 } from "react";
34555
34587
  import { useEditor as useEditor2, EditorContent as EditorContent2 } from "@tiptap/react";
34556
34588
  import { Selection as Selection2 } from "@tiptap/pm/state";
34557
- import { Extension as Extension18, getHTMLFromFragment } from "@tiptap/core";
34589
+ import { Extension as Extension18 } from "@tiptap/core";
34558
34590
  import StarterKit2 from "@tiptap/starter-kit";
34559
34591
  import Table from "@tiptap/extension-table";
34560
34592
  import TableRow from "@tiptap/extension-table-row";
@@ -35732,7 +35764,7 @@ function startNarrationTimingJob(input) {
35732
35764
  else jobs.delete(input.src);
35733
35765
  notify();
35734
35766
  };
35735
- import("./narrationTimingsFromAudio-ICMDSWPI.js").then(
35767
+ import("./narrationTimingsFromAudio-O67QKISS.js").then(
35736
35768
  ({ updateNarrationTimingsFromAudio }) => updateNarrationTimingsFromAudio({
35737
35769
  ...input,
35738
35770
  signal: job.abort.signal,
@@ -36270,6 +36302,30 @@ function preserveSource(baseline, edited) {
36270
36302
  return out.join("\n");
36271
36303
  }
36272
36304
 
36305
+ // src/documentHtml.ts
36306
+ import { getHTMLFromFragment } from "@tiptap/core";
36307
+ import { Fragment as Fragment25 } from "@tiptap/pm/model";
36308
+ function createDocumentHtmlSerializer() {
36309
+ const cache2 = /* @__PURE__ */ new WeakMap();
36310
+ return (doc) => {
36311
+ let hasBlockMarks = false;
36312
+ doc.forEach((node2) => {
36313
+ hasBlockMarks || (hasBlockMarks = node2.marks.length > 0);
36314
+ });
36315
+ if (hasBlockMarks) return getHTMLFromFragment(doc.content, doc.type.schema);
36316
+ const parts = [];
36317
+ doc.forEach((node2) => {
36318
+ let html = cache2.get(node2);
36319
+ if (html === void 0) {
36320
+ html = getHTMLFromFragment(Fragment25.from(node2), doc.type.schema);
36321
+ cache2.set(node2, html);
36322
+ }
36323
+ parts.push(html);
36324
+ });
36325
+ return parts.join("");
36326
+ };
36327
+ }
36328
+
36273
36329
  // src/MentionExtension.tsx
36274
36330
  import Mention from "@tiptap/extension-mention";
36275
36331
  import { PluginKey as PluginKey18 } from "@tiptap/pm/state";
@@ -36750,6 +36806,7 @@ function WysiwygEditor({
36750
36806
  const isExternalUpdate = useRef51(false);
36751
36807
  const externalApplyPendingRef = useRef51(false);
36752
36808
  const lastSourceRef = useRef51(editorSource);
36809
+ const serializeHtml = useMemo42(createDocumentHtmlSerializer, []);
36753
36810
  const sourceLayoutRef = useRef51(layoutMode);
36754
36811
  const pendingLocalSourcesRef = useRef51([]);
36755
36812
  const mediaProviderRef = useRef51(mediaProvider);
@@ -36899,12 +36956,12 @@ function WysiwygEditor({
36899
36956
  if (!transaction.docChanged) return;
36900
36957
  if (isExternalUpdate.current || externalApplyPendingRef.current) return;
36901
36958
  const serialize = (html) => persistFromWrite(tiptapToMarkdown(html), wrapStateRef.current);
36902
- let bodyMd = serialize(ed.getHTML());
36959
+ let bodyMd = serialize(serializeHtml(ed.state.doc));
36903
36960
  const loaded = loadedSourceRef.current;
36904
36961
  if (loaded) {
36905
36962
  loaded.baseline ?? (loaded.baseline = createSourceBaseline(
36906
36963
  loaded.body,
36907
- serialize(getHTMLFromFragment(transaction.before.content, ed.schema))
36964
+ serialize(serializeHtml(transaction.before))
36908
36965
  ));
36909
36966
  bodyMd = preserveSource(loaded.baseline, bodyMd);
36910
36967
  }
@@ -37489,7 +37546,7 @@ function insertDroppedMedia(view, event, point, mediaProvider, onMediaUploaded)
37489
37546
  }
37490
37547
 
37491
37548
  // src/InlinePreviewGutter.tsx
37492
- import { useLayoutEffect as useLayoutEffect13, useMemo as useMemo45, useRef as useRef52, useState as useState70 } from "react";
37549
+ import { useEffect as useEffect59, useLayoutEffect as useLayoutEffect13, useMemo as useMemo45, useRef as useRef52, useState as useState70 } from "react";
37493
37550
  import { VIEWPORT_PRESETS as VIEWPORT_PRESETS5 } from "@bendyline/squisq/schemas";
37494
37551
  import { BlockRenderer as BlockRenderer3, MediaContext as MediaContext4 } from "@bendyline/squisq-react";
37495
37552
 
@@ -37804,7 +37861,7 @@ function usePreviewProjection(doc, transformStyle, workspaceContainer, documentT
37804
37861
  }
37805
37862
 
37806
37863
  // src/useBlockPreviewItems.ts
37807
- function useBlockPreviewItems(viewport) {
37864
+ function useBlockPreviewItems(viewport, visibleIds) {
37808
37865
  const { doc, workspaceContainer, fileName, mediaRevision } = useEditorContext();
37809
37866
  const projection = usePreviewProjection(doc, "", workspaceContainer, fileName, mediaRevision);
37810
37867
  const previewDoc = projection?.contentDoc ?? doc;
@@ -37815,25 +37872,26 @@ function useBlockPreviewItems(viewport) {
37815
37872
  const flat = flattenRenderableBlocks(previewDoc.blocks);
37816
37873
  const result = [];
37817
37874
  flat.forEach((block, index2) => {
37818
- const visual = resolveBlockVisual(previewDoc, block, activeTheme, viewport, {
37875
+ const shouldResolve = visibleIds == null || visibleIds.has(block.id);
37876
+ const visual = shouldResolve ? resolveBlockVisual(previewDoc, block, activeTheme, viewport, {
37819
37877
  blockIndex: index2,
37820
37878
  totalBlocks: flat.length
37821
- });
37822
- if (!visual) return;
37879
+ }) : null;
37880
+ if (visibleIds == null && !visual) return;
37823
37881
  result.push({
37824
37882
  id: block.id,
37825
- template: visual.template ?? "content",
37883
+ template: visual?.template ?? block.template ?? "content",
37826
37884
  headingText: block.sourceHeading ? extractPlainText3(block.sourceHeading) : "",
37827
37885
  block: visual,
37828
37886
  sourceBlock: block
37829
37887
  });
37830
37888
  });
37831
37889
  return result;
37832
- }, [previewDoc, viewport, activeTheme]);
37890
+ }, [previewDoc, viewport, activeTheme, visibleIds]);
37833
37891
  }
37834
37892
 
37835
37893
  // src/InlinePreviewGutter.tsx
37836
- import { Fragment as Fragment25, jsx as jsx73, jsxs as jsxs59 } from "react/jsx-runtime";
37894
+ import { Fragment as Fragment26, jsx as jsx73, jsxs as jsxs59 } from "react/jsx-runtime";
37837
37895
  var BAR_RIGHT_OFFSET = 14;
37838
37896
  var CARD_LABEL_OFFSET = 16;
37839
37897
  var EXTENT_TOP_PAD = CARD_LABEL_OFFSET;
@@ -37848,13 +37906,56 @@ function InlinePreviewGutter({
37848
37906
  }) {
37849
37907
  const gutterRef = useRef52(null);
37850
37908
  const { entries: headingEntries, scrollToBlock } = useHeadingLayout(gutterRef);
37851
- const items = useBlockPreviewItems(viewport);
37909
+ const [visibleCards, setVisibleCards] = useState70(
37910
+ () => typeof IntersectionObserver === "undefined" ? null : /* @__PURE__ */ new Set()
37911
+ );
37912
+ const items = useBlockPreviewItems(viewport, visibleCards);
37852
37913
  const connectorTops = useMemo45(() => {
37853
37914
  const m = /* @__PURE__ */ new Map();
37854
37915
  headingEntries.forEach((e2) => m.set(e2.block.id, e2.top));
37855
37916
  return m;
37856
37917
  }, [headingEntries]);
37857
37918
  const [positions, setPositions] = useState70(/* @__PURE__ */ new Map());
37919
+ const itemIds = items.map((item) => item.id).join("\0");
37920
+ useEffect59(() => {
37921
+ const gutter = gutterRef.current;
37922
+ if (!gutter || typeof IntersectionObserver === "undefined") return;
37923
+ let active = true;
37924
+ const cards = [...gutter.querySelectorAll(".squisq-inline-preview-card")].filter(
37925
+ (card) => positions.has(card.dataset.previewId ?? "")
37926
+ );
37927
+ const ids = new Set(cards.map((card) => card.dataset.previewId));
37928
+ setVisibleCards((previous) => {
37929
+ if (previous === null || [...previous].every((id) => ids.has(id))) return previous;
37930
+ return new Set([...previous].filter((id) => ids.has(id)));
37931
+ });
37932
+ const observer = new IntersectionObserver(
37933
+ (entries) => {
37934
+ if (!active) return;
37935
+ setVisibleCards((previous) => {
37936
+ const next = new Set(previous);
37937
+ for (const entry of entries) {
37938
+ const id = entry.target.dataset.previewId;
37939
+ if (!id) continue;
37940
+ if (entry.isIntersecting) next.add(id);
37941
+ else next.delete(id);
37942
+ }
37943
+ if (previous?.size === next.size && [...next].every((id) => previous.has(id))) {
37944
+ return previous;
37945
+ }
37946
+ return next;
37947
+ });
37948
+ },
37949
+ { root: gutter, rootMargin: "320px 0px" }
37950
+ );
37951
+ for (const card of cards) {
37952
+ observer.observe(card);
37953
+ }
37954
+ return () => {
37955
+ active = false;
37956
+ observer.disconnect();
37957
+ };
37958
+ }, [itemIds, positions]);
37858
37959
  useLayoutEffect13(() => {
37859
37960
  if (items.length === 0) {
37860
37961
  setPositions((prev) => prev.size === 0 ? prev : /* @__PURE__ */ new Map());
@@ -37891,156 +37992,170 @@ function InlinePreviewGutter({
37891
37992
  return next;
37892
37993
  });
37893
37994
  }, [items, connectorTops]);
37894
- const isEmpty2 = items.length === 0;
37895
- if (isEmpty2) return null;
37896
- const totalWidth = width + connectorWidth;
37897
- const gutterStyle = {
37898
- position: "relative",
37899
- width: `${totalWidth}px`,
37900
- flex: `0 0 ${totalWidth}px`,
37901
- overflow: "hidden"
37902
- };
37903
- return /* @__PURE__ */ jsxs59(
37904
- "aside",
37905
- {
37906
- ref: gutterRef,
37907
- className: `squisq-inline-preview-gutter ${className ?? ""}`,
37908
- style: gutterStyle,
37909
- "data-testid": "inline-preview-gutter",
37910
- "aria-label": "Block previews",
37911
- children: [
37912
- headingEntries.length > 0 && /* @__PURE__ */ jsx73(
37913
- "div",
37914
- {
37915
- className: "squisq-inline-preview-connectors",
37916
- "aria-hidden": "true",
37917
- style: {
37918
- position: "absolute",
37919
- top: 0,
37920
- left: 0,
37921
- width: connectorWidth,
37922
- height: "100%",
37923
- overflow: "hidden",
37924
- pointerEvents: "none"
37925
- },
37926
- children: headingEntries.map((ex, i) => {
37927
- const EXTENT_GAP = 6;
37928
- const height = Math.max(2, ex.bottom - ex.top - EXTENT_GAP);
37929
- return /* @__PURE__ */ jsx73(
37930
- "div",
37931
- {
37932
- className: `squisq-inline-preview-extent${ex.annotated ? "" : " squisq-inline-preview-extent--untagged"}`,
37933
- style: {
37934
- position: "absolute",
37935
- top: `${ex.top}px`,
37936
- height: `${height}px`,
37937
- right: `${BAR_RIGHT_OFFSET}px`
37938
- }
37939
- },
37940
- `h-${i}-${ex.block.id}`
37941
- );
37942
- })
37943
- }
37944
- ),
37945
- items.length > 0 && /* @__PURE__ */ jsx73(
37946
- "svg",
37947
- {
37948
- className: "squisq-inline-preview-connector-svg",
37949
- "aria-hidden": "true",
37950
- style: {
37951
- position: "absolute",
37952
- top: 0,
37953
- left: 0,
37954
- width: connectorWidth + CARD_LEFT_INSET,
37955
- height: "100%",
37956
- pointerEvents: "none",
37957
- overflow: "visible"
37958
- },
37959
- children: items.map((item) => {
37960
- const headingTop = connectorTops.get(item.id);
37961
- const cardTop = positions.get(item.id);
37962
- if (headingTop == null || cardTop == null) return null;
37963
- const x1 = connectorWidth - BAR_RIGHT_OFFSET - 2;
37964
- const y1 = headingTop + EXTENT_TOP_PAD;
37965
- const x2 = connectorWidth + CARD_LEFT_INSET;
37966
- const y2 = cardTop + CARD_LABEL_OFFSET;
37967
- return /* @__PURE__ */ jsxs59("g", { children: [
37968
- /* @__PURE__ */ jsx73(
37969
- "line",
37970
- {
37971
- x1,
37972
- y1,
37973
- x2,
37974
- y2,
37975
- stroke: "#6366f1",
37976
- strokeWidth: "2",
37977
- strokeLinecap: "round"
37978
- }
37979
- ),
37980
- /* @__PURE__ */ jsx73("circle", { cx: x1, cy: y1, r: "4", fill: "#6366f1", stroke: "#ffffff", strokeWidth: "2" }),
37981
- /* @__PURE__ */ jsx73("circle", { cx: x2, cy: y2, r: "4", fill: "#6366f1", stroke: "#ffffff", strokeWidth: "2" })
37982
- ] }, item.id);
37983
- })
37984
- }
37985
- ),
37986
- /* @__PURE__ */ jsx73(MediaContext4.Provider, { value: mediaProvider ?? null, children: items.map((item) => {
37987
- const top = positions.get(item.id);
37988
- const hidden = top == null;
37989
- return /* @__PURE__ */ jsxs59(
37995
+ return useMemo45(() => {
37996
+ if (items.length === 0) return null;
37997
+ const totalWidth = width + connectorWidth;
37998
+ const gutterStyle = {
37999
+ position: "relative",
38000
+ width: `${totalWidth}px`,
38001
+ flex: `0 0 ${totalWidth}px`,
38002
+ overflow: "hidden"
38003
+ };
38004
+ return /* @__PURE__ */ jsxs59(
38005
+ "aside",
38006
+ {
38007
+ ref: gutterRef,
38008
+ className: `squisq-inline-preview-gutter ${className ?? ""}`,
38009
+ style: gutterStyle,
38010
+ "data-testid": "inline-preview-gutter",
38011
+ "aria-label": "Block previews",
38012
+ children: [
38013
+ headingEntries.length > 0 && /* @__PURE__ */ jsx73(
37990
38014
  "div",
37991
38015
  {
37992
- className: "squisq-inline-preview-card",
37993
- "data-template": item.template,
38016
+ className: "squisq-inline-preview-connectors",
38017
+ "aria-hidden": "true",
37994
38018
  style: {
37995
38019
  position: "absolute",
37996
- top: `${top ?? 0}px`,
37997
- left: connectorWidth + CARD_LEFT_INSET,
37998
- right: 12,
37999
- visibility: hidden ? "hidden" : "visible"
38020
+ top: 0,
38021
+ left: 0,
38022
+ width: connectorWidth,
38023
+ height: "100%",
38024
+ overflow: "hidden",
38025
+ pointerEvents: "none"
38000
38026
  },
38001
- onClick: () => scrollToBlock(item.sourceBlock),
38002
- children: [
38003
- /* @__PURE__ */ jsxs59("div", { className: "squisq-inline-preview-card-label", children: [
38004
- /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-template", children: templateLabel(item.template) }),
38005
- item.headingText && /* @__PURE__ */ jsxs59(Fragment25, { children: [
38006
- /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-sep", children: "\u2014" }),
38007
- /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-title", children: item.headingText })
38008
- ] })
38009
- ] }),
38010
- /* @__PURE__ */ jsx73(
38027
+ children: headingEntries.map((ex, i) => {
38028
+ const EXTENT_GAP = 6;
38029
+ const height = Math.max(2, ex.bottom - ex.top - EXTENT_GAP);
38030
+ return /* @__PURE__ */ jsx73(
38011
38031
  "div",
38012
38032
  {
38013
- className: "squisq-inline-preview-card-svg",
38033
+ className: `squisq-inline-preview-extent${ex.annotated ? "" : " squisq-inline-preview-extent--untagged"}`,
38014
38034
  style: {
38015
- aspectRatio: `${viewport.width} / ${viewport.height}`
38016
- },
38017
- children: /* @__PURE__ */ jsx73(
38018
- BlockRenderer3,
38019
- {
38020
- block: item.block,
38021
- buildPlayback: "all",
38022
- blockTime: 0,
38023
- basePath,
38024
- viewport
38025
- }
38026
- )
38027
- }
38028
- )
38029
- ]
38030
- },
38031
- item.id
38032
- );
38033
- }) })
38034
- ]
38035
- }
38036
- );
38035
+ position: "absolute",
38036
+ top: `${ex.top}px`,
38037
+ height: `${height}px`,
38038
+ right: `${BAR_RIGHT_OFFSET}px`
38039
+ }
38040
+ },
38041
+ `h-${i}-${ex.block.id}`
38042
+ );
38043
+ })
38044
+ }
38045
+ ),
38046
+ items.length > 0 && /* @__PURE__ */ jsx73(
38047
+ "svg",
38048
+ {
38049
+ className: "squisq-inline-preview-connector-svg",
38050
+ "aria-hidden": "true",
38051
+ style: {
38052
+ position: "absolute",
38053
+ top: 0,
38054
+ left: 0,
38055
+ width: connectorWidth + CARD_LEFT_INSET,
38056
+ height: "100%",
38057
+ pointerEvents: "none",
38058
+ overflow: "visible"
38059
+ },
38060
+ children: items.map((item) => {
38061
+ const headingTop = connectorTops.get(item.id);
38062
+ const cardTop = positions.get(item.id);
38063
+ if (headingTop == null || cardTop == null) return null;
38064
+ const x1 = connectorWidth - BAR_RIGHT_OFFSET - 2;
38065
+ const y1 = headingTop + EXTENT_TOP_PAD;
38066
+ const x2 = connectorWidth + CARD_LEFT_INSET;
38067
+ const y2 = cardTop + CARD_LABEL_OFFSET;
38068
+ return /* @__PURE__ */ jsxs59("g", { children: [
38069
+ /* @__PURE__ */ jsx73(
38070
+ "line",
38071
+ {
38072
+ x1,
38073
+ y1,
38074
+ x2,
38075
+ y2,
38076
+ stroke: "#6366f1",
38077
+ strokeWidth: "2",
38078
+ strokeLinecap: "round"
38079
+ }
38080
+ ),
38081
+ /* @__PURE__ */ jsx73("circle", { cx: x1, cy: y1, r: "4", fill: "#6366f1", stroke: "#ffffff", strokeWidth: "2" }),
38082
+ /* @__PURE__ */ jsx73("circle", { cx: x2, cy: y2, r: "4", fill: "#6366f1", stroke: "#ffffff", strokeWidth: "2" })
38083
+ ] }, item.id);
38084
+ })
38085
+ }
38086
+ ),
38087
+ /* @__PURE__ */ jsx73(MediaContext4.Provider, { value: mediaProvider ?? null, children: items.map((item) => {
38088
+ const top = positions.get(item.id);
38089
+ const hidden = top == null;
38090
+ return /* @__PURE__ */ jsxs59(
38091
+ "div",
38092
+ {
38093
+ className: "squisq-inline-preview-card",
38094
+ "data-template": item.template,
38095
+ "data-preview-id": item.id,
38096
+ style: {
38097
+ position: "absolute",
38098
+ top: `${top ?? 0}px`,
38099
+ left: connectorWidth + CARD_LEFT_INSET,
38100
+ right: 12,
38101
+ visibility: hidden ? "hidden" : "visible"
38102
+ },
38103
+ onClick: () => scrollToBlock(item.sourceBlock),
38104
+ children: [
38105
+ /* @__PURE__ */ jsxs59("div", { className: "squisq-inline-preview-card-label", children: [
38106
+ /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-template", children: templateLabel(item.template) }),
38107
+ item.headingText && /* @__PURE__ */ jsxs59(Fragment26, { children: [
38108
+ /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-sep", children: "\u2014" }),
38109
+ /* @__PURE__ */ jsx73("span", { className: "squisq-inline-preview-card-title", children: item.headingText })
38110
+ ] })
38111
+ ] }),
38112
+ /* @__PURE__ */ jsx73(
38113
+ "div",
38114
+ {
38115
+ className: "squisq-inline-preview-card-svg",
38116
+ style: {
38117
+ aspectRatio: `${viewport.width} / ${viewport.height}`
38118
+ },
38119
+ children: item.block && /* @__PURE__ */ jsx73(
38120
+ BlockRenderer3,
38121
+ {
38122
+ block: item.block,
38123
+ buildPlayback: "all",
38124
+ blockTime: 0,
38125
+ basePath,
38126
+ viewport
38127
+ }
38128
+ )
38129
+ }
38130
+ )
38131
+ ]
38132
+ },
38133
+ item.id
38134
+ );
38135
+ }) })
38136
+ ]
38137
+ }
38138
+ );
38139
+ }, [
38140
+ items,
38141
+ width,
38142
+ connectorWidth,
38143
+ className,
38144
+ headingEntries,
38145
+ connectorTops,
38146
+ positions,
38147
+ mediaProvider,
38148
+ scrollToBlock,
38149
+ viewport,
38150
+ basePath
38151
+ ]);
38037
38152
  }
38038
38153
 
38039
38154
  // src/OutlinePanel.tsx
38040
38155
  import {
38041
38156
  memo,
38042
38157
  useCallback as useCallback45,
38043
- useEffect as useEffect59,
38158
+ useEffect as useEffect60,
38044
38159
  useMemo as useMemo46,
38045
38160
  useRef as useRef53,
38046
38161
  useState as useState71
@@ -38513,10 +38628,10 @@ function useActiveOutlineBlockId() {
38513
38628
  flatBlocksRef.current = flatBlocks;
38514
38629
  const headingLocations = flatBlocks.map((block) => `${block.id}:${block.sourceHeading?.position?.start.line ?? ""}`).join("\0");
38515
38630
  const [activeId, setActiveId] = useState71(null);
38516
- useEffect59(() => {
38631
+ useEffect60(() => {
38517
38632
  setActiveId(null);
38518
38633
  }, [activeView]);
38519
- useEffect59(() => {
38634
+ useEffect60(() => {
38520
38635
  if (activeView !== "wysiwyg" || !tiptapEditor) return;
38521
38636
  const update = () => {
38522
38637
  const { from } = tiptapEditor.state.selection;
@@ -38538,7 +38653,7 @@ function useActiveOutlineBlockId() {
38538
38653
  tiptapEditor.off("update", update);
38539
38654
  };
38540
38655
  }, [activeView, tiptapEditor, headingLocations]);
38541
- useEffect59(() => {
38656
+ useEffect60(() => {
38542
38657
  if (activeView !== "raw" || !monacoEditor) return;
38543
38658
  const update = () => {
38544
38659
  const line = monacoEditor.getPosition()?.lineNumber;
@@ -38625,7 +38740,7 @@ function bumpHeadingLevelInSource(source, line, delta) {
38625
38740
  }
38626
38741
 
38627
38742
  // src/codeContext/CodeContextZones.tsx
38628
- import { useCallback as useCallback47, useEffect as useEffect61, useMemo as useMemo48, useRef as useRef55, useState as useState72 } from "react";
38743
+ import { useCallback as useCallback47, useEffect as useEffect62, useMemo as useMemo48, useRef as useRef55, useState as useState72 } from "react";
38629
38744
  import { createPortal as createPortal15 } from "react-dom";
38630
38745
 
38631
38746
  // src/codeContext/diffContextSections.ts
@@ -38749,7 +38864,7 @@ function setOrdinal(zone, ordinal) {
38749
38864
  // src/codeContext/CodeContextSectionView.tsx
38750
38865
  import { parseMarkdown as parseMarkdown8 } from "@bendyline/squisq/markdown";
38751
38866
  import { MarkdownRenderer } from "@bendyline/squisq-react";
38752
- import { useCallback as useCallback46, useEffect as useEffect60, useMemo as useMemo47, useRef as useRef54 } from "react";
38867
+ import { useCallback as useCallback46, useEffect as useEffect61, useMemo as useMemo47, useRef as useRef54 } from "react";
38753
38868
  import { jsx as jsx75, jsxs as jsxs61 } from "react/jsx-runtime";
38754
38869
  function CodeContextSectionView({
38755
38870
  section,
@@ -38769,7 +38884,7 @@ function CodeContextSectionView({
38769
38884
  () => expanded && section.markdown ? parseMarkdown8(section.markdown).children : null,
38770
38885
  [expanded, section.markdown]
38771
38886
  );
38772
- useEffect60(() => {
38887
+ useEffect61(() => {
38773
38888
  const el = rootRef.current;
38774
38889
  if (!el || typeof ResizeObserver === "undefined") return;
38775
38890
  const report = () => {
@@ -38838,14 +38953,14 @@ function CodeContextSectionView({
38838
38953
  }
38839
38954
 
38840
38955
  // src/codeContext/CodeContextZones.tsx
38841
- import { Fragment as Fragment26, jsx as jsx76 } from "react/jsx-runtime";
38956
+ import { Fragment as Fragment27, jsx as jsx76 } from "react/jsx-runtime";
38842
38957
  function CodeContextZones({ options }) {
38843
38958
  const { monacoEditor } = useEditorContext();
38844
38959
  const [manager, setManager] = useState72(null);
38845
38960
  const [, setZonesVersion] = useState72(0);
38846
38961
  const [expandedById, setExpandedById] = useState72({});
38847
38962
  const seenIds = useRef55(/* @__PURE__ */ new Set());
38848
- useEffect61(() => {
38963
+ useEffect62(() => {
38849
38964
  if (!monacoEditor) return;
38850
38965
  const mgr = new CodeContextZoneManager(monacoEditor);
38851
38966
  const off = mgr.onDidChangeZones(() => setZonesVersion((v2) => v2 + 1));
@@ -38868,7 +38983,7 @@ function CodeContextZones({ options }) {
38868
38983
  });
38869
38984
  return out;
38870
38985
  }, [fileTop, sections]);
38871
- useEffect61(() => {
38986
+ useEffect62(() => {
38872
38987
  if (!manager) return;
38873
38988
  manager.sync(resolved.map((r) => r.spec));
38874
38989
  setExpandedById((prev) => {
@@ -38907,7 +39022,7 @@ function CodeContextZones({ options }) {
38907
39022
  [monacoEditor]
38908
39023
  );
38909
39024
  if (!manager) return null;
38910
- return /* @__PURE__ */ jsx76(Fragment26, { children: resolved.map(({ section }) => {
39025
+ return /* @__PURE__ */ jsx76(Fragment27, { children: resolved.map(({ section }) => {
38911
39026
  const domNode = manager.getDomNode(section.id);
38912
39027
  if (!domNode) return null;
38913
39028
  return createPortal15(
@@ -39334,20 +39449,44 @@ function placeClipInBlock(source, fromLine, targetHeadingLine, spec, startAt) {
39334
39449
  }
39335
39450
 
39336
39451
  // src/TimelineTrack.tsx
39337
- import { useCallback as useCallback49, useEffect as useEffect64, useMemo as useMemo49, useRef as useRef58, useState as useState75 } from "react";
39452
+ import { useCallback as useCallback49, useEffect as useEffect65, useMemo as useMemo49, useRef as useRef58, useState as useState75 } from "react";
39338
39453
  import {
39339
39454
  resolveMediaSchedule as resolveMediaSchedule2,
39340
39455
  getDocPlaybackDuration,
39341
- VIEWPORT_PRESETS as VIEWPORT_PRESETS6
39456
+ VIEWPORT_PRESETS as VIEWPORT_PRESETS7
39342
39457
  } from "@bendyline/squisq/schemas";
39343
39458
  import { flattenBlocks as flattenBlocks5, DEFAULT_THEME as DEFAULT_THEME6, getPinnedBlockMeta } from "@bendyline/squisq/doc";
39344
39459
  import { createMediaTimeMap } from "@bendyline/squisq/mediaEdit";
39345
39460
  import { usesDynamicPresentation } from "@bendyline/squisq/transform";
39346
39461
  import { useProcessedAudio as useProcessedAudio2 } from "@bendyline/squisq-video-react/media-edit";
39347
- import { MediaClipLayer, MediaContext as MediaContext5 } from "@bendyline/squisq-react";
39462
+ import { MediaClipLayer, MediaContext as MediaContext6 } from "@bendyline/squisq-react";
39463
+
39464
+ // src/TimelineBlockPreview.tsx
39465
+ import { memo as memo2 } from "react";
39466
+ import { VIEWPORT_PRESETS as VIEWPORT_PRESETS6 } from "@bendyline/squisq/schemas";
39467
+ import { BlockRenderer as BlockRenderer4, MediaContext as MediaContext5 } from "@bendyline/squisq-react";
39468
+ import { jsx as jsx78 } from "react/jsx-runtime";
39469
+ var BlockThumbnail = memo2(function BlockThumbnail2({
39470
+ visual,
39471
+ buildPlayback = "all",
39472
+ viewport = VIEWPORT_PRESETS6.landscape,
39473
+ basePath = "/",
39474
+ mediaProvider = null
39475
+ }) {
39476
+ return /* @__PURE__ */ jsx78(MediaContext5.Provider, { value: mediaProvider, children: /* @__PURE__ */ jsx78(
39477
+ BlockRenderer4,
39478
+ {
39479
+ buildPlayback,
39480
+ block: visual,
39481
+ blockTime: 0,
39482
+ basePath,
39483
+ viewport
39484
+ }
39485
+ ) });
39486
+ });
39348
39487
 
39349
39488
  // src/useTimelineClock.ts
39350
- import { useCallback as useCallback48, useEffect as useEffect62, useRef as useRef56, useState as useState73 } from "react";
39489
+ import { useCallback as useCallback48, useEffect as useEffect63, useRef as useRef56, useState as useState73 } from "react";
39351
39490
  function advanceTime(prev, dt, total) {
39352
39491
  if (total <= 0) return 0;
39353
39492
  return Math.min(total, Math.max(0, prev + dt));
@@ -39376,10 +39515,10 @@ function useTimelineClock(total) {
39376
39515
  const mediaHostRef = useRef56(null);
39377
39516
  currentTimeRef.current = currentTime;
39378
39517
  isPlayingRef.current = isPlaying;
39379
- useEffect62(() => {
39518
+ useEffect63(() => {
39380
39519
  setCurrentTime((t) => Math.min(t, Math.max(0, total)));
39381
39520
  }, [total]);
39382
- useEffect62(() => {
39521
+ useEffect63(() => {
39383
39522
  if (!isPlaying) return;
39384
39523
  lastRef.current = performance.now();
39385
39524
  const tick = (now) => {
@@ -39477,9 +39616,9 @@ function timelineBars(clips) {
39477
39616
  }
39478
39617
 
39479
39618
  // src/TimelineItemMenu.tsx
39480
- import { useEffect as useEffect63, useLayoutEffect as useLayoutEffect14, useRef as useRef57, useState as useState74 } from "react";
39619
+ import { useEffect as useEffect64, useLayoutEffect as useLayoutEffect14, useRef as useRef57, useState as useState74 } from "react";
39481
39620
  import { createPortal as createPortal16 } from "react-dom";
39482
- import { Fragment as Fragment27, jsx as jsx78, jsxs as jsxs63 } from "react/jsx-runtime";
39621
+ import { Fragment as Fragment28, jsx as jsx79, jsxs as jsxs63 } from "react/jsx-runtime";
39483
39622
  function TimelineItemMenu({
39484
39623
  anchor,
39485
39624
  target,
@@ -39508,7 +39647,7 @@ function TimelineItemMenu({
39508
39647
  resizeObserver?.disconnect();
39509
39648
  };
39510
39649
  }, [anchor]);
39511
- useEffect63(() => {
39650
+ useEffect64(() => {
39512
39651
  const onKeyDown = (event) => {
39513
39652
  if (event.key !== "Escape") return;
39514
39653
  event.preventDefault();
@@ -39540,10 +39679,10 @@ function TimelineItemMenu({
39540
39679
  style: { ...style, ...accentStyle(accentColor) },
39541
39680
  children: [
39542
39681
  /* @__PURE__ */ jsxs63("div", { className: "squisq-timeline-item-menu-header", children: [
39543
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-kind", children: target.kind === "block" ? "Block" : "Video" }),
39544
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-title", title: target.title, children: target.title })
39682
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-kind", children: target.kind === "block" ? "Block" : "Video" }),
39683
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-title", title: target.title, children: target.title })
39545
39684
  ] }),
39546
- target.kind === "block" ? /* @__PURE__ */ jsx78(
39685
+ target.kind === "block" ? /* @__PURE__ */ jsx79(
39547
39686
  BlockMenu,
39548
39687
  {
39549
39688
  target,
@@ -39554,9 +39693,9 @@ function TimelineItemMenu({
39554
39693
  onClearTiming: onBlockClearTiming,
39555
39694
  onTransition: onBlockTransition
39556
39695
  }
39557
- ) : /* @__PURE__ */ jsxs63(Fragment27, { children: [
39558
- /* @__PURE__ */ jsx78(VideoMenu, { target, onPatch: onVideoPatch }),
39559
- onEditMedia && /* @__PURE__ */ jsx78(
39696
+ ) : /* @__PURE__ */ jsxs63(Fragment28, { children: [
39697
+ /* @__PURE__ */ jsx79(VideoMenu, { target, onPatch: onVideoPatch }),
39698
+ onEditMedia && /* @__PURE__ */ jsx79(
39560
39699
  "button",
39561
39700
  {
39562
39701
  type: "button",
@@ -39602,12 +39741,12 @@ function BlockMenu({
39602
39741
  };
39603
39742
  const pinned = explicitDuration || startTime !== "";
39604
39743
  return /* @__PURE__ */ jsxs63("div", { className: "squisq-timeline-item-menu-body", children: [
39605
- target.timingLocked ? /* @__PURE__ */ jsxs63(Fragment27, { children: [
39744
+ target.timingLocked ? /* @__PURE__ */ jsxs63(Fragment28, { children: [
39606
39745
  /* @__PURE__ */ jsxs63("p", { className: "squisq-timeline-item-menu-hint", children: [
39607
39746
  "Dynamic slides time each slide from the narration or reading pace, so this section's length and start can't be pinned.",
39608
39747
  pinned && " A pinned time here stops a narrated deck from playing."
39609
39748
  ] }),
39610
- pinned && onClearTiming && /* @__PURE__ */ jsx78(
39749
+ pinned && onClearTiming && /* @__PURE__ */ jsx79(
39611
39750
  "button",
39612
39751
  {
39613
39752
  type: "button",
@@ -39620,9 +39759,9 @@ function BlockMenu({
39620
39759
  children: "Clear pinned timing"
39621
39760
  }
39622
39761
  )
39623
- ] }) : /* @__PURE__ */ jsxs63(Fragment27, { children: [
39762
+ ] }) : /* @__PURE__ */ jsxs63(Fragment28, { children: [
39624
39763
  /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-check", children: [
39625
- /* @__PURE__ */ jsx78(
39764
+ /* @__PURE__ */ jsx79(
39626
39765
  "input",
39627
39766
  {
39628
39767
  type: "checkbox",
@@ -39630,10 +39769,10 @@ function BlockMenu({
39630
39769
  onChange: (event) => toggleAutotime(event.target.checked)
39631
39770
  }
39632
39771
  ),
39633
- /* @__PURE__ */ jsx78("span", { children: "Autotime block" })
39772
+ /* @__PURE__ */ jsx79("span", { children: "Autotime block" })
39634
39773
  ] }),
39635
- /* @__PURE__ */ jsx78("p", { className: "squisq-timeline-item-menu-hint", children: "Uses narration, content, and interior media when no explicit duration is set." }),
39636
- /* @__PURE__ */ jsx78(
39774
+ /* @__PURE__ */ jsx79("p", { className: "squisq-timeline-item-menu-hint", children: "Uses narration, content, and interior media when no explicit duration is set." }),
39775
+ /* @__PURE__ */ jsx79(
39637
39776
  MenuNumberField,
39638
39777
  {
39639
39778
  label: "Duration",
@@ -39647,7 +39786,7 @@ function BlockMenu({
39647
39786
  }
39648
39787
  }
39649
39788
  ),
39650
- /* @__PURE__ */ jsx78(
39789
+ /* @__PURE__ */ jsx79(
39651
39790
  MenuNumberField,
39652
39791
  {
39653
39792
  label: "Start time",
@@ -39662,8 +39801,8 @@ function BlockMenu({
39662
39801
  )
39663
39802
  ] }),
39664
39803
  /* @__PURE__ */ jsxs63("div", { className: "squisq-timeline-item-menu-row", children: [
39665
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: "Transition" }),
39666
- /* @__PURE__ */ jsx78(
39804
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: "Transition" }),
39805
+ /* @__PURE__ */ jsx79(
39667
39806
  TransitionPicker,
39668
39807
  {
39669
39808
  value: transition,
@@ -39695,14 +39834,14 @@ function VideoMenu({
39695
39834
  ];
39696
39835
  return /* @__PURE__ */ jsxs63("div", { className: "squisq-timeline-item-menu-body", children: [
39697
39836
  /* @__PURE__ */ jsxs63("div", { className: "squisq-timeline-item-menu-field", children: [
39698
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: "Placement" }),
39699
- /* @__PURE__ */ jsx78(
39837
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: "Placement" }),
39838
+ /* @__PURE__ */ jsx79(
39700
39839
  "div",
39701
39840
  {
39702
39841
  className: "squisq-timeline-item-menu-segments",
39703
39842
  role: "group",
39704
39843
  "aria-label": "Video placement",
39705
- children: placementOptions.map((option) => /* @__PURE__ */ jsx78(
39844
+ children: placementOptions.map((option) => /* @__PURE__ */ jsx79(
39706
39845
  "button",
39707
39846
  {
39708
39847
  type: "button",
@@ -39722,9 +39861,9 @@ function VideoMenu({
39722
39861
  }
39723
39862
  )
39724
39863
  ] }),
39725
- placed && /* @__PURE__ */ jsxs63(Fragment27, { children: [
39864
+ placed && /* @__PURE__ */ jsxs63(Fragment28, { children: [
39726
39865
  /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-check", children: [
39727
- /* @__PURE__ */ jsx78(
39866
+ /* @__PURE__ */ jsx79(
39728
39867
  "input",
39729
39868
  {
39730
39869
  type: "checkbox",
@@ -39738,11 +39877,11 @@ function VideoMenu({
39738
39877
  }
39739
39878
  }
39740
39879
  ),
39741
- /* @__PURE__ */ jsx78("span", { children: "Lock to block" })
39880
+ /* @__PURE__ */ jsx79("span", { children: "Lock to block" })
39742
39881
  ] }),
39743
- placement === "picture-in-picture" && /* @__PURE__ */ jsxs63(Fragment27, { children: [
39882
+ placement === "picture-in-picture" && /* @__PURE__ */ jsxs63(Fragment28, { children: [
39744
39883
  /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-field", children: [
39745
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: "PIP size" }),
39884
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: "PIP size" }),
39746
39885
  /* @__PURE__ */ jsxs63(
39747
39886
  "select",
39748
39887
  {
@@ -39759,14 +39898,14 @@ function VideoMenu({
39759
39898
  titleCase(target.defaultPipSize),
39760
39899
  ")"
39761
39900
  ] }),
39762
- /* @__PURE__ */ jsx78("option", { value: "small", children: "Small" }),
39763
- /* @__PURE__ */ jsx78("option", { value: "large", children: "Large" })
39901
+ /* @__PURE__ */ jsx79("option", { value: "small", children: "Small" }),
39902
+ /* @__PURE__ */ jsx79("option", { value: "large", children: "Large" })
39764
39903
  ]
39765
39904
  }
39766
39905
  )
39767
39906
  ] }),
39768
39907
  /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-field", children: [
39769
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: "PIP shape" }),
39908
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: "PIP shape" }),
39770
39909
  /* @__PURE__ */ jsxs63(
39771
39910
  "select",
39772
39911
  {
@@ -39783,14 +39922,14 @@ function VideoMenu({
39783
39922
  titleCase(target.defaultPipShape),
39784
39923
  ")"
39785
39924
  ] }),
39786
- /* @__PURE__ */ jsx78("option", { value: "square", children: "Square" }),
39787
- /* @__PURE__ */ jsx78("option", { value: "wide", children: "Wide (16:9)" })
39925
+ /* @__PURE__ */ jsx79("option", { value: "square", children: "Square" }),
39926
+ /* @__PURE__ */ jsx79("option", { value: "wide", children: "Wide (16:9)" })
39788
39927
  ]
39789
39928
  }
39790
39929
  )
39791
39930
  ] }),
39792
39931
  /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-field", children: [
39793
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: "PIP position" }),
39932
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: "PIP position" }),
39794
39933
  /* @__PURE__ */ jsxs63(
39795
39934
  "select",
39796
39935
  {
@@ -39807,10 +39946,10 @@ function VideoMenu({
39807
39946
  positionLabel(target.defaultPipPosition),
39808
39947
  ")"
39809
39948
  ] }),
39810
- /* @__PURE__ */ jsx78("option", { value: "top-left", children: "Top left" }),
39811
- /* @__PURE__ */ jsx78("option", { value: "top-right", children: "Top right" }),
39812
- /* @__PURE__ */ jsx78("option", { value: "bottom-left", children: "Bottom left" }),
39813
- /* @__PURE__ */ jsx78("option", { value: "bottom-right", children: "Bottom right" })
39949
+ /* @__PURE__ */ jsx79("option", { value: "top-left", children: "Top left" }),
39950
+ /* @__PURE__ */ jsx79("option", { value: "top-right", children: "Top right" }),
39951
+ /* @__PURE__ */ jsx79("option", { value: "bottom-left", children: "Bottom left" }),
39952
+ /* @__PURE__ */ jsx79("option", { value: "bottom-right", children: "Bottom right" })
39814
39953
  ]
39815
39954
  }
39816
39955
  )
@@ -39828,9 +39967,9 @@ function MenuNumberField({
39828
39967
  onChange
39829
39968
  }) {
39830
39969
  return /* @__PURE__ */ jsxs63("label", { className: "squisq-timeline-item-menu-field", children: [
39831
- /* @__PURE__ */ jsx78("span", { className: "squisq-timeline-item-menu-label", children: label }),
39970
+ /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-item-menu-label", children: label }),
39832
39971
  /* @__PURE__ */ jsxs63("span", { className: "squisq-timeline-item-menu-number", children: [
39833
- /* @__PURE__ */ jsx78(
39972
+ /* @__PURE__ */ jsx79(
39834
39973
  "input",
39835
39974
  {
39836
39975
  type: "number",
@@ -39843,7 +39982,7 @@ function MenuNumberField({
39843
39982
  onChange: (event) => onChange(event.target.value)
39844
39983
  }
39845
39984
  ),
39846
- /* @__PURE__ */ jsx78("span", { children: "sec" })
39985
+ /* @__PURE__ */ jsx79("span", { children: "sec" })
39847
39986
  ] })
39848
39987
  ] });
39849
39988
  }
@@ -39888,8 +40027,8 @@ function menuStyle(anchor, element) {
39888
40027
  }
39889
40028
 
39890
40029
  // src/TimelineTrack.tsx
39891
- import { jsx as jsx79, jsxs as jsxs64 } from "react/jsx-runtime";
39892
- var PREVIEW_VIEWPORT = VIEWPORT_PRESETS6.landscape;
40030
+ import { jsx as jsx80, jsxs as jsxs64 } from "react/jsx-runtime";
40031
+ var PREVIEW_VIEWPORT = VIEWPORT_PRESETS7.landscape;
39893
40032
  var DEFAULT_PX_PER_SECOND = 18;
39894
40033
  var ZOOM_MIN = 4;
39895
40034
  var ZOOM_MAX = 160;
@@ -39911,9 +40050,9 @@ function TimelineVideoFilmstrip({
39911
40050
  FILMSTRIP_MAX_FRAMES,
39912
40051
  Math.max(1, Math.ceil(width / FILMSTRIP_FRAME_WIDTH))
39913
40052
  );
39914
- return /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-video-filmstrip", "aria-hidden": "true", children: Array.from({ length: frameCount }, (_2, index2) => {
40053
+ return /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-video-filmstrip", "aria-hidden": "true", children: Array.from({ length: frameCount }, (_2, index2) => {
39915
40054
  const sampleTime = Math.max(0, sourceStart) + Math.max(0, sourceLength) * ((index2 + 0.5) / frameCount);
39916
- return /* @__PURE__ */ jsx79(
40055
+ return /* @__PURE__ */ jsx80(
39917
40056
  "video",
39918
40057
  {
39919
40058
  src: resolvedSrc,
@@ -39996,7 +40135,7 @@ function TimelineTrack({
39996
40135
  play();
39997
40136
  }, [play]);
39998
40137
  const [scrubbing, setScrubbing] = useState75(false);
39999
- useEffect64(() => {
40138
+ useEffect65(() => {
40000
40139
  if (!scrubbing) return;
40001
40140
  const onMove = (e2) => {
40002
40141
  const scroll = scrollRef.current;
@@ -40034,7 +40173,7 @@ function TimelineTrack({
40034
40173
  [blocks]
40035
40174
  );
40036
40175
  const followedBlockRef = useRef58(null);
40037
- useEffect64(() => {
40176
+ useEffect65(() => {
40038
40177
  if (!isPlaying) {
40039
40178
  followedBlockRef.current = null;
40040
40179
  return;
@@ -40045,7 +40184,7 @@ function TimelineTrack({
40045
40184
  const line = headingLine(block);
40046
40185
  if (line != null) goToBlockByLine(line);
40047
40186
  }, [isPlaying, currentTime, blockAtTime, goToBlockByLine]);
40048
- useEffect64(() => {
40187
+ useEffect65(() => {
40049
40188
  if (!isPlaying) return;
40050
40189
  const scroll = scrollRef.current;
40051
40190
  if (!scroll) return;
@@ -40094,7 +40233,7 @@ function TimelineTrack({
40094
40233
  const zoomIn = useCallback49(() => setPxPerSecond((s) => Math.min(ZOOM_MAX, s * ZOOM_FACTOR)), []);
40095
40234
  const zoomOut = useCallback49(() => setPxPerSecond((s) => Math.max(ZOOM_MIN, s / ZOOM_FACTOR)), []);
40096
40235
  const [viewportWidth, setViewportWidth] = useState75(0);
40097
- useEffect64(() => {
40236
+ useEffect65(() => {
40098
40237
  const el = scrollRef.current;
40099
40238
  if (!el || typeof ResizeObserver === "undefined") return;
40100
40239
  const update = () => setViewportWidth(el.clientWidth);
@@ -40108,7 +40247,7 @@ function TimelineTrack({
40108
40247
  const dragRef = useRef58(null);
40109
40248
  dragRef.current = drag;
40110
40249
  const isDragging = drag != null && !drag.committed;
40111
- useEffect64(() => {
40250
+ useEffect65(() => {
40112
40251
  if (!isDragging) return;
40113
40252
  const onMove = (e2) => {
40114
40253
  const d = dragRef.current;
@@ -40139,7 +40278,7 @@ function TimelineTrack({
40139
40278
  window.removeEventListener("pointerup", onUp);
40140
40279
  };
40141
40280
  }, [isDragging]);
40142
- useEffect64(() => {
40281
+ useEffect65(() => {
40143
40282
  if (dragRef.current?.committed) setDrag(null);
40144
40283
  }, [doc]);
40145
40284
  const beginDrag = useCallback49(
@@ -40225,7 +40364,7 @@ function TimelineTrack({
40225
40364
  for (let t = 0; t <= rulerEnd + 1e-3 && ticks.length < 1e3; t += tickSeconds) ticks.push(t);
40226
40365
  return /* @__PURE__ */ jsxs64("div", { className: "squisq-timeline", style: { height }, "data-testid": "timeline-track", children: [
40227
40366
  /* @__PURE__ */ jsxs64("div", { className: "squisq-timeline-controls", children: [
40228
- /* @__PURE__ */ jsx79(
40367
+ /* @__PURE__ */ jsx80(
40229
40368
  "button",
40230
40369
  {
40231
40370
  type: "button",
@@ -40242,7 +40381,7 @@ function TimelineTrack({
40242
40381
  " / ",
40243
40382
  formatClock3(total)
40244
40383
  ] }),
40245
- /* @__PURE__ */ jsx79(
40384
+ /* @__PURE__ */ jsx80(
40246
40385
  "button",
40247
40386
  {
40248
40387
  type: "button",
@@ -40254,7 +40393,7 @@ function TimelineTrack({
40254
40393
  children: "\u2212"
40255
40394
  }
40256
40395
  ),
40257
- /* @__PURE__ */ jsx79(
40396
+ /* @__PURE__ */ jsx80(
40258
40397
  "button",
40259
40398
  {
40260
40399
  type: "button",
@@ -40267,8 +40406,8 @@ function TimelineTrack({
40267
40406
  }
40268
40407
  )
40269
40408
  ] }),
40270
- /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-scroll", ref: scrollRef, children: /* @__PURE__ */ jsxs64("div", { className: "squisq-timeline-inner", style: { width }, children: [
40271
- /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-row squisq-timeline-row--blocks", children: blocks.map((b, i) => {
40409
+ /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-scroll", ref: scrollRef, children: /* @__PURE__ */ jsxs64("div", { className: "squisq-timeline-inner", style: { width }, children: [
40410
+ /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-row squisq-timeline-row--blocks", children: blocks.map((b, i) => {
40272
40411
  const line = headingLine(b);
40273
40412
  const isActive = line != null && line === activeBlockStartLine;
40274
40413
  const left = previewLeft(i);
@@ -40285,7 +40424,7 @@ function TimelineTrack({
40285
40424
  if (line != null) goToBlockByLine(line);
40286
40425
  },
40287
40426
  children: [
40288
- visualByBlock.has(b.id) && /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-block-thumb", "aria-hidden": true, children: /* @__PURE__ */ jsx79(
40427
+ visualByBlock.has(b.id) && /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-block-thumb", "aria-hidden": true, children: /* @__PURE__ */ jsx80(
40289
40428
  BlockThumbnail,
40290
40429
  {
40291
40430
  visual: visualByBlock.get(b.id),
@@ -40293,7 +40432,7 @@ function TimelineTrack({
40293
40432
  mediaProvider
40294
40433
  }
40295
40434
  ) }),
40296
- !timingLocked && prev && headingLine(prev) != null && /* @__PURE__ */ jsx79(
40435
+ !timingLocked && prev && headingLine(prev) != null && /* @__PURE__ */ jsx80(
40297
40436
  "span",
40298
40437
  {
40299
40438
  className: "squisq-timeline-edge squisq-timeline-edge--left",
@@ -40314,8 +40453,8 @@ function TimelineTrack({
40314
40453
  )
40315
40454
  }
40316
40455
  ),
40317
- /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-block-label", children: b.title ?? b.id }),
40318
- line != null && /* @__PURE__ */ jsx79(
40456
+ /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-block-label", children: b.title ?? b.id }),
40457
+ line != null && /* @__PURE__ */ jsx80(
40319
40458
  "button",
40320
40459
  {
40321
40460
  type: "button",
@@ -40337,7 +40476,7 @@ function TimelineTrack({
40337
40476
  children: "\u2026"
40338
40477
  }
40339
40478
  ),
40340
- !timingLocked && line != null && /* @__PURE__ */ jsx79(
40479
+ !timingLocked && line != null && /* @__PURE__ */ jsx80(
40341
40480
  "span",
40342
40481
  {
40343
40482
  className: "squisq-timeline-edge squisq-timeline-edge--right",
@@ -40386,7 +40525,7 @@ function TimelineTrack({
40386
40525
  ...raw.edits ? { edits: raw.edits } : {}
40387
40526
  } : { kind: c.kind, src: c.src, clipStart: c.sourceIn };
40388
40527
  };
40389
- return /* @__PURE__ */ jsx79(
40528
+ return /* @__PURE__ */ jsx80(
40390
40529
  "div",
40391
40530
  {
40392
40531
  className: "squisq-timeline-row squisq-timeline-row--media",
@@ -40423,7 +40562,7 @@ function TimelineTrack({
40423
40562
  if (next) setMarkdownSource(next);
40424
40563
  },
40425
40564
  children: [
40426
- c.kind === "video" && /* @__PURE__ */ jsx79(
40565
+ c.kind === "video" && /* @__PURE__ */ jsx80(
40427
40566
  TimelineVideoFilmstrip,
40428
40567
  {
40429
40568
  src: c.src,
@@ -40432,8 +40571,8 @@ function TimelineTrack({
40432
40571
  width: clipWidth
40433
40572
  }
40434
40573
  ),
40435
- /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-clip-label", children: timelineMediaLabel(c.src, c.kind) }),
40436
- cutMarks.map((at2) => /* @__PURE__ */ jsx79(
40574
+ /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-clip-label", children: timelineMediaLabel(c.src, c.kind) }),
40575
+ cutMarks.map((at2) => /* @__PURE__ */ jsx80(
40437
40576
  "span",
40438
40577
  {
40439
40578
  className: "squisq-timeline-cut-mark",
@@ -40442,7 +40581,7 @@ function TimelineTrack({
40442
40581
  },
40443
40582
  at2
40444
40583
  )),
40445
- c.kind === "video" && c.sourceLine != null && /* @__PURE__ */ jsx79(
40584
+ c.kind === "video" && c.sourceLine != null && /* @__PURE__ */ jsx80(
40446
40585
  "button",
40447
40586
  {
40448
40587
  type: "button",
@@ -40468,7 +40607,7 @@ function TimelineTrack({
40468
40607
  children: "\u2026"
40469
40608
  }
40470
40609
  ),
40471
- editable && /* @__PURE__ */ jsx79(
40610
+ editable && /* @__PURE__ */ jsx80(
40472
40611
  "span",
40473
40612
  {
40474
40613
  className: "squisq-timeline-edge squisq-timeline-edge--right",
@@ -40518,7 +40657,7 @@ function TimelineTrack({
40518
40657
  ...m.clipStart != null ? { clipStart: m.clipStart } : {},
40519
40658
  ...m.clipEnd != null ? { clipEnd: m.clipEnd } : {}
40520
40659
  };
40521
- return /* @__PURE__ */ jsx79(
40660
+ return /* @__PURE__ */ jsx80(
40522
40661
  "div",
40523
40662
  {
40524
40663
  className: "squisq-timeline-row squisq-timeline-row--media",
@@ -40545,7 +40684,7 @@ function TimelineTrack({
40545
40684
  { onClick: () => selectClipAt(b.startTime, b.id) }
40546
40685
  ),
40547
40686
  children: [
40548
- m.kind === "video" && /* @__PURE__ */ jsx79(
40687
+ m.kind === "video" && /* @__PURE__ */ jsx80(
40549
40688
  TimelineVideoFilmstrip,
40550
40689
  {
40551
40690
  src: m.src,
@@ -40554,8 +40693,8 @@ function TimelineTrack({
40554
40693
  width: clipWidth
40555
40694
  }
40556
40695
  ),
40557
- /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-clip-label", children: timelineMediaLabel(m.src, m.kind) }),
40558
- m.kind === "video" && m.sourceLine != null && /* @__PURE__ */ jsx79(
40696
+ /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-clip-label", children: timelineMediaLabel(m.src, m.kind) }),
40697
+ m.kind === "video" && m.sourceLine != null && /* @__PURE__ */ jsx80(
40559
40698
  "button",
40560
40699
  {
40561
40700
  type: "button",
@@ -40580,7 +40719,7 @@ function TimelineTrack({
40580
40719
  children: "\u2026"
40581
40720
  }
40582
40721
  ),
40583
- m.sourceLine != null && /* @__PURE__ */ jsx79(
40722
+ m.sourceLine != null && /* @__PURE__ */ jsx80(
40584
40723
  "span",
40585
40724
  {
40586
40725
  className: "squisq-timeline-edge squisq-timeline-edge--right",
@@ -40602,7 +40741,7 @@ function TimelineTrack({
40602
40741
  })
40603
40742
  )
40604
40743
  ] }),
40605
- /* @__PURE__ */ jsx79(
40744
+ /* @__PURE__ */ jsx80(
40606
40745
  "div",
40607
40746
  {
40608
40747
  className: "squisq-timeline-row squisq-timeline-row--ruler",
@@ -40610,10 +40749,10 @@ function TimelineTrack({
40610
40749
  const rect = e2.currentTarget.getBoundingClientRect();
40611
40750
  seek((e2.clientX - rect.left) / pxPerSecond);
40612
40751
  },
40613
- children: ticks.map((t) => /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-tick", style: { left: t * pxPerSecond }, children: /* @__PURE__ */ jsx79("span", { className: "squisq-timeline-tick-label", children: formatDur(t) }) }, t))
40752
+ children: ticks.map((t) => /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-tick", style: { left: t * pxPerSecond }, children: /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-tick-label", children: formatDur(t) }) }, t))
40614
40753
  }
40615
40754
  ),
40616
- /* @__PURE__ */ jsx79(
40755
+ /* @__PURE__ */ jsx80(
40617
40756
  "div",
40618
40757
  {
40619
40758
  className: "squisq-timeline-playhead",
@@ -40625,11 +40764,11 @@ function TimelineTrack({
40625
40764
  pause();
40626
40765
  setScrubbing(true);
40627
40766
  },
40628
- children: /* @__PURE__ */ jsx79("div", { className: "squisq-timeline-playhead-knob" })
40767
+ children: /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-playhead-knob" })
40629
40768
  }
40630
40769
  )
40631
40770
  ] }) }),
40632
- /* @__PURE__ */ jsx79("div", { ref: activeClock.registerMediaHost, className: "squisq-timeline-media-host", "aria-hidden": true, children: /* @__PURE__ */ jsx79(MediaContext5.Provider, { value: mediaProvider ?? null, children: /* @__PURE__ */ jsx79(
40771
+ /* @__PURE__ */ jsx80("div", { ref: activeClock.registerMediaHost, className: "squisq-timeline-media-host", "aria-hidden": true, children: /* @__PURE__ */ jsx80(MediaContext6.Provider, { value: mediaProvider ?? null, children: /* @__PURE__ */ jsx80(
40633
40772
  MediaClipLayer,
40634
40773
  {
40635
40774
  schedule: playbackClips,
@@ -40638,7 +40777,7 @@ function TimelineTrack({
40638
40777
  basePath
40639
40778
  }
40640
40779
  ) }) }),
40641
- itemMenu && itemMenuTarget && /* @__PURE__ */ jsx79(
40780
+ itemMenu && itemMenuTarget && /* @__PURE__ */ jsx80(
40642
40781
  TimelineItemMenu,
40643
40782
  {
40644
40783
  anchor: itemMenu.anchor,
@@ -40709,7 +40848,7 @@ function formatDur(seconds) {
40709
40848
  // src/TimelineVideoPanel.tsx
40710
40849
  import { useMemo as useMemo50 } from "react";
40711
40850
  import { MediaClipLayer as MediaClipLayer2 } from "@bendyline/squisq-react";
40712
- import { jsx as jsx80, jsxs as jsxs65 } from "react/jsx-runtime";
40851
+ import { jsx as jsx81, jsxs as jsxs65 } from "react/jsx-runtime";
40713
40852
  function TimelineVideoPanel({
40714
40853
  schedule,
40715
40854
  currentTime,
@@ -40730,10 +40869,10 @@ function TimelineVideoPanel({
40730
40869
  "aria-label": "Timeline video preview",
40731
40870
  children: [
40732
40871
  /* @__PURE__ */ jsxs65("header", { className: "squisq-timeline-video-header", children: [
40733
- /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-video-title", children: "Video monitor" }),
40734
- /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-video-label", title: activeLabel, children: activeLabel }),
40735
- /* @__PURE__ */ jsx80("span", { className: "squisq-timeline-video-time", children: formatClock4(currentTime) }),
40736
- onClose && /* @__PURE__ */ jsx80(
40872
+ /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-title", children: "Video monitor" }),
40873
+ /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-label", title: activeLabel, children: activeLabel }),
40874
+ /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-time", children: formatClock4(currentTime) }),
40875
+ onClose && /* @__PURE__ */ jsx81(
40737
40876
  "button",
40738
40877
  {
40739
40878
  type: "button",
@@ -40745,8 +40884,8 @@ function TimelineVideoPanel({
40745
40884
  }
40746
40885
  )
40747
40886
  ] }),
40748
- /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-video-body", children: /* @__PURE__ */ jsxs65("div", { className: "squisq-timeline-video-stage", children: [
40749
- /* @__PURE__ */ jsx80(
40887
+ /* @__PURE__ */ jsx81("div", { className: "squisq-timeline-video-body", children: /* @__PURE__ */ jsxs65("div", { className: "squisq-timeline-video-stage", children: [
40888
+ /* @__PURE__ */ jsx81(
40750
40889
  MediaClipLayer2,
40751
40890
  {
40752
40891
  schedule: videos,
@@ -40758,7 +40897,7 @@ function TimelineVideoPanel({
40758
40897
  muted: true
40759
40898
  }
40760
40899
  ),
40761
- activeVideos.length === 0 && /* @__PURE__ */ jsx80("div", { className: "squisq-timeline-video-empty", children: "Move the playhead onto a video clip" })
40900
+ activeVideos.length === 0 && /* @__PURE__ */ jsx81("div", { className: "squisq-timeline-video-empty", children: "Move the playhead onto a video clip" })
40762
40901
  ] }) })
40763
40902
  ]
40764
40903
  }
@@ -40774,7 +40913,7 @@ function formatClock4(seconds) {
40774
40913
  import { useMemo as useMemo51 } from "react";
40775
40914
  import { getDocPlaybackDuration as getDocPlaybackDuration2, resolveMediaSchedule as resolveMediaSchedule3 } from "@bendyline/squisq/schemas";
40776
40915
  import { DocPlayer } from "@bendyline/squisq-react";
40777
- import { jsx as jsx81, jsxs as jsxs66 } from "react/jsx-runtime";
40916
+ import { jsx as jsx82, jsxs as jsxs66 } from "react/jsx-runtime";
40778
40917
  function TimelineCompositionPanel({
40779
40918
  doc,
40780
40919
  clock,
@@ -40846,11 +40985,11 @@ function TimelineCompositionPanel({
40846
40985
  "aria-label": "Timeline video composition preview",
40847
40986
  children: [
40848
40987
  /* @__PURE__ */ jsxs66("header", { className: "squisq-timeline-video-header", children: [
40849
- /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-title", children: "Video composition" }),
40850
- /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-label", children: formatPresentation(effectiveVideoPresentation) }),
40851
- /* @__PURE__ */ jsx81(PreviewToolbarControls, { displayMode: "video" }),
40852
- /* @__PURE__ */ jsx81("span", { className: "squisq-timeline-video-time", children: formatClock5(clock.currentTime) }),
40853
- onClose && /* @__PURE__ */ jsx81(
40988
+ /* @__PURE__ */ jsx82("span", { className: "squisq-timeline-video-title", children: "Video composition" }),
40989
+ /* @__PURE__ */ jsx82("span", { className: "squisq-timeline-video-label", children: formatPresentation(effectiveVideoPresentation) }),
40990
+ /* @__PURE__ */ jsx82(PreviewToolbarControls, { displayMode: "video" }),
40991
+ /* @__PURE__ */ jsx82("span", { className: "squisq-timeline-video-time", children: formatClock5(clock.currentTime) }),
40992
+ onClose && /* @__PURE__ */ jsx82(
40854
40993
  "button",
40855
40994
  {
40856
40995
  type: "button",
@@ -40862,7 +41001,7 @@ function TimelineCompositionPanel({
40862
41001
  }
40863
41002
  )
40864
41003
  ] }),
40865
- /* @__PURE__ */ jsx81("div", { className: "squisq-timeline-video-body", children: /* @__PURE__ */ jsx81("div", { className: "squisq-timeline-composition-stage", children: playerDoc ? /* @__PURE__ */ jsx81(
41004
+ /* @__PURE__ */ jsx82("div", { className: "squisq-timeline-video-body", children: /* @__PURE__ */ jsx82("div", { className: "squisq-timeline-composition-stage", children: playerDoc ? /* @__PURE__ */ jsx82(
40866
41005
  DocPlayer,
40867
41006
  {
40868
41007
  doc: playerDoc,
@@ -40888,7 +41027,7 @@ function TimelineCompositionPanel({
40888
41027
  enableSwipe: false,
40889
41028
  globalKeyboardShortcuts: false
40890
41029
  }
40891
- ) : /* @__PURE__ */ jsx81("div", { className: "squisq-timeline-video-empty", children: "Preparing video composition\u2026" }) }) })
41030
+ ) : /* @__PURE__ */ jsx82("div", { className: "squisq-timeline-video-empty", children: "Preparing video composition\u2026" }) }) })
40892
41031
  ]
40893
41032
  }
40894
41033
  );
@@ -40905,7 +41044,7 @@ function formatPresentation(presentation) {
40905
41044
  }
40906
41045
 
40907
41046
  // src/TimelineToolbar.tsx
40908
- import { jsx as jsx82, jsxs as jsxs67 } from "react/jsx-runtime";
41047
+ import { jsx as jsx83, jsxs as jsxs67 } from "react/jsx-runtime";
40909
41048
  function TimelineToolbar({
40910
41049
  literalVideoVisible,
40911
41050
  compositionVisible,
@@ -40922,7 +41061,7 @@ function TimelineToolbar({
40922
41061
  "aria-label": "Timeline view controls",
40923
41062
  "data-testid": "timeline-toolbar",
40924
41063
  children: [
40925
- /* @__PURE__ */ jsx82("span", { className: "squisq-timeline-toolbar-title", children: "Preview panes" }),
41064
+ /* @__PURE__ */ jsx83("span", { className: "squisq-timeline-toolbar-title", children: "Preview panes" }),
40926
41065
  /* @__PURE__ */ jsxs67(
40927
41066
  "button",
40928
41067
  {
@@ -40935,7 +41074,7 @@ function TimelineToolbar({
40935
41074
  "data-tooltip": literalVideoVisible ? "Hide literal video" : "Show literal video",
40936
41075
  children: [
40937
41076
  /* @__PURE__ */ jsxs67("svg", { width: "15", height: "15", viewBox: "0 0 15 15", "aria-hidden": "true", children: [
40938
- /* @__PURE__ */ jsx82(
41077
+ /* @__PURE__ */ jsx83(
40939
41078
  "rect",
40940
41079
  {
40941
41080
  x: "1.5",
@@ -40948,7 +41087,7 @@ function TimelineToolbar({
40948
41087
  strokeWidth: "1.4"
40949
41088
  }
40950
41089
  ),
40951
- /* @__PURE__ */ jsx82(
41090
+ /* @__PURE__ */ jsx83(
40952
41091
  "path",
40953
41092
  {
40954
41093
  d: "M10 5.5 13.5 4v7L10 9.5z",
@@ -40959,7 +41098,7 @@ function TimelineToolbar({
40959
41098
  }
40960
41099
  )
40961
41100
  ] }),
40962
- /* @__PURE__ */ jsx82("span", { children: "Video monitor" })
41101
+ /* @__PURE__ */ jsx83("span", { children: "Video monitor" })
40963
41102
  ]
40964
41103
  }
40965
41104
  ),
@@ -40975,7 +41114,7 @@ function TimelineToolbar({
40975
41114
  "data-tooltip": compositionVisible ? "Hide video composition" : "Show video composition",
40976
41115
  children: [
40977
41116
  /* @__PURE__ */ jsxs67("svg", { width: "15", height: "15", viewBox: "0 0 15 15", "aria-hidden": "true", children: [
40978
- /* @__PURE__ */ jsx82(
41117
+ /* @__PURE__ */ jsx83(
40979
41118
  "rect",
40980
41119
  {
40981
41120
  x: "1.5",
@@ -40988,10 +41127,10 @@ function TimelineToolbar({
40988
41127
  strokeWidth: "1.4"
40989
41128
  }
40990
41129
  ),
40991
- /* @__PURE__ */ jsx82("path", { d: "M5 13h5M7.5 11v2", stroke: "currentColor", strokeWidth: "1.4" }),
40992
- /* @__PURE__ */ jsx82("path", { d: "m6.3 5 3 1.5-3 1.5z", fill: "currentColor" })
41130
+ /* @__PURE__ */ jsx83("path", { d: "M5 13h5M7.5 11v2", stroke: "currentColor", strokeWidth: "1.4" }),
41131
+ /* @__PURE__ */ jsx83("path", { d: "m6.3 5 3 1.5-3 1.5z", fill: "currentColor" })
40993
41132
  ] }),
40994
- /* @__PURE__ */ jsx82("span", { children: "Video composition" })
41133
+ /* @__PURE__ */ jsx83("span", { children: "Video composition" })
40995
41134
  ]
40996
41135
  }
40997
41136
  )
@@ -41001,7 +41140,7 @@ function TimelineToolbar({
41001
41140
  }
41002
41141
 
41003
41142
  // src/PlainHtmlPreview.tsx
41004
- import { useCallback as useCallback50, useEffect as useEffect65, useMemo as useMemo52, useRef as useRef59, useState as useState76 } from "react";
41143
+ import { useCallback as useCallback50, useEffect as useEffect66, useMemo as useMemo52, useRef as useRef59, useState as useState76 } from "react";
41005
41144
  import {
41006
41145
  isSvgImageSource as isSvgImageSource2,
41007
41146
  parseMarkdown as parseMarkdown9,
@@ -41045,7 +41184,7 @@ function isFontAwesomeRule(rule) {
41045
41184
  }
41046
41185
 
41047
41186
  // src/PlainHtmlPreview.tsx
41048
- import { jsx as jsx83 } from "react/jsx-runtime";
41187
+ import { jsx as jsx84 } from "react/jsx-runtime";
41049
41188
  var cachedRender = null;
41050
41189
  var cachedRenderPromise = null;
41051
41190
  function loadRenderFn() {
@@ -41111,7 +41250,7 @@ function PlainHtmlPreview({
41111
41250
  const parsedDoc = useMemo52(() => parseMarkdown9(markdown), [markdown]);
41112
41251
  const [wikiProjection, setWikiProjection] = useState76(null);
41113
41252
  const mdDoc = wikiProjection?.source === parsedDoc && wikiProjection.support === wikiLinks ? wikiProjection.doc : parsedDoc;
41114
- useEffect65(() => {
41253
+ useEffect66(() => {
41115
41254
  if (!wikiLinks) return;
41116
41255
  let cancelled = false;
41117
41256
  void resolveWikiLinks(
@@ -41130,7 +41269,7 @@ function PlainHtmlPreview({
41130
41269
  };
41131
41270
  }, [parsedDoc, wikiLinks]);
41132
41271
  const [resolvedImages, setResolvedImages] = useState76(null);
41133
- useEffect65(() => {
41272
+ useEffect66(() => {
41134
41273
  if (!mediaProvider) {
41135
41274
  setResolvedImages(null);
41136
41275
  return;
@@ -41167,7 +41306,7 @@ function PlainHtmlPreview({
41167
41306
  }, [resolvedImages, images]);
41168
41307
  const iconsCss = useMemo52(() => collectInlineFontAwesomeCss(), []);
41169
41308
  const [preparation, setPreparation] = useState76(null);
41170
- useEffect65(() => {
41309
+ useEffect66(() => {
41171
41310
  let cancelled = false;
41172
41311
  loadPreparation().then(
41173
41312
  (loaded) => {
@@ -41194,7 +41333,7 @@ function PlainHtmlPreview({
41194
41333
  );
41195
41334
  const [prepared, setPrepared] = useState76(null);
41196
41335
  const preparedOnceRef = useRef59(false);
41197
- useEffect65(() => {
41336
+ useEffect66(() => {
41198
41337
  if (!preparation || !needsPreparation) return;
41199
41338
  let cancelled = false;
41200
41339
  const prepare = () => {
@@ -41222,7 +41361,7 @@ function PlainHtmlPreview({
41222
41361
  }, [preparation, needsPreparation, mdDoc, container, dataTableCache]);
41223
41362
  const view = needsPreparation ? prepared : null;
41224
41363
  const [renderFn, setRenderFn] = useState76(() => cachedRender);
41225
- useEffect65(() => {
41364
+ useEffect66(() => {
41226
41365
  if (renderFn) return;
41227
41366
  let cancelled = false;
41228
41367
  loadRenderFn().then((fn) => {
@@ -41263,7 +41402,7 @@ function PlainHtmlPreview({
41263
41402
  frameDocument.addEventListener("click", handleClick, true);
41264
41403
  removeFrameLinkHandlerRef.current = () => frameDocument.removeEventListener("click", handleClick, true);
41265
41404
  }, [onLinkClick]);
41266
- useEffect65(() => {
41405
+ useEffect66(() => {
41267
41406
  installFrameLinkHandler();
41268
41407
  return () => removeFrameLinkHandlerRef.current();
41269
41408
  }, [html, installFrameLinkHandler]);
@@ -41359,11 +41498,11 @@ function PlainHtmlPreview({
41359
41498
  style2.remove();
41360
41499
  };
41361
41500
  }, [onCopyCode, showCodeCopyButton]);
41362
- useEffect65(() => {
41501
+ useEffect66(() => {
41363
41502
  installFrameCodeCopyControls();
41364
41503
  return () => removeFrameCodeCopyControlsRef.current();
41365
41504
  }, [html, installFrameCodeCopyControls]);
41366
- useEffect65(() => {
41505
+ useEffect66(() => {
41367
41506
  if (!globalKeyboardShortcuts) return;
41368
41507
  const handleKeyDown = (event) => {
41369
41508
  if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey || event.key !== "ArrowDown" && event.key !== "ArrowUp") {
@@ -41387,7 +41526,7 @@ function PlainHtmlPreview({
41387
41526
  document.addEventListener("keydown", handleKeyDown);
41388
41527
  return () => document.removeEventListener("keydown", handleKeyDown);
41389
41528
  }, [globalKeyboardShortcuts]);
41390
- return /* @__PURE__ */ jsx83(
41529
+ return /* @__PURE__ */ jsx84(
41391
41530
  "iframe",
41392
41531
  {
41393
41532
  ref: setIframeRef,
@@ -41448,7 +41587,7 @@ function collectImageRefs(doc) {
41448
41587
  }
41449
41588
 
41450
41589
  // src/PreviewPanel.tsx
41451
- import { useState as useState80, useEffect as useEffect70, useMemo as useMemo57, useCallback as useCallback54, useRef as useRef63 } from "react";
41590
+ import { useState as useState80, useEffect as useEffect71, useMemo as useMemo57, useCallback as useCallback54, useRef as useRef63 } from "react";
41452
41591
  import { createPortal as createPortal18 } from "react-dom";
41453
41592
  import {
41454
41593
  DashboardView,
@@ -41593,7 +41732,7 @@ import {
41593
41732
  createContext as createContext7,
41594
41733
  useCallback as useCallback51,
41595
41734
  useContext as useContext7,
41596
- useEffect as useEffect66,
41735
+ useEffect as useEffect67,
41597
41736
  useId as useId15,
41598
41737
  useLayoutEffect as useLayoutEffect15,
41599
41738
  useMemo as useMemo53,
@@ -41602,7 +41741,7 @@ import {
41602
41741
  } from "react";
41603
41742
  import { createPortal as createPortal17 } from "react-dom";
41604
41743
  import { inferDocumentTitle as inferDocumentTitle2 } from "@bendyline/squisq/markdown";
41605
- import { jsx as jsx84, jsxs as jsxs68 } from "react/jsx-runtime";
41744
+ import { jsx as jsx85, jsxs as jsxs68 } from "react/jsx-runtime";
41606
41745
  var PresentationModeContext = createContext7(null);
41607
41746
  function usePresentationMode() {
41608
41747
  const value = useContext7(PresentationModeContext);
@@ -41860,12 +41999,12 @@ function PresentationModeProvider({
41860
41999
  },
41861
42000
  [availableTargets, selectedTarget, stop]
41862
42001
  );
41863
- useEffect66(() => {
42002
+ useEffect67(() => {
41864
42003
  if (availableTargets.includes(selectedTarget)) return;
41865
42004
  setSelectedTarget("control");
41866
42005
  if (activeTargetRef.current !== null) void stop();
41867
42006
  }, [availableTargets, selectedTarget, stop]);
41868
- useEffect66(() => {
42007
+ useEffect67(() => {
41869
42008
  const root = rootRef.current;
41870
42009
  const ownerDocument = root?.ownerDocument;
41871
42010
  if (!root || !ownerDocument) return;
@@ -41877,7 +42016,7 @@ function PresentationModeProvider({
41877
42016
  ownerDocument.addEventListener("fullscreenchange", handleFullscreenChange);
41878
42017
  return () => ownerDocument.removeEventListener("fullscreenchange", handleFullscreenChange);
41879
42018
  }, [rootRef]);
41880
- useEffect66(() => {
42019
+ useEffect67(() => {
41881
42020
  const root = rootRef.current;
41882
42021
  if (!root) return;
41883
42022
  if (activeTarget) root.dataset.presentationMode = activeTarget;
@@ -41886,10 +42025,10 @@ function PresentationModeProvider({
41886
42025
  delete root.dataset.presentationMode;
41887
42026
  };
41888
42027
  }, [activeTarget, rootRef]);
41889
- useEffect66(() => {
42028
+ useEffect67(() => {
41890
42029
  if (activeView !== "preview" && activeTargetRef.current !== null) void stop();
41891
42030
  }, [activeView, stop]);
41892
- useEffect66(() => {
42031
+ useEffect67(() => {
41893
42032
  const previous = previousActiveTargetRef.current;
41894
42033
  previousActiveTargetRef.current = activeTarget;
41895
42034
  if (previous === null || activeTarget !== null) return;
@@ -41897,7 +42036,7 @@ function PresentationModeProvider({
41897
42036
  returnFocusRef.current = null;
41898
42037
  if (target?.isConnected) target.focus();
41899
42038
  }, [activeTarget]);
41900
- useEffect66(() => {
42039
+ useEffect67(() => {
41901
42040
  if (activeTarget !== "control") return;
41902
42041
  const ownerDocument = rootRef.current?.ownerDocument;
41903
42042
  if (!ownerDocument) return;
@@ -41909,7 +42048,7 @@ function PresentationModeProvider({
41909
42048
  ownerDocument.addEventListener("keydown", handleKeyDown);
41910
42049
  return () => ownerDocument.removeEventListener("keydown", handleKeyDown);
41911
42050
  }, [activeTarget, rootRef, stop]);
41912
- useEffect66(() => {
42051
+ useEffect67(() => {
41913
42052
  if (!error) return;
41914
42053
  const timer = window.setTimeout(() => setError(null), 6e3);
41915
42054
  return () => window.clearTimeout(timer);
@@ -41944,7 +42083,7 @@ function PresentationModeProvider({
41944
42083
  window.removeEventListener("resize", updatePosition);
41945
42084
  };
41946
42085
  }, [activeTarget, rootRef]);
41947
- useEffect66(
42086
+ useEffect67(
41948
42087
  () => () => {
41949
42088
  popupCleanupRef.current?.();
41950
42089
  const popup = popupRef.current;
@@ -41996,8 +42135,8 @@ function PresentationModeProvider({
41996
42135
  "aria-label": "Exit presentation mode",
41997
42136
  title: "Exit presentation mode (Esc)",
41998
42137
  children: [
41999
- /* @__PURE__ */ jsx84(Icon, { icon: "fa-solid fa-compress" }),
42000
- /* @__PURE__ */ jsx84("span", { children: "Exit presentation" })
42138
+ /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-compress" }),
42139
+ /* @__PURE__ */ jsx85("span", { children: "Exit presentation" })
42001
42140
  ]
42002
42141
  }
42003
42142
  ) : null;
@@ -42006,7 +42145,7 @@ function PresentationModeProvider({
42006
42145
  (activeTarget === "control" || activeTarget === "fullscreen") && exitButton,
42007
42146
  activeTarget === "window" && popupRoot && exitButton ? createPortal17(exitButton, popupRoot) : null,
42008
42147
  error && typeof document !== "undefined" ? createPortal17(
42009
- /* @__PURE__ */ jsx84("div", { className: "squisq-presentation-error", "data-theme": colorScheme, role: "alert", children: error }),
42148
+ /* @__PURE__ */ jsx85("div", { className: "squisq-presentation-error", "data-theme": colorScheme, role: "alert", children: error }),
42010
42149
  document.body
42011
42150
  ) : null
42012
42151
  ] });
@@ -42073,7 +42212,7 @@ function PresentationModeControl() {
42073
42212
  updatePosition();
42074
42213
  setOpen(true);
42075
42214
  }, [updatePosition]);
42076
- useEffect66(() => {
42215
+ useEffect67(() => {
42077
42216
  if (!open) return;
42078
42217
  const handlePointerDown = (event) => {
42079
42218
  const target = event.target;
@@ -42103,7 +42242,7 @@ function PresentationModeControl() {
42103
42242
  (checked ?? first)?.focus();
42104
42243
  }, [anchor, open]);
42105
42244
  return /* @__PURE__ */ jsxs68("div", { className: "squisq-presentation-control", children: [
42106
- /* @__PURE__ */ jsx84(
42245
+ /* @__PURE__ */ jsx85(
42107
42246
  "button",
42108
42247
  {
42109
42248
  type: "button",
@@ -42112,10 +42251,10 @@ function PresentationModeControl() {
42112
42251
  "aria-pressed": activeTarget !== null,
42113
42252
  "data-tooltip": activeTarget ? "Exit presentation" : `Present: ${selected.label}`,
42114
42253
  onClick: () => void (activeTarget ? stop() : start()),
42115
- children: /* @__PURE__ */ jsx84(Icon, { icon: "fa-solid fa-display" })
42254
+ children: /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-display" })
42116
42255
  }
42117
42256
  ),
42118
- options.length > 1 && /* @__PURE__ */ jsx84(
42257
+ options.length > 1 && /* @__PURE__ */ jsx85(
42119
42258
  "button",
42120
42259
  {
42121
42260
  ref: triggerRef,
@@ -42131,11 +42270,11 @@ function PresentationModeControl() {
42131
42270
  event.preventDefault();
42132
42271
  openMenu();
42133
42272
  },
42134
- children: /* @__PURE__ */ jsx84("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ jsx84("path", { d: "M2 3.5 5 6.5 8 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.4" }) })
42273
+ children: /* @__PURE__ */ jsx85("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ jsx85("path", { d: "M2 3.5 5 6.5 8 3.5", fill: "none", stroke: "currentColor", strokeWidth: "1.4" }) })
42135
42274
  }
42136
42275
  ),
42137
42276
  open && anchor ? createPortal17(
42138
- /* @__PURE__ */ jsx84(
42277
+ /* @__PURE__ */ jsx85(
42139
42278
  "div",
42140
42279
  {
42141
42280
  ref: menuRef,
@@ -42181,24 +42320,24 @@ function PresentationModeControl() {
42181
42320
  if (!alreadyThere) void start(option.target);
42182
42321
  },
42183
42322
  children: [
42184
- /* @__PURE__ */ jsx84(
42323
+ /* @__PURE__ */ jsx85(
42185
42324
  "span",
42186
42325
  {
42187
42326
  className: "squisq-use-mode-menu-icon squisq-presentation-menu-icon",
42188
42327
  "aria-hidden": "true",
42189
- children: /* @__PURE__ */ jsx84(Icon, { icon: option.icon })
42328
+ children: /* @__PURE__ */ jsx85(Icon, { icon: option.icon })
42190
42329
  }
42191
42330
  ),
42192
42331
  /* @__PURE__ */ jsxs68("span", { className: "squisq-use-mode-menu-copy squisq-presentation-menu-copy", children: [
42193
- /* @__PURE__ */ jsx84("span", { className: "squisq-use-mode-menu-label squisq-presentation-menu-label", children: option.label }),
42194
- /* @__PURE__ */ jsx84("span", { className: "squisq-use-mode-menu-summary squisq-presentation-menu-summary", children: disabled ? "Full screen is unavailable." : option.summary })
42332
+ /* @__PURE__ */ jsx85("span", { className: "squisq-use-mode-menu-label squisq-presentation-menu-label", children: option.label }),
42333
+ /* @__PURE__ */ jsx85("span", { className: "squisq-use-mode-menu-summary squisq-presentation-menu-summary", children: disabled ? "Full screen is unavailable." : option.summary })
42195
42334
  ] }),
42196
- /* @__PURE__ */ jsx84(
42335
+ /* @__PURE__ */ jsx85(
42197
42336
  "span",
42198
42337
  {
42199
42338
  className: "squisq-use-mode-menu-check squisq-presentation-menu-check",
42200
42339
  "aria-hidden": "true",
42201
- children: isSelected && /* @__PURE__ */ jsx84(Icon, { icon: "fa-solid fa-check" })
42340
+ children: isSelected && /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-check" })
42202
42341
  }
42203
42342
  )
42204
42343
  ]
@@ -42218,12 +42357,12 @@ import {
42218
42357
  createContext as createContext8,
42219
42358
  useCallback as useCallback52,
42220
42359
  useContext as useContext8,
42221
- useEffect as useEffect67,
42360
+ useEffect as useEffect68,
42222
42361
  useMemo as useMemo54,
42223
42362
  useRef as useRef61,
42224
42363
  useState as useState78
42225
42364
  } from "react";
42226
- import { jsx as jsx85, jsxs as jsxs69 } from "react/jsx-runtime";
42365
+ import { jsx as jsx86, jsxs as jsxs69 } from "react/jsx-runtime";
42227
42366
  var PrintModeContext = createContext8(null);
42228
42367
  function usePrintMode() {
42229
42368
  const value = useContext8(PrintModeContext);
@@ -42288,7 +42427,7 @@ function PrintModeProvider({ rootRef, children }) {
42288
42427
  markPrinting();
42289
42428
  ownerWindow.print();
42290
42429
  }, [markPrinting, rootRef]);
42291
- useEffect67(() => {
42430
+ useEffect68(() => {
42292
42431
  const root = rootRef.current;
42293
42432
  if (!root) return;
42294
42433
  if (active) root.dataset.printPreview = "true";
@@ -42297,10 +42436,10 @@ function PrintModeProvider({ rootRef, children }) {
42297
42436
  delete root.dataset.printPreview;
42298
42437
  };
42299
42438
  }, [active, rootRef]);
42300
- useEffect67(() => {
42439
+ useEffect68(() => {
42301
42440
  if (activeView !== "preview" && active) close();
42302
42441
  }, [active, activeView, close]);
42303
- useEffect67(() => {
42442
+ useEffect68(() => {
42304
42443
  if (!active) return;
42305
42444
  const ownerWindow = rootRef.current?.ownerDocument.defaultView;
42306
42445
  const ownerDocument = rootRef.current?.ownerDocument;
@@ -42334,7 +42473,7 @@ function PrintModeProvider({ rootRef, children }) {
42334
42473
  }),
42335
42474
  [active, close, open, print, registerPrintHandler, slidesPerPage]
42336
42475
  );
42337
- return /* @__PURE__ */ jsx85(PrintModeContext.Provider, { value, children });
42476
+ return /* @__PURE__ */ jsx86(PrintModeContext.Provider, { value, children });
42338
42477
  }
42339
42478
  function PrintModeControl() {
42340
42479
  const { open } = usePrintMode();
@@ -42347,8 +42486,8 @@ function PrintModeControl() {
42347
42486
  "aria-label": "Print",
42348
42487
  "data-tooltip": "Print",
42349
42488
  children: [
42350
- /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-print" }),
42351
- /* @__PURE__ */ jsx85("span", { children: "Print" })
42489
+ /* @__PURE__ */ jsx86(Icon, { icon: "fa-solid fa-print" }),
42490
+ /* @__PURE__ */ jsx86("span", { children: "Print" })
42352
42491
  ]
42353
42492
  }
42354
42493
  );
@@ -42358,8 +42497,8 @@ function PrintPreviewToolbar() {
42358
42497
  const { activeDisplayMode } = usePreviewSettings();
42359
42498
  const { slidesPerPage, setSlidesPerPage, print, close } = usePrintMode();
42360
42499
  return /* @__PURE__ */ jsxs69("div", { className: "squisq-print-toolbar", "aria-label": "Print preview controls", children: [
42361
- /* @__PURE__ */ jsx85("span", { className: "squisq-print-toolbar-title", children: "Print preview" }),
42362
- activeDisplayMode === "slideshow" && /* @__PURE__ */ jsx85("div", { className: "squisq-print-density", role: "group", "aria-label": "Slides per page", children: SLIDES_PER_PAGE_OPTIONS.map((value) => /* @__PURE__ */ jsxs69(
42500
+ /* @__PURE__ */ jsx86("span", { className: "squisq-print-toolbar-title", children: "Print preview" }),
42501
+ activeDisplayMode === "slideshow" && /* @__PURE__ */ jsx86("div", { className: "squisq-print-density", role: "group", "aria-label": "Slides per page", children: SLIDES_PER_PAGE_OPTIONS.map((value) => /* @__PURE__ */ jsxs69(
42363
42502
  "button",
42364
42503
  {
42365
42504
  type: "button",
@@ -42368,7 +42507,7 @@ function PrintPreviewToolbar() {
42368
42507
  "aria-label": `${value} ${value === 1 ? "slide" : "slides"} per page`,
42369
42508
  onClick: () => setSlidesPerPage(value),
42370
42509
  children: [
42371
- /* @__PURE__ */ jsx85("span", { children: value }),
42510
+ /* @__PURE__ */ jsx86("span", { children: value }),
42372
42511
  /* @__PURE__ */ jsxs69("span", { className: "squisq-print-density-label", children: [
42373
42512
  " ",
42374
42513
  value === 1 ? "slide" : "slides",
@@ -42378,22 +42517,22 @@ function PrintPreviewToolbar() {
42378
42517
  },
42379
42518
  value
42380
42519
  )) }),
42381
- /* @__PURE__ */ jsx85("div", { className: "squisq-print-toolbar-spacer" }),
42520
+ /* @__PURE__ */ jsx86("div", { className: "squisq-print-toolbar-spacer" }),
42382
42521
  /* @__PURE__ */ jsxs69("button", { type: "button", className: "squisq-print-action", onClick: print, children: [
42383
- /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-print" }),
42384
- /* @__PURE__ */ jsx85("span", { children: "Print" })
42522
+ /* @__PURE__ */ jsx86(Icon, { icon: "fa-solid fa-print" }),
42523
+ /* @__PURE__ */ jsx86("span", { children: "Print" })
42385
42524
  ] }),
42386
42525
  /* @__PURE__ */ jsxs69("button", { type: "button", className: "squisq-print-close", onClick: close, children: [
42387
- /* @__PURE__ */ jsx85(Icon, { icon: "fa-solid fa-xmark" }),
42388
- /* @__PURE__ */ jsx85("span", { children: "Close" })
42526
+ /* @__PURE__ */ jsx86(Icon, { icon: "fa-solid fa-xmark" }),
42527
+ /* @__PURE__ */ jsx86("span", { children: "Close" })
42389
42528
  ] })
42390
42529
  ] });
42391
42530
  }
42392
42531
 
42393
42532
  // src/print/PrintPreview.tsx
42394
- import { useCallback as useCallback53, useEffect as useEffect68, useMemo as useMemo55, useRef as useRef62 } from "react";
42533
+ import { useCallback as useCallback53, useEffect as useEffect69, useMemo as useMemo55, useRef as useRef62 } from "react";
42395
42534
  import {
42396
- BlockRenderer as BlockRenderer4,
42535
+ BlockRenderer as BlockRenderer5,
42397
42536
  FlashcardFaceView,
42398
42537
  LinearDocView,
42399
42538
  useDocPlayback,
@@ -42404,7 +42543,7 @@ import {
42404
42543
  } from "@bendyline/squisq/schemas";
42405
42544
  import { expandCoverBlock as expandCoverBlock2, materializeFlashcards } from "@bendyline/squisq/doc";
42406
42545
  import { resolveTransformStyle } from "@bendyline/squisq/transform";
42407
- import { jsx as jsx86, jsxs as jsxs70 } from "react/jsx-runtime";
42546
+ import { jsx as jsx87, jsxs as jsxs70 } from "react/jsx-runtime";
42408
42547
  function chunk(values, size) {
42409
42548
  const groups = [];
42410
42549
  for (let index2 = 0; index2 < values.length; index2 += size) {
@@ -42448,7 +42587,7 @@ function PrintPreview({
42448
42587
  [contentDoc]
42449
42588
  );
42450
42589
  const isTextDocument = displayMode === "page" || displayMode === "narrate";
42451
- useEffect68(() => {
42590
+ useEffect69(() => {
42452
42591
  if (!isTextDocument) return registerPrintHandler(null);
42453
42592
  return registerPrintHandler(() => {
42454
42593
  const frameWindow = documentFrameRef.current?.contentWindow;
@@ -42458,7 +42597,7 @@ function PrintPreview({
42458
42597
  }, [isTextDocument, registerPrintHandler]);
42459
42598
  const title = contentDoc?.frontmatter?.title ?? contentDoc?.startBlock?.title ?? void 0;
42460
42599
  if (isTextDocument) {
42461
- return /* @__PURE__ */ jsx86("div", { className: "squisq-print-preview squisq-print-preview--document", children: /* @__PURE__ */ jsx86("div", { className: "squisq-print-document-paper", children: /* @__PURE__ */ jsx86(
42600
+ return /* @__PURE__ */ jsx87("div", { className: "squisq-print-preview squisq-print-preview--document", children: /* @__PURE__ */ jsx87("div", { className: "squisq-print-document-paper", children: /* @__PURE__ */ jsx87(
42462
42601
  PlainHtmlPreview,
42463
42602
  {
42464
42603
  markdown: documentMarkdown,
@@ -42473,8 +42612,8 @@ function PrintPreview({
42473
42612
  }
42474
42613
  if (displayMode === "linear") {
42475
42614
  return /* @__PURE__ */ jsxs70("div", { className: "squisq-print-preview squisq-print-preview--page", children: [
42476
- /* @__PURE__ */ jsx86("style", { children: "@page { margin: 0; }" }),
42477
- /* @__PURE__ */ jsx86("div", { className: "squisq-print-page-paper", children: /* @__PURE__ */ jsx86(
42615
+ /* @__PURE__ */ jsx87("style", { children: "@page { margin: 0; }" }),
42616
+ /* @__PURE__ */ jsx87("div", { className: "squisq-print-page-paper", children: /* @__PURE__ */ jsx87(
42478
42617
  LinearDocView,
42479
42618
  {
42480
42619
  className: "squisq-print-linear",
@@ -42509,7 +42648,7 @@ function PrintPreview({
42509
42648
  "--squisq-print-flashcard-surface": theme.colors.backgroundLight
42510
42649
  },
42511
42650
  children: [
42512
- /* @__PURE__ */ jsx86("style", { children: "@page { size: landscape; margin: 0; }" }),
42651
+ /* @__PURE__ */ jsx87("style", { children: "@page { size: landscape; margin: 0; }" }),
42513
42652
  flashcardDeck?.cards.map((card, index2) => /* @__PURE__ */ jsxs70("article", { className: "squisq-print-flashcard-sheet", children: [
42514
42653
  /* @__PURE__ */ jsxs70("header", { children: [
42515
42654
  /* @__PURE__ */ jsxs70("span", { children: [
@@ -42518,25 +42657,25 @@ function PrintPreview({
42518
42657
  " of ",
42519
42658
  flashcardDeck.cards.length
42520
42659
  ] }),
42521
- card.label && /* @__PURE__ */ jsx86("strong", { children: card.label })
42660
+ card.label && /* @__PURE__ */ jsx87("strong", { children: card.label })
42522
42661
  ] }),
42523
42662
  /* @__PURE__ */ jsxs70("div", { className: "squisq-print-flashcard-pair", children: [
42524
42663
  /* @__PURE__ */ jsxs70("section", { className: "squisq-print-flashcard-face", "aria-label": "Question side", children: [
42525
- /* @__PURE__ */ jsx86("small", { children: "Front" }),
42526
- /* @__PURE__ */ jsx86(FlashcardFaceView, { ...faceProps, face: card.front }),
42527
- card.kind === "multiple-choice" && /* @__PURE__ */ jsx86("ol", { className: "squisq-print-flashcard-choices", children: card.choices?.map((choice) => /* @__PURE__ */ jsx86("li", { children: /* @__PURE__ */ jsx86(FlashcardFaceView, { ...faceProps, face: choice.content }) }, choice.id)) })
42664
+ /* @__PURE__ */ jsx87("small", { children: "Front" }),
42665
+ /* @__PURE__ */ jsx87(FlashcardFaceView, { ...faceProps, face: card.front }),
42666
+ card.kind === "multiple-choice" && /* @__PURE__ */ jsx87("ol", { className: "squisq-print-flashcard-choices", children: card.choices?.map((choice) => /* @__PURE__ */ jsx87("li", { children: /* @__PURE__ */ jsx87(FlashcardFaceView, { ...faceProps, face: choice.content }) }, choice.id)) })
42528
42667
  ] }),
42529
42668
  /* @__PURE__ */ jsxs70("section", { className: "squisq-print-flashcard-face", "aria-label": "Answer side", children: [
42530
- /* @__PURE__ */ jsx86("small", { children: "Back" }),
42531
- /* @__PURE__ */ jsx86(FlashcardFaceView, { ...faceProps, face: card.back }),
42669
+ /* @__PURE__ */ jsx87("small", { children: "Back" }),
42670
+ /* @__PURE__ */ jsx87(FlashcardFaceView, { ...faceProps, face: card.back }),
42532
42671
  card.explanation && /* @__PURE__ */ jsxs70("div", { className: "squisq-print-flashcard-explanation", children: [
42533
- /* @__PURE__ */ jsx86("small", { children: "Explanation" }),
42534
- /* @__PURE__ */ jsx86(FlashcardFaceView, { ...faceProps, face: card.explanation })
42672
+ /* @__PURE__ */ jsx87("small", { children: "Explanation" }),
42673
+ /* @__PURE__ */ jsx87(FlashcardFaceView, { ...faceProps, face: card.explanation })
42535
42674
  ] })
42536
42675
  ] })
42537
42676
  ] })
42538
42677
  ] }, card.id)),
42539
- (!flashcardDeck || flashcardDeck.cards.length === 0) && /* @__PURE__ */ jsx86("p", { className: "squisq-print-empty", children: "Nothing to print." })
42678
+ (!flashcardDeck || flashcardDeck.cards.length === 0) && /* @__PURE__ */ jsx87("p", { className: "squisq-print-empty", children: "Nothing to print." })
42540
42679
  ]
42541
42680
  }
42542
42681
  );
@@ -42556,15 +42695,15 @@ function PrintPreview({
42556
42695
  "data-slides-per-page": density,
42557
42696
  style: previewStyle,
42558
42697
  children: [
42559
- /* @__PURE__ */ jsx86("style", { children: `@page { size: ${orientation}; margin: 0; }` }),
42560
- sheets.map((sheet, pageIndex) => /* @__PURE__ */ jsx86(
42698
+ /* @__PURE__ */ jsx87("style", { children: `@page { size: ${orientation}; margin: 0; }` }),
42699
+ sheets.map((sheet, pageIndex) => /* @__PURE__ */ jsx87(
42561
42700
  "div",
42562
42701
  {
42563
42702
  className: "squisq-print-sheet",
42564
42703
  "data-slides-per-page": density,
42565
42704
  "aria-label": `Print page ${pageIndex + 1}`,
42566
- children: sheet.map((block) => /* @__PURE__ */ jsx86("div", { className: "squisq-print-slide-cell", children: /* @__PURE__ */ jsx86("div", { className: "squisq-print-slide-frame", children: /* @__PURE__ */ jsx86(
42567
- BlockRenderer4,
42705
+ children: sheet.map((block) => /* @__PURE__ */ jsx87("div", { className: "squisq-print-slide-cell", children: /* @__PURE__ */ jsx87("div", { className: "squisq-print-slide-frame", children: /* @__PURE__ */ jsx87(
42706
+ BlockRenderer5,
42568
42707
  {
42569
42708
  block,
42570
42709
  blockTime: Math.max(0, block.duration),
@@ -42577,7 +42716,7 @@ function PrintPreview({
42577
42716
  },
42578
42717
  `${density}-${pageIndex}`
42579
42718
  )),
42580
- sheets.length === 0 && /* @__PURE__ */ jsx86("p", { className: "squisq-print-empty", children: "Nothing to print." })
42719
+ sheets.length === 0 && /* @__PURE__ */ jsx87("p", { className: "squisq-print-empty", children: "Nothing to print." })
42581
42720
  ]
42582
42721
  }
42583
42722
  );
@@ -42587,7 +42726,7 @@ function PrintPreview({
42587
42726
  import {
42588
42727
  createContext as createContext9,
42589
42728
  useContext as useContext9,
42590
- useEffect as useEffect69,
42729
+ useEffect as useEffect70,
42591
42730
  useMemo as useMemo56,
42592
42731
  useState as useState79
42593
42732
  } from "react";
@@ -42631,7 +42770,7 @@ function collectSlideshowDataSources(doc) {
42631
42770
  }
42632
42771
 
42633
42772
  // src/slideshow/SlideshowDataGrid.tsx
42634
- import { Fragment as Fragment28, jsx as jsx87 } from "react/jsx-runtime";
42773
+ import { Fragment as Fragment29, jsx as jsx88 } from "react/jsx-runtime";
42635
42774
  var EMPTY_CONTEXT = {
42636
42775
  container: null,
42637
42776
  mediaRevision: 0,
@@ -42649,7 +42788,7 @@ function SlideshowDataGridProvider({
42649
42788
  () => ({ container: container ?? null, mediaRevision, sources }),
42650
42789
  [container, mediaRevision, sources]
42651
42790
  );
42652
- return /* @__PURE__ */ jsx87(SlideshowDataGridContext.Provider, { value, children });
42791
+ return /* @__PURE__ */ jsx88(SlideshowDataGridContext.Provider, { value, children });
42653
42792
  }
42654
42793
  var EMPTY_VIEW = { sort: [], filter: [] };
42655
42794
  function sourceKey(source) {
@@ -42694,7 +42833,7 @@ function SlideshowDataGridRenderer({
42694
42833
  const activeSourceKey = sourceKey(source);
42695
42834
  const [remote, setRemote] = useState79({ key: "", status: "idle" });
42696
42835
  const [gridModule, setGridModule] = useState79(null);
42697
- useEffect69(() => {
42836
+ useEffect70(() => {
42698
42837
  let active = true;
42699
42838
  void loadGridModule().then((module) => {
42700
42839
  if (active) setGridModule(module);
@@ -42703,7 +42842,7 @@ function SlideshowDataGridRenderer({
42703
42842
  active = false;
42704
42843
  };
42705
42844
  }, []);
42706
- useEffect69(() => {
42845
+ useEffect70(() => {
42707
42846
  if (!container || !source || !gridModule) {
42708
42847
  setRemote({ key: activeSourceKey, status: "idle" });
42709
42848
  return;
@@ -42754,14 +42893,14 @@ function SlideshowDataGridRenderer({
42754
42893
  () => useLocalGrid && gridModule ? new gridModule.TableStoreClient({ headers: previewHeaders, cells: previewRows }) : null,
42755
42894
  [previewHeaders, previewRows, useLocalGrid, gridModule]
42756
42895
  );
42757
- useEffect69(() => () => localProvider?.dispose(), [localProvider]);
42896
+ useEffect70(() => () => localProvider?.dispose(), [localProvider]);
42758
42897
  const ready = currentRemote?.status === "ready" ? currentRemote : void 0;
42759
42898
  const provider = ready?.provider ?? localProvider;
42760
42899
  const ingest = ready?.ingest ?? (localProvider ? { headers: previewHeaders, cells: previewRows } : void 0);
42761
42900
  const initialView = ready?.initialView ?? EMPTY_VIEW;
42762
42901
  const [view, setView] = useState79(initialView);
42763
- useEffect69(() => setView(initialView), [initialView, provider]);
42764
- if (!provider || !ingest || !gridModule) return /* @__PURE__ */ jsx87(Fragment28, { children: fallback });
42902
+ useEffect70(() => setView(initialView), [initialView, provider]);
42903
+ if (!provider || !ingest || !gridModule) return /* @__PURE__ */ jsx88(Fragment29, { children: fallback });
42765
42904
  const { style } = layer.content;
42766
42905
  const rowHeight = Math.max(32, style.fontSize * 2.1);
42767
42906
  const footerHeight = Math.max(28, style.fontSize * 1.5);
@@ -42790,7 +42929,7 @@ function SlideshowDataGridRenderer({
42790
42929
  "--squisq-grid-accent": style.headerBackground,
42791
42930
  "--squisq-grid-resize-handle": style.headerBackground
42792
42931
  };
42793
- return /* @__PURE__ */ jsx87("div", { className: "squisq-slideshow-data-grid", style: gridStyle, children: /* @__PURE__ */ jsx87(
42932
+ return /* @__PURE__ */ jsx88("div", { className: "squisq-slideshow-data-grid", style: gridStyle, children: /* @__PURE__ */ jsx88(
42794
42933
  gridModule.DataGrid,
42795
42934
  {
42796
42935
  provider,
@@ -42806,7 +42945,7 @@ function SlideshowDataGridRenderer({
42806
42945
 
42807
42946
  // src/PreviewPanel.tsx
42808
42947
  import { useProcessedAudio as useProcessedAudio3 } from "@bendyline/squisq-video-react/media-edit";
42809
- import { jsx as jsx88, jsxs as jsxs71 } from "react/jsx-runtime";
42948
+ import { jsx as jsx89, jsxs as jsxs71 } from "react/jsx-runtime";
42810
42949
  function PreviewPanel({
42811
42950
  basePath = "/",
42812
42951
  className,
@@ -42897,11 +43036,11 @@ function PreviewPanel({
42897
43036
  const isNarrateMode = activeDisplayMode === "narrate";
42898
43037
  const isDashboardMode = activeDisplayMode === "dashboard";
42899
43038
  const isFlashcardsMode = activeDisplayMode === "flashcards";
42900
- useEffect70(() => {
43039
+ useEffect71(() => {
42901
43040
  if (presentation?.activeTarget === "window") return;
42902
43041
  setPlaybackState(null);
42903
43042
  }, [presentation?.activeTarget]);
42904
- useEffect70(() => {
43043
+ useEffect71(() => {
42905
43044
  if (presentation?.activeTarget !== "window" || !presentation.popupRoot) return;
42906
43045
  const mainRoot = mainSurfaceRef.current;
42907
43046
  const followerRoot = popupSurfaceRef.current;
@@ -42964,22 +43103,22 @@ function PreviewPanel({
42964
43103
  presentation?.popupRoot
42965
43104
  ]);
42966
43105
  if (isParsing && !isNarrateMode && !previewDoc) {
42967
- return /* @__PURE__ */ jsx88("div", { className: `squisq-preview-status ${className || ""}`, "data-testid": "preview-panel", children: /* @__PURE__ */ jsx88("p", { children: "Parsing\u2026" }) });
43106
+ return /* @__PURE__ */ jsx89("div", { className: `squisq-preview-status ${className || ""}`, "data-testid": "preview-panel", children: /* @__PURE__ */ jsx89("p", { children: "Parsing\u2026" }) });
42968
43107
  }
42969
43108
  if (parseError && !isNarrateMode) {
42970
43109
  return /* @__PURE__ */ jsxs71("div", { className: `squisq-preview-status ${className || ""}`, "data-testid": "preview-panel", children: [
42971
- /* @__PURE__ */ jsx88("h3", { children: "Parse Error" }),
42972
- /* @__PURE__ */ jsx88("pre", { children: parseError })
43110
+ /* @__PURE__ */ jsx89("h3", { children: "Parse Error" }),
43111
+ /* @__PURE__ */ jsx89("pre", { children: parseError })
42973
43112
  ] });
42974
43113
  }
42975
43114
  if (!previewDoc && !isDocumentMode && !isNarrateMode) {
42976
- return /* @__PURE__ */ jsx88("div", { className: `squisq-preview-status ${className || ""}`, "data-testid": "preview-panel", children: /* @__PURE__ */ jsx88("p", { children: "No content to preview. Start typing in the editor." }) });
43115
+ return /* @__PURE__ */ jsx89("div", { className: `squisq-preview-status ${className || ""}`, "data-testid": "preview-panel", children: /* @__PURE__ */ jsx89("p", { children: "No content to preview. Start typing in the editor." }) });
42977
43116
  }
42978
43117
  const fillsContainer = printMode?.active || isDocumentMode || isPageMode || isNarrateMode || isFlashcardsMode ? "stretch" : "center";
42979
43118
  const audienceWindowOpen = presentation?.activeTarget === "window";
42980
43119
  const renderSurface = (audience) => {
42981
43120
  if (!audience && printMode?.active) {
42982
- return /* @__PURE__ */ jsx88(
43121
+ return /* @__PURE__ */ jsx89(
42983
43122
  PrintPreview,
42984
43123
  {
42985
43124
  displayMode: activeDisplayMode,
@@ -42997,7 +43136,7 @@ function PreviewPanel({
42997
43136
  );
42998
43137
  }
42999
43138
  if (isDocumentMode) {
43000
- return /* @__PURE__ */ jsx88(
43139
+ return /* @__PURE__ */ jsx89(
43001
43140
  PlainHtmlPreview,
43002
43141
  {
43003
43142
  markdown: documentMarkdown,
@@ -43016,7 +43155,7 @@ function PreviewPanel({
43016
43155
  }
43017
43156
  if (isNarrateMode) {
43018
43157
  if (audience) return null;
43019
- return /* @__PURE__ */ jsx88(
43158
+ return /* @__PURE__ */ jsx89(
43020
43159
  TeleprompterView,
43021
43160
  {
43022
43161
  doc,
@@ -43035,7 +43174,7 @@ function PreviewPanel({
43035
43174
  );
43036
43175
  }
43037
43176
  if (isPageMode) {
43038
- return /* @__PURE__ */ jsx88(
43177
+ return /* @__PURE__ */ jsx89(
43039
43178
  LinearDocView2,
43040
43179
  {
43041
43180
  doc: contentDoc ?? doc,
@@ -43052,7 +43191,7 @@ function PreviewPanel({
43052
43191
  );
43053
43192
  }
43054
43193
  if (isFlashcardsMode) {
43055
- return /* @__PURE__ */ jsx88(
43194
+ return /* @__PURE__ */ jsx89(
43056
43195
  FlashcardView,
43057
43196
  {
43058
43197
  doc: contentDoc ?? doc,
@@ -43067,7 +43206,7 @@ function PreviewPanel({
43067
43206
  );
43068
43207
  }
43069
43208
  if (isDashboardMode) {
43070
- return /* @__PURE__ */ jsx88("div", { className: "squisq-dashboard-fit", children: /* @__PURE__ */ jsx88(
43209
+ return /* @__PURE__ */ jsx89("div", { className: "squisq-dashboard-fit", children: /* @__PURE__ */ jsx89(
43071
43210
  DashboardView,
43072
43211
  {
43073
43212
  doc: contentDoc ?? doc,
@@ -43082,10 +43221,10 @@ function PreviewPanel({
43082
43221
  ) });
43083
43222
  }
43084
43223
  if (audience && !followerAudioController) {
43085
- return /* @__PURE__ */ jsx88("div", { className: "squisq-presentation-connecting", children: "Connecting presentation..." });
43224
+ return /* @__PURE__ */ jsx89("div", { className: "squisq-presentation-connecting", children: "Connecting presentation..." });
43086
43225
  }
43087
43226
  const audienceCaptionMode = playbackState?.captionMode;
43088
- return /* @__PURE__ */ jsx88(
43227
+ return /* @__PURE__ */ jsx89(
43089
43228
  DocPlayer2,
43090
43229
  {
43091
43230
  doc: previewDoc,
@@ -43136,7 +43275,7 @@ function PreviewPanel({
43136
43275
  container: workspaceContainer,
43137
43276
  mediaRevision,
43138
43277
  children: [
43139
- /* @__PURE__ */ jsx88(
43278
+ /* @__PURE__ */ jsx89(
43140
43279
  "div",
43141
43280
  {
43142
43281
  className: `squisq-preview-container ${className || ""}`,
@@ -43149,16 +43288,16 @@ function PreviewPanel({
43149
43288
  overflow: "hidden",
43150
43289
  background: "var(--squisq-bg)"
43151
43290
  },
43152
- children: /* @__PURE__ */ jsx88("div", { ref: mainSurfaceRef, className: "squisq-preview-player", style: surfaceStyle, children: renderSurface(false) })
43291
+ children: /* @__PURE__ */ jsx89("div", { ref: mainSurfaceRef, className: "squisq-preview-player", style: surfaceStyle, children: renderSurface(false) })
43153
43292
  }
43154
43293
  ),
43155
43294
  audienceWindowOpen && presentation?.popupRoot && !isNarrateMode ? createPortal18(
43156
- /* @__PURE__ */ jsx88(
43295
+ /* @__PURE__ */ jsx89(
43157
43296
  "div",
43158
43297
  {
43159
43298
  className: "squisq-editor-shell squisq-presentation-window",
43160
43299
  "data-theme": colorScheme,
43161
- children: /* @__PURE__ */ jsx88("div", { className: "squisq-preview-container squisq-presentation-window-preview", children: /* @__PURE__ */ jsx88(
43300
+ children: /* @__PURE__ */ jsx89("div", { className: "squisq-preview-container squisq-presentation-window-preview", children: /* @__PURE__ */ jsx89(
43162
43301
  "div",
43163
43302
  {
43164
43303
  ref: popupSurfaceRef,
@@ -43178,13 +43317,13 @@ function PreviewPanel({
43178
43317
  }
43179
43318
 
43180
43319
  // src/MediaBin.tsx
43181
- import { useState as useState82, useEffect as useEffect72, useRef as useRef65, useCallback as useCallback55 } from "react";
43320
+ import { useState as useState82, useEffect as useEffect73, useRef as useRef65, useCallback as useCallback55 } from "react";
43182
43321
  import { isSvgImageSource as isSvgImageSource3 } from "@bendyline/squisq/markdown";
43183
43322
  import { sanitizedSvgImageUrl as sanitizedSvgImageUrl2 } from "@bendyline/squisq-react";
43184
43323
 
43185
43324
  // src/MediaPreviewDialog.tsx
43186
- import { useEffect as useEffect71, useId as useId16, useRef as useRef64, useState as useState81 } from "react";
43187
- import { jsx as jsx89, jsxs as jsxs72 } from "react/jsx-runtime";
43325
+ import { useEffect as useEffect72, useId as useId16, useRef as useRef64, useState as useState81 } from "react";
43326
+ import { jsx as jsx90, jsxs as jsxs72 } from "react/jsx-runtime";
43188
43327
  function MediaPreviewDialog({
43189
43328
  kind,
43190
43329
  name,
@@ -43199,16 +43338,16 @@ function MediaPreviewDialog({
43199
43338
  const titleId = useId16();
43200
43339
  const [playbackFailed, setPlaybackFailed] = useState81(false);
43201
43340
  useModalDialog({ rootRef: overlayRef, dialogRef, onClose });
43202
- useEffect71(() => setPlaybackFailed(false), [src]);
43341
+ useEffect72(() => setPlaybackFailed(false), [src]);
43203
43342
  let body;
43204
43343
  if (failed || playbackFailed || src === "") {
43205
- body = /* @__PURE__ */ jsx89("div", { className: "squisq-media-preview-message", children: "This file can\u2019t be previewed." });
43344
+ body = /* @__PURE__ */ jsx90("div", { className: "squisq-media-preview-message", children: "This file can\u2019t be previewed." });
43206
43345
  } else if (src === null) {
43207
- body = /* @__PURE__ */ jsx89("div", { className: "squisq-media-preview-message", children: "Loading\u2026" });
43346
+ body = /* @__PURE__ */ jsx90("div", { className: "squisq-media-preview-message", children: "Loading\u2026" });
43208
43347
  } else if (kind === "image") {
43209
- body = /* @__PURE__ */ jsx89(ImageViewer, { src, alt: name, theme: isDark ? "dark" : "light" });
43348
+ body = /* @__PURE__ */ jsx90(ImageViewer, { src, alt: name, theme: isDark ? "dark" : "light" });
43210
43349
  } else if (kind === "video") {
43211
- body = /* @__PURE__ */ jsx89(
43350
+ body = /* @__PURE__ */ jsx90(
43212
43351
  "video",
43213
43352
  {
43214
43353
  className: "squisq-media-preview-video",
@@ -43221,11 +43360,11 @@ function MediaPreviewDialog({
43221
43360
  );
43222
43361
  } else {
43223
43362
  body = /* @__PURE__ */ jsxs72("div", { className: "squisq-media-preview-audio", children: [
43224
- /* @__PURE__ */ jsx89("span", { className: "squisq-media-preview-audio-icon", "aria-hidden": "true", children: "\u{1F50A}" }),
43225
- /* @__PURE__ */ jsx89("audio", { src, controls: true, autoPlay: true, onError: () => setPlaybackFailed(true) })
43363
+ /* @__PURE__ */ jsx90("span", { className: "squisq-media-preview-audio-icon", "aria-hidden": "true", children: "\u{1F50A}" }),
43364
+ /* @__PURE__ */ jsx90("audio", { src, controls: true, autoPlay: true, onError: () => setPlaybackFailed(true) })
43226
43365
  ] });
43227
43366
  }
43228
- return /* @__PURE__ */ jsx89(
43367
+ return /* @__PURE__ */ jsx90(
43229
43368
  "div",
43230
43369
  {
43231
43370
  ref: overlayRef,
@@ -43247,9 +43386,9 @@ function MediaPreviewDialog({
43247
43386
  "data-testid": "media-preview-dialog",
43248
43387
  children: [
43249
43388
  /* @__PURE__ */ jsxs72("header", { className: "squisq-media-preview-header", children: [
43250
- /* @__PURE__ */ jsx89("span", { id: titleId, className: "squisq-media-preview-title", title: name, children: name }),
43251
- /* @__PURE__ */ jsx89("span", { className: "squisq-media-preview-detail", children: detail }),
43252
- /* @__PURE__ */ jsx89(
43389
+ /* @__PURE__ */ jsx90("span", { id: titleId, className: "squisq-media-preview-title", title: name, children: name }),
43390
+ /* @__PURE__ */ jsx90("span", { className: "squisq-media-preview-detail", children: detail }),
43391
+ /* @__PURE__ */ jsx90(
43253
43392
  "button",
43254
43393
  {
43255
43394
  type: "button",
@@ -43260,7 +43399,7 @@ function MediaPreviewDialog({
43260
43399
  }
43261
43400
  )
43262
43401
  ] }),
43263
- /* @__PURE__ */ jsx89("div", { className: "squisq-media-preview-body", children: body })
43402
+ /* @__PURE__ */ jsx90("div", { className: "squisq-media-preview-body", children: body })
43264
43403
  ]
43265
43404
  }
43266
43405
  )
@@ -43269,7 +43408,7 @@ function MediaPreviewDialog({
43269
43408
  }
43270
43409
 
43271
43410
  // src/MediaBin.tsx
43272
- import { Fragment as Fragment29, jsx as jsx90, jsxs as jsxs73 } from "react/jsx-runtime";
43411
+ import { Fragment as Fragment30, jsx as jsx91, jsxs as jsxs73 } from "react/jsx-runtime";
43273
43412
  function formatSize(bytes) {
43274
43413
  if (bytes < 1024) return `${bytes} B`;
43275
43414
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
@@ -43343,7 +43482,7 @@ function MediaBin({
43343
43482
  }) {
43344
43483
  const [entries, setEntries] = useState82([]);
43345
43484
  const listRef = useRef65(null);
43346
- useEffect72(() => {
43485
+ useEffect73(() => {
43347
43486
  if (!highlightPath || !listRef.current) return;
43348
43487
  const item = listRef.current.querySelector(`[data-media-path="${CSS.escape(highlightPath)}"]`);
43349
43488
  if (item instanceof HTMLElement) {
@@ -43377,7 +43516,7 @@ function MediaBin({
43377
43516
  },
43378
43517
  [onCountChange]
43379
43518
  );
43380
- useEffect72(() => {
43519
+ useEffect73(() => {
43381
43520
  if (!contextMenu) return;
43382
43521
  const handlePointerDown = (event) => {
43383
43522
  if (contextMenuRef.current?.contains(event.target)) return;
@@ -43398,7 +43537,7 @@ function MediaBin({
43398
43537
  window.removeEventListener("resize", close);
43399
43538
  };
43400
43539
  }, [contextMenu]);
43401
- useEffect72(() => {
43540
+ useEffect73(() => {
43402
43541
  if (!mediaProvider) {
43403
43542
  setEntries([]);
43404
43543
  setThumbUrls({});
@@ -43555,7 +43694,7 @@ function MediaBin({
43555
43694
  const openContextMenu = useCallback55((entry, x, y) => {
43556
43695
  setContextMenu({ entry, x, y });
43557
43696
  }, []);
43558
- useEffect72(() => {
43697
+ useEffect73(() => {
43559
43698
  setPreview(null);
43560
43699
  }, [mediaProvider]);
43561
43700
  const openPreview = useCallback55(
@@ -43600,7 +43739,7 @@ function MediaBin({
43600
43739
  [openContextMenu, openPreview]
43601
43740
  );
43602
43741
  const previewKind = preview ? squisqMediaKind(preview.entry.mimeType) : "file";
43603
- return /* @__PURE__ */ jsxs73(Fragment29, { children: [
43742
+ return /* @__PURE__ */ jsxs73(Fragment30, { children: [
43604
43743
  /* @__PURE__ */ jsxs73(
43605
43744
  "div",
43606
43745
  {
@@ -43634,8 +43773,8 @@ function MediaBin({
43634
43773
  "aria-haspopup": "dialog",
43635
43774
  "aria-expanded": isRecorderOpen,
43636
43775
  children: [
43637
- /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-action-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-record-dot" }) }),
43638
- /* @__PURE__ */ jsx90("span", { children: "Record" })
43776
+ /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-action-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-record-dot" }) }),
43777
+ /* @__PURE__ */ jsx91("span", { children: "Record" })
43639
43778
  ]
43640
43779
  }
43641
43780
  ),
@@ -43648,8 +43787,8 @@ function MediaBin({
43648
43787
  disabled: !mediaProvider || loading,
43649
43788
  title: mediaProvider ? "Upload files" : "Load a content zip or select a storage slot first",
43650
43789
  children: [
43651
- /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-action-icon", children: "+" }),
43652
- /* @__PURE__ */ jsx90("span", { children: "Upload" })
43790
+ /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-action-icon", children: "+" }),
43791
+ /* @__PURE__ */ jsx91("span", { children: "Upload" })
43653
43792
  ]
43654
43793
  }
43655
43794
  )
@@ -43658,10 +43797,10 @@ function MediaBin({
43658
43797
  /* @__PURE__ */ jsxs73("div", { className: "squisq-media-bin-list", ref: listRef, children: [
43659
43798
  !mediaProvider && /* @__PURE__ */ jsxs73("div", { className: "squisq-media-bin-empty", children: [
43660
43799
  "No media context.",
43661
- /* @__PURE__ */ jsx90("br", {}),
43800
+ /* @__PURE__ */ jsx91("br", {}),
43662
43801
  "Load a content zip or select a storage slot."
43663
43802
  ] }),
43664
- mediaProvider && entries.length === 0 && !loading && /* @__PURE__ */ jsx90("div", { className: "squisq-media-bin-empty", children: "No files yet." }),
43803
+ mediaProvider && entries.length === 0 && !loading && /* @__PURE__ */ jsx91("div", { className: "squisq-media-bin-empty", children: "No files yet." }),
43665
43804
  entries.map((entry) => {
43666
43805
  const thumb = thumbUrls[entry.name];
43667
43806
  const basename = basenameForPath(entry.name);
@@ -43700,7 +43839,7 @@ ${formatSize(entry.size)}`,
43700
43839
  onDragStart: handleDragStart,
43701
43840
  onKeyDown: (e2) => handleItemKeyDown(entry, e2),
43702
43841
  children: [
43703
- thumb ? /* @__PURE__ */ jsx90(
43842
+ thumb ? /* @__PURE__ */ jsx91(
43704
43843
  "img",
43705
43844
  {
43706
43845
  src: thumb,
@@ -43708,15 +43847,15 @@ ${formatSize(entry.size)}`,
43708
43847
  className: "squisq-media-bin-thumb",
43709
43848
  draggable: false
43710
43849
  }
43711
- ) : /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-icon", children: iconForMime(entry.mimeType) }),
43850
+ ) : /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-icon", children: iconForMime(entry.mimeType) }),
43712
43851
  /* @__PURE__ */ jsxs73("div", { className: "squisq-media-bin-meta", children: [
43713
- /* @__PURE__ */ jsx90("div", { className: "squisq-media-bin-name", children: basename }),
43852
+ /* @__PURE__ */ jsx91("div", { className: "squisq-media-bin-name", children: basename }),
43714
43853
  /* @__PURE__ */ jsxs73("div", { className: "squisq-media-bin-detail-row", children: [
43715
- /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-size", children: formatSize(entry.size) }),
43716
- isUnused && /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-unused-badge", title: "Not used in document", children: "Unused" })
43854
+ /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-size", children: formatSize(entry.size) }),
43855
+ isUnused && /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-unused-badge", title: "Not used in document", children: "Unused" })
43717
43856
  ] })
43718
43857
  ] }),
43719
- allowBinaryDownloads && /* @__PURE__ */ jsx90(
43858
+ allowBinaryDownloads && /* @__PURE__ */ jsx91(
43720
43859
  "button",
43721
43860
  {
43722
43861
  type: "button",
@@ -43730,7 +43869,7 @@ ${formatSize(entry.size)}`,
43730
43869
  void handleDownloadEntry(entry);
43731
43870
  },
43732
43871
  onDragStart: (event) => event.preventDefault(),
43733
- children: /* @__PURE__ */ jsx90("span", { "aria-hidden": "true", children: downloadingPath === entry.name ? "\u2026" : "\u2193" })
43872
+ children: /* @__PURE__ */ jsx91("span", { "aria-hidden": "true", children: downloadingPath === entry.name ? "\u2026" : "\u2193" })
43734
43873
  }
43735
43874
  )
43736
43875
  ]
@@ -43740,11 +43879,11 @@ ${formatSize(entry.size)}`,
43740
43879
  })
43741
43880
  ] }),
43742
43881
  isDropActive && /* @__PURE__ */ jsxs73("div", { className: "squisq-media-bin-drop-target", "aria-hidden": "true", children: [
43743
- /* @__PURE__ */ jsx90("span", { className: "squisq-media-bin-drop-target-icon", children: "+" }),
43744
- /* @__PURE__ */ jsx90("strong", { children: "Drop media here" }),
43745
- /* @__PURE__ */ jsx90("span", { children: "Attach to this document" })
43882
+ /* @__PURE__ */ jsx91("span", { className: "squisq-media-bin-drop-target-icon", children: "+" }),
43883
+ /* @__PURE__ */ jsx91("strong", { children: "Drop media here" }),
43884
+ /* @__PURE__ */ jsx91("span", { children: "Attach to this document" })
43746
43885
  ] }),
43747
- contextMenu && /* @__PURE__ */ jsx90(
43886
+ contextMenu && /* @__PURE__ */ jsx91(
43748
43887
  "div",
43749
43888
  {
43750
43889
  ref: contextMenuRef,
@@ -43752,7 +43891,7 @@ ${formatSize(entry.size)}`,
43752
43891
  role: "menu",
43753
43892
  "aria-label": `${contextMenu.entry.name} actions`,
43754
43893
  style: contextMenuStyle,
43755
- children: /* @__PURE__ */ jsx90(
43894
+ children: /* @__PURE__ */ jsx91(
43756
43895
  "button",
43757
43896
  {
43758
43897
  type: "button",
@@ -43765,7 +43904,7 @@ ${formatSize(entry.size)}`,
43765
43904
  )
43766
43905
  }
43767
43906
  ),
43768
- /* @__PURE__ */ jsx90(
43907
+ /* @__PURE__ */ jsx91(
43769
43908
  "input",
43770
43909
  {
43771
43910
  ref: fileInputRef,
@@ -43778,7 +43917,7 @@ ${formatSize(entry.size)}`,
43778
43917
  ]
43779
43918
  }
43780
43919
  ),
43781
- preview && previewKind !== "file" && /* @__PURE__ */ jsx90(
43920
+ preview && previewKind !== "file" && /* @__PURE__ */ jsx91(
43782
43921
  MediaPreviewDialog,
43783
43922
  {
43784
43923
  kind: previewKind,
@@ -43795,7 +43934,7 @@ ${formatSize(entry.size)}`,
43795
43934
 
43796
43935
  // src/DropZoneOverlay.tsx
43797
43936
  import { useState as useState83 } from "react";
43798
- import { Fragment as Fragment30, jsx as jsx91, jsxs as jsxs74 } from "react/jsx-runtime";
43937
+ import { Fragment as Fragment31, jsx as jsx92, jsxs as jsxs74 } from "react/jsx-runtime";
43799
43938
  function DropZoneOverlay({
43800
43939
  dragContentType,
43801
43940
  zoneProps,
@@ -43803,8 +43942,8 @@ function DropZoneOverlay({
43803
43942
  }) {
43804
43943
  const showMedia = dragContentType === "media" || dragContentType === "mixed";
43805
43944
  const showText = dragContentType === "text" || dragContentType === "mixed";
43806
- return /* @__PURE__ */ jsx91("div", { className: "squisq-drop-overlay", children: /* @__PURE__ */ jsxs74("div", { className: "squisq-drop-overlay-inner", children: [
43807
- showMedia && /* @__PURE__ */ jsx91(
43945
+ return /* @__PURE__ */ jsx92("div", { className: "squisq-drop-overlay", children: /* @__PURE__ */ jsxs74("div", { className: "squisq-drop-overlay-inner", children: [
43946
+ showMedia && /* @__PURE__ */ jsx92(
43808
43947
  DropZone,
43809
43948
  {
43810
43949
  target: "media",
@@ -43816,8 +43955,8 @@ function DropZoneOverlay({
43816
43955
  variant: "media"
43817
43956
  }
43818
43957
  ),
43819
- showText && /* @__PURE__ */ jsxs74(Fragment30, { children: [
43820
- /* @__PURE__ */ jsx91(
43958
+ showText && /* @__PURE__ */ jsxs74(Fragment31, { children: [
43959
+ /* @__PURE__ */ jsx92(
43821
43960
  DropZone,
43822
43961
  {
43823
43962
  target: "insert",
@@ -43828,7 +43967,7 @@ function DropZoneOverlay({
43828
43967
  variant: "insert"
43829
43968
  }
43830
43969
  ),
43831
- /* @__PURE__ */ jsx91(
43970
+ /* @__PURE__ */ jsx92(
43832
43971
  DropZone,
43833
43972
  {
43834
43973
  target: "replace",
@@ -43886,16 +44025,16 @@ function DropZone({
43886
44025
  props.onDrop(e2);
43887
44026
  },
43888
44027
  children: [
43889
- /* @__PURE__ */ jsx91("span", { className: "squisq-drop-zone-icon", children: icon }),
43890
- /* @__PURE__ */ jsx91("span", { className: "squisq-drop-zone-label", children: label }),
43891
- /* @__PURE__ */ jsx91("span", { className: "squisq-drop-zone-desc", children: description })
44028
+ /* @__PURE__ */ jsx92("span", { className: "squisq-drop-zone-icon", children: icon }),
44029
+ /* @__PURE__ */ jsx92("span", { className: "squisq-drop-zone-label", children: label }),
44030
+ /* @__PURE__ */ jsx92("span", { className: "squisq-drop-zone-desc", children: description })
43892
44031
  ]
43893
44032
  }
43894
44033
  );
43895
44034
  }
43896
44035
 
43897
44036
  // src/Tooltip.tsx
43898
- import { useEffect as useEffect73, useLayoutEffect as useLayoutEffect16, useRef as useRef66, useState as useState84 } from "react";
44037
+ import { useEffect as useEffect74, useLayoutEffect as useLayoutEffect16, useRef as useRef66, useState as useState84 } from "react";
43899
44038
  import { createPortal as createPortal19 } from "react-dom";
43900
44039
 
43901
44040
  // src/tooltipPlacement.ts
@@ -43908,7 +44047,7 @@ function clampTooltipLeft(anchorX, tooltipWidth, viewportWidth, edgePadding = ED
43908
44047
  }
43909
44048
 
43910
44049
  // src/Tooltip.tsx
43911
- import { jsx as jsx92 } from "react/jsx-runtime";
44050
+ import { jsx as jsx93 } from "react/jsx-runtime";
43912
44051
  var SHOW_DELAY_MS = 180;
43913
44052
  function TooltipLayer() {
43914
44053
  const [state, setState3] = useState84(null);
@@ -43929,7 +44068,7 @@ function TooltipLayer() {
43929
44068
  node2.style.left = `${left}px`;
43930
44069
  node2.style.visibility = "visible";
43931
44070
  }, [state]);
43932
- useEffect73(() => {
44071
+ useEffect74(() => {
43933
44072
  const clearTimer = () => {
43934
44073
  if (timerRef.current) {
43935
44074
  clearTimeout(timerRef.current);
@@ -44011,7 +44150,7 @@ function TooltipLayer() {
44011
44150
  }, []);
44012
44151
  if (!state) return null;
44013
44152
  return createPortal19(
44014
- /* @__PURE__ */ jsx92(
44153
+ /* @__PURE__ */ jsx93(
44015
44154
  "div",
44016
44155
  {
44017
44156
  role: "tooltip",
@@ -44031,18 +44170,18 @@ function TooltipLayer() {
44031
44170
  }
44032
44171
 
44033
44172
  // src/EditorShell.tsx
44034
- import { useEffect as useEffect80, useRef as useRef75, useState as useState91, useCallback as useCallback63, useMemo as useMemo62 } from "react";
44173
+ import { useEffect as useEffect81, useRef as useRef75, useState as useState91, useCallback as useCallback63, useMemo as useMemo62 } from "react";
44035
44174
 
44036
44175
  // src/BlockPreviewPanel.tsx
44037
44176
  import { useMemo as useMemo58 } from "react";
44038
- import { VIEWPORT_PRESETS as VIEWPORT_PRESETS7 } from "@bendyline/squisq/schemas";
44177
+ import { VIEWPORT_PRESETS as VIEWPORT_PRESETS8 } from "@bendyline/squisq/schemas";
44039
44178
  import { flattenBlocks as flattenBlocks6, DEFAULT_THEME as DEFAULT_THEME7 } from "@bendyline/squisq/doc";
44040
- import { jsx as jsx93 } from "react/jsx-runtime";
44179
+ import { jsx as jsx94 } from "react/jsx-runtime";
44041
44180
  function BlockPreviewPanel({ basePath = "/" }) {
44042
44181
  const { doc, activeBlockStartLine, mediaProvider, workspaceContainer, fileName, mediaRevision } = useEditorContext();
44043
44182
  const previewSettings = usePreviewSettingsOptional();
44044
44183
  const theme = previewSettings?.activeTheme ?? DEFAULT_THEME7;
44045
- const viewport = previewSettings?.activeViewport ?? VIEWPORT_PRESETS7.landscape;
44184
+ const viewport = previewSettings?.activeViewport ?? VIEWPORT_PRESETS8.landscape;
44046
44185
  const projection = usePreviewProjection(doc, "", workspaceContainer, fileName, mediaRevision);
44047
44186
  const previewDoc = projection?.contentDoc ?? doc;
44048
44187
  const block = useMemo58(() => {
@@ -44056,12 +44195,12 @@ function BlockPreviewPanel({ basePath = "/" }) {
44056
44195
  [previewDoc, block, theme, viewport]
44057
44196
  );
44058
44197
  if (!visual) return null;
44059
- return /* @__PURE__ */ jsx93("div", { className: "squisq-block-preview-panel", "data-testid": "block-preview-panel", "aria-hidden": true, children: /* @__PURE__ */ jsx93(
44198
+ return /* @__PURE__ */ jsx94("div", { className: "squisq-block-preview-panel", "data-testid": "block-preview-panel", "aria-hidden": true, children: /* @__PURE__ */ jsx94(
44060
44199
  "div",
44061
44200
  {
44062
44201
  className: "squisq-block-preview-frame",
44063
44202
  style: { aspectRatio: `${viewport.width} / ${viewport.height}` },
44064
- children: /* @__PURE__ */ jsx93(
44203
+ children: /* @__PURE__ */ jsx94(
44065
44204
  BlockThumbnail,
44066
44205
  {
44067
44206
  visual,
@@ -44075,17 +44214,17 @@ function BlockPreviewPanel({ basePath = "/" }) {
44075
44214
  }
44076
44215
 
44077
44216
  // src/NavigationSheet.tsx
44078
- import { useCallback as useCallback57, useEffect as useEffect75, useId as useId17, useRef as useRef69, useState as useState85 } from "react";
44217
+ import { useCallback as useCallback57, useEffect as useEffect76, useId as useId17, useRef as useRef69, useState as useState85 } from "react";
44079
44218
 
44080
44219
  // src/BlockPreviewList.tsx
44081
44220
  import { useCallback as useCallback56, useRef as useRef67 } from "react";
44082
- import { VIEWPORT_PRESETS as VIEWPORT_PRESETS8 } from "@bendyline/squisq/schemas";
44221
+ import { VIEWPORT_PRESETS as VIEWPORT_PRESETS9 } from "@bendyline/squisq/schemas";
44083
44222
  import { flattenBlocks as flattenBlocks7 } from "@bendyline/squisq/doc";
44084
- import { BlockRenderer as BlockRenderer5, MediaContext as MediaContext6 } from "@bendyline/squisq-react";
44085
- import { Fragment as Fragment31, jsx as jsx94, jsxs as jsxs75 } from "react/jsx-runtime";
44223
+ import { BlockRenderer as BlockRenderer6, MediaContext as MediaContext7 } from "@bendyline/squisq-react";
44224
+ import { Fragment as Fragment32, jsx as jsx95, jsxs as jsxs75 } from "react/jsx-runtime";
44086
44225
  function BlockPreviewList({
44087
44226
  basePath = "/",
44088
- viewport = VIEWPORT_PRESETS8.landscape,
44227
+ viewport = VIEWPORT_PRESETS9.landscape,
44089
44228
  mediaProvider = null,
44090
44229
  onNavigate
44091
44230
  }) {
@@ -44118,9 +44257,9 @@ function BlockPreviewList({
44118
44257
  [activeView, doc, goToBlockByLine, layoutMode, monacoEditor, onNavigate]
44119
44258
  );
44120
44259
  if (items.length === 0) {
44121
- return /* @__PURE__ */ jsx94("div", { className: "squisq-preview-list-empty", children: /* @__PURE__ */ jsx94("p", { children: "Add some content to see block previews." }) });
44260
+ return /* @__PURE__ */ jsx95("div", { className: "squisq-preview-list-empty", children: /* @__PURE__ */ jsx95("p", { children: "Add some content to see block previews." }) });
44122
44261
  }
44123
- return /* @__PURE__ */ jsx94(MediaContext6.Provider, { value: mediaProvider, children: /* @__PURE__ */ jsx94("ul", { ref: listRef, className: "squisq-preview-list", "aria-label": "Block previews", children: items.map((item) => /* @__PURE__ */ jsx94("li", { children: /* @__PURE__ */ jsxs75(
44262
+ return /* @__PURE__ */ jsx95(MediaContext7.Provider, { value: mediaProvider, children: /* @__PURE__ */ jsx95("ul", { ref: listRef, className: "squisq-preview-list", "aria-label": "Block previews", children: items.map((item) => /* @__PURE__ */ jsx95("li", { children: /* @__PURE__ */ jsxs75(
44124
44263
  "button",
44125
44264
  {
44126
44265
  type: "button",
@@ -44129,20 +44268,20 @@ function BlockPreviewList({
44129
44268
  onClick: () => handleSelect(item),
44130
44269
  children: [
44131
44270
  /* @__PURE__ */ jsxs75("span", { className: "squisq-inline-preview-card-label", children: [
44132
- /* @__PURE__ */ jsx94("span", { className: "squisq-inline-preview-card-template", children: templateLabel(item.template) }),
44133
- item.headingText && /* @__PURE__ */ jsxs75(Fragment31, { children: [
44134
- /* @__PURE__ */ jsx94("span", { className: "squisq-inline-preview-card-sep", "aria-hidden": "true", children: "\u2014" }),
44135
- /* @__PURE__ */ jsx94("span", { className: "squisq-inline-preview-card-title", children: item.headingText })
44271
+ /* @__PURE__ */ jsx95("span", { className: "squisq-inline-preview-card-template", children: templateLabel(item.template) }),
44272
+ item.headingText && /* @__PURE__ */ jsxs75(Fragment32, { children: [
44273
+ /* @__PURE__ */ jsx95("span", { className: "squisq-inline-preview-card-sep", "aria-hidden": "true", children: "\u2014" }),
44274
+ /* @__PURE__ */ jsx95("span", { className: "squisq-inline-preview-card-title", children: item.headingText })
44136
44275
  ] })
44137
44276
  ] }),
44138
- /* @__PURE__ */ jsx94(
44277
+ /* @__PURE__ */ jsx95(
44139
44278
  "span",
44140
44279
  {
44141
44280
  className: "squisq-inline-preview-card-svg",
44142
44281
  "aria-hidden": "true",
44143
44282
  style: { aspectRatio: `${viewport.width} / ${viewport.height}` },
44144
- children: /* @__PURE__ */ jsx94(
44145
- BlockRenderer5,
44283
+ children: item.block && /* @__PURE__ */ jsx95(
44284
+ BlockRenderer6,
44146
44285
  {
44147
44286
  block: item.block,
44148
44287
  buildPlayback: "all",
@@ -44159,7 +44298,7 @@ function BlockPreviewList({
44159
44298
  }
44160
44299
 
44161
44300
  // src/useNavigationSheetSwipe.ts
44162
- import { useEffect as useEffect74, useRef as useRef68 } from "react";
44301
+ import { useEffect as useEffect75, useRef as useRef68 } from "react";
44163
44302
  var NAVIGATION_SHEET_MAX_BODY_WIDTH = 720;
44164
44303
  var EDGE_ZONE_PX = 24;
44165
44304
  var AXIS_LOCK_PX = 10;
@@ -44176,7 +44315,7 @@ function useNavigationSheetSwipe({
44176
44315
  }) {
44177
44316
  const callbacksRef = useRef68({ onDragStart, onOpen, onClose });
44178
44317
  callbacksRef.current = { onDragStart, onOpen, onClose };
44179
- useEffect74(() => {
44318
+ useEffect75(() => {
44180
44319
  const sheet = sheetRef.current;
44181
44320
  const surface = sheet?.parentElement;
44182
44321
  if (!sheet || !surface) return;
@@ -44282,7 +44421,7 @@ function useNavigationSheetSwipe({
44282
44421
  }
44283
44422
 
44284
44423
  // src/NavigationSheet.tsx
44285
- import { Fragment as Fragment32, jsx as jsx95, jsxs as jsxs76 } from "react/jsx-runtime";
44424
+ import { Fragment as Fragment33, jsx as jsx96, jsxs as jsxs76 } from "react/jsx-runtime";
44286
44425
  var PANEL_LABELS = {
44287
44426
  outline: "Outline",
44288
44427
  previews: "Block previews"
@@ -44310,7 +44449,7 @@ function NavigationSheet({
44310
44449
  const [lastShown, setLastShown] = useState85(shown);
44311
44450
  if (shown && shown !== lastShown) setLastShown(shown);
44312
44451
  const content = shown ?? lastShown;
44313
- useEffect75(() => {
44452
+ useEffect76(() => {
44314
44453
  if (shown || !lastShown) return;
44315
44454
  const timer = setTimeout(() => setLastShown(null), CLOSE_LINGER_MS);
44316
44455
  return () => clearTimeout(timer);
@@ -44335,14 +44474,14 @@ function NavigationSheet({
44335
44474
  onClose: close
44336
44475
  });
44337
44476
  useEscapeDismissal(open, close);
44338
- useEffect75(() => {
44477
+ useEffect76(() => {
44339
44478
  const scrim = scrimRef.current;
44340
44479
  if (!scrim) return;
44341
44480
  const stop = (event) => event.stopPropagation();
44342
44481
  scrim.addEventListener("pointerdown", stop);
44343
44482
  return () => scrim.removeEventListener("pointerdown", stop);
44344
44483
  }, []);
44345
- useEffect75(() => {
44484
+ useEffect76(() => {
44346
44485
  const sheet = sheetRef.current;
44347
44486
  const surface = sheet?.parentElement;
44348
44487
  if (!open || !sheet || !surface) return;
@@ -44363,8 +44502,8 @@ function NavigationSheet({
44363
44502
  "data-state": open ? "open" : dragPanel ? "dragging" : "closed",
44364
44503
  "data-testid": "navigation-sheet",
44365
44504
  children: [
44366
- /* @__PURE__ */ jsx95("div", { ref: scrimRef, className: "squisq-navigation-sheet-scrim", onClick: close }),
44367
- /* @__PURE__ */ jsx95(
44505
+ /* @__PURE__ */ jsx96("div", { ref: scrimRef, className: "squisq-navigation-sheet-scrim", onClick: close }),
44506
+ /* @__PURE__ */ jsx96(
44368
44507
  "div",
44369
44508
  {
44370
44509
  ref: panelRef,
@@ -44372,9 +44511,9 @@ function NavigationSheet({
44372
44511
  role: "dialog",
44373
44512
  "aria-label": content ? PANEL_LABELS[content] : "Document navigation",
44374
44513
  tabIndex: -1,
44375
- children: content && /* @__PURE__ */ jsxs76(Fragment32, { children: [
44514
+ children: content && /* @__PURE__ */ jsxs76(Fragment33, { children: [
44376
44515
  /* @__PURE__ */ jsxs76("div", { className: "squisq-navigation-sheet-header", children: [
44377
- /* @__PURE__ */ jsx95("div", { className: "squisq-navigation-sheet-tabs", role: "tablist", children: PANELS.map((option) => /* @__PURE__ */ jsx95(
44516
+ /* @__PURE__ */ jsx96("div", { className: "squisq-navigation-sheet-tabs", role: "tablist", children: PANELS.map((option) => /* @__PURE__ */ jsx96(
44378
44517
  "button",
44379
44518
  {
44380
44519
  type: "button",
@@ -44388,25 +44527,25 @@ function NavigationSheet({
44388
44527
  },
44389
44528
  option
44390
44529
  )) }),
44391
- /* @__PURE__ */ jsx95(
44530
+ /* @__PURE__ */ jsx96(
44392
44531
  "button",
44393
44532
  {
44394
44533
  type: "button",
44395
44534
  className: "squisq-navigation-sheet-close",
44396
44535
  "aria-label": "Close",
44397
44536
  onClick: close,
44398
- children: /* @__PURE__ */ jsx95(Icon, { icon: "xmark" })
44537
+ children: /* @__PURE__ */ jsx96(Icon, { icon: "xmark" })
44399
44538
  }
44400
44539
  )
44401
44540
  ] }),
44402
- /* @__PURE__ */ jsx95(
44541
+ /* @__PURE__ */ jsx96(
44403
44542
  "div",
44404
44543
  {
44405
44544
  id: `${tabIdPrefix}-body`,
44406
44545
  className: "squisq-navigation-sheet-body",
44407
44546
  role: "tabpanel",
44408
44547
  "aria-labelledby": `${tabIdPrefix}-${content}`,
44409
- children: content === "outline" ? /* @__PURE__ */ jsx95(OutlinePanel, { presentation: "sheet", readOnly, onNavigate: close }) : /* @__PURE__ */ jsx95(
44548
+ children: content === "outline" ? /* @__PURE__ */ jsx96(OutlinePanel, { presentation: "sheet", readOnly, onNavigate: close }) : /* @__PURE__ */ jsx96(
44410
44549
  BlockPreviewList,
44411
44550
  {
44412
44551
  basePath,
@@ -44425,7 +44564,7 @@ function NavigationSheet({
44425
44564
  }
44426
44565
 
44427
44566
  // src/proofing/ProofingPanel.tsx
44428
- import { jsx as jsx96, jsxs as jsxs77 } from "react/jsx-runtime";
44567
+ import { jsx as jsx97, jsxs as jsxs77 } from "react/jsx-runtime";
44429
44568
  var CATEGORY_LABELS = {
44430
44569
  spelling: "Spelling",
44431
44570
  grammar: "Grammar",
@@ -44439,10 +44578,10 @@ function ProofingPanel() {
44439
44578
  /* @__PURE__ */ jsxs77("div", { className: "squisq-proof-panel-header", children: [
44440
44579
  /* @__PURE__ */ jsxs77("span", { className: "squisq-proof-panel-title", children: [
44441
44580
  "Proofing",
44442
- /* @__PURE__ */ jsx96("span", { className: "squisq-proof-panel-count", children: findings.length })
44581
+ /* @__PURE__ */ jsx97("span", { className: "squisq-proof-panel-count", children: findings.length })
44443
44582
  ] }),
44444
44583
  /* @__PURE__ */ jsxs77("span", { className: "squisq-proof-panel-actions", children: [
44445
- /* @__PURE__ */ jsx96(
44584
+ /* @__PURE__ */ jsx97(
44446
44585
  "button",
44447
44586
  {
44448
44587
  type: "button",
@@ -44454,7 +44593,7 @@ function ProofingPanel() {
44454
44593
  children: "\u2191"
44455
44594
  }
44456
44595
  ),
44457
- /* @__PURE__ */ jsx96(
44596
+ /* @__PURE__ */ jsx97(
44458
44597
  "button",
44459
44598
  {
44460
44599
  type: "button",
@@ -44466,7 +44605,7 @@ function ProofingPanel() {
44466
44605
  children: "\u2193"
44467
44606
  }
44468
44607
  ),
44469
- /* @__PURE__ */ jsx96(
44608
+ /* @__PURE__ */ jsx97(
44470
44609
  "button",
44471
44610
  {
44472
44611
  type: "button",
@@ -44479,20 +44618,20 @@ function ProofingPanel() {
44479
44618
  )
44480
44619
  ] })
44481
44620
  ] }),
44482
- state.status === "loading" && /* @__PURE__ */ jsx96("div", { className: "squisq-proof-panel-empty", children: "Loading proofing engine\u2026" }),
44621
+ state.status === "loading" && /* @__PURE__ */ jsx97("div", { className: "squisq-proof-panel-empty", children: "Loading proofing engine\u2026" }),
44483
44622
  state.status === "error" && /* @__PURE__ */ jsxs77("div", { className: "squisq-proof-panel-empty", children: [
44484
44623
  "Proofing failed to load.",
44485
- /* @__PURE__ */ jsx96("button", { type: "button", className: "squisq-proof-panel-retry", onClick: state.retrySetup, children: "Retry" })
44624
+ /* @__PURE__ */ jsx97("button", { type: "button", className: "squisq-proof-panel-retry", onClick: state.retrySetup, children: "Retry" })
44486
44625
  ] }),
44487
- state.status === "ready" && findings.length === 0 && /* @__PURE__ */ jsx96("div", { className: "squisq-proof-panel-empty", children: "No issues found." }),
44488
- /* @__PURE__ */ jsx96("ul", { className: "squisq-proof-panel-list", children: findings.map((finding) => /* @__PURE__ */ jsx96("li", { children: /* @__PURE__ */ jsxs77(
44626
+ state.status === "ready" && findings.length === 0 && /* @__PURE__ */ jsx97("div", { className: "squisq-proof-panel-empty", children: "No issues found." }),
44627
+ /* @__PURE__ */ jsx97("ul", { className: "squisq-proof-panel-list", children: findings.map((finding) => /* @__PURE__ */ jsx97("li", { children: /* @__PURE__ */ jsxs77(
44489
44628
  "button",
44490
44629
  {
44491
44630
  type: "button",
44492
44631
  className: finding.id === activeFindingId ? "squisq-proof-panel-row squisq-proof-panel-row--active" : "squisq-proof-panel-row",
44493
44632
  onClick: () => state.selectFinding(finding.id),
44494
44633
  children: [
44495
- /* @__PURE__ */ jsx96(
44634
+ /* @__PURE__ */ jsx97(
44496
44635
  "span",
44497
44636
  {
44498
44637
  className: `squisq-proof-dot squisq-proof-dot--${finding.category}`,
@@ -44501,8 +44640,8 @@ function ProofingPanel() {
44501
44640
  }
44502
44641
  ),
44503
44642
  /* @__PURE__ */ jsxs77("span", { className: "squisq-proof-panel-row-body", children: [
44504
- /* @__PURE__ */ jsx96("span", { className: "squisq-proof-panel-excerpt", children: finding.originalText }),
44505
- /* @__PURE__ */ jsx96("span", { className: "squisq-proof-panel-message", children: proofMessageText(finding) })
44643
+ /* @__PURE__ */ jsx97("span", { className: "squisq-proof-panel-excerpt", children: finding.originalText }),
44644
+ /* @__PURE__ */ jsx97("span", { className: "squisq-proof-panel-message", children: proofMessageText(finding) })
44506
44645
  ] })
44507
44646
  ]
44508
44647
  }
@@ -44511,13 +44650,13 @@ function ProofingPanel() {
44511
44650
  }
44512
44651
 
44513
44652
  // src/imageEditor/ImageEditModal.tsx
44514
- import { useCallback as useCallback58, useEffect as useEffect76, useMemo as useMemo59, useRef as useRef70, useState as useState86 } from "react";
44653
+ import { useCallback as useCallback58, useEffect as useEffect77, useMemo as useMemo59, useRef as useRef70, useState as useState86 } from "react";
44515
44654
  import { DARK_SURFACE, LIGHT_SURFACE } from "@bendyline/squisq/schemas";
44516
44655
  import {
44517
44656
  MemoryContentContainer,
44518
44657
  scopeContainer
44519
44658
  } from "@bendyline/squisq/storage";
44520
- import { jsx as jsx97, jsxs as jsxs78 } from "react/jsx-runtime";
44659
+ import { jsx as jsx98, jsxs as jsxs78 } from "react/jsx-runtime";
44521
44660
  function ImageEditModal({
44522
44661
  relativePath,
44523
44662
  container,
@@ -44546,7 +44685,7 @@ function ImageEditModal({
44546
44685
  }, [container, relativePath]);
44547
44686
  const [initialSrc, setInitialSrc] = useState86(null);
44548
44687
  const [resolveError, setResolveError] = useState86(null);
44549
- useEffect76(() => {
44688
+ useEffect77(() => {
44550
44689
  let cancelled = false;
44551
44690
  setInitialSrc(null);
44552
44691
  setResolveError(null);
@@ -44576,7 +44715,7 @@ function ImageEditModal({
44576
44715
  },
44577
44716
  [mediaProvider, relativePath, onSaved]
44578
44717
  );
44579
- return /* @__PURE__ */ jsx97(
44718
+ return /* @__PURE__ */ jsx98(
44580
44719
  "div",
44581
44720
  {
44582
44721
  ref: modalRef,
@@ -44590,9 +44729,9 @@ function ImageEditModal({
44590
44729
  },
44591
44730
  children: /* @__PURE__ */ jsxs78("div", { ref: surfaceRef, className: "squisq-image-edit-modal__surface", children: [
44592
44731
  /* @__PURE__ */ jsxs78("header", { className: "squisq-image-edit-modal__header", children: [
44593
- /* @__PURE__ */ jsx97("span", { className: "squisq-image-edit-modal__title", children: "Edit image" }),
44594
- /* @__PURE__ */ jsx97("span", { className: "squisq-image-edit-modal__path", children: relativePath }),
44595
- /* @__PURE__ */ jsx97(
44732
+ /* @__PURE__ */ jsx98("span", { className: "squisq-image-edit-modal__title", children: "Edit image" }),
44733
+ /* @__PURE__ */ jsx98("span", { className: "squisq-image-edit-modal__path", children: relativePath }),
44734
+ /* @__PURE__ */ jsx98(
44596
44735
  "button",
44597
44736
  {
44598
44737
  type: "button",
@@ -44604,10 +44743,10 @@ function ImageEditModal({
44604
44743
  }
44605
44744
  )
44606
44745
  ] }),
44607
- /* @__PURE__ */ jsx97("div", { className: "squisq-image-edit-modal__body", children: resolveError ? /* @__PURE__ */ jsxs78("div", { className: "squisq-image-edit-modal__error", children: [
44746
+ /* @__PURE__ */ jsx98("div", { className: "squisq-image-edit-modal__body", children: resolveError ? /* @__PURE__ */ jsxs78("div", { className: "squisq-image-edit-modal__error", children: [
44608
44747
  "Failed to load image: ",
44609
44748
  resolveError
44610
- ] }) : !saveFormat ? /* @__PURE__ */ jsx97("div", { className: "squisq-image-edit-modal__error", children: "Editing supports PNG, JPEG, and WebP images without changing the asset type." }) : !initialSrc ? /* @__PURE__ */ jsx97("div", { className: "squisq-image-edit-modal__loading", children: "Loading image\u2026" }) : /* @__PURE__ */ jsx97(
44749
+ ] }) : !saveFormat ? /* @__PURE__ */ jsx98("div", { className: "squisq-image-edit-modal__error", children: "Editing supports PNG, JPEG, and WebP images without changing the asset type." }) : !initialSrc ? /* @__PURE__ */ jsx98("div", { className: "squisq-image-edit-modal__loading", children: "Loading image\u2026" }) : /* @__PURE__ */ jsx98(
44611
44750
  ImageEditor,
44612
44751
  {
44613
44752
  filesContainer: sidecar,
@@ -44668,7 +44807,7 @@ function MediaEditContextMenuItems() {
44668
44807
  // src/mediaEdit/MediaEditModal.tsx
44669
44808
  import {
44670
44809
  useCallback as useCallback62,
44671
- useEffect as useEffect79,
44810
+ useEffect as useEffect80,
44672
44811
  useId as useId18,
44673
44812
  useMemo as useMemo61,
44674
44813
  useRef as useRef74,
@@ -44679,7 +44818,7 @@ import {
44679
44818
  } from "@bendyline/squisq-video-react/media-edit";
44680
44819
 
44681
44820
  // src/mediaEdit/MediaEditAudioSection.tsx
44682
- import { useCallback as useCallback59, useEffect as useEffect77, useRef as useRef71, useState as useState87 } from "react";
44821
+ import { useCallback as useCallback59, useEffect as useEffect78, useRef as useRef71, useState as useState87 } from "react";
44683
44822
  import { MEDIA_FX_SPECS as MEDIA_FX_SPECS2, serializeMediaFx } from "@bendyline/squisq/mediaEdit";
44684
44823
 
44685
44824
  // src/mediaEdit/mediaEditDraft.ts
@@ -44778,7 +44917,7 @@ function centeredCrop(ratio, frameWidth, frameHeight) {
44778
44917
  }
44779
44918
 
44780
44919
  // src/mediaEdit/MediaEditAudioSection.tsx
44781
- import { Fragment as Fragment33, jsx as jsx98, jsxs as jsxs79 } from "react/jsx-runtime";
44920
+ import { Fragment as Fragment34, jsx as jsx99, jsxs as jsxs79 } from "react/jsx-runtime";
44782
44921
  var STAGES = [
44783
44922
  {
44784
44923
  id: "highpass",
@@ -44833,7 +44972,7 @@ var LOUDNESS_PRESETS = [
44833
44972
  var PREVIEW_SECONDS = 10;
44834
44973
  function useMediaDuration(url) {
44835
44974
  const [duration, setDuration] = useState87(null);
44836
- useEffect77(() => {
44975
+ useEffect78(() => {
44837
44976
  setDuration(null);
44838
44977
  if (!url || typeof Audio === "undefined") return;
44839
44978
  const probe = new Audio();
@@ -44873,8 +45012,8 @@ function usePreviewPlayer(preview) {
44873
45012
  setPosition(0);
44874
45013
  setPlaying(null);
44875
45014
  }, []);
44876
- useEffect77(() => stop, [preview, stop]);
44877
- useEffect77(
45015
+ useEffect78(() => stop, [preview, stop]);
45016
+ useEffect78(
44878
45017
  () => () => {
44879
45018
  void ctxRef.current?.close();
44880
45019
  ctxRef.current = null;
@@ -44913,7 +45052,7 @@ function usePreviewPlayer(preview) {
44913
45052
  },
44914
45053
  [duration, playing, play]
44915
45054
  );
44916
- useEffect77(() => {
45055
+ useEffect78(() => {
44917
45056
  if (!playing) return;
44918
45057
  let frame = requestAnimationFrame(function tick() {
44919
45058
  setPosition(currentOffset());
@@ -44924,26 +45063,26 @@ function usePreviewPlayer(preview) {
44924
45063
  return { playing, play, stop, seek, position, duration };
44925
45064
  }
44926
45065
  function PlayIcon() {
44927
- return /* @__PURE__ */ jsx98(
45066
+ return /* @__PURE__ */ jsx99(
44928
45067
  "svg",
44929
45068
  {
44930
45069
  className: "squisq-media-edit-icon",
44931
45070
  viewBox: "0 0 10 10",
44932
45071
  "aria-hidden": "true",
44933
45072
  focusable: "false",
44934
- children: /* @__PURE__ */ jsx98("path", { d: "M2 1 9 5 2 9Z" })
45073
+ children: /* @__PURE__ */ jsx99("path", { d: "M2 1 9 5 2 9Z" })
44935
45074
  }
44936
45075
  );
44937
45076
  }
44938
45077
  function StopIcon() {
44939
- return /* @__PURE__ */ jsx98(
45078
+ return /* @__PURE__ */ jsx99(
44940
45079
  "svg",
44941
45080
  {
44942
45081
  className: "squisq-media-edit-icon",
44943
45082
  viewBox: "0 0 10 10",
44944
45083
  "aria-hidden": "true",
44945
45084
  focusable: "false",
44946
- children: /* @__PURE__ */ jsx98("rect", { x: "1.5", y: "1.5", width: "7", height: "7", rx: "1" })
45085
+ children: /* @__PURE__ */ jsx99("rect", { x: "1.5", y: "1.5", width: "7", height: "7", rx: "1" })
44947
45086
  }
44948
45087
  );
44949
45088
  }
@@ -44968,7 +45107,7 @@ function MediaEditAudioSection({
44968
45107
  const [previewError, setPreviewError] = useState87(null);
44969
45108
  const previewAbort = useRef71(null);
44970
45109
  const player = usePreviewPlayer(preview);
44971
- useEffect77(() => () => previewAbort.current?.abort(), []);
45110
+ useEffect78(() => () => previewAbort.current?.abort(), []);
44972
45111
  const runPreview = useCallback59(async () => {
44973
45112
  if (draftFx.ops.length === 0) return;
44974
45113
  previewAbort.current?.abort();
@@ -44995,11 +45134,11 @@ function MediaEditAudioSection({
44995
45134
  }, [draftFx.ops.length, manager, item.src, knownFx, previewFrom]);
44996
45135
  return /* @__PURE__ */ jsxs79("div", { className: "squisq-media-edit-section", children: [
44997
45136
  /* @__PURE__ */ jsxs79("div", { className: "squisq-media-edit-presets", role: "group", "aria-label": "Presets", children: [
44998
- /* @__PURE__ */ jsx98("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("voice") }), children: "Clean up voice" }),
44999
- /* @__PURE__ */ jsx98("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("levels") }), children: "Levels only" }),
45000
- /* @__PURE__ */ jsx98("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("none") }), children: "None" })
45137
+ /* @__PURE__ */ jsx99("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("voice") }), children: "Clean up voice" }),
45138
+ /* @__PURE__ */ jsx99("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("levels") }), children: "Levels only" }),
45139
+ /* @__PURE__ */ jsx99("button", { type: "button", onClick: () => onChange({ ...draft, fx: presetFx("none") }), children: "None" })
45001
45140
  ] }),
45002
- /* @__PURE__ */ jsx98("ul", { className: "squisq-media-edit-stages", children: STAGES.map((stage) => {
45141
+ /* @__PURE__ */ jsx99("ul", { className: "squisq-media-edit-stages", children: STAGES.map((stage) => {
45003
45142
  const s = draft.fx[stage.id];
45004
45143
  const inputId = `${idPrefix}-${stage.id}`;
45005
45144
  return /* @__PURE__ */ jsxs79(
@@ -45009,7 +45148,7 @@ function MediaEditAudioSection({
45009
45148
  "data-enabled": s.enabled ? "true" : "false",
45010
45149
  children: [
45011
45150
  /* @__PURE__ */ jsxs79("label", { className: "squisq-media-edit-stage__toggle", children: [
45012
- /* @__PURE__ */ jsx98(
45151
+ /* @__PURE__ */ jsx99(
45013
45152
  "input",
45014
45153
  {
45015
45154
  type: "checkbox",
@@ -45017,9 +45156,9 @@ function MediaEditAudioSection({
45017
45156
  onChange: (e2) => setStage(stage.id, { enabled: e2.target.checked })
45018
45157
  }
45019
45158
  ),
45020
- /* @__PURE__ */ jsx98("span", { className: "squisq-media-edit-stage__label", children: stage.label })
45159
+ /* @__PURE__ */ jsx99("span", { className: "squisq-media-edit-stage__label", children: stage.label })
45021
45160
  ] }),
45022
- /* @__PURE__ */ jsx98(
45161
+ /* @__PURE__ */ jsx99(
45023
45162
  "input",
45024
45163
  {
45025
45164
  id: inputId,
@@ -45035,9 +45174,9 @@ function MediaEditAudioSection({
45035
45174
  onChange: (e2) => setStage(stage.id, { value: stage.toValue(Number(e2.target.value)) })
45036
45175
  }
45037
45176
  ),
45038
- /* @__PURE__ */ jsx98("output", { className: "squisq-media-edit-stage__value", htmlFor: inputId, children: stage.format(s.value) }),
45039
- /* @__PURE__ */ jsx98("p", { className: "squisq-media-edit-stage__hint", children: stage.hint }),
45040
- stage.id === "loudness" && s.enabled && /* @__PURE__ */ jsx98("div", { className: "squisq-media-edit-chips", role: "group", "aria-label": "Targets", children: LOUDNESS_PRESETS.map((preset) => /* @__PURE__ */ jsxs79(
45177
+ /* @__PURE__ */ jsx99("output", { className: "squisq-media-edit-stage__value", htmlFor: inputId, children: stage.format(s.value) }),
45178
+ /* @__PURE__ */ jsx99("p", { className: "squisq-media-edit-stage__hint", children: stage.hint }),
45179
+ stage.id === "loudness" && s.enabled && /* @__PURE__ */ jsx99("div", { className: "squisq-media-edit-chips", role: "group", "aria-label": "Targets", children: LOUDNESS_PRESETS.map((preset) => /* @__PURE__ */ jsxs79(
45041
45180
  "button",
45042
45181
  {
45043
45182
  type: "button",
@@ -45064,7 +45203,7 @@ function MediaEditAudioSection({
45064
45203
  previewFrom.toFixed(0),
45065
45204
  " s"
45066
45205
  ] }),
45067
- /* @__PURE__ */ jsx98(
45206
+ /* @__PURE__ */ jsx99(
45068
45207
  "input",
45069
45208
  {
45070
45209
  type: "range",
@@ -45076,7 +45215,7 @@ function MediaEditAudioSection({
45076
45215
  }
45077
45216
  )
45078
45217
  ] }),
45079
- /* @__PURE__ */ jsx98("div", { className: "squisq-media-edit-preview__actions", children: /* @__PURE__ */ jsx98(
45218
+ /* @__PURE__ */ jsx99("div", { className: "squisq-media-edit-preview__actions", children: /* @__PURE__ */ jsx99(
45080
45219
  "button",
45081
45220
  {
45082
45221
  type: "button",
@@ -45085,10 +45224,10 @@ function MediaEditAudioSection({
45085
45224
  children: previewing ? "Rendering preview\u2026" : preview ? "Update preview" : "Create preview"
45086
45225
  }
45087
45226
  ) }),
45088
- preview != null && player.duration > 0 && /* @__PURE__ */ jsxs79(Fragment33, { children: [
45227
+ preview != null && player.duration > 0 && /* @__PURE__ */ jsxs79(Fragment34, { children: [
45089
45228
  /* @__PURE__ */ jsxs79("div", { className: "squisq-media-edit-playback", "data-playing": player.playing ?? void 0, children: [
45090
- /* @__PURE__ */ jsx98("span", { className: "squisq-media-edit-playback__label", children: player.playing ? `${player.playing === "original" ? "Original" : "Processed"} from ${Math.round(preview.startSec)} s` : "Stopped" }),
45091
- /* @__PURE__ */ jsx98(
45229
+ /* @__PURE__ */ jsx99("span", { className: "squisq-media-edit-playback__label", children: player.playing ? `${player.playing === "original" ? "Original" : "Processed"} from ${Math.round(preview.startSec)} s` : "Stopped" }),
45230
+ /* @__PURE__ */ jsx99(
45092
45231
  "input",
45093
45232
  {
45094
45233
  type: "range",
@@ -45117,7 +45256,7 @@ function MediaEditAudioSection({
45117
45256
  disabled: previewing,
45118
45257
  onClick: () => player.play("original"),
45119
45258
  children: [
45120
- /* @__PURE__ */ jsx98(PlayIcon, {}),
45259
+ /* @__PURE__ */ jsx99(PlayIcon, {}),
45121
45260
  "Original"
45122
45261
  ]
45123
45262
  }
@@ -45130,26 +45269,26 @@ function MediaEditAudioSection({
45130
45269
  disabled: previewing,
45131
45270
  onClick: () => player.play("processed"),
45132
45271
  children: [
45133
- /* @__PURE__ */ jsx98(PlayIcon, {}),
45272
+ /* @__PURE__ */ jsx99(PlayIcon, {}),
45134
45273
  "Processed"
45135
45274
  ]
45136
45275
  }
45137
45276
  ),
45138
45277
  /* @__PURE__ */ jsxs79("button", { type: "button", disabled: !player.playing, onClick: player.stop, children: [
45139
- /* @__PURE__ */ jsx98(StopIcon, {}),
45278
+ /* @__PURE__ */ jsx99(StopIcon, {}),
45140
45279
  "Stop"
45141
45280
  ] })
45142
45281
  ] })
45143
45282
  ] }),
45144
- preview != null && previewedFx !== knownFx && /* @__PURE__ */ jsx98("p", { className: "squisq-media-edit-note", children: "Settings changed \u2014 update the preview to hear them." }),
45145
- previewError && /* @__PURE__ */ jsx98("p", { className: "squisq-media-edit-note squisq-media-edit-note--error", role: "alert", children: previewError })
45283
+ preview != null && previewedFx !== knownFx && /* @__PURE__ */ jsx99("p", { className: "squisq-media-edit-note", children: "Settings changed \u2014 update the preview to hear them." }),
45284
+ previewError && /* @__PURE__ */ jsx99("p", { className: "squisq-media-edit-note squisq-media-edit-note--error", role: "alert", children: previewError })
45146
45285
  ] })
45147
45286
  ] });
45148
45287
  }
45149
45288
 
45150
45289
  // src/mediaEdit/MediaEditTimingSection.tsx
45151
- import { useCallback as useCallback60, useEffect as useEffect78, useRef as useRef72, useState as useState88 } from "react";
45152
- import { jsx as jsx99, jsxs as jsxs80 } from "react/jsx-runtime";
45290
+ import { useCallback as useCallback60, useEffect as useEffect79, useRef as useRef72, useState as useState88 } from "react";
45291
+ import { jsx as jsx100, jsxs as jsxs80 } from "react/jsx-runtime";
45153
45292
  var DEFAULT_MAX_PAUSE = 0.8;
45154
45293
  function formatDb(value) {
45155
45294
  if (value === 0) return "0 dB";
@@ -45166,7 +45305,7 @@ function MediaEditTimingSection({
45166
45305
  const [finding, setFinding] = useState88(false);
45167
45306
  const [error, setError] = useState88(null);
45168
45307
  const abortRef = useRef72(null);
45169
- useEffect78(() => () => abortRef.current?.abort(), []);
45308
+ useEffect79(() => () => abortRef.current?.abort(), []);
45170
45309
  const findPauses = useCallback60(async () => {
45171
45310
  abortRef.current?.abort();
45172
45311
  const controller = new AbortController();
@@ -45192,8 +45331,8 @@ function MediaEditTimingSection({
45192
45331
  const saved = cutSeconds(draft.cuts);
45193
45332
  return /* @__PURE__ */ jsxs80("div", { className: "squisq-media-edit-section", children: [
45194
45333
  /* @__PURE__ */ jsxs80("div", { className: "squisq-media-edit-row", children: [
45195
- /* @__PURE__ */ jsx99("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-pause`, children: "Shorten pauses longer than" }),
45196
- /* @__PURE__ */ jsx99(
45334
+ /* @__PURE__ */ jsx100("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-pause`, children: "Shorten pauses longer than" }),
45335
+ /* @__PURE__ */ jsx100(
45197
45336
  "input",
45198
45337
  {
45199
45338
  id: `${idPrefix}-pause`,
@@ -45212,8 +45351,8 @@ function MediaEditTimingSection({
45212
45351
  ] })
45213
45352
  ] }),
45214
45353
  /* @__PURE__ */ jsxs80("div", { className: "squisq-media-edit-preview__actions", children: [
45215
- /* @__PURE__ */ jsx99("button", { type: "button", onClick: findPauses, disabled: finding, children: finding ? "Finding pauses\u2026" : "Find pauses" }),
45216
- /* @__PURE__ */ jsx99(
45354
+ /* @__PURE__ */ jsx100("button", { type: "button", onClick: findPauses, disabled: finding, children: finding ? "Finding pauses\u2026" : "Find pauses" }),
45355
+ /* @__PURE__ */ jsx100(
45217
45356
  "button",
45218
45357
  {
45219
45358
  type: "button",
@@ -45223,11 +45362,11 @@ function MediaEditTimingSection({
45223
45362
  }
45224
45363
  )
45225
45364
  ] }),
45226
- /* @__PURE__ */ jsx99("p", { className: "squisq-media-edit-note", role: "status", "aria-live": "polite", children: draft.cuts.length === 0 ? "No pauses shortened." : `${draft.cuts.length} ${draft.cuts.length === 1 ? "pause" : "pauses"} shortened, saving ${formatClock6(saved)}.` }),
45227
- error && /* @__PURE__ */ jsx99("p", { className: "squisq-media-edit-note squisq-media-edit-note--error", role: "alert", children: error }),
45365
+ /* @__PURE__ */ jsx100("p", { className: "squisq-media-edit-note", role: "status", "aria-live": "polite", children: draft.cuts.length === 0 ? "No pauses shortened." : `${draft.cuts.length} ${draft.cuts.length === 1 ? "pause" : "pauses"} shortened, saving ${formatClock6(saved)}.` }),
45366
+ error && /* @__PURE__ */ jsx100("p", { className: "squisq-media-edit-note squisq-media-edit-note--error", role: "alert", children: error }),
45228
45367
  /* @__PURE__ */ jsxs80("div", { className: "squisq-media-edit-row", children: [
45229
- /* @__PURE__ */ jsx99("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-gain`, children: "Volume" }),
45230
- /* @__PURE__ */ jsx99(
45368
+ /* @__PURE__ */ jsx100("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-gain`, children: "Volume" }),
45369
+ /* @__PURE__ */ jsx100(
45231
45370
  "input",
45232
45371
  {
45233
45372
  id: `${idPrefix}-gain`,
@@ -45240,11 +45379,11 @@ function MediaEditTimingSection({
45240
45379
  onChange: (e2) => onChange({ ...draft, gain: Number(e2.target.value) })
45241
45380
  }
45242
45381
  ),
45243
- /* @__PURE__ */ jsx99("output", { htmlFor: `${idPrefix}-gain`, children: formatDb(draft.gain) })
45382
+ /* @__PURE__ */ jsx100("output", { htmlFor: `${idPrefix}-gain`, children: formatDb(draft.gain) })
45244
45383
  ] }),
45245
45384
  ["fadeIn", "fadeOut"].map((key) => /* @__PURE__ */ jsxs80("div", { className: "squisq-media-edit-row", children: [
45246
- /* @__PURE__ */ jsx99("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-${key}`, children: key === "fadeIn" ? "Fade in" : "Fade out" }),
45247
- /* @__PURE__ */ jsx99(
45385
+ /* @__PURE__ */ jsx100("label", { className: "squisq-media-edit-row__label", htmlFor: `${idPrefix}-${key}`, children: key === "fadeIn" ? "Fade in" : "Fade out" }),
45386
+ /* @__PURE__ */ jsx100(
45248
45387
  "input",
45249
45388
  {
45250
45389
  id: `${idPrefix}-${key}`,
@@ -45257,7 +45396,7 @@ function MediaEditTimingSection({
45257
45396
  onChange: (e2) => onChange({ ...draft, [key]: Number(e2.target.value) })
45258
45397
  }
45259
45398
  ),
45260
- /* @__PURE__ */ jsx99("output", { htmlFor: `${idPrefix}-${key}`, children: draft[key] === 0 ? "Off" : `${draft[key].toFixed(1)} s` })
45399
+ /* @__PURE__ */ jsx100("output", { htmlFor: `${idPrefix}-${key}`, children: draft[key] === 0 ? "Off" : `${draft[key].toFixed(1)} s` })
45261
45400
  ] }, key))
45262
45401
  ] });
45263
45402
  }
@@ -45269,7 +45408,7 @@ import {
45269
45408
  useState as useState89
45270
45409
  } from "react";
45271
45410
  import { normalizeMediaCrop } from "@bendyline/squisq/mediaEdit";
45272
- import { jsx as jsx100, jsxs as jsxs81 } from "react/jsx-runtime";
45411
+ import { jsx as jsx101, jsxs as jsxs81 } from "react/jsx-runtime";
45273
45412
  var FULL = { x: 0, y: 0, w: 1, h: 1 };
45274
45413
  var MIN_EDGE = 0.05;
45275
45414
  var NUDGE = 0.01;
@@ -45351,7 +45490,7 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45351
45490
  const pct = (n) => `${(n * 100).toFixed(2)}%`;
45352
45491
  return /* @__PURE__ */ jsxs81("div", { className: "squisq-media-edit-section", children: [
45353
45492
  /* @__PURE__ */ jsxs81("div", { className: "squisq-media-edit-chips", role: "group", "aria-label": "Crop aspect", children: [
45354
- ASPECTS.map((option) => /* @__PURE__ */ jsx100(
45493
+ ASPECTS.map((option) => /* @__PURE__ */ jsx101(
45355
45494
  "button",
45356
45495
  {
45357
45496
  type: "button",
@@ -45366,7 +45505,7 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45366
45505
  },
45367
45506
  option.label
45368
45507
  )),
45369
- /* @__PURE__ */ jsx100(
45508
+ /* @__PURE__ */ jsx101(
45370
45509
  "button",
45371
45510
  {
45372
45511
  type: "button",
@@ -45386,7 +45525,7 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45386
45525
  className: "squisq-media-edit-crop",
45387
45526
  style: frame ? { aspectRatio: `${frame.w} / ${frame.h}` } : void 0,
45388
45527
  children: [
45389
- src && /* @__PURE__ */ jsx100(
45528
+ src && /* @__PURE__ */ jsx101(
45390
45529
  "video",
45391
45530
  {
45392
45531
  src,
@@ -45402,7 +45541,7 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45402
45541
  }
45403
45542
  }
45404
45543
  ),
45405
- /* @__PURE__ */ jsx100(
45544
+ /* @__PURE__ */ jsx101(
45406
45545
  "div",
45407
45546
  {
45408
45547
  className: "squisq-media-edit-crop__rect",
@@ -45413,7 +45552,7 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45413
45552
  style: { left: pct(crop.x), top: pct(crop.y), width: pct(crop.w), height: pct(crop.h) },
45414
45553
  onPointerDown: startDrag("move"),
45415
45554
  onKeyDown,
45416
- children: ["nw", "ne", "sw", "se"].map((handle) => /* @__PURE__ */ jsx100(
45555
+ children: ["nw", "ne", "sw", "se"].map((handle) => /* @__PURE__ */ jsx101(
45417
45556
  "span",
45418
45557
  {
45419
45558
  className: `squisq-media-edit-crop__handle squisq-media-edit-crop__handle--${handle}`,
@@ -45426,12 +45565,12 @@ function MediaEditFrameSection({ item, draft, onChange }) {
45426
45565
  ]
45427
45566
  }
45428
45567
  ),
45429
- /* @__PURE__ */ jsx100("p", { className: "squisq-media-edit-note", children: draft.crop ? "Only the framed area is shown and exported." : "Drag the corners or pick an aspect to crop." })
45568
+ /* @__PURE__ */ jsx101("p", { className: "squisq-media-edit-note", children: draft.crop ? "Only the framed area is shown and exported." : "Drag the corners or pick an aspect to crop." })
45430
45569
  ] });
45431
45570
  }
45432
45571
 
45433
45572
  // src/mediaEdit/MediaEditModal.tsx
45434
- import { Fragment as Fragment34, jsx as jsx101, jsxs as jsxs82 } from "react/jsx-runtime";
45573
+ import { Fragment as Fragment35, jsx as jsx102, jsxs as jsxs82 } from "react/jsx-runtime";
45435
45574
  var TABS = [
45436
45575
  { id: "audio", label: "Audio cleanup" },
45437
45576
  { id: "timing", label: "Timing" },
@@ -45466,20 +45605,20 @@ function RenderStatusText({
45466
45605
  }) {
45467
45606
  switch (status.state) {
45468
45607
  case "ready":
45469
- return /* @__PURE__ */ jsx101(Fragment34, { children: "Processed audio is in use." });
45608
+ return /* @__PURE__ */ jsx102(Fragment35, { children: "Processed audio is in use." });
45470
45609
  case "queued":
45471
- return /* @__PURE__ */ jsx101(Fragment34, { children: "Waiting to process\u2026" });
45610
+ return /* @__PURE__ */ jsx102(Fragment35, { children: "Waiting to process\u2026" });
45472
45611
  case "rendering":
45473
- return /* @__PURE__ */ jsxs82(Fragment34, { children: [
45612
+ return /* @__PURE__ */ jsxs82(Fragment35, { children: [
45474
45613
  "Processing\u2026 ",
45475
45614
  percent(status)
45476
45615
  ] });
45477
45616
  case "failed":
45478
- return /* @__PURE__ */ jsxs82(Fragment34, { children: [
45617
+ return /* @__PURE__ */ jsxs82(Fragment35, { children: [
45479
45618
  "Processing failed: ",
45480
45619
  status.error,
45481
45620
  " ",
45482
- /* @__PURE__ */ jsx101("button", { type: "button", onClick: onRetry, children: "Retry" })
45621
+ /* @__PURE__ */ jsx102("button", { type: "button", onClick: onRetry, children: "Retry" })
45483
45622
  ] });
45484
45623
  }
45485
45624
  }
@@ -45495,7 +45634,7 @@ function MediaEditModal({ target, onClose }) {
45495
45634
  const [draft, setDraft] = useState90(() => draftFromEdits(item?.edits));
45496
45635
  const seedKey = item ? `${item.sourceLine}|${editsSignature(item.edits)}` : null;
45497
45636
  const seededRef = useRef74(null);
45498
- useEffect79(() => {
45637
+ useEffect80(() => {
45499
45638
  if (seedKey === null || seededRef.current === seedKey) return;
45500
45639
  seededRef.current = seedKey;
45501
45640
  setDraft(draftFromEdits(item?.edits));
@@ -45530,7 +45669,7 @@ function MediaEditModal({ target, onClose }) {
45530
45669
  const tabbed = item != null && mediaEditRenders != null;
45531
45670
  const tabId = (tab) => `${titleId}-tab-${tab}`;
45532
45671
  const panelId = (tab) => `${titleId}-panel-${tab}`;
45533
- return /* @__PURE__ */ jsx101(
45672
+ return /* @__PURE__ */ jsx102(
45534
45673
  "div",
45535
45674
  {
45536
45675
  ref: modalRef,
@@ -45549,10 +45688,10 @@ function MediaEditModal({ target, onClose }) {
45549
45688
  "aria-labelledby": titleId,
45550
45689
  children: [
45551
45690
  /* @__PURE__ */ jsxs82("header", { className: "squisq-media-edit-modal__header", children: [
45552
- /* @__PURE__ */ jsx101("span", { id: titleId, className: "squisq-media-edit-modal__title", children: title }),
45553
- /* @__PURE__ */ jsx101("span", { className: "squisq-media-edit-modal__path", children: target.src }),
45554
- renderStatus && /* @__PURE__ */ jsx101(RenderStatusBadge, { status: renderStatus }),
45555
- /* @__PURE__ */ jsx101(
45691
+ /* @__PURE__ */ jsx102("span", { id: titleId, className: "squisq-media-edit-modal__title", children: title }),
45692
+ /* @__PURE__ */ jsx102("span", { className: "squisq-media-edit-modal__path", children: target.src }),
45693
+ renderStatus && /* @__PURE__ */ jsx102(RenderStatusBadge, { status: renderStatus }),
45694
+ /* @__PURE__ */ jsx102(
45556
45695
  "button",
45557
45696
  {
45558
45697
  type: "button",
@@ -45563,8 +45702,8 @@ function MediaEditModal({ target, onClose }) {
45563
45702
  }
45564
45703
  )
45565
45704
  ] }),
45566
- !item ? /* @__PURE__ */ jsx101("p", { className: "squisq-media-edit-modal__empty", children: "This clip is no longer in the document." }) : !mediaEditRenders ? /* @__PURE__ */ jsx101("p", { className: "squisq-media-edit-modal__empty", children: "Media editing needs a media folder for this document." }) : /* @__PURE__ */ jsxs82(Fragment34, { children: [
45567
- /* @__PURE__ */ jsx101("div", { className: "squisq-media-edit-tabs", role: "tablist", "aria-label": "Edit sections", children: tabs.map((tab, index2) => {
45705
+ !item ? /* @__PURE__ */ jsx102("p", { className: "squisq-media-edit-modal__empty", children: "This clip is no longer in the document." }) : !mediaEditRenders ? /* @__PURE__ */ jsx102("p", { className: "squisq-media-edit-modal__empty", children: "Media editing needs a media folder for this document." }) : /* @__PURE__ */ jsxs82(Fragment35, { children: [
45706
+ /* @__PURE__ */ jsx102("div", { className: "squisq-media-edit-tabs", role: "tablist", "aria-label": "Edit sections", children: tabs.map((tab, index2) => {
45568
45707
  const selected = tab.id === activeTab;
45569
45708
  const edited = tabHasEdits(tab.id, draft);
45570
45709
  return /* @__PURE__ */ jsxs82(
@@ -45586,21 +45725,21 @@ function MediaEditModal({ target, onClose }) {
45586
45725
  onKeyDown: (e2) => onTabKeyDown(e2, index2),
45587
45726
  children: [
45588
45727
  tab.label,
45589
- edited && /* @__PURE__ */ jsx101("span", { className: "squisq-sr-only", children: " (edited)" })
45728
+ edited && /* @__PURE__ */ jsx102("span", { className: "squisq-sr-only", children: " (edited)" })
45590
45729
  ]
45591
45730
  },
45592
45731
  tab.id
45593
45732
  );
45594
45733
  }) }),
45595
45734
  /* @__PURE__ */ jsxs82("div", { className: "squisq-media-edit-modal__body", children: [
45596
- /* @__PURE__ */ jsx101(
45735
+ /* @__PURE__ */ jsx102(
45597
45736
  "div",
45598
45737
  {
45599
45738
  role: "tabpanel",
45600
45739
  id: panelId("audio"),
45601
45740
  "aria-labelledby": tabId("audio"),
45602
45741
  hidden: activeTab !== "audio",
45603
- children: /* @__PURE__ */ jsx101(
45742
+ children: /* @__PURE__ */ jsx102(
45604
45743
  MediaEditAudioSection,
45605
45744
  {
45606
45745
  item,
@@ -45612,14 +45751,14 @@ function MediaEditModal({ target, onClose }) {
45612
45751
  )
45613
45752
  }
45614
45753
  ),
45615
- /* @__PURE__ */ jsx101(
45754
+ /* @__PURE__ */ jsx102(
45616
45755
  "div",
45617
45756
  {
45618
45757
  role: "tabpanel",
45619
45758
  id: panelId("timing"),
45620
45759
  "aria-labelledby": tabId("timing"),
45621
45760
  hidden: activeTab !== "timing",
45622
- children: /* @__PURE__ */ jsx101(
45761
+ children: /* @__PURE__ */ jsx102(
45623
45762
  MediaEditTimingSection,
45624
45763
  {
45625
45764
  item,
@@ -45631,14 +45770,14 @@ function MediaEditModal({ target, onClose }) {
45631
45770
  )
45632
45771
  }
45633
45772
  ),
45634
- item.kind === "video" && /* @__PURE__ */ jsx101(
45773
+ item.kind === "video" && /* @__PURE__ */ jsx102(
45635
45774
  "div",
45636
45775
  {
45637
45776
  role: "tabpanel",
45638
45777
  id: panelId("frame"),
45639
45778
  "aria-labelledby": tabId("frame"),
45640
45779
  hidden: activeTab !== "frame",
45641
- children: /* @__PURE__ */ jsx101(MediaEditFrameSection, { item, draft, onChange: setDraft })
45780
+ children: /* @__PURE__ */ jsx102(MediaEditFrameSection, { item, draft, onChange: setDraft })
45642
45781
  }
45643
45782
  ),
45644
45783
  companions.length > 0 && /* @__PURE__ */ jsxs82("p", { className: "squisq-media-edit-note", children: [
@@ -45652,15 +45791,15 @@ function MediaEditModal({ target, onClose }) {
45652
45791
  ] })
45653
45792
  ] }),
45654
45793
  /* @__PURE__ */ jsxs82("footer", { className: "squisq-media-edit-modal__footer", children: [
45655
- /* @__PURE__ */ jsx101("p", { className: "squisq-media-edit-status", role: "status", "data-state": renderStatus?.state, children: renderStatus && item && mediaEditRenders && /* @__PURE__ */ jsx101(
45794
+ /* @__PURE__ */ jsx102("p", { className: "squisq-media-edit-status", role: "status", "data-state": renderStatus?.state, children: renderStatus && item && mediaEditRenders && /* @__PURE__ */ jsx102(
45656
45795
  RenderStatusText,
45657
45796
  {
45658
45797
  status: renderStatus,
45659
45798
  onRetry: () => mediaEditRenders.retry(item.clip)
45660
45799
  }
45661
45800
  ) }),
45662
- /* @__PURE__ */ jsx101("button", { type: "button", onClick: onClose, children: "Cancel" }),
45663
- /* @__PURE__ */ jsx101(
45801
+ /* @__PURE__ */ jsx102("button", { type: "button", onClick: onClose, children: "Cancel" }),
45802
+ /* @__PURE__ */ jsx102(
45664
45803
  "button",
45665
45804
  {
45666
45805
  type: "button",
@@ -45920,12 +46059,12 @@ import {
45920
46059
  MemoryContentContainer as MemoryContentContainer2,
45921
46060
  createMediaProviderFromContainer
45922
46061
  } from "@bendyline/squisq/storage";
45923
- import { MediaContext as MediaContext7, useMediaClipDurations } from "@bendyline/squisq-react";
46062
+ import { MediaContext as MediaContext8, useMediaClipDurations } from "@bendyline/squisq-react";
45924
46063
  import {
45925
46064
  createMediaEditRenderManager,
45926
46065
  useProcessedAudio as useProcessedAudio4
45927
46066
  } from "@bendyline/squisq-video-react/media-edit";
45928
- import { Fragment as Fragment35, jsx as jsx102, jsxs as jsxs83 } from "react/jsx-runtime";
46067
+ import { Fragment as Fragment36, jsx as jsx103, jsxs as jsxs83 } from "react/jsx-runtime";
45929
46068
  function EditorShell({
45930
46069
  ariaLabel,
45931
46070
  initialMarkdown = "",
@@ -46031,11 +46170,11 @@ function EditorShell({
46031
46170
  () => mediaEditRenders === void 0 && effectiveMediaProvider ? createMediaEditRenderManager({ mediaProvider: effectiveMediaProvider }) : null,
46032
46171
  [mediaEditRenders, effectiveMediaProvider]
46033
46172
  );
46034
- useEffect80(() => () => ownedMediaEditRenders?.dispose(), [ownedMediaEditRenders]);
46173
+ useEffect81(() => () => ownedMediaEditRenders?.dispose(), [ownedMediaEditRenders]);
46035
46174
  const effectiveMediaEditRenders = mediaEditRenders === void 0 ? ownedMediaEditRenders : mediaEditRenders;
46036
46175
  const filesToggleEnabled = showFilesToggle ?? effectiveMediaProvider !== void 0;
46037
46176
  const effectiveInitialView = hostMode === "chat" || !showPlayTab && initialView === "preview" ? "wysiwyg" : initialView;
46038
- return /* @__PURE__ */ jsx102(MediaContext7.Provider, { value: effectiveMediaProvider ?? null, children: /* @__PURE__ */ jsx102(
46177
+ return /* @__PURE__ */ jsx103(MediaContext8.Provider, { value: effectiveMediaProvider ?? null, children: /* @__PURE__ */ jsx103(
46039
46178
  EditorProvider,
46040
46179
  {
46041
46180
  initialMarkdown,
@@ -46081,7 +46220,7 @@ function EditorShell({
46081
46220
  themeInheritance,
46082
46221
  viewPreferences,
46083
46222
  onViewPreferencesChange,
46084
- children: /* @__PURE__ */ jsx102(ProofingRoot, { children: /* @__PURE__ */ jsx102(ReviewRoot, { providers: reviewProviders, children: /* @__PURE__ */ jsx102(PageTemplateContext.Provider, { value: pageTemplates, children: /* @__PURE__ */ jsx102(
46223
+ children: /* @__PURE__ */ jsx103(ProofingRoot, { children: /* @__PURE__ */ jsx103(ReviewRoot, { providers: reviewProviders, children: /* @__PURE__ */ jsx103(PageTemplateContext.Provider, { value: pageTemplates, children: /* @__PURE__ */ jsx103(
46085
46224
  EditorShellInner,
46086
46225
  {
46087
46226
  ariaLabel: ariaLabel ?? (hostMode === "chat" ? "Message" : fileName ? `Edit ${fileName}` : "Document editor"),
@@ -46147,11 +46286,11 @@ function UseModeToolbarControls({
46147
46286
  summarizationDesigner
46148
46287
  }) {
46149
46288
  const printMode = usePrintMode();
46150
- if (printMode.active) return /* @__PURE__ */ jsx102(PrintPreviewToolbar, {});
46151
- return /* @__PURE__ */ jsxs83(Fragment35, { children: [
46152
- /* @__PURE__ */ jsx102(PreviewToolbarControls, { summarizationDesigner }),
46153
- /* @__PURE__ */ jsx102(PresentationModeControl, {}),
46154
- allowPrint && /* @__PURE__ */ jsx102(PrintModeControl, {})
46289
+ if (printMode.active) return /* @__PURE__ */ jsx103(PrintPreviewToolbar, {});
46290
+ return /* @__PURE__ */ jsxs83(Fragment36, { children: [
46291
+ /* @__PURE__ */ jsx103(PreviewToolbarControls, { summarizationDesigner }),
46292
+ /* @__PURE__ */ jsx103(PresentationModeControl, {}),
46293
+ allowPrint && /* @__PURE__ */ jsx103(PrintModeControl, {})
46155
46294
  ] });
46156
46295
  }
46157
46296
  function UseModeProviders({
@@ -46160,13 +46299,13 @@ function UseModeProviders({
46160
46299
  allowPresentationWindow,
46161
46300
  allowPresentationFullscreen
46162
46301
  }) {
46163
- return /* @__PURE__ */ jsx102(
46302
+ return /* @__PURE__ */ jsx103(
46164
46303
  PresentationModeProvider,
46165
46304
  {
46166
46305
  rootRef,
46167
46306
  allowWindow: allowPresentationWindow,
46168
46307
  allowFullscreen: allowPresentationFullscreen,
46169
- children: /* @__PURE__ */ jsx102(PrintModeProvider, { rootRef, children })
46308
+ children: /* @__PURE__ */ jsx103(PrintModeProvider, { rootRef, children })
46170
46309
  }
46171
46310
  );
46172
46311
  }
@@ -46266,7 +46405,7 @@ function EditorShellInner({
46266
46405
  const processedAudio = useProcessedAudio4(mediaEditRenders);
46267
46406
  const { docThemes, onDocThemesChange } = useDocCustomThemes();
46268
46407
  const lastEditingView = useRef75(activeView === "raw" ? "raw" : "wysiwyg");
46269
- useEffect80(() => {
46408
+ useEffect81(() => {
46270
46409
  if (activeView !== "preview") lastEditingView.current = activeView;
46271
46410
  }, [activeView]);
46272
46411
  const editingView = activeView === "preview" ? lastEditingView.current : activeView;
@@ -46332,13 +46471,13 @@ function EditorShellInner({
46332
46471
  }
46333
46472
  const imageEditFallbackContainer = imageEditFallbackContainerRef.current;
46334
46473
  const isDark = colorScheme === "dark";
46335
- useEffect80(() => {
46474
+ useEffect81(() => {
46336
46475
  if (!isTimelineMode || !hasTimelineVideo) setTimelineVideoVisible(false);
46337
46476
  }, [isTimelineMode, hasTimelineVideo]);
46338
- useEffect80(() => {
46477
+ useEffect81(() => {
46339
46478
  if (!isTimelineMode || !doc?.blocks.length) setTimelineCompositionVisible(false);
46340
46479
  }, [isTimelineMode, doc]);
46341
- useEffect80(() => {
46480
+ useEffect81(() => {
46342
46481
  if (!mediaProvider) {
46343
46482
  setMediaCount(0);
46344
46483
  return;
@@ -46362,7 +46501,7 @@ function EditorShellInner({
46362
46501
  cancelled = true;
46363
46502
  };
46364
46503
  }, [mediaProvider, mediaListRefreshKey]);
46365
- useEffect80(() => {
46504
+ useEffect81(() => {
46366
46505
  if (showFilesWhenNotEmpty && mediaCount > 0) setShowFiles(true);
46367
46506
  }, [mediaCount, showFilesWhenNotEmpty]);
46368
46507
  const handleToggleFiles = useCallback63(() => {
@@ -46382,7 +46521,7 @@ function EditorShellInner({
46382
46521
  [insertionTarget]
46383
46522
  );
46384
46523
  const docBasenameRef = useRef75("document");
46385
- useEffect80(() => {
46524
+ useEffect81(() => {
46386
46525
  let cancelled = false;
46387
46526
  docBasenameRef.current = "document";
46388
46527
  void resolveDocBasename(workspaceContainer).then((base) => {
@@ -46465,7 +46604,7 @@ function EditorShellInner({
46465
46604
  onDrop: handleFileDrop,
46466
46605
  enabled: !readOnly
46467
46606
  });
46468
- useEffect80(() => {
46607
+ useEffect81(() => {
46469
46608
  onChange?.(markdownSource);
46470
46609
  }, [markdownSource, onChange]);
46471
46610
  const handleShellKeyDown = useCallback63((e2) => {
@@ -46560,7 +46699,7 @@ function EditorShellInner({
46560
46699
  },
46561
46700
  ...containerProps,
46562
46701
  children: [
46563
- /* @__PURE__ */ jsx102(CustomThemeProvider, { docThemes, onDocThemesChange, children: /* @__PURE__ */ jsx102(
46702
+ /* @__PURE__ */ jsx103(CustomThemeProvider, { docThemes, onDocThemesChange, children: /* @__PURE__ */ jsx103(
46564
46703
  PreviewSettingsProvider,
46565
46704
  {
46566
46705
  doc,
@@ -46577,16 +46716,16 @@ function EditorShellInner({
46577
46716
  children: [
46578
46717
  isImageMode ? (toolbarSlotLeft || toolbarSlotRight) && /* @__PURE__ */ jsxs83("div", { className: "squisq-editor-header squisq-editor-header--image", children: [
46579
46718
  toolbarSlotLeft,
46580
- /* @__PURE__ */ jsx102("div", { style: { flex: 1 } }),
46719
+ /* @__PURE__ */ jsx103("div", { style: { flex: 1 } }),
46581
46720
  toolbarSlotRight
46582
- ] }) : /* @__PURE__ */ jsx102("div", { className: "squisq-editor-header", children: /* @__PURE__ */ jsx102(
46721
+ ] }) : /* @__PURE__ */ jsx103("div", { className: "squisq-editor-header", children: /* @__PURE__ */ jsx103(
46583
46722
  Toolbar,
46584
46723
  {
46585
46724
  showFiles,
46586
46725
  fileCount: mediaCount,
46587
46726
  onToggleFiles: !isCodeMode && filesToggleEnabled ? handleToggleFiles : void 0,
46588
46727
  slotLeft: toolbarSlotLeft,
46589
- slotAfterTabs: !isCodeMode && isPreview && /* @__PURE__ */ jsx102(
46728
+ slotAfterTabs: !isCodeMode && isPreview && /* @__PURE__ */ jsx103(
46590
46729
  UseModeToolbarControls,
46591
46730
  {
46592
46731
  allowPrint,
@@ -46628,7 +46767,7 @@ function EditorShellInner({
46628
46767
  position: "relative"
46629
46768
  },
46630
46769
  children: [
46631
- isImageMode && imageSrc && (imageMode === "edit" && imageEditorContainer ? /* @__PURE__ */ jsx102(
46770
+ isImageMode && imageSrc && (imageMode === "edit" && imageEditorContainer ? /* @__PURE__ */ jsx103(
46632
46771
  ImageEditor,
46633
46772
  {
46634
46773
  filesContainer: imageEditorContainer,
@@ -46638,7 +46777,7 @@ function EditorShellInner({
46638
46777
  onExport: onImageExport,
46639
46778
  surface: colorScheme === "dark" ? DARK_SURFACE2 : LIGHT_SURFACE2
46640
46779
  }
46641
- ) : /* @__PURE__ */ jsx102(ImageViewer, { src: imageSrc, alt: imageAlt, theme: colorScheme })),
46780
+ ) : /* @__PURE__ */ jsx103(ImageViewer, { src: imageSrc, alt: imageAlt, theme: colorScheme })),
46642
46781
  !isImageMode && editingView === "raw" && /* @__PURE__ */ jsxs83(
46643
46782
  "div",
46644
46783
  {
@@ -46646,8 +46785,8 @@ function EditorShellInner({
46646
46785
  hidden: isPreview,
46647
46786
  style: isPreview ? { display: "none" } : void 0,
46648
46787
  children: [
46649
- isMarkdownMode && outlineVisible && /* @__PURE__ */ jsx102(OutlinePanel, { width: outlineWidth, readOnly }, "outline"),
46650
- /* @__PURE__ */ jsx102(
46788
+ isMarkdownMode && outlineVisible && /* @__PURE__ */ jsx103(OutlinePanel, { width: outlineWidth, readOnly }, "outline"),
46789
+ /* @__PURE__ */ jsx103(
46651
46790
  BlockCardView,
46652
46791
  {
46653
46792
  active: isCardMode,
@@ -46656,7 +46795,7 @@ function EditorShellInner({
46656
46795
  onPrev: prevBlock,
46657
46796
  onNext: nextBlock,
46658
46797
  onAdd: addBlock,
46659
- children: /* @__PURE__ */ jsx102("div", { className: "squisq-raw-editor-container", children: /* @__PURE__ */ jsx102(
46798
+ children: /* @__PURE__ */ jsx103("div", { className: "squisq-raw-editor-container", children: /* @__PURE__ */ jsx103(
46660
46799
  RawEditor,
46661
46800
  {
46662
46801
  ariaLabel: `${ariaLabel} \u2014 source`,
@@ -46668,9 +46807,9 @@ function EditorShellInner({
46668
46807
  },
46669
46808
  "raw-frame"
46670
46809
  ),
46671
- isCodeMode && codeContext && /* @__PURE__ */ jsx102(CodeContextZones, { options: codeContext }, "code-context"),
46672
- isMarkdownMode && isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx102(BlockPreviewPanel, { basePath }, "block-preview"),
46673
- isMarkdownMode && !isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx102(
46810
+ isCodeMode && codeContext && /* @__PURE__ */ jsx103(CodeContextZones, { options: codeContext }, "code-context"),
46811
+ isMarkdownMode && isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx103(BlockPreviewPanel, { basePath }, "block-preview"),
46812
+ isMarkdownMode && !isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx103(
46674
46813
  InlinePreviewGutter,
46675
46814
  {
46676
46815
  width: inlinePreviewWidth,
@@ -46679,7 +46818,7 @@ function EditorShellInner({
46679
46818
  },
46680
46819
  "inline"
46681
46820
  ),
46682
- isMarkdownMode && /* @__PURE__ */ jsx102(
46821
+ isMarkdownMode && /* @__PURE__ */ jsx103(
46683
46822
  NavigationSheet,
46684
46823
  {
46685
46824
  panel: navigationSheetPanel,
@@ -46701,8 +46840,8 @@ function EditorShellInner({
46701
46840
  hidden: isPreview,
46702
46841
  style: isPreview ? { display: "none" } : void 0,
46703
46842
  children: [
46704
- outlineVisible && /* @__PURE__ */ jsx102(OutlinePanel, { width: outlineWidth, readOnly }, "outline"),
46705
- /* @__PURE__ */ jsx102(
46843
+ outlineVisible && /* @__PURE__ */ jsx103(OutlinePanel, { width: outlineWidth, readOnly }, "outline"),
46844
+ /* @__PURE__ */ jsx103(
46706
46845
  BlockCardView,
46707
46846
  {
46708
46847
  active: isCardMode,
@@ -46711,7 +46850,7 @@ function EditorShellInner({
46711
46850
  onPrev: prevBlock,
46712
46851
  onNext: nextBlock,
46713
46852
  onAdd: addBlock,
46714
- children: /* @__PURE__ */ jsx102(
46853
+ children: /* @__PURE__ */ jsx103(
46715
46854
  WysiwygEditor,
46716
46855
  {
46717
46856
  ariaLabel,
@@ -46729,8 +46868,8 @@ function EditorShellInner({
46729
46868
  },
46730
46869
  "wysiwyg-frame"
46731
46870
  ),
46732
- isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx102(BlockPreviewPanel, { basePath }, "block-preview"),
46733
- !isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx102(
46871
+ isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx103(BlockPreviewPanel, { basePath }, "block-preview"),
46872
+ !isCardMode && inlinePreviewVisible && /* @__PURE__ */ jsx103(
46734
46873
  InlinePreviewGutter,
46735
46874
  {
46736
46875
  width: inlinePreviewWidth,
@@ -46739,7 +46878,7 @@ function EditorShellInner({
46739
46878
  },
46740
46879
  "inline"
46741
46880
  ),
46742
- /* @__PURE__ */ jsx102(
46881
+ /* @__PURE__ */ jsx103(
46743
46882
  NavigationSheet,
46744
46883
  {
46745
46884
  panel: navigationSheetPanel,
@@ -46754,7 +46893,7 @@ function EditorShellInner({
46754
46893
  },
46755
46894
  "wysiwyg-shell"
46756
46895
  ),
46757
- isMarkdownMode && isPreview && /* @__PURE__ */ jsx102(
46896
+ isMarkdownMode && isPreview && /* @__PURE__ */ jsx103(
46758
46897
  PreviewPanel,
46759
46898
  {
46760
46899
  basePath,
@@ -46767,7 +46906,7 @@ function EditorShellInner({
46767
46906
  ]
46768
46907
  }
46769
46908
  ),
46770
- isTimelineMode && timelineVideoVisible && /* @__PURE__ */ jsx102(
46909
+ isTimelineMode && timelineVideoVisible && /* @__PURE__ */ jsx103(
46771
46910
  TimelineVideoPanel,
46772
46911
  {
46773
46912
  schedule: timelineVideoSchedule,
@@ -46777,7 +46916,7 @@ function EditorShellInner({
46777
46916
  onClose: () => setTimelineVideoVisible(false)
46778
46917
  }
46779
46918
  ),
46780
- isTimelineMode && timelineCompositionVisible && /* @__PURE__ */ jsx102(
46919
+ isTimelineMode && timelineCompositionVisible && /* @__PURE__ */ jsx103(
46781
46920
  TimelineCompositionPanel,
46782
46921
  {
46783
46922
  doc,
@@ -46787,7 +46926,7 @@ function EditorShellInner({
46787
46926
  onClose: () => setTimelineCompositionVisible(false)
46788
46927
  }
46789
46928
  ),
46790
- isMarkdownMode && showFiles && /* @__PURE__ */ jsx102(
46929
+ isMarkdownMode && showFiles && /* @__PURE__ */ jsx103(
46791
46930
  MediaBin,
46792
46931
  {
46793
46932
  mediaProvider,
@@ -46803,11 +46942,11 @@ function EditorShellInner({
46803
46942
  highlightPath: filesFocusPath
46804
46943
  }
46805
46944
  ),
46806
- isMarkdownMode && /* @__PURE__ */ jsx102(ProofingPanel, {}),
46807
- isMarkdownMode && /* @__PURE__ */ jsx102(ReviewPanel, {}),
46945
+ isMarkdownMode && /* @__PURE__ */ jsx103(ProofingPanel, {}),
46946
+ isMarkdownMode && /* @__PURE__ */ jsx103(ReviewPanel, {}),
46808
46947
  isMarkdownMode && sidePanelSlot,
46809
- isMarkdownMode && /* @__PURE__ */ jsx102(ThemeDesignerDock, {}),
46810
- isMarkdownMode && isDragging && !(activeView === "wysiwyg" && dragContentType === "media") && /* @__PURE__ */ jsx102(
46948
+ isMarkdownMode && /* @__PURE__ */ jsx103(ThemeDesignerDock, {}),
46949
+ isMarkdownMode && isDragging && !(activeView === "wysiwyg" && dragContentType === "media") && /* @__PURE__ */ jsx103(
46811
46950
  DropZoneOverlay,
46812
46951
  {
46813
46952
  dragContentType,
@@ -46818,7 +46957,7 @@ function EditorShellInner({
46818
46957
  ]
46819
46958
  }
46820
46959
  ),
46821
- isTimelineMode && /* @__PURE__ */ jsx102(
46960
+ isTimelineMode && /* @__PURE__ */ jsx103(
46822
46961
  TimelineToolbar,
46823
46962
  {
46824
46963
  literalVideoVisible: timelineVideoVisible,
@@ -46829,7 +46968,7 @@ function EditorShellInner({
46829
46968
  onToggleComposition: () => setTimelineCompositionVisible((visible) => !visible)
46830
46969
  }
46831
46970
  ),
46832
- isTimelineMode && /* @__PURE__ */ jsx102(
46971
+ isTimelineMode && /* @__PURE__ */ jsx103(
46833
46972
  TimelineTrack,
46834
46973
  {
46835
46974
  doc: timelineDoc,
@@ -46838,8 +46977,8 @@ function EditorShellInner({
46838
46977
  basePath
46839
46978
  }
46840
46979
  ),
46841
- statusBarVisible && !isImageMode && /* @__PURE__ */ jsx102(StatusBar, { slotRight: statusBarSlotRight }),
46842
- isMarkdownMode && allowRecording && mediaProvider && /* @__PURE__ */ jsx102(
46980
+ statusBarVisible && !isImageMode && /* @__PURE__ */ jsx103(StatusBar, { slotRight: statusBarSlotRight }),
46981
+ isMarkdownMode && allowRecording && mediaProvider && /* @__PURE__ */ jsx103(
46843
46982
  RecorderEntry,
46844
46983
  {
46845
46984
  open: mediaBinRecorderOpen,
@@ -46852,8 +46991,8 @@ function EditorShellInner({
46852
46991
  )
46853
46992
  }
46854
46993
  ) }),
46855
- /* @__PURE__ */ jsx102(TooltipLayer, {}),
46856
- imageEditTarget !== null && mediaProvider && /* @__PURE__ */ jsx102(
46994
+ /* @__PURE__ */ jsx103(TooltipLayer, {}),
46995
+ imageEditTarget !== null && mediaProvider && /* @__PURE__ */ jsx103(
46857
46996
  ImageEditModal,
46858
46997
  {
46859
46998
  relativePath: imageEditTarget,
@@ -46869,12 +47008,12 @@ function EditorShellInner({
46869
47008
  shellTheme: colorScheme
46870
47009
  }
46871
47010
  ),
46872
- mediaEditTarget !== null && /* @__PURE__ */ jsx102(MediaEditModal, { target: mediaEditTarget, onClose: closeMediaEdit })
47011
+ mediaEditTarget !== null && /* @__PURE__ */ jsx103(MediaEditModal, { target: mediaEditTarget, onClose: closeMediaEdit })
46873
47012
  ]
46874
47013
  }
46875
47014
  );
46876
47015
  return /* @__PURE__ */ jsxs83(EditorContextMenuProvider, { rootRef: shellRef, readOnly, children: [
46877
- /* @__PURE__ */ jsx102(MediaEditContextMenuItems, {}),
47016
+ /* @__PURE__ */ jsx103(MediaEditContextMenuItems, {}),
46878
47017
  shell
46879
47018
  ] });
46880
47019
  }