@mica-js/editor 0.8.3 → 0.9.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/fused-runtime.js +1 -1
- package/dist/fused.d.ts +2 -0
- package/dist/fused.js +13 -9
- package/dist/fused.js.map +1 -1
- package/dist/{runtime-SHLo4xoG.js → runtime-B7BCKT0Y.js} +3 -3
- package/dist/{runtime-SHLo4xoG.js.map → runtime-B7BCKT0Y.js.map} +1 -1
- package/dist/workers-BCtjAgJ7.js +34 -0
- package/dist/{workers-39Fc5BAt.js.map → workers-BCtjAgJ7.js.map} +1 -1
- package/package.json +3 -3
- package/dist/workers-39Fc5BAt.js +0 -34
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-B7BCKT0Y.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.d.ts
CHANGED
|
@@ -375,6 +375,8 @@ export declare interface IWorkbenchCommandMap {
|
|
|
375
375
|
'simulation.pause': IWorkbenchCommand;
|
|
376
376
|
/** Host-only resume of the mounted run session; no-op when already running. */
|
|
377
377
|
'simulation.resume': IWorkbenchCommand;
|
|
378
|
+
/** Host-only restart of the mounted run session: rebuilds the models, then advances. */
|
|
379
|
+
'simulation.restart': IWorkbenchCommand;
|
|
378
380
|
'canvas.fit': IWorkbenchCommand;
|
|
379
381
|
'canvas.zoom': IWorkbenchCommand<{
|
|
380
382
|
readonly factor: number;
|
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-B7BCKT0Y.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";
|
|
@@ -3264,6 +3264,11 @@ function createSimulationControl(onDidChangeStatus) {
|
|
|
3264
3264
|
await active.resume();
|
|
3265
3265
|
if (runtime === active && !closed) publish(active.getState().status);
|
|
3266
3266
|
},
|
|
3267
|
+
async restart() {
|
|
3268
|
+
const active = requireSession("restart");
|
|
3269
|
+
await active.reset();
|
|
3270
|
+
if (runtime === active && !closed) publish(active.getState().status);
|
|
3271
|
+
},
|
|
3267
3272
|
dispose() {
|
|
3268
3273
|
if (closed) return;
|
|
3269
3274
|
closed = true;
|
|
@@ -4484,8 +4489,6 @@ function ToolbarPart(props) {
|
|
|
4484
4489
|
const visible = items.slice(0, layout.count);
|
|
4485
4490
|
const overflow = items.slice(layout.count);
|
|
4486
4491
|
const runMode = props.state.mode === "run";
|
|
4487
|
-
const paused = props.state.simulationStatus === "paused";
|
|
4488
|
-
const canControl = !runMode || paused || props.state.simulationStatus === "running";
|
|
4489
4492
|
const control = (action) => {
|
|
4490
4493
|
setMore(false);
|
|
4491
4494
|
setControlling(true);
|
|
@@ -4546,14 +4549,14 @@ function ToolbarPart(props) {
|
|
|
4546
4549
|
"aria-label": "仿真控制",
|
|
4547
4550
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
4548
4551
|
className: "is-primary",
|
|
4549
|
-
disabled: props.state.busy || controlling
|
|
4550
|
-
onClick: () => control(() =>
|
|
4551
|
-
children: [/* @__PURE__ */ jsx(Icon, { name: runMode
|
|
4552
|
+
disabled: props.state.busy || controlling,
|
|
4553
|
+
onClick: () => control(() => props.context.workbench.setMode(runMode ? "edit" : "run")),
|
|
4554
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: runMode ? "debug-stop" : "play" }), runMode ? "停止" : "运行"]
|
|
4552
4555
|
}), runMode && /* @__PURE__ */ jsxs("button", {
|
|
4553
4556
|
disabled: props.state.busy || controlling,
|
|
4554
|
-
title: "
|
|
4555
|
-
onClick: () => control(() => props.context.workbench.
|
|
4556
|
-
children: [/* @__PURE__ */ jsx(Icon, { name: "debug-restart" }), "
|
|
4557
|
+
title: "重启仿真",
|
|
4558
|
+
onClick: () => control(() => props.context.workbench.executeCommand("simulation.restart")),
|
|
4559
|
+
children: [/* @__PURE__ */ jsx(Icon, { name: "debug-restart" }), "重启"]
|
|
4557
4560
|
})]
|
|
4558
4561
|
}),
|
|
4559
4562
|
items.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -6717,6 +6720,7 @@ async function createWorkbench(options) {
|
|
|
6717
6720
|
"workbench.setMode": ({ mode }) => setMode(mode),
|
|
6718
6721
|
"simulation.pause": () => controlSimulation("pause"),
|
|
6719
6722
|
"simulation.resume": () => controlSimulation("resume"),
|
|
6723
|
+
"simulation.restart": () => controlSimulation("restart"),
|
|
6720
6724
|
"canvas.fit": async () => {
|
|
6721
6725
|
canvas?.fit();
|
|
6722
6726
|
},
|