@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.96 → 2.0.0-next.98

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 (167) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +39 -124
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +343 -142
  4. package/dist/ar/poi/poi.d.ts +4 -2
  5. package/dist/ar/poi/poi.d.ts.map +1 -1
  6. package/dist/ar/poi/poi.js.map +1 -1
  7. package/dist/ar/poi-layer/poi-layer.d.ts +1 -0
  8. package/dist/ar/poi-layer/poi-layer.d.ts.map +1 -1
  9. package/dist/ar/poi-layer/poi-layer.js.map +1 -1
  10. package/dist/ar/poi-object/poi-object-aton.d.ts +1 -0
  11. package/dist/ar/poi-object/poi-object-aton.d.ts.map +1 -1
  12. package/dist/ar/poi-object/poi-object-aton.js.map +1 -1
  13. package/dist/automation/automation-badge/automation-badge.d.ts +2 -0
  14. package/dist/automation/automation-badge/automation-badge.d.ts.map +1 -1
  15. package/dist/automation/automation-badge/automation-badge.js.map +1 -1
  16. package/dist/automation/automation-button/automation-button.d.ts +9 -0
  17. package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
  18. package/dist/automation/automation-button/automation-button.js.map +1 -1
  19. package/dist/automation/automation-input-modal/automation-input-modal.d.ts +4 -0
  20. package/dist/automation/automation-input-modal/automation-input-modal.d.ts.map +1 -1
  21. package/dist/automation/automation-input-modal/automation-input-modal.js.map +1 -1
  22. package/dist/automation/automation-tank/automation-tank.css.js +8 -87
  23. package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
  24. package/dist/automation/automation-tank/automation-tank.d.ts +13 -33
  25. package/dist/automation/automation-tank/automation-tank.d.ts.map +1 -1
  26. package/dist/automation/automation-tank/automation-tank.js +12 -28
  27. package/dist/automation/automation-tank/automation-tank.js.map +1 -1
  28. package/dist/building-blocks/alert-list/alert-list.d.ts +4 -0
  29. package/dist/building-blocks/alert-list/alert-list.d.ts.map +1 -1
  30. package/dist/building-blocks/alert-list/alert-list.js.map +1 -1
  31. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts +2 -0
  32. package/dist/building-blocks/bar-horizontal/bar-horizontal.d.ts.map +1 -1
  33. package/dist/building-blocks/bar-horizontal/bar-horizontal.js.map +1 -1
  34. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts +2 -0
  35. package/dist/building-blocks/bar-vertical/bar-vertical.d.ts.map +1 -1
  36. package/dist/building-blocks/bar-vertical/bar-vertical.js.map +1 -1
  37. package/dist/components/advice-floating-item/advice-floating-item.d.ts +2 -4
  38. package/dist/components/advice-floating-item/advice-floating-item.d.ts.map +1 -1
  39. package/dist/components/advice-floating-item/advice-floating-item.js.map +1 -1
  40. package/dist/components/advice-message-item/advice-message-item.d.ts +6 -19
  41. package/dist/components/advice-message-item/advice-message-item.d.ts.map +1 -1
  42. package/dist/components/advice-message-item/advice-message-item.js.map +1 -1
  43. package/dist/components/alert-floating-item/alert-floating-item.d.ts +12 -0
  44. package/dist/components/alert-floating-item/alert-floating-item.d.ts.map +1 -1
  45. package/dist/components/alert-floating-item/alert-floating-item.js.map +1 -1
  46. package/dist/components/alert-menu/alert-menu.d.ts +6 -20
  47. package/dist/components/alert-menu/alert-menu.d.ts.map +1 -1
  48. package/dist/components/alert-menu/alert-menu.js.map +1 -1
  49. package/dist/components/alert-menu-item/alert-menu-item.d.ts +4 -0
  50. package/dist/components/alert-menu-item/alert-menu-item.d.ts.map +1 -1
  51. package/dist/components/alert-menu-item/alert-menu-item.js.map +1 -1
  52. package/dist/components/chat-message/chat-message.d.ts +3 -0
  53. package/dist/components/chat-message/chat-message.d.ts.map +1 -1
  54. package/dist/components/chat-message/chat-message.js.map +1 -1
  55. package/dist/components/elevated-card-radio/elevated-card-radio.d.ts +2 -6
  56. package/dist/components/elevated-card-radio/elevated-card-radio.d.ts.map +1 -1
  57. package/dist/components/elevated-card-radio/elevated-card-radio.js.map +1 -1
  58. package/dist/components/keyboard-numeric/keyboard-numeric.d.ts +6 -0
  59. package/dist/components/keyboard-numeric/keyboard-numeric.d.ts.map +1 -1
  60. package/dist/components/keyboard-numeric/keyboard-numeric.js.map +1 -1
  61. package/dist/components/notification-floating-item/notification-floating-item.d.ts +2 -4
  62. package/dist/components/notification-floating-item/notification-floating-item.d.ts.map +1 -1
  63. package/dist/components/notification-floating-item/notification-floating-item.js.map +1 -1
  64. package/dist/components/sequence-card/sequence-card.d.ts +9 -0
  65. package/dist/components/sequence-card/sequence-card.d.ts.map +1 -1
  66. package/dist/components/sequence-card/sequence-card.js.map +1 -1
  67. package/dist/components/sequence-item/sequence-item.d.ts +5 -0
  68. package/dist/components/sequence-item/sequence-item.d.ts.map +1 -1
  69. package/dist/components/sequence-item/sequence-item.js.map +1 -1
  70. package/dist/components/sequence-modal/sequence-modal.d.ts +4 -0
  71. package/dist/components/sequence-modal/sequence-modal.d.ts.map +1 -1
  72. package/dist/components/sequence-modal/sequence-modal.js.map +1 -1
  73. package/dist/components/sequence-step/sequence-step.d.ts.map +1 -1
  74. package/dist/components/sequence-step/sequence-step.js.map +1 -1
  75. package/dist/components/slider-double/slider-double.d.ts +4 -8
  76. package/dist/components/slider-double/slider-double.d.ts.map +1 -1
  77. package/dist/components/slider-double/slider-double.js.map +1 -1
  78. package/dist/components/status-indicator/status-indicator.d.ts +1 -0
  79. package/dist/components/status-indicator/status-indicator.d.ts.map +1 -1
  80. package/dist/components/status-indicator/status-indicator.js.map +1 -1
  81. package/dist/components/system-menu/system-menu.d.ts +2 -0
  82. package/dist/components/system-menu/system-menu.d.ts.map +1 -1
  83. package/dist/components/system-menu/system-menu.js.map +1 -1
  84. package/dist/components/table-header-item/table-header-item.d.ts +2 -0
  85. package/dist/components/table-header-item/table-header-item.d.ts.map +1 -1
  86. package/dist/components/table-header-item/table-header-item.js.map +1 -1
  87. package/dist/components/tag/tag.d.ts +1 -0
  88. package/dist/components/tag/tag.d.ts.map +1 -1
  89. package/dist/components/tag/tag.js.map +1 -1
  90. package/dist/components/toggletip/toggletip.d.ts +4 -4
  91. package/dist/components/toggletip/toggletip.js.map +1 -1
  92. package/dist/components/user-menu/user-menu.d.ts +1 -0
  93. package/dist/components/user-menu/user-menu.d.ts.map +1 -1
  94. package/dist/components/user-menu/user-menu.js.map +1 -1
  95. package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts +1 -0
  96. package/dist/integration-systems/integration-app-bar/integration-app-bar.d.ts.map +1 -1
  97. package/dist/integration-systems/integration-app-bar/integration-app-bar.js.map +1 -1
  98. package/dist/integration-systems/integration-bar/integration-bar.d.ts +0 -1
  99. package/dist/integration-systems/integration-bar/integration-bar.d.ts.map +1 -1
  100. package/dist/integration-systems/integration-bar/integration-bar.js.map +1 -1
  101. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.d.ts +9 -9
  102. package/dist/integration-systems/integration-bar-dropdown/integration-bar-dropdown.js.map +1 -1
  103. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts +1 -0
  104. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.d.ts.map +1 -1
  105. package/dist/integration-systems/integration-fleet-button/integration-fleet-button.js.map +1 -1
  106. package/dist/integration-systems/integration-tabs/integration-tabs.d.ts +1 -0
  107. package/dist/integration-systems/integration-tabs/integration-tabs.d.ts.map +1 -1
  108. package/dist/integration-systems/integration-tabs/integration-tabs.js.map +1 -1
  109. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts +0 -1
  110. package/dist/navigation-instruments/compass-sector/compass-sector.d.ts.map +1 -1
  111. package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
  112. package/dist/navigation-instruments/watch/tickmark.d.ts.map +1 -1
  113. package/dist/navigation-instruments/watch/tickmark.js +17 -7
  114. package/dist/navigation-instruments/watch/tickmark.js.map +1 -1
  115. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  116. package/dist/navigation-instruments/watch/watch.js +2 -2
  117. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  118. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +0 -1
  119. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
  120. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
  121. package/dist/pages/alert-detail-page/alert-detail-page.d.ts.map +1 -1
  122. package/dist/pages/alert-detail-page/alert-detail-page.js.map +1 -1
  123. package/package.json +3 -2
  124. package/script/check-slot-event-docs.ts +353 -0
  125. package/src/ar/poi/poi.ts +4 -2
  126. package/src/ar/poi-layer/poi-layer.ts +1 -0
  127. package/src/ar/poi-object/poi-object-aton.ts +1 -0
  128. package/src/automation/automation-badge/automation-badge.ts +2 -0
  129. package/src/automation/automation-button/automation-button.ts +9 -0
  130. package/src/automation/automation-input-modal/automation-input-modal.ts +4 -0
  131. package/src/automation/automation-tank/automation-tank.css +8 -64
  132. package/src/automation/automation-tank/automation-tank.stories.ts +41 -23
  133. package/src/automation/automation-tank/automation-tank.ts +25 -65
  134. package/src/building-blocks/alert-list/alert-list.ts +4 -0
  135. package/src/building-blocks/bar-horizontal/bar-horizontal.ts +2 -0
  136. package/src/building-blocks/bar-vertical/bar-vertical.ts +2 -0
  137. package/src/components/advice-floating-item/advice-floating-item.ts +2 -4
  138. package/src/components/advice-message-item/advice-message-item.ts +6 -19
  139. package/src/components/alert-floating-item/alert-floating-item.ts +12 -0
  140. package/src/components/alert-menu/alert-menu.ts +6 -20
  141. package/src/components/alert-menu-item/alert-menu-item.ts +4 -0
  142. package/src/components/chat-message/chat-message.ts +3 -0
  143. package/src/components/elevated-card-radio/elevated-card-radio.ts +2 -6
  144. package/src/components/keyboard-numeric/keyboard-numeric.ts +6 -0
  145. package/src/components/notification-floating-item/notification-floating-item.ts +2 -4
  146. package/src/components/sequence-card/sequence-card.ts +9 -0
  147. package/src/components/sequence-item/sequence-item.ts +5 -0
  148. package/src/components/sequence-modal/sequence-modal.ts +4 -0
  149. package/src/components/sequence-step/sequence-step.ts +3 -0
  150. package/src/components/slider-double/slider-double.ts +4 -8
  151. package/src/components/status-indicator/status-indicator.ts +1 -0
  152. package/src/components/system-menu/system-menu.ts +2 -0
  153. package/src/components/table-header-item/table-header-item.ts +2 -0
  154. package/src/components/tag/tag.ts +1 -0
  155. package/src/components/toggletip/toggletip.ts +4 -4
  156. package/src/components/user-menu/user-menu.ts +1 -0
  157. package/src/integration-systems/integration-app-bar/integration-app-bar.ts +1 -0
  158. package/src/integration-systems/integration-bar/integration-bar.ts +0 -1
  159. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.ts +9 -9
  160. package/src/integration-systems/integration-fleet-button/integration-fleet-button.ts +1 -0
  161. package/src/integration-systems/integration-tabs/integration-tabs.ts +1 -0
  162. package/src/navigation-instruments/compass-sector/compass-sector.ts +0 -1
  163. package/src/navigation-instruments/watch/tickmark.spec.ts +99 -0
  164. package/src/navigation-instruments/watch/tickmark.ts +21 -8
  165. package/src/navigation-instruments/watch/watch.ts +7 -2
  166. package/src/navigation-instruments/wind-propulsion/wind-propulsion.ts +0 -1
  167. package/src/pages/alert-detail-page/alert-detail-page.ts +7 -0
@@ -0,0 +1,99 @@
1
+ import {describe, it, expect} from 'vitest';
2
+ import type {SVGTemplateResult} from 'lit';
3
+ import {tickmark, TickmarkType, TickmarkStyle} from './tickmark.js';
4
+
5
+ /**
6
+ * Collect every numeric interpolated value from a `tickmark()` result without
7
+ * rendering it. `tickmark()` returns Lit `SVGTemplateResult`s (or an array of
8
+ * them); the interpolated `x`/`y`/coordinate values live on `.values`. This
9
+ * lets us assert the geometry is finite in a plain Node environment — no DOM.
10
+ */
11
+ function numericValues(
12
+ result: SVGTemplateResult | SVGTemplateResult[]
13
+ ): number[] {
14
+ const templates = Array.isArray(result) ? result : [result];
15
+ const numbers: number[] = [];
16
+ for (const template of templates) {
17
+ for (const value of template.values) {
18
+ if (typeof value === 'number') {
19
+ numbers.push(value);
20
+ }
21
+ }
22
+ }
23
+ return numbers;
24
+ }
25
+
26
+ describe('tickmark label positioning', () => {
27
+ // On first paint the element is not laid out yet, so obc-watch computes a
28
+ // scale of 0. A `textOnly` tick still renders a <text>, and dividing by a
29
+ // zero scale used to yield x/y of ±Infinity — which the browser rejects with
30
+ // `<text> attribute x: Expected length, "-Infinity"` (issue #1032).
31
+ it('keeps the zero-value textOnly label finite when the scale is 0', () => {
32
+ const result = tickmark(-90, {
33
+ size: TickmarkType.textOnly,
34
+ style: TickmarkStyle.regular,
35
+ scale: 0,
36
+ text: '0',
37
+ inside: false,
38
+ textRadius: 184,
39
+ maxDigits: 1,
40
+ });
41
+
42
+ for (const value of numericValues(result)) {
43
+ expect(Number.isFinite(value)).toBe(true);
44
+ }
45
+ });
46
+
47
+ it('keeps labelled ticks finite for a zero scale (inside and outside)', () => {
48
+ for (const inside of [false, true]) {
49
+ const result = tickmark(45, {
50
+ size: TickmarkType.primary,
51
+ style: TickmarkStyle.regular,
52
+ scale: 0,
53
+ text: '50',
54
+ inside,
55
+ textRadius: 184,
56
+ maxDigits: 2,
57
+ });
58
+
59
+ for (const value of numericValues(result)) {
60
+ expect(Number.isFinite(value)).toBe(true);
61
+ }
62
+ }
63
+ });
64
+
65
+ it('keeps rotated labels finite for a zero scale', () => {
66
+ const result = tickmark(120, {
67
+ size: TickmarkType.primary,
68
+ style: TickmarkStyle.regular,
69
+ scale: 0,
70
+ text: '12',
71
+ inside: false,
72
+ textRadius: 184,
73
+ rotation: 120,
74
+ maxDigits: 2,
75
+ });
76
+
77
+ for (const value of numericValues(result)) {
78
+ expect(Number.isFinite(value)).toBe(true);
79
+ }
80
+ });
81
+
82
+ it('does not distort geometry for a valid scale', () => {
83
+ // A settled scale must be untouched: the outside zero tick at -90° sits on
84
+ // the negative-x axis, so its x is finite and negative and y is ~0.
85
+ const result = tickmark(-90, {
86
+ size: TickmarkType.textOnly,
87
+ style: TickmarkStyle.regular,
88
+ scale: 1,
89
+ text: '0',
90
+ inside: false,
91
+ textRadius: 184,
92
+ maxDigits: 1,
93
+ });
94
+
95
+ const numbers = numericValues(result);
96
+ expect(numbers.every(Number.isFinite)).toBe(true);
97
+ expect(numbers.some((n) => n < -100)).toBe(true);
98
+ });
99
+ });
@@ -64,14 +64,15 @@ export function tickmark(
64
64
  endLabelsMaxMin?: boolean;
65
65
  }
66
66
  ): SVGTemplateResult | SVGTemplateResult[] {
67
- // check if scale is not infinite
68
- if (scale === Infinity || scale < 0) {
69
- throw new Error('Tick scale is not valid');
70
- }
67
+ // Before layout settles the caller can pass a scale of 0 (or a non-finite
68
+ // value). Label offsets are computed as `px / scale`, so a 0 scale would emit
69
+ // ±Infinity coordinates that the browser rejects. Fall back to a 1:1 scale
70
+ // until a real one is available (issue #1032).
71
+ const safeScale = Number.isFinite(scale) && scale > 0 ? scale : 1;
71
72
  const rOff = radiusOffset;
72
73
  let innerRadius: number;
73
74
  let outerRadius: number;
74
- textRadius = textRadius + (3 / scale + 3) * (inside ? -1 : 1);
75
+ textRadius = textRadius + (3 / safeScale + 3) * (inside ? -1 : 1);
75
76
  const rad = (angle * Math.PI) / 180;
76
77
  if (size === TickmarkType.primary) {
77
78
  innerRadius = 328 / 2 + rOff;
@@ -90,7 +91,13 @@ export function tickmark(
90
91
  outerRadius = 336 / 2 + rOff;
91
92
  } else {
92
93
  return [
93
- textSvg(text ?? '', {angle, inside, scale, textRadius, endLabelsMaxMin}),
94
+ textSvg(text ?? '', {
95
+ angle,
96
+ inside,
97
+ scale: safeScale,
98
+ textRadius,
99
+ endLabelsMaxMin,
100
+ }),
94
101
  ];
95
102
  }
96
103
 
@@ -121,11 +128,17 @@ export function tickmark(
121
128
  if (rotation === undefined) {
122
129
  return [
123
130
  tick,
124
- textSvg(text, {angle, inside, scale, textRadius, endLabelsMaxMin}),
131
+ textSvg(text, {
132
+ angle,
133
+ inside,
134
+ scale: safeScale,
135
+ textRadius,
136
+ endLabelsMaxMin,
137
+ }),
125
138
  ];
126
139
  } else {
127
140
  const newRadius =
128
- textRadius + ((4 / scale + 5) * (inside ? -1 : 1) * maxDigits) / 2;
141
+ textRadius + ((4 / safeScale + 5) * (inside ? -1 : 1) * maxDigits) / 2;
129
142
  const textX = Math.sin(rad) * newRadius;
130
143
  const textY = -Math.cos(rad) * newRadius;
131
144
  return [
@@ -690,8 +690,13 @@ export class ObcWatch extends LitElement {
690
690
  }
691
691
  }
692
692
  const scale = Math.min(clientWidth / width, clientHeight / height);
693
- if (scale === Infinity || scale < 0) {
694
- throw new Error('Watch scale is not valid');
693
+ // On first paint the element and its parent can both still be zero-sized, so
694
+ // the scale is 0 (or non-finite). That value flows into `px / scale` label
695
+ // math and yields ±Infinity coordinates the browser rejects. Fall back to a
696
+ // 1:1 scale until a real size is available; the ResizeController re-renders
697
+ // with the true scale once the element is laid out (issue #1032).
698
+ if (!Number.isFinite(scale) || scale <= 0) {
699
+ return 1;
695
700
  }
696
701
  return scale;
697
702
  }
@@ -58,7 +58,6 @@ export enum WindPropulsionPriorityElement {
58
58
  * proportionally (default 100).
59
59
  * - For a full-circle compass, use `<obc-compass>` instead.
60
60
  *
61
- * @fires None
62
61
  * @beta
63
62
  */
64
63
  @customElement('obc-wind-propulsion')
@@ -30,6 +30,13 @@ export enum AlertDetailPageType {
30
30
 
31
31
  @localized()
32
32
  /**
33
+ * @slot note-label - Label for the note section, rendered when `hasNote` is true
34
+ * @slot note - Note content, rendered when `hasNote` is true
35
+ * @slot readout-graph-title - Title for the readout graph, rendered when `hasReadoutGraph` is true
36
+ * @slot readout-graph - Readout graph content, rendered when `hasReadoutGraph` is true
37
+ * @slot action - Action controls, rendered when `hasActions` is true
38
+ * @slot <detail>-label - Overrides the label of the `<detail>` field (e.g. `tagId-label`, `category-label`, `time-label`)
39
+ * @slot <detail>-value - Overrides the value of the `<detail>` field (e.g. `tagId-value`, `category-value`, `time-value`)
33
40
  * @beta
34
41
  */
35
42
  @customElement('obc-alert-detail-page')