@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/runtime/index.js
CHANGED
|
@@ -15,10 +15,6 @@ import { evaluate, createMinimalContext } from '@almadar/evaluator';
|
|
|
15
15
|
import { useUISlots, UISlotProvider } from '@almadar/ui/context';
|
|
16
16
|
import { Link, Outlet, useLocation } from 'react-router-dom';
|
|
17
17
|
import ELK from 'elkjs/lib/elk.bundled.js';
|
|
18
|
-
import ReactMarkdown from 'react-markdown';
|
|
19
|
-
import remarkGfm from 'remark-gfm';
|
|
20
|
-
import remarkMath from 'remark-math';
|
|
21
|
-
import rehypeKatex from 'rehype-katex';
|
|
22
18
|
import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light.js';
|
|
23
19
|
import dark from 'react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus.js';
|
|
24
20
|
import { orbLanguage, loloLanguage, ORB_COLORS } from '@almadar/syntax';
|
|
@@ -38,6 +34,10 @@ import langDiff from 'react-syntax-highlighter/dist/esm/languages/prism/diff.js'
|
|
|
38
34
|
import langToml from 'react-syntax-highlighter/dist/esm/languages/prism/toml.js';
|
|
39
35
|
import langGo from 'react-syntax-highlighter/dist/esm/languages/prism/go.js';
|
|
40
36
|
import langGraphql from 'react-syntax-highlighter/dist/esm/languages/prism/graphql.js';
|
|
37
|
+
import ReactMarkdown from 'react-markdown';
|
|
38
|
+
import remarkGfm from 'remark-gfm';
|
|
39
|
+
import remarkMath from 'remark-math';
|
|
40
|
+
import rehypeKatex from 'rehype-katex';
|
|
41
41
|
import { isCircuitEvent, schemaToIR, getPage, clearSchemaCache as clearSchemaCache$1, isEntityCall, isInlineTrait } from '@almadar/core';
|
|
42
42
|
import { DndContext, pointerWithin, rectIntersection, closestCorners, useSensors, useSensor, PointerSensor, KeyboardSensor, useDroppable } from '@dnd-kit/core';
|
|
43
43
|
import { useSortable, arrayMove, sortableKeyboardCoordinates, SortableContext, rectSortingStrategy, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
@@ -13673,137 +13673,6 @@ var init_katex_min = __esm({
|
|
|
13673
13673
|
"node_modules/katex/dist/katex.min.css"() {
|
|
13674
13674
|
}
|
|
13675
13675
|
});
|
|
13676
|
-
var MarkdownContent;
|
|
13677
|
-
var init_MarkdownContent = __esm({
|
|
13678
|
-
"components/core/molecules/markdown/MarkdownContent.tsx"() {
|
|
13679
|
-
init_katex_min();
|
|
13680
|
-
init_Box();
|
|
13681
|
-
init_useTranslate();
|
|
13682
|
-
init_cn();
|
|
13683
|
-
MarkdownContent = React84__default.memo(
|
|
13684
|
-
({ content, direction, className }) => {
|
|
13685
|
-
const { t: _t } = useTranslate();
|
|
13686
|
-
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
13687
|
-
return /* @__PURE__ */ jsx(
|
|
13688
|
-
Box,
|
|
13689
|
-
{
|
|
13690
|
-
className: cn("prose max-w-none", className),
|
|
13691
|
-
style: {
|
|
13692
|
-
color: "var(--color-foreground)",
|
|
13693
|
-
"--tw-prose-body": "var(--color-foreground)",
|
|
13694
|
-
"--tw-prose-headings": "var(--color-foreground)",
|
|
13695
|
-
"--tw-prose-lead": "var(--color-muted-foreground)",
|
|
13696
|
-
"--tw-prose-links": "var(--color-primary)",
|
|
13697
|
-
"--tw-prose-bold": "var(--color-foreground)",
|
|
13698
|
-
"--tw-prose-counters": "var(--color-muted-foreground)",
|
|
13699
|
-
"--tw-prose-bullets": "var(--color-muted-foreground)",
|
|
13700
|
-
"--tw-prose-hr": "var(--color-border)",
|
|
13701
|
-
"--tw-prose-quotes": "var(--color-foreground)",
|
|
13702
|
-
"--tw-prose-quote-borders": "var(--color-primary)",
|
|
13703
|
-
"--tw-prose-captions": "var(--color-muted-foreground)",
|
|
13704
|
-
"--tw-prose-code": "var(--color-foreground)",
|
|
13705
|
-
"--tw-prose-pre-code": "var(--color-foreground)",
|
|
13706
|
-
"--tw-prose-pre-bg": "var(--color-muted)",
|
|
13707
|
-
"--tw-prose-th-borders": "var(--color-border)",
|
|
13708
|
-
"--tw-prose-td-borders": "var(--color-border)",
|
|
13709
|
-
direction
|
|
13710
|
-
},
|
|
13711
|
-
children: /* @__PURE__ */ jsx(
|
|
13712
|
-
ReactMarkdown,
|
|
13713
|
-
{
|
|
13714
|
-
remarkPlugins: [remarkMath, remarkGfm],
|
|
13715
|
-
rehypePlugins: [
|
|
13716
|
-
[rehypeKatex, { strict: false, throwOnError: false }]
|
|
13717
|
-
],
|
|
13718
|
-
components: {
|
|
13719
|
-
// Handle inline code only — fenced code blocks are parsed out separately
|
|
13720
|
-
code({ className: codeClassName, children, ...props }) {
|
|
13721
|
-
return /* @__PURE__ */ jsx(
|
|
13722
|
-
"code",
|
|
13723
|
-
{
|
|
13724
|
-
...props,
|
|
13725
|
-
className: codeClassName,
|
|
13726
|
-
style: {
|
|
13727
|
-
backgroundColor: "var(--color-muted)",
|
|
13728
|
-
color: "var(--color-foreground)",
|
|
13729
|
-
border: "1px solid var(--color-border)",
|
|
13730
|
-
padding: "0.125rem 0.375rem",
|
|
13731
|
-
borderRadius: "0.25rem",
|
|
13732
|
-
fontSize: "0.875em",
|
|
13733
|
-
fontFamily: "ui-monospace, monospace"
|
|
13734
|
-
},
|
|
13735
|
-
children
|
|
13736
|
-
}
|
|
13737
|
-
);
|
|
13738
|
-
},
|
|
13739
|
-
// Style links
|
|
13740
|
-
a({ href, children, ...props }) {
|
|
13741
|
-
return /* @__PURE__ */ jsx(
|
|
13742
|
-
"a",
|
|
13743
|
-
{
|
|
13744
|
-
href,
|
|
13745
|
-
...props,
|
|
13746
|
-
className: "text-[var(--color-primary)] hover:underline",
|
|
13747
|
-
target: href?.startsWith("http") ? "_blank" : void 0,
|
|
13748
|
-
rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
13749
|
-
children
|
|
13750
|
-
}
|
|
13751
|
-
);
|
|
13752
|
-
},
|
|
13753
|
-
// Style tables
|
|
13754
|
-
table({ children, ...props }) {
|
|
13755
|
-
return /* @__PURE__ */ jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsx(
|
|
13756
|
-
"table",
|
|
13757
|
-
{
|
|
13758
|
-
...props,
|
|
13759
|
-
className: "min-w-full border-collapse border border-[var(--color-border)]",
|
|
13760
|
-
children
|
|
13761
|
-
}
|
|
13762
|
-
) });
|
|
13763
|
-
},
|
|
13764
|
-
th({ children, ...props }) {
|
|
13765
|
-
return /* @__PURE__ */ jsx(
|
|
13766
|
-
"th",
|
|
13767
|
-
{
|
|
13768
|
-
...props,
|
|
13769
|
-
className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
13770
|
-
children
|
|
13771
|
-
}
|
|
13772
|
-
);
|
|
13773
|
-
},
|
|
13774
|
-
td({ children, ...props }) {
|
|
13775
|
-
return /* @__PURE__ */ jsx(
|
|
13776
|
-
"td",
|
|
13777
|
-
{
|
|
13778
|
-
...props,
|
|
13779
|
-
className: "border border-[var(--color-border)] px-4 py-2",
|
|
13780
|
-
children
|
|
13781
|
-
}
|
|
13782
|
-
);
|
|
13783
|
-
},
|
|
13784
|
-
// Style blockquotes
|
|
13785
|
-
blockquote({ children, ...props }) {
|
|
13786
|
-
return /* @__PURE__ */ jsx(
|
|
13787
|
-
"blockquote",
|
|
13788
|
-
{
|
|
13789
|
-
...props,
|
|
13790
|
-
className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
|
|
13791
|
-
children
|
|
13792
|
-
}
|
|
13793
|
-
);
|
|
13794
|
-
}
|
|
13795
|
-
},
|
|
13796
|
-
children: safeContent
|
|
13797
|
-
}
|
|
13798
|
-
)
|
|
13799
|
-
}
|
|
13800
|
-
);
|
|
13801
|
-
},
|
|
13802
|
-
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
13803
|
-
);
|
|
13804
|
-
MarkdownContent.displayName = "MarkdownContent";
|
|
13805
|
-
}
|
|
13806
|
-
});
|
|
13807
13676
|
function computeFoldRegions(code) {
|
|
13808
13677
|
const lines = code.split("\n");
|
|
13809
13678
|
const regions = [];
|
|
@@ -14349,6 +14218,181 @@ var init_CodeBlock = __esm({
|
|
|
14349
14218
|
CodeBlock.displayName = "CodeBlock";
|
|
14350
14219
|
}
|
|
14351
14220
|
});
|
|
14221
|
+
var MarkdownContent;
|
|
14222
|
+
var init_MarkdownContent = __esm({
|
|
14223
|
+
"components/core/molecules/markdown/MarkdownContent.tsx"() {
|
|
14224
|
+
init_katex_min();
|
|
14225
|
+
init_Box();
|
|
14226
|
+
init_CodeBlock();
|
|
14227
|
+
init_useTranslate();
|
|
14228
|
+
init_cn();
|
|
14229
|
+
MarkdownContent = React84__default.memo(
|
|
14230
|
+
({ content, direction, className }) => {
|
|
14231
|
+
const { t: _t } = useTranslate();
|
|
14232
|
+
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
14233
|
+
return /* @__PURE__ */ jsx(
|
|
14234
|
+
Box,
|
|
14235
|
+
{
|
|
14236
|
+
className: cn("prose max-w-none", className),
|
|
14237
|
+
style: {
|
|
14238
|
+
color: "var(--color-foreground)",
|
|
14239
|
+
"--tw-prose-body": "var(--color-foreground)",
|
|
14240
|
+
"--tw-prose-headings": "var(--color-foreground)",
|
|
14241
|
+
"--tw-prose-lead": "var(--color-muted-foreground)",
|
|
14242
|
+
"--tw-prose-links": "var(--color-primary)",
|
|
14243
|
+
"--tw-prose-bold": "var(--color-foreground)",
|
|
14244
|
+
"--tw-prose-counters": "var(--color-muted-foreground)",
|
|
14245
|
+
"--tw-prose-bullets": "var(--color-muted-foreground)",
|
|
14246
|
+
"--tw-prose-hr": "var(--color-border)",
|
|
14247
|
+
"--tw-prose-quotes": "var(--color-foreground)",
|
|
14248
|
+
"--tw-prose-quote-borders": "var(--color-primary)",
|
|
14249
|
+
"--tw-prose-captions": "var(--color-muted-foreground)",
|
|
14250
|
+
"--tw-prose-code": "var(--color-foreground)",
|
|
14251
|
+
"--tw-prose-pre-code": "var(--color-foreground)",
|
|
14252
|
+
"--tw-prose-pre-bg": "var(--color-muted)",
|
|
14253
|
+
"--tw-prose-th-borders": "var(--color-border)",
|
|
14254
|
+
"--tw-prose-td-borders": "var(--color-border)",
|
|
14255
|
+
direction
|
|
14256
|
+
},
|
|
14257
|
+
children: /* @__PURE__ */ jsx(
|
|
14258
|
+
ReactMarkdown,
|
|
14259
|
+
{
|
|
14260
|
+
remarkPlugins: [remarkMath, remarkGfm],
|
|
14261
|
+
rehypePlugins: [
|
|
14262
|
+
[rehypeKatex, { strict: false, throwOnError: false }]
|
|
14263
|
+
],
|
|
14264
|
+
components: {
|
|
14265
|
+
code({
|
|
14266
|
+
className: codeClassName,
|
|
14267
|
+
children,
|
|
14268
|
+
inline,
|
|
14269
|
+
...props
|
|
14270
|
+
}) {
|
|
14271
|
+
if (!inline) {
|
|
14272
|
+
const match = /language-(\w+)/.exec(codeClassName ?? "");
|
|
14273
|
+
const code = String(children).replace(/\n$/, "");
|
|
14274
|
+
if (match) {
|
|
14275
|
+
return /* @__PURE__ */ jsx(
|
|
14276
|
+
CodeBlock,
|
|
14277
|
+
{
|
|
14278
|
+
code,
|
|
14279
|
+
language: match[1],
|
|
14280
|
+
maxHeight: "60vh"
|
|
14281
|
+
}
|
|
14282
|
+
);
|
|
14283
|
+
}
|
|
14284
|
+
return /* @__PURE__ */ jsx(
|
|
14285
|
+
"pre",
|
|
14286
|
+
{
|
|
14287
|
+
style: {
|
|
14288
|
+
backgroundColor: "var(--color-muted)",
|
|
14289
|
+
color: "var(--color-foreground)",
|
|
14290
|
+
padding: "1rem",
|
|
14291
|
+
borderRadius: "0.5rem",
|
|
14292
|
+
overflow: "auto",
|
|
14293
|
+
margin: 0
|
|
14294
|
+
},
|
|
14295
|
+
children: /* @__PURE__ */ jsx(
|
|
14296
|
+
"code",
|
|
14297
|
+
{
|
|
14298
|
+
...props,
|
|
14299
|
+
className: codeClassName,
|
|
14300
|
+
style: {
|
|
14301
|
+
fontFamily: "ui-monospace, monospace",
|
|
14302
|
+
fontSize: "0.875em"
|
|
14303
|
+
},
|
|
14304
|
+
children
|
|
14305
|
+
}
|
|
14306
|
+
)
|
|
14307
|
+
}
|
|
14308
|
+
);
|
|
14309
|
+
}
|
|
14310
|
+
return /* @__PURE__ */ jsx(
|
|
14311
|
+
"code",
|
|
14312
|
+
{
|
|
14313
|
+
...props,
|
|
14314
|
+
className: codeClassName,
|
|
14315
|
+
style: {
|
|
14316
|
+
backgroundColor: "var(--color-muted)",
|
|
14317
|
+
color: "var(--color-foreground)",
|
|
14318
|
+
border: "1px solid var(--color-border)",
|
|
14319
|
+
padding: "0.125rem 0.375rem",
|
|
14320
|
+
borderRadius: "0.25rem",
|
|
14321
|
+
fontSize: "0.875em",
|
|
14322
|
+
fontFamily: "ui-monospace, monospace"
|
|
14323
|
+
},
|
|
14324
|
+
children
|
|
14325
|
+
}
|
|
14326
|
+
);
|
|
14327
|
+
},
|
|
14328
|
+
// Style links
|
|
14329
|
+
a({ href, children, ...props }) {
|
|
14330
|
+
return /* @__PURE__ */ jsx(
|
|
14331
|
+
"a",
|
|
14332
|
+
{
|
|
14333
|
+
href,
|
|
14334
|
+
...props,
|
|
14335
|
+
className: "text-[var(--color-primary)] hover:underline",
|
|
14336
|
+
target: href?.startsWith("http") ? "_blank" : void 0,
|
|
14337
|
+
rel: href?.startsWith("http") ? "noopener noreferrer" : void 0,
|
|
14338
|
+
children
|
|
14339
|
+
}
|
|
14340
|
+
);
|
|
14341
|
+
},
|
|
14342
|
+
// Style tables
|
|
14343
|
+
table({ children, ...props }) {
|
|
14344
|
+
return /* @__PURE__ */ jsx("div", { className: "overflow-x-auto my-4", children: /* @__PURE__ */ jsx(
|
|
14345
|
+
"table",
|
|
14346
|
+
{
|
|
14347
|
+
...props,
|
|
14348
|
+
className: "min-w-full border-collapse border border-[var(--color-border)]",
|
|
14349
|
+
children
|
|
14350
|
+
}
|
|
14351
|
+
) });
|
|
14352
|
+
},
|
|
14353
|
+
th({ children, ...props }) {
|
|
14354
|
+
return /* @__PURE__ */ jsx(
|
|
14355
|
+
"th",
|
|
14356
|
+
{
|
|
14357
|
+
...props,
|
|
14358
|
+
className: "border border-[var(--color-border)] bg-[var(--color-muted)] px-4 py-2 text-left font-semibold",
|
|
14359
|
+
children
|
|
14360
|
+
}
|
|
14361
|
+
);
|
|
14362
|
+
},
|
|
14363
|
+
td({ children, ...props }) {
|
|
14364
|
+
return /* @__PURE__ */ jsx(
|
|
14365
|
+
"td",
|
|
14366
|
+
{
|
|
14367
|
+
...props,
|
|
14368
|
+
className: "border border-[var(--color-border)] px-4 py-2",
|
|
14369
|
+
children
|
|
14370
|
+
}
|
|
14371
|
+
);
|
|
14372
|
+
},
|
|
14373
|
+
// Style blockquotes
|
|
14374
|
+
blockquote({ children, ...props }) {
|
|
14375
|
+
return /* @__PURE__ */ jsx(
|
|
14376
|
+
"blockquote",
|
|
14377
|
+
{
|
|
14378
|
+
...props,
|
|
14379
|
+
className: "border-l-4 border-[var(--color-primary)] pl-4 italic text-[var(--color-foreground)] my-4",
|
|
14380
|
+
children
|
|
14381
|
+
}
|
|
14382
|
+
);
|
|
14383
|
+
}
|
|
14384
|
+
},
|
|
14385
|
+
children: safeContent
|
|
14386
|
+
}
|
|
14387
|
+
)
|
|
14388
|
+
}
|
|
14389
|
+
);
|
|
14390
|
+
},
|
|
14391
|
+
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
14392
|
+
);
|
|
14393
|
+
MarkdownContent.displayName = "MarkdownContent";
|
|
14394
|
+
}
|
|
14395
|
+
});
|
|
14352
14396
|
function Card2({
|
|
14353
14397
|
title,
|
|
14354
14398
|
subtitle,
|