@almadar/ui 5.21.3 → 5.21.5

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.
@@ -15,10 +15,6 @@ var evaluator = require('@almadar/evaluator');
15
15
  var context = require('@almadar/ui/context');
16
16
  var reactRouterDom = require('react-router-dom');
17
17
  var ELK = require('elkjs/lib/elk.bundled.js');
18
- var ReactMarkdown = require('react-markdown');
19
- var remarkGfm = require('remark-gfm');
20
- var remarkMath = require('remark-math');
21
- var rehypeKatex = require('rehype-katex');
22
18
  var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism-light.js');
23
19
  var dark = require('react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js');
24
20
  var syntax = require('@almadar/syntax');
@@ -38,6 +34,10 @@ var langDiff = require('react-syntax-highlighter/dist/esm/languages/prism/diff.j
38
34
  var langToml = require('react-syntax-highlighter/dist/esm/languages/prism/toml.js');
39
35
  var langGo = require('react-syntax-highlighter/dist/esm/languages/prism/go.js');
40
36
  var langGraphql = require('react-syntax-highlighter/dist/esm/languages/prism/graphql.js');
37
+ var ReactMarkdown = require('react-markdown');
38
+ var remarkGfm = require('remark-gfm');
39
+ var remarkMath = require('remark-math');
40
+ var rehypeKatex = require('rehype-katex');
41
41
  var core = require('@almadar/core');
42
42
  var core$1 = require('@dnd-kit/core');
43
43
  var sortable = require('@dnd-kit/sortable');
@@ -71,10 +71,6 @@ var PhosphorIcons__namespace = /*#__PURE__*/_interopNamespace(PhosphorIcons);
71
71
  var TablerIcons__namespace = /*#__PURE__*/_interopNamespace(TablerIcons);
72
72
  var FaIcons__namespace = /*#__PURE__*/_interopNamespace(FaIcons);
73
73
  var ELK__default = /*#__PURE__*/_interopDefault(ELK);
74
- var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
75
- var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
76
- var remarkMath__default = /*#__PURE__*/_interopDefault(remarkMath);
77
- var rehypeKatex__default = /*#__PURE__*/_interopDefault(rehypeKatex);
78
74
  var SyntaxHighlighter__default = /*#__PURE__*/_interopDefault(SyntaxHighlighter);
79
75
  var dark__default = /*#__PURE__*/_interopDefault(dark);
80
76
  var langJson__default = /*#__PURE__*/_interopDefault(langJson);
@@ -93,6 +89,10 @@ var langDiff__default = /*#__PURE__*/_interopDefault(langDiff);
93
89
  var langToml__default = /*#__PURE__*/_interopDefault(langToml);
94
90
  var langGo__default = /*#__PURE__*/_interopDefault(langGo);
95
91
  var langGraphql__default = /*#__PURE__*/_interopDefault(langGraphql);
92
+ var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
93
+ var remarkGfm__default = /*#__PURE__*/_interopDefault(remarkGfm);
94
+ var remarkMath__default = /*#__PURE__*/_interopDefault(remarkMath);
95
+ var rehypeKatex__default = /*#__PURE__*/_interopDefault(rehypeKatex);
96
96
 
97
97
  var __defProp = Object.defineProperty;
98
98
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -13822,137 +13822,6 @@ var init_katex_min = __esm({
13822
13822
  "node_modules/katex/dist/katex.min.css"() {
13823
13823
  }
13824
13824
  });
13825
- var MarkdownContent;
13826
- var init_MarkdownContent = __esm({
13827
- "components/core/molecules/markdown/MarkdownContent.tsx"() {
13828
- init_katex_min();
13829
- init_Box();
13830
- init_useTranslate();
13831
- init_cn();
13832
- MarkdownContent = React85__namespace.default.memo(
13833
- ({ content, direction, className }) => {
13834
- const { t: _t } = useTranslate();
13835
- const safeContent = typeof content === "string" ? content : String(content ?? "");
13836
- return /* @__PURE__ */ jsxRuntime.jsx(
13837
- Box,
13838
- {
13839
- className: cn("prose max-w-none", className),
13840
- style: {
13841
- color: "var(--color-foreground)",
13842
- "--tw-prose-body": "var(--color-foreground)",
13843
- "--tw-prose-headings": "var(--color-foreground)",
13844
- "--tw-prose-lead": "var(--color-muted-foreground)",
13845
- "--tw-prose-links": "var(--color-primary)",
13846
- "--tw-prose-bold": "var(--color-foreground)",
13847
- "--tw-prose-counters": "var(--color-muted-foreground)",
13848
- "--tw-prose-bullets": "var(--color-muted-foreground)",
13849
- "--tw-prose-hr": "var(--color-border)",
13850
- "--tw-prose-quotes": "var(--color-foreground)",
13851
- "--tw-prose-quote-borders": "var(--color-primary)",
13852
- "--tw-prose-captions": "var(--color-muted-foreground)",
13853
- "--tw-prose-code": "var(--color-foreground)",
13854
- "--tw-prose-pre-code": "var(--color-foreground)",
13855
- "--tw-prose-pre-bg": "var(--color-muted)",
13856
- "--tw-prose-th-borders": "var(--color-border)",
13857
- "--tw-prose-td-borders": "var(--color-border)",
13858
- direction
13859
- },
13860
- children: /* @__PURE__ */ jsxRuntime.jsx(
13861
- ReactMarkdown__default.default,
13862
- {
13863
- remarkPlugins: [remarkMath__default.default, remarkGfm__default.default],
13864
- rehypePlugins: [
13865
- [rehypeKatex__default.default, { strict: false, throwOnError: false }]
13866
- ],
13867
- components: {
13868
- // Handle inline code only — fenced code blocks are parsed out separately
13869
- code({ className: codeClassName, children, ...props }) {
13870
- return /* @__PURE__ */ jsxRuntime.jsx(
13871
- "code",
13872
- {
13873
- ...props,
13874
- className: codeClassName,
13875
- style: {
13876
- backgroundColor: "var(--color-muted)",
13877
- color: "var(--color-foreground)",
13878
- border: "1px solid var(--color-border)",
13879
- padding: "0.125rem 0.375rem",
13880
- borderRadius: "0.25rem",
13881
- fontSize: "0.875em",
13882
- fontFamily: "ui-monospace, monospace"
13883
- },
13884
- children
13885
- }
13886
- );
13887
- },
13888
- // Style links
13889
- a({ href, children, ...props }) {
13890
- return /* @__PURE__ */ jsxRuntime.jsx(
13891
- "a",
13892
- {
13893
- href,
13894
- ...props,
13895
- className: "text-[var(--color-primary)] hover:underline",
13896
- target: href?.startsWith("http") ? "_blank" : void 0,
13897
- rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
13898
- children
13899
- }
13900
- );
13901
- },
13902
- // Style tables
13903
- table({ children, ...props }) {
13904
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsxRuntime.jsx(
13905
- "table",
13906
- {
13907
- ...props,
13908
- className: "min-w-full border-collapse border border-[var(--color-border)]",
13909
- children
13910
- }
13911
- ) });
13912
- },
13913
- th({ children, ...props }) {
13914
- return /* @__PURE__ */ jsxRuntime.jsx(
13915
- "th",
13916
- {
13917
- ...props,
13918
- className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
13919
- children
13920
- }
13921
- );
13922
- },
13923
- td({ children, ...props }) {
13924
- return /* @__PURE__ */ jsxRuntime.jsx(
13925
- "td",
13926
- {
13927
- ...props,
13928
- className: "border border-[var(--color-border)] px-4 py-2",
13929
- children
13930
- }
13931
- );
13932
- },
13933
- // Style blockquotes
13934
- blockquote({ children, ...props }) {
13935
- return /* @__PURE__ */ jsxRuntime.jsx(
13936
- "blockquote",
13937
- {
13938
- ...props,
13939
- className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
13940
- children
13941
- }
13942
- );
13943
- }
13944
- },
13945
- children: safeContent
13946
- }
13947
- )
13948
- }
13949
- );
13950
- },
13951
- (prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
13952
- );
13953
- MarkdownContent.displayName = "MarkdownContent";
13954
- }
13955
- });
13956
13825
  function computeFoldRegions(code) {
13957
13826
  const lines = code.split("\n");
13958
13827
  const regions = [];
@@ -14498,6 +14367,181 @@ var init_CodeBlock = __esm({
14498
14367
  CodeBlock.displayName = "CodeBlock";
14499
14368
  }
14500
14369
  });
14370
+ var MarkdownContent;
14371
+ var init_MarkdownContent = __esm({
14372
+ "components/core/molecules/markdown/MarkdownContent.tsx"() {
14373
+ init_katex_min();
14374
+ init_Box();
14375
+ init_CodeBlock();
14376
+ init_useTranslate();
14377
+ init_cn();
14378
+ MarkdownContent = React85__namespace.default.memo(
14379
+ ({ content, direction, className }) => {
14380
+ const { t: _t } = useTranslate();
14381
+ const safeContent = typeof content === "string" ? content : String(content ?? "");
14382
+ return /* @__PURE__ */ jsxRuntime.jsx(
14383
+ Box,
14384
+ {
14385
+ className: cn("prose max-w-none", className),
14386
+ style: {
14387
+ color: "var(--color-foreground)",
14388
+ "--tw-prose-body": "var(--color-foreground)",
14389
+ "--tw-prose-headings": "var(--color-foreground)",
14390
+ "--tw-prose-lead": "var(--color-muted-foreground)",
14391
+ "--tw-prose-links": "var(--color-primary)",
14392
+ "--tw-prose-bold": "var(--color-foreground)",
14393
+ "--tw-prose-counters": "var(--color-muted-foreground)",
14394
+ "--tw-prose-bullets": "var(--color-muted-foreground)",
14395
+ "--tw-prose-hr": "var(--color-border)",
14396
+ "--tw-prose-quotes": "var(--color-foreground)",
14397
+ "--tw-prose-quote-borders": "var(--color-primary)",
14398
+ "--tw-prose-captions": "var(--color-muted-foreground)",
14399
+ "--tw-prose-code": "var(--color-foreground)",
14400
+ "--tw-prose-pre-code": "var(--color-foreground)",
14401
+ "--tw-prose-pre-bg": "var(--color-muted)",
14402
+ "--tw-prose-th-borders": "var(--color-border)",
14403
+ "--tw-prose-td-borders": "var(--color-border)",
14404
+ direction
14405
+ },
14406
+ children: /* @__PURE__ */ jsxRuntime.jsx(
14407
+ ReactMarkdown__default.default,
14408
+ {
14409
+ remarkPlugins: [remarkMath__default.default, remarkGfm__default.default],
14410
+ rehypePlugins: [
14411
+ [rehypeKatex__default.default, { strict: false, throwOnError: false }]
14412
+ ],
14413
+ components: {
14414
+ code({
14415
+ className: codeClassName,
14416
+ children,
14417
+ inline,
14418
+ ...props
14419
+ }) {
14420
+ if (!inline) {
14421
+ const match = /language-(\w+)/.exec(codeClassName ?? "");
14422
+ const code = String(children).replace(/\n$/, "");
14423
+ if (match) {
14424
+ return /* @__PURE__ */ jsxRuntime.jsx(
14425
+ CodeBlock,
14426
+ {
14427
+ code,
14428
+ language: match[1],
14429
+ maxHeight: "60vh"
14430
+ }
14431
+ );
14432
+ }
14433
+ return /* @__PURE__ */ jsxRuntime.jsx(
14434
+ "pre",
14435
+ {
14436
+ style: {
14437
+ backgroundColor: "var(--color-muted)",
14438
+ color: "var(--color-foreground)",
14439
+ padding: "1rem",
14440
+ borderRadius: "0.5rem",
14441
+ overflow: "auto",
14442
+ margin: 0
14443
+ },
14444
+ children: /* @__PURE__ */ jsxRuntime.jsx(
14445
+ "code",
14446
+ {
14447
+ ...props,
14448
+ className: codeClassName,
14449
+ style: {
14450
+ fontFamily: "ui-monospace, monospace",
14451
+ fontSize: "0.875em"
14452
+ },
14453
+ children
14454
+ }
14455
+ )
14456
+ }
14457
+ );
14458
+ }
14459
+ return /* @__PURE__ */ jsxRuntime.jsx(
14460
+ "code",
14461
+ {
14462
+ ...props,
14463
+ className: codeClassName,
14464
+ style: {
14465
+ backgroundColor: "var(--color-muted)",
14466
+ color: "var(--color-foreground)",
14467
+ border: "1px solid var(--color-border)",
14468
+ padding: "0.125rem 0.375rem",
14469
+ borderRadius: "0.25rem",
14470
+ fontSize: "0.875em",
14471
+ fontFamily: "ui-monospace, monospace"
14472
+ },
14473
+ children
14474
+ }
14475
+ );
14476
+ },
14477
+ // Style links
14478
+ a({ href, children, ...props }) {
14479
+ return /* @__PURE__ */ jsxRuntime.jsx(
14480
+ "a",
14481
+ {
14482
+ href,
14483
+ ...props,
14484
+ className: "text-[var(--color-primary)] hover:underline",
14485
+ target: href?.startsWith("http") ? "_blank" : void 0,
14486
+ rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
14487
+ children
14488
+ }
14489
+ );
14490
+ },
14491
+ // Style tables
14492
+ table({ children, ...props }) {
14493
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsxRuntime.jsx(
14494
+ "table",
14495
+ {
14496
+ ...props,
14497
+ className: "min-w-full border-collapse border border-[var(--color-border)]",
14498
+ children
14499
+ }
14500
+ ) });
14501
+ },
14502
+ th({ children, ...props }) {
14503
+ return /* @__PURE__ */ jsxRuntime.jsx(
14504
+ "th",
14505
+ {
14506
+ ...props,
14507
+ className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
14508
+ children
14509
+ }
14510
+ );
14511
+ },
14512
+ td({ children, ...props }) {
14513
+ return /* @__PURE__ */ jsxRuntime.jsx(
14514
+ "td",
14515
+ {
14516
+ ...props,
14517
+ className: "border border-[var(--color-border)] px-4 py-2",
14518
+ children
14519
+ }
14520
+ );
14521
+ },
14522
+ // Style blockquotes
14523
+ blockquote({ children, ...props }) {
14524
+ return /* @__PURE__ */ jsxRuntime.jsx(
14525
+ "blockquote",
14526
+ {
14527
+ ...props,
14528
+ className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
14529
+ children
14530
+ }
14531
+ );
14532
+ }
14533
+ },
14534
+ children: safeContent
14535
+ }
14536
+ )
14537
+ }
14538
+ );
14539
+ },
14540
+ (prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
14541
+ );
14542
+ MarkdownContent.displayName = "MarkdownContent";
14543
+ }
14544
+ });
14501
14545
  function useLongPress(onLongPress, options = {}) {
14502
14546
  const { duration = 500, moveThreshold = 10 } = options;
14503
14547
  const timerRef = React85.useRef(null);