@willcgage/module-schematic 0.37.0 → 0.38.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.cts CHANGED
@@ -263,11 +263,6 @@ interface ModuleSchematicDoc {
263
263
  * Absent = the module keeps using its own `outline` exactly as before; this
264
264
  * is purely additive and nothing migrates on read. */
265
265
  sections?: SchematicSection[];
266
- /** Which compass axis the module actually runs along. The dispatcher panel
267
- * always draws LEFT→RIGHT — that's what makes a layout of modules read as one
268
- * strip — but a module built north/south should still be labelled N and S.
269
- * Absent = east/west. */
270
- orientation?: ModuleOrientation;
271
266
  /** @deprecated pre-grouping flat signals; read for back-compat. */
272
267
  signals?: SchematicSignal[];
273
268
  /** Authored mainline centre-line (module-local inches, open path with arcs).
@@ -284,20 +279,12 @@ interface BenchworkPoint {
284
279
  y: number;
285
280
  bulge?: number;
286
281
  }
287
- /** The compass axis a module runs along. Endplate A is the first label,
288
- * endplate B the second, so A→B reads left→right in the dispatcher panel
289
- * whichever axis it is. */
290
- type ModuleOrientation = "east-west" | "north-south";
291
- /** The compass letters for a module's two ends, A first. */
292
- declare function endLabels(o: ModuleOrientation | null | undefined): {
293
- a: string;
294
- b: string;
295
- };
296
- /** …spelled out, for a caption like "derived, South → North". */
297
- declare function endLabelsLong(o: ModuleOrientation | null | undefined): {
298
- a: string;
299
- b: string;
300
- };
282
+ /** NB: a module has NO compass direction of its own, deliberately. It has ends
283
+ * A and B. Direction is a property of the LAYOUT the same board can be
284
+ * installed running either way round, or on either axis, so a compass label
285
+ * stored here could only ever contradict the layout that placed it. Railroads
286
+ * do the same thing with timetable direction: the railroad declares which way
287
+ * is "east", not any one piece of track. Free-Dispatcher owns direction. */
301
288
  /** One bench-work section of a module (#96 phase 2). */
302
289
  interface SectionFootprint {
303
290
  id: string;
@@ -790,8 +777,6 @@ interface EditorState {
790
777
  /** The module's sections as named objects, each optionally carrying its own
791
778
  * outline (#96 phase 2). Empty = fall back to `outline` + `sectionBreaks`. */
792
779
  sections: SchematicSection[];
793
- /** Compass axis the module runs along; the panel still draws left→right. */
794
- orientation: ModuleOrientation;
795
780
  controlPoints: EditorControlPoint[];
796
781
  /** Rail-served industries — car-spot spans on a track (#industries). */
797
782
  industries: EditorIndustry[];
@@ -1083,4 +1068,4 @@ declare function poseOverridesFromDoc(doc: ModuleSchematicDoc): Record<string, {
1083
1068
  heading: number;
1084
1069
  }>;
1085
1070
 
1086
- export { type BenchworkPoint, type BranchConnector, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplatePose, type EndplateWidthIssue, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, type GeometryType, type IndustryLabelMode, type IndustrySpot, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleOrientation, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OutlineFace, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionFootprint, type SectionRelativePos, type SignalFacing, type SignalSide, type TrackConfig, type TrackRole, type TurnoutKind, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endLabels, endLabelsLong, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
1071
+ export { type BenchworkPoint, type BranchConnector, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplatePose, type EndplateWidthIssue, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, type GeometryType, type IndustryLabelMode, type IndustrySpot, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OutlineFace, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionFootprint, type SectionRelativePos, type SignalFacing, type SignalSide, type TrackConfig, type TrackRole, type TurnoutKind, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
package/dist/index.d.ts CHANGED
@@ -263,11 +263,6 @@ interface ModuleSchematicDoc {
263
263
  * Absent = the module keeps using its own `outline` exactly as before; this
264
264
  * is purely additive and nothing migrates on read. */
265
265
  sections?: SchematicSection[];
266
- /** Which compass axis the module actually runs along. The dispatcher panel
267
- * always draws LEFT→RIGHT — that's what makes a layout of modules read as one
268
- * strip — but a module built north/south should still be labelled N and S.
269
- * Absent = east/west. */
270
- orientation?: ModuleOrientation;
271
266
  /** @deprecated pre-grouping flat signals; read for back-compat. */
272
267
  signals?: SchematicSignal[];
273
268
  /** Authored mainline centre-line (module-local inches, open path with arcs).
@@ -284,20 +279,12 @@ interface BenchworkPoint {
284
279
  y: number;
285
280
  bulge?: number;
286
281
  }
287
- /** The compass axis a module runs along. Endplate A is the first label,
288
- * endplate B the second, so A→B reads left→right in the dispatcher panel
289
- * whichever axis it is. */
290
- type ModuleOrientation = "east-west" | "north-south";
291
- /** The compass letters for a module's two ends, A first. */
292
- declare function endLabels(o: ModuleOrientation | null | undefined): {
293
- a: string;
294
- b: string;
295
- };
296
- /** …spelled out, for a caption like "derived, South → North". */
297
- declare function endLabelsLong(o: ModuleOrientation | null | undefined): {
298
- a: string;
299
- b: string;
300
- };
282
+ /** NB: a module has NO compass direction of its own, deliberately. It has ends
283
+ * A and B. Direction is a property of the LAYOUT the same board can be
284
+ * installed running either way round, or on either axis, so a compass label
285
+ * stored here could only ever contradict the layout that placed it. Railroads
286
+ * do the same thing with timetable direction: the railroad declares which way
287
+ * is "east", not any one piece of track. Free-Dispatcher owns direction. */
301
288
  /** One bench-work section of a module (#96 phase 2). */
302
289
  interface SectionFootprint {
303
290
  id: string;
@@ -790,8 +777,6 @@ interface EditorState {
790
777
  /** The module's sections as named objects, each optionally carrying its own
791
778
  * outline (#96 phase 2). Empty = fall back to `outline` + `sectionBreaks`. */
792
779
  sections: SchematicSection[];
793
- /** Compass axis the module runs along; the panel still draws left→right. */
794
- orientation: ModuleOrientation;
795
780
  controlPoints: EditorControlPoint[];
796
781
  /** Rail-served industries — car-spot spans on a track (#industries). */
797
782
  industries: EditorIndustry[];
@@ -1083,4 +1068,4 @@ declare function poseOverridesFromDoc(doc: ModuleSchematicDoc): Record<string, {
1083
1068
  heading: number;
1084
1069
  }>;
1085
1070
 
1086
- export { type BenchworkPoint, type BranchConnector, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplatePose, type EndplateWidthIssue, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, type GeometryType, type IndustryLabelMode, type IndustrySpot, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleOrientation, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OutlineFace, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionFootprint, type SectionRelativePos, type SignalFacing, type SignalSide, type TrackConfig, type TrackRole, type TurnoutKind, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endLabels, endLabelsLong, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
1071
+ export { type BenchworkPoint, type BranchConnector, type DrawCrossing, type DrawCrossover, type DrawIndustry, type DrawSignal, type DrawTrack, type DrawTurnout, type EditorBranch, type EditorControlPoint, type EditorCpSignal, type EditorCrossing, type EditorIndustry, type EditorState, type EditorTrack, type EditorTurnout, type EndplateBConfig, type EndplatePose, type EndplateWidthIssue, FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, type GeometryType, type IndustryLabelMode, type IndustrySpot, MAIN2_TRACK_ID, MAIN_TRACK_ID, type ModuleFeatures, type ModuleFootprint, type ModuleFootprintInput, type ModuleGeometryInput, type ModuleSchematicDoc, type ModuleTrackRow, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, type OutlineFace, type SchematicBlock, type SchematicControlPoint, type SchematicCrossing, type SchematicEndplate, type SchematicEndplateTrack, type SchematicIndustry, type SchematicSection, type SchematicSignal, type SchematicTrack, type SchematicTurnout, type SectionAdjacency, type SectionFootprint, type SectionRelativePos, type SignalFacing, type SignalSide, type TrackConfig, type TrackRole, type TurnoutKind, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
package/dist/index.js CHANGED
@@ -7,12 +7,6 @@ function endplateWidthInches(ep) {
7
7
  const w = ep?.widthInches;
8
8
  return typeof w === "number" && w > 0 ? w : FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES;
9
9
  }
10
- function endLabels(o) {
11
- return o === "north-south" ? { a: "S", b: "N" } : { a: "W", b: "E" };
12
- }
13
- function endLabelsLong(o) {
14
- return o === "north-south" ? { a: "South", b: "North" } : { a: "West", b: "East" };
15
- }
16
10
  function benchworkOutline(doc) {
17
11
  const pts = (doc?.outline ?? []).filter((p) => p && Number.isFinite(p.x) && Number.isFinite(p.y)).map((p) => ({
18
12
  x: p.x,
@@ -563,7 +557,6 @@ function emptyEditorState(lengthInches) {
563
557
  outline: [],
564
558
  sectionBreaks: [],
565
559
  sections: [],
566
- orientation: "east-west",
567
560
  controlPoints: [],
568
561
  industries: [],
569
562
  mainPath: []
@@ -800,9 +793,6 @@ function stateToDoc(state, recordNumber) {
800
793
  // Sections as objects — emitted only once the owner has some, so a module
801
794
  // that never used them keeps exactly the doc it had before (#96 phase 2).
802
795
  ...state.sections.length ? { sections: moduleSections({ sections: state.sections }) } : {},
803
- // Emitted only when it isn't the east/west default, so existing docs are
804
- // byte-identical.
805
- ...state.orientation === "north-south" ? { orientation: state.orientation } : {},
806
796
  // Authored mainline path (module-local inches); only when it's a real path.
807
797
  ...state.mainPath.length >= 2 ? { mainPath: state.mainPath } : {}
808
798
  };
@@ -909,7 +899,6 @@ function docToState(doc, fallbackLength, moduleTracks = []) {
909
899
  outline,
910
900
  sectionBreaks: (d.sectionBreaks ?? []).filter((n) => Number.isFinite(n)).map((n) => sc(n)),
911
901
  sections: moduleSections(d),
912
- orientation: d.orientation === "north-south" ? "north-south" : "east-west",
913
902
  mainPath,
914
903
  crossings: (d.crossings ?? []).map((x) => ({
915
904
  id: x.id,
@@ -1424,6 +1413,6 @@ function poseOverridesFromDoc(doc) {
1424
1413
  return out;
1425
1414
  }
1426
1415
 
1427
- export { FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, MAIN2_TRACK_ID, MAIN_TRACK_ID, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endLabels, endLabelsLong, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
1416
+ export { FREEMO_ENDPLATE_TRACK_FASCIA_CLEARANCE_INCHES, FREEMO_ENDPLATE_WIDTH_MIN_INCHES, FREEMO_ENDPLATE_WIDTH_RECOMMENDED_INCHES, FREEMO_TRACK_SPACING_INCHES, MAIN2_TRACK_ID, MAIN_TRACK_ID, N_CAR_LENGTH_INCHES, N_SCALE_RATIO, WHOLE_MODULE_SECTION_ID, asModuleSchematic, benchworkBand, benchworkOutline, buildCrossover, buildPassingSiding, buildTransition, carCapacity, checkEndplateWidth, deriveEndplatePoses, divergeSideForHand, docToState, emptyEditorState, endplateFaceSegments, endplateTrackOffsetFor, endplateTrackOffsetInches, endplateWidthInches, fromSectionRelative, geometryTurnDegrees, inchesToScaleFeet, isLoopDoc, isTransitionTurnout, moduleCenterline, moduleFeatures, moduleFootprint, moduleLengthFromSections, moduleSections, nextId, poseNeedsManual, poseOverridesFromDoc, remapPos, sampleBenchworkOutline, samplePath, scaleFeetToInches, sectionAdjacency, sectionBand, sectionBreaksFromSections, sectionComponents, sectionFootprints, sectionNeighbours, sectionSpans, sectionSpansOrWhole, sectionedCenterline, sectionedEndPose, sliceCenterline, stateToDoc, toSectionRelative, trackPath };
1428
1417
  //# sourceMappingURL=index.js.map
1429
1418
  //# sourceMappingURL=index.js.map