@bendyline/squisq-editor-react 2.3.4 → 2.4.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.
@@ -0,0 +1,62 @@
1
+ // src/monacoLanguageDetection.ts
2
+ var LANGUAGE_ALIASES = {
3
+ bash: "shell",
4
+ c: "cpp",
5
+ "c++": "cpp",
6
+ "c#": "csharp",
7
+ cs: "csharp",
8
+ cxx: "cpp",
9
+ docker: "dockerfile",
10
+ htm: "html",
11
+ js: "javascript",
12
+ jsx: "javascript",
13
+ md: "markdown",
14
+ mdown: "markdown",
15
+ py: "python",
16
+ rb: "ruby",
17
+ sh: "shell",
18
+ text: "plaintext",
19
+ txt: "plaintext",
20
+ ts: "typescript",
21
+ tsx: "typescript",
22
+ yml: "yaml",
23
+ zsh: "shell"
24
+ };
25
+ function normalizeMonacoLanguage(language) {
26
+ const normalized = language.trim().toLowerCase();
27
+ return LANGUAGE_ALIASES[normalized] ?? normalized;
28
+ }
29
+ function normalizedMonacoLanguageRequests(requested) {
30
+ const values = typeof requested === "string" ? [requested] : requested ?? [];
31
+ return [...new Set(values.map(normalizeMonacoLanguage).filter(Boolean))].sort();
32
+ }
33
+ function monacoLanguageRequestKey(requested, options = {}) {
34
+ return `${options.languageServices ? "services" : "syntax"}:${normalizedMonacoLanguageRequests(requested).join(",")}`;
35
+ }
36
+ function monacoLanguagesForDocument(primaryLanguage, source) {
37
+ const primary = normalizeMonacoLanguage(primaryLanguage);
38
+ const requested = new Set(primary ? [primary] : []);
39
+ if (primary !== "markdown") return [...requested];
40
+ let openFence = null;
41
+ for (const line of source.split(/\r?\n/)) {
42
+ const match = line.match(/^ {0,3}(`{3,}|~{3,})[ \t]*([^\s`~]+)?/);
43
+ if (!match) continue;
44
+ const fence = match[1];
45
+ const marker = fence[0];
46
+ if (openFence) {
47
+ if (marker === openFence.marker && fence.length >= openFence.length) openFence = null;
48
+ continue;
49
+ }
50
+ openFence = { marker, length: fence.length };
51
+ const language = match[2];
52
+ if (language) requested.add(normalizeMonacoLanguage(language));
53
+ }
54
+ return [...requested];
55
+ }
56
+
57
+ export {
58
+ normalizeMonacoLanguage,
59
+ normalizedMonacoLanguageRequests,
60
+ monacoLanguageRequestKey,
61
+ monacoLanguagesForDocument
62
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ NarrationStage,
3
+ useNarrationStage
4
+ } from "./chunk-PDCKJCOS.js";
5
+
6
+ // src/teleprompter/TeleprompterView.tsx
7
+ import { jsx } from "react/jsx-runtime";
8
+ function TeleprompterView(props) {
9
+ const { doc, theme, presentationTarget = null, recording = null } = props;
10
+ const stage = useNarrationStage({ doc, recording });
11
+ return /* @__PURE__ */ jsx(NarrationStage, { stage, theme, presentationTarget });
12
+ }
13
+
14
+ export {
15
+ TeleprompterView
16
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  markdownToTiptap,
3
3
  tiptapToMarkdown
4
- } from "./chunk-NITZVAXL.js";
4
+ } from "./chunk-WLJ623UZ.js";
5
5
 
6
6
  // src/jsonEditor/JsonEditorContext.tsx
7
7
  import { createContext, useContext, useEffect, useMemo } from "react";
@@ -723,11 +723,35 @@ function serializeMediaTag(tag, attrs) {
723
723
  const width = /\bwidth="([^"]*)"/i.exec(attrs)?.[1];
724
724
  const height = /\bheight="([^"]*)"/i.exec(attrs)?.[1];
725
725
  const poster = tag === "video" ? /\bposter="([^"]*)"/i.exec(attrs)?.[1] : void 0;
726
+ const placement = tag === "video" ? /\bdata-squisq-video-placement="([^"]*)"/i.exec(attrs)?.[1] : void 0;
727
+ const lockToBlock = tag === "video" ? /\bdata-squisq-video-lock-to-block="([^"]*)"/i.exec(attrs)?.[1] : void 0;
728
+ const pipSize = tag === "video" ? /\bdata-squisq-video-pip-size="([^"]*)"/i.exec(attrs)?.[1] : void 0;
729
+ const pipShape = tag === "video" ? /\bdata-squisq-video-pip-shape="([^"]*)"/i.exec(attrs)?.[1] : void 0;
730
+ const pipPosition = tag === "video" ? /\bdata-squisq-video-pip-position="([^"]*)"/i.exec(attrs)?.[1] : void 0;
731
+ const startAt = tag === "video" ? /\bdata-squisq-video-start-at="([^"]*)"/i.exec(attrs)?.[1] : void 0;
732
+ const clipStart = tag === "video" ? /\bdata-squisq-video-clip-start="([^"]*)"/i.exec(attrs)?.[1] : void 0;
733
+ const clipEnd = tag === "video" ? /\bdata-squisq-video-clip-end="([^"]*)"/i.exec(attrs)?.[1] : void 0;
726
734
  const parts = [`<${tag} src="${src}"`];
727
735
  if (controls) parts.push(" controls");
728
736
  if (width) parts.push(` width="${width}"`);
729
737
  if (height) parts.push(` height="${height}"`);
730
738
  if (poster) parts.push(` poster="${poster}"`);
739
+ if (placement === "picture-in-picture" || placement === "overlay") {
740
+ parts.push(` data-squisq-video-placement="${placement}"`);
741
+ }
742
+ if (lockToBlock === "false") parts.push(' data-squisq-video-lock-to-block="false"');
743
+ if (pipSize === "small" || pipSize === "large") {
744
+ parts.push(` data-squisq-video-pip-size="${pipSize}"`);
745
+ }
746
+ if (pipShape === "square" || pipShape === "wide") {
747
+ parts.push(` data-squisq-video-pip-shape="${pipShape}"`);
748
+ }
749
+ if (pipPosition === "top-left" || pipPosition === "top-right" || pipPosition === "bottom-left" || pipPosition === "bottom-right") {
750
+ parts.push(` data-squisq-video-pip-position="${pipPosition}"`);
751
+ }
752
+ if (startAt != null) parts.push(` data-squisq-video-start-at="${startAt}"`);
753
+ if (clipStart != null) parts.push(` data-squisq-video-clip-start="${clipStart}"`);
754
+ if (clipEnd != null) parts.push(` data-squisq-video-clip-end="${clipEnd}"`);
731
755
  parts.push(`></${tag}>`);
732
756
  return parts.join("");
733
757
  }