@vishu1301/script-writing 1.5.5 โ†’ 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.
Files changed (2) hide show
  1. package/README.md +100 -41
  2. 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
- An advanced, React and Next.js-based script writing and breakdown analysis library for the web.
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
- This package provides developers with an intuitive suite of tools to draft, edit, and format scripts according to industry standards, alongside powerful script and shot breakdown utilities to highlight, tag, and analyze scene elements for pre-production.
5
+ ---
6
6
 
7
- ## Core Modules
7
+ ## ๐Ÿ“Œ Scope & Objective
8
8
 
9
- The library is divided into three primary modules: **Screenplay Editor**, **Script Breakdown**, and **Shot Breakdown**. Each module exposes headless hooks for robust state management and pre-built React views for rapid UI integration.
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
- ### 1. Screenplay Editor
12
- Draft, edit, and format screenplays with an intuitive WYSIWYG editor.
13
- - **Industry-Standard Formatting:** Automatically formats text to screenplay guidelines, dynamically handling Scene Headings, Action, Character, Parenthetical, Dialogue, and Transitions.
14
- - **Smart Auto-Suggestions:** Intelligently suggests previously used Characters, Locations, and Character Extensions (like V.O., O.S.) as you type.
15
- - **PDF Import & Export:** Built-in utilities to import existing scripts from PDFs (`pdfjs-dist`) and export drafts into beautifully formatted screenplay PDFs (`html2canvas-pro` & `jsPDF`).
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
- ### 2. Script Breakdown
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
- ### 3. Shot Breakdown
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
- ## Installation
21
+ Built with **React** and **Next.js**, the library follows a "Headless Logic, Styled View" architecture.
34
22
 
35
- Install the package via npm, yarn, or pnpm:
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
- ```bash
38
- npm install @vishu1301/script-writing
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
- ## Quick Start
42
- *Note: The UI views utilize standard Tailwind CSS utility classes and Lucide React icons.*
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
- ### Screenplay Editor Example
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 ScriptApp() {
49
- const editorProps = useScreenplayEditor();
50
+ export default function Page() {
51
+ const editor = useScreenplayEditor({
52
+ onSave: (data) => console.log("Script JSON:", data)
53
+ });
50
54
 
51
- return (
52
- <div className="w-full min-h-screen bg-zinc-50">
53
- <ScreenplayEditorView {...editorProps} />
54
- </div>
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
- ## Developer Notes
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
- This package relies heavily on data attributes and high-specificity style injection to force screenplay fonts (Courier Prime). For customized font integration or headless implementation, utilize the provided hooks to map output block objects into your custom interface.
120
+ *Designed with โค๏ธ for the next generation of storytellers.*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vishu1301/script-writing",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "types": "dist/index.d.ts",