@vishu1301/script-writing 1.1.6 → 1.1.8
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 +43 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +43 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -107,7 +107,7 @@ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, scene
|
|
|
107
107
|
} | null;
|
|
108
108
|
handleMouseUp: () => void;
|
|
109
109
|
addTag: (c: ElementCategory) => void;
|
|
110
|
-
removeTag: (e: React__default.MouseEvent, id
|
|
110
|
+
removeTag: (e: React__default.MouseEvent, id?: string) => void;
|
|
111
111
|
clearSelection: () => void;
|
|
112
112
|
menuPlacement: "top" | "bottom";
|
|
113
113
|
menuRef: React__default.RefObject<HTMLDivElement | null>;
|
|
@@ -120,7 +120,7 @@ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, scene
|
|
|
120
120
|
isSummarizing?: boolean;
|
|
121
121
|
}): react_jsx_runtime.JSX.Element;
|
|
122
122
|
|
|
123
|
-
declare function useScriptBreakdownScene(scene_url: string, fetchOptions?: RequestInit, onAISummarize?: (scene: any) => void, onTagAdded?: (tag: Tag) => void, onTagRemoved?: (tagId: string) => void): {
|
|
123
|
+
declare function useScriptBreakdownScene(scene_url: string, fetchOptions?: RequestInit, onAISummarize?: (scene: any) => void, onTagAdded?: (tag: Tag) => void, onTagRemoved?: (tagId: string) => void, preLoadedTags?: Tag[]): {
|
|
124
124
|
scene: any;
|
|
125
125
|
blocks: Block[];
|
|
126
126
|
characters: string[];
|
package/dist/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, scene
|
|
|
107
107
|
} | null;
|
|
108
108
|
handleMouseUp: () => void;
|
|
109
109
|
addTag: (c: ElementCategory) => void;
|
|
110
|
-
removeTag: (e: React__default.MouseEvent, id
|
|
110
|
+
removeTag: (e: React__default.MouseEvent, id?: string) => void;
|
|
111
111
|
clearSelection: () => void;
|
|
112
112
|
menuPlacement: "top" | "bottom";
|
|
113
113
|
menuRef: React__default.RefObject<HTMLDivElement | null>;
|
|
@@ -120,7 +120,7 @@ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, scene
|
|
|
120
120
|
isSummarizing?: boolean;
|
|
121
121
|
}): react_jsx_runtime.JSX.Element;
|
|
122
122
|
|
|
123
|
-
declare function useScriptBreakdownScene(scene_url: string, fetchOptions?: RequestInit, onAISummarize?: (scene: any) => void, onTagAdded?: (tag: Tag) => void, onTagRemoved?: (tagId: string) => void): {
|
|
123
|
+
declare function useScriptBreakdownScene(scene_url: string, fetchOptions?: RequestInit, onAISummarize?: (scene: any) => void, onTagAdded?: (tag: Tag) => void, onTagRemoved?: (tagId: string) => void, preLoadedTags?: Tag[]): {
|
|
124
124
|
scene: any;
|
|
125
125
|
blocks: Block[];
|
|
126
126
|
characters: string[];
|
package/dist/index.js
CHANGED
|
@@ -408,7 +408,7 @@ function ScreenplayEditorView({
|
|
|
408
408
|
}) }),
|
|
409
409
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 shrink-0 relative px-1", children: [
|
|
410
410
|
/* @__PURE__ */ jsx("div", { className: "w-[1px] h-6 bg-zinc-200/80 mx-2 hidden sm:block rounded-full" }),
|
|
411
|
-
showPdfImport && /* @__PURE__ */ jsx(PdfImporter, { disabled: isLocked, onScriptImported: handleScriptImport, children: /* @__PURE__ */ jsx("div", { title: "Import Script", children: /* @__PURE__ */ jsx(Upload, { className: "w-[18px] h-[18px]" }) }) }),
|
|
411
|
+
showPdfImport && !isLocked && /* @__PURE__ */ jsx(PdfImporter, { disabled: isLocked, onScriptImported: handleScriptImport, children: /* @__PURE__ */ jsx("div", { title: "Import Script", children: /* @__PURE__ */ jsx(Upload, { className: "w-[18px] h-[18px]" }) }) }),
|
|
412
412
|
onToggleLock && /* @__PURE__ */ jsx(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
@@ -1746,14 +1746,14 @@ var PopcornIcon = ({ isSummarizing }) => /* @__PURE__ */ jsxs(
|
|
|
1746
1746
|
"path",
|
|
1747
1747
|
{
|
|
1748
1748
|
d: "M18 8a2 2 0 0 0 0-4 2 2 0 0 0-4 0 2 2 0 0 0-4 0 2 2 0 0 0-4 0 2 2 0 0 0 0 4",
|
|
1749
|
-
|
|
1749
|
+
stroke: "#facc15",
|
|
1750
1750
|
strokeWidth: "2"
|
|
1751
1751
|
}
|
|
1752
1752
|
),
|
|
1753
|
-
/* @__PURE__ */ jsxs("g", {
|
|
1753
|
+
/* @__PURE__ */ jsxs("g", { stroke: "#ef4444", strokeWidth: "2", children: [
|
|
1754
1754
|
/* @__PURE__ */ jsx("path", { d: "M20 8c.5 0 .9.4.8 1l-2.6 12c-.1.5-.7 1-1.2 1H7c-.6 0-1.1-.4-1.2-1L3.2 9c-.1-.6.3-1 .8-1Z" }),
|
|
1755
|
-
/* @__PURE__ */ jsx("path", { d: "M10 22 9 8",
|
|
1756
|
-
/* @__PURE__ */ jsx("path", { d: "m14 22 1-14",
|
|
1755
|
+
/* @__PURE__ */ jsx("path", { d: "M10 22 9 8", strokeWidth: "1" }),
|
|
1756
|
+
/* @__PURE__ */ jsx("path", { d: "m14 22 1-14", strokeWidth: "1" })
|
|
1757
1757
|
] })
|
|
1758
1758
|
]
|
|
1759
1759
|
}
|
|
@@ -1769,15 +1769,31 @@ var SummarizeButton = ({
|
|
|
1769
1769
|
disabled: isSummarizing,
|
|
1770
1770
|
className: `group relative w-full py-4 px-8 rounded-[3rem] transition-all duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] border ${isSummarizing ? "bg-zinc-100 border-zinc-300 opacity-100 cursor-wait shadow-inner" : "bg-gradient-to-b from-white via-zinc-50 to-zinc-100 border-white/70 shadow-[0_10px_30px_-10px_rgba(0,0,0,0.12),inset_0_1px_0_rgba(255,255,255,0.8)] hover:shadow-[0_20px_50px_-15px_rgba(139,92,246,0.3)] hover:-translate-y-[2px] active:scale-[0.98]"}`,
|
|
1771
1771
|
children: [
|
|
1772
|
-
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition duration-700", children: /* @__PURE__ */ jsx(
|
|
1772
|
+
/* @__PURE__ */ jsx("span", { className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition duration-700", children: /* @__PURE__ */ jsx(
|
|
1773
|
+
"span",
|
|
1774
|
+
{
|
|
1775
|
+
className: "absolute inset-0 blur-3xl opacity-20",
|
|
1776
|
+
style: {
|
|
1777
|
+
backgroundImage: "conic-gradient(from 0deg at 50% 50%, #c084fc, transparent 60%, #fb7185, transparent 90%)",
|
|
1778
|
+
animation: "custom-spin 10s linear infinite"
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
) }),
|
|
1773
1782
|
/* @__PURE__ */ jsx(
|
|
1774
1783
|
"span",
|
|
1775
1784
|
{
|
|
1776
|
-
className: `absolute inset-0 transition-opacity duration-700
|
|
1785
|
+
className: `absolute inset-0 transition-opacity duration-700 ${isSummarizing ? "opacity-100" : "opacity-0"}`,
|
|
1786
|
+
style: {
|
|
1787
|
+
backgroundImage: "radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1), transparent 70%)"
|
|
1788
|
+
}
|
|
1777
1789
|
}
|
|
1778
1790
|
),
|
|
1779
1791
|
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center gap-4", children: [
|
|
1780
1792
|
/* @__PURE__ */ jsx("style", { children: `
|
|
1793
|
+
@keyframes custom-spin {
|
|
1794
|
+
from { transform: rotate(0deg); }
|
|
1795
|
+
to { transform: rotate(360deg); }
|
|
1796
|
+
}
|
|
1781
1797
|
@keyframes kernel-pop {
|
|
1782
1798
|
0% { transform: translate(0, 0) scale(0) rotate(0deg); opacity: 0; }
|
|
1783
1799
|
10% { opacity: 1; transform: translate(var(--tx1), var(--ty1)) scale(1.3) rotate(45deg); }
|
|
@@ -2017,7 +2033,7 @@ function ScriptBreakdownSceneView({
|
|
|
2017
2033
|
/* @__PURE__ */ jsx(
|
|
2018
2034
|
"div",
|
|
2019
2035
|
{
|
|
2020
|
-
className: "relative bg-[#fdfdfc] shadow-
|
|
2036
|
+
className: "relative bg-[#fdfdfc] shadow-md 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",
|
|
2021
2037
|
style: {
|
|
2022
2038
|
fontFamily: COURIER_STACK,
|
|
2023
2039
|
paddingLeft: "1.5in",
|
|
@@ -2099,8 +2115,8 @@ function ScriptBreakdownSceneView({
|
|
|
2099
2115
|
const tagToRemove = tags.find(
|
|
2100
2116
|
(t) => t.block_id === block.id && t.start_index === selectionMenu.startIndex && t.end_index === selectionMenu.endIndex
|
|
2101
2117
|
);
|
|
2102
|
-
if (tagToRemove
|
|
2103
|
-
removeTag(e, tagToRemove
|
|
2118
|
+
if (tagToRemove) {
|
|
2119
|
+
removeTag(e, tagToRemove.id);
|
|
2104
2120
|
clearSelection();
|
|
2105
2121
|
}
|
|
2106
2122
|
},
|
|
@@ -2124,7 +2140,7 @@ function ScriptBreakdownSceneView({
|
|
|
2124
2140
|
))
|
|
2125
2141
|
}
|
|
2126
2142
|
),
|
|
2127
|
-
/* @__PURE__ */ jsxs("div", { className: "relative bg-[#fdfdfc] shadow-
|
|
2143
|
+
/* @__PURE__ */ jsxs("div", { className: "relative bg-[#fdfdfc] shadow-md 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: [
|
|
2128
2144
|
/* @__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: [
|
|
2129
2145
|
/* @__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" }) }),
|
|
2130
2146
|
"Scene Brief"
|
|
@@ -2263,8 +2279,8 @@ function ScriptBreakdownSceneView({
|
|
|
2263
2279
|
] })
|
|
2264
2280
|
] }) });
|
|
2265
2281
|
}
|
|
2266
|
-
function useScriptBreakdownScene(scene_url, fetchOptions, onAISummarize, onTagAdded, onTagRemoved) {
|
|
2267
|
-
const [tags, setTags] = useState([]);
|
|
2282
|
+
function useScriptBreakdownScene(scene_url, fetchOptions, onAISummarize, onTagAdded, onTagRemoved, preLoadedTags) {
|
|
2283
|
+
const [tags, setTags] = useState(preLoadedTags || []);
|
|
2268
2284
|
const [selectionMenu, setSelectionMenu] = useState(null);
|
|
2269
2285
|
const autoTaggedSceneRef = useRef(null);
|
|
2270
2286
|
const [scene, setScene] = useState(null);
|
|
@@ -2341,17 +2357,26 @@ function useScriptBreakdownScene(scene_url, fetchOptions, onAISummarize, onTagAd
|
|
|
2341
2357
|
if (res.ok) {
|
|
2342
2358
|
const data = await res.json();
|
|
2343
2359
|
setIsSummarizing(false);
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2360
|
+
let parsedData = [];
|
|
2361
|
+
let parsedSummaryData = {};
|
|
2362
|
+
try {
|
|
2363
|
+
const normalData = JSON.parse(data.data);
|
|
2364
|
+
if (Array.isArray(normalData)) {
|
|
2365
|
+
parsedData = Array.isArray(normalData[0]) ? normalData[0] : [];
|
|
2366
|
+
const summary = Array.isArray(normalData[1]) ? normalData[1] : [];
|
|
2367
|
+
parsedSummaryData = summary[0] || {};
|
|
2368
|
+
}
|
|
2369
|
+
} catch (error2) {
|
|
2370
|
+
console.error("Error parsing AI summary data:", error2);
|
|
2371
|
+
}
|
|
2372
|
+
setSceneBrief(parsedSummaryData.summarise || "");
|
|
2349
2373
|
const newTags = [];
|
|
2350
2374
|
parsedData.forEach((aiTag) => {
|
|
2351
2375
|
if (!aiTag.block_id || !aiTag.category_id || typeof aiTag.start_index !== "number" || typeof aiTag.end_index !== "number") {
|
|
2352
2376
|
return;
|
|
2353
2377
|
}
|
|
2354
2378
|
newTags.push({
|
|
2379
|
+
id: aiTag.id || uuid(),
|
|
2355
2380
|
block_id: String(aiTag.block_id).startsWith("par") ? String(aiTag.block_id).substring(3) : String(aiTag.block_id),
|
|
2356
2381
|
category_id: aiTag.category_id,
|
|
2357
2382
|
name: aiTag.name,
|