@angular/animations 20.0.0-next.4 → 20.0.0-next.6

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.
@@ -1,490 +1,13 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.4
2
+ * @license Angular v20.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- import { ɵAnimationGroupPlayer as _AnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE as _PRE_STYLE, AnimationMetadataType, sequence, style } from '@angular/animations';
8
7
  import * as i0 from '@angular/core';
9
- import { ɵRuntimeError as _RuntimeError, Injectable } from '@angular/core';
10
-
11
- const LINE_START = '\n - ';
12
- function invalidTimingValue(exp) {
13
- return new _RuntimeError(3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value "${exp}" is invalid.`);
14
- }
15
- function negativeStepValue() {
16
- return new _RuntimeError(3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.');
17
- }
18
- function negativeDelayValue() {
19
- return new _RuntimeError(3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.');
20
- }
21
- function invalidStyleParams(varName) {
22
- return new _RuntimeError(3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode &&
23
- `Unable to resolve the local animation param ${varName} in the given list of values`);
24
- }
25
- function invalidParamValue(varName) {
26
- return new _RuntimeError(3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`);
27
- }
28
- function invalidNodeType(nodeType) {
29
- return new _RuntimeError(3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);
30
- }
31
- function invalidCssUnitValue(userProvidedProperty, value) {
32
- return new _RuntimeError(3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
33
- }
34
- function invalidTrigger() {
35
- return new _RuntimeError(3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode &&
36
- "animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))");
37
- }
38
- function invalidDefinition() {
39
- return new _RuntimeError(3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()');
40
- }
41
- function invalidState(metadataName, missingSubs) {
42
- return new _RuntimeError(3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode &&
43
- `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);
44
- }
45
- function invalidStyleValue(value) {
46
- return new _RuntimeError(3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`);
47
- }
48
- function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
49
- return new _RuntimeError(3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode &&
50
- `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
51
- }
52
- function invalidKeyframes() {
53
- return new _RuntimeError(3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`);
54
- }
55
- function invalidOffset() {
56
- return new _RuntimeError(3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);
57
- }
58
- function keyframeOffsetsOutOfOrder() {
59
- return new _RuntimeError(3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`);
60
- }
61
- function keyframesMissingOffsets() {
62
- return new _RuntimeError(3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);
63
- }
64
- function invalidStagger() {
65
- return new _RuntimeError(3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`);
66
- }
67
- function invalidQuery(selector) {
68
- return new _RuntimeError(3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode &&
69
- `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
70
- }
71
- function invalidExpression(expr) {
72
- return new _RuntimeError(3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression "${expr}" is not supported`);
73
- }
74
- function invalidTransitionAlias(alias) {
75
- return new _RuntimeError(3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value "${alias}" is not supported`);
76
- }
77
- function validationFailed(errors) {
78
- return new _RuntimeError(3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\n${errors.map((err) => err.message).join('\n')}`);
79
- }
80
- function buildingFailed(errors) {
81
- return new _RuntimeError(3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\n${errors.map((err) => err.message).join('\n')}`);
82
- }
83
- function triggerBuildFailed(name, errors) {
84
- return new _RuntimeError(3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode &&
85
- `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors
86
- .map((err) => err.message)
87
- .join('\n - ')}`);
88
- }
89
- function animationFailed(errors) {
90
- return new _RuntimeError(3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode &&
91
- `Unable to animate due to the following errors:${LINE_START}${errors
92
- .map((err) => err.message)
93
- .join(LINE_START)}`);
94
- }
95
- function registerFailed(errors) {
96
- return new _RuntimeError(3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode &&
97
- `Unable to build the animation due to the following errors: ${errors
98
- .map((err) => err.message)
99
- .join('\n')}`);
100
- }
101
- function missingOrDestroyedAnimation() {
102
- return new _RuntimeError(3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && "The requested animation doesn't exist or has already been destroyed");
103
- }
104
- function createAnimationFailed(errors) {
105
- return new _RuntimeError(3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode &&
106
- `Unable to create the animation due to the following errors:${errors
107
- .map((err) => err.message)
108
- .join('\n')}`);
109
- }
110
- function missingPlayer(id) {
111
- return new _RuntimeError(3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`);
112
- }
113
- function missingTrigger(phase, name) {
114
- return new _RuntimeError(3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode &&
115
- `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
116
- }
117
- function missingEvent(name) {
118
- return new _RuntimeError(3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode &&
119
- `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
120
- }
121
- function unsupportedTriggerEvent(phase, name) {
122
- return new _RuntimeError(3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode &&
123
- `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
124
- }
125
- function unregisteredTrigger(name) {
126
- return new _RuntimeError(3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger "${name}" has not been registered!`);
127
- }
128
- function triggerTransitionsFailed(errors) {
129
- return new _RuntimeError(3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode &&
130
- `Unable to process animations due to the following failed trigger transitions\n ${errors
131
- .map((err) => err.message)
132
- .join('\n')}`);
133
- }
134
- function transitionFailed(name, errors) {
135
- return new _RuntimeError(3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\n ${errors.map((err) => err.message).join('\n- ')}`);
136
- }
137
-
138
- /**
139
- * Set of all animatable CSS properties
140
- *
141
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
142
- */
143
- const ANIMATABLE_PROP_SET = new Set([
144
- '-moz-outline-radius',
145
- '-moz-outline-radius-bottomleft',
146
- '-moz-outline-radius-bottomright',
147
- '-moz-outline-radius-topleft',
148
- '-moz-outline-radius-topright',
149
- '-ms-grid-columns',
150
- '-ms-grid-rows',
151
- '-webkit-line-clamp',
152
- '-webkit-text-fill-color',
153
- '-webkit-text-stroke',
154
- '-webkit-text-stroke-color',
155
- 'accent-color',
156
- 'all',
157
- 'backdrop-filter',
158
- 'background',
159
- 'background-color',
160
- 'background-position',
161
- 'background-size',
162
- 'block-size',
163
- 'border',
164
- 'border-block-end',
165
- 'border-block-end-color',
166
- 'border-block-end-width',
167
- 'border-block-start',
168
- 'border-block-start-color',
169
- 'border-block-start-width',
170
- 'border-bottom',
171
- 'border-bottom-color',
172
- 'border-bottom-left-radius',
173
- 'border-bottom-right-radius',
174
- 'border-bottom-width',
175
- 'border-color',
176
- 'border-end-end-radius',
177
- 'border-end-start-radius',
178
- 'border-image-outset',
179
- 'border-image-slice',
180
- 'border-image-width',
181
- 'border-inline-end',
182
- 'border-inline-end-color',
183
- 'border-inline-end-width',
184
- 'border-inline-start',
185
- 'border-inline-start-color',
186
- 'border-inline-start-width',
187
- 'border-left',
188
- 'border-left-color',
189
- 'border-left-width',
190
- 'border-radius',
191
- 'border-right',
192
- 'border-right-color',
193
- 'border-right-width',
194
- 'border-start-end-radius',
195
- 'border-start-start-radius',
196
- 'border-top',
197
- 'border-top-color',
198
- 'border-top-left-radius',
199
- 'border-top-right-radius',
200
- 'border-top-width',
201
- 'border-width',
202
- 'bottom',
203
- 'box-shadow',
204
- 'caret-color',
205
- 'clip',
206
- 'clip-path',
207
- 'color',
208
- 'column-count',
209
- 'column-gap',
210
- 'column-rule',
211
- 'column-rule-color',
212
- 'column-rule-width',
213
- 'column-width',
214
- 'columns',
215
- 'filter',
216
- 'flex',
217
- 'flex-basis',
218
- 'flex-grow',
219
- 'flex-shrink',
220
- 'font',
221
- 'font-size',
222
- 'font-size-adjust',
223
- 'font-stretch',
224
- 'font-variation-settings',
225
- 'font-weight',
226
- 'gap',
227
- 'grid-column-gap',
228
- 'grid-gap',
229
- 'grid-row-gap',
230
- 'grid-template-columns',
231
- 'grid-template-rows',
232
- 'height',
233
- 'inline-size',
234
- 'input-security',
235
- 'inset',
236
- 'inset-block',
237
- 'inset-block-end',
238
- 'inset-block-start',
239
- 'inset-inline',
240
- 'inset-inline-end',
241
- 'inset-inline-start',
242
- 'left',
243
- 'letter-spacing',
244
- 'line-clamp',
245
- 'line-height',
246
- 'margin',
247
- 'margin-block-end',
248
- 'margin-block-start',
249
- 'margin-bottom',
250
- 'margin-inline-end',
251
- 'margin-inline-start',
252
- 'margin-left',
253
- 'margin-right',
254
- 'margin-top',
255
- 'mask',
256
- 'mask-border',
257
- 'mask-position',
258
- 'mask-size',
259
- 'max-block-size',
260
- 'max-height',
261
- 'max-inline-size',
262
- 'max-lines',
263
- 'max-width',
264
- 'min-block-size',
265
- 'min-height',
266
- 'min-inline-size',
267
- 'min-width',
268
- 'object-position',
269
- 'offset',
270
- 'offset-anchor',
271
- 'offset-distance',
272
- 'offset-path',
273
- 'offset-position',
274
- 'offset-rotate',
275
- 'opacity',
276
- 'order',
277
- 'outline',
278
- 'outline-color',
279
- 'outline-offset',
280
- 'outline-width',
281
- 'padding',
282
- 'padding-block-end',
283
- 'padding-block-start',
284
- 'padding-bottom',
285
- 'padding-inline-end',
286
- 'padding-inline-start',
287
- 'padding-left',
288
- 'padding-right',
289
- 'padding-top',
290
- 'perspective',
291
- 'perspective-origin',
292
- 'right',
293
- 'rotate',
294
- 'row-gap',
295
- 'scale',
296
- 'scroll-margin',
297
- 'scroll-margin-block',
298
- 'scroll-margin-block-end',
299
- 'scroll-margin-block-start',
300
- 'scroll-margin-bottom',
301
- 'scroll-margin-inline',
302
- 'scroll-margin-inline-end',
303
- 'scroll-margin-inline-start',
304
- 'scroll-margin-left',
305
- 'scroll-margin-right',
306
- 'scroll-margin-top',
307
- 'scroll-padding',
308
- 'scroll-padding-block',
309
- 'scroll-padding-block-end',
310
- 'scroll-padding-block-start',
311
- 'scroll-padding-bottom',
312
- 'scroll-padding-inline',
313
- 'scroll-padding-inline-end',
314
- 'scroll-padding-inline-start',
315
- 'scroll-padding-left',
316
- 'scroll-padding-right',
317
- 'scroll-padding-top',
318
- 'scroll-snap-coordinate',
319
- 'scroll-snap-destination',
320
- 'scrollbar-color',
321
- 'shape-image-threshold',
322
- 'shape-margin',
323
- 'shape-outside',
324
- 'tab-size',
325
- 'text-decoration',
326
- 'text-decoration-color',
327
- 'text-decoration-thickness',
328
- 'text-emphasis',
329
- 'text-emphasis-color',
330
- 'text-indent',
331
- 'text-shadow',
332
- 'text-underline-offset',
333
- 'top',
334
- 'transform',
335
- 'transform-origin',
336
- 'translate',
337
- 'vertical-align',
338
- 'visibility',
339
- 'width',
340
- 'word-spacing',
341
- 'z-index',
342
- 'zoom',
343
- ]);
344
-
345
- function optimizeGroupPlayer(players) {
346
- switch (players.length) {
347
- case 0:
348
- return new NoopAnimationPlayer();
349
- case 1:
350
- return players[0];
351
- default:
352
- return new _AnimationGroupPlayer(players);
353
- }
354
- }
355
- function normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) {
356
- const errors = [];
357
- const normalizedKeyframes = [];
358
- let previousOffset = -1;
359
- let previousKeyframe = null;
360
- keyframes.forEach((kf) => {
361
- const offset = kf.get('offset');
362
- const isSameOffset = offset == previousOffset;
363
- const normalizedKeyframe = (isSameOffset && previousKeyframe) || new Map();
364
- kf.forEach((val, prop) => {
365
- let normalizedProp = prop;
366
- let normalizedValue = val;
367
- if (prop !== 'offset') {
368
- normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);
369
- switch (normalizedValue) {
370
- case _PRE_STYLE:
371
- normalizedValue = preStyles.get(prop);
372
- break;
373
- case AUTO_STYLE:
374
- normalizedValue = postStyles.get(prop);
375
- break;
376
- default:
377
- normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);
378
- break;
379
- }
380
- }
381
- normalizedKeyframe.set(normalizedProp, normalizedValue);
382
- });
383
- if (!isSameOffset) {
384
- normalizedKeyframes.push(normalizedKeyframe);
385
- }
386
- previousKeyframe = normalizedKeyframe;
387
- previousOffset = offset;
388
- });
389
- if (errors.length) {
390
- throw animationFailed(errors);
391
- }
392
- return normalizedKeyframes;
393
- }
394
- function listenOnPlayer(player, eventName, event, callback) {
395
- switch (eventName) {
396
- case 'start':
397
- player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));
398
- break;
399
- case 'done':
400
- player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));
401
- break;
402
- case 'destroy':
403
- player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));
404
- break;
405
- }
406
- }
407
- function copyAnimationEvent(e, phaseName, player) {
408
- const totalTime = player.totalTime;
409
- const disabled = player.disabled ? true : false;
410
- const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled);
411
- const data = e['_data'];
412
- if (data != null) {
413
- event['_data'] = data;
414
- }
415
- return event;
416
- }
417
- function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) {
418
- return { element, triggerName, fromState, toState, phaseName, totalTime, disabled: !!disabled };
419
- }
420
- function getOrSetDefaultValue(map, key, defaultValue) {
421
- let value = map.get(key);
422
- if (!value) {
423
- map.set(key, (value = defaultValue));
424
- }
425
- return value;
426
- }
427
- function parseTimelineCommand(command) {
428
- const separatorPos = command.indexOf(':');
429
- const id = command.substring(1, separatorPos);
430
- const action = command.slice(separatorPos + 1);
431
- return [id, action];
432
- }
433
- const documentElement = /* @__PURE__ */ (() => typeof document === 'undefined' ? null : document.documentElement)();
434
- function getParentElement(element) {
435
- const parent = element.parentNode || element.host || null; // consider host to support shadow DOM
436
- if (parent === documentElement) {
437
- return null;
438
- }
439
- return parent;
440
- }
441
- function containsVendorPrefix(prop) {
442
- // Webkit is the only real popular vendor prefix nowadays
443
- // cc: http://shouldiprefix.com/
444
- return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
445
- }
446
- let _CACHED_BODY = null;
447
- let _IS_WEBKIT = false;
448
- function validateStyleProperty(prop) {
449
- if (!_CACHED_BODY) {
450
- _CACHED_BODY = getBodyNode() || {};
451
- _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false;
452
- }
453
- let result = true;
454
- if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
455
- result = prop in _CACHED_BODY.style;
456
- if (!result && _IS_WEBKIT) {
457
- const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);
458
- result = camelProp in _CACHED_BODY.style;
459
- }
460
- }
461
- return result;
462
- }
463
- function validateWebAnimatableStyleProperty(prop) {
464
- return ANIMATABLE_PROP_SET.has(prop);
465
- }
466
- function getBodyNode() {
467
- if (typeof document != 'undefined') {
468
- return document.body;
469
- }
470
- return null;
471
- }
472
- function containsElement(elm1, elm2) {
473
- while (elm2) {
474
- if (elm2 === elm1) {
475
- return true;
476
- }
477
- elm2 = getParentElement(elm2);
478
- }
479
- return false;
480
- }
481
- function invokeQuery(element, selector, multi) {
482
- if (multi) {
483
- return Array.from(element.querySelectorAll(selector));
484
- }
485
- const elem = element.querySelector(selector);
486
- return elem ? [elem] : [];
487
- }
8
+ import { Injectable } from '@angular/core';
9
+ import { validateStyleProperty, containsElement, getParentElement, invokeQuery, dashCaseToCamelCase, invalidCssUnitValue, invalidExpression, invalidTransitionAlias, visitDslNode, invalidTrigger, invalidDefinition, extractStyleParams, invalidState, invalidStyleValue, SUBSTITUTION_EXPR_START, invalidParallelAnimation, validateStyleParams, invalidKeyframes, invalidOffset, keyframeOffsetsOutOfOrder, keyframesMissingOffsets, getOrSetDefaultValue, invalidStagger, resolveTiming, normalizeAnimationEntry, NG_TRIGGER_SELECTOR, NG_ANIMATING_SELECTOR, resolveTimingValue, interpolateParams, invalidQuery, registerFailed, normalizeKeyframes, LEAVE_CLASSNAME, ENTER_CLASSNAME, missingOrDestroyedAnimation, createAnimationFailed, optimizeGroupPlayer, missingPlayer, listenOnPlayer, makeAnimationEvent, triggerTransitionsFailed, eraseStyles, setStyles, transitionFailed, missingTrigger, missingEvent, unsupportedTriggerEvent, unregisteredTrigger, NG_TRIGGER_CLASSNAME, NG_ANIMATING_CLASSNAME, triggerBuildFailed, parseTimelineCommand, computeStyle, camelCaseToDashCase, validateWebAnimatableStyleProperty, allowPreviousPlayerStylesMerge, normalizeKeyframes$1, balancePreviousStylesIntoKeyframes, validationFailed, normalizeStyles, buildingFailed } from './util-DN3Vao_r.mjs';
10
+ import { NoopAnimationPlayer, AnimationMetadataType, style, AUTO_STYLE, ɵPRE_STYLE as _PRE_STYLE, AnimationGroupPlayer } from './private_export-CacKMzxJ.mjs';
488
11
 
489
12
  /**
490
13
  * @publicApi
@@ -530,10 +53,10 @@ class NoopAnimationDriver {
530
53
  animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
531
54
  return new NoopAnimationPlayer(duration, delay);
532
55
  }
533
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
534
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: NoopAnimationDriver });
56
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
57
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: NoopAnimationDriver });
535
58
  }
536
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.4", ngImport: i0, type: NoopAnimationDriver, decorators: [{
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.0-next.6", ngImport: i0, type: NoopAnimationDriver, decorators: [{
537
60
  type: Injectable
538
61
  }] });
539
62
  /**
@@ -557,214 +80,6 @@ class NoopAnimationStyleNormalizer {
557
80
  }
558
81
  }
559
82
 
560
- const ONE_SECOND = 1000;
561
- const SUBSTITUTION_EXPR_START = '{{';
562
- const SUBSTITUTION_EXPR_END = '}}';
563
- const ENTER_CLASSNAME = 'ng-enter';
564
- const LEAVE_CLASSNAME = 'ng-leave';
565
- const NG_TRIGGER_CLASSNAME = 'ng-trigger';
566
- const NG_TRIGGER_SELECTOR = '.ng-trigger';
567
- const NG_ANIMATING_CLASSNAME = 'ng-animating';
568
- const NG_ANIMATING_SELECTOR = '.ng-animating';
569
- function resolveTimingValue(value) {
570
- if (typeof value == 'number')
571
- return value;
572
- const matches = value.match(/^(-?[\.\d]+)(m?s)/);
573
- if (!matches || matches.length < 2)
574
- return 0;
575
- return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
576
- }
577
- function _convertTimeValueToMS(value, unit) {
578
- switch (unit) {
579
- case 's':
580
- return value * ONE_SECOND;
581
- default: // ms or something else
582
- return value;
583
- }
584
- }
585
- function resolveTiming(timings, errors, allowNegativeValues) {
586
- return timings.hasOwnProperty('duration')
587
- ? timings
588
- : parseTimeExpression(timings, errors, allowNegativeValues);
589
- }
590
- function parseTimeExpression(exp, errors, allowNegativeValues) {
591
- const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
592
- let duration;
593
- let delay = 0;
594
- let easing = '';
595
- if (typeof exp === 'string') {
596
- const matches = exp.match(regex);
597
- if (matches === null) {
598
- errors.push(invalidTimingValue(exp));
599
- return { duration: 0, delay: 0, easing: '' };
600
- }
601
- duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
602
- const delayMatch = matches[3];
603
- if (delayMatch != null) {
604
- delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
605
- }
606
- const easingVal = matches[5];
607
- if (easingVal) {
608
- easing = easingVal;
609
- }
610
- }
611
- else {
612
- duration = exp;
613
- }
614
- if (!allowNegativeValues) {
615
- let containsErrors = false;
616
- let startIndex = errors.length;
617
- if (duration < 0) {
618
- errors.push(negativeStepValue());
619
- containsErrors = true;
620
- }
621
- if (delay < 0) {
622
- errors.push(negativeDelayValue());
623
- containsErrors = true;
624
- }
625
- if (containsErrors) {
626
- errors.splice(startIndex, 0, invalidTimingValue(exp));
627
- }
628
- }
629
- return { duration, delay, easing };
630
- }
631
- function normalizeKeyframes(keyframes) {
632
- if (!keyframes.length) {
633
- return [];
634
- }
635
- if (keyframes[0] instanceof Map) {
636
- return keyframes;
637
- }
638
- return keyframes.map((kf) => new Map(Object.entries(kf)));
639
- }
640
- function normalizeStyles(styles) {
641
- return Array.isArray(styles) ? new Map(...styles) : new Map(styles);
642
- }
643
- function setStyles(element, styles, formerStyles) {
644
- styles.forEach((val, prop) => {
645
- const camelProp = dashCaseToCamelCase(prop);
646
- if (formerStyles && !formerStyles.has(prop)) {
647
- formerStyles.set(prop, element.style[camelProp]);
648
- }
649
- element.style[camelProp] = val;
650
- });
651
- }
652
- function eraseStyles(element, styles) {
653
- styles.forEach((_, prop) => {
654
- const camelProp = dashCaseToCamelCase(prop);
655
- element.style[camelProp] = '';
656
- });
657
- }
658
- function normalizeAnimationEntry(steps) {
659
- if (Array.isArray(steps)) {
660
- if (steps.length == 1)
661
- return steps[0];
662
- return sequence(steps);
663
- }
664
- return steps;
665
- }
666
- function validateStyleParams(value, options, errors) {
667
- const params = options.params || {};
668
- const matches = extractStyleParams(value);
669
- if (matches.length) {
670
- matches.forEach((varName) => {
671
- if (!params.hasOwnProperty(varName)) {
672
- errors.push(invalidStyleParams(varName));
673
- }
674
- });
675
- }
676
- }
677
- const PARAM_REGEX = /* @__PURE__ */ new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, 'g');
678
- function extractStyleParams(value) {
679
- let params = [];
680
- if (typeof value === 'string') {
681
- let match;
682
- while ((match = PARAM_REGEX.exec(value))) {
683
- params.push(match[1]);
684
- }
685
- PARAM_REGEX.lastIndex = 0;
686
- }
687
- return params;
688
- }
689
- function interpolateParams(value, params, errors) {
690
- const original = `${value}`;
691
- const str = original.replace(PARAM_REGEX, (_, varName) => {
692
- let localVal = params[varName];
693
- // this means that the value was never overridden by the data passed in by the user
694
- if (localVal == null) {
695
- errors.push(invalidParamValue(varName));
696
- localVal = '';
697
- }
698
- return localVal.toString();
699
- });
700
- // we do this to assert that numeric values stay as they are
701
- return str == original ? value : str;
702
- }
703
- const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
704
- function dashCaseToCamelCase(input) {
705
- return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
706
- }
707
- function camelCaseToDashCase(input) {
708
- return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
709
- }
710
- function allowPreviousPlayerStylesMerge(duration, delay) {
711
- return duration === 0 || delay === 0;
712
- }
713
- function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
714
- if (previousStyles.size && keyframes.length) {
715
- let startingKeyframe = keyframes[0];
716
- let missingStyleProps = [];
717
- previousStyles.forEach((val, prop) => {
718
- if (!startingKeyframe.has(prop)) {
719
- missingStyleProps.push(prop);
720
- }
721
- startingKeyframe.set(prop, val);
722
- });
723
- if (missingStyleProps.length) {
724
- for (let i = 1; i < keyframes.length; i++) {
725
- let kf = keyframes[i];
726
- missingStyleProps.forEach((prop) => kf.set(prop, computeStyle(element, prop)));
727
- }
728
- }
729
- }
730
- return keyframes;
731
- }
732
- function visitDslNode(visitor, node, context) {
733
- switch (node.type) {
734
- case AnimationMetadataType.Trigger:
735
- return visitor.visitTrigger(node, context);
736
- case AnimationMetadataType.State:
737
- return visitor.visitState(node, context);
738
- case AnimationMetadataType.Transition:
739
- return visitor.visitTransition(node, context);
740
- case AnimationMetadataType.Sequence:
741
- return visitor.visitSequence(node, context);
742
- case AnimationMetadataType.Group:
743
- return visitor.visitGroup(node, context);
744
- case AnimationMetadataType.Animate:
745
- return visitor.visitAnimate(node, context);
746
- case AnimationMetadataType.Keyframes:
747
- return visitor.visitKeyframes(node, context);
748
- case AnimationMetadataType.Style:
749
- return visitor.visitStyle(node, context);
750
- case AnimationMetadataType.Reference:
751
- return visitor.visitReference(node, context);
752
- case AnimationMetadataType.AnimateChild:
753
- return visitor.visitAnimateChild(node, context);
754
- case AnimationMetadataType.AnimateRef:
755
- return visitor.visitAnimateRef(node, context);
756
- case AnimationMetadataType.Query:
757
- return visitor.visitQuery(node, context);
758
- case AnimationMetadataType.Stagger:
759
- return visitor.visitStagger(node, context);
760
- default:
761
- throw invalidNodeType(node.type);
762
- }
763
- }
764
- function computeStyle(element, prop) {
765
- return window.getComputedStyle(element)[prop];
766
- }
767
-
768
83
  const DIMENSIONAL_PROP_SET = new Set([
769
84
  'width',
770
85
  'height',
@@ -2502,7 +1817,7 @@ class TimelineAnimationEngine {
2502
1817
  }
2503
1818
  _buildPlayer(i, preStyles, postStyles) {
2504
1819
  const element = i.element;
2505
- const keyframes = normalizeKeyframes$1(this._normalizer, i.keyframes, preStyles, postStyles);
1820
+ const keyframes = normalizeKeyframes(this._normalizer, i.keyframes, preStyles, postStyles);
2506
1821
  return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true);
2507
1822
  }
2508
1823
  create(id, element, options = {}) {
@@ -3818,7 +3133,7 @@ class TransitionAnimationEngine {
3818
3133
  });
3819
3134
  const preStyles = preStylesMap.get(element);
3820
3135
  const postStyles = postStylesMap.get(element);
3821
- const keyframes = normalizeKeyframes$1(this._normalizer, timelineInstruction.keyframes, preStyles, postStyles);
3136
+ const keyframes = normalizeKeyframes(this._normalizer, timelineInstruction.keyframes, preStyles, postStyles);
3822
3137
  const player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);
3823
3138
  // this means that this particular player belongs to a sub trigger. It is
3824
3139
  // important that we match this player up with the corresponding (@trigger.listener)
@@ -4083,7 +3398,7 @@ function flattenGroupPlayers(players) {
4083
3398
  function _flattenGroupPlayersRecur(players, finalPlayers) {
4084
3399
  for (let i = 0; i < players.length; i++) {
4085
3400
  const player = players[i];
4086
- if (player instanceof _AnimationGroupPlayer) {
3401
+ if (player instanceof AnimationGroupPlayer) {
4087
3402
  _flattenGroupPlayersRecur(player.players, finalPlayers);
4088
3403
  }
4089
3404
  else {
@@ -4528,7 +3843,7 @@ class WebAnimationsDriver {
4528
3843
  player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val));
4529
3844
  });
4530
3845
  }
4531
- let _keyframes = normalizeKeyframes(keyframes).map((styles) => new Map(styles));
3846
+ let _keyframes = normalizeKeyframes$1(keyframes).map((styles) => new Map(styles));
4532
3847
  _keyframes = balancePreviousStylesIntoKeyframes(element, _keyframes, previousStyles);
4533
3848
  const specialStyles = packageNonAnimatableStyles(element, _keyframes);
4534
3849
  return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles);
@@ -4851,5 +4166,5 @@ class AnimationRendererFactory {
4851
4166
  }
4852
4167
  }
4853
4168
 
4854
- export { AnimationDriver, NoopAnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, BaseAnimationRenderer as ɵBaseAnimationRenderer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, camelCaseToDashCase as ɵcamelCaseToDashCase, containsElement as ɵcontainsElement, createEngine as ɵcreateEngine, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, normalizeKeyframes as ɵnormalizeKeyframes, validateStyleProperty as ɵvalidateStyleProperty, validateWebAnimatableStyleProperty as ɵvalidateWebAnimatableStyleProperty };
4169
+ export { AnimationDriver, NoopAnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationRenderer as ɵAnimationRenderer, AnimationRendererFactory as ɵAnimationRendererFactory, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, BaseAnimationRenderer as ɵBaseAnimationRenderer, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, camelCaseToDashCase as ɵcamelCaseToDashCase, containsElement as ɵcontainsElement, createEngine as ɵcreateEngine, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, normalizeKeyframes$1 as ɵnormalizeKeyframes, validateStyleProperty as ɵvalidateStyleProperty, validateWebAnimatableStyleProperty as ɵvalidateWebAnimatableStyleProperty };
4855
4170
  //# sourceMappingURL=browser.mjs.map