@vishu1301/script-writing 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useRef, useMemo, useCallback } from 'react';
2
- import { ArrowRightLeft, MessageCircle, Brackets, UserRound, Sparkles, Clapperboard, ArrowRight, User, ChevronRight, Upload, Save, FileDown, RefreshCcw, Cog, Loader2, Tags } from 'lucide-react';
2
+ import { ArrowRightLeft, MessageCircle, Brackets, UserRound, Sparkles, Clapperboard, Upload, Save, FileDown, RefreshCcw, Cog, ArrowRight, User, ChevronRight, Loader2, AlignLeft, Tags, Plus, X } from 'lucide-react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import * as pdfjs from 'pdfjs-dist';
5
5
  import jsPDF from 'jspdf';
@@ -334,51 +334,127 @@ function ScreenplayEditorView({
334
334
  }
335
335
  }, [COURIER_STACK]);
336
336
  return /* @__PURE__ */ jsxs(Fragment, { children: [
337
- /* @__PURE__ */ jsx(
337
+ /* @__PURE__ */ jsxs(
338
338
  "div",
339
339
  {
340
- className: "sticky top-6 z-50 bg-white backdrop-blur-xl border border-white/10 rounded-full shadow-2xl flex gap-1 p-1.5 mb-12 select-none overflow-x-auto custom-scrollbar",
340
+ className: "sticky top-6 z-50 mx-auto bg-white/70 backdrop-blur-2xl border border-white/60 shadow-[0_8px_30px_rgb(0,0,0,0.04)] ring-1 ring-zinc-900/5 rounded-[2rem] flex items-center justify-between p-2 mb-12 select-none transition-all",
341
341
  style: {
342
- maxWidth: "1024px"
342
+ maxWidth: "1240px"
343
343
  },
344
- children: blockTypes.map((type) => {
345
- var _a;
346
- const selected = ((_a = blocks.find((b) => b.id === focusedBlockId)) == null ? void 0 : _a.type) === type;
347
- return /* @__PURE__ */ jsxs(
348
- "button",
349
- {
350
- type: "button",
351
- className: `flex items-center gap-2 px-4 py-2.5 rounded-full font-medium text-sm transition-all duration-300 ${selected ? "bg-zinc-900 text-white shadow-sm" : "text-zinc-400 hover:bg-zinc-800/10 hover:text-zinc-800"}`,
352
- onClick: () => handleBlockTypeChange(type),
353
- children: [
354
- /* @__PURE__ */ jsx(
355
- "input",
356
- {
357
- type: "radio",
358
- name: "blockType",
359
- id: `block-type-${type}`,
360
- className: "sr-only",
361
- "aria-label": blockStyles[type].label,
362
- checked: selected,
363
- readOnly: true
364
- }
365
- ),
366
- /* @__PURE__ */ jsxs(
367
- "label",
368
- {
369
- htmlFor: `block-type-${type}`,
370
- className: "flex items-center gap-2 cursor-pointer",
371
- children: [
372
- icons[type],
373
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap hidden sm:inline", children: blockStyles[type].label })
374
- ]
375
- }
376
- )
377
- ]
378
- },
379
- type
380
- );
381
- })
344
+ children: [
345
+ /* @__PURE__ */ jsx("div", { className: "flex gap-1 overflow-x-auto custom-scrollbar pr-2 items-center", children: blockTypes.map((type) => {
346
+ var _a;
347
+ const selected = ((_a = blocks.find((b) => b.id === focusedBlockId)) == null ? void 0 : _a.type) === type;
348
+ return /* @__PURE__ */ jsxs(
349
+ "button",
350
+ {
351
+ type: "button",
352
+ className: `group flex items-center gap-2.5 px-4 py-2 rounded-full font-semibold text-sm transition-all duration-300 ease-out active:scale-95 ${selected ? "bg-zinc-900 text-white shadow-md shadow-zinc-900/20" : "text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900"}`,
353
+ onClick: () => handleBlockTypeChange(type),
354
+ children: [
355
+ /* @__PURE__ */ jsx(
356
+ "input",
357
+ {
358
+ type: "radio",
359
+ name: "blockType",
360
+ id: `block-type-${type}`,
361
+ className: "sr-only",
362
+ "aria-label": blockStyles[type].label,
363
+ checked: selected,
364
+ readOnly: true
365
+ }
366
+ ),
367
+ /* @__PURE__ */ jsxs(
368
+ "label",
369
+ {
370
+ htmlFor: `block-type-${type}`,
371
+ className: "flex items-center gap-2 cursor-pointer pointer-events-none",
372
+ children: [
373
+ /* @__PURE__ */ jsx(
374
+ "div",
375
+ {
376
+ className: `${selected ? "opacity-100" : "opacity-70 group-hover:opacity-100"} transition-opacity duration-200`,
377
+ children: icons[type]
378
+ }
379
+ ),
380
+ /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap hidden sm:inline tracking-wide", children: blockStyles[type].label })
381
+ ]
382
+ }
383
+ )
384
+ ]
385
+ },
386
+ type
387
+ );
388
+ }) }),
389
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0 relative px-1", children: [
390
+ /* @__PURE__ */ jsx("div", { className: "w-[1px] h-6 bg-zinc-200/80 mx-2 hidden sm:block rounded-full" }),
391
+ /* @__PURE__ */ jsx(PdfImporter, { onScriptImported: handleScriptImport, children: /* @__PURE__ */ jsx("div", { title: "Import Script", children: /* @__PURE__ */ jsx(Upload, { className: "w-[18px] h-[18px]" }) }) }),
392
+ onSave && /* @__PURE__ */ jsx(
393
+ "button",
394
+ {
395
+ onClick: onSave,
396
+ className: "flex items-center justify-center w-10 h-10 rounded-full text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 transition-all duration-200 active:scale-95",
397
+ title: "Save Script",
398
+ "aria-label": "Save Script",
399
+ children: /* @__PURE__ */ jsx(Save, { className: "w-[18px] h-[18px]" })
400
+ }
401
+ ),
402
+ onSaveAsPdf && /* @__PURE__ */ jsx(
403
+ "button",
404
+ {
405
+ onClick: onSaveAsPdf,
406
+ className: "flex items-center justify-center w-10 h-10 rounded-full text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 transition-all duration-200 active:scale-95",
407
+ title: "Save as PDF",
408
+ "aria-label": "Save Script as PDF",
409
+ children: /* @__PURE__ */ jsx(FileDown, { className: "w-[18px] h-[18px]" })
410
+ }
411
+ ),
412
+ onSaveAsSbx && /* @__PURE__ */ jsx(
413
+ "button",
414
+ {
415
+ onClick: onSaveAsSbx,
416
+ className: "flex items-center justify-center w-10 h-10 rounded-full text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900 transition-all duration-200 active:scale-95",
417
+ title: "Sync with Cloud (SBX)",
418
+ "aria-label": "Save Script as SBX",
419
+ children: /* @__PURE__ */ jsx(RefreshCcw, { className: "w-[18px] h-[18px]" })
420
+ }
421
+ ),
422
+ /* @__PURE__ */ jsx(
423
+ "button",
424
+ {
425
+ onClick: () => setIsRulesOpen(!isRulesOpen),
426
+ className: `flex items-center justify-center w-10 h-10 rounded-full transition-all duration-200 active:scale-95 ${isRulesOpen ? "bg-zinc-900 text-white shadow-md shadow-zinc-900/20" : "text-zinc-500 hover:bg-zinc-100 hover:text-zinc-900"}`,
427
+ title: "Settings & Shortcuts",
428
+ "aria-label": "Toggle Settings",
429
+ children: /* @__PURE__ */ jsx(Cog, { className: "w-[18px] h-[18px]" })
430
+ }
431
+ ),
432
+ isRulesOpen && /* @__PURE__ */ jsxs("div", { className: "absolute top-[calc(100%+1rem)] right-0 bg-white/95 backdrop-blur-3xl rounded-[1.5rem] shadow-[0_20px_60px_-15px_rgba(0,0,0,0.1)] ring-1 ring-zinc-900/5 p-5 text-sm text-zinc-700 select-none font-sans overflow-hidden transition-all duration-300 w-72 origin-top-right animate-in fade-in zoom-in-95 z-50", children: [
433
+ /* @__PURE__ */ jsxs("h4", { className: "font-bold text-zinc-900 mb-4 text-sm flex items-center gap-2", children: [
434
+ /* @__PURE__ */ jsx(Cog, { className: "w-4 h-4 text-zinc-400" }),
435
+ "Settings & Shortcuts"
436
+ ] }),
437
+ /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs("ul", { className: "space-y-2.5", children: [
438
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
439
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-zinc-600", children: "New Block" }),
440
+ /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-[11px] font-bold text-zinc-700 bg-white border border-zinc-200/80 shadow-[0_2px_4px_rgb(0,0,0,0.02)] rounded-md", children: "Enter" })
441
+ ] }),
442
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
443
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-zinc-600", children: "Delete Block" }),
444
+ /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-[11px] font-bold text-zinc-700 bg-white border border-zinc-200/80 shadow-[0_2px_4px_rgb(0,0,0,0.02)] rounded-md", children: "Backspace" })
445
+ ] }),
446
+ /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
447
+ /* @__PURE__ */ jsx("span", { className: "font-medium text-zinc-600", children: "Change Type" }),
448
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
449
+ /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-[11px] font-bold text-zinc-700 bg-white border border-zinc-200/80 shadow-[0_2px_4px_rgb(0,0,0,0.02)] rounded-md", children: "Ctrl" }),
450
+ /* @__PURE__ */ jsx("span", { className: "text-zinc-400 font-medium", children: "+" }),
451
+ /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-[11px] font-bold text-zinc-700 bg-white border border-zinc-200/80 shadow-[0_2px_4px_rgb(0,0,0,0.02)] rounded-md", children: "\u2191/\u2193" })
452
+ ] })
453
+ ] })
454
+ ] }) })
455
+ ] })
456
+ ] })
457
+ ]
382
458
  }
383
459
  ),
384
460
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-12 w-full items-center pb-24", children: /* @__PURE__ */ jsx(
@@ -616,79 +692,7 @@ function ScreenplayEditorView({
616
692
  );
617
693
  })
618
694
  }
619
- ) }),
620
- /* @__PURE__ */ jsxs("div", { className: "fixed bottom-6 right-6 flex flex-col items-end gap-4 z-50", children: [
621
- /* @__PURE__ */ jsx(PdfImporter, { onScriptImported: handleScriptImport, children: /* @__PURE__ */ jsxs(Fragment, { children: [
622
- /* @__PURE__ */ jsx(Upload, { className: "w-5 h-5" }),
623
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Import" })
624
- ] }) }),
625
- onSave && /* @__PURE__ */ jsxs(
626
- "button",
627
- {
628
- onClick: onSave,
629
- className: "flex items-center justify-center gap-2 w-auto px-4 h-12 rounded-full bg-zinc-950 text-white shadow-xl shadow-zinc-900/20 border border-white/10 hover:bg-zinc-800 hover:scale-105 active:scale-95 transition-all duration-300",
630
- "aria-label": "Save Script",
631
- children: [
632
- /* @__PURE__ */ jsx(Save, { className: "w-5 h-5" }),
633
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Save" })
634
- ]
635
- }
636
- ),
637
- onSaveAsPdf && /* @__PURE__ */ jsxs(
638
- "button",
639
- {
640
- onClick: onSaveAsPdf,
641
- className: "flex items-center justify-center gap-2 w-auto px-4 h-12 rounded-full bg-zinc-950 text-white shadow-xl shadow-zinc-900/20 border border-white/10 hover:bg-zinc-800 hover:scale-105 active:scale-95 transition-all duration-300",
642
- "aria-label": "Save Script as PDF",
643
- children: [
644
- /* @__PURE__ */ jsx(FileDown, { className: "w-5 h-5" }),
645
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Save as PDF" })
646
- ]
647
- }
648
- ),
649
- onSaveAsSbx && /* @__PURE__ */ jsxs(
650
- "button",
651
- {
652
- onClick: onSaveAsSbx,
653
- className: "flex items-center justify-center gap-2 w-auto px-4 h-12 rounded-full bg-zinc-950 text-white shadow-xl shadow-zinc-900/20 border border-white/10 hover:bg-zinc-800 hover:scale-105 active:scale-95 transition-all duration-300",
654
- "aria-label": "Save Script as SBX",
655
- children: [
656
- /* @__PURE__ */ jsx(RefreshCcw, { className: "w-5 h-5" }),
657
- /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold", children: "Save" })
658
- ]
659
- }
660
- ),
661
- isRulesOpen && /* @__PURE__ */ jsxs("div", { className: "bg-white/80 backdrop-blur-md rounded-xl shadow-lg border border-zinc-200/50 p-4 text-xs text-zinc-700 select-none font-sans overflow-hidden transition-all duration-300 w-64 origin-bottom-right animate-in fade-in zoom-in-95", children: [
662
- /* @__PURE__ */ jsx("h4", { className: "font-bold text-zinc-800 mb-3 text-sm", children: "Settings & Shortcuts" }),
663
- /* @__PURE__ */ jsx("div", { className: "space-y-4", children: /* @__PURE__ */ jsx("div", { className: "space-y-1.5", children: /* @__PURE__ */ jsxs("ul", { className: "space-y-1.5", children: [
664
- /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
665
- /* @__PURE__ */ jsx("span", { children: "New Block" }),
666
- /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-xs font-semibold text-zinc-800 bg-zinc-200/70 border border-zinc-300/70 rounded-md", children: "Enter" })
667
- ] }),
668
- /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
669
- /* @__PURE__ */ jsx("span", { children: "Delete Block" }),
670
- /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-xs font-semibold text-zinc-800 bg-zinc-200/70 border border-zinc-300/70 rounded-md", children: "Backspace" })
671
- ] }),
672
- /* @__PURE__ */ jsxs("li", { className: "flex items-center justify-between gap-6", children: [
673
- /* @__PURE__ */ jsx("span", { children: "Change Type" }),
674
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
675
- /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-xs font-semibold text-zinc-800 bg-zinc-200/70 border border-zinc-300/70 rounded-md", children: "Ctrl" }),
676
- /* @__PURE__ */ jsx("span", { children: "+" }),
677
- /* @__PURE__ */ jsx("kbd", { className: "px-2 py-1 text-xs font-semibold text-zinc-800 bg-zinc-200/70 border border-zinc-300/70 rounded-md", children: "\u2191/\u2193" })
678
- ] })
679
- ] })
680
- ] }) }) })
681
- ] }),
682
- /* @__PURE__ */ jsx(
683
- "button",
684
- {
685
- onClick: () => setIsRulesOpen(!isRulesOpen),
686
- className: `flex items-center justify-center w-12 h-12 rounded-full bg-zinc-950 text-white shadow-xl shadow-zinc-900/20 border border-white/10 hover:bg-zinc-800 hover:scale-105 active:scale-95 transition-all duration-300 ${isRulesOpen ? "rotate-90" : "rotate-0"}`,
687
- "aria-label": "Toggle Settings",
688
- children: /* @__PURE__ */ jsx(Cog, { className: "w-5 h-5" })
689
- }
690
- )
691
- ] })
695
+ ) })
692
696
  ] });
693
697
  }
694
698
 
@@ -1351,6 +1355,33 @@ function useScreenplayEditor(options) {
1351
1355
  return block;
1352
1356
  });
1353
1357
  setBlocks(finalizedBlocks);
1358
+ if (options == null ? void 0 : options.onSave) {
1359
+ options.onSave(content);
1360
+ const typeToDivClass = {
1361
+ SCENE_HEADING: "divtype0",
1362
+ ACTION: "divtype2",
1363
+ CHARACTER: "divtype3",
1364
+ PARENTHETICAL: "divtype4",
1365
+ DIALOGUE: "divtype5",
1366
+ TRANSITION: "divtype6",
1367
+ GENERAL: "divtype2"
1368
+ };
1369
+ const sbxData = finalizedBlocks.map((block) => {
1370
+ const divClass = typeToDivClass[block.type] || "divtype2";
1371
+ let text = block.text || "";
1372
+ let extraAttributes = "";
1373
+ if (block.type === "SCENE_HEADING") {
1374
+ text = `${block.sceneType || "INT."} ${text} - ${block.timeOfDay || "DAY"}`.toUpperCase();
1375
+ if (block.sceneNumber) {
1376
+ extraAttributes = ` data-scene="${block.sceneNumber}"`;
1377
+ }
1378
+ } else if (block.type === "CHARACTER" || block.type === "TRANSITION") {
1379
+ text = text.toUpperCase();
1380
+ }
1381
+ return `<div class="${divClass}" id="par${block.id}"${extraAttributes}>${text}</div>`;
1382
+ }).join("");
1383
+ options.onSave(sbxData);
1384
+ }
1354
1385
  setTimeout(() => {
1355
1386
  var _a;
1356
1387
  const firstId = parsedBlocks[0].id;
@@ -1361,7 +1392,7 @@ function useScreenplayEditor(options) {
1361
1392
  }, 100);
1362
1393
  }
1363
1394
  },
1364
- [refs]
1395
+ [refs, options == null ? void 0 : options.onSave]
1365
1396
  );
1366
1397
  const handleFocus = useCallback(
1367
1398
  (id) => {
@@ -1504,7 +1535,7 @@ function useScreenplayEditor(options) {
1504
1535
  loadFromUrl
1505
1536
  };
1506
1537
  }
1507
- var handleSaveAsPdf = (blocks, sceneNumbers) => {
1538
+ var handleSaveAsPdf = (blocks, sceneNumbers, project_name) => {
1508
1539
  if (document.activeElement instanceof HTMLElement) {
1509
1540
  document.activeElement.blur();
1510
1541
  }
@@ -1589,9 +1620,13 @@ var handleSaveAsPdf = (blocks, sceneNumbers) => {
1589
1620
  }
1590
1621
  y += blockHeight;
1591
1622
  });
1592
- doc.save("screenplay_export.pdf");
1623
+ if (project_name) {
1624
+ doc.save(`${project_name}_${(/* @__PURE__ */ new Date()).toISOString()}.pdf`);
1625
+ } else {
1626
+ doc.save("screenplay_export.pdf");
1627
+ }
1593
1628
  };
1594
- var handleSaveAsSbx = (blocks, sceneNumbers, onSaveAsSbx) => {
1629
+ var convertBlocksToSbx = (blocks, sceneNumbers) => {
1595
1630
  const typeToDivClass = {
1596
1631
  SCENE_HEADING: "divtype0",
1597
1632
  ACTION: "divtype2",
@@ -1601,7 +1636,7 @@ var handleSaveAsSbx = (blocks, sceneNumbers, onSaveAsSbx) => {
1601
1636
  TRANSITION: "divtype6",
1602
1637
  GENERAL: "divtype2"
1603
1638
  };
1604
- const sbxData = blocks.map((block) => {
1639
+ return blocks.map((block) => {
1605
1640
  const divClass = typeToDivClass[block.type] || "divtype2";
1606
1641
  let text = block.text || "";
1607
1642
  let extraAttributes = "";
@@ -1616,18 +1651,28 @@ var handleSaveAsSbx = (blocks, sceneNumbers, onSaveAsSbx) => {
1616
1651
  }
1617
1652
  return `<div class="${divClass}" id="par${block.id}"${extraAttributes}>${text}</div>`;
1618
1653
  }).join("");
1654
+ };
1655
+ var handleSaveAsSbx = (blocks, sceneNumbers, onSaveAsSbx, project_name) => {
1656
+ const sbxData = convertBlocksToSbx(blocks, sceneNumbers);
1619
1657
  const blob = new Blob([sbxData], { type: "text/plain" });
1620
- const url = URL.createObjectURL(blob);
1621
- const a = document.createElement("a");
1622
- a.href = url;
1623
- a.download = "screenplay.sbx";
1624
- document.body.appendChild(a);
1625
- a.click();
1626
- document.body.removeChild(a);
1627
- URL.revokeObjectURL(url);
1628
1658
  if (onSaveAsSbx) {
1629
- const file = new File([blob], "screenplay.sbx", { type: "text/plain" });
1630
- onSaveAsSbx(file);
1659
+ if (project_name) {
1660
+ const file = new File(
1661
+ [blob],
1662
+ `${project_name}_${(/* @__PURE__ */ new Date()).toISOString()}.sbx`,
1663
+ { type: "text/plain" }
1664
+ );
1665
+ onSaveAsSbx(file);
1666
+ } else {
1667
+ const file = new File([blob], "screenplay.sbx", { type: "text/plain" });
1668
+ onSaveAsSbx(file);
1669
+ }
1670
+ }
1671
+ };
1672
+ var handleSyncWithCloud = (blocks, sceneNumbers, onSyncWithCloud) => {
1673
+ if (onSyncWithCloud) {
1674
+ const sbxData = convertBlocksToSbx(blocks, sceneNumbers);
1675
+ onSyncWithCloud(sbxData);
1631
1676
  }
1632
1677
  };
1633
1678
 
@@ -1653,9 +1698,26 @@ function ScriptBreakdownSceneView({
1653
1698
  removeTag,
1654
1699
  clearSelection,
1655
1700
  menuPlacement,
1656
- menuRef
1701
+ menuRef,
1702
+ subLocations,
1703
+ addSubLocation,
1704
+ removeSubLocation,
1705
+ sceneBrief,
1706
+ setSceneBrief
1657
1707
  }) {
1658
1708
  const COURIER_STACK = "'Courier Prime', 'Courier', monospace";
1709
+ const [isSubLocOpen, setIsSubLocOpen] = useState(false);
1710
+ const [subLocInput, setSubLocInput] = useState("");
1711
+ const subLocPopoverRef = useRef(null);
1712
+ useEffect(() => {
1713
+ const handleClickOutside = (e) => {
1714
+ if (isSubLocOpen && subLocPopoverRef.current && !subLocPopoverRef.current.contains(e.target)) {
1715
+ setIsSubLocOpen(false);
1716
+ }
1717
+ };
1718
+ document.addEventListener("mousedown", handleClickOutside);
1719
+ return () => document.removeEventListener("mousedown", handleClickOutside);
1720
+ }, [isSubLocOpen]);
1659
1721
  useEffect(() => {
1660
1722
  const fontId = "google-font-courier-prime";
1661
1723
  const styleId = "screenplay-editor-force-v4";
@@ -1738,117 +1800,137 @@ function ScriptBreakdownSceneView({
1738
1800
  return nodes;
1739
1801
  };
1740
1802
  return /* @__PURE__ */ jsx("div", { className: "p-8 md:p-12 mx-auto w-full min-h-screen flex flex-col gap-8", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row gap-8 items-start", children: [
1741
- /* @__PURE__ */ jsx(
1742
- "div",
1743
- {
1744
- className: "relative bg-[#fdfdfc] shadow-2xl shadow-zinc-300/60 border border-zinc-100 rounded-sm md:rounded-md pl-[1.5in] py-[1in] pr-[1in] flex flex-col w-[210mm] min-h-auto shrink-0",
1745
- style: {
1746
- fontFamily: COURIER_STACK,
1747
- paddingLeft: "1.5in",
1748
- paddingRight: "1in",
1749
- paddingTop: "1in",
1750
- paddingBottom: "1in",
1751
- lineHeight: "1.2"
1752
- },
1753
- "data-screenplay-editor": "true",
1754
- onMouseUp: handleMouseUp,
1755
- children: blocks.map((block) => /* @__PURE__ */ jsxs(
1756
- "div",
1757
- {
1758
- "data-block-id": block.id,
1759
- className: `relative break-words w-full px-4 py-2 ${blockStyles[block.type].className}`,
1760
- style: __spreadProps(__spreadValues({}, blockStyles[block.type].inputStyle), {
1761
- minHeight: "2.5rem"
1762
- }),
1763
- children: [
1764
- renderBlockText(block),
1765
- (selectionMenu == null ? void 0 : selectionMenu.blockId) === block.id && /* @__PURE__ */ jsxs(
1766
- "div",
1767
- {
1768
- ref: menuRef,
1769
- "data-screenplay-editor": "false",
1770
- className: `tag-menu absolute z-50 bg-white/70 backdrop-blur-2xl shadow-[0_10px_40px_rgb(0,0,0,0.06)] border border-white rounded-[1.5rem] p-2 flex flex-col w-56 animate-in fade-in zoom-in-95 duration-300 ease-out ${menuPlacement === "top" ? "origin-bottom" : "origin-top"}`,
1771
- style: {
1772
- top: selectionMenu.top,
1773
- left: selectionMenu.left,
1774
- transform: menuPlacement === "top" ? "translate(-50%, calc(-100% - 12px))" : "translate(-50%, 32px)"
1775
- },
1776
- children: [
1777
- /* @__PURE__ */ jsxs("div", { className: "relative z-10 px-3 py-2.5 border-b border-white/60 mb-1.5", children: [
1778
- /* @__PURE__ */ jsx("p", { className: "text-[9px] font-extrabold tracking-[0.2em] text-slate-400 uppercase mb-1", children: "Tag Element" }),
1779
- /* @__PURE__ */ jsxs(
1780
- "p",
1781
- {
1782
- className: "text-xs font-bold text-slate-700 truncate drop-shadow-sm",
1783
- title: selectionMenu.text,
1784
- children: [
1785
- '"',
1786
- selectionMenu.text,
1787
- '"'
1788
- ]
1789
- }
1790
- )
1791
- ] }),
1792
- /* @__PURE__ */ jsxs("div", { className: "relative z-10 flex flex-col gap-1", children: [
1793
- CATEGORIES.filter(
1794
- (cat) => !(cat.id === "LOCATION" && hasLocationTag)
1795
- ).map((cat) => /* @__PURE__ */ jsxs(
1796
- "button",
1797
- {
1798
- onClick: () => addTag(cat.id),
1799
- className: "group w-full text-[12px] font-bold px-3 py-2 rounded-xl transition-all duration-300 text-left flex items-center justify-between hover:bg-white/80 hover:shadow-[0_2px_10px_rgb(0,0,0,0.02)] active:scale-[0.98]",
1800
- style: { color: cat.color },
1801
- children: [
1802
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1803
- /* @__PURE__ */ jsx(
1804
- "div",
1805
- {
1806
- className: "w-2 h-2 rounded-full shadow-sm group-hover:scale-125 transition-transform duration-300",
1807
- style: { backgroundColor: cat.hex }
1808
- }
1809
- ),
1810
- cat.label
1811
- ] }),
1812
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-slate-400 opacity-0 group-hover:opacity-100 transition-all duration-300 translate-x-1 group-hover:translate-x-0", children: "Select" })
1813
- ]
1814
- },
1815
- cat.id
1816
- )),
1817
- tags.some(
1818
- (t) => t.blockId === block.id && t.startIndex === selectionMenu.startIndex && t.endIndex === selectionMenu.endIndex
1819
- ) && /* @__PURE__ */ jsx("div", { className: "mt-1 pt-1 border-t border-white/60", children: /* @__PURE__ */ jsxs(
1820
- "button",
1821
- {
1822
- onClick: (e) => {
1823
- const tagToRemove = tags.find(
1824
- (t) => t.blockId === block.id && t.startIndex === selectionMenu.startIndex && t.endIndex === selectionMenu.endIndex
1825
- );
1826
- if (tagToRemove) {
1827
- removeTag(e, tagToRemove.id);
1828
- clearSelection();
1829
- }
1830
- },
1831
- className: "group w-full text-[12px] font-bold px-3 py-2 rounded-xl transition-all duration-300 text-left flex items-center justify-between hover:bg-rose-50 hover:text-rose-600 hover:shadow-[0_2px_10px_rgb(225,29,72,0.04)] active:scale-[0.98] text-slate-500 border border-transparent hover:border-rose-100",
1832
- children: [
1833
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1834
- /* @__PURE__ */ jsx("div", { className: "w-2 h-2 rounded-full shadow-sm bg-rose-400 group-hover:scale-125 transition-transform duration-300" }),
1835
- "Remove Tag"
1836
- ] }),
1837
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-rose-400 opacity-0 group-hover:opacity-100 transition-all duration-300 translate-x-1 group-hover:translate-x-0", children: "Remove" })
1838
- ]
1839
- }
1840
- ) })
1841
- ] })
1842
- ]
1843
- }
1844
- )
1845
- ]
1803
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
1804
+ /* @__PURE__ */ jsx(
1805
+ "div",
1806
+ {
1807
+ className: "relative bg-[#fdfdfc] shadow-2xl shadow-zinc-300/60 border border-zinc-100 rounded-sm md:rounded-md pl-[1.5in] py-[1in] pr-[1in] flex flex-col w-[210mm] min-h-auto shrink-0",
1808
+ style: {
1809
+ fontFamily: COURIER_STACK,
1810
+ paddingLeft: "1.5in",
1811
+ paddingRight: "1in",
1812
+ paddingTop: "1in",
1813
+ paddingBottom: "1in",
1814
+ lineHeight: "1.2"
1846
1815
  },
1847
- block.id
1848
- ))
1849
- }
1850
- ),
1851
- /* @__PURE__ */ jsxs("div", { className: "w-full lg:w-80 flex-shrink-0 bg-white/50 backdrop-blur-2xl border border-white shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2.5rem] p-8 sticky top-6", children: [
1816
+ "data-screenplay-editor": "true",
1817
+ onMouseUp: handleMouseUp,
1818
+ children: blocks.map((block) => /* @__PURE__ */ jsxs(
1819
+ "div",
1820
+ {
1821
+ "data-block-id": block.id,
1822
+ className: `relative break-words w-full px-4 py-2 ${blockStyles[block.type].className}`,
1823
+ style: __spreadProps(__spreadValues({}, blockStyles[block.type].inputStyle), {
1824
+ minHeight: "2.5rem"
1825
+ }),
1826
+ children: [
1827
+ renderBlockText(block),
1828
+ (selectionMenu == null ? void 0 : selectionMenu.blockId) === block.id && /* @__PURE__ */ jsxs(
1829
+ "div",
1830
+ {
1831
+ ref: menuRef,
1832
+ "data-screenplay-editor": "false",
1833
+ className: `tag-menu absolute z-50 bg-white/70 backdrop-blur-2xl shadow-[0_10px_40px_rgb(0,0,0,0.06)] border border-white rounded-[1.5rem] p-2 flex flex-col w-56 animate-in fade-in zoom-in-95 duration-300 ease-out ${menuPlacement === "top" ? "origin-bottom" : "origin-top"}`,
1834
+ style: {
1835
+ top: selectionMenu.top,
1836
+ left: selectionMenu.left,
1837
+ transform: menuPlacement === "top" ? "translate(-50%, calc(-100% - 12px))" : "translate(-50%, 32px)"
1838
+ },
1839
+ children: [
1840
+ /* @__PURE__ */ jsxs("div", { className: "relative z-10 px-3 py-2.5 border-b border-white/60 mb-1.5", children: [
1841
+ /* @__PURE__ */ jsx("p", { className: "text-[9px] font-extrabold tracking-[0.2em] text-slate-400 uppercase mb-1", children: "Tag Element" }),
1842
+ /* @__PURE__ */ jsxs(
1843
+ "p",
1844
+ {
1845
+ className: "text-xs font-bold text-slate-700 truncate drop-shadow-sm",
1846
+ title: selectionMenu.text,
1847
+ children: [
1848
+ '"',
1849
+ selectionMenu.text,
1850
+ '"'
1851
+ ]
1852
+ }
1853
+ )
1854
+ ] }),
1855
+ /* @__PURE__ */ jsxs("div", { className: "relative z-10 flex flex-col gap-1", children: [
1856
+ CATEGORIES.filter(
1857
+ (cat) => !(cat.id === "LOCATION" && hasLocationTag)
1858
+ ).map((cat) => /* @__PURE__ */ jsxs(
1859
+ "button",
1860
+ {
1861
+ onClick: () => addTag(cat.id),
1862
+ className: "group w-full text-[12px] font-bold px-3 py-2 rounded-xl transition-all duration-300 text-left flex items-center justify-between hover:bg-white/80 hover:shadow-[0_2px_10px_rgb(0,0,0,0.02)] active:scale-[0.98]",
1863
+ style: { color: cat.color },
1864
+ children: [
1865
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1866
+ /* @__PURE__ */ jsx(
1867
+ "div",
1868
+ {
1869
+ className: "w-2 h-2 rounded-full shadow-sm group-hover:scale-125 transition-transform duration-300",
1870
+ style: { backgroundColor: cat.hex }
1871
+ }
1872
+ ),
1873
+ cat.label
1874
+ ] }),
1875
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-slate-400 opacity-0 group-hover:opacity-100 transition-all duration-300 translate-x-1 group-hover:translate-x-0", children: "Select" })
1876
+ ]
1877
+ },
1878
+ cat.id
1879
+ )),
1880
+ tags.some(
1881
+ (t) => t.blockId === block.id && t.startIndex === selectionMenu.startIndex && t.endIndex === selectionMenu.endIndex
1882
+ ) && /* @__PURE__ */ jsx("div", { className: "mt-1 pt-1 border-t border-white/60", children: /* @__PURE__ */ jsxs(
1883
+ "button",
1884
+ {
1885
+ onClick: (e) => {
1886
+ const tagToRemove = tags.find(
1887
+ (t) => t.blockId === block.id && t.startIndex === selectionMenu.startIndex && t.endIndex === selectionMenu.endIndex
1888
+ );
1889
+ if (tagToRemove) {
1890
+ removeTag(e, tagToRemove.id);
1891
+ clearSelection();
1892
+ }
1893
+ },
1894
+ className: "group w-full text-[12px] font-bold px-3 py-2 rounded-xl transition-all duration-300 text-left flex items-center justify-between hover:bg-rose-50 hover:text-rose-600 hover:shadow-[0_2px_10px_rgb(225,29,72,0.04)] active:scale-[0.98] text-slate-500 border border-transparent hover:border-rose-100",
1895
+ children: [
1896
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
1897
+ /* @__PURE__ */ jsx("div", { className: "w-2 h-2 rounded-full shadow-sm bg-rose-400 group-hover:scale-125 transition-transform duration-300" }),
1898
+ "Remove Tag"
1899
+ ] }),
1900
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] font-bold text-rose-400 opacity-0 group-hover:opacity-100 transition-all duration-300 translate-x-1 group-hover:translate-x-0", children: "Remove" })
1901
+ ]
1902
+ }
1903
+ ) })
1904
+ ] })
1905
+ ]
1906
+ }
1907
+ )
1908
+ ]
1909
+ },
1910
+ block.id
1911
+ ))
1912
+ }
1913
+ ),
1914
+ /* @__PURE__ */ jsxs("div", { className: "relative bg-[#fdfdfc] shadow-2xl shadow-zinc-300/60 border border-zinc-100 rounded-sm md:rounded-md flex flex-col w-[210mm] shrink-0 p-8 md:p-12 lg:p-16", children: [
1915
+ /* @__PURE__ */ jsxs("h3", { className: "text-xs font-extrabold text-slate-800 uppercase tracking-[0.25em] mb-6 flex items-center gap-3 font-sans", children: [
1916
+ /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-slate-100/80 shadow-inner border border-slate-200/50", children: /* @__PURE__ */ jsx(AlignLeft, { className: "w-3.5 h-3.5 text-slate-500" }) }),
1917
+ "Scene Brief"
1918
+ ] }),
1919
+ /* @__PURE__ */ jsx("div", { className: "relative bg-zinc-50/50 border border-zinc-200/60 rounded-xl p-4 md:p-6 shadow-inner focus-within:bg-white focus-within:border-zinc-300 focus-within:shadow-[0_8px_30px_rgb(0,0,0,0.04)] transition-all duration-300", children: /* @__PURE__ */ jsx(
1920
+ "textarea",
1921
+ {
1922
+ value: sceneBrief,
1923
+ onChange: (e) => setSceneBrief(e.target.value),
1924
+ placeholder: "Write a brief description or notes for this scene...",
1925
+ className: "w-full min-h-[120px] bg-transparent outline-none resize-y text-zinc-700 placeholder:text-zinc-400 text-sm md:text-base custom-scrollbar font-sans",
1926
+ style: {
1927
+ lineHeight: "1.6"
1928
+ }
1929
+ }
1930
+ ) })
1931
+ ] })
1932
+ ] }),
1933
+ /* @__PURE__ */ jsx("div", { className: "w-full lg:w-80 flex-shrink-0 flex flex-col gap-6 sticky top-6", children: /* @__PURE__ */ jsxs("div", { className: "bg-white/50 backdrop-blur-2xl border border-white shadow-[0_8px_30px_rgb(0,0,0,0.04)] rounded-[2.5rem] p-8", children: [
1852
1934
  /* @__PURE__ */ jsxs("h3", { className: "text-xs font-extrabold text-slate-800 uppercase tracking-[0.25em] mb-8 flex items-center gap-3", children: [
1853
1935
  /* @__PURE__ */ jsx("span", { className: "flex items-center justify-center w-8 h-8 rounded-full bg-white/80 shadow-[0_4px_15px_rgb(0,0,0,0.04)] border border-white", children: /* @__PURE__ */ jsx(Tags, { className: "w-3.5 h-3.5 text-slate-500" }) }),
1854
1936
  "Tags",
@@ -1870,20 +1952,93 @@ function ScriptBreakdownSceneView({
1870
1952
  style: { backgroundColor: cat.hex }
1871
1953
  }
1872
1954
  ),
1873
- cat.label
1955
+ cat.label,
1956
+ cat.id === "LOCATION" && /* @__PURE__ */ jsxs(
1957
+ "div",
1958
+ {
1959
+ className: "ml-auto relative",
1960
+ ref: subLocPopoverRef,
1961
+ children: [
1962
+ /* @__PURE__ */ jsx(
1963
+ "button",
1964
+ {
1965
+ onClick: () => setIsSubLocOpen(!isSubLocOpen),
1966
+ className: "flex items-center justify-center w-5 h-5 rounded-full hover:bg-slate-200 transition-colors",
1967
+ title: "Add Sub Location",
1968
+ children: /* @__PURE__ */ jsx(Plus, { className: "w-3 h-3 text-slate-500" })
1969
+ }
1970
+ ),
1971
+ isSubLocOpen && /* @__PURE__ */ jsxs("div", { className: "absolute right-0 top-full mt-2 w-56 bg-white backdrop-blur-2xl shadow-[0_10px_40px_rgb(0,0,0,0.06)] border border-white rounded-[1.5rem] p-3 z-50 animate-in fade-in zoom-in-95", children: [
1972
+ /* @__PURE__ */ jsx("p", { className: "text-[9px] font-extrabold tracking-[0.2em] text-slate-400 uppercase mb-2 px-1", children: "Add Sub Location" }),
1973
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
1974
+ /* @__PURE__ */ jsx(
1975
+ "input",
1976
+ {
1977
+ type: "text",
1978
+ value: subLocInput,
1979
+ onChange: (e) => setSubLocInput(e.target.value),
1980
+ onKeyDown: (e) => {
1981
+ if (e.key === "Enter") {
1982
+ addSubLocation(subLocInput);
1983
+ setSubLocInput("");
1984
+ setIsSubLocOpen(false);
1985
+ }
1986
+ },
1987
+ className: "w-full text-xs px-3 py-2 bg-white/50 border border-white/60 rounded-xl outline-none focus:bg-white/80 focus:border-white transition-all text-slate-700 font-bold shadow-[0_2px_10px_rgb(0,0,0,0.02)] placeholder:font-medium placeholder:text-slate-400",
1988
+ placeholder: "Sub location...",
1989
+ autoFocus: true
1990
+ }
1991
+ ),
1992
+ /* @__PURE__ */ jsx(
1993
+ "button",
1994
+ {
1995
+ onClick: () => {
1996
+ addSubLocation(subLocInput);
1997
+ setSubLocInput("");
1998
+ setIsSubLocOpen(false);
1999
+ },
2000
+ className: "flex items-center justify-center shrink-0 bg-slate-800 text-white px-3.5 py-2 rounded-xl text-[11px] font-bold hover:bg-slate-700 hover:shadow-md transition-all active:scale-95",
2001
+ children: "Add"
2002
+ }
2003
+ )
2004
+ ] })
2005
+ ] })
2006
+ ]
2007
+ }
2008
+ )
1874
2009
  ] }),
1875
- /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: catTags.map((tag) => /* @__PURE__ */ jsx(
1876
- "span",
1877
- {
1878
- className: "text-[11px] font-bold px-3 py-1.5 rounded-xl bg-white/80 backdrop-blur-md border border-white shadow-[0_4px_15px_rgb(0,0,0,0.03)] hover:shadow-[0_4px_20px_rgb(0,0,0,0.06)] hover:-translate-y-0.5 transition-all duration-300 cursor-default",
1879
- style: { color: cat.color },
1880
- children: tag.text
1881
- },
1882
- tag.id
1883
- )) })
2010
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-2", children: [
2011
+ catTags.map((tag) => /* @__PURE__ */ jsx(
2012
+ "span",
2013
+ {
2014
+ className: "text-[11px] font-bold px-3 py-1.5 rounded-xl bg-white/80 backdrop-blur-md border border-white shadow-[0_4px_15px_rgb(0,0,0,0.03)] hover:shadow-[0_4px_20px_rgb(0,0,0,0.06)] hover:-translate-y-0.5 transition-all duration-300 cursor-default",
2015
+ style: { color: cat.color },
2016
+ children: tag.text
2017
+ },
2018
+ tag.id
2019
+ )),
2020
+ cat.id === "LOCATION" && subLocations.map((subLoc) => /* @__PURE__ */ jsxs(
2021
+ "span",
2022
+ {
2023
+ className: "group flex items-center gap-1.5 text-[11px] font-bold px-3 py-1.5 rounded-xl bg-white backdrop-blur-md border border-slate-200/50 shadow-[0_4px_15px_rgb(0,0,0,0.03)] transition-all duration-300 cursor-default text-slate-500",
2024
+ children: [
2025
+ subLoc,
2026
+ /* @__PURE__ */ jsx(
2027
+ "button",
2028
+ {
2029
+ onClick: () => removeSubLocation(subLoc),
2030
+ className: "w-3.5 h-3.5 rounded-full hover:bg-slate-300/50 flex items-center justify-center transition-colors opacity-0 group-hover:opacity-100",
2031
+ children: /* @__PURE__ */ jsx(X, { className: "w-2.5 h-2.5" })
2032
+ }
2033
+ )
2034
+ ]
2035
+ },
2036
+ `sub-${subLoc}`
2037
+ ))
2038
+ ] })
1884
2039
  ] }, cat.id);
1885
2040
  }) }) : /* @__PURE__ */ jsx("p", { className: "text-xs font-medium text-slate-400 italic bg-white/40 p-6 rounded-[2rem] border border-white border-dashed text-center shadow-[0_4px_20px_rgb(0,0,0,0.02)]", children: "Highlight text to tag elements." })
1886
- ] })
2041
+ ] }) })
1887
2042
  ] }) });
1888
2043
  }
1889
2044
  function useScriptBreakdown({
@@ -2010,8 +2165,24 @@ function useScriptBreakdownScene(sceneNumber) {
2010
2165
  const autoTaggedSceneRef = useRef(null);
2011
2166
  const [menuPlacement, setMenuPlacement] = useState("top");
2012
2167
  const menuRef = useRef(null);
2168
+ const [subLocations, setSubLocations] = useState([]);
2169
+ const addSubLocation = useCallback(
2170
+ (subLocation) => {
2171
+ const trimmed = subLocation.trim();
2172
+ if (trimmed && !subLocations.includes(trimmed)) {
2173
+ setSubLocations((prev) => [...prev, trimmed]);
2174
+ }
2175
+ },
2176
+ [subLocations]
2177
+ );
2178
+ const removeSubLocation = useCallback((subLocation) => {
2179
+ setSubLocations((prev) => prev.filter((loc) => loc !== subLocation));
2180
+ }, []);
2181
+ const [sceneBrief, setSceneBrief] = useState("");
2013
2182
  useEffect(() => {
2014
2183
  setTags([]);
2184
+ setSubLocations([]);
2185
+ setSceneBrief("");
2015
2186
  autoTaggedSceneRef.current = null;
2016
2187
  }, [sceneNumber]);
2017
2188
  useEffect(() => {
@@ -2026,14 +2197,17 @@ function useScriptBreakdownScene(sceneNumber) {
2026
2197
  let match;
2027
2198
  while ((match = regex.exec(block.text)) !== null) {
2028
2199
  const isOverlapping = autoTags.some(
2029
- (t) => t.blockId === block.id && (match.index + char.length > t.startIndex && match.index < t.endIndex)
2200
+ (t) => t.blockId === block.id && match.index + char.length > t.startIndex && match.index < t.endIndex
2030
2201
  );
2031
2202
  if (!isOverlapping) {
2032
2203
  autoTags.push({
2033
2204
  id: uuid(),
2034
2205
  blockId: block.id,
2035
2206
  categoryId: "CAST",
2036
- text: block.text.substring(match.index, match.index + char.length),
2207
+ text: block.text.substring(
2208
+ match.index,
2209
+ match.index + char.length
2210
+ ),
2037
2211
  startIndex: match.index,
2038
2212
  endIndex: match.index + char.length
2039
2213
  });
@@ -2099,15 +2273,25 @@ function useScriptBreakdownScene(sceneNumber) {
2099
2273
  };
2100
2274
  const handleMouseUp = () => {
2101
2275
  const selection = window.getSelection();
2102
- if (!selection || selection.isCollapsed || !selection.toString().trim()) return;
2276
+ if (!selection || selection.isCollapsed || !selection.toString().trim())
2277
+ return;
2103
2278
  const range = selection.getRangeAt(0);
2104
2279
  let container = range.commonAncestorContainer;
2105
- if (container.nodeType === Node.TEXT_NODE) container = container.parentElement;
2280
+ if (container.nodeType === Node.TEXT_NODE)
2281
+ container = container.parentElement;
2106
2282
  const blockElem = container.closest("[data-block-id]");
2107
2283
  if (!blockElem) return;
2108
2284
  const blockId = blockElem.getAttribute("data-block-id");
2109
- const startOffset = getAbsoluteOffset(blockElem, range.startContainer, range.startOffset);
2110
- const endOffset = getAbsoluteOffset(blockElem, range.endContainer, range.endOffset);
2285
+ const startOffset = getAbsoluteOffset(
2286
+ blockElem,
2287
+ range.startContainer,
2288
+ range.startOffset
2289
+ );
2290
+ const endOffset = getAbsoluteOffset(
2291
+ blockElem,
2292
+ range.endContainer,
2293
+ range.endOffset
2294
+ );
2111
2295
  if (startOffset !== null && endOffset !== null) {
2112
2296
  const rect = range.getBoundingClientRect();
2113
2297
  const blockRect = blockElem.getBoundingClientRect();
@@ -2158,10 +2342,15 @@ function useScriptBreakdownScene(sceneNumber) {
2158
2342
  removeTag,
2159
2343
  clearSelection,
2160
2344
  menuPlacement,
2161
- menuRef
2345
+ menuRef,
2346
+ subLocations,
2347
+ addSubLocation,
2348
+ removeSubLocation,
2349
+ sceneBrief,
2350
+ setSceneBrief
2162
2351
  };
2163
2352
  }
2164
2353
 
2165
- export { CATEGORIES, ScreenplayEditorView, ScriptBreakdownSceneView, blockStyles, blockTypes, handleSaveAsPdf, handleSaveAsSbx, icons, timeOfDayOptions, useScreenplayEditor, useScriptBreakdownScene, uuid };
2354
+ export { CATEGORIES, ScreenplayEditorView, ScriptBreakdownSceneView, blockStyles, blockTypes, convertBlocksToSbx, handleSaveAsPdf, handleSaveAsSbx, handleSyncWithCloud, icons, timeOfDayOptions, useScreenplayEditor, useScriptBreakdownScene, uuid };
2166
2355
  //# sourceMappingURL=index.js.map
2167
2356
  //# sourceMappingURL=index.js.map