@republicroad/seal-editor 1.6.0 → 1.7.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/index.d.ts +8 -7
- package/dist/index.js +81 -75
- package/dist/index.js.map +1 -1
- package/dist/schema.d.ts +7 -7
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1477,6 +1477,7 @@ export declare const GraphSimulator: default_2.FC<GraphSimulatorProps>;
|
|
|
1477
1477
|
export declare type GraphSimulatorProps = {
|
|
1478
1478
|
onClear?: () => void;
|
|
1479
1479
|
loading?: boolean;
|
|
1480
|
+
simulationFooter?: default_2.ReactNode;
|
|
1480
1481
|
defaultRequest?: SimulatorRequestPanelProps['defaultRequest'];
|
|
1481
1482
|
onChange?: SimulatorRequestPanelProps['onChange'];
|
|
1482
1483
|
onRun?: SimulatorRequestPanelProps['onRun'];
|
|
@@ -2477,13 +2478,6 @@ declare type ViewConfigPermission = 'edit:values' | 'edit:rules' | 'edit:full';
|
|
|
2477
2478
|
export { }
|
|
2478
2479
|
|
|
2479
2480
|
|
|
2480
|
-
declare module '@gorules/zen-engine-wasm' {
|
|
2481
|
-
interface VariableType {
|
|
2482
|
-
__hash: string;
|
|
2483
|
-
}
|
|
2484
|
-
}
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
2481
|
declare global {
|
|
2488
2482
|
interface Window {
|
|
2489
2483
|
monaco?: Monaco;
|
|
@@ -2495,6 +2489,13 @@ declare namespace ContextMenuSub {
|
|
|
2495
2489
|
var displayName: string;
|
|
2496
2490
|
}
|
|
2497
2491
|
|
|
2492
|
+
|
|
2493
|
+
declare module '@gorules/zen-engine-wasm' {
|
|
2494
|
+
interface VariableType {
|
|
2495
|
+
__hash: string;
|
|
2496
|
+
}
|
|
2497
|
+
}
|
|
2498
|
+
|
|
2498
2499
|
declare namespace console {
|
|
2499
2500
|
function log(...args: any[]): void;
|
|
2500
2501
|
async function sleep(durationMs: number): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -17512,89 +17512,95 @@ var hv = ({ t: e, shouldShowSimulatorSourceSelect: t, boundRequestSourceIndex: n
|
|
|
17512
17512
|
})] });
|
|
17513
17513
|
}, Sv = /* @__PURE__ */ function(e) {
|
|
17514
17514
|
return e.Output = "Output", e.Input = "Input", e.Trace = "Trace", e;
|
|
17515
|
-
}(Sv || {}), Cv = ({ defaultRequest: e, onChange: t, onRun: n, onClear: r, loading: i = !1,
|
|
17516
|
-
let
|
|
17515
|
+
}(Sv || {}), Cv = ({ defaultRequest: e, onChange: t, onRun: n, onClear: r, loading: i = !1, simulationFooter: a, leftPanel: o = xv }) => {
|
|
17516
|
+
let s = Z(), [c, l] = jm("simulation.search", ""), [u, d] = jm("simulation.segment", "Output"), { viewConfig: f } = $((e) => ({ viewConfig: e.viewConfig })), { actions: p } = um(), { nodeTypes: m, simulate: h, hasInputNode: g } = $(({ decisionGraph: e, simulate: t }) => ({
|
|
17517
17517
|
simulate: t,
|
|
17518
17518
|
hasInputNode: e.nodes.some((e) => e.type === Q.Input),
|
|
17519
17519
|
nodeTypes: (e.nodes ?? []).reduce((e, t) => ({
|
|
17520
17520
|
...e,
|
|
17521
17521
|
[t.id]: t.type
|
|
17522
17522
|
}), {})
|
|
17523
|
-
})), [
|
|
17524
|
-
return /* @__PURE__ */ H(
|
|
17525
|
-
className: "h-full w-full
|
|
17526
|
-
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17534
|
-
|
|
17535
|
-
|
|
17536
|
-
|
|
17537
|
-
|
|
17538
|
-
|
|
17539
|
-
|
|
17540
|
-
|
|
17541
|
-
/* @__PURE__ */ V(Hi, {}),
|
|
17542
|
-
/* @__PURE__ */ V(Bi, {
|
|
17543
|
-
minSize: 20,
|
|
17544
|
-
maxSize: 20,
|
|
17545
|
-
className: "flex w-[260px] flex-col",
|
|
17546
|
-
children: /* @__PURE__ */ V(fv, {
|
|
17547
|
-
search: s,
|
|
17548
|
-
onSearchChange: c,
|
|
17549
|
-
loading: i,
|
|
17550
|
-
simulate: m,
|
|
17551
|
-
nodeTypes: p,
|
|
17552
|
-
viewConfig: d,
|
|
17553
|
-
selectedNode: g,
|
|
17554
|
-
onSelectNode: _,
|
|
17555
|
-
onClear: () => {
|
|
17556
|
-
r?.(), _("graph"), c("");
|
|
17557
|
-
},
|
|
17558
|
-
onGoToNode: (e) => f.goToNode(e)
|
|
17559
|
-
})
|
|
17560
|
-
}),
|
|
17561
|
-
/* @__PURE__ */ V(Hi, {}),
|
|
17562
|
-
/* @__PURE__ */ H(Bi, {
|
|
17563
|
-
minSize: 30,
|
|
17564
|
-
defaultSize: 42,
|
|
17565
|
-
className: "flex min-w-[300px] flex-1 flex-col",
|
|
17566
|
-
children: [/* @__PURE__ */ V("div", {
|
|
17567
|
-
className: "flex h-9 select-none items-center justify-between gap-1 border-b border-b-[var(--border)] pl-0 pr-2",
|
|
17568
|
-
children: /* @__PURE__ */ V(rs, {
|
|
17569
|
-
size: "small",
|
|
17570
|
-
style: { width: "100%" },
|
|
17571
|
-
onChange: (e) => u(e),
|
|
17572
|
-
items: Object.values(Sv).map((e) => ({
|
|
17573
|
-
key: e,
|
|
17574
|
-
label: e
|
|
17575
|
-
})),
|
|
17576
|
-
tabBarExtraContent: /* @__PURE__ */ V(Y, {
|
|
17577
|
-
title: o("dg.toolbar.closeClose"),
|
|
17578
|
-
placement: "bottomRight",
|
|
17579
|
-
children: /* @__PURE__ */ V(J, {
|
|
17580
|
-
type: "text",
|
|
17581
|
-
icon: /* @__PURE__ */ V(Wc, { className: "size-3" }),
|
|
17582
|
-
onClick: () => f.setActivePanel(void 0)
|
|
17583
|
-
})
|
|
17584
|
-
})
|
|
17523
|
+
})), [_, v] = R("graph");
|
|
17524
|
+
return /* @__PURE__ */ H("div", {
|
|
17525
|
+
className: "flex h-full w-full flex-col",
|
|
17526
|
+
children: [/* @__PURE__ */ H(Vi, {
|
|
17527
|
+
className: "h-full w-full bg-[var(--seal-color-primary-bg-fade)]",
|
|
17528
|
+
direction: "horizontal",
|
|
17529
|
+
autoSaveId: "jdm-editor:simulator:layout",
|
|
17530
|
+
children: [
|
|
17531
|
+
/* @__PURE__ */ V(Bi, {
|
|
17532
|
+
minSize: 20,
|
|
17533
|
+
defaultSize: 38,
|
|
17534
|
+
className: "flex w-[300px] flex-col",
|
|
17535
|
+
children: /* @__PURE__ */ V(o, {
|
|
17536
|
+
defaultRequest: e,
|
|
17537
|
+
loading: i,
|
|
17538
|
+
hasInputNode: g,
|
|
17539
|
+
onRun: n,
|
|
17540
|
+
onChange: t
|
|
17585
17541
|
})
|
|
17586
|
-
}),
|
|
17587
|
-
|
|
17588
|
-
|
|
17589
|
-
|
|
17590
|
-
|
|
17591
|
-
|
|
17592
|
-
|
|
17593
|
-
|
|
17542
|
+
}),
|
|
17543
|
+
/* @__PURE__ */ V(Hi, {}),
|
|
17544
|
+
/* @__PURE__ */ V(Bi, {
|
|
17545
|
+
minSize: 20,
|
|
17546
|
+
maxSize: 20,
|
|
17547
|
+
className: "flex w-[260px] flex-col",
|
|
17548
|
+
children: /* @__PURE__ */ V(fv, {
|
|
17549
|
+
search: c,
|
|
17550
|
+
onSearchChange: l,
|
|
17551
|
+
loading: i,
|
|
17552
|
+
simulate: h,
|
|
17553
|
+
nodeTypes: m,
|
|
17554
|
+
viewConfig: f,
|
|
17555
|
+
selectedNode: _,
|
|
17556
|
+
onSelectNode: v,
|
|
17557
|
+
onClear: () => {
|
|
17558
|
+
r?.(), v("graph"), l("");
|
|
17559
|
+
},
|
|
17560
|
+
onGoToNode: (e) => p.goToNode(e)
|
|
17594
17561
|
})
|
|
17595
|
-
})
|
|
17596
|
-
|
|
17597
|
-
|
|
17562
|
+
}),
|
|
17563
|
+
/* @__PURE__ */ V(Hi, {}),
|
|
17564
|
+
/* @__PURE__ */ H(Bi, {
|
|
17565
|
+
minSize: 30,
|
|
17566
|
+
defaultSize: 42,
|
|
17567
|
+
className: "flex min-w-[300px] flex-1 flex-col",
|
|
17568
|
+
children: [/* @__PURE__ */ V("div", {
|
|
17569
|
+
className: "flex h-9 select-none items-center justify-between gap-1 border-b border-b-[var(--border)] pl-0 pr-2",
|
|
17570
|
+
children: /* @__PURE__ */ V(rs, {
|
|
17571
|
+
size: "small",
|
|
17572
|
+
style: { width: "100%" },
|
|
17573
|
+
onChange: (e) => d(e),
|
|
17574
|
+
items: Object.values(Sv).map((e) => ({
|
|
17575
|
+
key: e,
|
|
17576
|
+
label: e
|
|
17577
|
+
})),
|
|
17578
|
+
tabBarExtraContent: /* @__PURE__ */ V(Y, {
|
|
17579
|
+
title: s("dg.toolbar.closeClose"),
|
|
17580
|
+
placement: "bottomRight",
|
|
17581
|
+
children: /* @__PURE__ */ V(J, {
|
|
17582
|
+
type: "text",
|
|
17583
|
+
icon: /* @__PURE__ */ V(Wc, { className: "size-3" }),
|
|
17584
|
+
onClick: () => p.setActivePanel(void 0)
|
|
17585
|
+
})
|
|
17586
|
+
})
|
|
17587
|
+
})
|
|
17588
|
+
}), /* @__PURE__ */ V("div", {
|
|
17589
|
+
className: "min-h-0 flex-1 overflow-y-auto",
|
|
17590
|
+
children: /* @__PURE__ */ V(lv, {
|
|
17591
|
+
readOnly: !0,
|
|
17592
|
+
value: G(h).with({ result: W._ }, ({ result: e }) => G(_).with("graph", () => wv({
|
|
17593
|
+
traceData: e?.trace,
|
|
17594
|
+
output: e?.result
|
|
17595
|
+
}, u ?? "Output")).otherwise(() => wv(e?.trace[_], u ?? "Output"))).otherwise(() => "")
|
|
17596
|
+
})
|
|
17597
|
+
})]
|
|
17598
|
+
})
|
|
17599
|
+
]
|
|
17600
|
+
}), a && /* @__PURE__ */ V("div", {
|
|
17601
|
+
className: "flex flex-none items-center gap-2 border-t border-t-[var(--border)] px-4 py-1.5",
|
|
17602
|
+
children: a
|
|
17603
|
+
})]
|
|
17598
17604
|
});
|
|
17599
17605
|
}, wv = (e, t) => {
|
|
17600
17606
|
let n = G([t, e]).with(["Output", { output: W._ }], ([, { output: e }]) => e).with(["Input", { input: W._ }], ([, { input: e }]) => e).with(["Trace", { trace: W._ }], ([, { trace: e }]) => e).with(["Trace", { traceData: W._ }], ([, { traceData: e }]) => e).otherwise(() => ({}));
|