@vishu1301/script-writing 0.5.4 → 1.0.1

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.js CHANGED
@@ -306,8 +306,10 @@ function ScreenplayEditorView({
306
306
  handleSceneNumberChange
307
307
  }) {
308
308
  const [isRulesOpen, setIsRulesOpen] = useState(false);
309
+ const screenplayFont = "'Courier Prime', Courier, monospace";
309
310
  useEffect(() => {
310
311
  const fontId = "google-font-courier-prime";
312
+ const styleId = "screenplay-editor-force-font";
311
313
  if (!document.getElementById(fontId)) {
312
314
  const link = document.createElement("link");
313
315
  link.id = fontId;
@@ -315,7 +317,19 @@ function ScreenplayEditorView({
315
317
  link.href = "https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap";
316
318
  document.head.appendChild(link);
317
319
  }
318
- }, []);
320
+ if (!document.getElementById(styleId)) {
321
+ const style = document.createElement("style");
322
+ style.id = styleId;
323
+ style.textContent = `
324
+ .font-screenplay-container,
325
+ .font-screenplay-container *,
326
+ .font-screenplay-container [contenteditable] {
327
+ font-family: ${screenplayFont} !important;
328
+ }
329
+ `;
330
+ document.head.appendChild(style);
331
+ }
332
+ }, [screenplayFont]);
319
333
  return /* @__PURE__ */ jsxs(Fragment, { children: [
320
334
  /* @__PURE__ */ jsx("div", { className: "sticky top-6 z-50 bg-white backdrop-blur-xl border border-white/10 rounded-full shadow-2xl flex gap-1 max-w-fit p-1.5 mb-12 select-none overflow-x-auto custom-scrollbar", children: blockTypes.map((type) => {
321
335
  var _a;
@@ -358,14 +372,14 @@ function ScreenplayEditorView({
358
372
  /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-12 w-full items-center pb-24", children: /* @__PURE__ */ jsx(
359
373
  "div",
360
374
  {
361
- className: "relative bg-[#fdfdfc] shadow-2xl 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-[297mm] shrink-0 font-screenplay!",
375
+ className: "relative bg-[#fdfdfc] shadow-2xl 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-[297mm] shrink-0 font-screenplay-container",
362
376
  style: {
363
- // fontFamily:
364
- // "var(--font-courier-prime, 'Courier Prime', 'Courier New', Courier, monospace) !important",
377
+ fontFamily: screenplayFont,
365
378
  paddingLeft: "1.5in",
366
379
  paddingRight: "1in",
367
380
  paddingTop: "1in",
368
- paddingBottom: "1in"
381
+ paddingBottom: "1in",
382
+ lineHeight: "1.2"
369
383
  },
370
384
  children: blocks.map((block) => {
371
385
  var _a, _b;