simple-circuit-engine 0.0.2 → 0.0.9
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/AGENTS.md +151 -0
- package/CLAUDE.md +140 -0
- package/README.md +31 -30
- package/dist/{CircuitRunner-CAeE31M5.js → CircuitRunner-FXM_s5ll.js} +2 -2
- package/dist/{CircuitRunner-CAeE31M5.js.map → CircuitRunner-FXM_s5ll.js.map} +1 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.js.map +1 -1
- package/dist/index.d.ts +30 -4
- package/dist/index.js +23 -20
- package/dist/scene/index.d.ts +1 -0
- package/dist/scene/index.js +22 -19
- package/dist/{setup-vP_WEVVE.js → setup-YQJVUHFM.js} +92 -79
- package/dist/setup-YQJVUHFM.js.map +1 -0
- package/package.json +5 -3
- package/dist/setup-vP_WEVVE.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1244,7 +1244,7 @@ export declare class CircuitController extends AbstractCircuitController {
|
|
|
1244
1244
|
* Specific Initialization logic, performed after AbstractCircuitController initialization
|
|
1245
1245
|
* @private
|
|
1246
1246
|
*/
|
|
1247
|
-
protected onInitialize(
|
|
1247
|
+
protected onInitialize(_options?: ControllerOptions): void;
|
|
1248
1248
|
protected emitReady(): void;
|
|
1249
1249
|
/**
|
|
1250
1250
|
* Enable or disable edit mode (FR-006, FR-027)
|
|
@@ -1733,6 +1733,7 @@ declare class CircuitMetadata {
|
|
|
1733
1733
|
export declare class CircuitRunnerController extends AbstractCircuitController {
|
|
1734
1734
|
private _runner;
|
|
1735
1735
|
private _behaviorRegistry;
|
|
1736
|
+
private _autoPlay;
|
|
1736
1737
|
private _isPlaying;
|
|
1737
1738
|
private _tickIntervalMs;
|
|
1738
1739
|
private _simulationLoopId;
|
|
@@ -1808,8 +1809,10 @@ export declare class CircuitRunnerController extends AbstractCircuitController {
|
|
|
1808
1809
|
/**
|
|
1809
1810
|
* Specific Initialization logic, performed after AbstractCircuitController initialization
|
|
1810
1811
|
* @private
|
|
1812
|
+
*
|
|
1813
|
+
* @param options - Controller options passed to initialize()
|
|
1811
1814
|
*/
|
|
1812
|
-
protected onInitialize(): void;
|
|
1815
|
+
protected onInitialize(options?: ControllerOptions): void;
|
|
1813
1816
|
protected emitReady(): void;
|
|
1814
1817
|
/**
|
|
1815
1818
|
* specific disposal prepended at the beginning of dispose process
|
|
@@ -2740,8 +2743,18 @@ export declare interface ControllerOptions {
|
|
|
2740
2743
|
defaultTool?: ToolType | null;
|
|
2741
2744
|
/** MapControls configuration options */
|
|
2742
2745
|
mapControls?: MapControlsOptions;
|
|
2746
|
+
/** Startup CircuitRunnerController simulation speed */
|
|
2747
|
+
simulationSpeed?: number;
|
|
2748
|
+
/** If CircuitRunnerController plays automatically at activation */
|
|
2749
|
+
simulationAutoPlay?: boolean;
|
|
2743
2750
|
}
|
|
2744
2751
|
|
|
2752
|
+
/**
|
|
2753
|
+
* returns default complete controllerOptions or an autocompleted partial controllerOptions
|
|
2754
|
+
* @param options
|
|
2755
|
+
*/
|
|
2756
|
+
export declare function controllerOptions(options?: ControllerOptions | undefined): ControllerOptions;
|
|
2757
|
+
|
|
2745
2758
|
/**
|
|
2746
2759
|
* Cursor types for tool operations
|
|
2747
2760
|
*/
|
|
@@ -2822,6 +2835,12 @@ export declare interface EngineOptions {
|
|
|
2822
2835
|
runnerOptions?: RunnerOptions;
|
|
2823
2836
|
}
|
|
2824
2837
|
|
|
2838
|
+
/**
|
|
2839
|
+
* returns default complete engineOptions or and autoCompleted partial engineOptions
|
|
2840
|
+
* @param options
|
|
2841
|
+
*/
|
|
2842
|
+
export declare function engineOptions(options?: EngineOptions | undefined): EngineOptions;
|
|
2843
|
+
|
|
2825
2844
|
/**
|
|
2826
2845
|
* Electrical connection point (component pin or wire branching point).
|
|
2827
2846
|
*
|
|
@@ -4084,6 +4103,12 @@ export declare interface MapControlsOptions {
|
|
|
4084
4103
|
rotateSpeed?: number;
|
|
4085
4104
|
}
|
|
4086
4105
|
|
|
4106
|
+
/**
|
|
4107
|
+
* returns default complete mapControlsOptions or an autocompleted partial mapControlOptions
|
|
4108
|
+
* @param options
|
|
4109
|
+
*/
|
|
4110
|
+
export declare function mapControlsOptions(options?: MapControlsOptions | undefined): MapControlsOptions;
|
|
4111
|
+
|
|
4087
4112
|
/**
|
|
4088
4113
|
* Event emitted when controller mode changes
|
|
4089
4114
|
*/
|
|
@@ -4091,7 +4116,7 @@ export declare interface ModeChangedEvent {
|
|
|
4091
4116
|
/** New active mode */
|
|
4092
4117
|
mode: EngineMode;
|
|
4093
4118
|
/** Previous mode before transition */
|
|
4094
|
-
previousMode
|
|
4119
|
+
previousMode?: EngineMode;
|
|
4095
4120
|
}
|
|
4096
4121
|
|
|
4097
4122
|
export declare type ModelEditAction = 'edit' | 'add' | 'delete';
|
|
@@ -4547,8 +4572,9 @@ export declare class RectangleLEDVisualFactory extends ComponentVisualFactoryBas
|
|
|
4547
4572
|
* Basic components are : Battery, Lightbulb, RectangleLED, Relay, SmallLED, Switch, Transistor
|
|
4548
4573
|
* @public
|
|
4549
4574
|
* @param registry
|
|
4575
|
+
* @return the input factory registry for chaining
|
|
4550
4576
|
*/
|
|
4551
|
-
export declare function registerBasicComponentsFactories(registry: IFactoryRegistry):
|
|
4577
|
+
export declare function registerBasicComponentsFactories(registry: IFactoryRegistry): IFactoryRegistry;
|
|
4552
4578
|
|
|
4553
4579
|
/**
|
|
4554
4580
|
* Visual factory for Relay components
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as e, C as s, j as
|
|
2
|
-
import { BatteryBehavior as R, BatteryState as d, BehaviorRegistry as v, Circuit as M, CircuitMetadata as V, ComponentState as b, ENode as A, LightbulbBehavior as P, LightbulbState as f, RectangleLEDBehavior as N, RectangleLEDState as
|
|
3
|
-
import { A as q, f as z, d as G, B as J, a as K, C as X, b as Z, c as $, D as aa, F as ta, e as ea, H as sa, L as
|
|
1
|
+
import { b as e, C as s, j as o, i, a as r, D as n, E as l, d as c, m as u, P as y, h as S, R as g, l as p, S as C, k as T, T as m, f as h, e as B, g as E, c as D, s as F } from "./CircuitRunner-FXM_s5ll.js";
|
|
2
|
+
import { BatteryBehavior as R, BatteryState as d, BehaviorRegistry as v, Circuit as M, CircuitMetadata as V, ComponentState as b, ENode as A, LightbulbBehavior as P, LightbulbState as f, RectangleLEDBehavior as N, RectangleLEDState as O, RelayBehavior as I, RelayState as x, SmallLEDBehavior as U, SmallLEDState as W, SwitchBehavior as _, SwitchState as k, TransistorBehavior as w, TransistorState as H, Wire as j, registerBasicComponentsBehaviors as Q } from "./core/index.js";
|
|
3
|
+
import { A as q, f as z, d as G, B as J, a as K, C as X, b as Z, c as $, D as aa, F as ta, e as ea, H as sa, L as oa, g as ia, M as ra, R as na, h as la, S as ca, i as ua, j as ya, T as Sa, W as ga, k as pa, l as Ca, m as Ta, r as ma } from "./setup-YQJVUHFM.js";
|
|
4
4
|
export {
|
|
5
5
|
q as AddComponentTool,
|
|
6
6
|
R as BatteryBehavior,
|
|
@@ -15,10 +15,10 @@ export {
|
|
|
15
15
|
K as CircuitController,
|
|
16
16
|
X as CircuitEngine,
|
|
17
17
|
V as CircuitMetadata,
|
|
18
|
-
|
|
18
|
+
o as CircuitRunner,
|
|
19
19
|
Z as CircuitRunnerController,
|
|
20
20
|
$ as CircuitWriter,
|
|
21
|
-
|
|
21
|
+
i as Component,
|
|
22
22
|
b as ComponentState,
|
|
23
23
|
r as ComponentType,
|
|
24
24
|
aa as DefaultVisualFactory,
|
|
@@ -30,42 +30,45 @@ export {
|
|
|
30
30
|
ta as FactoryRegistry,
|
|
31
31
|
ea as HitboxLayers,
|
|
32
32
|
sa as HoverManager,
|
|
33
|
-
|
|
33
|
+
oa as LabelVisualFactory,
|
|
34
34
|
P as LightbulbBehavior,
|
|
35
35
|
f as LightbulbState,
|
|
36
|
-
|
|
36
|
+
ia as LightbulbVisualFactory,
|
|
37
37
|
ra as MultiSelectTool,
|
|
38
38
|
y as Position,
|
|
39
39
|
S as Position3D,
|
|
40
40
|
N as RectangleLEDBehavior,
|
|
41
|
-
|
|
41
|
+
O as RectangleLEDState,
|
|
42
42
|
na as RectangleLEDVisualFactory,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
I as RelayBehavior,
|
|
44
|
+
x as RelayState,
|
|
45
45
|
la as RelayVisualFactory,
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
g as Rotation,
|
|
47
|
+
p as SIMULATION_SPEED,
|
|
48
48
|
ca as SelectionManager,
|
|
49
49
|
C as SimulationState,
|
|
50
50
|
U as SmallLEDBehavior,
|
|
51
51
|
W as SmallLEDState,
|
|
52
52
|
ua as SmallLEDVisualFactory,
|
|
53
|
-
|
|
53
|
+
T as StateManager,
|
|
54
54
|
_ as SwitchBehavior,
|
|
55
|
-
|
|
55
|
+
k as SwitchState,
|
|
56
56
|
ya as SwitchVisualFactory,
|
|
57
57
|
m as TRANSITION_DEFAULTS,
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
w as TransistorBehavior,
|
|
59
|
+
H as TransistorState,
|
|
60
60
|
Sa as TransistorVisualFactory,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
j as Wire,
|
|
62
|
+
ga as WireVisualManager,
|
|
63
|
+
pa as controllerOptions,
|
|
64
|
+
Ca as engineOptions,
|
|
65
|
+
h as findPositionBestIndex,
|
|
64
66
|
B as generateUUID,
|
|
65
67
|
E as getAllComponentTypes,
|
|
66
68
|
D as getComponentTypeMetadata,
|
|
69
|
+
Ta as mapControlsOptions,
|
|
67
70
|
Q as registerBasicComponentsBehaviors,
|
|
68
|
-
|
|
71
|
+
ma as registerBasicComponentsFactories,
|
|
69
72
|
F as simplifyPositions
|
|
70
73
|
};
|
|
71
74
|
//# sourceMappingURL=index.js.map
|
package/dist/scene/index.d.ts
CHANGED
|
@@ -38,5 +38,6 @@ export type * from './shared/types';
|
|
|
38
38
|
export * from './shared/types';
|
|
39
39
|
export { HitboxLayers } from './shared/utils/LayerConstants';
|
|
40
40
|
export type { HitboxLayerValue } from './shared/utils/LayerConstants';
|
|
41
|
+
export * from './shared/utils/Options';
|
|
41
42
|
export { registerBasicComponentsFactories } from './setup';
|
|
42
43
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/scene/index.js
CHANGED
|
@@ -1,27 +1,30 @@
|
|
|
1
|
-
import { A as r, f as
|
|
1
|
+
import { A as r, f as t, d as i, B as o, a as l, C as e, b as n, c, D as u, F as y, e as F, H as g, L as V, g as C, M as p, R as m, h as L, S as b, i as B, j as M, T as R, W as S, k as T, l as d, m as h, r as D } from "../setup-YQJVUHFM.js";
|
|
2
2
|
export {
|
|
3
3
|
r as AddComponentTool,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
t as BatteryVisualFactory,
|
|
5
|
+
i as BranchingPointVisualFactory,
|
|
6
6
|
o as BuildTool,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
l as CircuitController,
|
|
8
|
+
e as CircuitEngine,
|
|
9
|
+
n as CircuitRunnerController,
|
|
10
|
+
c as CircuitWriter,
|
|
11
|
+
u as DefaultVisualFactory,
|
|
12
12
|
y as FactoryRegistry,
|
|
13
13
|
F as HitboxLayers,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
g as HoverManager,
|
|
15
|
+
V as LabelVisualFactory,
|
|
16
16
|
C as LightbulbVisualFactory,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
p as MultiSelectTool,
|
|
18
|
+
m as RectangleLEDVisualFactory,
|
|
19
|
+
L as RelayVisualFactory,
|
|
20
|
+
b as SelectionManager,
|
|
21
|
+
B as SmallLEDVisualFactory,
|
|
22
|
+
M as SwitchVisualFactory,
|
|
23
|
+
R as TransistorVisualFactory,
|
|
24
|
+
S as WireVisualManager,
|
|
25
|
+
T as controllerOptions,
|
|
26
|
+
d as engineOptions,
|
|
27
|
+
h as mapControlsOptions,
|
|
28
|
+
D as registerBasicComponentsFactories
|
|
26
29
|
};
|
|
27
30
|
//# sourceMappingURL=index.js.map
|