@vishu1301/script-writing 1.0.4 → 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.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React, { KeyboardEvent } from 'react';
2
+ import * as React$1 from 'react';
3
+ import React__default, { KeyboardEvent } from 'react';
3
4
 
4
5
  type BlockType = "SCENE_HEADING" | "ACTION" | "CHARACTER" | "PARENTHETICAL" | "DIALOGUE" | "TRANSITION";
5
6
  type TimeOfDay = "DAY" | "NIGHT";
@@ -14,20 +15,21 @@ interface Block {
14
15
  }
15
16
  declare const blockTypes: BlockType[];
16
17
  declare const uuid: () => string;
17
- declare const icons: Record<BlockType, React.ReactNode>;
18
+ declare const icons: Record<BlockType, React__default.ReactNode>;
18
19
  declare const blockStyles: Record<BlockType, {
19
20
  label: string;
20
21
  className: string;
21
- inputStyle: React.CSSProperties;
22
+ inputStyle: React__default.CSSProperties;
22
23
  }>;
23
24
 
24
25
  interface UseScreenplayEditorOptions {
25
26
  initialUrl?: string;
26
27
  fetchOptions?: RequestInit;
28
+ onSave?: (content?: string) => void;
27
29
  }
28
30
  declare function useScreenplayEditor(options?: UseScreenplayEditorOptions): {
29
31
  blocks: Block[];
30
- refs: React.RefObject<Record<string, HTMLDivElement | null>>;
32
+ refs: React__default.RefObject<Record<string, HTMLDivElement | null>>;
31
33
  focusedBlockId: string;
32
34
  showSuggestions: boolean;
33
35
  showExtensionSuggestions: boolean;
@@ -57,7 +59,84 @@ type ScreenplayEditorViewProps = ReturnType<typeof useScreenplayEditor> & {
57
59
  };
58
60
  declare function ScreenplayEditorView({ blocks, refs, focusedBlockId, showSuggestions, showExtensionSuggestions, characterExtensions, locations, characters, handleBlockTextChange, handleSceneTypeChange, handleTimeOfDayChange, handleBlockTypeChange, handleSelectCharacterExtension, handleKeyDown, handleFocus, handleBlur, handleScriptImport, onSave, onSaveAsPdf, onSaveAsSbx, onSyncWithCloud, handleSceneNumberChange, }: ScreenplayEditorViewProps): react_jsx_runtime.JSX.Element;
59
61
 
60
- declare const handleSaveAsPdf: (blocks: Block[], sceneNumbers: Record<string, string>) => void;
61
- declare const handleSaveAsSbx: (blocks: Block[], sceneNumbers: Record<string, string>, onSaveAsSbx?: (file: File) => void) => void;
62
+ declare const handleSaveAsPdf: (blocks: Block[], sceneNumbers: Record<string, string>, project_name?: string) => void;
63
+ declare const convertBlocksToSbx: (blocks: Block[], sceneNumbers: Record<string, string>) => string;
64
+ declare const handleSaveAsSbx: (blocks: Block[], sceneNumbers: Record<string, string>, onSaveAsSbx?: (file: File) => void, project_name?: string) => void;
65
+ declare const handleSyncWithCloud: (blocks: Block[], sceneNumbers: Record<string, string>, onSyncWithCloud?: (sbxData: string) => void) => void;
62
66
 
63
- export { type Block, type BlockType, ScreenplayEditorView, type TimeOfDay, blockStyles, blockTypes, handleSaveAsPdf, handleSaveAsSbx, icons, timeOfDayOptions, useScreenplayEditor, uuid };
67
+ interface ScriptBreakdown {
68
+ scene_number: string;
69
+ content: string;
70
+ }
71
+ type ElementCategory = "CAST" | "PROP" | "COSTUME" | "VEHICLE" | "SET_PROP" | "EXTRA" | "LOCATION";
72
+ interface Tag {
73
+ id: string;
74
+ blockId: string;
75
+ categoryId: ElementCategory;
76
+ text: string;
77
+ startIndex: number;
78
+ endIndex: number;
79
+ }
80
+ declare const CATEGORIES: {
81
+ id: ElementCategory;
82
+ label: string;
83
+ color: string;
84
+ hex: string;
85
+ }[];
86
+
87
+ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, sceneNumber, tags, selectionMenu, handleMouseUp, addTag, removeTag, clearSelection, menuPlacement, menuRef, subLocations, addSubLocation, removeSubLocation, sceneBrief, setSceneBrief, }: {
88
+ blocks: Block[];
89
+ characters: string[];
90
+ isLoading: boolean;
91
+ sceneNumber: string;
92
+ tags: Tag[];
93
+ selectionMenu: {
94
+ blockId: string;
95
+ startIndex: number;
96
+ endIndex: number;
97
+ text: string;
98
+ top: number;
99
+ left: number;
100
+ } | null;
101
+ handleMouseUp: () => void;
102
+ addTag: (c: ElementCategory) => void;
103
+ removeTag: (e: React__default.MouseEvent, id: string) => void;
104
+ clearSelection: () => void;
105
+ menuPlacement: "top" | "bottom";
106
+ menuRef: React__default.RefObject<HTMLDivElement | null>;
107
+ subLocations: string[];
108
+ addSubLocation: (loc: string) => void;
109
+ removeSubLocation: (loc: string) => void;
110
+ sceneBrief: string;
111
+ setSceneBrief: (brief: string) => void;
112
+ }): react_jsx_runtime.JSX.Element;
113
+
114
+ declare function useScriptBreakdownScene(sceneNumber: string): {
115
+ scene: ScriptBreakdown | undefined;
116
+ blocks: Block[];
117
+ characters: string[];
118
+ isLoading: boolean;
119
+ error: Error | null;
120
+ tags: Tag[];
121
+ selectionMenu: {
122
+ blockId: string;
123
+ startIndex: number;
124
+ endIndex: number;
125
+ text: string;
126
+ top: number;
127
+ left: number;
128
+ } | null;
129
+ handleMouseUp: () => void;
130
+ addTag: (categoryId: ElementCategory) => void;
131
+ removeTag: (e: React.MouseEvent, id: string) => void;
132
+ clearSelection: () => void;
133
+ menuPlacement: "top" | "bottom";
134
+ menuRef: React$1.RefObject<HTMLDivElement | null>;
135
+ subLocations: string[];
136
+ addSubLocation: (subLocation: string) => void;
137
+ removeSubLocation: (subLocation: string) => void;
138
+ sceneBrief: string;
139
+ setSceneBrief: React$1.Dispatch<React$1.SetStateAction<string>>;
140
+ };
141
+
142
+ export { type Block, type BlockType, CATEGORIES, type ElementCategory, ScreenplayEditorView, type ScriptBreakdown, ScriptBreakdownSceneView, type Tag, type TimeOfDay, blockStyles, blockTypes, convertBlocksToSbx, handleSaveAsPdf, handleSaveAsSbx, handleSyncWithCloud, icons, timeOfDayOptions, useScreenplayEditor, useScriptBreakdownScene, uuid };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React, { KeyboardEvent } from 'react';
2
+ import * as React$1 from 'react';
3
+ import React__default, { KeyboardEvent } from 'react';
3
4
 
4
5
  type BlockType = "SCENE_HEADING" | "ACTION" | "CHARACTER" | "PARENTHETICAL" | "DIALOGUE" | "TRANSITION";
5
6
  type TimeOfDay = "DAY" | "NIGHT";
@@ -14,20 +15,21 @@ interface Block {
14
15
  }
15
16
  declare const blockTypes: BlockType[];
16
17
  declare const uuid: () => string;
17
- declare const icons: Record<BlockType, React.ReactNode>;
18
+ declare const icons: Record<BlockType, React__default.ReactNode>;
18
19
  declare const blockStyles: Record<BlockType, {
19
20
  label: string;
20
21
  className: string;
21
- inputStyle: React.CSSProperties;
22
+ inputStyle: React__default.CSSProperties;
22
23
  }>;
23
24
 
24
25
  interface UseScreenplayEditorOptions {
25
26
  initialUrl?: string;
26
27
  fetchOptions?: RequestInit;
28
+ onSave?: (content?: string) => void;
27
29
  }
28
30
  declare function useScreenplayEditor(options?: UseScreenplayEditorOptions): {
29
31
  blocks: Block[];
30
- refs: React.RefObject<Record<string, HTMLDivElement | null>>;
32
+ refs: React__default.RefObject<Record<string, HTMLDivElement | null>>;
31
33
  focusedBlockId: string;
32
34
  showSuggestions: boolean;
33
35
  showExtensionSuggestions: boolean;
@@ -57,7 +59,84 @@ type ScreenplayEditorViewProps = ReturnType<typeof useScreenplayEditor> & {
57
59
  };
58
60
  declare function ScreenplayEditorView({ blocks, refs, focusedBlockId, showSuggestions, showExtensionSuggestions, characterExtensions, locations, characters, handleBlockTextChange, handleSceneTypeChange, handleTimeOfDayChange, handleBlockTypeChange, handleSelectCharacterExtension, handleKeyDown, handleFocus, handleBlur, handleScriptImport, onSave, onSaveAsPdf, onSaveAsSbx, onSyncWithCloud, handleSceneNumberChange, }: ScreenplayEditorViewProps): react_jsx_runtime.JSX.Element;
59
61
 
60
- declare const handleSaveAsPdf: (blocks: Block[], sceneNumbers: Record<string, string>) => void;
61
- declare const handleSaveAsSbx: (blocks: Block[], sceneNumbers: Record<string, string>, onSaveAsSbx?: (file: File) => void) => void;
62
+ declare const handleSaveAsPdf: (blocks: Block[], sceneNumbers: Record<string, string>, project_name?: string) => void;
63
+ declare const convertBlocksToSbx: (blocks: Block[], sceneNumbers: Record<string, string>) => string;
64
+ declare const handleSaveAsSbx: (blocks: Block[], sceneNumbers: Record<string, string>, onSaveAsSbx?: (file: File) => void, project_name?: string) => void;
65
+ declare const handleSyncWithCloud: (blocks: Block[], sceneNumbers: Record<string, string>, onSyncWithCloud?: (sbxData: string) => void) => void;
62
66
 
63
- export { type Block, type BlockType, ScreenplayEditorView, type TimeOfDay, blockStyles, blockTypes, handleSaveAsPdf, handleSaveAsSbx, icons, timeOfDayOptions, useScreenplayEditor, uuid };
67
+ interface ScriptBreakdown {
68
+ scene_number: string;
69
+ content: string;
70
+ }
71
+ type ElementCategory = "CAST" | "PROP" | "COSTUME" | "VEHICLE" | "SET_PROP" | "EXTRA" | "LOCATION";
72
+ interface Tag {
73
+ id: string;
74
+ blockId: string;
75
+ categoryId: ElementCategory;
76
+ text: string;
77
+ startIndex: number;
78
+ endIndex: number;
79
+ }
80
+ declare const CATEGORIES: {
81
+ id: ElementCategory;
82
+ label: string;
83
+ color: string;
84
+ hex: string;
85
+ }[];
86
+
87
+ declare function ScriptBreakdownSceneView({ blocks, characters, isLoading, sceneNumber, tags, selectionMenu, handleMouseUp, addTag, removeTag, clearSelection, menuPlacement, menuRef, subLocations, addSubLocation, removeSubLocation, sceneBrief, setSceneBrief, }: {
88
+ blocks: Block[];
89
+ characters: string[];
90
+ isLoading: boolean;
91
+ sceneNumber: string;
92
+ tags: Tag[];
93
+ selectionMenu: {
94
+ blockId: string;
95
+ startIndex: number;
96
+ endIndex: number;
97
+ text: string;
98
+ top: number;
99
+ left: number;
100
+ } | null;
101
+ handleMouseUp: () => void;
102
+ addTag: (c: ElementCategory) => void;
103
+ removeTag: (e: React__default.MouseEvent, id: string) => void;
104
+ clearSelection: () => void;
105
+ menuPlacement: "top" | "bottom";
106
+ menuRef: React__default.RefObject<HTMLDivElement | null>;
107
+ subLocations: string[];
108
+ addSubLocation: (loc: string) => void;
109
+ removeSubLocation: (loc: string) => void;
110
+ sceneBrief: string;
111
+ setSceneBrief: (brief: string) => void;
112
+ }): react_jsx_runtime.JSX.Element;
113
+
114
+ declare function useScriptBreakdownScene(sceneNumber: string): {
115
+ scene: ScriptBreakdown | undefined;
116
+ blocks: Block[];
117
+ characters: string[];
118
+ isLoading: boolean;
119
+ error: Error | null;
120
+ tags: Tag[];
121
+ selectionMenu: {
122
+ blockId: string;
123
+ startIndex: number;
124
+ endIndex: number;
125
+ text: string;
126
+ top: number;
127
+ left: number;
128
+ } | null;
129
+ handleMouseUp: () => void;
130
+ addTag: (categoryId: ElementCategory) => void;
131
+ removeTag: (e: React.MouseEvent, id: string) => void;
132
+ clearSelection: () => void;
133
+ menuPlacement: "top" | "bottom";
134
+ menuRef: React$1.RefObject<HTMLDivElement | null>;
135
+ subLocations: string[];
136
+ addSubLocation: (subLocation: string) => void;
137
+ removeSubLocation: (subLocation: string) => void;
138
+ sceneBrief: string;
139
+ setSceneBrief: React$1.Dispatch<React$1.SetStateAction<string>>;
140
+ };
141
+
142
+ export { type Block, type BlockType, CATEGORIES, type ElementCategory, ScreenplayEditorView, type ScriptBreakdown, ScriptBreakdownSceneView, type Tag, type TimeOfDay, blockStyles, blockTypes, convertBlocksToSbx, handleSaveAsPdf, handleSaveAsSbx, handleSyncWithCloud, icons, timeOfDayOptions, useScreenplayEditor, useScriptBreakdownScene, uuid };