@oicl/openbridge-webcomponents 2.0.0-next.56 → 2.0.0-next.57

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.
Files changed (26) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +395 -123
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +284 -2
  4. package/dist/navigation-instruments/compass-sector/compass-sector.css.js +12 -0
  5. package/dist/navigation-instruments/compass-sector/compass-sector.css.js.map +1 -1
  6. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +23 -0
  7. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
  8. package/dist/navigation-instruments/compass-sector/compass-sector.js +47 -0
  9. package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
  10. package/dist/navigation-instruments/pitch/pitch.d.ts +37 -0
  11. package/dist/navigation-instruments/pitch/pitch.d.ts.map +1 -1
  12. package/dist/navigation-instruments/pitch/pitch.js +130 -62
  13. package/dist/navigation-instruments/pitch/pitch.js.map +1 -1
  14. package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts +7 -0
  15. package/dist/navigation-instruments/pitch-roll/pitch-roll.d.ts.map +1 -1
  16. package/dist/navigation-instruments/pitch-roll/pitch-roll.js +58 -2
  17. package/dist/navigation-instruments/pitch-roll/pitch-roll.js.map +1 -1
  18. package/dist/navigation-instruments/roll/roll.d.ts +37 -0
  19. package/dist/navigation-instruments/roll/roll.d.ts.map +1 -1
  20. package/dist/navigation-instruments/roll/roll.js +119 -63
  21. package/dist/navigation-instruments/roll/roll.js.map +1 -1
  22. package/dist/navigation-instruments/rot-sector/rot-sector.d.ts +15 -0
  23. package/dist/navigation-instruments/rot-sector/rot-sector.d.ts.map +1 -1
  24. package/dist/navigation-instruments/rot-sector/rot-sector.js +53 -1
  25. package/dist/navigation-instruments/rot-sector/rot-sector.js.map +1 -1
  26. package/package.json +1 -1
@@ -70468,6 +70468,16 @@
70468
70468
  "default": "false",
70469
70469
  "attribute": "zoomToFitArc"
70470
70470
  },
70471
+ {
70472
+ "kind": "field",
70473
+ "name": "hasReadout",
70474
+ "type": {
70475
+ "text": "boolean"
70476
+ },
70477
+ "default": "false",
70478
+ "description": "When `true`, shows a centered `<obc-readout>` under the arc displaying the\nheading (label `HDG`, unit `DEG`). The value color follows the HDG entry in\n`priorityElements`, matching the HDG arrow.",
70479
+ "attribute": "hasReadout"
70480
+ },
70471
70481
  {
70472
70482
  "kind": "field",
70473
70483
  "name": "_headingSp",
@@ -70680,6 +70690,16 @@
70680
70690
  }
70681
70691
  }
70682
70692
  ]
70693
+ },
70694
+ {
70695
+ "kind": "field",
70696
+ "name": "_readoutTopPercent",
70697
+ "type": {
70698
+ "text": "number"
70699
+ },
70700
+ "privacy": "private",
70701
+ "description": "Vertical placement of the readout as a percentage of the host height.\n\nWith `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose\n`radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which\ncardinal axes its bounding box crosses), not just its bend. The arc itself\nis always rotated back to the top, so it stays put on screen — but a\nframe-derived offset would swing wildly as `heading` rotates the bbox around\nthe circle. So in zoom we use a fixed offset, which keeps the readout steady\nunder the (stationary) arc regardless of heading.\n\nWithout zoom the viewBox is the fixed, origin-symmetric 120° framing, so the\ngeometry is orientation-independent: place the readout halfway down the inner\nradius from the watch center toward the arc's inner edge.",
70702
+ "readonly": true
70683
70703
  }
70684
70704
  ],
70685
70705
  "events": [
@@ -70869,6 +70889,15 @@
70869
70889
  },
70870
70890
  "default": "false",
70871
70891
  "fieldName": "zoomToFitArc"
70892
+ },
70893
+ {
70894
+ "name": "hasReadout",
70895
+ "type": {
70896
+ "text": "boolean"
70897
+ },
70898
+ "default": "false",
70899
+ "description": "When `true`, shows a centered `<obc-readout>` under the arc displaying the\nheading (label `HDG`, unit `DEG`). The value color follows the HDG entry in\n`priorityElements`, matching the HDG arrow.",
70900
+ "fieldName": "hasReadout"
70872
70901
  }
70873
70902
  ],
70874
70903
  "superclass": {
@@ -79764,6 +79793,16 @@
79764
79793
  },
79765
79794
  "default": "[ PitchRollPriorityElement.pitch, PitchRollPriorityElement.roll, ]"
79766
79795
  },
79796
+ {
79797
+ "kind": "field",
79798
+ "name": "hasReadout",
79799
+ "type": {
79800
+ "text": "boolean"
79801
+ },
79802
+ "default": "false",
79803
+ "description": "When `true`, the centre shows two stacked `<obc-readout>`s (pitch above\nroll) instead of the vessel images. Default `false`.",
79804
+ "attribute": "hasReadout"
79805
+ },
79767
79806
  {
79768
79807
  "kind": "field",
79769
79808
  "name": "zoomToFitArc",
@@ -79883,6 +79922,31 @@
79883
79922
  "privacy": "private",
79884
79923
  "readonly": true
79885
79924
  },
79925
+ {
79926
+ "kind": "method",
79927
+ "name": "renderReadout",
79928
+ "privacy": "private",
79929
+ "parameters": [
79930
+ {
79931
+ "name": "value",
79932
+ "type": {
79933
+ "text": "number"
79934
+ }
79935
+ },
79936
+ {
79937
+ "name": "label",
79938
+ "type": {
79939
+ "text": "string"
79940
+ }
79941
+ },
79942
+ {
79943
+ "name": "element",
79944
+ "type": {
79945
+ "text": "PitchRollPriorityElement"
79946
+ }
79947
+ }
79948
+ ]
79949
+ },
79886
79950
  {
79887
79951
  "kind": "method",
79888
79952
  "name": "renderZoomedArcs",
@@ -80062,6 +80126,15 @@
80062
80126
  },
80063
80127
  "fieldName": "priority"
80064
80128
  },
80129
+ {
80130
+ "name": "hasReadout",
80131
+ "type": {
80132
+ "text": "boolean"
80133
+ },
80134
+ "default": "false",
80135
+ "description": "When `true`, the centre shows two stacked `<obc-readout>`s (pitch above\nroll) instead of the vessel images. Default `false`.",
80136
+ "fieldName": "hasReadout"
80137
+ },
80065
80138
  {
80066
80139
  "name": "zoomToFitArc",
80067
80140
  "type": {
@@ -80129,7 +80202,7 @@
80129
80202
  "declarations": [
80130
80203
  {
80131
80204
  "kind": "class",
80132
- "description": "",
80205
+ "description": "`<obc-pitch>` — Pitch (trim) indicator with a side arc scale.\n\nShows `pitch` against a watch arc centred on the right, with an average-pitch\nband and a rotating indicator. Supports an optional opposite-side scale\n(`dual-scale`), a centre readout (`hasReadout`), and a `regular`/`enhanced`\npalette.",
80133
80206
  "name": "ObcPitch",
80134
80207
  "members": [
80135
80208
  {
@@ -80194,6 +80267,34 @@
80194
80267
  "default": "false",
80195
80268
  "attribute": "zoomToFitArc"
80196
80269
  },
80270
+ {
80271
+ "kind": "field",
80272
+ "name": "hasReadout",
80273
+ "type": {
80274
+ "text": "boolean"
80275
+ },
80276
+ "default": "false",
80277
+ "description": "When `true`, the centre shows an `<obc-readout>` with the pitch value\n(label `Pitch`, unit `DEG`) instead of the horizon line, rotating indicator\nand vessel. Default `false`.",
80278
+ "attribute": "hasReadout"
80279
+ },
80280
+ {
80281
+ "kind": "field",
80282
+ "name": "type",
80283
+ "type": {
80284
+ "text": "ObcPitchType"
80285
+ },
80286
+ "description": "`single-scale` shows one arc on the right (default); `dual-scale` also\nshows the scale on the opposite (left) arc (the indicator's opposite end).",
80287
+ "attribute": "type"
80288
+ },
80289
+ {
80290
+ "kind": "field",
80291
+ "name": "priority",
80292
+ "type": {
80293
+ "text": "Priority"
80294
+ },
80295
+ "description": "Colour palette for the scale fill / indicator and the readout value:\n`regular` (default) or `enhanced`.",
80296
+ "attribute": "priority"
80297
+ },
80197
80298
  {
80198
80299
  "kind": "field",
80199
80300
  "name": "arcAngle",
@@ -80212,6 +80313,43 @@
80212
80313
  },
80213
80314
  "privacy": "private"
80214
80315
  },
80316
+ {
80317
+ "kind": "field",
80318
+ "name": "scaleFillColor",
80319
+ "type": {
80320
+ "text": "string"
80321
+ },
80322
+ "privacy": "private",
80323
+ "readonly": true
80324
+ },
80325
+ {
80326
+ "kind": "field",
80327
+ "name": "indicatorColor",
80328
+ "type": {
80329
+ "text": "string"
80330
+ },
80331
+ "privacy": "private",
80332
+ "readonly": true
80333
+ },
80334
+ {
80335
+ "kind": "method",
80336
+ "name": "renderScale",
80337
+ "privacy": "private",
80338
+ "parameters": [
80339
+ {
80340
+ "name": "areas",
80341
+ "type": {
80342
+ "text": "WatchArea[]"
80343
+ }
80344
+ },
80345
+ {
80346
+ "name": "opposite",
80347
+ "type": {
80348
+ "text": "boolean"
80349
+ }
80350
+ }
80351
+ ]
80352
+ },
80215
80353
  {
80216
80354
  "kind": "field",
80217
80355
  "name": "advices",
@@ -80278,6 +80416,31 @@
80278
80416
  "default": "false",
80279
80417
  "fieldName": "zoomToFitArc"
80280
80418
  },
80419
+ {
80420
+ "name": "hasReadout",
80421
+ "type": {
80422
+ "text": "boolean"
80423
+ },
80424
+ "default": "false",
80425
+ "description": "When `true`, the centre shows an `<obc-readout>` with the pitch value\n(label `Pitch`, unit `DEG`) instead of the horizon line, rotating indicator\nand vessel. Default `false`.",
80426
+ "fieldName": "hasReadout"
80427
+ },
80428
+ {
80429
+ "name": "type",
80430
+ "type": {
80431
+ "text": "ObcPitchType"
80432
+ },
80433
+ "description": "`single-scale` shows one arc on the right (default); `dual-scale` also\nshows the scale on the opposite (left) arc (the indicator's opposite end).",
80434
+ "fieldName": "type"
80435
+ },
80436
+ {
80437
+ "name": "priority",
80438
+ "type": {
80439
+ "text": "Priority"
80440
+ },
80441
+ "description": "Colour palette for the scale fill / indicator and the readout value:\n`regular` (default) or `enhanced`.",
80442
+ "fieldName": "priority"
80443
+ },
80281
80444
  {
80282
80445
  "name": "arcAngle",
80283
80446
  "type": {
@@ -83833,7 +83996,7 @@
83833
83996
  "declarations": [
83834
83997
  {
83835
83998
  "kind": "class",
83836
- "description": "",
83999
+ "description": "`<obc-roll>` — Roll (heel) indicator with a bottom arc scale.\n\nShows `roll` against a watch arc centred at the bottom, with an average-roll\nband and a rotating indicator. Supports an optional top scale (`dual-scale`),\na centre readout (`hasReadout`), and a `regular`/`enhanced` palette. See the\nindividual properties for details.",
83837
84000
  "name": "ObcRoll",
83838
84001
  "members": [
83839
84002
  {
@@ -83907,6 +84070,34 @@
83907
84070
  "default": "false",
83908
84071
  "attribute": "zoomToFitArc"
83909
84072
  },
84073
+ {
84074
+ "kind": "field",
84075
+ "name": "hasReadout",
84076
+ "type": {
84077
+ "text": "boolean"
84078
+ },
84079
+ "default": "false",
84080
+ "description": "When `true`, the centre shows an `<obc-readout>` with the roll value\n(label `Roll`, unit `DEG`) instead of the horizon line, rotating indicator\nand vessel. Default `false`.",
84081
+ "attribute": "hasReadout"
84082
+ },
84083
+ {
84084
+ "kind": "field",
84085
+ "name": "type",
84086
+ "type": {
84087
+ "text": "ObcRollType"
84088
+ },
84089
+ "description": "`single-scale` shows one arc at the bottom (default); `dual-scale` also\nshows the scale on the top arc (the indicator's opposite end).",
84090
+ "attribute": "type"
84091
+ },
84092
+ {
84093
+ "kind": "field",
84094
+ "name": "priority",
84095
+ "type": {
84096
+ "text": "Priority"
84097
+ },
84098
+ "description": "Colour palette for the scale fill / indicator and the readout value:\n`regular` (default) or `enhanced`.",
84099
+ "attribute": "priority"
84100
+ },
83910
84101
  {
83911
84102
  "kind": "field",
83912
84103
  "name": "arcAngle",
@@ -83934,6 +84125,43 @@
83934
84125
  "privacy": "private",
83935
84126
  "readonly": true
83936
84127
  },
84128
+ {
84129
+ "kind": "field",
84130
+ "name": "scaleFillColor",
84131
+ "type": {
84132
+ "text": "string"
84133
+ },
84134
+ "privacy": "private",
84135
+ "readonly": true
84136
+ },
84137
+ {
84138
+ "kind": "field",
84139
+ "name": "indicatorColor",
84140
+ "type": {
84141
+ "text": "string"
84142
+ },
84143
+ "privacy": "private",
84144
+ "readonly": true
84145
+ },
84146
+ {
84147
+ "kind": "method",
84148
+ "name": "renderScale",
84149
+ "privacy": "private",
84150
+ "parameters": [
84151
+ {
84152
+ "name": "areas",
84153
+ "type": {
84154
+ "text": "WatchArea[]"
84155
+ }
84156
+ },
84157
+ {
84158
+ "name": "top",
84159
+ "type": {
84160
+ "text": "boolean"
84161
+ }
84162
+ }
84163
+ ]
84164
+ },
83937
84165
  {
83938
84166
  "kind": "field",
83939
84167
  "name": "advices",
@@ -84008,6 +84236,31 @@
84008
84236
  "default": "false",
84009
84237
  "fieldName": "zoomToFitArc"
84010
84238
  },
84239
+ {
84240
+ "name": "hasReadout",
84241
+ "type": {
84242
+ "text": "boolean"
84243
+ },
84244
+ "default": "false",
84245
+ "description": "When `true`, the centre shows an `<obc-readout>` with the roll value\n(label `Roll`, unit `DEG`) instead of the horizon line, rotating indicator\nand vessel. Default `false`.",
84246
+ "fieldName": "hasReadout"
84247
+ },
84248
+ {
84249
+ "name": "type",
84250
+ "type": {
84251
+ "text": "ObcRollType"
84252
+ },
84253
+ "description": "`single-scale` shows one arc at the bottom (default); `dual-scale` also\nshows the scale on the top arc (the indicator's opposite end).",
84254
+ "fieldName": "type"
84255
+ },
84256
+ {
84257
+ "name": "priority",
84258
+ "type": {
84259
+ "text": "Priority"
84260
+ },
84261
+ "description": "Colour palette for the scale fill / indicator and the readout value:\n`regular` (default) or `enhanced`.",
84262
+ "fieldName": "priority"
84263
+ },
84011
84264
  {
84012
84265
  "name": "arcAngle",
84013
84266
  "type": {
@@ -84394,6 +84647,16 @@
84394
84647
  "default": "60",
84395
84648
  "attribute": "rotArcExtent"
84396
84649
  },
84650
+ {
84651
+ "kind": "field",
84652
+ "name": "hasReadout",
84653
+ "type": {
84654
+ "text": "boolean"
84655
+ },
84656
+ "default": "false",
84657
+ "description": "When `true`, shows a centered `<obc-readout>` (label `ROT`, unit `DEG/min`)\nunder the arc with the current rate-of-turn value. Default `false`.",
84658
+ "attribute": "hasReadout"
84659
+ },
84397
84660
  {
84398
84661
  "kind": "field",
84399
84662
  "name": "getAngle"
@@ -84415,6 +84678,16 @@
84415
84678
  "privacy": "private",
84416
84679
  "readonly": true
84417
84680
  },
84681
+ {
84682
+ "kind": "field",
84683
+ "name": "_readoutTopPercent",
84684
+ "type": {
84685
+ "text": "number"
84686
+ },
84687
+ "privacy": "private",
84688
+ "description": "Vertical position of the readout, in % of the host. In the zoomed view the\narc's lower edge shifts with `rotArcExtent`, so the position is interpolated\nbetween the narrow- and wide-arc anchors to keep a roughly constant gap\nbetween the arc and the readout. The static (unzoomed) arc uses a fixed\nposition.",
84689
+ "readonly": true
84690
+ },
84418
84691
  {
84419
84692
  "kind": "field",
84420
84693
  "name": "_needleColor",
@@ -84724,6 +84997,15 @@
84724
84997
  "default": "60",
84725
84998
  "fieldName": "rotArcExtent"
84726
84999
  },
85000
+ {
85001
+ "name": "hasReadout",
85002
+ "type": {
85003
+ "text": "boolean"
85004
+ },
85005
+ "default": "false",
85006
+ "description": "When `true`, shows a centered `<obc-readout>` (label `ROT`, unit `DEG/min`)\nunder the arc with the current rate-of-turn value. Default `false`.",
85007
+ "fieldName": "hasReadout"
85008
+ },
84727
85009
  {
84728
85010
  "name": "setpoint",
84729
85011
  "type": {
@@ -22,6 +22,18 @@ const componentStyle = css`
22
22
  height: 100%;
23
23
  }
24
24
 
25
+ .container > .readout {
26
+ left: 50%;
27
+ width: auto;
28
+ height: auto;
29
+ transform: translate(-50%, -50%);
30
+ }
31
+
32
+ obc-readout::part(value-wrapper),
33
+ obc-readout::part(meta-wrapper) {
34
+ justify-self: center;
35
+ }
36
+
25
37
  :host {
26
38
  display: block;
27
39
  width: 100%;
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"compass-sector.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,7 @@ import { AngleAdvice } from '../watch/advice.js';
3
3
  import { RotType, RotPosition } from '../watch/watch.js';
4
4
  import { InstrumentState, Priority } from '../types.js';
5
5
  import '../watch/watch.js';
6
+ import '../readout/readout.js';
6
7
  export { RotType, RotPosition };
7
8
  export declare enum CompassSectorPriorityElement {
8
9
  hdg = "hdg",
@@ -98,6 +99,12 @@ export declare class ObcCompassSector extends LitElement {
98
99
  priorityElements: CompassSectorPriorityElement[];
99
100
  tickmarksInside: boolean;
100
101
  zoomToFitArc: boolean;
102
+ /**
103
+ * When `true`, shows a centered `<obc-readout>` under the arc displaying the
104
+ * heading (label `HDG`, unit `DEG`). The value color follows the HDG entry in
105
+ * `priorityElements`, matching the HDG arrow.
106
+ */
107
+ hasReadout: boolean;
101
108
  private _headingSp;
102
109
  private _halfFOV;
103
110
  private _arcHalfExtent;
@@ -119,6 +126,22 @@ export declare class ObcCompassSector extends LitElement {
119
126
  private get _effectiveRotDegPerMin();
120
127
  private get _rotEndAngle();
121
128
  private priorityFor;
129
+ /**
130
+ * Vertical placement of the readout as a percentage of the host height.
131
+ *
132
+ * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose
133
+ * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which
134
+ * cardinal axes its bounding box crosses), not just its bend. The arc itself
135
+ * is always rotated back to the top, so it stays put on screen — but a
136
+ * frame-derived offset would swing wildly as `heading` rotates the bbox around
137
+ * the circle. So in zoom we use a fixed offset, which keeps the readout steady
138
+ * under the (stationary) arc regardless of heading.
139
+ *
140
+ * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the
141
+ * geometry is orientation-independent: place the readout halfway down the inner
142
+ * radius from the watch center toward the arc's inner edge.
143
+ */
144
+ private get _readoutTopPercent();
122
145
  render(): import('lit-html').TemplateResult<1>;
123
146
  static styles: import('lit').CSSResult;
124
147
  }
@@ -1 +1 @@
1
- {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAG9E,OAAO,mBAAmB,CAAC;AAG3B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,E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H,OAAO,CAAC,QAAQ,CAAM;IACtB,OAAO,CAAC,cAAc,CAAmB;IACzC,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAwB;IAErC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA8DzC,oBAAoB,IAAI,IAAI;IASrC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe;IAmDvB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAgBrB,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,YAAY,GAKvB;IAED,OAAO,CAAC,WAAW;IAWV,MAAM;IAiFf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
1
+ {"version":3,"file":"compass-sector.d.ts","sourceRoot":"","sources":["../../../src/navigation-instruments/compass-sector/compass-sector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,cAAc,EAAgC,MAAM,KAAK,CAAC;AAG9E,OAAO,mBAAmB,CAAC;AAC3B,OAAO,uBAAuB,CAAC;AAI/B,OAAO,EAAc,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAKL,OAAO,EACP,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,aAAa,CAAC;AACtD,OAAO,EAAC,OAAO,EAAE,WAAW,EAAC,CAAC;AAE9B,oBAAY,4BAA4B;IACtC,GAAG,QAAQ;IACX,G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O,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,gBAAgB,CAAkB;IAC1C,OAAO,CAAC,cAAc,CAAwB;IAErC,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IA8DzC,oBAAoB,IAAI,IAAI;IASrC,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,eAAe;IAmDvB,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAgBrB,OAAO,KAAK,sBAAsB,GAEjC;IAED,OAAO,KAAK,YAAY,GAKvB;IAED,OAAO,CAAC,WAAW;IAOnB;;;;;;;;;;;;;;OAcG;IACH,OAAO,KAAK,kBAAkB,GAU7B;IAMQ,MAAM;IAkGf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,gBAAgB,CAAC;KACxC;CACF"}
@@ -2,6 +2,7 @@ import { unsafeCSS, LitElement, nothing, svg, html } from "lit";
2
2
  import { property } from "lit/decorators.js";
3
3
  import componentStyle from "./compass-sector.css.js";
4
4
  import { WatchCircleType, innerRingRadiusFor, OUTER_RING_RADIUS } from "../watch/watch.js";
5
+ import { ReadoutVariant, ReadoutDirection } from "../readout/readout.js";
5
6
  import { TickmarkType, TickmarkStyle } from "../watch/tickmark.js";
6
7
  import { arrow, ArrowStyle } from "../compass/arrow.js";
7
8
  import { AdviceState } from "../watch/advice.js";
@@ -75,6 +76,7 @@ let ObcCompassSector = class extends LitElement {
75
76
  ];
76
77
  this.tickmarksInside = false;
77
78
  this.zoomToFitArc = false;
79
+ this.hasReadout = false;
78
80
  this._headingSp = new SetpointBundle({
79
81
  angularWraparound: true,
80
82
  onAnimationEnd: () => this.requestUpdate()
@@ -262,6 +264,32 @@ let ObcCompassSector = class extends LitElement {
262
264
  const selected = Array.isArray(this.priorityElements) ? this.priorityElements : [];
263
265
  return selected.includes(element) ? this.priority : Priority.regular;
264
266
  }
267
+ /**
268
+ * Vertical placement of the readout as a percentage of the host height.
269
+ *
270
+ * With `zoomToFitArc` the arc is reframed by `computeZoomToFitArcFrame`, whose
271
+ * `radiusOffset`/`viewBox` depend on the arc's *absolute* orientation (which
272
+ * cardinal axes its bounding box crosses), not just its bend. The arc itself
273
+ * is always rotated back to the top, so it stays put on screen — but a
274
+ * frame-derived offset would swing wildly as `heading` rotates the bbox around
275
+ * the circle. So in zoom we use a fixed offset, which keeps the readout steady
276
+ * under the (stationary) arc regardless of heading.
277
+ *
278
+ * Without zoom the viewBox is the fixed, origin-symmetric 120° framing, so the
279
+ * geometry is orientation-independent: place the readout halfway down the inner
280
+ * radius from the watch center toward the arc's inner edge.
281
+ */
282
+ get _readoutTopPercent() {
283
+ if (this.zoomToFitArc) {
284
+ return 70;
285
+ }
286
+ const [, vy, , vh] = this._cachedViewBox.split(" ").map(Number);
287
+ if (!vh || Number.isNaN(vy)) {
288
+ return 50;
289
+ }
290
+ const anchorY = -INNER_RADIUS * 0.5;
291
+ return Math.round((anchorY - vy) / vh * 1e3) / 10;
292
+ }
265
293
  // ---------------------------------------------------------------------------
266
294
  // Render
267
295
  // ---------------------------------------------------------------------------
@@ -343,6 +371,22 @@ let ObcCompassSector = class extends LitElement {
343
371
  rOff
344
372
  )}
345
373
  </svg>
374
+ ${this.hasReadout ? html`<div class="readout" style="top: ${this._readoutTopPercent}%">
375
+ <obc-readout
376
+ .variant=${ReadoutVariant.enhanced}
377
+ .direction=${ReadoutDirection.vertical}
378
+ .hasSetpoint=${false}
379
+ .hasAdvice=${false}
380
+ .value=${this.heading}
381
+ .fractionDigits=${0}
382
+ .valuePriority=${this.priorityFor(
383
+ "hdg"
384
+ /* hdg */
385
+ )}
386
+ label="HDG"
387
+ unit="DEG"
388
+ ></obc-readout>
389
+ </div>` : nothing}
346
390
  </div>
347
391
  `;
348
392
  }
@@ -426,6 +470,9 @@ __decorateClass([
426
470
  __decorateClass([
427
471
  property({ type: Boolean })
428
472
  ], ObcCompassSector.prototype, "zoomToFitArc", 2);
473
+ __decorateClass([
474
+ property({ type: Boolean })
475
+ ], ObcCompassSector.prototype, "hasReadout", 2);
429
476
  ObcCompassSector = __decorateClass([
430
477
  customElement("obc-compass-sector")
431
478
  ], ObcCompassSector);