themed-markdown 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -230,7 +230,29 @@ function resetFontScale(theme2) {
230
230
  return scaleThemeFonts(theme2, 1);
231
231
  }
232
232
 
233
- // industryMarkdown/utils/markdownUtils.ts
233
+ // node_modules/@a24z/markdown-utils/dist/index.mjs
234
+ var CHUNK_TYPES = {
235
+ MARKDOWN: "markdown_chunk",
236
+ MERMAID: "mermaid_chunk",
237
+ SLIDE: "slide_chunk",
238
+ CODE: "code_chunk"
239
+ };
240
+ var MarkdownPresentationFormat;
241
+ ((MarkdownPresentationFormat2) => {
242
+ MarkdownPresentationFormat2["HORIZONTAL_RULE"] = "horizontal_rule";
243
+ MarkdownPresentationFormat2["HEADER"] = "header";
244
+ MarkdownPresentationFormat2["FULL_CONTENT"] = "full_content";
245
+ })(MarkdownPresentationFormat ||= {});
246
+ var MarkdownSourceType;
247
+ ((MarkdownSourceType2) => {
248
+ MarkdownSourceType2["WORKSPACE_FILE"] = "workspace_file";
249
+ MarkdownSourceType2["REMOTE_FILE"] = "remote_file";
250
+ MarkdownSourceType2["GITHUB_FILE"] = "github_file";
251
+ MarkdownSourceType2["DRAFT"] = "draft";
252
+ MarkdownSourceType2["GITHUB_ISSUE"] = "github_issue";
253
+ MarkdownSourceType2["GITHUB_PULL_REQUEST"] = "github_pull_request";
254
+ MarkdownSourceType2["GITHUB_GIST"] = "github_gist";
255
+ })(MarkdownSourceType ||= {});
234
256
  function hashMarkdownString(str) {
235
257
  let hash = 0;
236
258
  for (let i = 0;i < str.length; i++) {
@@ -240,10 +262,10 @@ function hashMarkdownString(str) {
240
262
  }
241
263
  return Math.abs(hash).toString(36);
242
264
  }
243
- function parseMarkdownChunks(markdownContent, idPrefix) {
265
+ function parseMarkdownChunks(markdownContent, idPrefix, customParsers) {
244
266
  try {
245
267
  if (typeof markdownContent !== "string") {
246
- throw new Error("Invalid markdown content provided for slide");
268
+ throw new Error("Invalid markdown content provided");
247
269
  }
248
270
  if (!markdownContent || markdownContent.trim() === "") {
249
271
  return [];
@@ -259,18 +281,18 @@ function parseMarkdownChunks(markdownContent, idPrefix) {
259
281
  const mdContent = markdownContent.substring(lastIndex, match.index);
260
282
  if (mdContent.trim()) {
261
283
  chunks.push({
262
- type: "markdown_chunk",
284
+ type: CHUNK_TYPES.MARKDOWN,
263
285
  content: mdContent,
264
286
  id: `${idPrefix}-md-${partCounter}-${hashMarkdownString(mdContent)}`
265
287
  });
266
288
  }
267
289
  }
268
290
  partCounter++;
269
- const mermaidCode = match[1].trim();
291
+ const mermaidContent = match[1].trim();
270
292
  chunks.push({
271
- type: "mermaid_chunk",
272
- code: mermaidCode,
273
- id: `${idPrefix}-mermaid-${partCounter}-${hashMarkdownString(mermaidCode)}`
293
+ type: CHUNK_TYPES.MERMAID,
294
+ content: mermaidContent,
295
+ id: `${idPrefix}-mermaid-${partCounter}-${hashMarkdownString(mermaidContent)}`
274
296
  });
275
297
  lastIndex = match.index + match[0].length;
276
298
  }
@@ -279,7 +301,7 @@ function parseMarkdownChunks(markdownContent, idPrefix) {
279
301
  const remainingMdContent = markdownContent.substring(lastIndex);
280
302
  if (remainingMdContent.trim()) {
281
303
  chunks.push({
282
- type: "markdown_chunk",
304
+ type: CHUNK_TYPES.MARKDOWN,
283
305
  content: remainingMdContent,
284
306
  id: `${idPrefix}-md-${partCounter}-${hashMarkdownString(remainingMdContent)}`
285
307
  });
@@ -287,23 +309,280 @@ function parseMarkdownChunks(markdownContent, idPrefix) {
287
309
  }
288
310
  if (chunks.length === 0 && markdownContent.trim()) {
289
311
  chunks.push({
290
- type: "markdown_chunk",
312
+ type: CHUNK_TYPES.MARKDOWN,
291
313
  content: markdownContent,
292
314
  id: `${idPrefix}-md-only-${hashMarkdownString(markdownContent)}`
293
315
  });
294
316
  }
317
+ if (customParsers && customParsers.length > 0) {
318
+ let processedChunks = chunks;
319
+ for (const parser of customParsers) {
320
+ const newChunks = [];
321
+ for (const chunk of processedChunks) {
322
+ if (chunk.type === CHUNK_TYPES.MARKDOWN) {
323
+ const parsed = parser(chunk.content, chunk.id);
324
+ if (parsed.length > 0) {
325
+ newChunks.push(...parsed);
326
+ } else {
327
+ newChunks.push(chunk);
328
+ }
329
+ } else {
330
+ newChunks.push(chunk);
331
+ }
332
+ }
333
+ processedChunks = newChunks;
334
+ }
335
+ return processedChunks;
336
+ }
295
337
  return chunks;
296
338
  } catch (error) {
297
339
  console.error("Error in parseMarkdownChunks:", error);
298
340
  return markdownContent ? [
299
341
  {
300
- type: "markdown_chunk",
342
+ type: CHUNK_TYPES.MARKDOWN,
301
343
  content: markdownContent,
302
344
  id: `${idPrefix}-md-error-fallback-${hashMarkdownString(markdownContent)}`
303
345
  }
304
346
  ] : [];
305
347
  }
306
348
  }
349
+ function hashMarkdownString2(str) {
350
+ let hash = 0;
351
+ for (let i = 0;i < str.length; i++) {
352
+ const char = str.charCodeAt(i);
353
+ hash = (hash << 5) - hash + char;
354
+ hash = hash & hash;
355
+ }
356
+ return Math.abs(hash).toString(36);
357
+ }
358
+ function extractSlideTitle(content) {
359
+ const lines = content.split(`
360
+ `).filter((line) => line.trim());
361
+ for (const line of lines) {
362
+ const headingMatch = line.match(/^#+\s+(.+)$/);
363
+ if (headingMatch) {
364
+ return headingMatch[1].trim();
365
+ }
366
+ }
367
+ if (lines.length > 0) {
368
+ const firstLine = lines[0];
369
+ return firstLine.length > 50 ? firstLine.substring(0, 47) + "..." : firstLine;
370
+ }
371
+ return "Untitled Slide";
372
+ }
373
+ function parseMarkdownIntoPresentation(markdownContent, format, repositoryInfo, customParsers) {
374
+ const detectedFormat = format || detectPresentationFormat(markdownContent);
375
+ if (detectedFormat === "full_content") {
376
+ const id = `slide-0-${hashMarkdownString2(markdownContent)}`;
377
+ const chunks = parseMarkdownChunks(markdownContent, id, customParsers);
378
+ return {
379
+ slides: [
380
+ {
381
+ id,
382
+ title: extractSlideTitle(markdownContent),
383
+ location: {
384
+ startLine: 0,
385
+ endLine: markdownContent.split(`
386
+ `).length - 1,
387
+ content: markdownContent,
388
+ type: detectedFormat
389
+ },
390
+ chunks
391
+ }
392
+ ],
393
+ originalContent: markdownContent,
394
+ format: detectedFormat,
395
+ repositoryInfo
396
+ };
397
+ }
398
+ const lines = markdownContent.split(`
399
+ `);
400
+ const slides = [];
401
+ let currentSlideLines = [];
402
+ let currentSlideStartLine = 0;
403
+ for (let i = 0;i < lines.length; i++) {
404
+ const line = lines[i];
405
+ const isDelimiter = detectedFormat === "horizontal_rule" ? line.trim() === "---" : detectedFormat === "header" ? line.trim().startsWith("#") && !line.trim().startsWith("##") : false;
406
+ if (isDelimiter && currentSlideLines.length > 0) {
407
+ const slideContent = currentSlideLines.join(`
408
+ `);
409
+ const slideId = `slide-${slides.length}-${hashMarkdownString2(slideContent)}`;
410
+ const chunks = parseMarkdownChunks(slideContent, slideId, customParsers);
411
+ slides.push({
412
+ id: slideId,
413
+ title: extractSlideTitle(slideContent),
414
+ location: {
415
+ startLine: currentSlideStartLine,
416
+ endLine: i - 1,
417
+ content: slideContent,
418
+ type: detectedFormat
419
+ },
420
+ chunks
421
+ });
422
+ currentSlideLines = detectedFormat === "header" ? [line] : [];
423
+ currentSlideStartLine = i;
424
+ } else {
425
+ currentSlideLines.push(line);
426
+ }
427
+ }
428
+ if (currentSlideLines.length > 0) {
429
+ const slideContent = currentSlideLines.join(`
430
+ `);
431
+ const slideId = `slide-${slides.length}-${hashMarkdownString2(slideContent)}`;
432
+ const chunks = parseMarkdownChunks(slideContent, slideId, customParsers);
433
+ slides.push({
434
+ id: slideId,
435
+ title: extractSlideTitle(slideContent),
436
+ location: {
437
+ startLine: currentSlideStartLine,
438
+ endLine: lines.length - 1,
439
+ content: slideContent,
440
+ type: detectedFormat
441
+ },
442
+ chunks
443
+ });
444
+ }
445
+ return {
446
+ slides,
447
+ originalContent: markdownContent,
448
+ format: detectedFormat,
449
+ repositoryInfo
450
+ };
451
+ }
452
+ function detectPresentationFormat(markdownContent) {
453
+ const lines = markdownContent.split(`
454
+ `);
455
+ let hrCount = 0;
456
+ let h1Count = 0;
457
+ for (const line of lines) {
458
+ if (line.trim() === "---")
459
+ hrCount++;
460
+ if (line.trim().startsWith("#") && !line.trim().startsWith("##"))
461
+ h1Count++;
462
+ }
463
+ if (hrCount > 1) {
464
+ return "horizontal_rule";
465
+ }
466
+ if (h1Count > 1) {
467
+ return "header";
468
+ }
469
+ return "full_content";
470
+ }
471
+ function parseBashCommands(codeString) {
472
+ const lines = codeString.split(`
473
+ `);
474
+ const commands = [];
475
+ let currentCommand = "";
476
+ let commandStartLine = 0;
477
+ let currentDescription = "";
478
+ for (let i = 0;i < lines.length; i++) {
479
+ const line = lines[i].trim();
480
+ if (!line) {
481
+ if (currentCommand) {
482
+ commands.push({
483
+ command: currentCommand.trim(),
484
+ description: currentDescription || undefined,
485
+ line: commandStartLine + 1
486
+ });
487
+ currentCommand = "";
488
+ currentDescription = "";
489
+ }
490
+ continue;
491
+ }
492
+ if (line.startsWith("#")) {
493
+ if (!currentCommand) {
494
+ currentDescription = line.substring(1).trim();
495
+ }
496
+ continue;
497
+ }
498
+ if (line.endsWith("\\")) {
499
+ if (!currentCommand) {
500
+ commandStartLine = i;
501
+ }
502
+ currentCommand += line.slice(0, -1) + " ";
503
+ continue;
504
+ }
505
+ const isPipeContinuation = line.startsWith("|") || line.startsWith("&&") || line.startsWith("||");
506
+ const previousLineEndsWithOperator = currentCommand && (currentCommand.trim().endsWith("|") || currentCommand.trim().endsWith("&&") || currentCommand.trim().endsWith("||") || currentCommand.trim().endsWith(";"));
507
+ if (currentCommand && (isPipeContinuation || previousLineEndsWithOperator)) {
508
+ currentCommand += (currentCommand.endsWith(" ") ? "" : " ") + line;
509
+ continue;
510
+ }
511
+ if (currentCommand) {
512
+ commands.push({
513
+ command: currentCommand.trim(),
514
+ description: currentDescription || undefined,
515
+ line: commandStartLine + 1
516
+ });
517
+ currentDescription = "";
518
+ }
519
+ commandStartLine = i;
520
+ currentCommand = line;
521
+ }
522
+ if (currentCommand) {
523
+ commands.push({
524
+ command: currentCommand.trim(),
525
+ description: currentDescription || undefined,
526
+ line: commandStartLine + 1
527
+ });
528
+ }
529
+ return commands.filter((cmd) => cmd.command.length > 0);
530
+ }
531
+ function getCommandDisplayName(command, maxLength = 50) {
532
+ if (command.description) {
533
+ return command.description.length <= maxLength ? command.description : command.description.substring(0, maxLength - 3) + "...";
534
+ }
535
+ const cmdText = command.command;
536
+ if (cmdText.length <= maxLength) {
537
+ return cmdText;
538
+ }
539
+ return cmdText.substring(0, maxLength - 3) + "...";
540
+ }
541
+ function isRelativeUrl(url) {
542
+ if (url.startsWith("http://") || url.startsWith("https://")) {
543
+ return false;
544
+ }
545
+ if (url.startsWith("//")) {
546
+ return false;
547
+ }
548
+ if (url.startsWith("data:")) {
549
+ return false;
550
+ }
551
+ if (url.startsWith("blob:")) {
552
+ return false;
553
+ }
554
+ return true;
555
+ }
556
+ function transformImageUrl(src, repositoryInfo) {
557
+ if (!repositoryInfo || !isRelativeUrl(src)) {
558
+ return src;
559
+ }
560
+ const { owner, repo, branch = "main", basePath = "" } = repositoryInfo;
561
+ let fullPath;
562
+ if (src.startsWith("/")) {
563
+ fullPath = src.substring(1);
564
+ } else {
565
+ let cleanPath = src;
566
+ if (cleanPath.startsWith("./")) {
567
+ cleanPath = cleanPath.substring(2);
568
+ }
569
+ if (cleanPath.startsWith("../")) {
570
+ console.warn("Relative parent directory navigation in image URLs is not fully supported:", src);
571
+ cleanPath = cleanPath.replace(/^(\.\.\/)+/, "");
572
+ }
573
+ if (basePath) {
574
+ const cleanBasePath = basePath.replace(/^\/+|\/+$/g, "");
575
+ fullPath = `${cleanBasePath}/${cleanPath}`;
576
+ } else {
577
+ fullPath = cleanPath;
578
+ }
579
+ }
580
+ const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${fullPath}`;
581
+ return rawUrl;
582
+ }
583
+
584
+ // industryMarkdown/utils/markdownUtils.ts
585
+ var parseMarkdownChunks2 = parseMarkdownChunks;
307
586
 
308
587
  // industryMarkdown/components/IndustryHtmlModal.tsx
309
588
  import React2, { useState as useState2 } from "react";
@@ -886,78 +1165,6 @@ function IndustryLazyMermaidDiagram({
886
1165
  import { Copy, Monitor, FileText, Check } from "lucide-react";
887
1166
  import React7, { useMemo, useState as useState6, useRef as useRef4 } from "react";
888
1167
 
889
- // industryMarkdown/utils/bashCommandParser.ts
890
- function parseBashCommands(codeString) {
891
- const lines = codeString.split(`
892
- `);
893
- const commands = [];
894
- let currentCommand = "";
895
- let commandStartLine = 0;
896
- let currentDescription = "";
897
- for (let i = 0;i < lines.length; i++) {
898
- const line = lines[i].trim();
899
- if (!line) {
900
- if (currentCommand) {
901
- commands.push({
902
- command: currentCommand.trim(),
903
- description: currentDescription || undefined,
904
- line: commandStartLine + 1
905
- });
906
- currentCommand = "";
907
- currentDescription = "";
908
- }
909
- continue;
910
- }
911
- if (line.startsWith("#")) {
912
- if (!currentCommand) {
913
- currentDescription = line.substring(1).trim();
914
- }
915
- continue;
916
- }
917
- if (line.endsWith("\\")) {
918
- if (!currentCommand) {
919
- commandStartLine = i;
920
- }
921
- currentCommand += line.slice(0, -1) + " ";
922
- continue;
923
- }
924
- const isPipeContinuation = line.startsWith("|") || line.startsWith("&&") || line.startsWith("||");
925
- const previousLineEndsWithOperator = currentCommand && (currentCommand.trim().endsWith("|") || currentCommand.trim().endsWith("&&") || currentCommand.trim().endsWith("||") || currentCommand.trim().endsWith(";"));
926
- if (currentCommand && (isPipeContinuation || previousLineEndsWithOperator)) {
927
- currentCommand += (currentCommand.endsWith(" ") ? "" : " ") + line;
928
- continue;
929
- }
930
- if (currentCommand) {
931
- commands.push({
932
- command: currentCommand.trim(),
933
- description: currentDescription || undefined,
934
- line: commandStartLine + 1
935
- });
936
- currentDescription = "";
937
- }
938
- commandStartLine = i;
939
- currentCommand = line;
940
- }
941
- if (currentCommand) {
942
- commands.push({
943
- command: currentCommand.trim(),
944
- description: currentDescription || undefined,
945
- line: commandStartLine + 1
946
- });
947
- }
948
- return commands.filter((cmd) => cmd.command.length > 0);
949
- }
950
- function getCommandDisplayName(command, maxLength = 50) {
951
- if (command.description) {
952
- return command.description.length <= maxLength ? command.description : command.description.substring(0, maxLength - 3) + "...";
953
- }
954
- const cmdText = command.command;
955
- if (cmdText.length <= maxLength) {
956
- return cmdText;
957
- }
958
- return cmdText.substring(0, maxLength - 3) + "...";
959
- }
960
-
961
1168
  // industryMarkdown/utils/componentUtils.tsx
962
1169
  import React5 from "react";
963
1170
  var extractTextFromChildren = (children) => {
@@ -990,51 +1197,6 @@ var LinkWithLoadingIndicator = ({ href, children, onClick, className }) => {
990
1197
  rel: "noopener noreferrer"
991
1198
  }, children);
992
1199
  };
993
-
994
- // industryMarkdown/utils/imageUrlUtils.ts
995
- function isRelativeUrl(url) {
996
- if (url.startsWith("http://") || url.startsWith("https://")) {
997
- return false;
998
- }
999
- if (url.startsWith("//")) {
1000
- return false;
1001
- }
1002
- if (url.startsWith("data:")) {
1003
- return false;
1004
- }
1005
- if (url.startsWith("blob:")) {
1006
- return false;
1007
- }
1008
- return true;
1009
- }
1010
- function transformImageUrl(src, repositoryInfo) {
1011
- if (!repositoryInfo || !isRelativeUrl(src)) {
1012
- return src;
1013
- }
1014
- const { owner, repo, branch = "main", basePath = "" } = repositoryInfo;
1015
- let fullPath;
1016
- if (src.startsWith("/")) {
1017
- fullPath = src.substring(1);
1018
- } else {
1019
- let cleanPath = src;
1020
- if (cleanPath.startsWith("./")) {
1021
- cleanPath = cleanPath.substring(2);
1022
- }
1023
- if (cleanPath.startsWith("../")) {
1024
- console.warn("Relative parent directory navigation in image URLs is not fully supported:", src);
1025
- cleanPath = cleanPath.replace(/^(\.\.\/)+/, "");
1026
- }
1027
- if (basePath) {
1028
- const cleanBasePath = basePath.replace(/^\/+|\/+$/g, "");
1029
- fullPath = `${cleanBasePath}/${cleanPath}`;
1030
- } else {
1031
- fullPath = cleanPath;
1032
- }
1033
- }
1034
- const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${fullPath}`;
1035
- return rawUrl;
1036
- }
1037
-
1038
1200
  // industryMarkdown/components/IndustryBashCommandDropdown.tsx
1039
1201
  import { Play, ChevronDown } from "lucide-react";
1040
1202
  import React6, { useState as useState5, useRef as useRef3, useEffect as useEffect4 } from "react";
@@ -2389,7 +2551,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
2389
2551
  let chunks = [];
2390
2552
  try {
2391
2553
  if (typeof content === "string") {
2392
- chunks = parseMarkdownChunks(content, slideIdPrefix);
2554
+ chunks = parseMarkdownChunks2(content, slideIdPrefix);
2393
2555
  } else {}
2394
2556
  } catch (error) {
2395
2557
  console.error("Error parsing markdown chunks:", error);
@@ -2771,7 +2933,7 @@ var IndustryMarkdownSlide = React11.memo(function IndustryMarkdownSlide2({
2771
2933
  if (chunk.type === "mermaid_chunk") {
2772
2934
  const mermaidProps = {
2773
2935
  id: chunk.id,
2774
- code: chunk.code,
2936
+ code: chunk.content,
2775
2937
  onCopyError: onCopyMermaidError,
2776
2938
  rootMargin,
2777
2939
  theme: theme2
@@ -2809,7 +2971,7 @@ import { ChevronLeft, ChevronRight, Maximize2, Minimize2, Menu, X } from "lucide
2809
2971
  import React12, { useState as useState10, useCallback as useCallback2, useRef as useRef8, useEffect as useEffect8 } from "react";
2810
2972
 
2811
2973
  // industryMarkdown/utils/extractSlideTitles.ts
2812
- function extractSlideTitle(content, slideIndex) {
2974
+ function extractSlideTitle2(content, slideIndex) {
2813
2975
  const lines = content.split(`
2814
2976
  `);
2815
2977
  for (const line of lines) {
@@ -2824,7 +2986,7 @@ function extractSlideTitle(content, slideIndex) {
2824
2986
  return `Slide ${slideIndex + 1}`;
2825
2987
  }
2826
2988
  function extractAllSlideTitles(slides) {
2827
- return slides.map((slide, index) => extractSlideTitle(slide, index));
2989
+ return slides.map((slide, index) => extractSlideTitle2(slide, index));
2828
2990
  }
2829
2991
 
2830
2992
  // industryMarkdown/components/SlidePresentation.tsx
@@ -3676,161 +3838,32 @@ var IndustryEditableMarkdownSlide = ({
3676
3838
  }));
3677
3839
  };
3678
3840
  // industryMarkdown/utils/presentationUtils.ts
3679
- function hashMarkdownString2(str) {
3680
- let hash = 0;
3681
- for (let i = 0;i < str.length; i++) {
3682
- const char = str.charCodeAt(i);
3683
- hash = (hash << 5) - hash + char;
3684
- hash = hash & hash;
3685
- }
3686
- return Math.abs(hash).toString(36);
3687
- }
3688
- function extractSlideTitle2(content) {
3689
- const lines = content.split(`
3690
- `).filter((line) => line.trim());
3691
- for (const line of lines) {
3692
- const headingMatch = line.match(/^#+\s+(.+)$/);
3693
- if (headingMatch) {
3694
- return headingMatch[1].trim();
3695
- }
3696
- }
3697
- if (lines.length > 0) {
3698
- const firstLine = lines[0];
3699
- return firstLine.length > 50 ? firstLine.substring(0, 47) + "..." : firstLine;
3700
- }
3701
- return "Untitled Slide";
3702
- }
3841
+ var extractSlideTitle3 = extractSlideTitle;
3703
3842
  function parseMarkdownIntoPresentationFromSource(source) {
3704
3843
  let presentation;
3705
3844
  switch (source.type) {
3706
- case "workspace_file" /* WORKSPACE_FILE */:
3707
- case "github_file" /* GITHUB_FILE */:
3708
- case "draft" /* DRAFT */:
3709
- presentation = parseMarkdownIntoPresentation(source.content);
3845
+ case MarkdownSourceType.WORKSPACE_FILE:
3846
+ case MarkdownSourceType.GITHUB_FILE:
3847
+ case MarkdownSourceType.DRAFT:
3848
+ presentation = parseMarkdownIntoPresentation2(source.content, undefined, source.repositoryInfo);
3710
3849
  break;
3711
3850
  default:
3712
3851
  throw new Error(`Unsupported source type: ${source.type}`);
3713
3852
  }
3714
3853
  presentation.source = source;
3715
- presentation.repositoryInfo = source.repositoryInfo;
3716
3854
  return presentation;
3717
3855
  }
3718
3856
  function createGithubFileSource(content, repositoryInfo) {
3719
3857
  return {
3720
- type: "github_file" /* GITHUB_FILE */,
3858
+ type: MarkdownSourceType.GITHUB_FILE,
3721
3859
  content,
3722
3860
  repositoryInfo,
3723
3861
  editable: false,
3724
3862
  deletable: false
3725
3863
  };
3726
3864
  }
3727
- function parseMarkdownIntoPresentation(markdownContent) {
3728
- try {
3729
- if (typeof markdownContent !== "string") {
3730
- console.error("Invalid markdown content provided - not a string");
3731
- return {
3732
- slides: [],
3733
- originalContent: "",
3734
- format: "full_content" /* FULL_CONTENT */
3735
- };
3736
- }
3737
- if (!markdownContent || markdownContent.trim() === "") {
3738
- return {
3739
- slides: [],
3740
- originalContent: "",
3741
- format: "full_content" /* FULL_CONTENT */
3742
- };
3743
- }
3744
- const slides = [];
3745
- let format = "full_content" /* FULL_CONTENT */;
3746
- let slideCounter = 0;
3747
- const headerMatches = Array.from(markdownContent.matchAll(/^(##\s+.*$)/gm));
3748
- if (headerMatches.length > 0) {
3749
- format = "header" /* HEADER */;
3750
- const firstHeaderStart = headerMatches[0].index;
3751
- const firstContent = markdownContent.substring(0, firstHeaderStart).trim();
3752
- if (firstContent) {
3753
- slideCounter++;
3754
- slides.push({
3755
- id: `slide-${slideCounter}-${hashMarkdownString2(firstContent)}`,
3756
- title: extractSlideTitle2(firstContent),
3757
- location: {
3758
- startLine: 1,
3759
- endLine: firstContent.split(`
3760
- `).length,
3761
- content: firstContent,
3762
- type: "header" /* HEADER */
3763
- },
3764
- chunks: parseMarkdownChunks(firstContent, `slide-${slideCounter}`)
3765
- });
3766
- }
3767
- for (let i = 0;i < headerMatches.length; i++) {
3768
- const headerMatch = headerMatches[i];
3769
- const startIndex = headerMatch.index;
3770
- const endIndex = i < headerMatches.length - 1 ? headerMatches[i + 1].index : markdownContent.length;
3771
- const content = markdownContent.substring(startIndex, endIndex).trim();
3772
- if (content) {
3773
- slideCounter++;
3774
- const startLine = markdownContent.substring(0, startIndex).split(`
3775
- `).length;
3776
- const endLine = startLine + content.split(`
3777
- `).length - 1;
3778
- slides.push({
3779
- id: `slide-${slideCounter}-${hashMarkdownString2(content)}`,
3780
- title: extractSlideTitle2(content),
3781
- location: {
3782
- startLine,
3783
- endLine,
3784
- content,
3785
- type: "header" /* HEADER */
3786
- },
3787
- chunks: parseMarkdownChunks(content, `slide-${slideCounter}`)
3788
- });
3789
- }
3790
- }
3791
- } else if (markdownContent.trim()) {
3792
- slideCounter++;
3793
- const trimmedContent = markdownContent.trim();
3794
- slides.push({
3795
- id: `slide-${slideCounter}-${hashMarkdownString2(trimmedContent)}`,
3796
- title: extractSlideTitle2(trimmedContent),
3797
- location: {
3798
- startLine: 1,
3799
- endLine: markdownContent.split(`
3800
- `).length,
3801
- content: trimmedContent,
3802
- type: "full_content" /* FULL_CONTENT */
3803
- },
3804
- chunks: parseMarkdownChunks(trimmedContent, `slide-${slideCounter}`)
3805
- });
3806
- }
3807
- return {
3808
- slides,
3809
- originalContent: markdownContent,
3810
- format
3811
- };
3812
- } catch (error) {
3813
- console.error("Error parsing markdown presentation:", error);
3814
- const content = markdownContent.trim();
3815
- return {
3816
- slides: content ? [
3817
- {
3818
- id: `slide-error-${hashMarkdownString2(content)}`,
3819
- title: extractSlideTitle2(content),
3820
- location: {
3821
- startLine: 1,
3822
- endLine: content.split(`
3823
- `).length,
3824
- content,
3825
- type: "full_content" /* FULL_CONTENT */
3826
- },
3827
- chunks: parseMarkdownChunks(content, "slide-error")
3828
- }
3829
- ] : [],
3830
- originalContent: markdownContent,
3831
- format: "full_content" /* FULL_CONTENT */
3832
- };
3833
- }
3865
+ function parseMarkdownIntoPresentation2(markdownContent, format, repositoryInfo) {
3866
+ return parseMarkdownIntoPresentation(markdownContent, format, repositoryInfo);
3834
3867
  }
3835
3868
  function createPresentationWithErrorMessage(errorMessage) {
3836
3869
  const errorMessageMarkdown = `# Error Loading Markdown:
@@ -3840,29 +3873,29 @@ ${errorMessage}`;
3840
3873
  slides: [
3841
3874
  {
3842
3875
  id: "error",
3843
- title: extractSlideTitle2(errorMessageMarkdown),
3876
+ title: extractSlideTitle3(errorMessageMarkdown),
3844
3877
  location: {
3845
3878
  startLine: 0,
3846
3879
  endLine: 0,
3847
3880
  content: errorMessageMarkdown,
3848
- type: "full_content" /* FULL_CONTENT */
3881
+ type: MarkdownPresentationFormat.FULL_CONTENT
3849
3882
  },
3850
3883
  chunks: parseMarkdownChunks(errorMessageMarkdown, "slide-error")
3851
3884
  }
3852
3885
  ],
3853
3886
  originalContent: errorMessageMarkdown,
3854
- format: "full_content" /* FULL_CONTENT */
3887
+ format: MarkdownPresentationFormat.FULL_CONTENT
3855
3888
  };
3856
3889
  }
3857
3890
  function reconstructMarkdownContent(presentation) {
3858
3891
  switch (presentation.format) {
3859
- case "horizontal_rule" /* HORIZONTAL_RULE */:
3892
+ case MarkdownPresentationFormat.HORIZONTAL_RULE:
3860
3893
  return presentation.slides.map((slide) => slide.location.content).join(`
3861
3894
 
3862
3895
  ---
3863
3896
 
3864
3897
  `);
3865
- case "header" /* HEADER */:
3898
+ case MarkdownPresentationFormat.HEADER:
3866
3899
  return presentation.slides.map((slide, index) => {
3867
3900
  if (index === 0 && !slide.location.content.startsWith("##")) {
3868
3901
  return slide.location.content;
@@ -3871,7 +3904,7 @@ function reconstructMarkdownContent(presentation) {
3871
3904
  }).join(`
3872
3905
 
3873
3906
  `);
3874
- case "full_content" /* FULL_CONTENT */:
3907
+ case MarkdownPresentationFormat.FULL_CONTENT:
3875
3908
  default:
3876
3909
  return presentation.slides[0]?.location.content || "";
3877
3910
  }
@@ -3901,7 +3934,7 @@ function updateSlideContent(slide, newContent) {
3901
3934
  ...slide.location,
3902
3935
  content: newContent
3903
3936
  },
3904
- title: extractSlideTitle2(newContent),
3937
+ title: extractSlideTitle3(newContent),
3905
3938
  chunks: parseMarkdownChunks(newContent, slide.id.split("-")[1] || "slide")
3906
3939
  };
3907
3940
  }
@@ -3931,13 +3964,13 @@ export {
3931
3964
  resetFontScale,
3932
3965
  reconstructMarkdownContent,
3933
3966
  parseMarkdownIntoPresentationFromSource,
3934
- parseMarkdownIntoPresentation,
3935
- parseMarkdownChunks,
3967
+ parseMarkdownIntoPresentation2 as parseMarkdownIntoPresentation,
3968
+ parseMarkdownChunks2 as parseMarkdownChunks,
3936
3969
  increaseFontScale,
3937
3970
  getAllSlideTitles,
3938
3971
  findSlideIndexByTitle,
3939
3972
  findSlideByTitle,
3940
- extractSlideTitle2 as extractSlideTitle,
3973
+ extractSlideTitle3 as extractSlideTitle,
3941
3974
  theme as defaultTheme,
3942
3975
  decreaseFontScale,
3943
3976
  createPresentationWithErrorMessage,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '../types/presentation';
2
+ import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '@a24z/markdown-utils';
3
3
  export interface DocumentViewProps {
4
4
  content: string | string[];
5
5
  showSegmented?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DocumentView.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/DocumentView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI9F,MAAM,WAAW,iBAAiB;IAEhC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAG3B,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtF,cAAc,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAGhD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IAGzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,C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AAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACrG,gBAAgB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0NpD,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '../../industryTheme';
3
- import { BashCommand } from '../utils/bashCommandParser';
3
+ import { BashCommand } from '@a24z/markdown-utils';
4
4
  interface IndustryBashCommandDropdownProps {
5
5
  commands: BashCommand[];
6
6
  allCommands: string;
@@ -1 +1 @@
1
- {"version":3,"file":"IndustryBashCommandDropdown.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryBashCommandDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAyB,MAAM,4BAA4B,CAAC;AAEhF,UAAU,gCAAgC;IACxC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAwMlF,CAAC"}
1
+ {"version":3,"file":"IndustryBashCommandDropdown.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryBashCommandDropdown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAY,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAyB,MAAM,sBAAsB,CAAC;AAE1E,UAAU,gCAAgC;IACxC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,EAAE,CAAC,gCAAgC,CAwMlF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { Theme } from '../../industryTheme';
3
3
  import { MarkdownComponentProps, HeadingProps, ListItemProps, LinkProps, ImageProps, CodeProps, SourceProps } from '../types/markdownComponents';
4
- import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '../types/presentation';
4
+ import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '@a24z/markdown-utils';
5
5
  interface IndustryMarkdownComponentsProps {
6
6
  theme: Theme;
7
7
  slideIdPrefix: string;
@@ -1 +1 @@
1
- {"version":3,"file":"IndustryMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryMarkdownComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,sBAA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B;iCAgBrB,sBAAsB;iCAgBtB,sBAAsB;iCAgBtB,aAAa;oCAuGV,sBAAsB;oCAsBtB,sBAAsB;iCAUzB,sBAAsB;iCActB,sBAAsB;sCAcjB,SAAS;kCAWb,UAAU;sCAWN,sBAAsB;2CAGjB,WAAW;oDAyBF,SAAS;CAwS5D,CAAC"}
1
+ {"version":3,"file":"IndustryMarkdownComponents.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryMarkdownComponents.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,aAAa,EACb,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EAEZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAqB,MAAM,sBAAsB,CAAC;AAMhH,UAAU,+BAA+B;IACvC,KAAK,EAAE,KAAK,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtF,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,eAAe,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/E,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,oBAAoB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/E,oBAAoB,CAAC,EAAE,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,KACzB,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAyFD;;;GAGG;AACH,eAAO,MAAM,gCAAgC,GAAI,uOAe9C,+BAA+B;iCAqBD,YAAY;iCAgBZ,YAAY;iCAiBZ,YAAY;gCAkBb,sBAAsB;iCAgBrB,sBAAsB;iCAgBtB,sBAAsB;iCAgBtB,aAAa;oCAuGV,sBAAsB;oCAsBtB,sBAAsB;iCAUzB,sBAAsB;iCActB,sBAAsB;sCAcjB,SAAS;kCAWb,UAAU;sCAWN,sBAAsB;2CAGjB,WAAW;oDAyBF,SAAS;CAwS5D,CAAC"}
@@ -61,7 +61,7 @@
61
61
  import React from 'react';
62
62
  import { Theme } from '../../industryTheme';
63
63
  import { KeyboardBinding } from '../types/keyboard';
64
- import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '../types/presentation';
64
+ import { BashCommandOptions, BashCommandResult, RepositoryInfo } from '@a24z/markdown-utils';
65
65
  export interface IndustryMarkdownSlideProps {
66
66
  content: string;
67
67
  slideIdPrefix: string;
@@ -1 +1 @@
1
- {"version":3,"file":"IndustryMarkdownSlide.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/IndustryMarkdownSlide.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AAGH,OAAO,KAA4D,MAAM,OAAO,CAAC;AAQjF,OAAO,EAAY,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,C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EAAE,oBAAoB,GAAG,eAAe,EAAE,CA8D7F;AAED,eAAO,MAAM,qBAAqB,wDAylBhC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { BashCommandOptions, BashCommandResult } from '../types/presentation';
2
+ import { BashCommandOptions, BashCommandResult } from '@a24z/markdown-utils';
3
3
  export interface SlidePresentationProps {
4
4
  slides: string[];
5
5
  initialSlide?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SlidePresentation.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/components/SlidePresentation.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAK9E,MAAM,WAAW,sBAAsB;IAErC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAGtF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACzD,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,iBAAiB,CAA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CAAC;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAgkB9D,CAAC"}
@@ -1,15 +1,2 @@
1
- import { RepositoryInfo } from '../types/presentation';
2
- /**
3
- * Determines if a URL is relative (not absolute)
4
- */
5
- export declare function isRelativeUrl(url: string): boolean;
6
- /**
7
- * Transforms a relative image URL to a GitHub raw URL
8
- */
9
- export declare function transformImageUrl(src: string, repositoryInfo?: RepositoryInfo): string;
10
- /**
11
- * Transforms image URLs in markdown content
12
- * This can be used to preprocess markdown content before rendering
13
- */
14
- export declare function transformMarkdownImageUrls(markdownContent: string, repositoryInfo?: RepositoryInfo): string;
1
+ export { isRelativeUrl, transformImageUrl, transformMarkdownImageUrls } from '@a24z/markdown-utils';
15
2
  //# sourceMappingURL=imageUrlUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"imageUrlUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/imageUrlUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAuBlD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,cAAc,GAAG,MAAM,CA8CtF;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,eAAe,EAAE,MAAM,EACvB,cAAc,CAAC,EAAE,cAAc,GAC9B,MAAM,CAeR"}
1
+ {"version":3,"file":"imageUrlUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/imageUrlUtils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC"}
@@ -1,6 +1,7 @@
1
- import { ContentChunk } from '../types/customMarkdownChunks';
1
+ import { parseMarkdownChunks as parseMarkdownChunksCore } from '@a24z/markdown-utils';
2
2
  /**
3
3
  * Parses markdown content within a slide into chunks (markdown and mermaid)
4
+ * Now uses the core library implementation
4
5
  */
5
- export declare function parseMarkdownChunks(markdownContent: string, idPrefix: string): ContentChunk[];
6
+ export declare const parseMarkdownChunks: typeof parseMarkdownChunksCore;
6
7
  //# sourceMappingURL=markdownUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdownUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/markdownUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAa7D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,YAAY,EAAE,CAuE7F"}
1
+ {"version":3,"file":"markdownUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/markdownUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEtF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gCAA0B,CAAC"}
@@ -1,15 +1,17 @@
1
- import { MarkdownPresentation, MarkdownSlide, MarkdownSource, RepositoryInfo } from '../types/presentation';
1
+ import { MarkdownPresentation, MarkdownSlide, MarkdownPresentationFormat, MarkdownSource, RepositoryInfo, extractSlideTitle as extractSlideTitleCore } from '@a24z/markdown-utils';
2
2
  /**
3
3
  * Extract the title from slide content (first heading or first line)
4
+ * Re-export from core library
4
5
  */
5
- export declare function extractSlideTitle(content: string): string;
6
+ export declare const extractSlideTitle: typeof extractSlideTitleCore;
6
7
  export declare function parseMarkdownIntoPresentationFromSource(source: MarkdownSource): MarkdownPresentation;
7
8
  export declare function createGithubFileSource(content: string, repositoryInfo: RepositoryInfo): MarkdownSource;
8
9
  /**
9
10
  * Enhanced version of markdown slide parsing that preserves location information
10
11
  * and returns a structured Presentation object
12
+ * Now uses the core library implementation
11
13
  */
12
- export declare function parseMarkdownIntoPresentation(markdownContent: string): MarkdownPresentation;
14
+ export declare function parseMarkdownIntoPresentation(markdownContent: string, format?: MarkdownPresentationFormat, repositoryInfo?: RepositoryInfo): MarkdownPresentation;
13
15
  /**
14
16
  *
15
17
  * @param errorMessage Depricated
@@ -1 +1 @@
1
- {"version":3,"file":"presentationUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/presentationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EAEb,cAAc,EAEd,cAAc,EACf,MAAM,uBAAuB,CAAC;AAe/B;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,cAAc,GACrB,oBAAoB,CAetB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,cAAc,GAC7B,cAAc,CAQhB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,MAAM,GAAG,oBAAoB,CAwH3F;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,YAAY,EAAE,MAAM,GAAG,oBAAoB,CAmB7F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAwBrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAE9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CAE3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAKtF;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAE1F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAU1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,oBAAoB,CActB"}
1
+ {"version":3,"file":"presentationUtils.d.ts","sourceRoot":"","sources":["../../../industryMarkdown/utils/presentationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,0BAA0B,EAC1B,cAAc,EAEd,cAAc,EAEd,iBAAiB,IAAI,qBAAqB,EAE3C,MAAM,sBAAsB,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,iBAAiB,8BAAwB,CAAC;AAEvD,wBAAgB,uCAAuC,CACrD,MAAM,EAAE,cAAc,GACrB,oBAAoB,CAatB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,cAAc,GAC7B,cAAc,CAQhB;AAED;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,0BAA0B,EACnC,cAAc,CAAC,EAAE,cAAc,GAC9B,oBAAoB,CAGtB;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,YAAY,EAAE,MAAM,GAAG,oBAAoB,CAmB7F;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAwBrF;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,EAAE,CAE9E;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,GACZ,aAAa,GAAG,SAAS,CAE3B;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/F;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAKtF;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,oBAAoB,GAAG,MAAM,CAE1F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,GAAG,aAAa,CAU1F;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,oBAAoB,EAClC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GACjB,oBAAoB,CActB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themed-markdown",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "Industry-themed markdown renderer with presentation capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -43,6 +43,7 @@
43
43
  "author": "PrincipleMD Team",
44
44
  "license": "MIT",
45
45
  "dependencies": {
46
+ "@a24z/markdown-utils": "^0.1.0",
46
47
  "@modelcontextprotocol/sdk": "^1.0.4",
47
48
  "@types/d3-hierarchy": "^3.1.7",
48
49
  "@types/flexsearch": "^0.7.6",