@oicl/openbridge-webcomponents 2.0.0-next.111 → 2.0.0-next.112

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 (40) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +73 -16
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +79 -7
  4. package/dist/navigation-instruments/compass/compass.d.ts +1 -1
  5. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
  6. package/dist/navigation-instruments/compass/compass.js +1 -1
  7. package/dist/navigation-instruments/compass/compass.js.map +1 -1
  8. package/dist/navigation-instruments/current/current.d.ts +25 -0
  9. package/dist/navigation-instruments/current/current.d.ts.map +1 -1
  10. package/dist/navigation-instruments/current/current.js +25 -4
  11. package/dist/navigation-instruments/current/current.js.map +1 -1
  12. package/dist/navigation-instruments/heading/heading.js +1 -1
  13. package/dist/navigation-instruments/heading/heading.js.map +1 -1
  14. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.d.ts +6 -0
  15. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.d.ts.map +1 -1
  16. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.js +8 -1
  17. package/dist/navigation-instruments/pitch-roll-heave/pitch-roll-heave.js.map +1 -1
  18. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts +5 -2
  19. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.d.ts.map +1 -1
  20. package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js.map +1 -1
  21. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.d.ts +6 -0
  22. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.d.ts.map +1 -1
  23. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.js +19 -4
  24. package/dist/navigation-instruments/top-view-propulsion/top-view-propulsion.js.map +1 -1
  25. package/dist/navigation-instruments/watch/environment.d.ts +8 -0
  26. package/dist/navigation-instruments/watch/environment.d.ts.map +1 -1
  27. package/dist/navigation-instruments/watch/environment.js +3 -0
  28. package/dist/navigation-instruments/watch/environment.js.map +1 -1
  29. package/dist/navigation-instruments/watch/force-pattern.d.ts +20 -2
  30. package/dist/navigation-instruments/watch/force-pattern.d.ts.map +1 -1
  31. package/dist/navigation-instruments/watch/force-pattern.js +12 -5
  32. package/dist/navigation-instruments/watch/force-pattern.js.map +1 -1
  33. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  34. package/dist/navigation-instruments/watch/watch.js +6 -4
  35. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  36. package/dist/navigation-instruments/wind/wind.d.ts +5 -2
  37. package/dist/navigation-instruments/wind/wind.d.ts.map +1 -1
  38. package/dist/navigation-instruments/wind/wind.js +5 -1
  39. package/dist/navigation-instruments/wind/wind.js.map +1 -1
  40. package/package.json +1 -1
@@ -54698,6 +54698,8 @@ const WIND_SHAFT_BUCKETS = [
54698
54698
  100
54699
54699
  ];
54700
54700
  const WIND_ICON_SCALE = 2;
54701
+ const WIND_ICON_TIP_Y = 22.4453;
54702
+ const WIND_ICON_TIP_TO_BOX_INNER = (24 - WIND_ICON_TIP_Y) * WIND_ICON_SCALE;
54701
54703
  const windIconCache = /* @__PURE__ */ new Map();
54702
54704
  function getWindIconSvg(bucket) {
54703
54705
  const tagName = `obi-wind-true-${bucket}`;
@@ -55267,6 +55269,8 @@ function innerRingRadiusFor(type) {
55267
55269
  }
55268
55270
  }
55269
55271
  const RADIAL_SETPOINT_INWARD_ADJUST = 4;
55272
+ const CURRENT_ICON_OUTSIDE_RADIUS = OUTER_RING_RADIUS + 4;
55273
+ const WIND_ICON_OUTSIDE_RADIUS = CURRENT_ICON_OUTSIDE_RADIUS + WIND_ICON_TIP_TO_BOX_INNER;
55270
55274
  let ObcWatch = class extends i$4 {
55271
55275
  constructor() {
55272
55276
  super(...arguments);
@@ -55819,7 +55823,7 @@ let ObcWatch = class extends i$4 {
55819
55823
  );
55820
55824
  const advices = this.advices ? this.advices.map((a2) => renderAdvice$3(a2, rOff)) : A;
55821
55825
  const showNsweLabels = this.showLabels && !this._labelsHidden;
55822
- const showNorthArrow = this.northArrow && !this._labelsHidden;
55826
+ const showNorthArrow = this.northArrow;
55823
55827
  const insideLabels = this.tickmarksInside && showNsweLabels;
55824
55828
  const includeNorth = !this.northArrow;
55825
55829
  const labelPositions = showNsweLabels ? getLabelPositions({
@@ -55845,7 +55849,7 @@ let ObcWatch = class extends i$4 {
55845
55849
  const wind = this.windKnots != null && this.windFromDirectionDeg != null ? w`<g transform="scale(${this.scaleWindIcon})">${renderWind({
55846
55850
  windKnots: this.windKnots,
55847
55851
  fromDirectionDeg: this.windFromDirectionDeg,
55848
- radius: this.windSymbolRadius ?? 192,
55852
+ radius: this.windSymbolRadius ?? WIND_ICON_OUTSIDE_RADIUS,
55849
55853
  color: this.windColor
55850
55854
  })}</g>` : A;
55851
55855
  const current = this.current != null && this.currentFromDirectionDeg != null ? this.currentIconCentered ? renderCurrentCentered({
@@ -55856,7 +55860,7 @@ let ObcWatch = class extends i$4 {
55856
55860
  }) : renderCurrent({
55857
55861
  current: this.current,
55858
55862
  fromDirectionDeg: this.currentFromDirectionDeg,
55859
- radius: this.currentSymbolRadius ?? 192,
55863
+ radius: this.currentSymbolRadius ?? CURRENT_ICON_OUTSIDE_RADIUS,
55860
55864
  color: this.currentColor
55861
55865
  }) : A;
55862
55866
  return b`
@@ -213112,7 +213116,7 @@ let ObcCompass = class extends i$4 {
213112
213116
  .tickmarksInside=${this.tickmarksInside}
213113
213117
  .crosshairEnabled=${true}
213114
213118
  .crosshairCenterCutout=${this.hasCenterReadouts}
213115
- .northArrow=${!frame.labelsHidden}
213119
+ .northArrow=${true}
213116
213120
  .angleSetpoint=${this.headingSetpoint ?? void 0}
213117
213121
  .newAngleSetpoint=${this.newHeadingSetpoint}
213118
213122
  .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}
@@ -213392,14 +213396,18 @@ function renderWindForcePattern(options) {
213392
213396
  function renderCurrentForcePattern(options) {
213393
213397
  const { fromDirectionDeg, radius, patternScale } = options;
213394
213398
  const color2 = options.color ?? DEFAULT_COLOR;
213395
- const tile = CURRENT_TILE * patternScale;
213399
+ const lengthScale = Number.isFinite(options.waveLength) && options.waveLength > 0 ? options.waveLength : 1;
213400
+ const intensity = Number.isFinite(options.waveHeight) ? Math.max(0, Math.min(1, options.waveHeight)) : 1;
213401
+ const speed = Number.isFinite(options.waveSpeed) ? options.waveSpeed : 0;
213402
+ const tile = CURRENT_TILE * patternScale * lengthScale;
213396
213403
  const side = DESIGN_PATTERN_SQUARE * patternScale;
213397
- const phase = CURRENT_TILE_PHASE_OFFSET * patternScale;
213404
+ const phase = CURRENT_TILE_PHASE_OFFSET * patternScale * lengthScale;
213405
+ const drift = speed !== 0 ? w`<animateTransform attributeName="transform" attributeType="XML" type="translate" from="0 0" to="0 ${tile * Math.sign(speed)}" dur="${1 / Math.abs(speed)}s" repeatCount="indefinite"/>` : A;
213398
213406
  return w`
213399
213407
  <defs>
213400
213408
  <linearGradient id="current-force-band-gradient" x1="24" y1="0" x2="24" y2="48" gradientUnits="userSpaceOnUse">
213401
213409
  <stop stop-color=${color2} stop-opacity="0"/>
213402
- <stop offset="1" stop-color=${color2}/>
213410
+ <stop offset="1" stop-color=${color2} stop-opacity=${intensity}/>
213403
213411
  </linearGradient>
213404
213412
  <pattern id="current-force-pattern" patternUnits="userSpaceOnUse" x=${-side / 2 + phase} y=${-side / 2 + phase} width=${tile} height=${tile} viewBox="0 0 48 48" preserveAspectRatio="none">
213405
213413
  <rect width="48" height="48" fill="url(#current-force-band-gradient)"/>
@@ -213407,7 +213415,10 @@ function renderCurrentForcePattern(options) {
213407
213415
  <clipPath id="current-force-clip"><circle cx="0" cy="0" r=${radius}/></clipPath>
213408
213416
  </defs>
213409
213417
  <g clip-path="url(#current-force-clip)" transform="rotate(${fromDirectionDeg})">
213410
- <rect x=${-side / 2} y=${-side / 2} width=${side} height=${side} fill="url(#current-force-pattern)"/>
213418
+ <g>
213419
+ ${drift}
213420
+ <rect x=${-side / 2} y=${-side / 2 - tile} width=${side} height=${side + 2 * tile} fill="url(#current-force-pattern)"/>
213421
+ </g>
213411
213422
  </g>
213412
213423
  `;
213413
213424
  }
@@ -213423,7 +213434,9 @@ var __decorateClass$L = (decorators, target, key, kind) => {
213423
213434
  };
213424
213435
  const CURRENT_PATTERN_SCALE_VESSEL = 1.39;
213425
213436
  const CURRENT_PATTERN_SCALE_DIRECTION = 2;
213426
- const CURRENT_ICON_PERIPHERY_RADIUS = 116;
213437
+ const CURRENT_ICON_PERIPHERY_RADIUS = innerRingRadiusFor(
213438
+ WatchCircleType.double
213439
+ );
213427
213440
  const CURRENT_DIRECTION_ICON_SCALE = 7;
213428
213441
  function clampCurrentSpeed(value) {
213429
213442
  if (value == null || !Number.isFinite(value)) {
@@ -213438,6 +213451,10 @@ let ObcCurrent = class extends i$4 {
213438
213451
  this.currentSpeed = null;
213439
213452
  this.currentFromDirection = null;
213440
213453
  this.priority = Priority.regular;
213454
+ this.hasPattern = true;
213455
+ this.waveLength = 1;
213456
+ this.waveHeight = 1;
213457
+ this.waveSpeed = 0;
213441
213458
  this.vesselImage = VesselImage.genericTop;
213442
213459
  this.vesselHeadingDeg = 0;
213443
213460
  }
@@ -213480,7 +213497,7 @@ let ObcCurrent = class extends i$4 {
213480
213497
  `;
213481
213498
  }
213482
213499
  renderForcePattern(watchCircleType) {
213483
- if (this.currentFromDirection == null) {
213500
+ if (!this.hasPattern || this.currentFromDirection == null) {
213484
213501
  return A;
213485
213502
  }
213486
213503
  return b`
@@ -213489,7 +213506,10 @@ let ObcCurrent = class extends i$4 {
213489
213506
  fromDirectionDeg: this.currentFromDirection,
213490
213507
  radius: innerRingRadiusFor(watchCircleType),
213491
213508
  patternScale: this.isVesselType ? CURRENT_PATTERN_SCALE_VESSEL : CURRENT_PATTERN_SCALE_DIRECTION,
213492
- color: this.enhanced ? "var(--instrument-enhanced-tertiary-color)" : void 0
213509
+ color: this.enhanced ? "var(--instrument-enhanced-tertiary-color)" : void 0,
213510
+ waveLength: this.waveLength,
213511
+ waveHeight: this.waveHeight,
213512
+ waveSpeed: this.waveSpeed
213493
213513
  })}
213494
213514
  </svg>
213495
213515
  `;
@@ -213508,6 +213528,18 @@ __decorateClass$L([
213508
213528
  __decorateClass$L([
213509
213529
  n$3({ type: String })
213510
213530
  ], ObcCurrent.prototype, "priority", 2);
213531
+ __decorateClass$L([
213532
+ n$3({ type: Boolean, attribute: false })
213533
+ ], ObcCurrent.prototype, "hasPattern", 2);
213534
+ __decorateClass$L([
213535
+ n$3({ type: Number })
213536
+ ], ObcCurrent.prototype, "waveLength", 2);
213537
+ __decorateClass$L([
213538
+ n$3({ type: Number })
213539
+ ], ObcCurrent.prototype, "waveHeight", 2);
213540
+ __decorateClass$L([
213541
+ n$3({ type: Number })
213542
+ ], ObcCurrent.prototype, "waveSpeed", 2);
213511
213543
  __decorateClass$L([
213512
213544
  n$3({ type: String })
213513
213545
  ], ObcCurrent.prototype, "vesselImage", 2);
@@ -222128,7 +222160,7 @@ let ObcHeading = class extends i$4 {
222128
222160
  .tickmarksInside=${this.tickmarksInside}
222129
222161
  .crosshairEnabled=${true}
222130
222162
  .crosshairCenterCutout=${this.hasCenterReadouts}
222131
- .northArrow=${!frame.labelsHidden}
222163
+ .northArrow=${true}
222132
222164
  .angleSetpoint=${this.headingSetpoint ?? void 0}
222133
222165
  .newAngleSetpoint=${this.newHeadingSetpoint}
222134
222166
  .atAngleSetpoint=${this._headingSp.computeAtSetpoint(this.heading)}
@@ -224483,9 +224515,16 @@ let ObcPitchRollHeave = class extends i$4 {
224483
224515
  * `obc-watch` renders its crosshair after the bands, i.e. on top of them.
224484
224516
  * Drawing it here puts it under the watch layer, so the bands and the heave
224485
224517
  * column mask it naturally.
224518
+ *
224519
+ * In `single-scale` nothing frames the segment above the vessel (the other
224520
+ * three arms end under the pitch band, roll band and heave column), so the
224521
+ * vertical arm stops at the centre instead of continuing upward. In
224522
+ * `dual-scale` the top roll band gives it a natural endpoint, so the full
224523
+ * arm is kept.
224486
224524
  */
224487
224525
  renderCrosshair() {
224488
224526
  const r2 = OUTER_RING_RADIUS;
224527
+ const yTop = this.isDualScale ? -r2 : 0;
224489
224528
  return w`
224490
224529
  <line
224491
224530
  x1=${-r2} y1="0" x2=${r2} y2="0"
@@ -224493,7 +224532,7 @@ let ObcPitchRollHeave = class extends i$4 {
224493
224532
  vector-effect="non-scaling-stroke"
224494
224533
  />
224495
224534
  <line
224496
- x1="0" y1=${-r2} x2="0" y2=${r2}
224535
+ x1="0" y1=${yTop} x2="0" y2=${r2}
224497
224536
  stroke="var(--instrument-frame-tertiary-color)"
224498
224537
  vector-effect="non-scaling-stroke"
224499
224538
  />
@@ -230747,6 +230786,20 @@ let ObcTopViewPropulsion = class extends i$4 {
230747
230786
  stroke-linecap="round"
230748
230787
  ></path>`;
230749
230788
  }
230789
+ /**
230790
+ * Thin outline on the track band's inner edge, always shown per the
230791
+ * design's track face. Drawn on the overlay because the watch paints its
230792
+ * band bars over the ring circles, which would swallow a watch-side line.
230793
+ */
230794
+ renderInnerRingLine() {
230795
+ return w`<circle
230796
+ r=${BAND_INNER_RADIUS}
230797
+ fill="none"
230798
+ stroke="var(--instrument-frame-tertiary-color)"
230799
+ stroke-width="1"
230800
+ vector-effect="non-scaling-stroke"
230801
+ ></circle>`;
230802
+ }
230750
230803
  renderPropeller() {
230751
230804
  return w`<g transform="scale(${PROPELLER_SCALE}) translate(-80 -80)">${propellerImages[this.propeller]}</g>`;
230752
230805
  }
@@ -230767,6 +230820,7 @@ let ObcTopViewPropulsion = class extends i$4 {
230767
230820
  <obc-watch
230768
230821
  .touching=${this.touching}
230769
230822
  .arcFrame=${frame}
230823
+ .watchCircleType=${WatchCircleType.double}
230770
230824
  .tickmarks=${shownTickmarks}
230771
230825
  .state=${this.state}
230772
230826
  .priority=${this.priority}
@@ -230784,8 +230838,8 @@ let ObcTopViewPropulsion = class extends i$4 {
230784
230838
  .tickmarkStyle=${this.tickmarkStyle}
230785
230839
  ></obc-watch>
230786
230840
  <svg viewBox=${frame.viewBox} xmlns="http://www.w3.org/2000/svg">
230787
- ${this.renderLoadingArc()} ${this.renderSecondaryArc()}
230788
- ${this.renderPropeller()}
230841
+ ${this.renderInnerRingLine()} ${this.renderLoadingArc()}
230842
+ ${this.renderSecondaryArc()} ${this.renderPropeller()}
230789
230843
  </svg>
230790
230844
  </div>
230791
230845
  `;
@@ -232298,7 +232352,10 @@ function resolveHistogramMaxRadius(variant) {
232298
232352
  function resolveWindArrowPlacement(variant) {
232299
232353
  switch (variant) {
232300
232354
  case "large":
232301
- return { windSymbolRadius: 119, scaleWindIcon: 1 };
232355
+ return {
232356
+ windSymbolRadius: innerRingRadiusFor(WatchCircleType.double) + WIND_ICON_TIP_TO_BOX_INNER,
232357
+ scaleWindIcon: 1
232358
+ };
232302
232359
  case "medium":
232303
232360
  return { windSymbolRadius: 62, scaleWindIcon: 1.5 };
232304
232361
  case "small":