@vishu1301/script-writing 1.0.8 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1351,6 +1351,7 @@ function useScreenplayEditor(options) {
1351
1351
  );
1352
1352
  const handleScriptImport = react.useCallback(
1353
1353
  (title, content, preParsedBlocks) => {
1354
+ var _a;
1354
1355
  let parsedBlocks = [];
1355
1356
  if (preParsedBlocks && preParsedBlocks.length > 0) {
1356
1357
  parsedBlocks = preParsedBlocks.map((b) => ({
@@ -1405,19 +1406,19 @@ function useScreenplayEditor(options) {
1405
1406
  return `<div class="${divClass}" id="par${block.id}"${extraAttributes}>${text}</div>`;
1406
1407
  }).join("");
1407
1408
  const blob = new Blob([sbxData], { type: "text/plain" });
1408
- options.onSave(blob);
1409
+ (_a = options == null ? void 0 : options.onSave) == null ? void 0 : _a.call(options, blob);
1409
1410
  }
1410
1411
  setTimeout(() => {
1411
- var _a;
1412
+ var _a2;
1412
1413
  const firstId = parsedBlocks[0].id;
1413
1414
  if (firstId && refs.current[firstId]) {
1414
1415
  setFocusedBlockId(firstId);
1415
- (_a = refs.current[firstId]) == null ? void 0 : _a.focus();
1416
+ (_a2 = refs.current[firstId]) == null ? void 0 : _a2.focus();
1416
1417
  }
1417
1418
  }, 100);
1418
1419
  }
1419
1420
  },
1420
- [refs, options == null ? void 0 : options.onSave]
1421
+ [refs]
1421
1422
  );
1422
1423
  const handleFocus = react.useCallback(
1423
1424
  (id) => {