@tylertech/forge-core 2.2.0 → 2.2.2

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.
@@ -33,7 +33,7 @@ export class MediaObserver extends Subject {
33
33
  }
34
34
  return DiscreteMediaObserver.create(feature);
35
35
  }
36
- /** Returns a media oberserver tracking a range feature. */
36
+ /** Returns a media observer tracking a range feature. */
37
37
  /**
38
38
  * Returns a new media observer tracking a range feature.
39
39
  * @param feature The name of a range media feature.
@@ -166,17 +166,22 @@ export class RangeMediaObserver extends MediaObserver {
166
166
  if (!this._isInitialized) {
167
167
  return;
168
168
  }
169
- if (value.matches) {
170
- this._valueQueue.push(name);
171
- }
172
169
  if (!this._isAwaitingQueries) {
173
170
  setTimeout(() => {
174
171
  this.next([...this._valueQueue]);
175
172
  this._valueQueue = [];
176
173
  this._isAwaitingQueries = false;
177
174
  });
175
+ this._valueQueue = [...this.source];
178
176
  this._isAwaitingQueries = true;
179
177
  }
178
+ const index = this._valueQueue.findIndex(queued => queued === name);
179
+ if (value.matches && index === -1) {
180
+ this._valueQueue.push(name);
181
+ }
182
+ else if (!value.matches && index > -1) {
183
+ this._valueQueue.splice(index, 1);
184
+ }
180
185
  }
181
186
  }
182
187
  /**
@@ -34,6 +34,7 @@ export const BOOLEAN_MEDIA_FEATURES = [
34
34
  'any-pointer',
35
35
  'color',
36
36
  'color-index',
37
+ 'dynamic-range',
37
38
  'forced-colors',
38
39
  'grid',
39
40
  'height',
@@ -43,8 +44,11 @@ export const BOOLEAN_MEDIA_FEATURES = [
43
44
  'overflow-block',
44
45
  'overflow-inline',
45
46
  'pointer',
47
+ 'prefers-contrast',
48
+ 'prefers-reduced-motion',
46
49
  'scripting',
47
50
  'update',
51
+ 'video-dynamic-range',
48
52
  'width'
49
53
  ];
50
54
  export const colorGamutValues = ['srbg', 'p3', 'rec2020'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tylertech/forge-core",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "A library of core web utilities that support Forge Web Component libraries.",
5
5
  "author": "Tyler Technologies, Inc.",
6
6
  "license": "Apache-2.0",
@@ -19,7 +19,7 @@ export declare abstract class MediaObserver<T> extends Subject<T> {
19
19
  * @returns A `DiscreteMediaObserver` tracking the given feature.
20
20
  */
21
21
  static observeDiscrete(feature: DiscreteMediaFeature, options?: IMediaObserverOptions): DiscreteMediaObserver;
22
- /** Returns a media oberserver tracking a range feature. */
22
+ /** Returns a media observer tracking a range feature. */
23
23
  /**
24
24
  * Returns a new media observer tracking a range feature.
25
25
  * @param feature The name of a range media feature.
@@ -1,7 +1,7 @@
1
1
  export declare const DISCRETE_MEDIA_FEATURES: readonly ["any-hover", "any-pointer", "color-gamut", "display-mode", "dynamic-range", "forced-colors", "grid", "hover", "inverted-colors", "orientation", "overflow-block", "overflow-inline", "pointer", "prefers-contrast", "prefers-color-scheme", "prefers-reduced-motion", "scripting", "update", "video-dynamic-range"];
2
2
  export declare const RANGE_MEDIA_FEATURES: readonly ["aspect-ratio", "color", "color-index", "height", "monochrome", "resolution", "width"];
3
3
  export declare const ALL_MEDIA_FEATURES: ("height" | "width" | "color" | "grid" | "update" | "orientation" | "any-hover" | "any-pointer" | "color-gamut" | "display-mode" | "dynamic-range" | "forced-colors" | "hover" | "inverted-colors" | "overflow-block" | "overflow-inline" | "pointer" | "prefers-contrast" | "prefers-color-scheme" | "prefers-reduced-motion" | "scripting" | "video-dynamic-range" | "aspect-ratio" | "color-index" | "monochrome" | "resolution")[];
4
- export declare const BOOLEAN_MEDIA_FEATURES: readonly ["any-hover", "any-pointer", "color", "color-index", "forced-colors", "grid", "height", "hover", "inverted-colors", "monochrome", "overflow-block", "overflow-inline", "pointer", "scripting", "update", "width"];
4
+ export declare const BOOLEAN_MEDIA_FEATURES: readonly ["any-hover", "any-pointer", "color", "color-index", "dynamic-range", "forced-colors", "grid", "height", "hover", "inverted-colors", "monochrome", "overflow-block", "overflow-inline", "pointer", "prefers-contrast", "prefers-reduced-motion", "scripting", "update", "video-dynamic-range", "width"];
5
5
  export declare type DiscreteMediaFeature = typeof DISCRETE_MEDIA_FEATURES[number];
6
6
  export declare type RangeMediaFeature = typeof RANGE_MEDIA_FEATURES[number];
7
7
  export declare type MediaFeature = DiscreteMediaFeature | RangeMediaFeature;