@oicl/openbridge-webcomponents-full-bundle 2.1.0-next.8 → 2.1.0-next.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/.storybook/preview.tsx +6 -1
- package/bundle/openbridge-webcomponents.bundle.js +25 -16
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +8 -8
- package/dist/components/menu-button/menu-button.css.js +1 -1
- package/dist/components/menu-button/menu-button.css.js.map +1 -1
- package/dist/icons/icon-log-open-google.d.ts +16 -0
- package/dist/icons/icon-log-open-google.d.ts.map +1 -0
- package/dist/icons/icon-log-open-google.js +10 -0
- package/dist/icons/icon-log-open-google.js.map +1 -0
- package/dist/icons/icon-timer-google.d.ts +16 -0
- package/dist/icons/icon-timer-google.d.ts.map +1 -0
- package/dist/icons/icon-timer-google.js +10 -0
- package/dist/icons/icon-timer-google.js.map +1 -0
- package/dist/icons/index.d.ts +2 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/icons/index.js +2 -0
- package/dist/navigation-instruments/compass/compass.js +1 -1
- package/dist/navigation-instruments/compass/compass.js.map +1 -1
- package/dist/navigation-instruments/compass-flat/compass-flat.js +1 -1
- package/dist/navigation-instruments/compass-flat/compass-flat.js.map +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.js +1 -1
- package/dist/navigation-instruments/compass-sector/compass-sector.js.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.js +2 -2
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.controller.js.map +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js +1 -1
- package/dist/navigation-instruments/rate-of-turn/rate-of-turn.js.map +1 -1
- package/dist/palettes/blinking.d.ts +5 -4
- package/dist/palettes/blinking.d.ts.map +1 -1
- package/dist/palettes/blinking.js +10 -9
- package/dist/palettes/blinking.js.map +1 -1
- package/docs/MigrationGuide.mdx +2 -0
- package/docs/MigrationGuide21.mdx +124 -0
- package/docs/migration-guide/flash-tempo.md +2 -2
- package/docs/migration-guide-2-1/automation-tokens.md +12 -0
- package/package.json +1 -1
- package/script/download-icons.ts +12 -0
- package/script/icon-aliases.test.ts +77 -0
- package/script/icon-aliases.ts +79 -0
- package/src/components/menu-button/menu-button.css +1 -1
- package/src/components/menu-button/menu-button.stories.ts +15 -1
- package/src/icons/icon-log-open-google.ts +18 -0
- package/src/icons/icon-timer-google.ts +18 -0
- package/src/icons/index.ts +2 -0
- package/src/navigation-instruments/compass/compass.ts +1 -1
- package/src/navigation-instruments/compass-flat/compass-flat.ts +1 -1
- package/src/navigation-instruments/compass-sector/compass-sector.ts +1 -1
- package/src/navigation-instruments/rate-of-turn/rate-of-turn.controller.ts +2 -2
- package/src/navigation-instruments/rate-of-turn/rate-of-turn.ts +1 -1
- package/src/navigation-instruments/rate-of-turn/rotations-per-minute.spec.ts +105 -0
- package/src/palettes/blinking.spec.ts +20 -6
- package/src/palettes/blinking.ts +10 -9
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
flashVariable,
|
|
10
10
|
installFlashing,
|
|
11
11
|
} from './blinking.js';
|
|
12
|
-
import {FlashingSpeed} from '../types.js';
|
|
12
|
+
import {FlashingSpeed, type FlashTempo} from '../types.js';
|
|
13
13
|
|
|
14
14
|
describe('installFlashing', () => {
|
|
15
15
|
const hosts: HTMLElement[] = [];
|
|
@@ -46,20 +46,32 @@ describe('installFlashing', () => {
|
|
|
46
46
|
}
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
it('follows the tempo table: on for 400 ms, off for 400
|
|
49
|
+
it('follows the tempo table: on for 400, 1200 or 2800 ms, off for 400 ms', () => {
|
|
50
50
|
expect(
|
|
51
51
|
FLASH_TEMPOS.map((tempo) => [FLASH_ON_MS[tempo], FLASH_OFF_MS[tempo]])
|
|
52
52
|
).toEqual([
|
|
53
53
|
[400, 400],
|
|
54
|
-
[
|
|
55
|
-
[
|
|
54
|
+
[1200, 400],
|
|
55
|
+
[2800, 400],
|
|
56
56
|
]);
|
|
57
57
|
});
|
|
58
58
|
|
|
59
|
-
it('nests the cycles so every tempo lights up together', () => {
|
|
59
|
+
it('nests the cycles so every tempo lights up together and goes off together', () => {
|
|
60
60
|
expect(flashPeriodMs(FlashingSpeed.Fast)).toBe(800);
|
|
61
61
|
expect(flashPeriodMs(FlashingSpeed.Slow)).toBe(1600);
|
|
62
62
|
expect(flashPeriodMs(FlashingSpeed.VerySlow)).toBe(3200);
|
|
63
|
+
const lit = (tempo: FlashTempo, time: number) =>
|
|
64
|
+
time % flashPeriodMs(tempo) < FLASH_ON_MS[tempo];
|
|
65
|
+
expect(FLASH_TEMPOS.map((tempo) => lit(tempo, 100))).toEqual([
|
|
66
|
+
true,
|
|
67
|
+
true,
|
|
68
|
+
true,
|
|
69
|
+
]);
|
|
70
|
+
expect(FLASH_TEMPOS.map((tempo) => lit(tempo, 3100))).toEqual([
|
|
71
|
+
false,
|
|
72
|
+
false,
|
|
73
|
+
false,
|
|
74
|
+
]);
|
|
63
75
|
});
|
|
64
76
|
|
|
65
77
|
it.each(FLASH_TEMPOS)(
|
|
@@ -73,10 +85,12 @@ describe('installFlashing', () => {
|
|
|
73
85
|
.getPropertyValue(flashVariable(tempo, phase))
|
|
74
86
|
.trim();
|
|
75
87
|
const period = flashPeriodMs(tempo);
|
|
88
|
+
const onTime = FLASH_ON_MS[tempo];
|
|
76
89
|
anim.pause();
|
|
77
90
|
for (const [time, lit] of [
|
|
78
91
|
[100, true],
|
|
79
|
-
[
|
|
92
|
+
[onTime - 100, true],
|
|
93
|
+
[onTime + 100, false],
|
|
80
94
|
[period - 100, false],
|
|
81
95
|
[period + 100, true],
|
|
82
96
|
] as const) {
|
package/src/palettes/blinking.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import {FlashingSpeed, type FlashTempo} from '../types.js';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* The on phase carries the tempo, so a flashing alert stays coloured for most
|
|
5
|
+
* of its cycle. The cycles (800/1600/3200 ms) nest, so every tempo lights up
|
|
6
|
+
* together at the start of the longest one and goes off with it (#1367).
|
|
7
|
+
*/
|
|
4
8
|
export const FLASH_ON_MS: Record<FlashTempo, number> = {
|
|
5
9
|
[FlashingSpeed.Fast]: 400,
|
|
6
|
-
[FlashingSpeed.Slow]:
|
|
7
|
-
[FlashingSpeed.VerySlow]:
|
|
10
|
+
[FlashingSpeed.Slow]: 1200,
|
|
11
|
+
[FlashingSpeed.VerySlow]: 2800,
|
|
8
12
|
};
|
|
9
13
|
|
|
10
|
-
/**
|
|
11
|
-
* The off phase carries the tempo. The cycles (800/1600/3200 ms) nest, so
|
|
12
|
-
* every tempo lights up together at the start of the longest one (#1224).
|
|
13
|
-
*/
|
|
14
|
+
/** Shared off phase: every tempo goes off for the last 400 ms of its cycle. */
|
|
14
15
|
export const FLASH_OFF_MS: Record<FlashTempo, number> = {
|
|
15
16
|
[FlashingSpeed.Fast]: 400,
|
|
16
|
-
[FlashingSpeed.Slow]:
|
|
17
|
-
[FlashingSpeed.VerySlow]:
|
|
17
|
+
[FlashingSpeed.Slow]: 400,
|
|
18
|
+
[FlashingSpeed.VerySlow]: 400,
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
export const FLASH_TEMPOS: readonly FlashTempo[] = [
|