@mica-js/editor 0.8.1 → 0.8.3
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/fused-runtime.js +1 -1
- package/dist/fused.js +23 -14
- package/dist/fused.js.map +1 -1
- package/dist/{runtime-Rsz_qDPa.js → runtime-SHLo4xoG.js} +3 -1
- package/dist/runtime-SHLo4xoG.js.map +1 -0
- package/dist/style.css +3 -23
- package/package.json +1 -1
- package/dist/runtime-Rsz_qDPa.js.map +0 -1
package/dist/fused-runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { c as toWireFailure, i as isFusedBridgeError, n as FusedBridgeError, o as mapWireFailure, r as fromWireFailure, t as FUSED_WIRE_FAILURE } from "./wire-BDHL5Aj9.js";
|
|
2
|
-
import { _ as fusedModelSinkService, a as createFusedRuntime, c as createModelEventRouter, d as createHostPackageGateway, f as packageLockKey, g as fusedModelChannelService, h as fusedHostResourceService, i as startFusedSimulationGuest, l as createFusedDisplay, m as fusedHostPackageService, n as startFusedDisplayGuest, o as createHostModelRouter, p as fusedDisplayService, r as createViewSession, s as channelKey, t as loadFusedWorkerFactories, u as connectFusedWorkbench, v as fusedSimulationService } from "./runtime-
|
|
2
|
+
import { _ as fusedModelSinkService, a as createFusedRuntime, c as createModelEventRouter, d as createHostPackageGateway, f as packageLockKey, g as fusedModelChannelService, h as fusedHostResourceService, i as startFusedSimulationGuest, l as createFusedDisplay, m as fusedHostPackageService, n as startFusedDisplayGuest, o as createHostModelRouter, p as fusedDisplayService, r as createViewSession, s as channelKey, t as loadFusedWorkerFactories, u as connectFusedWorkbench, v as fusedSimulationService } from "./runtime-SHLo4xoG.js";
|
|
3
3
|
export { FUSED_WIRE_FAILURE, FusedBridgeError, channelKey, connectFusedWorkbench, createFusedDisplay, createFusedRuntime, createHostModelRouter, createHostPackageGateway, createModelEventRouter, createViewSession, fromWireFailure, fusedDisplayService, fusedHostPackageService, fusedHostResourceService, fusedModelChannelService, fusedModelSinkService, fusedSimulationService, isFusedBridgeError, loadFusedWorkerFactories, mapWireFailure, packageLockKey, startFusedDisplayGuest, startFusedSimulationGuest, toWireFailure };
|
package/dist/fused.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as planPolylineSegmentDrag, n as orthogonalWaypoints, t as extendWirePath } from "./wire-JZIiIOI0.js";
|
|
2
2
|
import { Q as isHtmlViewError, _ as resolveTheme, a as createHtmlViewHost, f as WORKBENCH_DARK_COLORS, g as readCanvasTheme, h as normalizeTheme, m as WORKBENCH_THEME_CSS_VARIABLES, p as WORKBENCH_LIGHT_COLORS, v as themeStyle } from "./html-HXwZq1my.js";
|
|
3
|
-
import { a as createFusedRuntime } from "./runtime-
|
|
3
|
+
import { a as createFusedRuntime } from "./runtime-SHLo4xoG.js";
|
|
4
4
|
import { DisposableStore, Emitter } from "@mica-js/core/lifecycle";
|
|
5
5
|
import { projectOnSegment } from "@mica-js/document/schematic";
|
|
6
6
|
import { timePs } from "@mica-js/core";
|
|
@@ -4428,6 +4428,7 @@ function SidebarPart(props) {
|
|
|
4428
4428
|
//#region src/fused/parts/toolbar-part.tsx
|
|
4429
4429
|
function ToolbarPart(props) {
|
|
4430
4430
|
const [more, setMore] = useState(false);
|
|
4431
|
+
const [controlling, setControlling] = useState(false);
|
|
4431
4432
|
const toolbar = useRef(null);
|
|
4432
4433
|
const modeGroup = useRef(null);
|
|
4433
4434
|
const measurements = useRef(null);
|
|
@@ -4482,6 +4483,14 @@ function ToolbarPart(props) {
|
|
|
4482
4483
|
}, [items]);
|
|
4483
4484
|
const visible = items.slice(0, layout.count);
|
|
4484
4485
|
const overflow = items.slice(layout.count);
|
|
4486
|
+
const runMode = props.state.mode === "run";
|
|
4487
|
+
const paused = props.state.simulationStatus === "paused";
|
|
4488
|
+
const canControl = !runMode || paused || props.state.simulationStatus === "running";
|
|
4489
|
+
const control = (action) => {
|
|
4490
|
+
setMore(false);
|
|
4491
|
+
setControlling(true);
|
|
4492
|
+
action().catch(props.onError).finally(() => setControlling(false));
|
|
4493
|
+
};
|
|
4485
4494
|
const execute = (item) => {
|
|
4486
4495
|
setMore(false);
|
|
4487
4496
|
if (!props.registry.enabled(item)) return;
|
|
@@ -4530,22 +4539,22 @@ function ToolbarPart(props) {
|
|
|
4530
4539
|
})
|
|
4531
4540
|
]
|
|
4532
4541
|
}),
|
|
4533
|
-
/* @__PURE__ */
|
|
4542
|
+
/* @__PURE__ */ jsxs("div", {
|
|
4534
4543
|
ref: modeGroup,
|
|
4535
4544
|
className: "mica-wb-mode",
|
|
4536
4545
|
role: "group",
|
|
4537
|
-
"aria-label": "
|
|
4538
|
-
"
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
children: [/* @__PURE__ */ jsx(Icon, { name:
|
|
4548
|
-
}
|
|
4546
|
+
"aria-label": "仿真控制",
|
|
4547
|
+
children: [/* @__PURE__ */ jsxs("button", {
|
|
4548
|
+
className: "is-primary",
|
|
4549
|
+
disabled: props.state.busy || controlling || !canControl,
|
|
4550
|
+
onClick: () => control(() => !runMode ? props.context.workbench.setMode("run") : props.context.workbench.executeCommand(paused ? "simulation.resume" : "simulation.pause")),
|
|
4551
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: runMode && !paused ? "debug-pause" : "play" }), runMode ? paused ? "继续" : "暂停" : "运行"]
|
|
4552
|
+
}), runMode && /* @__PURE__ */ jsxs("button", {
|
|
4553
|
+
disabled: props.state.busy || controlling,
|
|
4554
|
+
title: "结束仿真并返回编辑",
|
|
4555
|
+
onClick: () => control(() => props.context.workbench.setMode("edit")),
|
|
4556
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: "debug-restart" }), "复位"]
|
|
4557
|
+
})]
|
|
4549
4558
|
}),
|
|
4550
4559
|
items.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4551
4560
|
/* @__PURE__ */ jsx("span", {
|