@vishu1301/script-writing 1.5.4 โ 1.5.7
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/README.md +100 -41
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,61 +1,120 @@
|
|
|
1
|
-
# Script Writing & Breakdown Library
|
|
1
|
+
# ๐ฌ Script Writing & Breakdown Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A high-performance, industry-standard documentation for `@vishu1301/script-writing`. This library is designed to bridge the gap between creative writing and technical pre-production.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## ๐ Scope & Objective
|
|
8
8
|
|
|
9
|
-
The
|
|
9
|
+
The **Script Writing & Breakdown Library** is an all-in-one suite for filmmakers, screenwriters, and production teams. It transforms the traditionally fragmented process of writing, breaking down, and shot-listing into a unified digital workflow.
|
|
10
10
|
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- **Keyboard Shortcuts:** Fluid writing experience utilizing familiar keyboard shortcuts (e.g., `Ctrl + โ/โ` to change block types, `Enter` for smart block transitions).
|
|
17
|
-
- **Core Exports:** `useScreenplayEditor` (Hook), `ScreenplayEditorView` (Component).
|
|
11
|
+
### Problems It Solves:
|
|
12
|
+
1. **Formatting Friction**: Screenwriters often waste 30% of their time on margins and indentation. This library automates industry-standard formatting.
|
|
13
|
+
2. **Disconnected Workflows**: Breakdown sheets and shot lists are usually separate documents. Here, they are dynamically linked to the live screenplay.
|
|
14
|
+
3. **Multilingual Barriers**: Native storytelling in Indic languages (Hindi, Gujarati) is often hard due to lack of specialized editors. Our phonetic engine solves this.
|
|
15
|
+
4. **Data Silos**: Pre-production data (Cast, Props, VFX) is extracted directly from the text, ensuring nothing is missed.
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
Analyze and tag script elements to prepare for scheduling and production.
|
|
21
|
-
- **Interactive Scene Viewer:** View parsed scripts in breakdown mode where text is immutable but fully interactive.
|
|
22
|
-
- **Element Tagging:** Select blocks of text to tag them as Cast, Props, Wardrobe, VFX, Vehicles, Extras, etc.
|
|
23
|
-
- **Color-Coded Analysis:** Industry-standard color-coded highlighting applied automatically as elements are tagged.
|
|
24
|
-
- **Core Exports:** `useScriptBreakdownScene` (Hook), `ScriptBreakdownSceneView` (Component).
|
|
17
|
+
---
|
|
25
18
|
|
|
26
|
-
|
|
27
|
-
Visually plan camera work, cinematography, and storyboarding shot-by-shot linked directly to the screenplay text.
|
|
28
|
-
- **Multi-Camera Management:** Initialize your digital production with multiple cameras and easily swap between them when assigning shots.
|
|
29
|
-
- **Extensive Shot Configuration:** Detailed properties for each shot covering Core Identification, Optics & Mechanics (Lens, Movement, Support, Aperture), Visual Composition (Framing, Depth of Field), and Narrative Context (Lighting, Sound, VFX, Emotional Purpose).
|
|
30
|
-
- **Text-to-Shot Mapping:** Highlight specific script sections on the editor space to directly bind them to newly created shots, dynamically overlaying shot durations on the script.
|
|
31
|
-
- **Core Exports:** `useShotBreakdownScene` (Hook), `ShotBreakdownSceneView` (Component).
|
|
19
|
+
## ๐ How It Works: The Technical Perspective
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
Built with **React** and **Next.js**, the library follows a "Headless Logic, Styled View" architecture.
|
|
34
22
|
|
|
35
|
-
|
|
23
|
+
### 1. The Architecture
|
|
24
|
+
- **State Management**: Heavy lifting is done via custom hooks (`useScreenplayEditor`, `useScriptBreakdown`). These manage the nested JSON tree representing the screenplay.
|
|
25
|
+
- **Deterministic Finite State Machine (DFSM)**: The `MultilingualInputService` uses a DFSM to handle complex phonetic sequences (e.g., typing `k + h` results in `เค`) in real-time without lag.
|
|
26
|
+
- **Virtual DOM Interaction**: Uses data-attributes and CSS-in-JS to enforce "Courier Prime" typography while maintaining a content-editable environment.
|
|
36
27
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
### 2. Core Technical Stack
|
|
29
|
+
- **Parsing**: Advanced regex and sequence analysis for automatic block type detection.
|
|
30
|
+
- **PDF Engine**:
|
|
31
|
+
- **Import**: Uses `pdfjs-dist` to reverse-engineer standard PDF layouts back into editable JSON blocks.
|
|
32
|
+
- **Export**: Combines `html2canvas-pro` for high-fidelity rendering and `jsPDF` for multi-page document generation.
|
|
33
|
+
- **Data Binding**: Shots are linked to script fragments via unique ID mapping, allowing "Text-to-Shot" overlays.
|
|
34
|
+
|
|
35
|
+
### 3. The DFSM Architectural Edge
|
|
36
|
+
At the heart of the multilingual engine is a **Deterministic Finite State Machine (DFSM)**. Traditionally, handling complex Indic scripts (like Hindi or Gujarati) in a web editor leads to "State Hell" due to overlapping keystrokes.
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
**How DFSM solves the architecture:**
|
|
39
|
+
- **State Isolation**: Every keystroke (e.g., typing 'k' then 'h') is a transition between predefined states. This prevents unexpected character garbling.
|
|
40
|
+
- **Look-back Logic**: The machine remembers the `prevChar` and current `state`, allowing it to transform `k + h` into `เค` or `เช + h` into `เช` with 100% predictability.
|
|
41
|
+
- **Zero Latency**: By mapping transitions in a flat configuration, we achieve $O(1)$ transformation speed, ensuring the editor feels as snappy as a native OS keyboard.
|
|
42
|
+
- **Headless Linguistic Layer**: The logic is entirely decoupled from the React lifecycle, allowing the engine to be tested in isolation and reused across different UI components.
|
|
43
43
|
|
|
44
|
-
###
|
|
44
|
+
### 4. Implementation Examples
|
|
45
|
+
|
|
46
|
+
#### Screenplay Editor
|
|
45
47
|
```tsx
|
|
46
48
|
import { ScreenplayEditorView, useScreenplayEditor } from "@vishu1301/script-writing";
|
|
47
49
|
|
|
48
|
-
export default function
|
|
49
|
-
const
|
|
50
|
+
export default function Page() {
|
|
51
|
+
const editor = useScreenplayEditor({
|
|
52
|
+
onSave: (data) => console.log("Script JSON:", data)
|
|
53
|
+
});
|
|
50
54
|
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
return <ScreenplayEditorView {...editor} />;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### Script Breakdown
|
|
60
|
+
```tsx
|
|
61
|
+
import { ScriptBreakdownSceneView, useScriptBreakdownScene } from "@vishu1301/script-writing";
|
|
62
|
+
|
|
63
|
+
export default function Page() {
|
|
64
|
+
const breakdown = useScriptBreakdownScene({ scene_url: "scene_1.sbx" });
|
|
65
|
+
return <ScriptBreakdownSceneView {...breakdown} />;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
#### Shot Breakdown
|
|
70
|
+
```tsx
|
|
71
|
+
import { ShotBreakdownView, useShotBreakdownScene } from "@vishu1301/script-writing";
|
|
72
|
+
|
|
73
|
+
export default function Page() {
|
|
74
|
+
const shots = useShotBreakdownScene({
|
|
75
|
+
scene_url: "scene_1.sbx",
|
|
76
|
+
preloadedCameras: [{ name: "A-Cam" }]
|
|
77
|
+
});
|
|
78
|
+
return <ShotBreakdownView {...shots} />;
|
|
56
79
|
}
|
|
57
80
|
```
|
|
58
81
|
|
|
59
|
-
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## ๐จ How It Works: The Non-Technical Perspective
|
|
85
|
+
|
|
86
|
+
If you can use Google Docs, you can write a feature film here.
|
|
87
|
+
|
|
88
|
+
### 1. For Screenwriters (The Flow)
|
|
89
|
+
- **Tab & Enter System**: Press **Enter** to move to the next logical block (e.g., Character โ Dialogue). Press **Tab** to cycle through formatting types (e.g., Action โ Character).
|
|
90
|
+
- **Auto-Complete**: The system remembers your characters and locations. Type "J" and it suggests "JACK" and "JACK'S APARTMENT".
|
|
91
|
+
- **Phonetic Typing**: Type in English (hinglish/gujlish) and watch it turn into beautiful Hindi or Gujarati script instantly.
|
|
92
|
+
|
|
93
|
+
### 2. For Directors & DPs (Shot Breakdown)
|
|
94
|
+
- **Visual Mapping**: Highlight a sentence in the script and click "Add Shot". That sentence is now linked to a camera setup.
|
|
95
|
+
- **Lens & Movement**: Add technical details like "50mm Prime", "Dolly In", or "Low Angle" in a structured sidebar that populates your shot list automatically.
|
|
96
|
+
|
|
97
|
+
### 3. For ADs & Producers (Script Breakdown)
|
|
98
|
+
- **Color Tagging**: Highlight "Red Dress" and tag it as **Wardrobe**. It instantly highlights in the standard production color (Purple) and adds it to your scene's breakdown sheet.
|
|
99
|
+
- **Scene Analysis**: The system automatically counts scenes, pages, and locations, giving you a bird's-eye view of your production complexity.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## ๐ Key Modules
|
|
104
|
+
|
|
105
|
+
| Module | Purpose | Key Feature |
|
|
106
|
+
| :--- | :--- | :--- |
|
|
107
|
+
| **Screenplay Editor** | Writing & Formatting | Smart Auto-Suggestions & PDF Import |
|
|
108
|
+
| **Script Breakdown** | Tagging & Logistics | Interactive Element Highlighting |
|
|
109
|
+
| **Shot Breakdown** | Cinematography | Text-to-Shot Dynamic Mapping |
|
|
110
|
+
| **Multilingual Engine**| Native Storytelling | Professional Phonetic Transliteration |
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## ๐ฅ Installation
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
npm install @vishu1301/script-writing
|
|
118
|
+
```
|
|
60
119
|
|
|
61
|
-
|
|
120
|
+
*Designed with โค๏ธ for the next generation of storytellers.*
|