@almadar/ui 4.50.9 → 4.50.10
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
CHANGED
|
@@ -59826,7 +59826,7 @@ function findPatternInTree(root, path) {
|
|
|
59826
59826
|
}
|
|
59827
59827
|
var FIELD_TYPE_OPTIONS = core.FieldTypeSchema.options.map((v) => ({ value: v, label: v }));
|
|
59828
59828
|
var EFFECT_TYPE_OPTIONS = Object.keys(exports.EFFECT_TYPE_TO_CATEGORY).map((v) => ({ value: v, label: v }));
|
|
59829
|
-
function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose }) {
|
|
59829
|
+
function OrbInspector({ node, schema, editable = false, userType = "builder", onSchemaChange, onClose }) {
|
|
59830
59830
|
const { selected: selectedPattern } = React93.useContext(PatternSelectionContext);
|
|
59831
59831
|
const [activeTab, setActiveTab] = React93.useState("inspector");
|
|
59832
59832
|
const eventBus = useEventBus();
|
|
@@ -59932,27 +59932,18 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59932
59932
|
}
|
|
59933
59933
|
)
|
|
59934
59934
|
] }),
|
|
59935
|
-
/* @__PURE__ */ jsxRuntime.
|
|
59936
|
-
|
|
59937
|
-
|
|
59938
|
-
|
|
59939
|
-
|
|
59940
|
-
|
|
59941
|
-
|
|
59942
|
-
|
|
59943
|
-
|
|
59944
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
59945
|
-
"button",
|
|
59946
|
-
{
|
|
59947
|
-
onClick: () => setActiveTab("code"),
|
|
59948
|
-
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"}`,
|
|
59949
|
-
children: "Code"
|
|
59950
|
-
}
|
|
59951
|
-
)
|
|
59952
|
-
] })
|
|
59935
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex px-4 gap-4", children: ["inspector", "styles", "code"].filter((tab) => tab !== "code" || userType === "architect").map((tab) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
59936
|
+
"button",
|
|
59937
|
+
{
|
|
59938
|
+
onClick: () => setActiveTab(tab),
|
|
59939
|
+
className: `pb-2 text-[12px] font-medium border-b-2 cursor-pointer bg-transparent border-x-0 border-t-0 px-0 capitalize ${activeTab === tab ? "border-[var(--color-primary)] text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
59940
|
+
children: tab
|
|
59941
|
+
},
|
|
59942
|
+
tab
|
|
59943
|
+
)) })
|
|
59953
59944
|
] }),
|
|
59954
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 overflow-y-auto", children: activeTab === "code" ? (
|
|
59955
|
-
/* ── Code Tab ── */
|
|
59945
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex-1 overflow-y-auto", children: activeTab === "code" && userType === "architect" ? (
|
|
59946
|
+
/* ── Code Tab (architect only) ── */
|
|
59956
59947
|
/* GAP-51: when editable, the CodeBlock molecule renders the existing
|
|
59957
59948
|
Textarea atom internally and forwards keystrokes via UI:CODE_CHANGE
|
|
59958
59949
|
on the EventBus. The consumer (builder workspace) listens, debounces,
|
|
@@ -59970,6 +59961,21 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59970
59961
|
onChange: editable ? (code) => eventBus.emit("UI:CODE_CHANGE", { code }) : void 0
|
|
59971
59962
|
}
|
|
59972
59963
|
) })
|
|
59964
|
+
) : activeTab === "styles" ? (
|
|
59965
|
+
/* ── Styles Tab (read-only in Phase 2) ──
|
|
59966
|
+
Phase 2 ships a token-only viewer with no editing. The proper
|
|
59967
|
+
tokenContract on PatternDefinition lands in Phase 6; until then
|
|
59968
|
+
we fall back to a static map of well-known atoms keyed by
|
|
59969
|
+
pattern type. Patterns missing from the map render a placeholder
|
|
59970
|
+
so the gap is visible rather than silently empty. */
|
|
59971
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
59972
|
+
StylesTabReadOnly,
|
|
59973
|
+
{
|
|
59974
|
+
patternType,
|
|
59975
|
+
patternDef,
|
|
59976
|
+
patternConfig
|
|
59977
|
+
}
|
|
59978
|
+
)
|
|
59973
59979
|
) : (
|
|
59974
59980
|
/* ── Inspector Tab ── */
|
|
59975
59981
|
/* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -59996,7 +60002,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59996
60002
|
] }, propName);
|
|
59997
60003
|
}) })
|
|
59998
60004
|
] }),
|
|
59999
|
-
(selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60005
|
+
userType === "architect" && (selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60000
60006
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Entity") }),
|
|
60001
60007
|
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 mb-2", children: [
|
|
60002
60008
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 14, height: 14, children: /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: 7, cy: 7, r: 5, fill: "var(--color-primary)" }) }),
|
|
@@ -60120,7 +60126,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60120
60126
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsxRuntime.jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
|
|
60121
60127
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: transitionEvent })
|
|
60122
60128
|
] }) }),
|
|
60123
|
-
(transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60129
|
+
userType === "architect" && (transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60124
60130
|
/* @__PURE__ */ jsxRuntime.jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsxRuntime.jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
|
|
60125
60131
|
editable ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
60126
60132
|
Input,
|
|
@@ -60132,7 +60138,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60132
60138
|
}
|
|
60133
60139
|
) : /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-mono text-[11px] text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
|
|
60134
60140
|
] }) }),
|
|
60135
|
-
(effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60141
|
+
userType === "architect" && (effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60136
60142
|
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: [
|
|
60137
60143
|
t("Effects"),
|
|
60138
60144
|
" (",
|
|
@@ -60164,7 +60170,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60164
60170
|
}) }),
|
|
60165
60171
|
editable && /* @__PURE__ */ jsxRuntime.jsx(AddEffectButton, { onAdd: handleAddEffect })
|
|
60166
60172
|
] }),
|
|
60167
|
-
patterns$1.length > 0 && !selectedPattern && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3", children: [
|
|
60173
|
+
userType === "architect" && patterns$1.length > 0 && !selectedPattern && /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3", children: [
|
|
60168
60174
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "render-ui" }),
|
|
60169
60175
|
/* @__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: [
|
|
60170
60176
|
/* @__PURE__ */ jsxRuntime.jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: [
|
|
@@ -60237,6 +60243,83 @@ function OrbPatternTree({ config, depth }) {
|
|
|
60237
60243
|
] });
|
|
60238
60244
|
}
|
|
60239
60245
|
OrbInspector.displayName = "OrbInspector";
|
|
60246
|
+
var PHASE_2_TOKEN_FALLBACK = {
|
|
60247
|
+
button: ["--color-primary", "--color-primary-foreground", "--radius-md", "--shadow-sm"],
|
|
60248
|
+
badge: ["--color-primary", "--radius-full"],
|
|
60249
|
+
card: ["--color-card", "--color-border", "--radius-lg", "--shadow-main"],
|
|
60250
|
+
input: ["--color-input", "--color-border", "--radius-md"],
|
|
60251
|
+
typography: ["--color-foreground", "--color-muted-foreground"],
|
|
60252
|
+
divider: ["--color-border"],
|
|
60253
|
+
avatar: ["--radius-full", "--color-muted"],
|
|
60254
|
+
alert: ["--color-warning", "--color-success", "--color-danger", "--radius-md"],
|
|
60255
|
+
modal: ["--color-card", "--shadow-lg", "--radius-lg"],
|
|
60256
|
+
toast: ["--color-card", "--shadow-lg", "--radius-md"]
|
|
60257
|
+
};
|
|
60258
|
+
function StylesTabReadOnly({ patternType, patternDef, patternConfig }) {
|
|
60259
|
+
const { t } = useTranslate();
|
|
60260
|
+
if (!patternType) {
|
|
60261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "p-4", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px]", children: t("Select a pattern to view its style tokens.") }) });
|
|
60262
|
+
}
|
|
60263
|
+
const tier = patternDef?.category ?? "Pattern";
|
|
60264
|
+
const tokens = PHASE_2_TOKEN_FALLBACK[patternType] ?? [];
|
|
60265
|
+
const variantEnum = patternDef?.propsSchema?.variant?.enumValues;
|
|
60266
|
+
const sizeEnum = patternDef?.propsSchema?.size?.enumValues;
|
|
60267
|
+
const currentVariant = patternConfig && typeof patternConfig.variant === "string" ? patternConfig.variant : void 0;
|
|
60268
|
+
const currentSize = patternConfig && typeof patternConfig.size === "string" ? patternConfig.size : void 0;
|
|
60269
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "px-4 py-3 flex flex-col gap-4", children: [
|
|
60270
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
60271
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: patternType }),
|
|
60272
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
60273
|
+
Box,
|
|
60274
|
+
{
|
|
60275
|
+
className: "rounded px-1.5 py-0.5 text-[9px] font-mono uppercase tracking-wider",
|
|
60276
|
+
style: { backgroundColor: "var(--color-muted)", color: "var(--color-muted-foreground)" },
|
|
60277
|
+
children: tier
|
|
60278
|
+
}
|
|
60279
|
+
)
|
|
60280
|
+
] }),
|
|
60281
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
60282
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Tokens") }),
|
|
60283
|
+
tokens.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px] italic", children: t("No token contract declared for this pattern.") }) : /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-col gap-1", children: tokens.map((token) => /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "font-mono text-[11px]", children: token }) }, token)) })
|
|
60284
|
+
] }),
|
|
60285
|
+
variantEnum && variantEnum.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
60286
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Variant") }),
|
|
60287
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-wrap gap-1", children: variantEnum.map((variant) => {
|
|
60288
|
+
const isActive = variant === currentVariant || !currentVariant && variant === "default";
|
|
60289
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
60290
|
+
Box,
|
|
60291
|
+
{
|
|
60292
|
+
className: "rounded px-2 py-0.5 text-[11px] font-mono",
|
|
60293
|
+
style: {
|
|
60294
|
+
backgroundColor: isActive ? "var(--color-primary)" : "var(--color-muted)",
|
|
60295
|
+
color: isActive ? "var(--color-primary-foreground)" : "var(--color-muted-foreground)"
|
|
60296
|
+
},
|
|
60297
|
+
children: variant
|
|
60298
|
+
},
|
|
60299
|
+
variant
|
|
60300
|
+
);
|
|
60301
|
+
}) })
|
|
60302
|
+
] }),
|
|
60303
|
+
sizeEnum && sizeEnum.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Box, { children: [
|
|
60304
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Size") }),
|
|
60305
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "flex flex-wrap gap-1", children: sizeEnum.map((size) => {
|
|
60306
|
+
const isActive = size === currentSize || !currentSize && size === "md";
|
|
60307
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
60308
|
+
Box,
|
|
60309
|
+
{
|
|
60310
|
+
className: "rounded px-2 py-0.5 text-[11px] font-mono",
|
|
60311
|
+
style: {
|
|
60312
|
+
backgroundColor: isActive ? "var(--color-primary)" : "var(--color-muted)",
|
|
60313
|
+
color: isActive ? "var(--color-primary-foreground)" : "var(--color-muted-foreground)"
|
|
60314
|
+
},
|
|
60315
|
+
children: size
|
|
60316
|
+
},
|
|
60317
|
+
size
|
|
60318
|
+
);
|
|
60319
|
+
}) })
|
|
60320
|
+
] })
|
|
60321
|
+
] });
|
|
60322
|
+
}
|
|
60240
60323
|
|
|
60241
60324
|
// components/organisms/avl/FlowCanvas.tsx
|
|
60242
60325
|
init_Box();
|
|
@@ -60280,7 +60363,8 @@ function FlowCanvasInner({
|
|
|
60280
60363
|
onNodeSelect,
|
|
60281
60364
|
composeLevel,
|
|
60282
60365
|
behaviorEntries,
|
|
60283
|
-
behaviorWires
|
|
60366
|
+
behaviorWires,
|
|
60367
|
+
userType = "builder"
|
|
60284
60368
|
}) {
|
|
60285
60369
|
const NODE_TYPES2 = React93.useMemo(() => ({
|
|
60286
60370
|
preview: OrbPreviewNode,
|
|
@@ -60575,6 +60659,7 @@ function FlowCanvasInner({
|
|
|
60575
60659
|
node: selectedNode,
|
|
60576
60660
|
schema: parsedSchema,
|
|
60577
60661
|
editable,
|
|
60662
|
+
userType,
|
|
60578
60663
|
onSchemaChange,
|
|
60579
60664
|
onClose: handleClosePanel
|
|
60580
60665
|
}
|
package/dist/avl/index.d.cts
CHANGED
|
@@ -1196,10 +1196,18 @@ interface OrbInspectorProps {
|
|
|
1196
1196
|
node: PreviewNodeData;
|
|
1197
1197
|
schema: OrbitalSchema;
|
|
1198
1198
|
editable?: boolean;
|
|
1199
|
+
/**
|
|
1200
|
+
* Studio persona viewing the inspector. Controls tab visibility (Code is
|
|
1201
|
+
* architect-only, Styles is universal) and section visibility (Entity,
|
|
1202
|
+
* raw guard, raw effects are architect-only). Default `'builder'` matches
|
|
1203
|
+
* pre-Phase-2 behavior except for the new Styles tab, which every persona
|
|
1204
|
+
* gets.
|
|
1205
|
+
*/
|
|
1206
|
+
userType?: 'builder' | 'designer' | 'architect';
|
|
1199
1207
|
onSchemaChange?: (schema: OrbitalSchema) => void;
|
|
1200
1208
|
onClose: () => void;
|
|
1201
1209
|
}
|
|
1202
|
-
declare function OrbInspector({ node, schema, editable, onSchemaChange, onClose }: OrbInspectorProps): React__default.ReactElement;
|
|
1210
|
+
declare function OrbInspector({ node, schema, editable, userType, onSchemaChange, onClose }: OrbInspectorProps): React__default.ReactElement;
|
|
1203
1211
|
declare namespace OrbInspector {
|
|
1204
1212
|
var displayName: string;
|
|
1205
1213
|
}
|
|
@@ -1320,6 +1328,13 @@ interface FlowCanvasProps {
|
|
|
1320
1328
|
initialTrait?: string;
|
|
1321
1329
|
/** @deprecated Not used in V3. */
|
|
1322
1330
|
stateCoverage?: Record<string, string>;
|
|
1331
|
+
/**
|
|
1332
|
+
* Studio persona viewing the canvas. Drives `OrbInspector` tab/section
|
|
1333
|
+
* visibility — designers and builders hide the raw `code` tab and the
|
|
1334
|
+
* architect-only Entity / raw-guard / raw-effects sections; architects see
|
|
1335
|
+
* everything. Default `'builder'` preserves pre-Phase-2 behavior.
|
|
1336
|
+
*/
|
|
1337
|
+
userType?: 'builder' | 'designer' | 'architect';
|
|
1323
1338
|
}
|
|
1324
1339
|
declare const FlowCanvas: React__default.FC<FlowCanvasProps>;
|
|
1325
1340
|
|
package/dist/avl/index.js
CHANGED
|
@@ -59780,7 +59780,7 @@ function findPatternInTree(root, path) {
|
|
|
59780
59780
|
}
|
|
59781
59781
|
var FIELD_TYPE_OPTIONS = FieldTypeSchema.options.map((v) => ({ value: v, label: v }));
|
|
59782
59782
|
var EFFECT_TYPE_OPTIONS = Object.keys(EFFECT_TYPE_TO_CATEGORY).map((v) => ({ value: v, label: v }));
|
|
59783
|
-
function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose }) {
|
|
59783
|
+
function OrbInspector({ node, schema, editable = false, userType = "builder", onSchemaChange, onClose }) {
|
|
59784
59784
|
const { selected: selectedPattern } = useContext(PatternSelectionContext);
|
|
59785
59785
|
const [activeTab, setActiveTab] = useState("inspector");
|
|
59786
59786
|
const eventBus = useEventBus();
|
|
@@ -59886,27 +59886,18 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59886
59886
|
}
|
|
59887
59887
|
)
|
|
59888
59888
|
] }),
|
|
59889
|
-
/* @__PURE__ */
|
|
59890
|
-
|
|
59891
|
-
|
|
59892
|
-
|
|
59893
|
-
|
|
59894
|
-
|
|
59895
|
-
|
|
59896
|
-
|
|
59897
|
-
|
|
59898
|
-
/* @__PURE__ */ jsx(
|
|
59899
|
-
"button",
|
|
59900
|
-
{
|
|
59901
|
-
onClick: () => setActiveTab("code"),
|
|
59902
|
-
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"}`,
|
|
59903
|
-
children: "Code"
|
|
59904
|
-
}
|
|
59905
|
-
)
|
|
59906
|
-
] })
|
|
59889
|
+
/* @__PURE__ */ jsx(Box, { className: "flex px-4 gap-4", children: ["inspector", "styles", "code"].filter((tab) => tab !== "code" || userType === "architect").map((tab) => /* @__PURE__ */ jsx(
|
|
59890
|
+
"button",
|
|
59891
|
+
{
|
|
59892
|
+
onClick: () => setActiveTab(tab),
|
|
59893
|
+
className: `pb-2 text-[12px] font-medium border-b-2 cursor-pointer bg-transparent border-x-0 border-t-0 px-0 capitalize ${activeTab === tab ? "border-[var(--color-primary)] text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"}`,
|
|
59894
|
+
children: tab
|
|
59895
|
+
},
|
|
59896
|
+
tab
|
|
59897
|
+
)) })
|
|
59907
59898
|
] }),
|
|
59908
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: activeTab === "code" ? (
|
|
59909
|
-
/* ── Code Tab ── */
|
|
59899
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 overflow-y-auto", children: activeTab === "code" && userType === "architect" ? (
|
|
59900
|
+
/* ── Code Tab (architect only) ── */
|
|
59910
59901
|
/* GAP-51: when editable, the CodeBlock molecule renders the existing
|
|
59911
59902
|
Textarea atom internally and forwards keystrokes via UI:CODE_CHANGE
|
|
59912
59903
|
on the EventBus. The consumer (builder workspace) listens, debounces,
|
|
@@ -59924,6 +59915,21 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59924
59915
|
onChange: editable ? (code) => eventBus.emit("UI:CODE_CHANGE", { code }) : void 0
|
|
59925
59916
|
}
|
|
59926
59917
|
) })
|
|
59918
|
+
) : activeTab === "styles" ? (
|
|
59919
|
+
/* ── Styles Tab (read-only in Phase 2) ──
|
|
59920
|
+
Phase 2 ships a token-only viewer with no editing. The proper
|
|
59921
|
+
tokenContract on PatternDefinition lands in Phase 6; until then
|
|
59922
|
+
we fall back to a static map of well-known atoms keyed by
|
|
59923
|
+
pattern type. Patterns missing from the map render a placeholder
|
|
59924
|
+
so the gap is visible rather than silently empty. */
|
|
59925
|
+
/* @__PURE__ */ jsx(
|
|
59926
|
+
StylesTabReadOnly,
|
|
59927
|
+
{
|
|
59928
|
+
patternType,
|
|
59929
|
+
patternDef,
|
|
59930
|
+
patternConfig
|
|
59931
|
+
}
|
|
59932
|
+
)
|
|
59927
59933
|
) : (
|
|
59928
59934
|
/* ── Inspector Tab ── */
|
|
59929
59935
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -59950,7 +59956,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
59950
59956
|
] }, propName);
|
|
59951
59957
|
}) })
|
|
59952
59958
|
] }),
|
|
59953
|
-
(selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59959
|
+
userType === "architect" && (selectedPattern && isEntityPattern || !selectedPattern && !isExpanded) && entity && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
59954
59960
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Entity") }),
|
|
59955
59961
|
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 mb-2", children: [
|
|
59956
59962
|
/* @__PURE__ */ jsx("svg", { width: 14, height: 14, children: /* @__PURE__ */ jsx("circle", { cx: 7, cy: 7, r: 5, fill: "var(--color-primary)" }) }),
|
|
@@ -60074,7 +60080,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60074
60080
|
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlEvent, { x: 8, y: 8, size: 12 }) }),
|
|
60075
60081
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: transitionEvent })
|
|
60076
60082
|
] }) }),
|
|
60077
|
-
(transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60083
|
+
userType === "architect" && (transition?.guard ?? guard ?? editable) && isExpanded && /* @__PURE__ */ jsx(Box, { className: "px-4 py-2 border-b border-border/40", children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
60078
60084
|
/* @__PURE__ */ jsx("svg", { width: 16, height: 16, children: /* @__PURE__ */ jsx(AvlGuard, { x: 8, y: 8, size: 12 }) }),
|
|
60079
60085
|
editable ? /* @__PURE__ */ jsx(
|
|
60080
60086
|
Input,
|
|
@@ -60086,7 +60092,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60086
60092
|
}
|
|
60087
60093
|
) : /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-mono text-[11px] text-muted-foreground", children: formatExpression(transition?.guard ?? guard) })
|
|
60088
60094
|
] }) }),
|
|
60089
|
-
(effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60095
|
+
userType === "architect" && (effectTypes.length > 0 || editable) && isExpanded && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 border-b border-border/40", children: [
|
|
60090
60096
|
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: [
|
|
60091
60097
|
t("Effects"),
|
|
60092
60098
|
" (",
|
|
@@ -60118,7 +60124,7 @@ function OrbInspector({ node, schema, editable = false, onSchemaChange, onClose
|
|
|
60118
60124
|
}) }),
|
|
60119
60125
|
editable && /* @__PURE__ */ jsx(AddEffectButton, { onAdd: handleAddEffect })
|
|
60120
60126
|
] }),
|
|
60121
|
-
patterns.length > 0 && !selectedPattern && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3", children: [
|
|
60127
|
+
userType === "architect" && patterns.length > 0 && !selectedPattern && /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3", children: [
|
|
60122
60128
|
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: "render-ui" }),
|
|
60123
60129
|
/* @__PURE__ */ 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__ */ jsxs(Box, { children: [
|
|
60124
60130
|
/* @__PURE__ */ jsxs(Typography, { variant: "small", className: "text-muted-foreground text-[10px]", children: [
|
|
@@ -60191,6 +60197,83 @@ function OrbPatternTree({ config, depth }) {
|
|
|
60191
60197
|
] });
|
|
60192
60198
|
}
|
|
60193
60199
|
OrbInspector.displayName = "OrbInspector";
|
|
60200
|
+
var PHASE_2_TOKEN_FALLBACK = {
|
|
60201
|
+
button: ["--color-primary", "--color-primary-foreground", "--radius-md", "--shadow-sm"],
|
|
60202
|
+
badge: ["--color-primary", "--radius-full"],
|
|
60203
|
+
card: ["--color-card", "--color-border", "--radius-lg", "--shadow-main"],
|
|
60204
|
+
input: ["--color-input", "--color-border", "--radius-md"],
|
|
60205
|
+
typography: ["--color-foreground", "--color-muted-foreground"],
|
|
60206
|
+
divider: ["--color-border"],
|
|
60207
|
+
avatar: ["--radius-full", "--color-muted"],
|
|
60208
|
+
alert: ["--color-warning", "--color-success", "--color-danger", "--radius-md"],
|
|
60209
|
+
modal: ["--color-card", "--shadow-lg", "--radius-lg"],
|
|
60210
|
+
toast: ["--color-card", "--shadow-lg", "--radius-md"]
|
|
60211
|
+
};
|
|
60212
|
+
function StylesTabReadOnly({ patternType, patternDef, patternConfig }) {
|
|
60213
|
+
const { t } = useTranslate();
|
|
60214
|
+
if (!patternType) {
|
|
60215
|
+
return /* @__PURE__ */ jsx(Box, { className: "p-4", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px]", children: t("Select a pattern to view its style tokens.") }) });
|
|
60216
|
+
}
|
|
60217
|
+
const tier = patternDef?.category ?? "Pattern";
|
|
60218
|
+
const tokens = PHASE_2_TOKEN_FALLBACK[patternType] ?? [];
|
|
60219
|
+
const variantEnum = patternDef?.propsSchema?.variant?.enumValues;
|
|
60220
|
+
const sizeEnum = patternDef?.propsSchema?.size?.enumValues;
|
|
60221
|
+
const currentVariant = patternConfig && typeof patternConfig.variant === "string" ? patternConfig.variant : void 0;
|
|
60222
|
+
const currentSize = patternConfig && typeof patternConfig.size === "string" ? patternConfig.size : void 0;
|
|
60223
|
+
return /* @__PURE__ */ jsxs(Box, { className: "px-4 py-3 flex flex-col gap-4", children: [
|
|
60224
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
60225
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-semibold text-[12px]", children: patternType }),
|
|
60226
|
+
/* @__PURE__ */ jsx(
|
|
60227
|
+
Box,
|
|
60228
|
+
{
|
|
60229
|
+
className: "rounded px-1.5 py-0.5 text-[9px] font-mono uppercase tracking-wider",
|
|
60230
|
+
style: { backgroundColor: "var(--color-muted)", color: "var(--color-muted-foreground)" },
|
|
60231
|
+
children: tier
|
|
60232
|
+
}
|
|
60233
|
+
)
|
|
60234
|
+
] }),
|
|
60235
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
60236
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Tokens") }),
|
|
60237
|
+
tokens.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[11px] italic", children: t("No token contract declared for this pattern.") }) : /* @__PURE__ */ jsx(Box, { className: "flex flex-col gap-1", children: tokens.map((token) => /* @__PURE__ */ jsx(Box, { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(Typography, { variant: "small", className: "font-mono text-[11px]", children: token }) }, token)) })
|
|
60238
|
+
] }),
|
|
60239
|
+
variantEnum && variantEnum.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
|
|
60240
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Variant") }),
|
|
60241
|
+
/* @__PURE__ */ jsx(Box, { className: "flex flex-wrap gap-1", children: variantEnum.map((variant) => {
|
|
60242
|
+
const isActive = variant === currentVariant || !currentVariant && variant === "default";
|
|
60243
|
+
return /* @__PURE__ */ jsx(
|
|
60244
|
+
Box,
|
|
60245
|
+
{
|
|
60246
|
+
className: "rounded px-2 py-0.5 text-[11px] font-mono",
|
|
60247
|
+
style: {
|
|
60248
|
+
backgroundColor: isActive ? "var(--color-primary)" : "var(--color-muted)",
|
|
60249
|
+
color: isActive ? "var(--color-primary-foreground)" : "var(--color-muted-foreground)"
|
|
60250
|
+
},
|
|
60251
|
+
children: variant
|
|
60252
|
+
},
|
|
60253
|
+
variant
|
|
60254
|
+
);
|
|
60255
|
+
}) })
|
|
60256
|
+
] }),
|
|
60257
|
+
sizeEnum && sizeEnum.length > 0 && /* @__PURE__ */ jsxs(Box, { children: [
|
|
60258
|
+
/* @__PURE__ */ jsx(Typography, { variant: "small", className: "text-muted-foreground text-[10px] uppercase tracking-wider mb-2", children: t("Size") }),
|
|
60259
|
+
/* @__PURE__ */ jsx(Box, { className: "flex flex-wrap gap-1", children: sizeEnum.map((size) => {
|
|
60260
|
+
const isActive = size === currentSize || !currentSize && size === "md";
|
|
60261
|
+
return /* @__PURE__ */ jsx(
|
|
60262
|
+
Box,
|
|
60263
|
+
{
|
|
60264
|
+
className: "rounded px-2 py-0.5 text-[11px] font-mono",
|
|
60265
|
+
style: {
|
|
60266
|
+
backgroundColor: isActive ? "var(--color-primary)" : "var(--color-muted)",
|
|
60267
|
+
color: isActive ? "var(--color-primary-foreground)" : "var(--color-muted-foreground)"
|
|
60268
|
+
},
|
|
60269
|
+
children: size
|
|
60270
|
+
},
|
|
60271
|
+
size
|
|
60272
|
+
);
|
|
60273
|
+
}) })
|
|
60274
|
+
] })
|
|
60275
|
+
] });
|
|
60276
|
+
}
|
|
60194
60277
|
|
|
60195
60278
|
// components/organisms/avl/FlowCanvas.tsx
|
|
60196
60279
|
init_Box();
|
|
@@ -60234,7 +60317,8 @@ function FlowCanvasInner({
|
|
|
60234
60317
|
onNodeSelect,
|
|
60235
60318
|
composeLevel,
|
|
60236
60319
|
behaviorEntries,
|
|
60237
|
-
behaviorWires
|
|
60320
|
+
behaviorWires,
|
|
60321
|
+
userType = "builder"
|
|
60238
60322
|
}) {
|
|
60239
60323
|
const NODE_TYPES2 = useMemo(() => ({
|
|
60240
60324
|
preview: OrbPreviewNode,
|
|
@@ -60529,6 +60613,7 @@ function FlowCanvasInner({
|
|
|
60529
60613
|
node: selectedNode,
|
|
60530
60614
|
schema: parsedSchema,
|
|
60531
60615
|
editable,
|
|
60616
|
+
userType,
|
|
60532
60617
|
onSchemaChange,
|
|
60533
60618
|
onClose: handleClosePanel
|
|
60534
60619
|
}
|
|
@@ -117,5 +117,12 @@ export interface FlowCanvasProps {
|
|
|
117
117
|
initialTrait?: string;
|
|
118
118
|
/** @deprecated Not used in V3. */
|
|
119
119
|
stateCoverage?: Record<string, string>;
|
|
120
|
+
/**
|
|
121
|
+
* Studio persona viewing the canvas. Drives `OrbInspector` tab/section
|
|
122
|
+
* visibility — designers and builders hide the raw `code` tab and the
|
|
123
|
+
* architect-only Entity / raw-guard / raw-effects sections; architects see
|
|
124
|
+
* everything. Default `'builder'` preserves pre-Phase-2 behavior.
|
|
125
|
+
*/
|
|
126
|
+
userType?: 'builder' | 'designer' | 'architect';
|
|
120
127
|
}
|
|
121
128
|
export declare const FlowCanvas: React.FC<FlowCanvasProps>;
|
|
@@ -20,10 +20,18 @@ export interface OrbInspectorProps {
|
|
|
20
20
|
node: PreviewNodeData;
|
|
21
21
|
schema: OrbitalSchema;
|
|
22
22
|
editable?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Studio persona viewing the inspector. Controls tab visibility (Code is
|
|
25
|
+
* architect-only, Styles is universal) and section visibility (Entity,
|
|
26
|
+
* raw guard, raw effects are architect-only). Default `'builder'` matches
|
|
27
|
+
* pre-Phase-2 behavior except for the new Styles tab, which every persona
|
|
28
|
+
* gets.
|
|
29
|
+
*/
|
|
30
|
+
userType?: 'builder' | 'designer' | 'architect';
|
|
23
31
|
onSchemaChange?: (schema: OrbitalSchema) => void;
|
|
24
32
|
onClose: () => void;
|
|
25
33
|
}
|
|
26
|
-
export declare function OrbInspector({ node, schema, editable, onSchemaChange, onClose }: OrbInspectorProps): React.ReactElement;
|
|
34
|
+
export declare function OrbInspector({ node, schema, editable, userType, onSchemaChange, onClose }: OrbInspectorProps): React.ReactElement;
|
|
27
35
|
export declare namespace OrbInspector {
|
|
28
36
|
var displayName: string;
|
|
29
37
|
}
|