@yschimke/livery-a2ui 0.0.0-stage → 0.11.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/README.md +194 -2
- package/dist/angular.d.ts +32 -0
- package/dist/angular.js +51 -0
- package/dist/api.d.ts +35 -0
- package/dist/api.js +35 -0
- package/dist/catalog.d.ts +18 -0
- package/dist/catalog.js +55 -0
- package/dist/cmp-player.d.ts +3 -0
- package/dist/cmp-player.js +125 -0
- package/dist/controller.d.ts +61 -0
- package/dist/controller.js +330 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/livery-web/livery-livery-web.d.mts +75 -0
- package/dist/livery-web/livery-livery-web.import-object.mjs +370 -0
- package/dist/livery-web/livery-livery-web.js-builtins.mjs +52 -0
- package/dist/livery-web/livery-livery-web.mjs +104 -0
- package/dist/livery-web/livery-livery-web.wasm +0 -0
- package/dist/livery-web-compose/fonts/NotoSansSymbols2-OFL.txt +117 -0
- package/dist/livery-web-compose/fonts/NotoSansSymbols2-Regular.ttf +0 -0
- package/dist/livery-web-compose/fonts/README.md +8 -0
- package/dist/livery-web-compose/fonts/RobotoFlex-OFL.txt +93 -0
- package/dist/livery-web-compose/fonts/RobotoFlex.ttf +0 -0
- package/dist/livery-web-compose/livery-livery-web-compose.d.mts +60 -0
- package/dist/livery-web-compose/livery-livery-web-compose.import-object.mjs +653 -0
- package/dist/livery-web-compose/livery-livery-web-compose.js-builtins.mjs +52 -0
- package/dist/livery-web-compose/livery-livery-web-compose.mjs +89 -0
- package/dist/livery-web-compose/livery-livery-web-compose.wasm +0 -0
- package/dist/livery-web-compose/skiko.mjs +1118 -0
- package/dist/livery-web-compose/skiko.wasm +0 -0
- package/dist/livery.d.ts +165 -0
- package/dist/livery.js +87 -0
- package/dist/player.d.ts +2 -0
- package/dist/player.js +2 -0
- package/dist/react.d.ts +24 -0
- package/dist/react.js +36 -0
- package/node_modules/@js-joda/core/CHANGELOG.md +363 -0
- package/node_modules/@js-joda/core/CheatSheet.md +947 -0
- package/node_modules/@js-joda/core/LICENSE +34 -0
- package/node_modules/@js-joda/core/README.md +155 -0
- package/node_modules/@js-joda/core/bower.json +21 -0
- package/node_modules/@js-joda/core/dist/js-joda.d.ts +2452 -0
- package/node_modules/@js-joda/core/dist/js-joda.esm.js +13564 -0
- package/node_modules/@js-joda/core/dist/js-joda.flow.js +949 -0
- package/node_modules/@js-joda/core/dist/js-joda.js +13630 -0
- package/node_modules/@js-joda/core/dist/js-joda.js.map +1 -0
- package/node_modules/@js-joda/core/dist/js-joda.min.js +5 -0
- package/node_modules/@js-joda/core/package.json +76 -0
- package/node_modules/@js-joda/core/src/Clock.js +330 -0
- package/node_modules/@js-joda/core/src/DayOfWeek.js +451 -0
- package/node_modules/@js-joda/core/src/Duration.js +1205 -0
- package/node_modules/@js-joda/core/src/Enum.js +30 -0
- package/node_modules/@js-joda/core/src/Instant.js +1012 -0
- package/node_modules/@js-joda/core/src/LocalDate.js +1703 -0
- package/node_modules/@js-joda/core/src/LocalDateTime.js +1686 -0
- package/node_modules/@js-joda/core/src/LocalTime.js +1415 -0
- package/node_modules/@js-joda/core/src/MathUtil.js +236 -0
- package/node_modules/@js-joda/core/src/Month.js +600 -0
- package/node_modules/@js-joda/core/src/MonthDay.js +730 -0
- package/node_modules/@js-joda/core/src/OffsetDateTime.js +757 -0
- package/node_modules/@js-joda/core/src/OffsetTime.js +621 -0
- package/node_modules/@js-joda/core/src/Period.js +933 -0
- package/node_modules/@js-joda/core/src/StringUtil.js +43 -0
- package/node_modules/@js-joda/core/src/Year.js +1015 -0
- package/node_modules/@js-joda/core/src/YearConstants.js +21 -0
- package/node_modules/@js-joda/core/src/YearMonth.js +1096 -0
- package/node_modules/@js-joda/core/src/ZoneId.js +236 -0
- package/node_modules/@js-joda/core/src/ZoneIdFactory.js +201 -0
- package/node_modules/@js-joda/core/src/ZoneOffset.js +486 -0
- package/node_modules/@js-joda/core/src/ZoneRegion.js +72 -0
- package/node_modules/@js-joda/core/src/ZonedDateTime.js +2007 -0
- package/node_modules/@js-joda/core/src/_init.js +68 -0
- package/node_modules/@js-joda/core/src/assert.js +33 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoLocalDate.js +230 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoLocalDateTime.js +130 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoZonedDateTime.js +194 -0
- package/node_modules/@js-joda/core/src/chrono/IsoChronology.js +235 -0
- package/node_modules/@js-joda/core/src/convert.js +83 -0
- package/node_modules/@js-joda/core/src/errors.js +54 -0
- package/node_modules/@js-joda/core/src/format/DateTimeBuilder.js +535 -0
- package/node_modules/@js-joda/core/src/format/DateTimeFormatter.js +728 -0
- package/node_modules/@js-joda/core/src/format/DateTimeFormatterBuilder.js +1545 -0
- package/node_modules/@js-joda/core/src/format/DateTimeParseContext.js +297 -0
- package/node_modules/@js-joda/core/src/format/DateTimePrintContext.js +138 -0
- package/node_modules/@js-joda/core/src/format/DecimalStyle.js +113 -0
- package/node_modules/@js-joda/core/src/format/EnumMap.js +70 -0
- package/node_modules/@js-joda/core/src/format/ParsePosition.js +31 -0
- package/node_modules/@js-joda/core/src/format/ResolverStyle.js +93 -0
- package/node_modules/@js-joda/core/src/format/SignStyle.js +38 -0
- package/node_modules/@js-joda/core/src/format/StringBuilder.js +47 -0
- package/node_modules/@js-joda/core/src/format/TextStyle.js +114 -0
- package/node_modules/@js-joda/core/src/format/parser/CharLiteralPrinterParser.js +46 -0
- package/node_modules/@js-joda/core/src/format/parser/CompositePrinterParser.js +89 -0
- package/node_modules/@js-joda/core/src/format/parser/FractionPrinterParser.js +162 -0
- package/node_modules/@js-joda/core/src/format/parser/NumberPrinterParser.js +367 -0
- package/node_modules/@js-joda/core/src/format/parser/OffsetIdPrinterParser.js +177 -0
- package/node_modules/@js-joda/core/src/format/parser/PadPrinterParserDecorator.js +81 -0
- package/node_modules/@js-joda/core/src/format/parser/SettingsParser.js +44 -0
- package/node_modules/@js-joda/core/src/format/parser/StringLiteralPrinterParser.js +39 -0
- package/node_modules/@js-joda/core/src/format/parser/ZoneIdPrinterParser.js +218 -0
- package/node_modules/@js-joda/core/src/js-joda.js +210 -0
- package/node_modules/@js-joda/core/src/license-preamble.js +3 -0
- package/node_modules/@js-joda/core/src/temporal/ChronoField.js +470 -0
- package/node_modules/@js-joda/core/src/temporal/ChronoUnit.js +310 -0
- package/node_modules/@js-joda/core/src/temporal/DefaultInterfaceTemporal.js +118 -0
- package/node_modules/@js-joda/core/src/temporal/IsoFields.js +859 -0
- package/node_modules/@js-joda/core/src/temporal/NativeJsTemporal.js +105 -0
- package/node_modules/@js-joda/core/src/temporal/Temporal.js +346 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAccessor.js +125 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAdjuster.js +92 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAdjusters.js +464 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAmount.js +166 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalField.js +248 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQueries.js +223 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQueriesFactory.js +77 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQuery.js +107 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalUnit.js +179 -0
- package/node_modules/@js-joda/core/src/temporal/ValueRange.js +257 -0
- package/node_modules/@js-joda/core/src/use.js +20 -0
- package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneId.js +31 -0
- package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneRules.js +162 -0
- package/node_modules/@js-joda/core/src/zone/ZoneOffsetTransition.js +289 -0
- package/node_modules/@js-joda/core/src/zone/ZoneRules.js +464 -0
- package/node_modules/@js-joda/core/src/zone/ZoneRulesProvider.js +36 -0
- package/node_modules/@yschimke/livery-web/README.md +112 -0
- package/node_modules/@yschimke/livery-web/dist/descriptor.d.ts +24 -0
- package/node_modules/@yschimke/livery-web/dist/descriptor.js +32 -0
- package/node_modules/@yschimke/livery-web/dist/index.d.ts +9 -0
- package/node_modules/@yschimke/livery-web/dist/index.js +5 -0
- package/node_modules/@yschimke/livery-web/dist/livery-web/livery-livery-web-core.d.mts +63 -0
- package/node_modules/@yschimke/livery-web/dist/livery-web/livery-livery-web-core.import-object.mjs +333 -0
- package/node_modules/@yschimke/livery-web/dist/livery-web/livery-livery-web-core.js-builtins.mjs +52 -0
- package/node_modules/@yschimke/livery-web/dist/livery-web/livery-livery-web-core.mjs +92 -0
- package/node_modules/@yschimke/livery-web/dist/livery-web/livery-livery-web-core.wasm +0 -0
- package/node_modules/@yschimke/livery-web/dist/player.d.ts +65 -0
- package/node_modules/@yschimke/livery-web/dist/player.js +117 -0
- package/node_modules/@yschimke/livery-web/dist/preview.d.ts +57 -0
- package/node_modules/@yschimke/livery-web/dist/preview.js +214 -0
- package/node_modules/@yschimke/livery-web/dist/publication.d.ts +7 -0
- package/node_modules/@yschimke/livery-web/dist/publication.js +103 -0
- package/node_modules/@yschimke/livery-web/dist/session.d.ts +71 -0
- package/node_modules/@yschimke/livery-web/dist/session.js +55 -0
- package/node_modules/@yschimke/livery-web/dist/viewer.d.ts +1 -0
- package/node_modules/@yschimke/livery-web/dist/viewer.js +18 -0
- package/node_modules/@yschimke/livery-web/package.json +39 -0
- package/node_modules/@yschimke/livery-web/vendor/PROVENANCE.md +18 -0
- package/node_modules/@yschimke/livery-web/vendor/remote-compose-player.d.mts +30 -0
- package/node_modules/@yschimke/livery-web/vendor/remote-compose-player.mjs +86 -0
- package/package.json +102 -4
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
5
|
+
*/
|
|
6
|
+
import {ArithmeticException} from './errors';
|
|
7
|
+
|
|
8
|
+
export const MAX_SAFE_INTEGER = 9007199254740991;
|
|
9
|
+
export const MIN_SAFE_INTEGER = -9007199254740991;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Math helper with static function for integer operations
|
|
13
|
+
*/
|
|
14
|
+
export class MathUtil {
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* @param {number} x
|
|
18
|
+
* @param {number} y
|
|
19
|
+
* @returns {number}
|
|
20
|
+
*/
|
|
21
|
+
static intDiv(x, y) {
|
|
22
|
+
let r = x/y;
|
|
23
|
+
r = MathUtil.roundDown(r);
|
|
24
|
+
return MathUtil.safeZero(r);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
* @param {number} x
|
|
30
|
+
* @param {number} y
|
|
31
|
+
* @returns {number}
|
|
32
|
+
*/
|
|
33
|
+
static intMod(x, y) {
|
|
34
|
+
let r = x - MathUtil.intDiv(x, y) * y;
|
|
35
|
+
r = MathUtil.roundDown(r);
|
|
36
|
+
return MathUtil.safeZero(r);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @param {number} r
|
|
42
|
+
* @returns {number}
|
|
43
|
+
*/
|
|
44
|
+
static roundDown(r){
|
|
45
|
+
if (r < 0) {
|
|
46
|
+
return Math.ceil(r);
|
|
47
|
+
} else {
|
|
48
|
+
return Math.floor(r);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param {number} x
|
|
55
|
+
* @param {number} y
|
|
56
|
+
* @returns {number}
|
|
57
|
+
*/
|
|
58
|
+
static floorDiv(x, y){
|
|
59
|
+
const r = Math.floor(x / y);
|
|
60
|
+
return MathUtil.safeZero(r);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {number} x
|
|
66
|
+
* @param {number} y
|
|
67
|
+
* @returns {number}
|
|
68
|
+
*/
|
|
69
|
+
static floorMod(x, y){
|
|
70
|
+
const r = x - MathUtil.floorDiv(x, y) * y;
|
|
71
|
+
return MathUtil.safeZero(r);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
*
|
|
76
|
+
* @param {number} x
|
|
77
|
+
* @param {number} y
|
|
78
|
+
* @returns {number}
|
|
79
|
+
*/
|
|
80
|
+
static safeAdd(x, y) {
|
|
81
|
+
MathUtil.verifyInt(x);
|
|
82
|
+
MathUtil.verifyInt(y);
|
|
83
|
+
if (x === 0) {
|
|
84
|
+
return MathUtil.safeZero(y);
|
|
85
|
+
}
|
|
86
|
+
if (y === 0) {
|
|
87
|
+
return MathUtil.safeZero(x);
|
|
88
|
+
}
|
|
89
|
+
const r = MathUtil.safeToInt(x + y);
|
|
90
|
+
if (r === x || r === y) {
|
|
91
|
+
throw new ArithmeticException('Invalid addition beyond MAX_SAFE_INTEGER!');
|
|
92
|
+
}
|
|
93
|
+
return r;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @param {number} x
|
|
99
|
+
* @param {number} y
|
|
100
|
+
* @returns {number}
|
|
101
|
+
*/
|
|
102
|
+
static safeSubtract(x, y) {
|
|
103
|
+
MathUtil.verifyInt(x);
|
|
104
|
+
MathUtil.verifyInt(y);
|
|
105
|
+
if (x === 0 && y === 0) {
|
|
106
|
+
return 0;
|
|
107
|
+
} else if (x === 0) {
|
|
108
|
+
return MathUtil.safeZero(-1 * y);
|
|
109
|
+
} else if (y === 0) {
|
|
110
|
+
return MathUtil.safeZero(x);
|
|
111
|
+
}
|
|
112
|
+
return MathUtil.safeToInt(x - y);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
*
|
|
117
|
+
* @param {number} x
|
|
118
|
+
* @param {number} y
|
|
119
|
+
* @returns {number}
|
|
120
|
+
*/
|
|
121
|
+
static safeMultiply(x, y) {
|
|
122
|
+
MathUtil.verifyInt(x);
|
|
123
|
+
MathUtil.verifyInt(y);
|
|
124
|
+
if (x === 1) {
|
|
125
|
+
return MathUtil.safeZero(y);
|
|
126
|
+
}
|
|
127
|
+
if (y === 1) {
|
|
128
|
+
return MathUtil.safeZero(x);
|
|
129
|
+
}
|
|
130
|
+
if (x === 0 || y === 0) {
|
|
131
|
+
return 0;
|
|
132
|
+
}
|
|
133
|
+
const r = MathUtil.safeToInt(x * y);
|
|
134
|
+
if (r / y !== x || (x === MIN_SAFE_INTEGER && y === -1) || (y === MIN_SAFE_INTEGER && x === -1)) {
|
|
135
|
+
throw new ArithmeticException('Multiplication overflows: ' + x + ' * ' + y);
|
|
136
|
+
}
|
|
137
|
+
return r;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
*
|
|
142
|
+
* @param {number} value
|
|
143
|
+
* @returns {number}
|
|
144
|
+
*/
|
|
145
|
+
static parseInt(value) {
|
|
146
|
+
const r = parseInt(value);
|
|
147
|
+
return MathUtil.safeToInt(r);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
* @param {number} value
|
|
153
|
+
* @returns {number}
|
|
154
|
+
*/
|
|
155
|
+
static safeToInt(value) {
|
|
156
|
+
MathUtil.verifyInt(value);
|
|
157
|
+
return MathUtil.safeZero(value);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
*
|
|
162
|
+
* @param {number} value
|
|
163
|
+
*/
|
|
164
|
+
static verifyInt(value){
|
|
165
|
+
if (value == null) {
|
|
166
|
+
throw new ArithmeticException(`Invalid value: '${value}', using null or undefined as argument`);
|
|
167
|
+
}
|
|
168
|
+
if (isNaN(value)) {
|
|
169
|
+
throw new ArithmeticException('Invalid int value, using NaN as argument');
|
|
170
|
+
}
|
|
171
|
+
if ((value % 1) !== 0) {
|
|
172
|
+
throw new ArithmeticException(`Invalid value: '${value}' is a float`);
|
|
173
|
+
}
|
|
174
|
+
if (value > MAX_SAFE_INTEGER || value < MIN_SAFE_INTEGER) {
|
|
175
|
+
throw new ArithmeticException('Calculation overflows an int: ' + value);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* convert -0 to 0 and int as string to a number ( '1' -> 1 )
|
|
181
|
+
*
|
|
182
|
+
* @param {number} value
|
|
183
|
+
* @returns {number}
|
|
184
|
+
*/
|
|
185
|
+
static safeZero(value){
|
|
186
|
+
return value === 0 ? 0 : +value;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Compares two Numbers.
|
|
191
|
+
*
|
|
192
|
+
* @param {number} a the first value
|
|
193
|
+
* @param {number} b the second value
|
|
194
|
+
* @return {number} the result
|
|
195
|
+
*/
|
|
196
|
+
static compareNumbers(a, b) {
|
|
197
|
+
if (a < b) {
|
|
198
|
+
return -1;
|
|
199
|
+
}
|
|
200
|
+
if (a > b) {
|
|
201
|
+
return 1;
|
|
202
|
+
}
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// convert to small integer for v8 optimisation
|
|
207
|
+
static smi(int) {
|
|
208
|
+
return ((int >>> 1) & 0x40000000) | (int & 0xBFFFFFFF);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// calculate 32 bit hash of a number and convert to SMI
|
|
212
|
+
static hash(number) {
|
|
213
|
+
if (number !== number || number === Infinity) {
|
|
214
|
+
return 0;
|
|
215
|
+
}
|
|
216
|
+
let result = number;
|
|
217
|
+
while (number > 0xFFFFFFFF) {
|
|
218
|
+
number /= 0xFFFFFFFF;
|
|
219
|
+
result ^= number;
|
|
220
|
+
}
|
|
221
|
+
return MathUtil.smi(result);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// default hashCode calculation for a number sequence as mentioned by Joshua Bloch
|
|
225
|
+
static hashCode(...numbers) {
|
|
226
|
+
let result = 17;
|
|
227
|
+
for (const n of numbers) {
|
|
228
|
+
result = (result << 5) - result + MathUtil.hash(n);
|
|
229
|
+
}
|
|
230
|
+
return MathUtil.hash(result);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
MathUtil.MAX_SAFE_INTEGER = MAX_SAFE_INTEGER;
|
|
235
|
+
MathUtil.MIN_SAFE_INTEGER = MIN_SAFE_INTEGER;
|
|
236
|
+
|