@vishu1301/script-writing 1.0.2 → 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;
@@ -345,19 +345,19 @@ function ScreenplayEditorView({
345
345
  if (!document.getElementById(styleId)) {
346
346
  const style = document.createElement("style");
347
347
  style.id = styleId;
348
- style.textContent = style.textContent = `
349
- [data-screenplay-editor],
350
- [data-screenplay-editor] *,
351
- [data-screenplay-editor] [contenteditable="true"],
352
- .font-screenplay-container,
353
- .font-screenplay-container div,
354
- .font-screenplay-container span {
355
- font-family: 'Courier Prime', Courier, monospace !important;
356
- }
357
- `;
348
+ style.textContent = `
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;
356
+ }
357
+ `;
358
358
  document.head.appendChild(style);
359
359
  }
360
- }, [screenplayFont]);
360
+ }, [COURIER_STACK]);
361
361
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
362
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) => {
363
363
  var _a;
@@ -400,15 +400,16 @@ function ScreenplayEditorView({
400
400
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-12 w-full items-center pb-24", children: /* @__PURE__ */ jsxRuntime.jsx(
401
401
  "div",
402
402
  {
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 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",
404
404
  style: {
405
- fontFamily: screenplayFont,
405
+ fontFamily: COURIER_STACK,
406
406
  paddingLeft: "1.5in",
407
407
  paddingRight: "1in",
408
408
  paddingTop: "1in",
409
409
  paddingBottom: "1in",
410
410
  lineHeight: "1.2"
411
411
  },
412
+ "data-screenplay-editor": "true",
412
413
  children: blocks.map((block) => {
413
414
  var _a, _b;
414
415
  return /* @__PURE__ */ jsxRuntime.jsx(