@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.
- package/dist/avl/index.cjs +183 -139
- package/dist/avl/index.js +179 -135
- package/dist/components/index.cjs +183 -139
- package/dist/components/index.js +179 -135
- package/dist/providers/index.cjs +183 -139
- package/dist/providers/index.js +179 -135
- package/dist/runtime/index.cjs +183 -139
- package/dist/runtime/index.js +179 -135
- package/package.json +1 -1
package/dist/avl/index.js
CHANGED
|
@@ -12,10 +12,6 @@ import * as FaIcons from 'react-icons/fa';
|
|
|
12
12
|
import { createPortal } from 'react-dom';
|
|
13
13
|
import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
14
14
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
15
|
-
import ReactMarkdown from 'react-markdown';
|
|
16
|
-
import remarkGfm from 'remark-gfm';
|
|
17
|
-
import remarkMath from 'remark-math';
|
|
18
|
-
import rehypeKatex from 'rehype-katex';
|
|
19
15
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
20
16
|
import dark from 'react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js';
|
|
21
17
|
import { orbLanguage, loloLanguage, ORB_COLORS } from '@almadar/syntax';
|
|
@@ -35,6 +31,10 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff.js'
|
|
|
35
31
|
import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js';
|
|
36
32
|
import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
|
|
37
33
|
import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
|
|
34
|
+
import ReactMarkdown from 'react-markdown';
|
|
35
|
+
import remarkGfm from 'remark-gfm';
|
|
36
|
+
import remarkMath from 'remark-math';
|
|
37
|
+
import rehypeKatex from 'rehype-katex';
|
|
38
38
|
import { FieldTypeSchema, isInlineTrait, isPageReference, isEntityCall, schemaToIR, getPage, isCircuitEvent } from '@almadar/core';
|
|
39
39
|
import { useDroppable, useDraggable, DndContext, DragOverlay, useSensors, useSensor, PointerSensor, KeyboardSensor, pointerWithin, rectIntersection, closestCorners } from '@dnd-kit/core';
|
|
40
40
|
import { sortableKeyboardCoordinates, useSortable, arrayMove, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
@@ -16960,137 +16960,6 @@ var init_katex_min = __esm({
|
|
|
16960
16960
|
"node_modules/katex/dist/katex.min.css"() {
|
|
16961
16961
|
}
|
|
16962
16962
|
});
|
|
16963
|
-
var MarkdownContent;
|
|
16964
|
-
var init_MarkdownContent = __esm({
|
|
16965
|
-
"components/core/molecules/markdown/MarkdownContent.tsx"() {
|
|
16966
|
-
init_katex_min();
|
|
16967
|
-
init_Box();
|
|
16968
|
-
init_useTranslate();
|
|
16969
|
-
init_cn();
|
|
16970
|
-
MarkdownContent = React97__default.memo(
|
|
16971
|
-
({ content, direction, className }) => {
|
|
16972
|
-
const { t: _t } = useTranslate();
|
|
16973
|
-
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
16974
|
-
return /* @__PURE__ */ jsx(
|
|
16975
|
-
Box,
|
|
16976
|
-
{
|
|
16977
|
-
className: cn("prose max-w-none", className),
|
|
16978
|
-
style: {
|
|
16979
|
-
color: "var(--color-foreground)",
|
|
16980
|
-
"--tw-prose-body": "var(--color-foreground)",
|
|
16981
|
-
"--tw-prose-headings": "var(--color-foreground)",
|
|
16982
|
-
"--tw-prose-lead": "var(--color-muted-foreground)",
|
|
16983
|
-
"--tw-prose-links": "var(--color-primary)",
|
|
16984
|
-
"--tw-prose-bold": "var(--color-foreground)",
|
|
16985
|
-
"--tw-prose-counters": "var(--color-muted-foreground)",
|
|
16986
|
-
"--tw-prose-bullets": "var(--color-muted-foreground)",
|
|
16987
|
-
"--tw-prose-hr": "var(--color-border)",
|
|
16988
|
-
"--tw-prose-quotes": "var(--color-foreground)",
|
|
16989
|
-
"--tw-prose-quote-borders": "var(--color-primary)",
|
|
16990
|
-
"--tw-prose-captions": "var(--color-muted-foreground)",
|
|
16991
|
-
"--tw-prose-code": "var(--color-foreground)",
|
|
16992
|
-
"--tw-prose-pre-code": "var(--color-foreground)",
|
|
16993
|
-
"--tw-prose-pre-bg": "var(--color-muted)",
|
|
16994
|
-
"--tw-prose-th-borders": "var(--color-border)",
|
|
16995
|
-
"--tw-prose-td-borders": "var(--color-border)",
|
|
16996
|
-
direction
|
|
16997
|
-
},
|
|
16998
|
-
children: /* @__PURE__ */ jsx(
|
|
16999
|
-
ReactMarkdown,
|
|
17000
|
-
{
|
|
17001
|
-
remarkPlugins: [remarkMath, remarkGfm],
|
|
17002
|
-
rehypePlugins: [
|
|
17003
|
-
[rehypeKatex, { strict: false, throwOnError: false }]
|
|
17004
|
-
],
|
|
17005
|
-
components: {
|
|
17006
|
-
// Handle inline code only — fenced code blocks are parsed out separately
|
|
17007
|
-
code({ className: codeClassName, children, ...props }) {
|
|
17008
|
-
return /* @__PURE__ */ jsx(
|
|
17009
|
-
"code",
|
|
17010
|
-
{
|
|
17011
|
-
...props,
|
|
17012
|
-
className: codeClassName,
|
|
17013
|
-
style: {
|
|
17014
|
-
backgroundColor: "var(--color-muted)",
|
|
17015
|
-
color: "var(--color-foreground)",
|
|
17016
|
-
border: "1px solid var(--color-border)",
|
|
17017
|
-
padding: "0.125rem 0.375rem",
|
|
17018
|
-
borderRadius: "0.25rem",
|
|
17019
|
-
fontSize: "0.875em",
|
|
17020
|
-
fontFamily: "ui-monospace, monospace"
|
|
17021
|
-
},
|
|
17022
|
-
children
|
|
17023
|
-
}
|
|
17024
|
-
);
|
|
17025
|
-
},
|
|
17026
|
-
// Style links
|
|
17027
|
-
a({ href, children, ...props }) {
|
|
17028
|
-
return /* @__PURE__ */ jsx(
|
|
17029
|
-
"a",
|
|
17030
|
-
{
|
|
17031
|
-
href,
|
|
17032
|
-
...props,
|
|
17033
|
-
className: "text-[var(--color-primary)] hover:underline",
|
|
17034
|
-
target: href?.startsWith("http") ? "_blank" : void 0,
|
|
17035
|
-
rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
17036
|
-
children
|
|
17037
|
-
}
|
|
17038
|
-
);
|
|
17039
|
-
},
|
|
17040
|
-
// Style tables
|
|
17041
|
-
table({ children, ...props }) {
|
|
17042
|
-
return /* @__PURE__ */ jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsx(
|
|
17043
|
-
"table",
|
|
17044
|
-
{
|
|
17045
|
-
...props,
|
|
17046
|
-
className: "min-w-full border-collapse border border-[var(--color-border)]",
|
|
17047
|
-
children
|
|
17048
|
-
}
|
|
17049
|
-
) });
|
|
17050
|
-
},
|
|
17051
|
-
th({ children, ...props }) {
|
|
17052
|
-
return /* @__PURE__ */ jsx(
|
|
17053
|
-
"th",
|
|
17054
|
-
{
|
|
17055
|
-
...props,
|
|
17056
|
-
className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
17057
|
-
children
|
|
17058
|
-
}
|
|
17059
|
-
);
|
|
17060
|
-
},
|
|
17061
|
-
td({ children, ...props }) {
|
|
17062
|
-
return /* @__PURE__ */ jsx(
|
|
17063
|
-
"td",
|
|
17064
|
-
{
|
|
17065
|
-
...props,
|
|
17066
|
-
className: "border border-[var(--color-border)] px-4 py-2",
|
|
17067
|
-
children
|
|
17068
|
-
}
|
|
17069
|
-
);
|
|
17070
|
-
},
|
|
17071
|
-
// Style blockquotes
|
|
17072
|
-
blockquote({ children, ...props }) {
|
|
17073
|
-
return /* @__PURE__ */ jsx(
|
|
17074
|
-
"blockquote",
|
|
17075
|
-
{
|
|
17076
|
-
...props,
|
|
17077
|
-
className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
|
|
17078
|
-
children
|
|
17079
|
-
}
|
|
17080
|
-
);
|
|
17081
|
-
}
|
|
17082
|
-
},
|
|
17083
|
-
children: safeContent
|
|
17084
|
-
}
|
|
17085
|
-
)
|
|
17086
|
-
}
|
|
17087
|
-
);
|
|
17088
|
-
},
|
|
17089
|
-
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
17090
|
-
);
|
|
17091
|
-
MarkdownContent.displayName = "MarkdownContent";
|
|
17092
|
-
}
|
|
17093
|
-
});
|
|
17094
16963
|
function computeFoldRegions(code) {
|
|
17095
16964
|
const lines = code.split("\n");
|
|
17096
16965
|
const regions = [];
|
|
@@ -17636,6 +17505,181 @@ var init_CodeBlock = __esm({
|
|
|
17636
17505
|
CodeBlock.displayName = "CodeBlock";
|
|
17637
17506
|
}
|
|
17638
17507
|
});
|
|
17508
|
+
var MarkdownContent;
|
|
17509
|
+
var init_MarkdownContent = __esm({
|
|
17510
|
+
"components/core/molecules/markdown/MarkdownContent.tsx"() {
|
|
17511
|
+
init_katex_min();
|
|
17512
|
+
init_Box();
|
|
17513
|
+
init_CodeBlock();
|
|
17514
|
+
init_useTranslate();
|
|
17515
|
+
init_cn();
|
|
17516
|
+
MarkdownContent = React97__default.memo(
|
|
17517
|
+
({ content, direction, className }) => {
|
|
17518
|
+
const { t: _t } = useTranslate();
|
|
17519
|
+
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
17520
|
+
return /* @__PURE__ */ jsx(
|
|
17521
|
+
Box,
|
|
17522
|
+
{
|
|
17523
|
+
className: cn("prose max-w-none", className),
|
|
17524
|
+
style: {
|
|
17525
|
+
color: "var(--color-foreground)",
|
|
17526
|
+
"--tw-prose-body": "var(--color-foreground)",
|
|
17527
|
+
"--tw-prose-headings": "var(--color-foreground)",
|
|
17528
|
+
"--tw-prose-lead": "var(--color-muted-foreground)",
|
|
17529
|
+
"--tw-prose-links": "var(--color-primary)",
|
|
17530
|
+
"--tw-prose-bold": "var(--color-foreground)",
|
|
17531
|
+
"--tw-prose-counters": "var(--color-muted-foreground)",
|
|
17532
|
+
"--tw-prose-bullets": "var(--color-muted-foreground)",
|
|
17533
|
+
"--tw-prose-hr": "var(--color-border)",
|
|
17534
|
+
"--tw-prose-quotes": "var(--color-foreground)",
|
|
17535
|
+
"--tw-prose-quote-borders": "var(--color-primary)",
|
|
17536
|
+
"--tw-prose-captions": "var(--color-muted-foreground)",
|
|
17537
|
+
"--tw-prose-code": "var(--color-foreground)",
|
|
17538
|
+
"--tw-prose-pre-code": "var(--color-foreground)",
|
|
17539
|
+
"--tw-prose-pre-bg": "var(--color-muted)",
|
|
17540
|
+
"--tw-prose-th-borders": "var(--color-border)",
|
|
17541
|
+
"--tw-prose-td-borders": "var(--color-border)",
|
|
17542
|
+
direction
|
|
17543
|
+
},
|
|
17544
|
+
children: /* @__PURE__ */ jsx(
|
|
17545
|
+
ReactMarkdown,
|
|
17546
|
+
{
|
|
17547
|
+
remarkPlugins: [remarkMath, remarkGfm],
|
|
17548
|
+
rehypePlugins: [
|
|
17549
|
+
[rehypeKatex, { strict: false, throwOnError: false }]
|
|
17550
|
+
],
|
|
17551
|
+
components: {
|
|
17552
|
+
code({
|
|
17553
|
+
className: codeClassName,
|
|
17554
|
+
children,
|
|
17555
|
+
inline,
|
|
17556
|
+
...props
|
|
17557
|
+
}) {
|
|
17558
|
+
if (!inline) {
|
|
17559
|
+
const match = /language-(\w+)/.exec(codeClassName ?? "");
|
|
17560
|
+
const code = String(children).replace(/\n$/, "");
|
|
17561
|
+
if (match) {
|
|
17562
|
+
return /* @__PURE__ */ jsx(
|
|
17563
|
+
CodeBlock,
|
|
17564
|
+
{
|
|
17565
|
+
code,
|
|
17566
|
+
language: match[1],
|
|
17567
|
+
maxHeight: "60vh"
|
|
17568
|
+
}
|
|
17569
|
+
);
|
|
17570
|
+
}
|
|
17571
|
+
return /* @__PURE__ */ jsx(
|
|
17572
|
+
"pre",
|
|
17573
|
+
{
|
|
17574
|
+
style: {
|
|
17575
|
+
backgroundColor: "var(--color-muted)",
|
|
17576
|
+
color: "var(--color-foreground)",
|
|
17577
|
+
padding: "1rem",
|
|
17578
|
+
borderRadius: "0.5rem",
|
|
17579
|
+
overflow: "auto",
|
|
17580
|
+
margin: 0
|
|
17581
|
+
},
|
|
17582
|
+
children: /* @__PURE__ */ jsx(
|
|
17583
|
+
"code",
|
|
17584
|
+
{
|
|
17585
|
+
...props,
|
|
17586
|
+
className: codeClassName,
|
|
17587
|
+
style: {
|
|
17588
|
+
fontFamily: "ui-monospace, monospace",
|
|
17589
|
+
fontSize: "0.875em"
|
|
17590
|
+
},
|
|
17591
|
+
children
|
|
17592
|
+
}
|
|
17593
|
+
)
|
|
17594
|
+
}
|
|
17595
|
+
);
|
|
17596
|
+
}
|
|
17597
|
+
return /* @__PURE__ */ jsx(
|
|
17598
|
+
"code",
|
|
17599
|
+
{
|
|
17600
|
+
...props,
|
|
17601
|
+
className: codeClassName,
|
|
17602
|
+
style: {
|
|
17603
|
+
backgroundColor: "var(--color-muted)",
|
|
17604
|
+
color: "var(--color-foreground)",
|
|
17605
|
+
border: "1px solid var(--color-border)",
|
|
17606
|
+
padding: "0.125rem 0.375rem",
|
|
17607
|
+
borderRadius: "0.25rem",
|
|
17608
|
+
fontSize: "0.875em",
|
|
17609
|
+
fontFamily: "ui-monospace, monospace"
|
|
17610
|
+
},
|
|
17611
|
+
children
|
|
17612
|
+
}
|
|
17613
|
+
);
|
|
17614
|
+
},
|
|
17615
|
+
// Style links
|
|
17616
|
+
a({ href, children, ...props }) {
|
|
17617
|
+
return /* @__PURE__ */ jsx(
|
|
17618
|
+
"a",
|
|
17619
|
+
{
|
|
17620
|
+
href,
|
|
17621
|
+
...props,
|
|
17622
|
+
className: "text-[var(--color-primary)] hover:underline",
|
|
17623
|
+
target: href?.startsWith("http") ? "_blank" : void 0,
|
|
17624
|
+
rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
17625
|
+
children
|
|
17626
|
+
}
|
|
17627
|
+
);
|
|
17628
|
+
},
|
|
17629
|
+
// Style tables
|
|
17630
|
+
table({ children, ...props }) {
|
|
17631
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsx(
|
|
17632
|
+
"table",
|
|
17633
|
+
{
|
|
17634
|
+
...props,
|
|
17635
|
+
className: "min-w-full border-collapse border border-[var(--color-border)]",
|
|
17636
|
+
children
|
|
17637
|
+
}
|
|
17638
|
+
) });
|
|
17639
|
+
},
|
|
17640
|
+
th({ children, ...props }) {
|
|
17641
|
+
return /* @__PURE__ */ jsx(
|
|
17642
|
+
"th",
|
|
17643
|
+
{
|
|
17644
|
+
...props,
|
|
17645
|
+
className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
17646
|
+
children
|
|
17647
|
+
}
|
|
17648
|
+
);
|
|
17649
|
+
},
|
|
17650
|
+
td({ children, ...props }) {
|
|
17651
|
+
return /* @__PURE__ */ jsx(
|
|
17652
|
+
"td",
|
|
17653
|
+
{
|
|
17654
|
+
...props,
|
|
17655
|
+
className: "border border-[var(--color-border)] px-4 py-2",
|
|
17656
|
+
children
|
|
17657
|
+
}
|
|
17658
|
+
);
|
|
17659
|
+
},
|
|
17660
|
+
// Style blockquotes
|
|
17661
|
+
blockquote({ children, ...props }) {
|
|
17662
|
+
return /* @__PURE__ */ jsx(
|
|
17663
|
+
"blockquote",
|
|
17664
|
+
{
|
|
17665
|
+
...props,
|
|
17666
|
+
className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
|
|
17667
|
+
children
|
|
17668
|
+
}
|
|
17669
|
+
);
|
|
17670
|
+
}
|
|
17671
|
+
},
|
|
17672
|
+
children: safeContent
|
|
17673
|
+
}
|
|
17674
|
+
)
|
|
17675
|
+
}
|
|
17676
|
+
);
|
|
17677
|
+
},
|
|
17678
|
+
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
17679
|
+
);
|
|
17680
|
+
MarkdownContent.displayName = "MarkdownContent";
|
|
17681
|
+
}
|
|
17682
|
+
});
|
|
17639
17683
|
function useLongPress(onLongPress, options = {}) {
|
|
17640
17684
|
const { duration = 500, moveThreshold = 10 } = options;
|
|
17641
17685
|
const timerRef = useRef(null);
|