@vishu1301/script-writing 1.0.1 → 1.0.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 CHANGED
@@ -331,10 +331,10 @@ function ScreenplayEditorView({
331
331
  handleSceneNumberChange
332
332
  }) {
333
333
  const [isRulesOpen, setIsRulesOpen] = react.useState(false);
334
- const screenplayFont = "'Courier Prime', Courier, monospace";
334
+ const COURIER_STACK = "'Courier Prime', 'Courier', monospace";
335
335
  react.useEffect(() => {
336
336
  const fontId = "google-font-courier-prime";
337
- const styleId = "screenplay-editor-force-font";
337
+ const styleId = "screenplay-editor-force-v4";
338
338
  if (!document.getElementById(fontId)) {
339
339
  const link = document.createElement("link");
340
340
  link.id = fontId;
@@ -346,15 +346,18 @@ function ScreenplayEditorView({
346
346
  const style = document.createElement("style");
347
347
  style.id = styleId;
348
348
  style.textContent = `
349
- .font-screenplay-container,
350
- .font-screenplay-container *,
351
- .font-screenplay-container [contenteditable] {
352
- font-family: ${screenplayFont} !important;
349
+ /* We target by the data-attribute to ensure the highest specificity possible */
350
+ [data-screenplay-editor] *,
351
+ [data-screenplay-editor] div,
352
+ [data-screenplay-editor] span,
353
+ [data-screenplay-editor] [contenteditable="true"] {
354
+ font-family: ${COURIER_STACK} !important;
355
+ -webkit-font-smoothing: antialiased;
353
356
  }
354
357
  `;
355
358
  document.head.appendChild(style);
356
359
  }
357
- }, [screenplayFont]);
360
+ }, [COURIER_STACK]);
358
361
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
359
362
  /* @__PURE__ */ jsxRuntime.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) => {
360
363
  var _a;
@@ -397,15 +400,16 @@ function ScreenplayEditorView({
397
400
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-12 w-full items-center pb-24", children: /* @__PURE__ */ jsxRuntime.jsx(
398
401
  "div",
399
402
  {
400
- 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",
403
+ 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",
401
404
  style: {
402
- fontFamily: screenplayFont,
405
+ fontFamily: COURIER_STACK,
403
406
  paddingLeft: "1.5in",
404
407
  paddingRight: "1in",
405
408
  paddingTop: "1in",
406
409
  paddingBottom: "1in",
407
410
  lineHeight: "1.2"
408
411
  },
412
+ "data-screenplay-editor": "true",
409
413
  children: blocks.map((block) => {
410
414
  var _a, _b;
411
415
  return /* @__PURE__ */ jsxRuntime.jsx(