@vishu1301/script-writing 1.4.1 → 1.4.3
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 +201 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -4
- package/dist/index.d.ts +9 -4
- package/dist/index.js +201 -114
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -186,7 +186,7 @@ interface Shot {
|
|
|
186
186
|
lens_feel: string;
|
|
187
187
|
aperture: string;
|
|
188
188
|
depth_of_field: string;
|
|
189
|
-
fps?:
|
|
189
|
+
fps?: number;
|
|
190
190
|
subject: string;
|
|
191
191
|
action_blocking: string;
|
|
192
192
|
emotional_purpose: string;
|
|
@@ -207,7 +207,7 @@ interface ShotBreakdown {
|
|
|
207
207
|
shots: Shot[];
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, handleMouseUp, addShot, updateShot, clearSelection, menuRef, cameras, sceneType, initializeProduction, }: {
|
|
210
|
+
declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, handleMouseUp, addShot, updateShot, clearSelection, menuRef, cameras, sceneType, initializeProduction, handleAISummarize, isSummarizing, aiSummarized, }: {
|
|
211
211
|
blocks: Block[];
|
|
212
212
|
isLoading: boolean;
|
|
213
213
|
shots: Shot[];
|
|
@@ -224,6 +224,9 @@ declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, ha
|
|
|
224
224
|
menuRef: React__default.RefObject<HTMLDivElement | null>;
|
|
225
225
|
cameras: Camera[];
|
|
226
226
|
initializeProduction: (count: number, type: string) => any;
|
|
227
|
+
handleAISummarize: () => void;
|
|
228
|
+
isSummarizing: boolean;
|
|
229
|
+
aiSummarized?: boolean;
|
|
227
230
|
}): react_jsx_runtime.JSX.Element;
|
|
228
231
|
|
|
229
232
|
interface UseShotBreakdownOptions {
|
|
@@ -231,7 +234,7 @@ interface UseShotBreakdownOptions {
|
|
|
231
234
|
fetchOptions?: RequestInit;
|
|
232
235
|
onAISummarize?: (scene: any) => void;
|
|
233
236
|
onShotAdded?: (shot: Shot) => any;
|
|
234
|
-
onShotsBulkAdded?: (shots: Shot[],
|
|
237
|
+
onShotsBulkAdded?: (shots: Shot[], scene_type: string) => Promise<void>;
|
|
235
238
|
onShotRemoved?: (shotId: string) => any;
|
|
236
239
|
onShotUpdated?: (shotId: string, detail: Shot) => any;
|
|
237
240
|
onProductionInitialized?: (cameras: Camera[], type: string) => any;
|
|
@@ -256,6 +259,8 @@ declare function useShotBreakdownScene(options: UseShotBreakdownOptions): {
|
|
|
256
259
|
addShot: (shotDetails: Omit<Shot, "id" | "shot_number" | "parts">) => any;
|
|
257
260
|
updateShot: (shotId: string | number, updatedDetails: Omit<Shot, "id" | "shot_number" | "parts">) => Promise<any>;
|
|
258
261
|
clearSelection: () => void;
|
|
262
|
+
handleAISummarize: () => Promise<void>;
|
|
263
|
+
isSummarizing: boolean;
|
|
259
264
|
menuRef: React$1.RefObject<HTMLDivElement | null>;
|
|
260
265
|
};
|
|
261
266
|
|
|
@@ -283,7 +288,7 @@ declare const vfx_types: {
|
|
|
283
288
|
name: string;
|
|
284
289
|
}[];
|
|
285
290
|
declare const fps_options: {
|
|
286
|
-
value:
|
|
291
|
+
value: number;
|
|
287
292
|
label: string;
|
|
288
293
|
}[];
|
|
289
294
|
declare const scene_types: {
|
package/dist/index.d.ts
CHANGED
|
@@ -186,7 +186,7 @@ interface Shot {
|
|
|
186
186
|
lens_feel: string;
|
|
187
187
|
aperture: string;
|
|
188
188
|
depth_of_field: string;
|
|
189
|
-
fps?:
|
|
189
|
+
fps?: number;
|
|
190
190
|
subject: string;
|
|
191
191
|
action_blocking: string;
|
|
192
192
|
emotional_purpose: string;
|
|
@@ -207,7 +207,7 @@ interface ShotBreakdown {
|
|
|
207
207
|
shots: Shot[];
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, handleMouseUp, addShot, updateShot, clearSelection, menuRef, cameras, sceneType, initializeProduction, }: {
|
|
210
|
+
declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, handleMouseUp, addShot, updateShot, clearSelection, menuRef, cameras, sceneType, initializeProduction, handleAISummarize, isSummarizing, aiSummarized, }: {
|
|
211
211
|
blocks: Block[];
|
|
212
212
|
isLoading: boolean;
|
|
213
213
|
shots: Shot[];
|
|
@@ -224,6 +224,9 @@ declare function ShotBreakdownView({ blocks, isLoading, shots, selectionMenu, ha
|
|
|
224
224
|
menuRef: React__default.RefObject<HTMLDivElement | null>;
|
|
225
225
|
cameras: Camera[];
|
|
226
226
|
initializeProduction: (count: number, type: string) => any;
|
|
227
|
+
handleAISummarize: () => void;
|
|
228
|
+
isSummarizing: boolean;
|
|
229
|
+
aiSummarized?: boolean;
|
|
227
230
|
}): react_jsx_runtime.JSX.Element;
|
|
228
231
|
|
|
229
232
|
interface UseShotBreakdownOptions {
|
|
@@ -231,7 +234,7 @@ interface UseShotBreakdownOptions {
|
|
|
231
234
|
fetchOptions?: RequestInit;
|
|
232
235
|
onAISummarize?: (scene: any) => void;
|
|
233
236
|
onShotAdded?: (shot: Shot) => any;
|
|
234
|
-
onShotsBulkAdded?: (shots: Shot[],
|
|
237
|
+
onShotsBulkAdded?: (shots: Shot[], scene_type: string) => Promise<void>;
|
|
235
238
|
onShotRemoved?: (shotId: string) => any;
|
|
236
239
|
onShotUpdated?: (shotId: string, detail: Shot) => any;
|
|
237
240
|
onProductionInitialized?: (cameras: Camera[], type: string) => any;
|
|
@@ -256,6 +259,8 @@ declare function useShotBreakdownScene(options: UseShotBreakdownOptions): {
|
|
|
256
259
|
addShot: (shotDetails: Omit<Shot, "id" | "shot_number" | "parts">) => any;
|
|
257
260
|
updateShot: (shotId: string | number, updatedDetails: Omit<Shot, "id" | "shot_number" | "parts">) => Promise<any>;
|
|
258
261
|
clearSelection: () => void;
|
|
262
|
+
handleAISummarize: () => Promise<void>;
|
|
263
|
+
isSummarizing: boolean;
|
|
259
264
|
menuRef: React$1.RefObject<HTMLDivElement | null>;
|
|
260
265
|
};
|
|
261
266
|
|
|
@@ -283,7 +288,7 @@ declare const vfx_types: {
|
|
|
283
288
|
name: string;
|
|
284
289
|
}[];
|
|
285
290
|
declare const fps_options: {
|
|
286
|
-
value:
|
|
291
|
+
value: number;
|
|
287
292
|
label: string;
|
|
288
293
|
}[];
|
|
289
294
|
declare const scene_types: {
|
package/dist/index.js
CHANGED
|
@@ -1563,7 +1563,12 @@ function useScreenplayEditor(options) {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
1565
1565
|
const filename = ((_a = url.split("/").pop()) == null ? void 0 : _a.replace(/\.sbx$/i, "")) || "Imported from URL";
|
|
1566
|
-
handleScriptImport(
|
|
1566
|
+
handleScriptImport(
|
|
1567
|
+
filename,
|
|
1568
|
+
scriptContent,
|
|
1569
|
+
preParsedBlocks,
|
|
1570
|
+
isInitialLoad
|
|
1571
|
+
);
|
|
1567
1572
|
} catch (error) {
|
|
1568
1573
|
console.error(
|
|
1569
1574
|
"[useScreenplayEditor] Error loading script from URL:",
|
|
@@ -3223,17 +3228,17 @@ var vfx_types = [
|
|
|
3223
3228
|
{ name: "CG Lighting / Light Wrap" }
|
|
3224
3229
|
];
|
|
3225
3230
|
var fps_options = [
|
|
3226
|
-
{ value:
|
|
3227
|
-
{ value:
|
|
3228
|
-
{ value:
|
|
3229
|
-
{ value:
|
|
3230
|
-
{ value:
|
|
3231
|
-
{ value:
|
|
3232
|
-
{ value:
|
|
3233
|
-
{ value:
|
|
3234
|
-
{ value:
|
|
3235
|
-
{ value:
|
|
3236
|
-
{ value:
|
|
3231
|
+
{ value: 23.98, label: "23.98 fps" },
|
|
3232
|
+
{ value: 24, label: "24 fps" },
|
|
3233
|
+
{ value: 25, label: "25 fps" },
|
|
3234
|
+
{ value: 29.97, label: "29.97 fps" },
|
|
3235
|
+
{ value: 30, label: "30 fps" },
|
|
3236
|
+
{ value: 48, label: "48 fps" },
|
|
3237
|
+
{ value: 50, label: "50 fps" },
|
|
3238
|
+
{ value: 59.94, label: "59.94 fps" },
|
|
3239
|
+
{ value: 60, label: "60 fps" },
|
|
3240
|
+
{ value: 120, label: "120 fps (Slow Motion)" },
|
|
3241
|
+
{ value: 240, label: "240 fps (High Speed)" }
|
|
3237
3242
|
];
|
|
3238
3243
|
var scene_types = [
|
|
3239
3244
|
{ name: "Action / Adventure" },
|
|
@@ -3319,7 +3324,7 @@ var AddShotForm = ({
|
|
|
3319
3324
|
lens_mm: "",
|
|
3320
3325
|
lens_feel: "",
|
|
3321
3326
|
aperture: "T2.8",
|
|
3322
|
-
fps:
|
|
3327
|
+
fps: 24,
|
|
3323
3328
|
depth_of_field: "",
|
|
3324
3329
|
subject: "",
|
|
3325
3330
|
action_blocking: "",
|
|
@@ -4099,7 +4104,10 @@ function ShotBreakdownView({
|
|
|
4099
4104
|
menuRef,
|
|
4100
4105
|
cameras,
|
|
4101
4106
|
sceneType,
|
|
4102
|
-
initializeProduction
|
|
4107
|
+
initializeProduction,
|
|
4108
|
+
handleAISummarize,
|
|
4109
|
+
isSummarizing,
|
|
4110
|
+
aiSummarized = false
|
|
4103
4111
|
}) {
|
|
4104
4112
|
var _a, _b, _c;
|
|
4105
4113
|
const COURIER_STACK = "'Courier Prime', 'Courier', monospace";
|
|
@@ -4253,115 +4261,132 @@ function ShotBreakdownView({
|
|
|
4253
4261
|
"div",
|
|
4254
4262
|
{
|
|
4255
4263
|
className: `fixed xl:absolute top-0 right-0 z-50 h-full w-72 transform transition-transform duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] xl:translate-x-0 ${isSidebarOpen ? "translate-x-0 shadow-[0_0_40px_rgba(0,0,0,0.1)]" : "translate-x-full"}`,
|
|
4256
|
-
children: /* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4264
|
+
children: /* @__PURE__ */ jsxs("div", { className: "sticky top-0 flex h-[100dvh] max-h-screen w-full flex-col border-l border-l-[#eefafd] bg-white p-3 py-5", children: [
|
|
4265
|
+
!aiSummarized && /* @__PURE__ */ jsx(
|
|
4266
|
+
summarize_button_default,
|
|
4267
|
+
{
|
|
4268
|
+
onSummarize: handleAISummarize,
|
|
4269
|
+
isSummarizing
|
|
4270
|
+
}
|
|
4271
|
+
),
|
|
4272
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex flex-col gap-3 py-5 my-5 border-t border-t-[#eefafd] flex-1 overflow-hidden", children: [
|
|
4273
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-between mb-6 shrink-0 px-1", children: [
|
|
4274
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
4275
|
+
/* @__PURE__ */ jsx("div", { className: "relative flex h-8 w-8 items-center justify-center rounded-[10px] border border-[#15607b]/20 bg-white shadow-sm", children: /* @__PURE__ */ jsx(Video, { className: "h-4 w-4 text-[#15607b]" }) }),
|
|
4276
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
4277
|
+
/* @__PURE__ */ jsx("h3", { className: "text-[12px] font-semibold uppercase tracking-[0.28em] text-[#134a61]", children: "Shots" }),
|
|
4278
|
+
sceneType && /* @__PURE__ */ jsx("span", { className: "text-[9px] font-bold text-[#15607b] uppercase tracking-tighter opacity-80 mt-0.5", children: sceneType })
|
|
4279
|
+
] })
|
|
4280
|
+
] }),
|
|
4281
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
|
|
4282
|
+
cameras.length === 0 && /* @__PURE__ */ jsx(
|
|
4283
|
+
"button",
|
|
4284
|
+
{
|
|
4285
|
+
onClick: () => setIsInitModalOpen(true),
|
|
4286
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md border border-slate-200 bg-white shadow-sm transition-colors hover:bg-slate-50",
|
|
4287
|
+
title: "Project Setup",
|
|
4288
|
+
children: /* @__PURE__ */ jsx(Settings2, { className: "h-3.5 w-3.5 text-slate-600" })
|
|
4289
|
+
}
|
|
4290
|
+
),
|
|
4291
|
+
shots.length > 0 && /* @__PURE__ */ jsx("span", { className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[10px] font-semibold text-slate-600 shadow-sm", children: shots.length })
|
|
4263
4292
|
] })
|
|
4264
4293
|
] }),
|
|
4265
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center
|
|
4266
|
-
|
|
4267
|
-
|
|
4294
|
+
shots.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-4 text-center", children: [
|
|
4295
|
+
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-slate-50 border border-slate-100 mb-3", children: /* @__PURE__ */ jsx(Video, { className: "h-4 w-4 text-slate-300" }) }),
|
|
4296
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-700", children: "No shots created" }),
|
|
4297
|
+
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 mt-1 max-w-[160px] leading-relaxed", children: "Highlight text in the screenplay to add your first shot." })
|
|
4298
|
+
] }) : /* @__PURE__ */ jsx("div", { className: "flex h-full max-h-[calc(100vh-200px)] flex-col gap-2.5 overflow-y-auto overflow-x-hidden pb-4 pr-2 custom-scrollbar", children: shots.map((shot) => {
|
|
4299
|
+
const isActive = toggledShotId === shot.id;
|
|
4300
|
+
return /* @__PURE__ */ jsxs(
|
|
4301
|
+
"div",
|
|
4268
4302
|
{
|
|
4269
|
-
onClick: () =>
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
shots.length > 0 && /* @__PURE__ */ jsx("span", { className: "rounded-md border border-slate-200 bg-white px-2 py-0.5 text-[10px] font-semibold text-slate-600 shadow-sm", children: shots.length })
|
|
4276
|
-
] })
|
|
4277
|
-
] }),
|
|
4278
|
-
cameras.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5 px-1 mb-6 mt-2", children: /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 text-[9px] font-bold uppercase tracking-widest bg-slate-100 text-slate-500 px-2 py-1 rounded-md border border-slate-200/50", children: [
|
|
4279
|
-
cameras.length,
|
|
4280
|
-
" Multi-Cam Setup"
|
|
4281
|
-
] }) }),
|
|
4282
|
-
shots.length === 0 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-10 px-4 text-center", children: [
|
|
4283
|
-
/* @__PURE__ */ jsx("div", { className: "flex h-10 w-10 items-center justify-center rounded-full bg-slate-50 border border-slate-100 mb-3", children: /* @__PURE__ */ jsx(Video, { className: "h-4 w-4 text-slate-300" }) }),
|
|
4284
|
-
/* @__PURE__ */ jsx("p", { className: "text-xs font-semibold text-slate-700", children: "No shots created" }),
|
|
4285
|
-
/* @__PURE__ */ jsx("p", { className: "text-[11px] text-slate-500 mt-1 max-w-[160px] leading-relaxed", children: "Highlight text in the screenplay to add your first shot." })
|
|
4286
|
-
] }) : /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2.5 overflow-y-auto overflow-x-hidden pb-4 pr-2 custom-scrollbar", children: shots.map((shot) => {
|
|
4287
|
-
const isActive = toggledShotId === shot.id;
|
|
4288
|
-
return /* @__PURE__ */ jsxs(
|
|
4289
|
-
"div",
|
|
4290
|
-
{
|
|
4291
|
-
onClick: () => {
|
|
4292
|
-
var _a2;
|
|
4293
|
-
return setToggledShotId(isActive ? null : (_a2 = shot.id) != null ? _a2 : null);
|
|
4294
|
-
},
|
|
4295
|
-
className: `group relative flex flex-col cursor-pointer gap-2 overflow-hidden rounded-lg border px-3.5 py-3 transition-colors duration-200 ${isActive ? "border-slate-800 bg-slate-50 shadow-[0_2px_8px_rgba(0,0,0,0.04)]" : "border-slate-200 bg-white hover:border-slate-300 hover:bg-slate-50/50"}`,
|
|
4296
|
-
children: [
|
|
4297
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
4298
|
-
/* @__PURE__ */ jsxs(
|
|
4299
|
-
"span",
|
|
4300
|
-
{
|
|
4301
|
-
className: `text-xs font-semibold ${isActive ? "text-slate-900" : "text-slate-700"}`,
|
|
4302
|
-
children: [
|
|
4303
|
-
"Shot ",
|
|
4304
|
-
shot.shot_number
|
|
4305
|
-
]
|
|
4306
|
-
}
|
|
4307
|
-
),
|
|
4303
|
+
onClick: () => {
|
|
4304
|
+
var _a2;
|
|
4305
|
+
return setToggledShotId(isActive ? null : (_a2 = shot.id) != null ? _a2 : null);
|
|
4306
|
+
},
|
|
4307
|
+
className: `group relative flex-shrink-0 cursor-pointer rounded-xl border transition-all duration-300 overflow-hidden ${isActive ? "border-slate-900 bg-slate-50 shadow-[0_6px_20px_rgba(0,0,0,0.06)]" : "border-slate-200 bg-white hover:border-slate-300 hover:shadow-[0_4px_14px_rgba(0,0,0,0.05)]"}`,
|
|
4308
|
+
children: [
|
|
4308
4309
|
/* @__PURE__ */ jsx(
|
|
4309
|
-
"
|
|
4310
|
+
"div",
|
|
4310
4311
|
{
|
|
4311
|
-
className: `
|
|
4312
|
-
|
|
4312
|
+
className: `absolute left-0 top-0 h-full w-[3px] transition-all duration-300
|
|
4313
|
+
${isActive ? "bg-slate-900" : "bg-transparent group-hover:bg-slate-300"}`
|
|
4313
4314
|
}
|
|
4314
|
-
)
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4332
|
-
|
|
4333
|
-
},
|
|
4334
|
-
className: "flex flex-1 items-center justify-center gap-1.5 rounded-md border border-slate-200 bg-white py-1.5 text-[10px] font-bold text-slate-700 shadow-sm transition-colors hover:bg-slate-50 hover:text-slate-900",
|
|
4335
|
-
children: [
|
|
4336
|
-
/* @__PURE__ */ jsx(Eye, { className: "h-3 w-3" }),
|
|
4337
|
-
"View"
|
|
4338
|
-
]
|
|
4339
|
-
}
|
|
4340
|
-
),
|
|
4341
|
-
/* @__PURE__ */ jsxs(
|
|
4342
|
-
"button",
|
|
4315
|
+
),
|
|
4316
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2 px-4 py-3.5", children: [
|
|
4317
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
4318
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
|
|
4319
|
+
/* @__PURE__ */ jsxs(
|
|
4320
|
+
"span",
|
|
4321
|
+
{
|
|
4322
|
+
className: `text-[11px] font-semibold tracking-wide uppercase
|
|
4323
|
+
${isActive ? "text-slate-900" : "text-slate-500"}`,
|
|
4324
|
+
children: [
|
|
4325
|
+
"Shot ",
|
|
4326
|
+
shot.shot_number
|
|
4327
|
+
]
|
|
4328
|
+
}
|
|
4329
|
+
),
|
|
4330
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-slate-800 leading-tight", children: shot.camera_name || "Unknown Camera" })
|
|
4331
|
+
] }),
|
|
4332
|
+
/* @__PURE__ */ jsx(
|
|
4333
|
+
"span",
|
|
4343
4334
|
{
|
|
4344
|
-
|
|
4345
|
-
|
|
4346
|
-
e.stopPropagation();
|
|
4347
|
-
setUpdatingShotId((_a2 = shot.id) != null ? _a2 : null);
|
|
4348
|
-
},
|
|
4349
|
-
className: "flex flex-1 items-center justify-center gap-1.5 rounded-md bg-slate-900 py-1.5 text-[10px] font-bold text-white shadow-sm transition-colors hover:bg-slate-800",
|
|
4350
|
-
children: [
|
|
4351
|
-
/* @__PURE__ */ jsx(Pencil, { className: "h-3 w-3" }),
|
|
4352
|
-
"Edit"
|
|
4353
|
-
]
|
|
4335
|
+
className: `rounded-md px-2 py-0.5 text-[8px] font-bold uppercase tracking-wider ${isActive ? "bg-slate-900 text-white" : "bg-slate-100 text-slate-500 group-hover:bg-slate-200"}`,
|
|
4336
|
+
children: shot.shot_type
|
|
4354
4337
|
}
|
|
4355
4338
|
)
|
|
4356
|
-
] })
|
|
4357
|
-
|
|
4358
|
-
|
|
4359
|
-
|
|
4360
|
-
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4339
|
+
] }),
|
|
4340
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-[11px] text-slate-500", children: [
|
|
4341
|
+
/* @__PURE__ */ jsx("span", { children: shot.lens_mm ? `${shot.lens_mm}mm Lens` : "\u2014" }),
|
|
4342
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-60", children: "Tap to expand" })
|
|
4343
|
+
] }),
|
|
4344
|
+
/* @__PURE__ */ jsx(
|
|
4345
|
+
"div",
|
|
4346
|
+
{
|
|
4347
|
+
className: `grid transition-all duration-300 ease-in-out ${isActive ? "grid-rows-[1fr] opacity-100 mt-2" : "grid-rows-[0fr] opacity-0"}`,
|
|
4348
|
+
children: /* @__PURE__ */ jsx("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsxs("div", { className: "py-3 pb-1 border-t border-slate-200/70 flex gap-2", children: [
|
|
4349
|
+
/* @__PURE__ */ jsxs(
|
|
4350
|
+
"button",
|
|
4351
|
+
{
|
|
4352
|
+
onClick: (e) => {
|
|
4353
|
+
var _a2;
|
|
4354
|
+
e.stopPropagation();
|
|
4355
|
+
setViewingShotId((_a2 = shot.id) != null ? _a2 : null);
|
|
4356
|
+
},
|
|
4357
|
+
className: "flex flex-1 items-center justify-center gap-1.5 rounded-md border border-slate-200 bg-white py-2 text-[11px] font-semibold text-slate-700 transition-all hover:bg-slate-50 hover:text-slate-900",
|
|
4358
|
+
children: [
|
|
4359
|
+
/* @__PURE__ */ jsx(Eye, { className: "h-3.5 w-3.5" }),
|
|
4360
|
+
"View"
|
|
4361
|
+
]
|
|
4362
|
+
}
|
|
4363
|
+
),
|
|
4364
|
+
/* @__PURE__ */ jsxs(
|
|
4365
|
+
"button",
|
|
4366
|
+
{
|
|
4367
|
+
onClick: (e) => {
|
|
4368
|
+
var _a2;
|
|
4369
|
+
e.stopPropagation();
|
|
4370
|
+
setUpdatingShotId((_a2 = shot.id) != null ? _a2 : null);
|
|
4371
|
+
},
|
|
4372
|
+
className: "flex flex-1 items-center justify-center gap-1.5 rounded-md bg-slate-900 py-2 text-[11px] font-semibold text-white transition-all hover:bg-slate-800",
|
|
4373
|
+
children: [
|
|
4374
|
+
/* @__PURE__ */ jsx(Pencil, { className: "h-3.5 w-3.5" }),
|
|
4375
|
+
"Edit"
|
|
4376
|
+
]
|
|
4377
|
+
}
|
|
4378
|
+
)
|
|
4379
|
+
] }) })
|
|
4380
|
+
}
|
|
4381
|
+
)
|
|
4382
|
+
] })
|
|
4383
|
+
]
|
|
4384
|
+
},
|
|
4385
|
+
shot.id
|
|
4386
|
+
);
|
|
4387
|
+
}) })
|
|
4388
|
+
] })
|
|
4389
|
+
] })
|
|
4365
4390
|
}
|
|
4366
4391
|
),
|
|
4367
4392
|
selectionMenu && /* @__PURE__ */ jsx(
|
|
@@ -4453,6 +4478,7 @@ function useShotBreakdownScene(options) {
|
|
|
4453
4478
|
);
|
|
4454
4479
|
const [scene, setScene] = useState(null);
|
|
4455
4480
|
const [isLoading, setIsLoading] = useState(true);
|
|
4481
|
+
const [isSummarizing, setIsSummarizing] = useState(false);
|
|
4456
4482
|
const [error, setError] = useState(false);
|
|
4457
4483
|
const [selectionMenu, setSelectionMenu] = useState(null);
|
|
4458
4484
|
const menuRef = useRef(null);
|
|
@@ -4669,6 +4695,65 @@ function useShotBreakdownScene(options) {
|
|
|
4669
4695
|
return result;
|
|
4670
4696
|
}
|
|
4671
4697
|
};
|
|
4698
|
+
const handleAISummarize = async () => {
|
|
4699
|
+
var _a;
|
|
4700
|
+
if (!scene || !scene.content || !options.onAISummarize) return;
|
|
4701
|
+
setIsSummarizing(true);
|
|
4702
|
+
try {
|
|
4703
|
+
const res = await ((_a = options.onAISummarize) == null ? void 0 : _a.call(options, scene.content));
|
|
4704
|
+
if (res && res.ok) {
|
|
4705
|
+
const data = await res.json();
|
|
4706
|
+
setIsSummarizing(false);
|
|
4707
|
+
const newShots = [];
|
|
4708
|
+
data.data[0].forEach((aiShot) => {
|
|
4709
|
+
var _a2;
|
|
4710
|
+
const newShot = {
|
|
4711
|
+
id: aiShot.id || uuid(),
|
|
4712
|
+
shot_number: (shots.length || 0) + newShots.length + 1,
|
|
4713
|
+
priority: aiShot.priority || "Essential",
|
|
4714
|
+
shot_type: aiShot.shot_type || "Medium Shot (MS)",
|
|
4715
|
+
framing: aiShot.framing || "Eye Level",
|
|
4716
|
+
camera_angle: aiShot.camera_angle || "Eye Level",
|
|
4717
|
+
camera_movement: aiShot.camera_movement || "Static (Locked-Off)",
|
|
4718
|
+
camera_support: aiShot.camera_support || "Tripod",
|
|
4719
|
+
lens_mm: aiShot.lens_mm || "35",
|
|
4720
|
+
lens_feel: aiShot.lens_feel || "Standard",
|
|
4721
|
+
aperture: aiShot.aperture || "T2.8",
|
|
4722
|
+
depth_of_field: aiShot.depth_of_field || "Deep",
|
|
4723
|
+
subject: aiShot.subject || "",
|
|
4724
|
+
action_blocking: aiShot.action_blocking || "",
|
|
4725
|
+
emotional_purpose: aiShot.emotional_purpose || "",
|
|
4726
|
+
lighting: aiShot.lighting || "",
|
|
4727
|
+
sound: aiShot.sound || "",
|
|
4728
|
+
duration_seconds: aiShot.duration_seconds || 5,
|
|
4729
|
+
edit_purpose: aiShot.edit_purpose || "",
|
|
4730
|
+
reason: aiShot.reason || "",
|
|
4731
|
+
vfx: aiShot.vfx || "None",
|
|
4732
|
+
camera_name: aiShot.camera_name || ((_a2 = cameras[0]) == null ? void 0 : _a2.name) || "Camera A",
|
|
4733
|
+
fps: aiShot.fps || 24,
|
|
4734
|
+
parts: aiShot.parts.map((part) => ({
|
|
4735
|
+
block_id: part.block_id.startsWith("par") ? part.block_id.substring(3) : part.block_id || uuid(),
|
|
4736
|
+
start_index: part.start_index,
|
|
4737
|
+
end_index: part.end_index,
|
|
4738
|
+
text: part.text
|
|
4739
|
+
})) || []
|
|
4740
|
+
};
|
|
4741
|
+
newShots.push(newShot);
|
|
4742
|
+
});
|
|
4743
|
+
if (newShots.length > 0) {
|
|
4744
|
+
setShots((prev) => [...prev, ...newShots]);
|
|
4745
|
+
if (options.onShotsBulkAdded) {
|
|
4746
|
+
await options.onShotsBulkAdded(newShots, data.data[1]);
|
|
4747
|
+
}
|
|
4748
|
+
}
|
|
4749
|
+
} else {
|
|
4750
|
+
setIsSummarizing(false);
|
|
4751
|
+
}
|
|
4752
|
+
} catch (error2) {
|
|
4753
|
+
setIsSummarizing(false);
|
|
4754
|
+
console.error("Error in AI summarization:", error2);
|
|
4755
|
+
}
|
|
4756
|
+
};
|
|
4672
4757
|
return {
|
|
4673
4758
|
blocks,
|
|
4674
4759
|
isLoading,
|
|
@@ -4682,6 +4767,8 @@ function useShotBreakdownScene(options) {
|
|
|
4682
4767
|
addShot,
|
|
4683
4768
|
updateShot,
|
|
4684
4769
|
clearSelection,
|
|
4770
|
+
handleAISummarize,
|
|
4771
|
+
isSummarizing,
|
|
4685
4772
|
menuRef
|
|
4686
4773
|
};
|
|
4687
4774
|
}
|