@vishu1301/script-writing 1.0.8 → 1.0.9
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 +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -995,6 +995,10 @@ function useScreenplayEditor(options) {
|
|
|
995
995
|
const [showExtensionSuggestions, setShowExtensionSuggestions] = react.useState(false);
|
|
996
996
|
const blurTimeout = react.useRef(null);
|
|
997
997
|
const loadedUrlRef = react.useRef(null);
|
|
998
|
+
const onSaveRef = react.useRef(options == null ? void 0 : options.onSave);
|
|
999
|
+
react.useEffect(() => {
|
|
1000
|
+
onSaveRef.current = options == null ? void 0 : options.onSave;
|
|
1001
|
+
}, [options == null ? void 0 : options.onSave]);
|
|
998
1002
|
const characterExtensions = react.useMemo(
|
|
999
1003
|
() => ["(V.O.)", "(O.S.)", "(O.C.)", "(SUBTITLE)", "(CONT'D)"],
|
|
1000
1004
|
[]
|
|
@@ -1380,7 +1384,7 @@ function useScreenplayEditor(options) {
|
|
|
1380
1384
|
return block;
|
|
1381
1385
|
});
|
|
1382
1386
|
setBlocks(finalizedBlocks);
|
|
1383
|
-
if (
|
|
1387
|
+
if (onSaveRef.current) {
|
|
1384
1388
|
const typeToDivClass = {
|
|
1385
1389
|
SCENE_HEADING: "divtype0",
|
|
1386
1390
|
ACTION: "divtype2",
|
|
@@ -1405,7 +1409,7 @@ function useScreenplayEditor(options) {
|
|
|
1405
1409
|
return `<div class="${divClass}" id="par${block.id}"${extraAttributes}>${text}</div>`;
|
|
1406
1410
|
}).join("");
|
|
1407
1411
|
const blob = new Blob([sbxData], { type: "text/plain" });
|
|
1408
|
-
|
|
1412
|
+
onSaveRef.current(blob);
|
|
1409
1413
|
}
|
|
1410
1414
|
setTimeout(() => {
|
|
1411
1415
|
var _a;
|
|
@@ -1417,7 +1421,7 @@ function useScreenplayEditor(options) {
|
|
|
1417
1421
|
}, 100);
|
|
1418
1422
|
}
|
|
1419
1423
|
},
|
|
1420
|
-
[refs
|
|
1424
|
+
[refs]
|
|
1421
1425
|
);
|
|
1422
1426
|
const handleFocus = react.useCallback(
|
|
1423
1427
|
(id) => {
|