@almadar/ui 2.35.0 → 2.37.0
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 +359 -131
- package/dist/avl/index.d.cts +33 -1
- package/dist/avl/index.d.ts +1 -0
- package/dist/avl/index.js +342 -131
- package/dist/components/atoms/Input.d.ts +1 -1
- package/dist/components/index.cjs +122 -6
- package/dist/components/index.js +106 -6
- package/dist/components/organisms/avl/FlowCanvas.d.ts +4 -0
- package/dist/components/organisms/avl/OrbInspector.d.ts +29 -0
- package/dist/components/organisms/avl/index.d.ts +1 -0
- package/dist/providers/index.cjs +82 -2
- package/dist/providers/index.js +66 -2
- package/dist/runtime/index.cjs +122 -6
- package/dist/runtime/index.js +106 -6
- package/package.json +4 -3
- package/dist/components/organisms/avl/TransitionPanel.d.ts +0 -20
package/dist/avl/index.cjs
CHANGED
|
@@ -24,8 +24,25 @@ var ReactMarkdown = require('react-markdown');
|
|
|
24
24
|
var remarkGfm = require('remark-gfm');
|
|
25
25
|
var remarkMath = require('remark-math');
|
|
26
26
|
var rehypeKatex = require('rehype-katex');
|
|
27
|
-
var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism');
|
|
27
|
+
var SyntaxHighlighter = require('react-syntax-highlighter/dist/esm/prism-light');
|
|
28
28
|
var dark = require('react-syntax-highlighter/dist/esm/styles/prism/vsc-dark-plus');
|
|
29
|
+
var syntax = require('@almadar/syntax');
|
|
30
|
+
var langJson = require('react-syntax-highlighter/dist/esm/languages/prism/json');
|
|
31
|
+
var langJavascript = require('react-syntax-highlighter/dist/esm/languages/prism/javascript');
|
|
32
|
+
var langTypescript = require('react-syntax-highlighter/dist/esm/languages/prism/typescript');
|
|
33
|
+
var langJsx = require('react-syntax-highlighter/dist/esm/languages/prism/jsx');
|
|
34
|
+
var langTsx = require('react-syntax-highlighter/dist/esm/languages/prism/tsx');
|
|
35
|
+
var langCss = require('react-syntax-highlighter/dist/esm/languages/prism/css');
|
|
36
|
+
var langMarkdown = require('react-syntax-highlighter/dist/esm/languages/prism/markdown');
|
|
37
|
+
var langBash = require('react-syntax-highlighter/dist/esm/languages/prism/bash');
|
|
38
|
+
var langYaml = require('react-syntax-highlighter/dist/esm/languages/prism/yaml');
|
|
39
|
+
var langRust = require('react-syntax-highlighter/dist/esm/languages/prism/rust');
|
|
40
|
+
var langPython = require('react-syntax-highlighter/dist/esm/languages/prism/python');
|
|
41
|
+
var langSql = require('react-syntax-highlighter/dist/esm/languages/prism/sql');
|
|
42
|
+
var langDiff = require('react-syntax-highlighter/dist/esm/languages/prism/diff');
|
|
43
|
+
var langToml = require('react-syntax-highlighter/dist/esm/languages/prism/toml');
|
|
44
|
+
var langGo = require('react-syntax-highlighter/dist/esm/languages/prism/go');
|
|
45
|
+
var langGraphql = require('react-syntax-highlighter/dist/esm/languages/prism/graphql');
|
|
29
46
|
var core = require('@almadar/core');
|
|
30
47
|
require('@tanstack/react-query');
|
|
31
48
|
var runtime = require('@almadar/runtime');
|
|
@@ -61,6 +78,22 @@ var remarkMath__default = /*#__PURE__*/_interopDefault(remarkMath);
|
|
|
61
78
|
var rehypeKatex__default = /*#__PURE__*/_interopDefault(rehypeKatex);
|
|
62
79
|
var SyntaxHighlighter__default = /*#__PURE__*/_interopDefault(SyntaxHighlighter);
|
|
63
80
|
var dark__default = /*#__PURE__*/_interopDefault(dark);
|
|
81
|
+
var langJson__default = /*#__PURE__*/_interopDefault(langJson);
|
|
82
|
+
var langJavascript__default = /*#__PURE__*/_interopDefault(langJavascript);
|
|
83
|
+
var langTypescript__default = /*#__PURE__*/_interopDefault(langTypescript);
|
|
84
|
+
var langJsx__default = /*#__PURE__*/_interopDefault(langJsx);
|
|
85
|
+
var langTsx__default = /*#__PURE__*/_interopDefault(langTsx);
|
|
86
|
+
var langCss__default = /*#__PURE__*/_interopDefault(langCss);
|
|
87
|
+
var langMarkdown__default = /*#__PURE__*/_interopDefault(langMarkdown);
|
|
88
|
+
var langBash__default = /*#__PURE__*/_interopDefault(langBash);
|
|
89
|
+
var langYaml__default = /*#__PURE__*/_interopDefault(langYaml);
|
|
90
|
+
var langRust__default = /*#__PURE__*/_interopDefault(langRust);
|
|
91
|
+
var langPython__default = /*#__PURE__*/_interopDefault(langPython);
|
|
92
|
+
var langSql__default = /*#__PURE__*/_interopDefault(langSql);
|
|
93
|
+
var langDiff__default = /*#__PURE__*/_interopDefault(langDiff);
|
|
94
|
+
var langToml__default = /*#__PURE__*/_interopDefault(langToml);
|
|
95
|
+
var langGo__default = /*#__PURE__*/_interopDefault(langGo);
|
|
96
|
+
var langGraphql__default = /*#__PURE__*/_interopDefault(langGraphql);
|
|
64
97
|
|
|
65
98
|
var __defProp = Object.defineProperty;
|
|
66
99
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -21728,6 +21761,51 @@ MarkdownContent.displayName = "MarkdownContent";
|
|
|
21728
21761
|
init_Box();
|
|
21729
21762
|
init_Stack();
|
|
21730
21763
|
init_useEventBus();
|
|
21764
|
+
SyntaxHighlighter__default.default.registerLanguage("json", langJson__default.default);
|
|
21765
|
+
SyntaxHighlighter__default.default.registerLanguage("javascript", langJavascript__default.default);
|
|
21766
|
+
SyntaxHighlighter__default.default.registerLanguage("js", langJavascript__default.default);
|
|
21767
|
+
SyntaxHighlighter__default.default.registerLanguage("typescript", langTypescript__default.default);
|
|
21768
|
+
SyntaxHighlighter__default.default.registerLanguage("ts", langTypescript__default.default);
|
|
21769
|
+
SyntaxHighlighter__default.default.registerLanguage("jsx", langJsx__default.default);
|
|
21770
|
+
SyntaxHighlighter__default.default.registerLanguage("tsx", langTsx__default.default);
|
|
21771
|
+
SyntaxHighlighter__default.default.registerLanguage("css", langCss__default.default);
|
|
21772
|
+
SyntaxHighlighter__default.default.registerLanguage("markdown", langMarkdown__default.default);
|
|
21773
|
+
SyntaxHighlighter__default.default.registerLanguage("md", langMarkdown__default.default);
|
|
21774
|
+
SyntaxHighlighter__default.default.registerLanguage("bash", langBash__default.default);
|
|
21775
|
+
SyntaxHighlighter__default.default.registerLanguage("shell", langBash__default.default);
|
|
21776
|
+
SyntaxHighlighter__default.default.registerLanguage("sh", langBash__default.default);
|
|
21777
|
+
SyntaxHighlighter__default.default.registerLanguage("yaml", langYaml__default.default);
|
|
21778
|
+
SyntaxHighlighter__default.default.registerLanguage("yml", langYaml__default.default);
|
|
21779
|
+
SyntaxHighlighter__default.default.registerLanguage("rust", langRust__default.default);
|
|
21780
|
+
SyntaxHighlighter__default.default.registerLanguage("python", langPython__default.default);
|
|
21781
|
+
SyntaxHighlighter__default.default.registerLanguage("py", langPython__default.default);
|
|
21782
|
+
SyntaxHighlighter__default.default.registerLanguage("sql", langSql__default.default);
|
|
21783
|
+
SyntaxHighlighter__default.default.registerLanguage("diff", langDiff__default.default);
|
|
21784
|
+
SyntaxHighlighter__default.default.registerLanguage("toml", langToml__default.default);
|
|
21785
|
+
SyntaxHighlighter__default.default.registerLanguage("go", langGo__default.default);
|
|
21786
|
+
SyntaxHighlighter__default.default.registerLanguage("graphql", langGraphql__default.default);
|
|
21787
|
+
SyntaxHighlighter__default.default.registerLanguage("orb", syntax.orbLanguage);
|
|
21788
|
+
var orbStyleOverrides = {
|
|
21789
|
+
"orb-binding": { color: syntax.ORB_COLORS.dark.binding, fontWeight: "bold" },
|
|
21790
|
+
"orb-effect": { color: syntax.ORB_COLORS.dark.effect, fontWeight: "bold" },
|
|
21791
|
+
"orb-event": { color: syntax.ORB_COLORS.dark.event },
|
|
21792
|
+
"orb-slot": { color: syntax.ORB_COLORS.dark.uiSlot },
|
|
21793
|
+
"orb-structural": { color: syntax.ORB_COLORS.dark.structural },
|
|
21794
|
+
"orb-field-type": { color: syntax.ORB_COLORS.dark.fieldType },
|
|
21795
|
+
"orb-persistence": { color: syntax.ORB_COLORS.dark.persistence },
|
|
21796
|
+
"orb-pattern": { color: syntax.ORB_COLORS.dark.pattern },
|
|
21797
|
+
"orb-behavior": { color: syntax.ORB_COLORS.dark.behavior },
|
|
21798
|
+
"orb-unknown-op": { color: syntax.ORB_COLORS.dark.error, textDecoration: "wavy underline" },
|
|
21799
|
+
"orb-op-arithmetic": { color: syntax.ORB_COLORS.dark.arithmetic, fontWeight: "bold" },
|
|
21800
|
+
"orb-op-comparison": { color: syntax.ORB_COLORS.dark.comparison },
|
|
21801
|
+
"orb-op-logic": { color: syntax.ORB_COLORS.dark.logic },
|
|
21802
|
+
"orb-op-string": { color: syntax.ORB_COLORS.dark.string },
|
|
21803
|
+
"orb-op-collection": { color: syntax.ORB_COLORS.dark.collection },
|
|
21804
|
+
"orb-op-time": { color: syntax.ORB_COLORS.dark.time },
|
|
21805
|
+
"orb-op-control": { color: syntax.ORB_COLORS.dark.control },
|
|
21806
|
+
"orb-op-async": { color: syntax.ORB_COLORS.dark.async }
|
|
21807
|
+
};
|
|
21808
|
+
var orbStyle = { ...dark__default.default, ...orbStyleOverrides };
|
|
21731
21809
|
var CodeBlock = React124__namespace.default.memo(
|
|
21732
21810
|
({
|
|
21733
21811
|
code: rawCode,
|
|
@@ -21738,6 +21816,8 @@ var CodeBlock = React124__namespace.default.memo(
|
|
|
21738
21816
|
className
|
|
21739
21817
|
}) => {
|
|
21740
21818
|
const code = typeof rawCode === "string" ? rawCode : String(rawCode ?? "");
|
|
21819
|
+
const isOrb = language === "orb";
|
|
21820
|
+
const activeStyle = isOrb ? orbStyle : dark__default.default;
|
|
21741
21821
|
const eventBus = useEventBus();
|
|
21742
21822
|
const { t: _t } = useTranslate();
|
|
21743
21823
|
const scrollRef = React124.useRef(null);
|
|
@@ -21817,7 +21897,7 @@ var CodeBlock = React124__namespace.default.memo(
|
|
|
21817
21897
|
{
|
|
21818
21898
|
PreTag: "div",
|
|
21819
21899
|
language,
|
|
21820
|
-
style:
|
|
21900
|
+
style: activeStyle,
|
|
21821
21901
|
customStyle: {
|
|
21822
21902
|
backgroundColor: "transparent",
|
|
21823
21903
|
borderRadius: 0,
|
|
@@ -41004,22 +41084,33 @@ function VerifyModePanel({
|
|
|
41004
41084
|
}) {
|
|
41005
41085
|
const scrollRef = React124__namespace.useRef(null);
|
|
41006
41086
|
const prevCountRef = React124__namespace.useRef(0);
|
|
41087
|
+
const [walkStep, setWalkStep] = React124__namespace.useState(null);
|
|
41088
|
+
React124__namespace.useEffect(() => {
|
|
41089
|
+
const interval = setInterval(() => {
|
|
41090
|
+
const w = window;
|
|
41091
|
+
const step = w.__orbitalWalkStep;
|
|
41092
|
+
if (step) setWalkStep(step);
|
|
41093
|
+
}, 300);
|
|
41094
|
+
return () => clearInterval(interval);
|
|
41095
|
+
}, []);
|
|
41007
41096
|
React124__namespace.useEffect(() => {
|
|
41008
41097
|
if (transitions.length > prevCountRef.current && scrollRef.current) {
|
|
41009
41098
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
41010
41099
|
}
|
|
41011
41100
|
prevCountRef.current = transitions.length;
|
|
41012
41101
|
}, [transitions.length]);
|
|
41013
|
-
|
|
41102
|
+
const hudBottom = typeof document !== "undefined" ? document.getElementById("slot-hud-bottom") : null;
|
|
41103
|
+
const panel = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
41014
41104
|
"div",
|
|
41015
41105
|
{
|
|
41016
41106
|
className: cn(
|
|
41017
41107
|
"runtime-debugger runtime-debugger--verify",
|
|
41018
|
-
"
|
|
41108
|
+
"flex flex-col bg-gray-900 text-white border-t-2 border-cyan-500",
|
|
41109
|
+
hudBottom ? "" : "fixed bottom-0 left-0 right-0",
|
|
41019
41110
|
className
|
|
41020
41111
|
),
|
|
41021
41112
|
"data-testid": "debugger-verify",
|
|
41022
|
-
style: {
|
|
41113
|
+
style: { height: "25vh", zIndex: hudBottom ? void 0 : 40 },
|
|
41023
41114
|
children: [
|
|
41024
41115
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 flex items-center gap-3 text-xs font-mono border-b border-gray-700 flex-shrink-0", children: [
|
|
41025
41116
|
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: failedChecks > 0 ? "danger" : "success", size: "sm", children: failedChecks > 0 ? `${failedChecks} fail` : "OK" }),
|
|
@@ -41033,10 +41124,35 @@ function VerifyModePanel({
|
|
|
41033
41124
|
] }),
|
|
41034
41125
|
traitStates && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-cyan-400 truncate max-w-[400px]", children: traitStates })
|
|
41035
41126
|
] }),
|
|
41036
|
-
/* @__PURE__ */ jsxRuntime.
|
|
41127
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 flex overflow-hidden", children: [
|
|
41128
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: scrollRef, className: "flex-1 overflow-y-auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1", children: transitions.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500 text-xs font-mono py-2 text-center", children: "Waiting for transitions..." }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "space-y-0.5", children: transitions.map((trace) => /* @__PURE__ */ jsxRuntime.jsx(TransitionRow, { trace }, trace.id)) }) }) }),
|
|
41129
|
+
walkStep && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-56 flex-shrink-0 border-l border-gray-700 px-2 py-1 text-xs font-mono overflow-y-auto", children: [
|
|
41130
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-cyan-400 font-bold mb-1", children: [
|
|
41131
|
+
"Walk Step ",
|
|
41132
|
+
walkStep.stepIndex,
|
|
41133
|
+
"/",
|
|
41134
|
+
walkStep.stepTotal
|
|
41135
|
+
] }),
|
|
41136
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-300 mb-1", children: walkStep.traitName }),
|
|
41137
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1 mb-1", children: [
|
|
41138
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-yellow-300", children: walkStep.from }),
|
|
41139
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "--" }),
|
|
41140
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-green-300", children: walkStep.event }),
|
|
41141
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-gray-500", children: "-->" }),
|
|
41142
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-yellow-300", children: walkStep.to })
|
|
41143
|
+
] }),
|
|
41144
|
+
walkStep.guardCase && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: walkStep.guardCase === "pass" ? "text-green-400" : "text-red-400", children: [
|
|
41145
|
+
"guard: ",
|
|
41146
|
+
walkStep.guardCase
|
|
41147
|
+
] }),
|
|
41148
|
+
walkStep.isRepositioning && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-gray-500 italic", children: "repositioning" }),
|
|
41149
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: walkStep.accepted ? "text-green-400 mt-1" : "text-red-400 mt-1", children: walkStep.accepted ? "\u2713 accepted" : "\u2717 rejected" })
|
|
41150
|
+
] })
|
|
41151
|
+
] })
|
|
41037
41152
|
]
|
|
41038
41153
|
}
|
|
41039
41154
|
);
|
|
41155
|
+
return hudBottom ? reactDom.createPortal(panel, hudBottom) : panel;
|
|
41040
41156
|
}
|
|
41041
41157
|
function RuntimeDebugger({
|
|
41042
41158
|
position = "bottom-right",
|
|
@@ -46871,20 +46987,14 @@ init_Avl3DStateNode();
|
|
|
46871
46987
|
init_Avl3DTransitionArc();
|
|
46872
46988
|
init_Avl3DExprTree();
|
|
46873
46989
|
|
|
46874
|
-
// components/organisms/avl/
|
|
46875
|
-
init_Box();
|
|
46876
|
-
init_Typography();
|
|
46877
|
-
|
|
46878
|
-
// components/organisms/avl/TransitionPanel.tsx
|
|
46990
|
+
// components/organisms/avl/OrbInspector.tsx
|
|
46879
46991
|
init_Box();
|
|
46880
46992
|
init_Typography();
|
|
46881
46993
|
init_types();
|
|
46882
46994
|
function formatExpression(expr) {
|
|
46883
46995
|
if (!expr) return "";
|
|
46884
46996
|
if (typeof expr === "string") return expr;
|
|
46885
|
-
if (Array.isArray(expr)) {
|
|
46886
|
-
return `(${expr.map(formatExpression).join(" ")})`;
|
|
46887
|
-
}
|
|
46997
|
+
if (Array.isArray(expr)) return `(${expr.map(formatExpression).join(" ")})`;
|
|
46888
46998
|
return String(expr);
|
|
46889
46999
|
}
|
|
46890
47000
|
var KNOWN_EFFECTS = /* @__PURE__ */ new Set([
|
|
@@ -46902,153 +47012,255 @@ var KNOWN_EFFECTS = /* @__PURE__ */ new Set([
|
|
|
46902
47012
|
"if",
|
|
46903
47013
|
"log"
|
|
46904
47014
|
]);
|
|
46905
|
-
function effectSummary(
|
|
46906
|
-
|
|
46907
|
-
|
|
46908
|
-
|
|
46909
|
-
|
|
46910
|
-
|
|
46911
|
-
|
|
46912
|
-
|
|
46913
|
-
|
|
46914
|
-
|
|
46915
|
-
|
|
46916
|
-
|
|
46917
|
-
|
|
46918
|
-
|
|
46919
|
-
|
|
46920
|
-
|
|
46921
|
-
|
|
46922
|
-
|
|
46923
|
-
|
|
46924
|
-
|
|
46925
|
-
}
|
|
47015
|
+
function effectSummary(type) {
|
|
47016
|
+
return type;
|
|
47017
|
+
}
|
|
47018
|
+
var FIELD_TYPE_MAP = {
|
|
47019
|
+
string: "string",
|
|
47020
|
+
number: "number",
|
|
47021
|
+
boolean: "boolean",
|
|
47022
|
+
date: "date",
|
|
47023
|
+
enum: "enum",
|
|
47024
|
+
object: "object",
|
|
47025
|
+
array: "array"
|
|
47026
|
+
};
|
|
47027
|
+
function findEntity(schema, orbitalName) {
|
|
47028
|
+
const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
|
|
47029
|
+
if (!orbital || typeof orbital.entity === "string") return null;
|
|
47030
|
+
const e = orbital.entity;
|
|
47031
|
+
const fields = (e.fields ?? []).map((f3) => ({
|
|
47032
|
+
name: f3.name ?? "",
|
|
47033
|
+
type: f3.type ?? "string",
|
|
47034
|
+
required: f3.required
|
|
47035
|
+
}));
|
|
47036
|
+
return { name: e.name ?? orbitalName, persistence: e.persistence ?? "runtime", fields };
|
|
46926
47037
|
}
|
|
46927
|
-
function
|
|
46928
|
-
const
|
|
46929
|
-
|
|
46930
|
-
const
|
|
46931
|
-
const
|
|
46932
|
-
|
|
46933
|
-
const
|
|
46934
|
-
|
|
46935
|
-
|
|
46936
|
-
|
|
46937
|
-
|
|
46938
|
-
const
|
|
47038
|
+
function findTransition(schema, orbitalName, traitName, event) {
|
|
47039
|
+
const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
|
|
47040
|
+
if (!orbital) return null;
|
|
47041
|
+
const traits2 = orbital.traits ?? [];
|
|
47042
|
+
const trait = traits2.find((t) => typeof t !== "string" && t.name === traitName);
|
|
47043
|
+
if (!trait || typeof trait === "string") return null;
|
|
47044
|
+
const sm = trait.stateMachine;
|
|
47045
|
+
if (!sm) return null;
|
|
47046
|
+
return sm.transitions?.find((t) => t.event === event) ?? null;
|
|
47047
|
+
}
|
|
47048
|
+
function findTraits(schema, orbitalName) {
|
|
47049
|
+
const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
|
|
47050
|
+
if (!orbital) return [];
|
|
47051
|
+
return (orbital.traits ?? []).filter((t) => typeof t !== "string").map((t) => ({
|
|
47052
|
+
name: t.name,
|
|
47053
|
+
stateCount: t.stateMachine?.states?.length ?? 0
|
|
47054
|
+
}));
|
|
47055
|
+
}
|
|
47056
|
+
function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose }) {
|
|
46939
47057
|
const { selected: selectedPattern } = React124.useContext(PatternSelectionContext);
|
|
46940
|
-
|
|
46941
|
-
|
|
46942
|
-
|
|
46943
|
-
|
|
46944
|
-
|
|
46945
|
-
|
|
46946
|
-
|
|
46947
|
-
|
|
46948
|
-
|
|
46949
|
-
|
|
46950
|
-
|
|
46951
|
-
|
|
46952
|
-
|
|
46953
|
-
|
|
46954
|
-
|
|
46955
|
-
|
|
46956
|
-
|
|
47058
|
+
const [activeTab, setActiveTab] = React124.useState("inspector");
|
|
47059
|
+
const orbitalName = node.orbitalName ?? "";
|
|
47060
|
+
const traitName = node.traitName ?? "";
|
|
47061
|
+
const transitionEvent = node.transitionEvent ?? "";
|
|
47062
|
+
const fromState = node.fromState ?? "";
|
|
47063
|
+
const toState = node.toState ?? "";
|
|
47064
|
+
const entityName = node.entityName ?? "";
|
|
47065
|
+
const patterns$1 = node.patterns ?? [];
|
|
47066
|
+
const effectTypes = node.effectTypes ?? [];
|
|
47067
|
+
const guard = node.guard;
|
|
47068
|
+
const isExpanded = Boolean(traitName);
|
|
47069
|
+
const patternType = selectedPattern?.patternType;
|
|
47070
|
+
const patternDef = React124.useMemo(() => patternType ? patterns.getPatternDefinition(patternType) : null, [patternType]);
|
|
47071
|
+
const isEntityPattern = patternType ? patterns.isEntityAwarePattern(patternType) : false;
|
|
47072
|
+
const entity = React124.useMemo(() => findEntity(schema, orbitalName), [schema, orbitalName]);
|
|
47073
|
+
const transition = React124.useMemo(() => {
|
|
47074
|
+
if (!traitName || !transitionEvent) return null;
|
|
47075
|
+
return findTransition(schema, orbitalName, traitName, transitionEvent);
|
|
47076
|
+
}, [schema, orbitalName, traitName, transitionEvent]);
|
|
47077
|
+
const traits2 = React124.useMemo(() => findTraits(schema, orbitalName), [schema, orbitalName]);
|
|
47078
|
+
const orbCode = React124.useMemo(() => {
|
|
47079
|
+
const orbital = schema.orbitals?.find((o) => o.name === orbitalName);
|
|
47080
|
+
if (!orbital) return "{}";
|
|
47081
|
+
if (isExpanded && traitName) {
|
|
47082
|
+
const traits3 = orbital.traits ?? [];
|
|
47083
|
+
const trait = traits3.find((t) => typeof t !== "string" && t.name === traitName);
|
|
47084
|
+
if (trait && typeof trait !== "string" && trait.stateMachine) {
|
|
47085
|
+
if (transitionEvent) {
|
|
47086
|
+
const t = trait.stateMachine.transitions?.find((tx) => tx.event === transitionEvent);
|
|
47087
|
+
if (t) return JSON.stringify(t, null, 2);
|
|
47088
|
+
}
|
|
47089
|
+
return JSON.stringify({ name: trait.name, stateMachine: trait.stateMachine }, null, 2);
|
|
47090
|
+
}
|
|
47091
|
+
}
|
|
47092
|
+
return JSON.stringify(orbital, null, 2);
|
|
47093
|
+
}, [schema, orbitalName, traitName, transitionEvent, isExpanded]);
|
|
47094
|
+
const handlePropChange = React124.useCallback((prop, value) => {
|
|
47095
|
+
if (!editable || !onSchemaChange) return;
|
|
47096
|
+
}, [editable, onSchemaChange]);
|
|
47097
|
+
const headerTitle = selectedPattern ? selectedPattern.patternType : isExpanded ? transitionEvent || "Transition" : orbitalName;
|
|
47098
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex flex-col bg-card border-l border-border h-full", style: { width: 340 }, children: [
|
|
47099
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "shrink-0 border-b border-border", children: [
|
|
47100
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center justify-between px-4 py-2", children: [
|
|
47101
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center gap-2", children: selectedPattern ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
47102
|
+
Box,
|
|
47103
|
+
{
|
|
47104
|
+
className: "rounded px-2 py-0.5 text-[11px] font-mono font-semibold",
|
|
47105
|
+
style: { backgroundColor: "var(--color-primary)", color: "var(--color-primary-foreground)" },
|
|
47106
|
+
children: headerTitle
|
|
47107
|
+
}
|
|
47108
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold", children: headerTitle }) }),
|
|
47109
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47110
|
+
"button",
|
|
47111
|
+
{
|
|
47112
|
+
onClick: onClose,
|
|
47113
|
+
className: "text-muted-foreground hover:text-foreground text-sm cursor-pointer bg-transparent border-none p-1",
|
|
47114
|
+
"aria-label": "Close",
|
|
47115
|
+
children: "\xD7"
|
|
47116
|
+
}
|
|
47117
|
+
)
|
|
47118
|
+
] }),
|
|
47119
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex px-4 gap-4", children: [
|
|
47120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47121
|
+
"button",
|
|
47122
|
+
{
|
|
47123
|
+
onClick: () => setActiveTab("inspector"),
|
|
47124
|
+
className: `pb-2 text-[12px] font-medium border-b-2 cursor-pointer bg-transparent border-x-0 border-t-0 px-0 ${activeTab === "inspector" ? "border-[var(--color-primary)] text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
47125
|
+
children: "Inspector"
|
|
47126
|
+
}
|
|
47127
|
+
),
|
|
47128
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47129
|
+
"button",
|
|
47130
|
+
{
|
|
47131
|
+
onClick: () => setActiveTab("code"),
|
|
47132
|
+
className: `pb-2 text-[12px] font-medium border-b-2 cursor-pointer bg-transparent border-x-0 border-t-0 px-0 ${activeTab === "code" ? "border-[var(--color-primary)] text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
47133
|
+
children: "Code"
|
|
47134
|
+
}
|
|
47135
|
+
)
|
|
47136
|
+
] })
|
|
47137
|
+
] }),
|
|
47138
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 overflow-y-auto", children: activeTab === "code" ? (
|
|
47139
|
+
/* ── Code Tab ── */
|
|
47140
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "p-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
47141
|
+
CodeBlock,
|
|
47142
|
+
{
|
|
47143
|
+
code: orbCode,
|
|
47144
|
+
language: "orb",
|
|
47145
|
+
showCopyButton: true,
|
|
47146
|
+
showLanguageBadge: true,
|
|
47147
|
+
maxHeight: "100%"
|
|
47148
|
+
}
|
|
47149
|
+
) })
|
|
47150
|
+
) : (
|
|
47151
|
+
/* ── Inspector Tab ── */
|
|
47152
|
+
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
47153
|
+
selectedPattern && patternDef?.propsSchema && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47154
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Props" }),
|
|
47155
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-1.5", children: Object.entries(patternDef.propsSchema).slice(0, 8).map(([propName, propSchema]) => {
|
|
47156
|
+
const ps = propSchema;
|
|
47157
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47158
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px] w-20 shrink-0 font-mono", children: propName }),
|
|
47159
|
+
editable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
47160
|
+
Input,
|
|
47161
|
+
{
|
|
47162
|
+
placeholder: ps.types?.join(" | ") ?? "string",
|
|
47163
|
+
className: "flex-1 text-[11px] h-6",
|
|
47164
|
+
onChange: (e) => handlePropChange(propName, e.target.value)
|
|
47165
|
+
}
|
|
47166
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-[11px] text-muted-foreground", children: [
|
|
47167
|
+
ps.types?.join(" | ") ?? "string",
|
|
47168
|
+
ps.required ? " *" : ""
|
|
47169
|
+
] })
|
|
47170
|
+
] }, propName);
|
|
47171
|
+
}) })
|
|
46957
47172
|
] }),
|
|
46958
|
-
selectedPattern && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border
|
|
46959
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "
|
|
47173
|
+
(selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47174
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Entity" }),
|
|
46960
47175
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 mb-2", children: [
|
|
46961
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
46962
|
-
|
|
46963
|
-
|
|
46964
|
-
className: "rounded px-2 py-0.5 text-[11px] font-mono font-semibold",
|
|
46965
|
-
style: {
|
|
46966
|
-
backgroundColor: "var(--color-primary)",
|
|
46967
|
-
color: "var(--color-primary-foreground)"
|
|
46968
|
-
},
|
|
46969
|
-
children: selectedPattern.patternType
|
|
46970
|
-
}
|
|
46971
|
-
),
|
|
46972
|
-
selectedPattern.patternId && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px] font-mono", children: [
|
|
46973
|
-
"#",
|
|
46974
|
-
selectedPattern.patternId
|
|
46975
|
-
] })
|
|
47176
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 14, height: 14, children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 7, cy: 7, r: 5, fill: "var(--color-primary)" }) }),
|
|
47177
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: entity.name }),
|
|
47178
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: entity.persistence })
|
|
46976
47179
|
] }),
|
|
46977
|
-
|
|
46978
|
-
"
|
|
46979
|
-
|
|
46980
|
-
|
|
47180
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-1", children: entity.fields.map((f3) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47181
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 12, height: 12, children: /* @__PURE__ */ jsxRuntime.jsx(AvlFieldType, { x: 6, y: 6, kind: FIELD_TYPE_MAP[f3.type] ?? "string", size: 4 }) }),
|
|
47182
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-[11px] font-mono flex-1", children: f3.name }),
|
|
47183
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: f3.type }),
|
|
47184
|
+
f3.required && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-primary text-[9px]", children: "req" })
|
|
47185
|
+
] }, f3.name)) })
|
|
47186
|
+
] }),
|
|
47187
|
+
!selectedPattern && !isExpanded && traits2.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47188
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Traits" }),
|
|
47189
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-1", children: traits2.map((t) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47190
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-[11px] font-semibold", children: t.name }),
|
|
47191
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: [
|
|
47192
|
+
t.stateCount,
|
|
47193
|
+
" states"
|
|
47194
|
+
] })
|
|
47195
|
+
] }, t.name)) })
|
|
46981
47196
|
] }),
|
|
46982
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
46983
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "
|
|
46984
|
-
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "100%", height:
|
|
46985
|
-
/* @__PURE__ */ jsxRuntime.jsx(AvlState, { x:
|
|
46986
|
-
/* @__PURE__ */ jsxRuntime.jsx("line", { x1:
|
|
46987
|
-
/* @__PURE__ */ jsxRuntime.jsx(AvlState, { x:
|
|
46988
|
-
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "arrow
|
|
47197
|
+
isExpanded && fromState && toState && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47198
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "Transition" }),
|
|
47199
|
+
/* @__PURE__ */ jsxRuntime.jsxs("svg", { width: "100%", height: 44, viewBox: "0 0 280 44", children: [
|
|
47200
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvlState, { x: 8, y: 8, name: fromState, role: getStateRole(fromState), width: 90, height: 26 }),
|
|
47201
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: 104, y1: 21, x2: 158, y2: 21, stroke: "#1E293B", strokeWidth: 2, markerEnd: "url(#orb-arrow)" }),
|
|
47202
|
+
/* @__PURE__ */ jsxRuntime.jsx(AvlState, { x: 164, y: 8, name: toState, role: getStateRole(toState), width: 90, height: 26 }),
|
|
47203
|
+
/* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsx("marker", { id: "orb-arrow", markerWidth: 8, markerHeight: 6, refX: 8, refY: 3, orient: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M0,0 L8,3 L0,6 Z", fill: "#1E293B" }) }) })
|
|
46989
47204
|
] }),
|
|
46990
|
-
traitName && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[11px]
|
|
46991
|
-
"Trait: ",
|
|
47205
|
+
traitName && /* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[11px]", children: [
|
|
46992
47206
|
traitName,
|
|
46993
|
-
|
|
46994
|
-
entityName ? `on ${entityName}` : ""
|
|
47207
|
+
entityName ? ` on ${entityName}` : ""
|
|
46995
47208
|
] })
|
|
46996
47209
|
] }),
|
|
46997
|
-
/* @__PURE__ */ jsxRuntime.
|
|
46998
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
46999
|
-
/* @__PURE__ */ jsxRuntime.
|
|
47000
|
-
|
|
47001
|
-
|
|
47002
|
-
|
|
47003
|
-
|
|
47004
|
-
|
|
47005
|
-
|
|
47006
|
-
|
|
47007
|
-
|
|
47008
|
-
|
|
47009
|
-
] })
|
|
47010
|
-
] }),
|
|
47011
|
-
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47210
|
+
isExpanded && transitionEvent && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47211
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsxRuntime.jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
|
|
47212
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: transitionEvent })
|
|
47213
|
+
] }) }),
|
|
47214
|
+
(transition?.guard ?? guard) && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47215
|
+
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsxRuntime.jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
|
|
47216
|
+
editable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
47217
|
+
Input,
|
|
47218
|
+
{
|
|
47219
|
+
defaultValue: formatExpression(transition?.guard ?? guard),
|
|
47220
|
+
className: "flex-1 text-[11px] font-mono h-6"
|
|
47221
|
+
}
|
|
47222
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-mono text-[11px] text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
|
|
47223
|
+
] }) }),
|
|
47224
|
+
effectTypes.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
47012
47225
|
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: [
|
|
47013
47226
|
"Effects (",
|
|
47014
|
-
|
|
47227
|
+
effectTypes.length,
|
|
47015
47228
|
")"
|
|
47016
47229
|
] }),
|
|
47017
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-
|
|
47018
|
-
const isKnown = KNOWN_EFFECTS.has(
|
|
47019
|
-
const category = exports.EFFECT_TYPE_TO_CATEGORY[
|
|
47230
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-1.5", children: effectTypes.map((type, i) => {
|
|
47231
|
+
const isKnown = KNOWN_EFFECTS.has(type);
|
|
47232
|
+
const category = exports.EFFECT_TYPE_TO_CATEGORY[type];
|
|
47020
47233
|
const catColor = category ? exports.EFFECT_CATEGORY_COLORS[category] : void 0;
|
|
47021
47234
|
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
47022
47235
|
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[11px] w-4 text-right shrink-0", children: [
|
|
47023
47236
|
i + 1,
|
|
47024
47237
|
"."
|
|
47025
47238
|
] }),
|
|
47026
|
-
isKnown
|
|
47027
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-[
|
|
47239
|
+
isKnown && /* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsxRuntime.jsx(AvlEffect, { x: 8, y: 8, effectType: type, size: 6, showBackground: true }) }),
|
|
47240
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-[11px]", style: { color: catColor?.color }, children: effectSummary(type) })
|
|
47028
47241
|
] }, i);
|
|
47029
47242
|
}) })
|
|
47030
47243
|
] }),
|
|
47031
|
-
patterns.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3", children: [
|
|
47032
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "render-ui
|
|
47033
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "bg-muted/20 rounded-md p-3 font-mono text-[11px] leading-relaxed overflow-x-auto", children: patterns.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
47244
|
+
patterns$1.length > 0 && !selectedPattern && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3", children: [
|
|
47245
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "render-ui" }),
|
|
47246
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "bg-muted/20 rounded-md p-3 font-mono text-[11px] leading-relaxed overflow-x-auto", children: patterns$1.map((entry, i) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
47034
47247
|
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: [
|
|
47035
47248
|
"slot: ",
|
|
47036
47249
|
entry.slot
|
|
47037
47250
|
] }),
|
|
47038
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
47251
|
+
/* @__PURE__ */ jsxRuntime.jsx(OrbPatternTree, { config: entry.pattern, depth: 0 })
|
|
47039
47252
|
] }, i)) })
|
|
47040
47253
|
] })
|
|
47041
|
-
]
|
|
47042
|
-
}
|
|
47043
|
-
);
|
|
47254
|
+
] })
|
|
47255
|
+
) })
|
|
47256
|
+
] });
|
|
47044
47257
|
}
|
|
47045
|
-
function
|
|
47258
|
+
function OrbPatternTree({ config, depth }) {
|
|
47046
47259
|
if (!config || typeof config !== "object") return null;
|
|
47047
47260
|
const { type, children, ...props } = config;
|
|
47048
47261
|
if (typeof type !== "string") return null;
|
|
47049
|
-
const indent = depth * 12;
|
|
47050
47262
|
const propEntries = Object.entries(props).filter(([k]) => k !== "type");
|
|
47051
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { style: { paddingLeft:
|
|
47263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { style: { paddingLeft: depth * 12 }, children: [
|
|
47052
47264
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-primary font-semibold text-[11px]", children: type }),
|
|
47053
47265
|
propEntries.slice(0, 5).map(([key, val]) => {
|
|
47054
47266
|
const display = typeof val === "string" ? val.startsWith("@") ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-purple-500", children: val }) : `"${val}"` : Array.isArray(val) && typeof val[0] === "string" && val[0].includes("/") ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-amber-600", children: [
|
|
@@ -47064,10 +47276,14 @@ function PatternTree({ config, depth }) {
|
|
|
47064
47276
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: display })
|
|
47065
47277
|
] }, key);
|
|
47066
47278
|
}),
|
|
47067
|
-
Array.isArray(children) && children.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
47279
|
+
Array.isArray(children) && children.map((child, i) => /* @__PURE__ */ jsxRuntime.jsx(OrbPatternTree, { config: child, depth: depth + 1 }, i))
|
|
47068
47280
|
] });
|
|
47069
47281
|
}
|
|
47070
|
-
|
|
47282
|
+
OrbInspector.displayName = "OrbInspector";
|
|
47283
|
+
|
|
47284
|
+
// components/organisms/avl/FlowCanvas.tsx
|
|
47285
|
+
init_Box();
|
|
47286
|
+
init_Typography();
|
|
47071
47287
|
var NODE_TYPES = {
|
|
47072
47288
|
preview: OrbPreviewNode
|
|
47073
47289
|
};
|
|
@@ -47085,7 +47301,9 @@ function FlowCanvasInner({
|
|
|
47085
47301
|
height = 500,
|
|
47086
47302
|
onNodeClick,
|
|
47087
47303
|
onLevelChange,
|
|
47088
|
-
initialOrbital
|
|
47304
|
+
initialOrbital,
|
|
47305
|
+
editable,
|
|
47306
|
+
onSchemaChange
|
|
47089
47307
|
}) {
|
|
47090
47308
|
const parsedSchema = React124.useMemo(() => {
|
|
47091
47309
|
if (typeof schemaProp === "string") return JSON.parse(schemaProp);
|
|
@@ -47282,7 +47500,16 @@ function FlowCanvasInner({
|
|
|
47282
47500
|
}
|
|
47283
47501
|
)
|
|
47284
47502
|
] }),
|
|
47285
|
-
selectedNode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
47503
|
+
selectedNode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
47504
|
+
OrbInspector,
|
|
47505
|
+
{
|
|
47506
|
+
node: selectedNode,
|
|
47507
|
+
schema: parsedSchema,
|
|
47508
|
+
editable,
|
|
47509
|
+
onSchemaChange,
|
|
47510
|
+
onClose: handleClosePanel
|
|
47511
|
+
}
|
|
47512
|
+
)
|
|
47286
47513
|
]
|
|
47287
47514
|
}
|
|
47288
47515
|
) }) });
|
|
@@ -47863,6 +48090,7 @@ exports.EventFlowEdge = EventFlowEdge;
|
|
|
47863
48090
|
exports.FlowCanvas = FlowCanvas;
|
|
47864
48091
|
exports.MiniStateMachine = MiniStateMachine;
|
|
47865
48092
|
exports.ModuleCard = ModuleCard;
|
|
48093
|
+
exports.OrbInspector = OrbInspector;
|
|
47866
48094
|
exports.OrbPreviewNode = OrbPreviewNode;
|
|
47867
48095
|
exports.SystemNode = SystemNode;
|
|
47868
48096
|
exports.ZOOM_BAND_THRESHOLDS = ZOOM_BAND_THRESHOLDS;
|