@almadar/ui 5.122.11 → 5.122.12

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.
@@ -16680,6 +16680,19 @@ var init_EmptyState = __esm({
16680
16680
  EmptyState.displayName = "EmptyState";
16681
16681
  }
16682
16682
  });
16683
+ function isLanguageRegistered(lang) {
16684
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
16685
+ }
16686
+ async function loadPrismLanguage(lang) {
16687
+ if (isLanguageRegistered(lang)) return;
16688
+ try {
16689
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
16690
+ if (grammar) SyntaxHighlighter__default.default.registerLanguage(lang, grammar);
16691
+ dynamicallyLoaded.add(lang);
16692
+ } catch {
16693
+ dynamicallyLoaded.add(lang);
16694
+ }
16695
+ }
16683
16696
  function computeFoldRegions(code) {
16684
16697
  const lines = code.split("\n");
16685
16698
  const regions = [];
@@ -16715,7 +16728,8 @@ function computeFoldRegions(code) {
16715
16728
  return regions.sort((a, b) => a.start - b.start);
16716
16729
  }
16717
16730
  function toCodeLanguage(value) {
16718
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
16731
+ if (!value) return "text";
16732
+ return value.toLowerCase();
16719
16733
  }
16720
16734
  function generateDiff(oldVal, newVal) {
16721
16735
  const oldLines = oldVal.split("\n");
@@ -16734,7 +16748,24 @@ function generateDiff(oldVal, newVal) {
16734
16748
  }
16735
16749
  return diff;
16736
16750
  }
16737
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16751
+ function useLanguageReady(language) {
16752
+ const [ready, setReady] = React91.useState(() => isLanguageRegistered(language));
16753
+ React91.useEffect(() => {
16754
+ if (isLanguageRegistered(language)) {
16755
+ if (!ready) setReady(true);
16756
+ return;
16757
+ }
16758
+ let active = true;
16759
+ loadPrismLanguage(language).then(() => {
16760
+ if (active) setReady(true);
16761
+ });
16762
+ return () => {
16763
+ active = false;
16764
+ };
16765
+ }, [language]);
16766
+ return ready;
16767
+ }
16768
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16738
16769
  var init_CodeBlock = __esm({
16739
16770
  "components/core/molecules/markdown/CodeBlock.tsx"() {
16740
16771
  init_cn();
@@ -16775,6 +16806,8 @@ var init_CodeBlock = __esm({
16775
16806
  SyntaxHighlighter__default.default.registerLanguage("graphql", langGraphql__default.default);
16776
16807
  SyntaxHighlighter__default.default.registerLanguage("orb", syntax.orbLanguage);
16777
16808
  SyntaxHighlighter__default.default.registerLanguage("lolo", syntax.loloLanguage);
16809
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
16810
+ codeLanguageLoader = null;
16778
16811
  orbStyleOverrides = {
16779
16812
  "orb-binding": { color: syntax.ORB_COLORS.dark.binding, fontWeight: "bold" },
16780
16813
  "orb-effect": { color: syntax.ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -16890,6 +16923,7 @@ var init_CodeBlock = __esm({
16890
16923
  const isOrb = language === "orb";
16891
16924
  const isLolo = language === "lolo";
16892
16925
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
16926
+ const languageReady = useLanguageReady(language);
16893
16927
  const eventBus = useEventBus();
16894
16928
  const { t } = hooks.useTranslate();
16895
16929
  const scrollRef = React91.useRef(null);
@@ -17013,7 +17047,7 @@ var init_CodeBlock = __esm({
17013
17047
  children: code
17014
17048
  }
17015
17049
  ),
17016
- [code, language, activeStyle]
17050
+ [code, language, activeStyle, languageReady]
17017
17051
  );
17018
17052
  React91.useLayoutEffect(() => {
17019
17053
  const container = codeRef.current;
@@ -17613,10 +17647,10 @@ var init_MarkdownContent = __esm({
17613
17647
  }
17614
17648
  });
17615
17649
 
17616
- // components/core/molecules/lessonSegmentUtils.ts
17650
+ // lib/lessonSegmentUtils.ts
17617
17651
  function parseMarkdownWithCodeBlocks(content) {
17618
17652
  const segments = [];
17619
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
17653
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
17620
17654
  let lastIndex = 0;
17621
17655
  let match;
17622
17656
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -17624,12 +17658,12 @@ function parseMarkdownWithCodeBlocks(content) {
17624
17658
  if (before.trim()) {
17625
17659
  segments.push({ type: "markdown", content: before });
17626
17660
  }
17627
- const rawLanguage = match[1] ?? "text";
17628
- const runModifier = !!match[2];
17661
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
17662
+ let rawLanguage = tokens[0] ?? "text";
17629
17663
  const suffixRunnable = rawLanguage.endsWith("-runnable");
17630
- const runnable = runModifier || suffixRunnable;
17664
+ const runnable = suffixRunnable || tokens.includes("run");
17631
17665
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
17632
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
17666
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
17633
17667
  lastIndex = codeBlockRegex.lastIndex;
17634
17668
  }
17635
17669
  const remaining = content.slice(lastIndex);
@@ -17639,7 +17673,7 @@ function parseMarkdownWithCodeBlocks(content) {
17639
17673
  return segments;
17640
17674
  }
17641
17675
  var init_lessonSegmentUtils = __esm({
17642
- "components/core/molecules/lessonSegmentUtils.ts"() {
17676
+ "lib/lessonSegmentUtils.ts"() {
17643
17677
  }
17644
17678
  });
17645
17679
  var BLOOM_CONFIG, BloomQuizBlock;
package/dist/avl/index.js CHANGED
@@ -16634,6 +16634,19 @@ var init_EmptyState = __esm({
16634
16634
  EmptyState.displayName = "EmptyState";
16635
16635
  }
16636
16636
  });
16637
+ function isLanguageRegistered(lang) {
16638
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
16639
+ }
16640
+ async function loadPrismLanguage(lang) {
16641
+ if (isLanguageRegistered(lang)) return;
16642
+ try {
16643
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
16644
+ if (grammar) SyntaxHighlighter.registerLanguage(lang, grammar);
16645
+ dynamicallyLoaded.add(lang);
16646
+ } catch {
16647
+ dynamicallyLoaded.add(lang);
16648
+ }
16649
+ }
16637
16650
  function computeFoldRegions(code) {
16638
16651
  const lines = code.split("\n");
16639
16652
  const regions = [];
@@ -16669,7 +16682,8 @@ function computeFoldRegions(code) {
16669
16682
  return regions.sort((a, b) => a.start - b.start);
16670
16683
  }
16671
16684
  function toCodeLanguage(value) {
16672
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
16685
+ if (!value) return "text";
16686
+ return value.toLowerCase();
16673
16687
  }
16674
16688
  function generateDiff(oldVal, newVal) {
16675
16689
  const oldLines = oldVal.split("\n");
@@ -16688,7 +16702,24 @@ function generateDiff(oldVal, newVal) {
16688
16702
  }
16689
16703
  return diff;
16690
16704
  }
16691
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16705
+ function useLanguageReady(language) {
16706
+ const [ready, setReady] = useState(() => isLanguageRegistered(language));
16707
+ useEffect(() => {
16708
+ if (isLanguageRegistered(language)) {
16709
+ if (!ready) setReady(true);
16710
+ return;
16711
+ }
16712
+ let active = true;
16713
+ loadPrismLanguage(language).then(() => {
16714
+ if (active) setReady(true);
16715
+ });
16716
+ return () => {
16717
+ active = false;
16718
+ };
16719
+ }, [language]);
16720
+ return ready;
16721
+ }
16722
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
16692
16723
  var init_CodeBlock = __esm({
16693
16724
  "components/core/molecules/markdown/CodeBlock.tsx"() {
16694
16725
  init_cn();
@@ -16729,6 +16760,8 @@ var init_CodeBlock = __esm({
16729
16760
  SyntaxHighlighter.registerLanguage("graphql", langGraphql);
16730
16761
  SyntaxHighlighter.registerLanguage("orb", orbLanguage);
16731
16762
  SyntaxHighlighter.registerLanguage("lolo", loloLanguage);
16763
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
16764
+ codeLanguageLoader = null;
16732
16765
  orbStyleOverrides = {
16733
16766
  "orb-binding": { color: ORB_COLORS.dark.binding, fontWeight: "bold" },
16734
16767
  "orb-effect": { color: ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -16844,6 +16877,7 @@ var init_CodeBlock = __esm({
16844
16877
  const isOrb = language === "orb";
16845
16878
  const isLolo = language === "lolo";
16846
16879
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
16880
+ const languageReady = useLanguageReady(language);
16847
16881
  const eventBus = useEventBus();
16848
16882
  const { t } = useTranslate();
16849
16883
  const scrollRef = useRef(null);
@@ -16967,7 +17001,7 @@ var init_CodeBlock = __esm({
16967
17001
  children: code
16968
17002
  }
16969
17003
  ),
16970
- [code, language, activeStyle]
17004
+ [code, language, activeStyle, languageReady]
16971
17005
  );
16972
17006
  useLayoutEffect(() => {
16973
17007
  const container = codeRef.current;
@@ -17567,10 +17601,10 @@ var init_MarkdownContent = __esm({
17567
17601
  }
17568
17602
  });
17569
17603
 
17570
- // components/core/molecules/lessonSegmentUtils.ts
17604
+ // lib/lessonSegmentUtils.ts
17571
17605
  function parseMarkdownWithCodeBlocks(content) {
17572
17606
  const segments = [];
17573
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
17607
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
17574
17608
  let lastIndex = 0;
17575
17609
  let match;
17576
17610
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -17578,12 +17612,12 @@ function parseMarkdownWithCodeBlocks(content) {
17578
17612
  if (before.trim()) {
17579
17613
  segments.push({ type: "markdown", content: before });
17580
17614
  }
17581
- const rawLanguage = match[1] ?? "text";
17582
- const runModifier = !!match[2];
17615
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
17616
+ let rawLanguage = tokens[0] ?? "text";
17583
17617
  const suffixRunnable = rawLanguage.endsWith("-runnable");
17584
- const runnable = runModifier || suffixRunnable;
17618
+ const runnable = suffixRunnable || tokens.includes("run");
17585
17619
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
17586
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
17620
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
17587
17621
  lastIndex = codeBlockRegex.lastIndex;
17588
17622
  }
17589
17623
  const remaining = content.slice(lastIndex);
@@ -17593,7 +17627,7 @@ function parseMarkdownWithCodeBlocks(content) {
17593
17627
  return segments;
17594
17628
  }
17595
17629
  var init_lessonSegmentUtils = __esm({
17596
- "components/core/molecules/lessonSegmentUtils.ts"() {
17630
+ "lib/lessonSegmentUtils.ts"() {
17597
17631
  }
17598
17632
  });
17599
17633
  var BLOOM_CONFIG, BloomQuizBlock;
@@ -10023,6 +10023,22 @@ var init_EmptyState = __esm({
10023
10023
  exports.EmptyState.displayName = "EmptyState";
10024
10024
  }
10025
10025
  });
10026
+ function registerCodeLanguageLoader(loader) {
10027
+ codeLanguageLoader = loader;
10028
+ }
10029
+ function isLanguageRegistered(lang) {
10030
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
10031
+ }
10032
+ async function loadPrismLanguage(lang) {
10033
+ if (isLanguageRegistered(lang)) return;
10034
+ try {
10035
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
10036
+ if (grammar) SyntaxHighlighter__default.default.registerLanguage(lang, grammar);
10037
+ dynamicallyLoaded.add(lang);
10038
+ } catch {
10039
+ dynamicallyLoaded.add(lang);
10040
+ }
10041
+ }
10026
10042
  function computeFoldRegions(code) {
10027
10043
  const lines = code.split("\n");
10028
10044
  const regions = [];
@@ -10058,7 +10074,8 @@ function computeFoldRegions(code) {
10058
10074
  return regions.sort((a, b) => a.start - b.start);
10059
10075
  }
10060
10076
  function toCodeLanguage(value) {
10061
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
10077
+ if (!value) return "text";
10078
+ return value.toLowerCase();
10062
10079
  }
10063
10080
  function generateDiff(oldVal, newVal) {
10064
10081
  const oldLines = oldVal.split("\n");
@@ -10077,7 +10094,24 @@ function generateDiff(oldVal, newVal) {
10077
10094
  }
10078
10095
  return diff;
10079
10096
  }
10080
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
10097
+ function useLanguageReady(language) {
10098
+ const [ready, setReady] = React74.useState(() => isLanguageRegistered(language));
10099
+ React74.useEffect(() => {
10100
+ if (isLanguageRegistered(language)) {
10101
+ if (!ready) setReady(true);
10102
+ return;
10103
+ }
10104
+ let active = true;
10105
+ loadPrismLanguage(language).then(() => {
10106
+ if (active) setReady(true);
10107
+ });
10108
+ return () => {
10109
+ active = false;
10110
+ };
10111
+ }, [language]);
10112
+ return ready;
10113
+ }
10114
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS; exports.CodeBlock = void 0;
10081
10115
  var init_CodeBlock = __esm({
10082
10116
  "components/core/molecules/markdown/CodeBlock.tsx"() {
10083
10117
  init_cn();
@@ -10118,6 +10152,8 @@ var init_CodeBlock = __esm({
10118
10152
  SyntaxHighlighter__default.default.registerLanguage("graphql", langGraphql__default.default);
10119
10153
  SyntaxHighlighter__default.default.registerLanguage("orb", syntax.orbLanguage);
10120
10154
  SyntaxHighlighter__default.default.registerLanguage("lolo", syntax.loloLanguage);
10155
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
10156
+ codeLanguageLoader = null;
10121
10157
  orbStyleOverrides = {
10122
10158
  "orb-binding": { color: syntax.ORB_COLORS.dark.binding, fontWeight: "bold" },
10123
10159
  "orb-effect": { color: syntax.ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -10233,6 +10269,7 @@ var init_CodeBlock = __esm({
10233
10269
  const isOrb = language === "orb";
10234
10270
  const isLolo = language === "lolo";
10235
10271
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
10272
+ const languageReady = useLanguageReady(language);
10236
10273
  const eventBus = useEventBus();
10237
10274
  const { t } = hooks.useTranslate();
10238
10275
  const scrollRef = React74.useRef(null);
@@ -10356,7 +10393,7 @@ var init_CodeBlock = __esm({
10356
10393
  children: code
10357
10394
  }
10358
10395
  ),
10359
- [code, language, activeStyle]
10396
+ [code, language, activeStyle, languageReady]
10360
10397
  );
10361
10398
  React74.useLayoutEffect(() => {
10362
10399
  const container = codeRef.current;
@@ -10956,10 +10993,10 @@ var init_MarkdownContent = __esm({
10956
10993
  }
10957
10994
  });
10958
10995
 
10959
- // components/core/molecules/lessonSegmentUtils.ts
10996
+ // lib/lessonSegmentUtils.ts
10960
10997
  function parseMarkdownWithCodeBlocks(content) {
10961
10998
  const segments = [];
10962
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
10999
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
10963
11000
  let lastIndex = 0;
10964
11001
  let match;
10965
11002
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -10967,12 +11004,12 @@ function parseMarkdownWithCodeBlocks(content) {
10967
11004
  if (before.trim()) {
10968
11005
  segments.push({ type: "markdown", content: before });
10969
11006
  }
10970
- const rawLanguage = match[1] ?? "text";
10971
- const runModifier = !!match[2];
11007
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
11008
+ let rawLanguage = tokens[0] ?? "text";
10972
11009
  const suffixRunnable = rawLanguage.endsWith("-runnable");
10973
- const runnable = runModifier || suffixRunnable;
11010
+ const runnable = suffixRunnable || tokens.includes("run");
10974
11011
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
10975
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
11012
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
10976
11013
  lastIndex = codeBlockRegex.lastIndex;
10977
11014
  }
10978
11015
  const remaining = content.slice(lastIndex);
@@ -10982,7 +11019,7 @@ function parseMarkdownWithCodeBlocks(content) {
10982
11019
  return segments;
10983
11020
  }
10984
11021
  var init_lessonSegmentUtils = __esm({
10985
- "components/core/molecules/lessonSegmentUtils.ts"() {
11022
+ "lib/lessonSegmentUtils.ts"() {
10986
11023
  }
10987
11024
  });
10988
11025
  var BLOOM_CONFIG; exports.BloomQuizBlock = void 0;
@@ -37579,7 +37616,7 @@ var init_ReflectionBlock = __esm({
37579
37616
  }
37580
37617
  });
37581
37618
 
37582
- // components/core/molecules/parseLessonSegments.ts
37619
+ // lib/parseLessonSegments.ts
37583
37620
  function extractTagContent(content, tagName) {
37584
37621
  const closedTagRegex = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`, "i");
37585
37622
  const closedMatch = content.match(closedTagRegex);
@@ -37656,7 +37693,7 @@ function parseLessonSegments(lesson) {
37656
37693
  return segments;
37657
37694
  }
37658
37695
  var init_parseLessonSegments = __esm({
37659
- "components/core/molecules/parseLessonSegments.ts"() {
37696
+ "lib/parseLessonSegments.ts"() {
37660
37697
  init_lessonSegmentUtils();
37661
37698
  }
37662
37699
  });
@@ -48391,6 +48428,7 @@ exports.parseEditFocus = parseEditFocus;
48391
48428
  exports.parseLessonSegments = parseLessonSegments;
48392
48429
  exports.parseMarkdownWithCodeBlocks = parseMarkdownWithCodeBlocks;
48393
48430
  exports.parseQueryBinding = parseQueryBinding;
48431
+ exports.registerCodeLanguageLoader = registerCodeLanguageLoader;
48394
48432
  exports.resolveFieldMap = resolveFieldMap;
48395
48433
  exports.resolveFrame = resolveFrame;
48396
48434
  exports.resolveSheetDirection = resolveSheetDirection;
@@ -5095,6 +5095,15 @@ declare const MarkdownContent: React__default.NamedExoticComponent<MarkdownConte
5095
5095
  * - Emits: UI:COPY_CODE { language, success }
5096
5096
  */
5097
5097
 
5098
+ /** A PrismLight grammar module's default export: a function that registers
5099
+ * token definitions on the Prism/refractor instance passed to it. */
5100
+ type PrismLanguageGrammar = (prism: object) => void;
5101
+ /** A consumer-supplied async grammar fetcher. Returns the language module
5102
+ * default (registered with PrismLight), or `null` if no grammar exists. */
5103
+ type CodeLanguageLoader = (lang: string) => Promise<PrismLanguageGrammar | null>;
5104
+ /** Wire up a dynamic language-grammar loader. Must be called from app source
5105
+ * (not a pre-bundled dependency) so the bundler can split grammars into chunks. */
5106
+ declare function registerCodeLanguageLoader(loader: CodeLanguageLoader | null): void;
5098
5107
  /**
5099
5108
  * The set of languages with a registered PrismLight grammar (above) plus the
5100
5109
  * `.orb`/`.lolo` grammars from `@almadar/syntax`. Authoritative: an unregistered
@@ -5104,11 +5113,11 @@ declare const MarkdownContent: React__default.NamedExoticComponent<MarkdownConte
5104
5113
  declare const CODE_LANGUAGES: readonly ["text", "json", "javascript", "js", "typescript", "ts", "jsx", "tsx", "css", "markdown", "md", "bash", "shell", "sh", "yaml", "yml", "rust", "python", "py", "sql", "diff", "toml", "go", "graphql", "html", "xml", "orb", "lolo"];
5105
5114
  type CodeLanguage = (typeof CODE_LANGUAGES)[number];
5106
5115
  /**
5107
- * Narrow an arbitrary string (e.g. a markdown fence info-string) to a
5108
- * `CodeLanguage`, falling back to `'text'` for any value without a registered
5109
- * grammar matching the highlighter's own plain-text fallback.
5116
+ * Normalize a fence info-string to a language id. Known languages pass through
5117
+ * as-is; unknown ids also pass through so they can be dynamically loaded by
5118
+ * `CodeBlock` (falling back to plain text if no Prism grammar exists).
5110
5119
  */
5111
- declare function toCodeLanguage(value: string | undefined): CodeLanguage;
5120
+ declare function toCodeLanguage(value: string | undefined): string;
5112
5121
  type CodeViewerMode = 'code' | 'diff';
5113
5122
  interface DiffLine$1 {
5114
5123
  type: 'add' | 'added' | 'remove' | 'removed' | 'context' | 'unchanged';
@@ -5129,8 +5138,8 @@ interface CodeViewerFile {
5129
5138
  interface CodeBlockProps {
5130
5139
  /** The code content to display */
5131
5140
  code?: string;
5132
- /** Programming language for syntax highlighting */
5133
- language?: CodeLanguage;
5141
+ /** Programming language for syntax highlighting (any Prism id; loaded on demand if not pre-registered) */
5142
+ language?: string;
5134
5143
  /** Show the copy button */
5135
5144
  showCopyButton?: boolean;
5136
5145
  /** Show the language badge */
@@ -11432,4 +11441,4 @@ interface AboutPageTemplateProps extends TemplateProps<AboutPageEntity> {
11432
11441
  }
11433
11442
  declare const AboutPageTemplate: React__default.FC<AboutPageTemplateProps>;
11434
11443
 
11435
- export { ALL_PRESETS, AR_BOOK_FIELDS, type AboutPageEntity, AboutPageTemplate, type AboutPageTemplateProps, Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, ActionPalette, type ActionPaletteProps, ActionTile, type ActionTileProps, ActivationBlock, type ActivationBlockProps, Alert, type AlertProps, type AlertVariant, type AlgorithmBar, AlgorithmCanvas, type AlgorithmCanvasProps, type AlgorithmCell, type AlgorithmPointer, AnimatedCounter, type AnimatedCounterProps, AnimatedGraphic, type AnimatedGraphicProps, AnimatedReveal, type AnimatedRevealProps, ArticleSection, type ArticleSectionProps, Aside, type AsideProps, AssetPicker, type AssetPickerProps, AtlasImage, type AtlasImageAsset, type AtlasImageProps, AtlasPanel, type AtlasPanelProps, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, BehaviorView, type BehaviorViewProps, BiologyCanvas, type BiologyCanvasProps, type BiologyEdge, type BiologyNode, type BlockType, type BloomLevel, BloomQuizBlock, type BloomQuizBlockProps, BookChapterView, type BookChapterViewProps, BookCoverPage, type BookCoverPageProps, type BookFieldMap, BookNavBar, type BookNavBarProps, BookTableOfContents, type BookTableOfContentsProps, BookViewer, type BookViewerProps, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, BranchingLogicBuilder, type BranchingLogicBuilderProps, type BranchingQuestion, type BranchingRule, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CTABanner, type CTABannerBackground, type CTABannerProps, CalendarGrid, type CalendarGridProps, type CameraMode, CameraState, Canvas, Canvas2D, type Canvas2DProps, type CanvasItemShape, type CanvasItemStatus, type CanvasMode, type CanvasProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, Carousel, type CarouselProps, CaseStudyCard, type CaseStudyCardProps, CaseStudyOrganism, type CaseStudyOrganismProps, Center, type CenterProps, Chart, type ChartDataPoint, ChartLegend, type ChartLegendItem, type ChartLegendProps, type ChartProps, type ChartSeries, type ChartType, ChatBar, type ChatBarProps, type ChatBarStatus, Checkbox, type CheckboxProps, type ChemistryArrow, type ChemistryAtom, type ChemistryBond, ChemistryCanvas, type ChemistryCanvasProps, ChoiceButton, type ChoiceButtonProps, Coachmark, type CoachmarkAnchor, type CoachmarkPlacement, type CoachmarkProps, CodeBlock, type CodeBlockProps, type CodeLanguage, CodeRunnerPanel, type CodeRunnerPanelProps, type CodeSimulationOutput, type CodeViewerAction, type CodeViewerFile, type CodeViewerMode, CollapsibleSection, type CollapsibleSectionProps, type Column, CommunityLinks, type CommunityLinksProps, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfettiEffect, type ConfettiEffectProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, ConnectionBlock, type ConnectionBlockProps, Container, type ContainerProps, ContentRenderer, type ContentRendererProps, ContentSection, type ContentSectionBackground, type ContentSectionPadding, type ContentSectionProps, ControlButton, type ControlButtonProps, ControlGrid, type ControlGridButton, type ControlGridKind, type ControlGridProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, type DPadDirection, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataGrid, type DataGridField, type DataGridItemAction, type DataGridProps, DataList, type DataListField, type DataListItemAction, type DataListProps, DataTable, type DataTableProps, DateRangePicker, type DateRangePickerPreset, type DateRangePickerProps, DateRangeSelector, type DateRangeSelectorOption, type DateRangeSelectorProps, DayCell, type DayCellProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, Dialog, type DialogProps, DialogueBubble, type DialogueBubbleProps, type DiffLine$1 as DiffLine, type DiffLineType, type DiffRevision, type DisplayStateProps, Divider, type DividerOrientation, type DividerProps, DocBreadcrumb, type DocBreadcrumbItem, type DocBreadcrumbProps, DocPagination, type DocPaginationLink, type DocPaginationProps, DocSearch, type DocSearchProps, type DocSearchResult, DocSidebar, type DocSidebarItem, type DocSidebarProps, DocTOC, type DocTOCItem, type DocTOCProps, type DocumentType, DocumentViewer, type DocumentViewerProps, StateMachineView as DomStateMachineVisualizer, type DotSize, type DotState, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, ELEMENT_SELECTED_EVENT, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, EditorCheckbox, type EditorCheckboxProps, type EditorMode, EditorSelect, type EditorSelectProps, EditorSlider, type EditorSliderProps, EditorTextInput, type EditorTextInputProps, EditorToolbar, type EditorToolbarProps, EmptyState, type EmptyStateProps, EntityDisplayEvents, ErrorBoundary, type ErrorBoundaryProps, ErrorState, type ErrorStateProps, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FacingDirection, FeatureCard, type FeatureCardProps, type FeatureDetailPageEntity, FeatureDetailPageTemplate, type FeatureDetailPageTemplateProps, type FeatureDetailSection, FeatureGrid, FeatureGridOrganism, type FeatureGridOrganismProps, type FeatureGridProps, FileTree, type FileTreeNode, type FileTreeProps, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterPayload, FilterPill, type FilterPillProps, type FilterPillSize, type FilterPillVariant, Flex, type FlexProps, FlipCard, type FlipCardProps, FlipContainer, type FlipContainerProps, type FloatingAction, FloatingActionButton, type FloatingActionButtonProps, type FooterLinkColumn, type FooterLinkItem, Form, FormActions, type FormActionsProps, FormField, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, GameAudioToggle, type GameAudioToggleProps, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameIcon, type GameIconProps, GameMenu, type GameMenuProps, GameShell, type GameShellProps, GenericAppTemplate, type GenericAppTemplateProps, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, GraphCanvas, type GraphCanvasProps, type GraphEdge, type GraphNode, type GraphSimilarity, GraphView, type GraphViewEdge, type GraphViewNode, type GraphViewProps, type GraphicAnimation, Grid, GridPicker, type GridPickerCellSize, type GridPickerProps, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, HeroOrganism, type HeroOrganismProps, HeroSection, type HeroSectionProps, type HighlightType, IDENTITY_BOOK_FIELDS, Icon, type IconAnimation, type IconInput, IconPicker, type IconPickerProps, type IconProps, type IconSize, ImageSource, InfiniteScrollSentinel, type InfiniteScrollSentinelProps, Input, InputGroup, type InputGroupProps, type InputProps, InstallBox, type InstallBoxProps, IsometricUnit, JazariStateMachine, type JazariStateMachineProps, JsonTreeEditor, type JsonTreeEditorProps, Label, type LabelProps, type LandingPageEntity, LandingPageTemplate, type LandingPageTemplateProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, LearningCanvas, type LearningCanvasProps, type LearningPhysicsBody, type LearningPhysicsConstraint, type LearningPoint, type LearningShape, type LearningShapeType, type LessonSegment, type LessonUserProgress, Lightbox, type LightboxImage, type LightboxProps, type LikertOption, LikertScale, type LikertScaleProps, LineChart, type LineChartProps, LinkAction, List, type ListItem, type ListProps, LoadingState, type LoadingStateProps, type MapMarkerData, type MapRouteData, type MapRouteWaypoint, MapView, type MapViewProps, MarkdownContent, type MarkdownContentProps, MarketingFooter, type MarketingFooterProps, MarketingStatCard, type MarketingStatCardProps, MasterDetail, MasterDetailLayout, type MasterDetailLayoutProps, type MasterDetailProps, MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type MathVector, type MatrixColumn, MatrixQuestion, type MatrixQuestionProps, type MatrixRow, MediaGallery, type MediaGalleryProps, type MediaItem, Menu, type MenuItem, type MenuOption, type MenuProps, Meter, type MeterAction, type MeterProps, type MeterThreshold, type MeterVariant, type MixedSegment, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, ModuleCard, type ModuleCardProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, NodeSlotEditor, type NodeSlotEditorProps, NotifyListener, NumberStepper, type NumberStepperProps, type NumberStepperSize, OnboardingSpotlight, type OnboardingSpotlightProps, type OptionConstraint, OptionConstraintGroup, type OptionConstraintGroupProps, type OptionConstraintOption, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, PageTransition, type PageTransitionProps, type PaginatePayload, Pagination, type PaginationProps, PatternTile, type PatternTileProps, type PatternVariant, PhysicsCanvas, type PhysicsCanvasProps, type PickerItem, type Platform, Point, Popover, type PopoverProps, PositionedCanvas, type PositionedCanvasProps, Presence, type PresenceAnimation, type PresenceProps, type PresenceResult, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PricingOrganism, type PricingOrganismProps, type PricingPageEntity, PricingPageTemplate, type PricingPageTemplateProps, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, ProgressDots, type ProgressDotsProps, type Projection, PropertyInspector, type PropertyInspectorProps, PullQuote, type PullQuoteProps, PullToRefresh, type PullToRefreshProps, type QrScanResult, QrScanner, type QrScannerProps, QuizBlock, type QuizBlockProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, type RangeSliderSize, ReflectionBlock, type ReflectionBlockProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, ReplyTree, type ReplyTreeProps, ResolvedFrame, type RevealAnimation, type RevealTrigger, type RichBlock, RichBlockEditor, type RichBlockEditorProps, type RowAction, type RuleDefinition, type RuleOption, RuntimeDebugger, type RuntimeDebuggerProps, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, type ScaledDiagramProps, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, type SearchPayload, Section, SectionHeader, type SectionHeaderProps, type SectionProps, SegmentRenderer, type SegmentRendererProps, Select, type SelectOption, type SelectOptionGroup, type SelectPayload, type SelectProps, SequenceBar, type SequenceBarProps, ServiceCatalog, type ServiceCatalogItem, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, ShowcaseOrganism, type ShowcaseOrganismProps, SidePanel, type SidePanelProps, type SidePlayer, Sidebar, type SidebarItem, type SidebarProps, SignaturePad, type SignaturePadProps, SimpleGrid, type SimpleGridProps, Skeleton, type SkeletonProps, type SkeletonVariant, SlotContent, SlotContentRenderer, type SlotItemData, SocialProof, type SocialProofItem, type SocialProofProps, type SortPayload, SortableList, type SortableListProps, Spacer, type SpacerProps, type SpacerSize, Sparkline, type SparklineColor, type SparklineProps, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, SplitSection, type SplitSectionProps, type SpotlightStep, SpriteFrameDims, SpriteSheetUrls, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StarRating, type StarRatingPrecision, type StarRatingProps, type StarRatingSize, StatBadge, type StatBadgeProps, StatCard, type StatCardProps, type StatCardSize, StatDisplay, type StatDisplayProps, StateGraph, type StateGraphProps, type StateGraphTransition, StateJsonView, type StateJsonViewProps, StateMachineView, type StateMachineViewProps, StateNode, type StateNodeProps, StatsGrid, type StatsGridProps, StatsOrganism, type StatsOrganismProps, StatusBar, type StatusBarProps, StatusDot, type StatusDotProps, type StatusDotSize, type StatusDotStatus, StepFlow, StepFlowOrganism, type StepFlowOrganismProps, type StepFlowProps, type StepItemProps, SubagentTracePanel, type SubagentTracePanelProps, SvgBranch, type SvgBranchProps, SvgConnection, type SvgConnectionProps, SvgFlow, type SvgFlowProps, SvgGrid, type SvgGridProps, SvgLobe, type SvgLobeProps, SvgMesh, type SvgMeshProps, SvgMorph, type SvgMorphProps, SvgNode, type SvgNodeProps, SvgPulse, type SvgPulseProps, SvgRing, type SvgRingProps, SvgShield, type SvgShieldProps, SvgStack, type SvgStackProps, type SwipeAction, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, TableView, type TableViewColumn, type TableViewProps, Tabs, type TabsProps, TagCloud, type TagCloudItem, type TagCloudProps, TagInput, type TagInputProps, TeamCard, type TeamCardProps, TeamOrganism, type TeamOrganismProps, type TeamUnitTraits, type TemplateProps, TerrainPalette, type TerrainPaletteProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeToggle, type ThemeToggleProps, type TileCoord, type TileLayout, TimeSlotCell, type TimeSlotCellProps, Timeline, type TimelineItem, type TimelineItemStatus, type TimelineProps, TimerDisplay, type TimerDisplayProps, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, type TraceDisclosureLevel, TraitFrame, type TraitFrameProps, TraitSlot, type TraitSlotProps, type TraitStateMachineDefinition, TraitStateViewer, type TraitStateViewerProps, type TraitTransition, TransitionArrow, type TransitionArrowProps, type TransitionBundle, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type TrendIndicatorSize, TypewriterText, type TypewriterTextProps, Typography, type TypographyProps, type TypographyVariant, UISlotComponent, UISlotRenderer, type UISlotRendererProps, UiError, UnitAnimationState, UploadDropZone, type UploadDropZoneProps, type UsePresenceOptions, VStack, type VStackProps, type Vec2, VersionDiff, type DiffLine as VersionDiffLine, type VersionDiffProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, VoteStack, type VoteStackProps, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, boardEntity, bool, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAnchorRect, useAtlasSliceDataUrl, useCamera, useImageCache, usePresence, useUnitSpriteAtlas, vec2 };
11444
+ export { ALL_PRESETS, AR_BOOK_FIELDS, type AboutPageEntity, AboutPageTemplate, type AboutPageTemplateProps, Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, ActionPalette, type ActionPaletteProps, ActionTile, type ActionTileProps, ActivationBlock, type ActivationBlockProps, Alert, type AlertProps, type AlertVariant, type AlgorithmBar, AlgorithmCanvas, type AlgorithmCanvasProps, type AlgorithmCell, type AlgorithmPointer, AnimatedCounter, type AnimatedCounterProps, AnimatedGraphic, type AnimatedGraphicProps, AnimatedReveal, type AnimatedRevealProps, ArticleSection, type ArticleSectionProps, Aside, type AsideProps, AssetPicker, type AssetPickerProps, AtlasImage, type AtlasImageAsset, type AtlasImageProps, AtlasPanel, type AtlasPanelProps, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, BehaviorView, type BehaviorViewProps, BiologyCanvas, type BiologyCanvasProps, type BiologyEdge, type BiologyNode, type BlockType, type BloomLevel, BloomQuizBlock, type BloomQuizBlockProps, BookChapterView, type BookChapterViewProps, BookCoverPage, type BookCoverPageProps, type BookFieldMap, BookNavBar, type BookNavBarProps, BookTableOfContents, type BookTableOfContentsProps, BookViewer, type BookViewerProps, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, BranchingLogicBuilder, type BranchingLogicBuilderProps, type BranchingQuestion, type BranchingRule, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CTABanner, type CTABannerBackground, type CTABannerProps, CalendarGrid, type CalendarGridProps, type CameraMode, CameraState, Canvas, Canvas2D, type Canvas2DProps, type CanvasItemShape, type CanvasItemStatus, type CanvasMode, type CanvasProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, Carousel, type CarouselProps, CaseStudyCard, type CaseStudyCardProps, CaseStudyOrganism, type CaseStudyOrganismProps, Center, type CenterProps, Chart, type ChartDataPoint, ChartLegend, type ChartLegendItem, type ChartLegendProps, type ChartProps, type ChartSeries, type ChartType, ChatBar, type ChatBarProps, type ChatBarStatus, Checkbox, type CheckboxProps, type ChemistryArrow, type ChemistryAtom, type ChemistryBond, ChemistryCanvas, type ChemistryCanvasProps, ChoiceButton, type ChoiceButtonProps, Coachmark, type CoachmarkAnchor, type CoachmarkPlacement, type CoachmarkProps, CodeBlock, type CodeBlockProps, type CodeLanguage, type CodeLanguageLoader, CodeRunnerPanel, type CodeRunnerPanelProps, type CodeSimulationOutput, type CodeViewerAction, type CodeViewerFile, type CodeViewerMode, CollapsibleSection, type CollapsibleSectionProps, type Column, CommunityLinks, type CommunityLinksProps, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfettiEffect, type ConfettiEffectProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, ConnectionBlock, type ConnectionBlockProps, Container, type ContainerProps, ContentRenderer, type ContentRendererProps, ContentSection, type ContentSectionBackground, type ContentSectionPadding, type ContentSectionProps, ControlButton, type ControlButtonProps, ControlGrid, type ControlGridButton, type ControlGridKind, type ControlGridProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, type DPadDirection, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataGrid, type DataGridField, type DataGridItemAction, type DataGridProps, DataList, type DataListField, type DataListItemAction, type DataListProps, DataTable, type DataTableProps, DateRangePicker, type DateRangePickerPreset, type DateRangePickerProps, DateRangeSelector, type DateRangeSelectorOption, type DateRangeSelectorProps, DayCell, type DayCellProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, Dialog, type DialogProps, DialogueBubble, type DialogueBubbleProps, type DiffLine$1 as DiffLine, type DiffLineType, type DiffRevision, type DisplayStateProps, Divider, type DividerOrientation, type DividerProps, DocBreadcrumb, type DocBreadcrumbItem, type DocBreadcrumbProps, DocPagination, type DocPaginationLink, type DocPaginationProps, DocSearch, type DocSearchProps, type DocSearchResult, DocSidebar, type DocSidebarItem, type DocSidebarProps, DocTOC, type DocTOCItem, type DocTOCProps, type DocumentType, DocumentViewer, type DocumentViewerProps, StateMachineView as DomStateMachineVisualizer, type DotSize, type DotState, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, ELEMENT_SELECTED_EVENT, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, EditorCheckbox, type EditorCheckboxProps, type EditorMode, EditorSelect, type EditorSelectProps, EditorSlider, type EditorSliderProps, EditorTextInput, type EditorTextInputProps, EditorToolbar, type EditorToolbarProps, EmptyState, type EmptyStateProps, EntityDisplayEvents, ErrorBoundary, type ErrorBoundaryProps, ErrorState, type ErrorStateProps, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FacingDirection, FeatureCard, type FeatureCardProps, type FeatureDetailPageEntity, FeatureDetailPageTemplate, type FeatureDetailPageTemplateProps, type FeatureDetailSection, FeatureGrid, FeatureGridOrganism, type FeatureGridOrganismProps, type FeatureGridProps, FileTree, type FileTreeNode, type FileTreeProps, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterPayload, FilterPill, type FilterPillProps, type FilterPillSize, type FilterPillVariant, Flex, type FlexProps, FlipCard, type FlipCardProps, FlipContainer, type FlipContainerProps, type FloatingAction, FloatingActionButton, type FloatingActionButtonProps, type FooterLinkColumn, type FooterLinkItem, Form, FormActions, type FormActionsProps, FormField, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, GameAudioToggle, type GameAudioToggleProps, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameIcon, type GameIconProps, GameMenu, type GameMenuProps, GameShell, type GameShellProps, GenericAppTemplate, type GenericAppTemplateProps, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, GraphCanvas, type GraphCanvasProps, type GraphEdge, type GraphNode, type GraphSimilarity, GraphView, type GraphViewEdge, type GraphViewNode, type GraphViewProps, type GraphicAnimation, Grid, GridPicker, type GridPickerCellSize, type GridPickerProps, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, HeroOrganism, type HeroOrganismProps, HeroSection, type HeroSectionProps, type HighlightType, IDENTITY_BOOK_FIELDS, Icon, type IconAnimation, type IconInput, IconPicker, type IconPickerProps, type IconProps, type IconSize, ImageSource, InfiniteScrollSentinel, type InfiniteScrollSentinelProps, Input, InputGroup, type InputGroupProps, type InputProps, InstallBox, type InstallBoxProps, IsometricUnit, JazariStateMachine, type JazariStateMachineProps, JsonTreeEditor, type JsonTreeEditorProps, Label, type LabelProps, type LandingPageEntity, LandingPageTemplate, type LandingPageTemplateProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, LearningCanvas, type LearningCanvasProps, type LearningPhysicsBody, type LearningPhysicsConstraint, type LearningPoint, type LearningShape, type LearningShapeType, type LessonSegment, type LessonUserProgress, Lightbox, type LightboxImage, type LightboxProps, type LikertOption, LikertScale, type LikertScaleProps, LineChart, type LineChartProps, LinkAction, List, type ListItem, type ListProps, LoadingState, type LoadingStateProps, type MapMarkerData, type MapRouteData, type MapRouteWaypoint, MapView, type MapViewProps, MarkdownContent, type MarkdownContentProps, MarketingFooter, type MarketingFooterProps, MarketingStatCard, type MarketingStatCardProps, MasterDetail, MasterDetailLayout, type MasterDetailLayoutProps, type MasterDetailProps, MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type MathVector, type MatrixColumn, MatrixQuestion, type MatrixQuestionProps, type MatrixRow, MediaGallery, type MediaGalleryProps, type MediaItem, Menu, type MenuItem, type MenuOption, type MenuProps, Meter, type MeterAction, type MeterProps, type MeterThreshold, type MeterVariant, type MixedSegment, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, ModuleCard, type ModuleCardProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, NodeSlotEditor, type NodeSlotEditorProps, NotifyListener, NumberStepper, type NumberStepperProps, type NumberStepperSize, OnboardingSpotlight, type OnboardingSpotlightProps, type OptionConstraint, OptionConstraintGroup, type OptionConstraintGroupProps, type OptionConstraintOption, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, PageTransition, type PageTransitionProps, type PaginatePayload, Pagination, type PaginationProps, PatternTile, type PatternTileProps, type PatternVariant, PhysicsCanvas, type PhysicsCanvasProps, type PickerItem, type Platform, Point, Popover, type PopoverProps, PositionedCanvas, type PositionedCanvasProps, Presence, type PresenceAnimation, type PresenceProps, type PresenceResult, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PricingOrganism, type PricingOrganismProps, type PricingPageEntity, PricingPageTemplate, type PricingPageTemplateProps, type PrismLanguageGrammar, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, ProgressDots, type ProgressDotsProps, type Projection, PropertyInspector, type PropertyInspectorProps, PullQuote, type PullQuoteProps, PullToRefresh, type PullToRefreshProps, type QrScanResult, QrScanner, type QrScannerProps, QuizBlock, type QuizBlockProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, type RangeSliderSize, ReflectionBlock, type ReflectionBlockProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, ReplyTree, type ReplyTreeProps, ResolvedFrame, type RevealAnimation, type RevealTrigger, type RichBlock, RichBlockEditor, type RichBlockEditorProps, type RowAction, type RuleDefinition, type RuleOption, RuntimeDebugger, type RuntimeDebuggerProps, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, type ScaledDiagramProps, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, type SearchPayload, Section, SectionHeader, type SectionHeaderProps, type SectionProps, SegmentRenderer, type SegmentRendererProps, Select, type SelectOption, type SelectOptionGroup, type SelectPayload, type SelectProps, SequenceBar, type SequenceBarProps, ServiceCatalog, type ServiceCatalogItem, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, ShowcaseOrganism, type ShowcaseOrganismProps, SidePanel, type SidePanelProps, type SidePlayer, Sidebar, type SidebarItem, type SidebarProps, SignaturePad, type SignaturePadProps, SimpleGrid, type SimpleGridProps, Skeleton, type SkeletonProps, type SkeletonVariant, SlotContent, SlotContentRenderer, type SlotItemData, SocialProof, type SocialProofItem, type SocialProofProps, type SortPayload, SortableList, type SortableListProps, Spacer, type SpacerProps, type SpacerSize, Sparkline, type SparklineColor, type SparklineProps, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, SplitSection, type SplitSectionProps, type SpotlightStep, SpriteFrameDims, SpriteSheetUrls, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StarRating, type StarRatingPrecision, type StarRatingProps, type StarRatingSize, StatBadge, type StatBadgeProps, StatCard, type StatCardProps, type StatCardSize, StatDisplay, type StatDisplayProps, StateGraph, type StateGraphProps, type StateGraphTransition, StateJsonView, type StateJsonViewProps, StateMachineView, type StateMachineViewProps, StateNode, type StateNodeProps, StatsGrid, type StatsGridProps, StatsOrganism, type StatsOrganismProps, StatusBar, type StatusBarProps, StatusDot, type StatusDotProps, type StatusDotSize, type StatusDotStatus, StepFlow, StepFlowOrganism, type StepFlowOrganismProps, type StepFlowProps, type StepItemProps, SubagentTracePanel, type SubagentTracePanelProps, SvgBranch, type SvgBranchProps, SvgConnection, type SvgConnectionProps, SvgFlow, type SvgFlowProps, SvgGrid, type SvgGridProps, SvgLobe, type SvgLobeProps, SvgMesh, type SvgMeshProps, SvgMorph, type SvgMorphProps, SvgNode, type SvgNodeProps, SvgPulse, type SvgPulseProps, SvgRing, type SvgRingProps, SvgShield, type SvgShieldProps, SvgStack, type SvgStackProps, type SwipeAction, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, TableView, type TableViewColumn, type TableViewProps, Tabs, type TabsProps, TagCloud, type TagCloudItem, type TagCloudProps, TagInput, type TagInputProps, TeamCard, type TeamCardProps, TeamOrganism, type TeamOrganismProps, type TeamUnitTraits, type TemplateProps, TerrainPalette, type TerrainPaletteProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeToggle, type ThemeToggleProps, type TileCoord, type TileLayout, TimeSlotCell, type TimeSlotCellProps, Timeline, type TimelineItem, type TimelineItemStatus, type TimelineProps, TimerDisplay, type TimerDisplayProps, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, type TraceDisclosureLevel, TraitFrame, type TraitFrameProps, TraitSlot, type TraitSlotProps, type TraitStateMachineDefinition, TraitStateViewer, type TraitStateViewerProps, type TraitTransition, TransitionArrow, type TransitionArrowProps, type TransitionBundle, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type TrendIndicatorSize, TypewriterText, type TypewriterTextProps, Typography, type TypographyProps, type TypographyVariant, UISlotComponent, UISlotRenderer, type UISlotRendererProps, UiError, UnitAnimationState, UploadDropZone, type UploadDropZoneProps, type UsePresenceOptions, VStack, type VStackProps, type Vec2, VersionDiff, type DiffLine as VersionDiffLine, type VersionDiffProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, VoteStack, type VoteStackProps, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, boardEntity, bool, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAnchorRect, useAtlasSliceDataUrl, useCamera, useImageCache, usePresence, useUnitSpriteAtlas, vec2 };
@@ -5095,6 +5095,15 @@ declare const MarkdownContent: React__default.NamedExoticComponent<MarkdownConte
5095
5095
  * - Emits: UI:COPY_CODE { language, success }
5096
5096
  */
5097
5097
 
5098
+ /** A PrismLight grammar module's default export: a function that registers
5099
+ * token definitions on the Prism/refractor instance passed to it. */
5100
+ type PrismLanguageGrammar = (prism: object) => void;
5101
+ /** A consumer-supplied async grammar fetcher. Returns the language module
5102
+ * default (registered with PrismLight), or `null` if no grammar exists. */
5103
+ type CodeLanguageLoader = (lang: string) => Promise<PrismLanguageGrammar | null>;
5104
+ /** Wire up a dynamic language-grammar loader. Must be called from app source
5105
+ * (not a pre-bundled dependency) so the bundler can split grammars into chunks. */
5106
+ declare function registerCodeLanguageLoader(loader: CodeLanguageLoader | null): void;
5098
5107
  /**
5099
5108
  * The set of languages with a registered PrismLight grammar (above) plus the
5100
5109
  * `.orb`/`.lolo` grammars from `@almadar/syntax`. Authoritative: an unregistered
@@ -5104,11 +5113,11 @@ declare const MarkdownContent: React__default.NamedExoticComponent<MarkdownConte
5104
5113
  declare const CODE_LANGUAGES: readonly ["text", "json", "javascript", "js", "typescript", "ts", "jsx", "tsx", "css", "markdown", "md", "bash", "shell", "sh", "yaml", "yml", "rust", "python", "py", "sql", "diff", "toml", "go", "graphql", "html", "xml", "orb", "lolo"];
5105
5114
  type CodeLanguage = (typeof CODE_LANGUAGES)[number];
5106
5115
  /**
5107
- * Narrow an arbitrary string (e.g. a markdown fence info-string) to a
5108
- * `CodeLanguage`, falling back to `'text'` for any value without a registered
5109
- * grammar matching the highlighter's own plain-text fallback.
5116
+ * Normalize a fence info-string to a language id. Known languages pass through
5117
+ * as-is; unknown ids also pass through so they can be dynamically loaded by
5118
+ * `CodeBlock` (falling back to plain text if no Prism grammar exists).
5110
5119
  */
5111
- declare function toCodeLanguage(value: string | undefined): CodeLanguage;
5120
+ declare function toCodeLanguage(value: string | undefined): string;
5112
5121
  type CodeViewerMode = 'code' | 'diff';
5113
5122
  interface DiffLine$1 {
5114
5123
  type: 'add' | 'added' | 'remove' | 'removed' | 'context' | 'unchanged';
@@ -5129,8 +5138,8 @@ interface CodeViewerFile {
5129
5138
  interface CodeBlockProps {
5130
5139
  /** The code content to display */
5131
5140
  code?: string;
5132
- /** Programming language for syntax highlighting */
5133
- language?: CodeLanguage;
5141
+ /** Programming language for syntax highlighting (any Prism id; loaded on demand if not pre-registered) */
5142
+ language?: string;
5134
5143
  /** Show the copy button */
5135
5144
  showCopyButton?: boolean;
5136
5145
  /** Show the language badge */
@@ -11432,4 +11441,4 @@ interface AboutPageTemplateProps extends TemplateProps<AboutPageEntity> {
11432
11441
  }
11433
11442
  declare const AboutPageTemplate: React__default.FC<AboutPageTemplateProps>;
11434
11443
 
11435
- export { ALL_PRESETS, AR_BOOK_FIELDS, type AboutPageEntity, AboutPageTemplate, type AboutPageTemplateProps, Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, ActionPalette, type ActionPaletteProps, ActionTile, type ActionTileProps, ActivationBlock, type ActivationBlockProps, Alert, type AlertProps, type AlertVariant, type AlgorithmBar, AlgorithmCanvas, type AlgorithmCanvasProps, type AlgorithmCell, type AlgorithmPointer, AnimatedCounter, type AnimatedCounterProps, AnimatedGraphic, type AnimatedGraphicProps, AnimatedReveal, type AnimatedRevealProps, ArticleSection, type ArticleSectionProps, Aside, type AsideProps, AssetPicker, type AssetPickerProps, AtlasImage, type AtlasImageAsset, type AtlasImageProps, AtlasPanel, type AtlasPanelProps, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, BehaviorView, type BehaviorViewProps, BiologyCanvas, type BiologyCanvasProps, type BiologyEdge, type BiologyNode, type BlockType, type BloomLevel, BloomQuizBlock, type BloomQuizBlockProps, BookChapterView, type BookChapterViewProps, BookCoverPage, type BookCoverPageProps, type BookFieldMap, BookNavBar, type BookNavBarProps, BookTableOfContents, type BookTableOfContentsProps, BookViewer, type BookViewerProps, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, BranchingLogicBuilder, type BranchingLogicBuilderProps, type BranchingQuestion, type BranchingRule, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CTABanner, type CTABannerBackground, type CTABannerProps, CalendarGrid, type CalendarGridProps, type CameraMode, CameraState, Canvas, Canvas2D, type Canvas2DProps, type CanvasItemShape, type CanvasItemStatus, type CanvasMode, type CanvasProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, Carousel, type CarouselProps, CaseStudyCard, type CaseStudyCardProps, CaseStudyOrganism, type CaseStudyOrganismProps, Center, type CenterProps, Chart, type ChartDataPoint, ChartLegend, type ChartLegendItem, type ChartLegendProps, type ChartProps, type ChartSeries, type ChartType, ChatBar, type ChatBarProps, type ChatBarStatus, Checkbox, type CheckboxProps, type ChemistryArrow, type ChemistryAtom, type ChemistryBond, ChemistryCanvas, type ChemistryCanvasProps, ChoiceButton, type ChoiceButtonProps, Coachmark, type CoachmarkAnchor, type CoachmarkPlacement, type CoachmarkProps, CodeBlock, type CodeBlockProps, type CodeLanguage, CodeRunnerPanel, type CodeRunnerPanelProps, type CodeSimulationOutput, type CodeViewerAction, type CodeViewerFile, type CodeViewerMode, CollapsibleSection, type CollapsibleSectionProps, type Column, CommunityLinks, type CommunityLinksProps, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfettiEffect, type ConfettiEffectProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, ConnectionBlock, type ConnectionBlockProps, Container, type ContainerProps, ContentRenderer, type ContentRendererProps, ContentSection, type ContentSectionBackground, type ContentSectionPadding, type ContentSectionProps, ControlButton, type ControlButtonProps, ControlGrid, type ControlGridButton, type ControlGridKind, type ControlGridProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, type DPadDirection, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataGrid, type DataGridField, type DataGridItemAction, type DataGridProps, DataList, type DataListField, type DataListItemAction, type DataListProps, DataTable, type DataTableProps, DateRangePicker, type DateRangePickerPreset, type DateRangePickerProps, DateRangeSelector, type DateRangeSelectorOption, type DateRangeSelectorProps, DayCell, type DayCellProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, Dialog, type DialogProps, DialogueBubble, type DialogueBubbleProps, type DiffLine$1 as DiffLine, type DiffLineType, type DiffRevision, type DisplayStateProps, Divider, type DividerOrientation, type DividerProps, DocBreadcrumb, type DocBreadcrumbItem, type DocBreadcrumbProps, DocPagination, type DocPaginationLink, type DocPaginationProps, DocSearch, type DocSearchProps, type DocSearchResult, DocSidebar, type DocSidebarItem, type DocSidebarProps, DocTOC, type DocTOCItem, type DocTOCProps, type DocumentType, DocumentViewer, type DocumentViewerProps, StateMachineView as DomStateMachineVisualizer, type DotSize, type DotState, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, ELEMENT_SELECTED_EVENT, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, EditorCheckbox, type EditorCheckboxProps, type EditorMode, EditorSelect, type EditorSelectProps, EditorSlider, type EditorSliderProps, EditorTextInput, type EditorTextInputProps, EditorToolbar, type EditorToolbarProps, EmptyState, type EmptyStateProps, EntityDisplayEvents, ErrorBoundary, type ErrorBoundaryProps, ErrorState, type ErrorStateProps, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FacingDirection, FeatureCard, type FeatureCardProps, type FeatureDetailPageEntity, FeatureDetailPageTemplate, type FeatureDetailPageTemplateProps, type FeatureDetailSection, FeatureGrid, FeatureGridOrganism, type FeatureGridOrganismProps, type FeatureGridProps, FileTree, type FileTreeNode, type FileTreeProps, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterPayload, FilterPill, type FilterPillProps, type FilterPillSize, type FilterPillVariant, Flex, type FlexProps, FlipCard, type FlipCardProps, FlipContainer, type FlipContainerProps, type FloatingAction, FloatingActionButton, type FloatingActionButtonProps, type FooterLinkColumn, type FooterLinkItem, Form, FormActions, type FormActionsProps, FormField, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, GameAudioToggle, type GameAudioToggleProps, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameIcon, type GameIconProps, GameMenu, type GameMenuProps, GameShell, type GameShellProps, GenericAppTemplate, type GenericAppTemplateProps, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, GraphCanvas, type GraphCanvasProps, type GraphEdge, type GraphNode, type GraphSimilarity, GraphView, type GraphViewEdge, type GraphViewNode, type GraphViewProps, type GraphicAnimation, Grid, GridPicker, type GridPickerCellSize, type GridPickerProps, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, HeroOrganism, type HeroOrganismProps, HeroSection, type HeroSectionProps, type HighlightType, IDENTITY_BOOK_FIELDS, Icon, type IconAnimation, type IconInput, IconPicker, type IconPickerProps, type IconProps, type IconSize, ImageSource, InfiniteScrollSentinel, type InfiniteScrollSentinelProps, Input, InputGroup, type InputGroupProps, type InputProps, InstallBox, type InstallBoxProps, IsometricUnit, JazariStateMachine, type JazariStateMachineProps, JsonTreeEditor, type JsonTreeEditorProps, Label, type LabelProps, type LandingPageEntity, LandingPageTemplate, type LandingPageTemplateProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, LearningCanvas, type LearningCanvasProps, type LearningPhysicsBody, type LearningPhysicsConstraint, type LearningPoint, type LearningShape, type LearningShapeType, type LessonSegment, type LessonUserProgress, Lightbox, type LightboxImage, type LightboxProps, type LikertOption, LikertScale, type LikertScaleProps, LineChart, type LineChartProps, LinkAction, List, type ListItem, type ListProps, LoadingState, type LoadingStateProps, type MapMarkerData, type MapRouteData, type MapRouteWaypoint, MapView, type MapViewProps, MarkdownContent, type MarkdownContentProps, MarketingFooter, type MarketingFooterProps, MarketingStatCard, type MarketingStatCardProps, MasterDetail, MasterDetailLayout, type MasterDetailLayoutProps, type MasterDetailProps, MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type MathVector, type MatrixColumn, MatrixQuestion, type MatrixQuestionProps, type MatrixRow, MediaGallery, type MediaGalleryProps, type MediaItem, Menu, type MenuItem, type MenuOption, type MenuProps, Meter, type MeterAction, type MeterProps, type MeterThreshold, type MeterVariant, type MixedSegment, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, ModuleCard, type ModuleCardProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, NodeSlotEditor, type NodeSlotEditorProps, NotifyListener, NumberStepper, type NumberStepperProps, type NumberStepperSize, OnboardingSpotlight, type OnboardingSpotlightProps, type OptionConstraint, OptionConstraintGroup, type OptionConstraintGroupProps, type OptionConstraintOption, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, PageTransition, type PageTransitionProps, type PaginatePayload, Pagination, type PaginationProps, PatternTile, type PatternTileProps, type PatternVariant, PhysicsCanvas, type PhysicsCanvasProps, type PickerItem, type Platform, Point, Popover, type PopoverProps, PositionedCanvas, type PositionedCanvasProps, Presence, type PresenceAnimation, type PresenceProps, type PresenceResult, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PricingOrganism, type PricingOrganismProps, type PricingPageEntity, PricingPageTemplate, type PricingPageTemplateProps, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, ProgressDots, type ProgressDotsProps, type Projection, PropertyInspector, type PropertyInspectorProps, PullQuote, type PullQuoteProps, PullToRefresh, type PullToRefreshProps, type QrScanResult, QrScanner, type QrScannerProps, QuizBlock, type QuizBlockProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, type RangeSliderSize, ReflectionBlock, type ReflectionBlockProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, ReplyTree, type ReplyTreeProps, ResolvedFrame, type RevealAnimation, type RevealTrigger, type RichBlock, RichBlockEditor, type RichBlockEditorProps, type RowAction, type RuleDefinition, type RuleOption, RuntimeDebugger, type RuntimeDebuggerProps, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, type ScaledDiagramProps, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, type SearchPayload, Section, SectionHeader, type SectionHeaderProps, type SectionProps, SegmentRenderer, type SegmentRendererProps, Select, type SelectOption, type SelectOptionGroup, type SelectPayload, type SelectProps, SequenceBar, type SequenceBarProps, ServiceCatalog, type ServiceCatalogItem, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, ShowcaseOrganism, type ShowcaseOrganismProps, SidePanel, type SidePanelProps, type SidePlayer, Sidebar, type SidebarItem, type SidebarProps, SignaturePad, type SignaturePadProps, SimpleGrid, type SimpleGridProps, Skeleton, type SkeletonProps, type SkeletonVariant, SlotContent, SlotContentRenderer, type SlotItemData, SocialProof, type SocialProofItem, type SocialProofProps, type SortPayload, SortableList, type SortableListProps, Spacer, type SpacerProps, type SpacerSize, Sparkline, type SparklineColor, type SparklineProps, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, SplitSection, type SplitSectionProps, type SpotlightStep, SpriteFrameDims, SpriteSheetUrls, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StarRating, type StarRatingPrecision, type StarRatingProps, type StarRatingSize, StatBadge, type StatBadgeProps, StatCard, type StatCardProps, type StatCardSize, StatDisplay, type StatDisplayProps, StateGraph, type StateGraphProps, type StateGraphTransition, StateJsonView, type StateJsonViewProps, StateMachineView, type StateMachineViewProps, StateNode, type StateNodeProps, StatsGrid, type StatsGridProps, StatsOrganism, type StatsOrganismProps, StatusBar, type StatusBarProps, StatusDot, type StatusDotProps, type StatusDotSize, type StatusDotStatus, StepFlow, StepFlowOrganism, type StepFlowOrganismProps, type StepFlowProps, type StepItemProps, SubagentTracePanel, type SubagentTracePanelProps, SvgBranch, type SvgBranchProps, SvgConnection, type SvgConnectionProps, SvgFlow, type SvgFlowProps, SvgGrid, type SvgGridProps, SvgLobe, type SvgLobeProps, SvgMesh, type SvgMeshProps, SvgMorph, type SvgMorphProps, SvgNode, type SvgNodeProps, SvgPulse, type SvgPulseProps, SvgRing, type SvgRingProps, SvgShield, type SvgShieldProps, SvgStack, type SvgStackProps, type SwipeAction, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, TableView, type TableViewColumn, type TableViewProps, Tabs, type TabsProps, TagCloud, type TagCloudItem, type TagCloudProps, TagInput, type TagInputProps, TeamCard, type TeamCardProps, TeamOrganism, type TeamOrganismProps, type TeamUnitTraits, type TemplateProps, TerrainPalette, type TerrainPaletteProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeToggle, type ThemeToggleProps, type TileCoord, type TileLayout, TimeSlotCell, type TimeSlotCellProps, Timeline, type TimelineItem, type TimelineItemStatus, type TimelineProps, TimerDisplay, type TimerDisplayProps, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, type TraceDisclosureLevel, TraitFrame, type TraitFrameProps, TraitSlot, type TraitSlotProps, type TraitStateMachineDefinition, TraitStateViewer, type TraitStateViewerProps, type TraitTransition, TransitionArrow, type TransitionArrowProps, type TransitionBundle, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type TrendIndicatorSize, TypewriterText, type TypewriterTextProps, Typography, type TypographyProps, type TypographyVariant, UISlotComponent, UISlotRenderer, type UISlotRendererProps, UiError, UnitAnimationState, UploadDropZone, type UploadDropZoneProps, type UsePresenceOptions, VStack, type VStackProps, type Vec2, VersionDiff, type DiffLine as VersionDiffLine, type VersionDiffProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, VoteStack, type VoteStackProps, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, boardEntity, bool, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAnchorRect, useAtlasSliceDataUrl, useCamera, useImageCache, usePresence, useUnitSpriteAtlas, vec2 };
11444
+ export { ALL_PRESETS, AR_BOOK_FIELDS, type AboutPageEntity, AboutPageTemplate, type AboutPageTemplateProps, Accordion, type AccordionItem, type AccordionProps, Card as ActionCard, type CardProps as ActionCardProps, ActionPalette, type ActionPaletteProps, ActionTile, type ActionTileProps, ActivationBlock, type ActivationBlockProps, Alert, type AlertProps, type AlertVariant, type AlgorithmBar, AlgorithmCanvas, type AlgorithmCanvasProps, type AlgorithmCell, type AlgorithmPointer, AnimatedCounter, type AnimatedCounterProps, AnimatedGraphic, type AnimatedGraphicProps, AnimatedReveal, type AnimatedRevealProps, ArticleSection, type ArticleSectionProps, Aside, type AsideProps, AssetPicker, type AssetPickerProps, AtlasImage, type AtlasImageAsset, type AtlasImageProps, AtlasPanel, type AtlasPanelProps, AuthLayout, type AuthLayoutProps, Avatar, type AvatarProps, type AvatarSize, type AvatarStatus, Badge, type BadgeProps, type BadgeVariant, BehaviorView, type BehaviorViewProps, BiologyCanvas, type BiologyCanvasProps, type BiologyEdge, type BiologyNode, type BlockType, type BloomLevel, BloomQuizBlock, type BloomQuizBlockProps, BookChapterView, type BookChapterViewProps, BookCoverPage, type BookCoverPageProps, type BookFieldMap, BookNavBar, type BookNavBarProps, BookTableOfContents, type BookTableOfContentsProps, BookViewer, type BookViewerProps, Box, type BoxBg, type BoxMargin, type BoxPadding, type BoxProps, type BoxRounded, type BoxShadow, BranchingLogicBuilder, type BranchingLogicBuilderProps, type BranchingQuestion, type BranchingRule, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, CTABanner, type CTABannerBackground, type CTABannerProps, CalendarGrid, type CalendarGridProps, type CameraMode, CameraState, Canvas, Canvas2D, type Canvas2DProps, type CanvasItemShape, type CanvasItemStatus, type CanvasMode, type CanvasProps, Card$1 as Card, type CardAction, CardBody, CardContent, CardFooter, CardGrid, type CardGridGap, type CardGridProps, CardHeader, type CardProps$1 as CardProps, CardTitle, Carousel, type CarouselProps, CaseStudyCard, type CaseStudyCardProps, CaseStudyOrganism, type CaseStudyOrganismProps, Center, type CenterProps, Chart, type ChartDataPoint, ChartLegend, type ChartLegendItem, type ChartLegendProps, type ChartProps, type ChartSeries, type ChartType, ChatBar, type ChatBarProps, type ChatBarStatus, Checkbox, type CheckboxProps, type ChemistryArrow, type ChemistryAtom, type ChemistryBond, ChemistryCanvas, type ChemistryCanvasProps, ChoiceButton, type ChoiceButtonProps, Coachmark, type CoachmarkAnchor, type CoachmarkPlacement, type CoachmarkProps, CodeBlock, type CodeBlockProps, type CodeLanguage, type CodeLanguageLoader, CodeRunnerPanel, type CodeRunnerPanelProps, type CodeSimulationOutput, type CodeViewerAction, type CodeViewerFile, type CodeViewerMode, CollapsibleSection, type CollapsibleSectionProps, type Column, CommunityLinks, type CommunityLinksProps, type ConditionalContext, ConditionalWrapper, type ConditionalWrapperProps, ConfettiEffect, type ConfettiEffectProps, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogVariant, ConnectionBlock, type ConnectionBlockProps, Container, type ContainerProps, ContentRenderer, type ContentRendererProps, ContentSection, type ContentSectionBackground, type ContentSectionPadding, type ContentSectionProps, ControlButton, type ControlButtonProps, ControlGrid, type ControlGridButton, type ControlGridKind, type ControlGridProps, type CounterSize, CounterTemplate, type CounterTemplateProps, type CounterVariant, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DIAMOND_TOP_Y, type DPadDirection, DashboardGrid, type DashboardGridCell, type DashboardGridProps, DashboardLayout, type DashboardLayoutProps, DataGrid, type DataGridField, type DataGridItemAction, type DataGridProps, DataList, type DataListField, type DataListItemAction, type DataListProps, DataTable, type DataTableProps, DateRangePicker, type DateRangePickerPreset, type DateRangePickerProps, DateRangeSelector, type DateRangeSelectorOption, type DateRangeSelectorProps, DayCell, type DayCellProps, type DetailField, DetailPanel, type DetailPanelProps, type DetailSection, Dialog, type DialogProps, DialogueBubble, type DialogueBubbleProps, type DiffLine$1 as DiffLine, type DiffLineType, type DiffRevision, type DisplayStateProps, Divider, type DividerOrientation, type DividerProps, DocBreadcrumb, type DocBreadcrumbItem, type DocBreadcrumbProps, DocPagination, type DocPaginationLink, type DocPaginationProps, DocSearch, type DocSearchProps, type DocSearchResult, DocSidebar, type DocSidebarItem, type DocSidebarProps, DocTOC, type DocTOCItem, type DocTOCProps, type DocumentType, DocumentViewer, type DocumentViewerProps, StateMachineView as DomStateMachineVisualizer, type DotSize, type DotState, Drawer, type DrawerPosition, type DrawerProps, type DrawerSize, DrawerSlot, type DrawerSlotProps, ELEMENT_SELECTED_EVENT, EdgeDecoration, type EdgeDecorationProps, type EdgeSide, type EdgeVariant, EditorCheckbox, type EditorCheckboxProps, type EditorMode, EditorSelect, type EditorSelectProps, EditorSlider, type EditorSliderProps, EditorTextInput, type EditorTextInputProps, EditorToolbar, type EditorToolbarProps, EmptyState, type EmptyStateProps, EntityDisplayEvents, ErrorBoundary, type ErrorBoundaryProps, ErrorState, type ErrorStateProps, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FacingDirection, FeatureCard, type FeatureCardProps, type FeatureDetailPageEntity, FeatureDetailPageTemplate, type FeatureDetailPageTemplateProps, type FeatureDetailSection, FeatureGrid, FeatureGridOrganism, type FeatureGridOrganismProps, type FeatureGridProps, FileTree, type FileTreeNode, type FileTreeProps, type FilterDefinition, FilterGroup, type FilterGroupProps, type FilterPayload, FilterPill, type FilterPillProps, type FilterPillSize, type FilterPillVariant, Flex, type FlexProps, FlipCard, type FlipCardProps, FlipContainer, type FlipContainerProps, type FloatingAction, FloatingActionButton, type FloatingActionButtonProps, type FooterLinkColumn, type FooterLinkItem, Form, FormActions, type FormActionsProps, FormField, type FormFieldProps, FormLayout, type FormLayoutProps, type FormProps, FormSection$1 as FormSection, FormSectionHeader, type FormSectionHeaderProps, type FormSectionProps, GameAudioToggle, type GameAudioToggleProps, GameHud, type GameHudElement, type GameHudProps, type GameHudStat, GameIcon, type GameIconProps, GameMenu, type GameMenuProps, GameShell, type GameShellProps, GenericAppTemplate, type GenericAppTemplateProps, GeometricPattern, type GeometricPatternProps, GradientDivider, type GradientDividerProps, GraphCanvas, type GraphCanvasProps, type GraphEdge, type GraphNode, type GraphSimilarity, GraphView, type GraphViewEdge, type GraphViewNode, type GraphViewProps, type GraphicAnimation, Grid, GridPicker, type GridPickerCellSize, type GridPickerProps, type GridProps, HStack, type HStackProps, Header, type HeaderProps, HealthBar, type HealthBarProps, HeroOrganism, type HeroOrganismProps, HeroSection, type HeroSectionProps, type HighlightType, IDENTITY_BOOK_FIELDS, Icon, type IconAnimation, type IconInput, IconPicker, type IconPickerProps, type IconProps, type IconSize, ImageSource, InfiniteScrollSentinel, type InfiniteScrollSentinelProps, Input, InputGroup, type InputGroupProps, type InputProps, InstallBox, type InstallBoxProps, IsometricUnit, JazariStateMachine, type JazariStateMachineProps, JsonTreeEditor, type JsonTreeEditorProps, Label, type LabelProps, type LandingPageEntity, LandingPageTemplate, type LandingPageTemplateProps, type LawReference, LawReferenceTooltip, type LawReferenceTooltipProps, LearningCanvas, type LearningCanvasProps, type LearningPhysicsBody, type LearningPhysicsConstraint, type LearningPoint, type LearningShape, type LearningShapeType, type LessonSegment, type LessonUserProgress, Lightbox, type LightboxImage, type LightboxProps, type LikertOption, LikertScale, type LikertScaleProps, LineChart, type LineChartProps, LinkAction, List, type ListItem, type ListProps, LoadingState, type LoadingStateProps, type MapMarkerData, type MapRouteData, type MapRouteWaypoint, MapView, type MapViewProps, MarkdownContent, type MarkdownContentProps, MarketingFooter, type MarketingFooterProps, MarketingStatCard, type MarketingStatCardProps, MasterDetail, MasterDetailLayout, type MasterDetailLayoutProps, type MasterDetailProps, MathCanvas, type MathCanvasProps, type MathCurve, type MathPoint, type MathVector, type MatrixColumn, MatrixQuestion, type MatrixQuestionProps, type MatrixRow, MediaGallery, type MediaGalleryProps, type MediaItem, Menu, type MenuItem, type MenuOption, type MenuProps, Meter, type MeterAction, type MeterProps, type MeterThreshold, type MeterVariant, type MixedSegment, Modal, type ModalProps, type ModalSize, ModalSlot, type ModalSlotProps, ModuleCard, type ModuleCardProps, type NavItem, Navigation, type NavigationItem, type NavigationProps, NodeSlotEditor, type NodeSlotEditorProps, NotifyListener, NumberStepper, type NumberStepperProps, type NumberStepperSize, OnboardingSpotlight, type OnboardingSpotlightProps, type OptionConstraint, OptionConstraintGroup, type OptionConstraintGroupProps, type OptionConstraintOption, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, type OrbitalVisualizationProps, Overlay, type OverlayProps, type PageBreadcrumb, PageHeader, type PageHeaderProps, PageTransition, type PageTransitionProps, type PaginatePayload, Pagination, type PaginationProps, PatternTile, type PatternTileProps, type PatternVariant, PhysicsCanvas, type PhysicsCanvasProps, type PickerItem, type Platform, Point, Popover, type PopoverProps, PositionedCanvas, type PositionedCanvasProps, Presence, type PresenceAnimation, type PresenceProps, type PresenceResult, PricingCard, type PricingCardProps, PricingGrid, type PricingGridProps, PricingOrganism, type PricingOrganismProps, type PricingPageEntity, PricingPageTemplate, type PricingPageTemplateProps, type PrismLanguageGrammar, ProgressBar, type ProgressBarColor, type ProgressBarProps, type ProgressBarVariant, ProgressDots, type ProgressDotsProps, type Projection, PropertyInspector, type PropertyInspectorProps, PullQuote, type PullQuoteProps, PullToRefresh, type PullToRefreshProps, type QrScanResult, QrScanner, type QrScannerProps, QuizBlock, type QuizBlockProps, Radio, type RadioProps, RangeSlider, type RangeSliderProps, type RangeSliderSize, ReflectionBlock, type ReflectionBlockProps, type RelationOption, RelationSelect, type RelationSelectProps, RepeatableFormSection, type RepeatableFormSectionProps, type RepeatableItem, ReplyTree, type ReplyTreeProps, ResolvedFrame, type RevealAnimation, type RevealTrigger, type RichBlock, RichBlockEditor, type RichBlockEditorProps, type RowAction, type RuleDefinition, type RuleOption, RuntimeDebugger, type RuntimeDebuggerProps, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, type ScaledDiagramProps, ScoreDisplay, type ScoreDisplayProps, SearchInput, type SearchInputProps, type SearchPayload, Section, SectionHeader, type SectionHeaderProps, type SectionProps, SegmentRenderer, type SegmentRendererProps, Select, type SelectOption, type SelectOptionGroup, type SelectPayload, type SelectProps, SequenceBar, type SequenceBarProps, ServiceCatalog, type ServiceCatalogItem, type ServiceCatalogProps, ShowcaseCard, type ShowcaseCardProps, ShowcaseOrganism, type ShowcaseOrganismProps, SidePanel, type SidePanelProps, type SidePlayer, Sidebar, type SidebarItem, type SidebarProps, SignaturePad, type SignaturePadProps, SimpleGrid, type SimpleGridProps, Skeleton, type SkeletonProps, type SkeletonVariant, SlotContent, SlotContentRenderer, type SlotItemData, SocialProof, type SocialProofItem, type SocialProofProps, type SortPayload, SortableList, type SortableListProps, Spacer, type SpacerProps, type SpacerSize, Sparkline, type SparklineColor, type SparklineProps, Spinner, type SpinnerProps, Split, SplitPane, type SplitPaneProps, type SplitProps, SplitSection, type SplitSectionProps, type SpotlightStep, SpriteFrameDims, SpriteSheetUrls, Stack, type StackAlign, type StackDirection, type StackGap, type StackJustify, type StackProps, StarRating, type StarRatingPrecision, type StarRatingProps, type StarRatingSize, StatBadge, type StatBadgeProps, StatCard, type StatCardProps, type StatCardSize, StatDisplay, type StatDisplayProps, StateGraph, type StateGraphProps, type StateGraphTransition, StateJsonView, type StateJsonViewProps, StateMachineView, type StateMachineViewProps, StateNode, type StateNodeProps, StatsGrid, type StatsGridProps, StatsOrganism, type StatsOrganismProps, StatusBar, type StatusBarProps, StatusDot, type StatusDotProps, type StatusDotSize, type StatusDotStatus, StepFlow, StepFlowOrganism, type StepFlowOrganismProps, type StepFlowProps, type StepItemProps, SubagentTracePanel, type SubagentTracePanelProps, SvgBranch, type SvgBranchProps, SvgConnection, type SvgConnectionProps, SvgFlow, type SvgFlowProps, SvgGrid, type SvgGridProps, SvgLobe, type SvgLobeProps, SvgMesh, type SvgMeshProps, SvgMorph, type SvgMorphProps, SvgNode, type SvgNodeProps, SvgPulse, type SvgPulseProps, SvgRing, type SvgRingProps, SvgShield, type SvgShieldProps, SvgStack, type SvgStackProps, type SwipeAction, SwipeableRow, type SwipeableRowProps, Switch, type SwitchProps, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, type TabDefinition, type TabItem, TabbedContainer, type TabbedContainerProps, TableView, type TableViewColumn, type TableViewProps, Tabs, type TabsProps, TagCloud, type TagCloudItem, type TagCloudProps, TagInput, type TagInputProps, TeamCard, type TeamCardProps, TeamOrganism, type TeamOrganismProps, type TeamUnitTraits, type TemplateProps, TerrainPalette, type TerrainPaletteProps, TextHighlight, type TextHighlightProps, Textarea, type TextareaProps, ThemeToggle, type ThemeToggleProps, type TileCoord, type TileLayout, TimeSlotCell, type TimeSlotCellProps, Timeline, type TimelineItem, type TimelineItemStatus, type TimelineProps, TimerDisplay, type TimerDisplayProps, Toast, type ToastProps, ToastSlot, type ToastSlotProps, type ToastVariant, Tooltip, type TooltipProps, type TraceDisclosureLevel, TraitFrame, type TraitFrameProps, TraitSlot, type TraitSlotProps, type TraitStateMachineDefinition, TraitStateViewer, type TraitStateViewerProps, type TraitTransition, TransitionArrow, type TransitionArrowProps, type TransitionBundle, type TrendDirection, TrendIndicator, type TrendIndicatorProps, type TrendIndicatorSize, TypewriterText, type TypewriterTextProps, Typography, type TypographyProps, type TypographyVariant, UISlotComponent, UISlotRenderer, type UISlotRendererProps, UiError, UnitAnimationState, UploadDropZone, type UploadDropZoneProps, type UsePresenceOptions, VStack, type VStackProps, type Vec2, VersionDiff, type DiffLine as VersionDiffLine, type VersionDiffProps, ViolationAlert, type ViolationAlertProps, type ViolationRecord, VoteStack, type VoteStackProps, WizardContainer, type WizardContainerProps, WizardNavigation, type WizardNavigationProps, WizardProgress, type WizardProgressProps, type WizardProgressStep, type WizardStep, boardEntity, bool, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAnchorRect, useAtlasSliceDataUrl, useCamera, useImageCache, usePresence, useUnitSpriteAtlas, vec2 };
@@ -9978,6 +9978,22 @@ var init_EmptyState = __esm({
9978
9978
  EmptyState.displayName = "EmptyState";
9979
9979
  }
9980
9980
  });
9981
+ function registerCodeLanguageLoader(loader) {
9982
+ codeLanguageLoader = loader;
9983
+ }
9984
+ function isLanguageRegistered(lang) {
9985
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
9986
+ }
9987
+ async function loadPrismLanguage(lang) {
9988
+ if (isLanguageRegistered(lang)) return;
9989
+ try {
9990
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
9991
+ if (grammar) SyntaxHighlighter.registerLanguage(lang, grammar);
9992
+ dynamicallyLoaded.add(lang);
9993
+ } catch {
9994
+ dynamicallyLoaded.add(lang);
9995
+ }
9996
+ }
9981
9997
  function computeFoldRegions(code) {
9982
9998
  const lines = code.split("\n");
9983
9999
  const regions = [];
@@ -10013,7 +10029,8 @@ function computeFoldRegions(code) {
10013
10029
  return regions.sort((a, b) => a.start - b.start);
10014
10030
  }
10015
10031
  function toCodeLanguage(value) {
10016
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
10032
+ if (!value) return "text";
10033
+ return value.toLowerCase();
10017
10034
  }
10018
10035
  function generateDiff(oldVal, newVal) {
10019
10036
  const oldLines = oldVal.split("\n");
@@ -10032,7 +10049,24 @@ function generateDiff(oldVal, newVal) {
10032
10049
  }
10033
10050
  return diff;
10034
10051
  }
10035
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
10052
+ function useLanguageReady(language) {
10053
+ const [ready, setReady] = useState(() => isLanguageRegistered(language));
10054
+ useEffect(() => {
10055
+ if (isLanguageRegistered(language)) {
10056
+ if (!ready) setReady(true);
10057
+ return;
10058
+ }
10059
+ let active = true;
10060
+ loadPrismLanguage(language).then(() => {
10061
+ if (active) setReady(true);
10062
+ });
10063
+ return () => {
10064
+ active = false;
10065
+ };
10066
+ }, [language]);
10067
+ return ready;
10068
+ }
10069
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log4, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
10036
10070
  var init_CodeBlock = __esm({
10037
10071
  "components/core/molecules/markdown/CodeBlock.tsx"() {
10038
10072
  init_cn();
@@ -10073,6 +10107,8 @@ var init_CodeBlock = __esm({
10073
10107
  SyntaxHighlighter.registerLanguage("graphql", langGraphql);
10074
10108
  SyntaxHighlighter.registerLanguage("orb", orbLanguage);
10075
10109
  SyntaxHighlighter.registerLanguage("lolo", loloLanguage);
10110
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
10111
+ codeLanguageLoader = null;
10076
10112
  orbStyleOverrides = {
10077
10113
  "orb-binding": { color: ORB_COLORS.dark.binding, fontWeight: "bold" },
10078
10114
  "orb-effect": { color: ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -10188,6 +10224,7 @@ var init_CodeBlock = __esm({
10188
10224
  const isOrb = language === "orb";
10189
10225
  const isLolo = language === "lolo";
10190
10226
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
10227
+ const languageReady = useLanguageReady(language);
10191
10228
  const eventBus = useEventBus();
10192
10229
  const { t } = useTranslate();
10193
10230
  const scrollRef = useRef(null);
@@ -10311,7 +10348,7 @@ var init_CodeBlock = __esm({
10311
10348
  children: code
10312
10349
  }
10313
10350
  ),
10314
- [code, language, activeStyle]
10351
+ [code, language, activeStyle, languageReady]
10315
10352
  );
10316
10353
  useLayoutEffect(() => {
10317
10354
  const container = codeRef.current;
@@ -10911,10 +10948,10 @@ var init_MarkdownContent = __esm({
10911
10948
  }
10912
10949
  });
10913
10950
 
10914
- // components/core/molecules/lessonSegmentUtils.ts
10951
+ // lib/lessonSegmentUtils.ts
10915
10952
  function parseMarkdownWithCodeBlocks(content) {
10916
10953
  const segments = [];
10917
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
10954
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
10918
10955
  let lastIndex = 0;
10919
10956
  let match;
10920
10957
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -10922,12 +10959,12 @@ function parseMarkdownWithCodeBlocks(content) {
10922
10959
  if (before.trim()) {
10923
10960
  segments.push({ type: "markdown", content: before });
10924
10961
  }
10925
- const rawLanguage = match[1] ?? "text";
10926
- const runModifier = !!match[2];
10962
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
10963
+ let rawLanguage = tokens[0] ?? "text";
10927
10964
  const suffixRunnable = rawLanguage.endsWith("-runnable");
10928
- const runnable = runModifier || suffixRunnable;
10965
+ const runnable = suffixRunnable || tokens.includes("run");
10929
10966
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
10930
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
10967
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
10931
10968
  lastIndex = codeBlockRegex.lastIndex;
10932
10969
  }
10933
10970
  const remaining = content.slice(lastIndex);
@@ -10937,7 +10974,7 @@ function parseMarkdownWithCodeBlocks(content) {
10937
10974
  return segments;
10938
10975
  }
10939
10976
  var init_lessonSegmentUtils = __esm({
10940
- "components/core/molecules/lessonSegmentUtils.ts"() {
10977
+ "lib/lessonSegmentUtils.ts"() {
10941
10978
  }
10942
10979
  });
10943
10980
  var BLOOM_CONFIG, BloomQuizBlock;
@@ -37534,7 +37571,7 @@ var init_ReflectionBlock = __esm({
37534
37571
  }
37535
37572
  });
37536
37573
 
37537
- // components/core/molecules/parseLessonSegments.ts
37574
+ // lib/parseLessonSegments.ts
37538
37575
  function extractTagContent(content, tagName) {
37539
37576
  const closedTagRegex = new RegExp(`<${tagName}>([\\s\\S]*?)<\\/${tagName}>`, "i");
37540
37577
  const closedMatch = content.match(closedTagRegex);
@@ -37611,7 +37648,7 @@ function parseLessonSegments(lesson) {
37611
37648
  return segments;
37612
37649
  }
37613
37650
  var init_parseLessonSegments = __esm({
37614
- "components/core/molecules/parseLessonSegments.ts"() {
37651
+ "lib/parseLessonSegments.ts"() {
37615
37652
  init_lessonSegmentUtils();
37616
37653
  }
37617
37654
  });
@@ -48245,4 +48282,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
48245
48282
  });
48246
48283
  }
48247
48284
 
48248
- export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate115 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
48285
+ export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, Card2 as ActionCard, ActionPalette, ActionTile, ActivationBlock, Alert, AlgorithmCanvas, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AssetPicker, AtlasImage, AtlasPanel, AuthLayout, Avatar, Badge, BehaviorView, BiologyCanvas, BloomQuizBlock, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, Button, ButtonGroup, CTABanner, CalendarGrid, Canvas, Canvas2D, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, Center, Chart, ChartLegend, ChatBar, Checkbox, ChemistryCanvas, ChoiceButton, Coachmark, CodeBlock, CodeRunnerPanel, CollapsibleSection, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, ConnectionBlock, Container, ContentRenderer, ContentSection, ControlButton, ControlGrid, CounterTemplate, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DetailPanel, Dialog, DialogueBubble, Divider, DocBreadcrumb, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, ELEMENT_SELECTED_EVENT, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EntityDisplayEvents, ErrorBoundary, ErrorState, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioToggle, GameHud, GameIcon, GameMenu, GameShell, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, GridPicker, HStack, Header, HealthBar, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, IconPicker, InfiniteScrollSentinel, Input, InputGroup, InstallBox, JazariStateMachine, JsonTreeEditor, Label, LandingPageTemplate, LawReferenceTooltip, LearningCanvas, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MathCanvas, MatrixQuestion, MediaGallery, Menu, Meter, Modal, ModalSlot, ModuleCard, Navigation, NodeSlotEditor, NotifyListener, NumberStepper, OnboardingSpotlight, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, PageTransition, Pagination, PatternTile, PhysicsCanvas, Popover, PositionedCanvas, Presence, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PropertyInspector, PullQuote, PullToRefresh, QrScanner, QuizBlock, Radio, RangeSlider, ReflectionBlock, RelationSelect, RepeatableFormSection, ReplyTree, RichBlockEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreDisplay, SearchInput, Section, SectionHeader, SegmentRenderer, Select, SequenceBar, ServiceCatalog, SharedEntityStoreContext, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateGraph, StateJsonView, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StepFlow, StepFlowOrganism, SubagentTracePanel, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, TextHighlight, Textarea, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UploadDropZone, VStack, VersionDiff, ViolationAlert, VoteStack, WizardContainer, WizardNavigation, WizardProgress, boardEntity, bool, calculateAttackTargets, calculateValidMoves, cn, createInitialGameState, createSharedEntityStore, createTranslate, createUnitAnimationState, getCurrentFrame, getTileDimensions, inferDirection, isoToScreen, makeAsset, makeAssetMap, mapBookData, num, objAvailableActions, objAvailableEvents, objCurrentState, objIcon, objId, objMaxRules, objName, objRules, objStates, parseEditFocus, parseLessonSegments, parseMarkdownWithCodeBlocks, parseQueryBinding, pendulum, projectileMotion, registerCodeLanguageLoader, resolveFieldMap, resolveFrame, resolveSheetDirection, rows, runTickFrame, screenToIso, springOscillator, str, tickAnimationState, toCodeLanguage, transitionAnimation, unitHealth, unitPosition, unitTeam, useAgentChat, useAnchorRect, useAtlasSliceDataUrl, useAuthContext, useCamera, useCanvasGestures, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useLongPress, useOrbitalHistory, usePresence, usePreview, usePullToRefresh, useQuerySingleton, useRenderInterpolation, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useSwipeGesture, useTapReveal, useTraitListens, useTranslate115 as useTranslate, useUIEvents, useUISlotManager, useUnitSpriteAtlas, useValidation, vec2 };
@@ -14414,6 +14414,19 @@ var init_EmptyState = __esm({
14414
14414
  EmptyState.displayName = "EmptyState";
14415
14415
  }
14416
14416
  });
14417
+ function isLanguageRegistered(lang) {
14418
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
14419
+ }
14420
+ async function loadPrismLanguage(lang) {
14421
+ if (isLanguageRegistered(lang)) return;
14422
+ try {
14423
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
14424
+ if (grammar) SyntaxHighlighter__default.default.registerLanguage(lang, grammar);
14425
+ dynamicallyLoaded.add(lang);
14426
+ } catch {
14427
+ dynamicallyLoaded.add(lang);
14428
+ }
14429
+ }
14417
14430
  function computeFoldRegions(code) {
14418
14431
  const lines = code.split("\n");
14419
14432
  const regions = [];
@@ -14449,7 +14462,8 @@ function computeFoldRegions(code) {
14449
14462
  return regions.sort((a, b) => a.start - b.start);
14450
14463
  }
14451
14464
  function toCodeLanguage(value) {
14452
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
14465
+ if (!value) return "text";
14466
+ return value.toLowerCase();
14453
14467
  }
14454
14468
  function generateDiff(oldVal, newVal) {
14455
14469
  const oldLines = oldVal.split("\n");
@@ -14468,7 +14482,24 @@ function generateDiff(oldVal, newVal) {
14468
14482
  }
14469
14483
  return diff;
14470
14484
  }
14471
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14485
+ function useLanguageReady(language) {
14486
+ const [ready, setReady] = React84.useState(() => isLanguageRegistered(language));
14487
+ React84.useEffect(() => {
14488
+ if (isLanguageRegistered(language)) {
14489
+ if (!ready) setReady(true);
14490
+ return;
14491
+ }
14492
+ let active = true;
14493
+ loadPrismLanguage(language).then(() => {
14494
+ if (active) setReady(true);
14495
+ });
14496
+ return () => {
14497
+ active = false;
14498
+ };
14499
+ }, [language]);
14500
+ return ready;
14501
+ }
14502
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14472
14503
  var init_CodeBlock = __esm({
14473
14504
  "components/core/molecules/markdown/CodeBlock.tsx"() {
14474
14505
  init_cn();
@@ -14509,6 +14540,8 @@ var init_CodeBlock = __esm({
14509
14540
  SyntaxHighlighter__default.default.registerLanguage("graphql", langGraphql__default.default);
14510
14541
  SyntaxHighlighter__default.default.registerLanguage("orb", syntax.orbLanguage);
14511
14542
  SyntaxHighlighter__default.default.registerLanguage("lolo", syntax.loloLanguage);
14543
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
14544
+ codeLanguageLoader = null;
14512
14545
  orbStyleOverrides = {
14513
14546
  "orb-binding": { color: syntax.ORB_COLORS.dark.binding, fontWeight: "bold" },
14514
14547
  "orb-effect": { color: syntax.ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -14624,6 +14657,7 @@ var init_CodeBlock = __esm({
14624
14657
  const isOrb = language === "orb";
14625
14658
  const isLolo = language === "lolo";
14626
14659
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
14660
+ const languageReady = useLanguageReady(language);
14627
14661
  const eventBus = useEventBus();
14628
14662
  const { t } = hooks.useTranslate();
14629
14663
  const scrollRef = React84.useRef(null);
@@ -14747,7 +14781,7 @@ var init_CodeBlock = __esm({
14747
14781
  children: code
14748
14782
  }
14749
14783
  ),
14750
- [code, language, activeStyle]
14784
+ [code, language, activeStyle, languageReady]
14751
14785
  );
14752
14786
  React84.useLayoutEffect(() => {
14753
14787
  const container = codeRef.current;
@@ -15347,10 +15381,10 @@ var init_MarkdownContent = __esm({
15347
15381
  }
15348
15382
  });
15349
15383
 
15350
- // components/core/molecules/lessonSegmentUtils.ts
15384
+ // lib/lessonSegmentUtils.ts
15351
15385
  function parseMarkdownWithCodeBlocks(content) {
15352
15386
  const segments = [];
15353
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
15387
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
15354
15388
  let lastIndex = 0;
15355
15389
  let match;
15356
15390
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -15358,12 +15392,12 @@ function parseMarkdownWithCodeBlocks(content) {
15358
15392
  if (before.trim()) {
15359
15393
  segments.push({ type: "markdown", content: before });
15360
15394
  }
15361
- const rawLanguage = match[1] ?? "text";
15362
- const runModifier = !!match[2];
15395
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
15396
+ let rawLanguage = tokens[0] ?? "text";
15363
15397
  const suffixRunnable = rawLanguage.endsWith("-runnable");
15364
- const runnable = runModifier || suffixRunnable;
15398
+ const runnable = suffixRunnable || tokens.includes("run");
15365
15399
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
15366
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
15400
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
15367
15401
  lastIndex = codeBlockRegex.lastIndex;
15368
15402
  }
15369
15403
  const remaining = content.slice(lastIndex);
@@ -15373,7 +15407,7 @@ function parseMarkdownWithCodeBlocks(content) {
15373
15407
  return segments;
15374
15408
  }
15375
15409
  var init_lessonSegmentUtils = __esm({
15376
- "components/core/molecules/lessonSegmentUtils.ts"() {
15410
+ "lib/lessonSegmentUtils.ts"() {
15377
15411
  }
15378
15412
  });
15379
15413
  var BLOOM_CONFIG, BloomQuizBlock;
@@ -14369,6 +14369,19 @@ var init_EmptyState = __esm({
14369
14369
  EmptyState.displayName = "EmptyState";
14370
14370
  }
14371
14371
  });
14372
+ function isLanguageRegistered(lang) {
14373
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
14374
+ }
14375
+ async function loadPrismLanguage(lang) {
14376
+ if (isLanguageRegistered(lang)) return;
14377
+ try {
14378
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
14379
+ if (grammar) SyntaxHighlighter.registerLanguage(lang, grammar);
14380
+ dynamicallyLoaded.add(lang);
14381
+ } catch {
14382
+ dynamicallyLoaded.add(lang);
14383
+ }
14384
+ }
14372
14385
  function computeFoldRegions(code) {
14373
14386
  const lines = code.split("\n");
14374
14387
  const regions = [];
@@ -14404,7 +14417,8 @@ function computeFoldRegions(code) {
14404
14417
  return regions.sort((a, b) => a.start - b.start);
14405
14418
  }
14406
14419
  function toCodeLanguage(value) {
14407
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
14420
+ if (!value) return "text";
14421
+ return value.toLowerCase();
14408
14422
  }
14409
14423
  function generateDiff(oldVal, newVal) {
14410
14424
  const oldLines = oldVal.split("\n");
@@ -14423,7 +14437,24 @@ function generateDiff(oldVal, newVal) {
14423
14437
  }
14424
14438
  return diff;
14425
14439
  }
14426
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14440
+ function useLanguageReady(language) {
14441
+ const [ready, setReady] = useState(() => isLanguageRegistered(language));
14442
+ useEffect(() => {
14443
+ if (isLanguageRegistered(language)) {
14444
+ if (!ready) setReady(true);
14445
+ return;
14446
+ }
14447
+ let active = true;
14448
+ loadPrismLanguage(language).then(() => {
14449
+ if (active) setReady(true);
14450
+ });
14451
+ return () => {
14452
+ active = false;
14453
+ };
14454
+ }, [language]);
14455
+ return ready;
14456
+ }
14457
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log7, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14427
14458
  var init_CodeBlock = __esm({
14428
14459
  "components/core/molecules/markdown/CodeBlock.tsx"() {
14429
14460
  init_cn();
@@ -14464,6 +14495,8 @@ var init_CodeBlock = __esm({
14464
14495
  SyntaxHighlighter.registerLanguage("graphql", langGraphql);
14465
14496
  SyntaxHighlighter.registerLanguage("orb", orbLanguage);
14466
14497
  SyntaxHighlighter.registerLanguage("lolo", loloLanguage);
14498
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
14499
+ codeLanguageLoader = null;
14467
14500
  orbStyleOverrides = {
14468
14501
  "orb-binding": { color: ORB_COLORS.dark.binding, fontWeight: "bold" },
14469
14502
  "orb-effect": { color: ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -14579,6 +14612,7 @@ var init_CodeBlock = __esm({
14579
14612
  const isOrb = language === "orb";
14580
14613
  const isLolo = language === "lolo";
14581
14614
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
14615
+ const languageReady = useLanguageReady(language);
14582
14616
  const eventBus = useEventBus();
14583
14617
  const { t } = useTranslate();
14584
14618
  const scrollRef = useRef(null);
@@ -14702,7 +14736,7 @@ var init_CodeBlock = __esm({
14702
14736
  children: code
14703
14737
  }
14704
14738
  ),
14705
- [code, language, activeStyle]
14739
+ [code, language, activeStyle, languageReady]
14706
14740
  );
14707
14741
  useLayoutEffect(() => {
14708
14742
  const container = codeRef.current;
@@ -15302,10 +15336,10 @@ var init_MarkdownContent = __esm({
15302
15336
  }
15303
15337
  });
15304
15338
 
15305
- // components/core/molecules/lessonSegmentUtils.ts
15339
+ // lib/lessonSegmentUtils.ts
15306
15340
  function parseMarkdownWithCodeBlocks(content) {
15307
15341
  const segments = [];
15308
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
15342
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
15309
15343
  let lastIndex = 0;
15310
15344
  let match;
15311
15345
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -15313,12 +15347,12 @@ function parseMarkdownWithCodeBlocks(content) {
15313
15347
  if (before.trim()) {
15314
15348
  segments.push({ type: "markdown", content: before });
15315
15349
  }
15316
- const rawLanguage = match[1] ?? "text";
15317
- const runModifier = !!match[2];
15350
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
15351
+ let rawLanguage = tokens[0] ?? "text";
15318
15352
  const suffixRunnable = rawLanguage.endsWith("-runnable");
15319
- const runnable = runModifier || suffixRunnable;
15353
+ const runnable = suffixRunnable || tokens.includes("run");
15320
15354
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
15321
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
15355
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
15322
15356
  lastIndex = codeBlockRegex.lastIndex;
15323
15357
  }
15324
15358
  const remaining = content.slice(lastIndex);
@@ -15328,7 +15362,7 @@ function parseMarkdownWithCodeBlocks(content) {
15328
15362
  return segments;
15329
15363
  }
15330
15364
  var init_lessonSegmentUtils = __esm({
15331
- "components/core/molecules/lessonSegmentUtils.ts"() {
15365
+ "lib/lessonSegmentUtils.ts"() {
15332
15366
  }
15333
15367
  });
15334
15368
  var BLOOM_CONFIG, BloomQuizBlock;
@@ -14099,6 +14099,19 @@ var init_EmptyState = __esm({
14099
14099
  EmptyState.displayName = "EmptyState";
14100
14100
  }
14101
14101
  });
14102
+ function isLanguageRegistered(lang) {
14103
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
14104
+ }
14105
+ async function loadPrismLanguage(lang) {
14106
+ if (isLanguageRegistered(lang)) return;
14107
+ try {
14108
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
14109
+ if (grammar) SyntaxHighlighter__default.default.registerLanguage(lang, grammar);
14110
+ dynamicallyLoaded.add(lang);
14111
+ } catch {
14112
+ dynamicallyLoaded.add(lang);
14113
+ }
14114
+ }
14102
14115
  function computeFoldRegions(code) {
14103
14116
  const lines = code.split("\n");
14104
14117
  const regions = [];
@@ -14134,7 +14147,8 @@ function computeFoldRegions(code) {
14134
14147
  return regions.sort((a, b) => a.start - b.start);
14135
14148
  }
14136
14149
  function toCodeLanguage(value) {
14137
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
14150
+ if (!value) return "text";
14151
+ return value.toLowerCase();
14138
14152
  }
14139
14153
  function generateDiff(oldVal, newVal) {
14140
14154
  const oldLines = oldVal.split("\n");
@@ -14153,7 +14167,24 @@ function generateDiff(oldVal, newVal) {
14153
14167
  }
14154
14168
  return diff;
14155
14169
  }
14156
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14170
+ function useLanguageReady(language) {
14171
+ const [ready, setReady] = React82.useState(() => isLanguageRegistered(language));
14172
+ React82.useEffect(() => {
14173
+ if (isLanguageRegistered(language)) {
14174
+ if (!ready) setReady(true);
14175
+ return;
14176
+ }
14177
+ let active = true;
14178
+ loadPrismLanguage(language).then(() => {
14179
+ if (active) setReady(true);
14180
+ });
14181
+ return () => {
14182
+ active = false;
14183
+ };
14184
+ }, [language]);
14185
+ return ready;
14186
+ }
14187
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14157
14188
  var init_CodeBlock = __esm({
14158
14189
  "components/core/molecules/markdown/CodeBlock.tsx"() {
14159
14190
  init_cn();
@@ -14194,6 +14225,8 @@ var init_CodeBlock = __esm({
14194
14225
  SyntaxHighlighter__default.default.registerLanguage("graphql", langGraphql__default.default);
14195
14226
  SyntaxHighlighter__default.default.registerLanguage("orb", syntax.orbLanguage);
14196
14227
  SyntaxHighlighter__default.default.registerLanguage("lolo", syntax.loloLanguage);
14228
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
14229
+ codeLanguageLoader = null;
14197
14230
  orbStyleOverrides = {
14198
14231
  "orb-binding": { color: syntax.ORB_COLORS.dark.binding, fontWeight: "bold" },
14199
14232
  "orb-effect": { color: syntax.ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -14309,6 +14342,7 @@ var init_CodeBlock = __esm({
14309
14342
  const isOrb = language === "orb";
14310
14343
  const isLolo = language === "lolo";
14311
14344
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark__default.default;
14345
+ const languageReady = useLanguageReady(language);
14312
14346
  const eventBus = useEventBus();
14313
14347
  const { t } = hooks.useTranslate();
14314
14348
  const scrollRef = React82.useRef(null);
@@ -14432,7 +14466,7 @@ var init_CodeBlock = __esm({
14432
14466
  children: code
14433
14467
  }
14434
14468
  ),
14435
- [code, language, activeStyle]
14469
+ [code, language, activeStyle, languageReady]
14436
14470
  );
14437
14471
  React82.useLayoutEffect(() => {
14438
14472
  const container = codeRef.current;
@@ -15032,10 +15066,10 @@ var init_MarkdownContent = __esm({
15032
15066
  }
15033
15067
  });
15034
15068
 
15035
- // components/core/molecules/lessonSegmentUtils.ts
15069
+ // lib/lessonSegmentUtils.ts
15036
15070
  function parseMarkdownWithCodeBlocks(content) {
15037
15071
  const segments = [];
15038
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
15072
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
15039
15073
  let lastIndex = 0;
15040
15074
  let match;
15041
15075
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -15043,12 +15077,12 @@ function parseMarkdownWithCodeBlocks(content) {
15043
15077
  if (before.trim()) {
15044
15078
  segments.push({ type: "markdown", content: before });
15045
15079
  }
15046
- const rawLanguage = match[1] ?? "text";
15047
- const runModifier = !!match[2];
15080
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
15081
+ let rawLanguage = tokens[0] ?? "text";
15048
15082
  const suffixRunnable = rawLanguage.endsWith("-runnable");
15049
- const runnable = runModifier || suffixRunnable;
15083
+ const runnable = suffixRunnable || tokens.includes("run");
15050
15084
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
15051
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
15085
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
15052
15086
  lastIndex = codeBlockRegex.lastIndex;
15053
15087
  }
15054
15088
  const remaining = content.slice(lastIndex);
@@ -15058,7 +15092,7 @@ function parseMarkdownWithCodeBlocks(content) {
15058
15092
  return segments;
15059
15093
  }
15060
15094
  var init_lessonSegmentUtils = __esm({
15061
- "components/core/molecules/lessonSegmentUtils.ts"() {
15095
+ "lib/lessonSegmentUtils.ts"() {
15062
15096
  }
15063
15097
  });
15064
15098
  var BLOOM_CONFIG, BloomQuizBlock;
@@ -14055,6 +14055,19 @@ var init_EmptyState = __esm({
14055
14055
  EmptyState.displayName = "EmptyState";
14056
14056
  }
14057
14057
  });
14058
+ function isLanguageRegistered(lang) {
14059
+ return CODE_LANGUAGE_SET.has(lang) || dynamicallyLoaded.has(lang);
14060
+ }
14061
+ async function loadPrismLanguage(lang) {
14062
+ if (isLanguageRegistered(lang)) return;
14063
+ try {
14064
+ const grammar = codeLanguageLoader ? await codeLanguageLoader(lang) : null;
14065
+ if (grammar) SyntaxHighlighter.registerLanguage(lang, grammar);
14066
+ dynamicallyLoaded.add(lang);
14067
+ } catch {
14068
+ dynamicallyLoaded.add(lang);
14069
+ }
14070
+ }
14058
14071
  function computeFoldRegions(code) {
14059
14072
  const lines = code.split("\n");
14060
14073
  const regions = [];
@@ -14090,7 +14103,8 @@ function computeFoldRegions(code) {
14090
14103
  return regions.sort((a, b) => a.start - b.start);
14091
14104
  }
14092
14105
  function toCodeLanguage(value) {
14093
- return value && CODE_LANGUAGE_SET.has(value) ? value : "text";
14106
+ if (!value) return "text";
14107
+ return value.toLowerCase();
14094
14108
  }
14095
14109
  function generateDiff(oldVal, newVal) {
14096
14110
  const oldLines = oldVal.split("\n");
@@ -14109,7 +14123,24 @@ function generateDiff(oldVal, newVal) {
14109
14123
  }
14110
14124
  return diff;
14111
14125
  }
14112
- var orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14126
+ function useLanguageReady(language) {
14127
+ const [ready, setReady] = useState(() => isLanguageRegistered(language));
14128
+ useEffect(() => {
14129
+ if (isLanguageRegistered(language)) {
14130
+ if (!ready) setReady(true);
14131
+ return;
14132
+ }
14133
+ let active = true;
14134
+ loadPrismLanguage(language).then(() => {
14135
+ if (active) setReady(true);
14136
+ });
14137
+ return () => {
14138
+ active = false;
14139
+ };
14140
+ }, [language]);
14141
+ return ready;
14142
+ }
14143
+ var dynamicallyLoaded, codeLanguageLoader, orbStyleOverrides, orbStyle, loloStyleOverrides, loloStyle, log6, CODE_LANGUAGES, CODE_LANGUAGE_SET, DIFF_STYLES, DIFF_STYLE_FALLBACK, LINE_PROPS_FN, HIDDEN_LINE_NUMBERS, CodeBlock;
14113
14144
  var init_CodeBlock = __esm({
14114
14145
  "components/core/molecules/markdown/CodeBlock.tsx"() {
14115
14146
  init_cn();
@@ -14150,6 +14181,8 @@ var init_CodeBlock = __esm({
14150
14181
  SyntaxHighlighter.registerLanguage("graphql", langGraphql);
14151
14182
  SyntaxHighlighter.registerLanguage("orb", orbLanguage);
14152
14183
  SyntaxHighlighter.registerLanguage("lolo", loloLanguage);
14184
+ dynamicallyLoaded = /* @__PURE__ */ new Set();
14185
+ codeLanguageLoader = null;
14153
14186
  orbStyleOverrides = {
14154
14187
  "orb-binding": { color: ORB_COLORS.dark.binding, fontWeight: "bold" },
14155
14188
  "orb-effect": { color: ORB_COLORS.dark.effect, fontWeight: "bold" },
@@ -14265,6 +14298,7 @@ var init_CodeBlock = __esm({
14265
14298
  const isOrb = language === "orb";
14266
14299
  const isLolo = language === "lolo";
14267
14300
  const activeStyle = isOrb ? orbStyle : isLolo ? loloStyle : dark;
14301
+ const languageReady = useLanguageReady(language);
14268
14302
  const eventBus = useEventBus();
14269
14303
  const { t } = useTranslate();
14270
14304
  const scrollRef = useRef(null);
@@ -14388,7 +14422,7 @@ var init_CodeBlock = __esm({
14388
14422
  children: code
14389
14423
  }
14390
14424
  ),
14391
- [code, language, activeStyle]
14425
+ [code, language, activeStyle, languageReady]
14392
14426
  );
14393
14427
  useLayoutEffect(() => {
14394
14428
  const container = codeRef.current;
@@ -14988,10 +15022,10 @@ var init_MarkdownContent = __esm({
14988
15022
  }
14989
15023
  });
14990
15024
 
14991
- // components/core/molecules/lessonSegmentUtils.ts
15025
+ // lib/lessonSegmentUtils.ts
14992
15026
  function parseMarkdownWithCodeBlocks(content) {
14993
15027
  const segments = [];
14994
- const codeBlockRegex = /```([\w-]+)?(?:\s+(run))?\n([\s\S]*?)```/g;
15028
+ const codeBlockRegex = /```([^\n\r]*)\r?\n([\s\S]*?)```/g;
14995
15029
  let lastIndex = 0;
14996
15030
  let match;
14997
15031
  while ((match = codeBlockRegex.exec(content)) !== null) {
@@ -14999,12 +15033,12 @@ function parseMarkdownWithCodeBlocks(content) {
14999
15033
  if (before.trim()) {
15000
15034
  segments.push({ type: "markdown", content: before });
15001
15035
  }
15002
- const rawLanguage = match[1] ?? "text";
15003
- const runModifier = !!match[2];
15036
+ const tokens = match[1].trim().split(/\s+/).filter(Boolean);
15037
+ let rawLanguage = tokens[0] ?? "text";
15004
15038
  const suffixRunnable = rawLanguage.endsWith("-runnable");
15005
- const runnable = runModifier || suffixRunnable;
15039
+ const runnable = suffixRunnable || tokens.includes("run");
15006
15040
  const baseLanguage = suffixRunnable ? rawLanguage.slice(0, -"-runnable".length) || "text" : rawLanguage;
15007
- segments.push({ type: "code", language: baseLanguage, content: match[3].trim(), runnable });
15041
+ segments.push({ type: "code", language: baseLanguage, content: match[2].trim(), runnable });
15008
15042
  lastIndex = codeBlockRegex.lastIndex;
15009
15043
  }
15010
15044
  const remaining = content.slice(lastIndex);
@@ -15014,7 +15048,7 @@ function parseMarkdownWithCodeBlocks(content) {
15014
15048
  return segments;
15015
15049
  }
15016
15050
  var init_lessonSegmentUtils = __esm({
15017
- "components/core/molecules/lessonSegmentUtils.ts"() {
15051
+ "lib/lessonSegmentUtils.ts"() {
15018
15052
  }
15019
15053
  });
15020
15054
  var BLOOM_CONFIG, BloomQuizBlock;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.122.11",
3
+ "version": "5.122.12",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [