@filip.mazev/blocks-core 0.0.21 → 0.0.22

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,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, inject, NgZone, PLATFORM_ID, signal, computed } from '@angular/core';
2
+ import { Injectable, signal, computed, inject, NgZone, PLATFORM_ID } from '@angular/core';
3
3
  import { isPlatformBrowser } from '@angular/common';
4
4
  import { fromEvent } from 'rxjs';
5
5
  import { debounceTime, map, distinctUntilChanged } from 'rxjs/operators';
@@ -23,7 +23,7 @@ var MobileOS;
23
23
  })(MobileOS || (MobileOS = {}));
24
24
 
25
25
  class DeviceTypeService {
26
- userAgent = navigator.userAgent || navigator.vendor || window.opera || undefined;
26
+ userAgent = navigator.userAgent || navigator.vendor || window?.opera || undefined;
27
27
  isDesktopDevice = !this.isMobileDevice() && !this.isTabletDevice();
28
28
  supportedScreenOrientation = (screen?.orientation || {}).type ?? screen.mozOrientation ?? screen.msOrientation;
29
29
  safariScreenOrientation = !screen?.orientation && matchMedia('(orientation: portrait)').matches ? 'portrait-primary' : 'landscape-primary';
@@ -31,25 +31,56 @@ class DeviceTypeService {
31
31
  screenOrientation = this.initialScreenOrientation;
32
32
  constructor() {
33
33
  if (screen.orientation) {
34
- screen.orientation.addEventListener('change', (ev) => (this.screenOrientation = (ev.target ?? {}).type));
34
+ screen.orientation.addEventListener('change', (ev) => {
35
+ const orientation = ev.target;
36
+ if (orientation?.type) {
37
+ this.screenOrientation = orientation.type;
38
+ }
39
+ });
35
40
  }
36
41
  }
37
- isMobileDevice() {
38
- const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];
39
- return regexs.some(b => this.userAgent.match(b) !== null);
40
- }
41
- isTabletDevice() {
42
- const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;
43
- return regex.test(this.userAgent.toLowerCase());
44
- }
45
42
  isLandscapeOrientation() {
46
43
  return ['landscape-primary', 'landscape-secondary'].includes(this.screenOrientation);
47
44
  }
48
45
  isPortraitOrientation() {
49
46
  return ['portrait-primary', 'portrait-secondary'].includes(this.screenOrientation);
50
47
  }
48
+ getDeviceState() {
49
+ const isDesktop = this.isDesktopDevice;
50
+ const isMobile = this.isMobileDevice();
51
+ const isTablet = this.isTabletDevice();
52
+ const mobileOS = this.getMobileOS();
53
+ const isAndroidDevice = this.getDeviceOS() === MobileOS.Android;
54
+ const isAppleDevice = this.getDeviceOS() === MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS;
55
+ const isUnknownMobileDevice = this.getDeviceOS() === MobileOS.Unknown;
56
+ const desktopOS = this.getDesktopOS();
57
+ const isWindowsDesktop = this.getDeviceOS() === DesktopOS.Windows;
58
+ const isLinuxOrUnixDesktop = this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix;
59
+ return {
60
+ isDesktop,
61
+ desktopOS,
62
+ isWindowsDesktop,
63
+ isLinuxOrUnixDesktop,
64
+ isMobile,
65
+ mobileOS,
66
+ isAndroidDevice,
67
+ isAppleDevice,
68
+ isUnknownMobileDevice,
69
+ isTablet,
70
+ isLandscapeOrientation: () => this.isLandscapeOrientation(),
71
+ isPortraitOrientation: () => this.isPortraitOrientation()
72
+ };
73
+ }
74
+ isMobileDevice() {
75
+ const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];
76
+ return regexs.some((b) => this.userAgent?.match(b) !== null);
77
+ }
78
+ isTabletDevice() {
79
+ const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;
80
+ return regex.test(this.userAgent?.toLowerCase() ?? '');
81
+ }
51
82
  getMobileOS() {
52
- if (this.isMobileDevice()) {
83
+ if (this.isMobileDevice() && this.userAgent) {
53
84
  if (/windows phone/i.test(this.userAgent))
54
85
  return MobileOS.WindowsPhone;
55
86
  else if (/android/i.test(this.userAgent))
@@ -58,11 +89,10 @@ class DeviceTypeService {
58
89
  return MobileOS.iOS;
59
90
  return MobileOS.Unknown;
60
91
  }
61
- else
62
- return undefined;
92
+ return undefined;
63
93
  }
64
94
  getDesktopOS() {
65
- if (this.isDesktopDevice) {
95
+ if (this.isDesktopDevice && this.userAgent) {
66
96
  if (this.userAgent.indexOf('Win') !== -1)
67
97
  return DesktopOS.Windows;
68
98
  else if (this.userAgent.indexOf('Mac') !== -1)
@@ -79,36 +109,10 @@ class DeviceTypeService {
79
109
  getDeviceOS() {
80
110
  return this.getMobileOS() ?? this.getDesktopOS();
81
111
  }
82
- getDeviceState() {
83
- const isDesktop = this.isDesktopDevice;
84
- const isMobile = this.isMobileDevice();
85
- const isTablet = this.isTabletDevice();
86
- const mobileOS = this.getMobileOS();
87
- const isAndroidDevice = this.getDeviceOS() === MobileOS.Android;
88
- const isAppleDevice = this.getDeviceOS() === MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS;
89
- const isUnknownMobileDevice = this.getDeviceOS() === MobileOS.Unknown;
90
- const desktopOS = this.getDesktopOS();
91
- const isWindowsDesktop = this.getDeviceOS() === DesktopOS.Windows;
92
- const isLinuxOrUnixDesktop = this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix;
93
- return {
94
- isDesktop,
95
- desktopOS,
96
- isWindowsDesktop,
97
- isLinuxOrUnixDesktop,
98
- isMobile,
99
- mobileOS,
100
- isAndroidDevice,
101
- isAppleDevice,
102
- isUnknownMobileDevice,
103
- isTablet,
104
- isLandscapeOrientation: () => this.isLandscapeOrientation(),
105
- isPortraitOrientation: () => this.isPortraitOrientation()
106
- };
107
- }
108
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DeviceTypeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
109
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DeviceTypeService, providedIn: 'root' });
112
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DeviceTypeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
113
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DeviceTypeService, providedIn: 'root' });
110
114
  }
111
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: DeviceTypeService, decorators: [{
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DeviceTypeService, decorators: [{
112
116
  type: Injectable,
113
117
  args: [{
114
118
  providedIn: 'root'
@@ -123,19 +127,19 @@ const BREAKPOINTS = {
123
127
  xl: 1280,
124
128
  '2xl': 1536,
125
129
  '3xl': 1920,
126
- '4xl': 2560,
130
+ '4xl': 2560
127
131
  };
128
132
 
129
133
  class WindowDimensionsService {
130
- ngZone = inject(NgZone);
131
- platformId = inject(PLATFORM_ID);
132
- isBrowser = isPlatformBrowser(this.platformId);
133
134
  _dimensions = signal(this.getCurrentDimensions(), ...(ngDevMode ? [{ debugName: "_dimensions" }] : []));
134
135
  dimensions = this._dimensions.asReadonly();
135
136
  isMobile = computed(() => this.dimensions().width < BREAKPOINTS.md, ...(ngDevMode ? [{ debugName: "isMobile" }] : []));
136
137
  isTablet = computed(() => this.dimensions().width >= BREAKPOINTS.md && this.dimensions().width < BREAKPOINTS.lg, ...(ngDevMode ? [{ debugName: "isTablet" }] : []));
137
138
  isDesktop = computed(() => this.dimensions().width >= BREAKPOINTS.lg, ...(ngDevMode ? [{ debugName: "isDesktop" }] : []));
138
139
  breakpoints = BREAKPOINTS;
140
+ ngZone = inject(NgZone);
141
+ platformId = inject(PLATFORM_ID);
142
+ isBrowser = isPlatformBrowser(this.platformId);
139
143
  constructor() {
140
144
  this.initResizeListener();
141
145
  }
@@ -145,7 +149,7 @@ class WindowDimensionsService {
145
149
  }
146
150
  return {
147
151
  width: window.innerWidth,
148
- height: window.innerHeight,
152
+ height: window.innerHeight
149
153
  };
150
154
  }
151
155
  initResizeListener() {
@@ -161,22 +165,22 @@ class WindowDimensionsService {
161
165
  });
162
166
  });
163
167
  }
164
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: WindowDimensionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
165
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: WindowDimensionsService, providedIn: 'root' });
168
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: WindowDimensionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
169
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: WindowDimensionsService, providedIn: 'root' });
166
170
  }
167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: WindowDimensionsService, decorators: [{
171
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: WindowDimensionsService, decorators: [{
168
172
  type: Injectable,
169
173
  args: [{
170
- providedIn: 'root',
174
+ providedIn: 'root'
171
175
  }]
172
176
  }], ctorParameters: () => [] });
173
177
 
174
178
  class ScrollLockService {
179
+ _isScrollDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isScrollDisabled" }] : []));
180
+ isScrollDisabled = this._isScrollDisabled.asReadonly();
175
181
  deviceTypeService = inject(DeviceTypeService);
176
182
  windowDimensionsService = inject(WindowDimensionsService);
177
183
  activeLocks = new Map();
178
- _isScrollDisabled = signal(false, ...(ngDevMode ? [{ debugName: "_isScrollDisabled" }] : []));
179
- isScrollDisabled = this._isScrollDisabled.asReadonly();
180
184
  previousBodyPadding = null;
181
185
  activeConfig = computed(() => {
182
186
  if (this.activeLocks.size === 0)
@@ -188,7 +192,6 @@ class ScrollLockService {
188
192
  windowDimensions = this.windowDimensionsService.dimensions;
189
193
  boundHandleTouchMove = this.handleTouchMove.bind(this);
190
194
  boundPreventDefault = this.preventDefault.bind(this);
191
- constructor() { }
192
195
  ngOnDestroy() {
193
196
  this.activeLocks.clear();
194
197
  this.updateStateAndCleanup();
@@ -263,9 +266,11 @@ class ScrollLockService {
263
266
  const targetNode = event.target;
264
267
  const currentConfiguration = this.activeConfig();
265
268
  if (!this.isAllowedToScroll(targetNode) && (currentConfiguration === null || currentConfiguration?.handleTouchInput !== false)) {
266
- if (currentConfiguration === null || currentConfiguration?.mobileOnlyTouchPrevention !== true ||
267
- (currentConfiguration?.mobileOnlyTouchPrevention === true && ((!this.deviceTypeService.getDeviceState().isMobile || !this.deviceTypeService.getDeviceState().isTablet)
268
- && (this.windowDimensions().width < this.windowDimensionsService.breakpoints.sm)))) {
269
+ if (currentConfiguration === null ||
270
+ currentConfiguration?.mobileOnlyTouchPrevention !== true ||
271
+ (currentConfiguration?.mobileOnlyTouchPrevention === true &&
272
+ (!this.deviceTypeService.getDeviceState().isMobile || !this.deviceTypeService.getDeviceState().isTablet) &&
273
+ this.windowDimensions().width < this.windowDimensionsService.breakpoints.sm)) {
269
274
  event.preventDefault();
270
275
  event.stopPropagation();
271
276
  }
@@ -290,24 +295,24 @@ class ScrollLockService {
290
295
  event.preventDefault();
291
296
  event.stopPropagation();
292
297
  }
293
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ScrollLockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
294
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ScrollLockService, providedIn: 'root' });
298
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScrollLockService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
299
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScrollLockService, providedIn: 'root' });
295
300
  }
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ScrollLockService, decorators: [{
301
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ScrollLockService, decorators: [{
297
302
  type: Injectable,
298
303
  args: [{
299
304
  providedIn: 'root'
300
305
  }]
301
- }], ctorParameters: () => [] });
306
+ }] });
302
307
 
303
308
  class ThemingService {
304
- platformId = inject(PLATFORM_ID);
305
- isBrowser = isPlatformBrowser(this.platformId);
306
309
  _systemTheme = signal(this.detectInitialSystemTheme(), ...(ngDevMode ? [{ debugName: "_systemTheme" }] : []));
307
310
  _applicationTheme = signal(null, ...(ngDevMode ? [{ debugName: "_applicationTheme" }] : []));
308
311
  systemTheme = this._systemTheme.asReadonly();
309
312
  applicationTheme = this._applicationTheme.asReadonly();
310
313
  activeTheme = computed(() => this.applicationTheme() ?? this.systemTheme(), ...(ngDevMode ? [{ debugName: "activeTheme" }] : []));
314
+ platformId = inject(PLATFORM_ID);
315
+ isBrowser = isPlatformBrowser(this.platformId);
311
316
  systemTheme$ = toObservable(this._systemTheme);
312
317
  applicationTheme$ = toObservable(this._applicationTheme);
313
318
  mediaQueryList;
@@ -350,10 +355,10 @@ class ThemingService {
350
355
  };
351
356
  this.mediaQueryList.addEventListener('change', this.mediaQueryListener);
352
357
  }
353
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ThemingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
354
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ThemingService, providedIn: 'root' });
358
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ThemingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
359
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ThemingService, providedIn: 'root' });
355
360
  }
356
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ThemingService, decorators: [{
361
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: ThemingService, decorators: [{
357
362
  type: Injectable,
358
363
  args: [{
359
364
  providedIn: 'root'
@@ -363,7 +368,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
363
368
  const SCROLL_LOCK_INSTANCE_IDENTIFIER = 'scroll_lock_instance_';
364
369
 
365
370
  function uuidv4() {
366
- return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));
371
+ return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));
367
372
  }
368
373
 
369
374
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"filip.mazev-blocks-core.mjs","sources":["../../../projects/blocks-core/src/lib/enums/desktop-os.enum.ts","../../../projects/blocks-core/src/lib/enums/mobile-os.enum.ts","../../../projects/blocks-core/src/lib/services/device-type.service.ts","../../../projects/blocks-core/src/lib/constants/window-dimension.constants.ts","../../../projects/blocks-core/src/lib/services/window-dimension.service.ts","../../../projects/blocks-core/src/lib/services/scroll-lock.service.ts","../../../projects/blocks-core/src/lib/services/theming.service.ts","../../../projects/blocks-core/src/lib/constants/scroll-lock.constants.ts","../../../projects/blocks-core/src/lib/helpers/uui4.ts","../../../projects/blocks-core/src/public-api.ts","../../../projects/blocks-core/src/filip.mazev-blocks-core.ts"],"sourcesContent":["export enum DesktopOS {\n Linux = 'linux',\n MacOS = 'mac_os',\n Unix = 'unix',\n Unknown = 'unknown',\n Windows = 'windows'\n}","export enum MobileOS {\n Android = 'android',\n iOS = 'ios',\n Unknown = 'unknown',\n WindowsPhone = 'Windows Phone'\n}","import { Injectable } from '@angular/core';\nimport { DesktopOS } from '../enums/desktop-os.enum';\nimport { MobileOS } from '../enums/mobile-os.enum';\nimport { DeviceState } from '../interfaces/device-state.interface';\nimport { DeviceOS, DeviceOrientationType } from '../types/device.types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DeviceTypeService {\n private userAgent: string = navigator.userAgent || navigator.vendor || (window as any).opera || undefined;\n private isDesktopDevice: boolean = !this.isMobileDevice() && !this.isTabletDevice();\n\n private supportedScreenOrientation = (screen?.orientation || {}).type ?? (screen as any).mozOrientation ?? (screen as any).msOrientation;\n private safariScreenOrientation: DeviceOrientationType = !screen?.orientation && matchMedia('(orientation: portrait)').matches ? 'portrait-primary' : 'landscape-primary';\n private initialScreenOrientation: DeviceOrientationType = this.supportedScreenOrientation ?? this.safariScreenOrientation ?? 'portrait-primary';\n private screenOrientation: DeviceOrientationType = this.initialScreenOrientation;\n \n constructor() {\n if (screen.orientation) {\n screen.orientation.addEventListener(\n 'change',\n (ev: Event) => (this.screenOrientation = (ev.target ?? ({} as any)).type as OrientationType)\n );\n }\n }\n\n private isMobileDevice(): boolean {\n const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];\n return regexs.some(b => this.userAgent.match(b) !== null);\n }\n\n private isTabletDevice(): boolean {\n const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;\n return regex.test(this.userAgent.toLowerCase());\n }\n\n public isLandscapeOrientation(): boolean {\n return ['landscape-primary', 'landscape-secondary'].includes(this.screenOrientation);\n }\n\n public isPortraitOrientation(): boolean {\n return ['portrait-primary', 'portrait-secondary'].includes(this.screenOrientation);\n }\n\n private getMobileOS(): MobileOS | undefined {\n if (this.isMobileDevice()) {\n if (/windows phone/i.test(this.userAgent)) return MobileOS.WindowsPhone;\n else if (/android/i.test(this.userAgent)) return MobileOS.Android;\n else if (/iPad|iPhone|iPod/.test(this.userAgent) && !(window as any).MSStream) return MobileOS.iOS;\n\n return MobileOS.Unknown;\n } else return undefined;\n }\n\n private getDesktopOS(): DesktopOS | undefined {\n if (this.isDesktopDevice) {\n if (this.userAgent.indexOf('Win') !== -1) return DesktopOS.Windows;\n else if (this.userAgent.indexOf('Mac') !== -1) return DesktopOS.MacOS;\n else if (this.userAgent.indexOf('X11') !== -1) return DesktopOS.Unix;\n else if (this.userAgent.indexOf('Linux') !== -1) return DesktopOS.Linux;\n\n return DesktopOS.Unknown;\n } else return undefined;\n }\n\n private getDeviceOS(): DeviceOS | undefined {\n return this.getMobileOS() ?? this.getDesktopOS();\n }\n\n public getDeviceState(): DeviceState {\n const isDesktop = this.isDesktopDevice;\n const isMobile = this.isMobileDevice();\n const isTablet = this.isTabletDevice();\n const mobileOS: MobileOS | undefined = this.getMobileOS();\n const isAndroidDevice = this.getDeviceOS() === MobileOS.Android;\n const isAppleDevice = this.getDeviceOS() === MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS;\n const isUnknownMobileDevice = this.getDeviceOS() === MobileOS.Unknown;\n const desktopOS: DesktopOS | undefined = this.getDesktopOS();\n const isWindowsDesktop = this.getDeviceOS() === DesktopOS.Windows;\n const isLinuxOrUnixDesktop = this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix;\n\n return {\n isDesktop,\n desktopOS,\n isWindowsDesktop,\n isLinuxOrUnixDesktop,\n isMobile,\n mobileOS,\n isAndroidDevice,\n isAppleDevice,\n isUnknownMobileDevice,\n isTablet,\n isLandscapeOrientation: () => this.isLandscapeOrientation(),\n isPortraitOrientation: () => this.isPortraitOrientation()\n };\n }\n}\n","export const BREAKPOINTS = {\n xs: 360,\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536,\n '3xl': 1920,\n '4xl': 2560,\n} as const;","import { Injectable, inject, NgZone, PLATFORM_ID, signal, computed } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';\nimport { BREAKPOINTS } from '../constants/window-dimension.constants';\nimport { WindowDimensions } from '../interfaces/window-dimensions.interface';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class WindowDimensionsService {\n private readonly ngZone = inject(NgZone);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private readonly _dimensions = signal<WindowDimensions>(this.getCurrentDimensions());\n\n public readonly dimensions = this._dimensions.asReadonly();\n\n public readonly isMobile = computed(() => this.dimensions().width < BREAKPOINTS.md);\n public readonly isTablet = computed(() => this.dimensions().width >= BREAKPOINTS.md && this.dimensions().width < BREAKPOINTS.lg);\n public readonly isDesktop = computed(() => this.dimensions().width >= BREAKPOINTS.lg);\n\n public readonly breakpoints = BREAKPOINTS;\n\n constructor() {\n this.initResizeListener();\n }\n\n private getCurrentDimensions(): WindowDimensions {\n if (!this.isBrowser) {\n return { width: 0, height: 0 };\n }\n return {\n width: window.innerWidth,\n height: window.innerHeight,\n };\n }\n\n private initResizeListener(): void {\n if (!this.isBrowser) return;\n\n this.ngZone.runOutsideAngular(() => {\n fromEvent(window, 'resize')\n .pipe(\n debounceTime(150),\n map(() => this.getCurrentDimensions()),\n distinctUntilChanged((prev, curr) => \n prev.width === curr.width && prev.height === curr.height\n )\n )\n .subscribe((dims) => {\n this.ngZone.run(() => {\n this._dimensions.set(dims);\n });\n });\n });\n }\n}","import { Injectable, OnDestroy, inject, signal, computed } from '@angular/core';\nimport { DeviceTypeService } from './device-type.service';\nimport { WindowDimensionsService } from './window-dimension.service';\nimport { IScrollLockConfig } from '../interfaces/scroll-lock-config.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ScrollLockService implements OnDestroy {\n private deviceTypeService = inject(DeviceTypeService);\n private windowDimensionsService = inject(WindowDimensionsService);\n\n private activeLocks = new Map<string, IScrollLockConfig>();\n\n private _isScrollDisabled = signal<boolean>(false);\n public readonly isScrollDisabled = this._isScrollDisabled.asReadonly();\n\n private previousBodyPadding: string | null = null;\n\n private activeConfig = computed(() => {\n if (this.activeLocks.size === 0) return null;\n const keys = Array.from(this.activeLocks.keys());\n const lastKey = keys[keys.length - 1];\n return this.activeLocks.get(lastKey) ?? null;\n });\n\n private windowDimensions = this.windowDimensionsService.dimensions;\n\n private boundHandleTouchMove = this.handleTouchMove.bind(this);\n private boundPreventDefault = this.preventDefault.bind(this);\n\n constructor() { }\n\n public ngOnDestroy(): void {\n this.activeLocks.clear();\n this.updateStateAndCleanup();\n }\n\n public disableScroll(usageId: string, config: IScrollLockConfig): void {\n const wasAlreadyDisabled = this._isScrollDisabled();\n\n this.activeLocks.set(usageId, config);\n this._isScrollDisabled.set(true);\n\n if (wasAlreadyDisabled) {\n return;\n }\n\n const documentWidth = document.documentElement.clientWidth;\n const windowWidth = window.innerWidth;\n const scrollBarWidth = windowWidth - documentWidth;\n\n if (scrollBarWidth > 0) {\n this.previousBodyPadding = document.body.style.paddingRight;\n\n const computedBodyPadding = parseInt(window.getComputedStyle(document.body).paddingRight, 10) || 0;\n const newPadding = computedBodyPadding + scrollBarWidth;\n\n document.body.style.setProperty('padding-right', `${newPadding}px`, 'important');\n }\n\n document.body.style.setProperty('overflow', 'hidden', 'important');\n\n if (config.handleTouchInput !== false) {\n document.body.style.setProperty('touch-action', 'none', 'important');\n }\n\n setTimeout(() => {\n if (!this._isScrollDisabled()) return;\n\n if (config.handleTouchInput === true) {\n document.body.addEventListener('touchmove', this.boundHandleTouchMove, { passive: false });\n }\n\n if (config.handleExtremeOverflow === true) {\n const options = { passive: false };\n window.addEventListener('wheel', this.boundPreventDefault, options);\n window.addEventListener('mousewheel', this.boundPreventDefault, options);\n window.addEventListener('scroll', this.boundPreventDefault, options);\n window.addEventListener('DOMMouseScroll', this.boundPreventDefault, options);\n }\n }, (config.animationDuration ?? 0) + 10);\n }\n\n public enableScroll(usageId: string, extreme_overflow?: boolean): void {\n if (!this.activeLocks.has(usageId)) {\n return;\n }\n\n this.activeLocks.delete(usageId);\n\n if (this.activeLocks.size > 0) {\n return;\n }\n\n this.updateStateAndCleanup(extreme_overflow);\n }\n\n private updateStateAndCleanup(extreme_overflow?: boolean): void {\n this._isScrollDisabled.set(false);\n\n document.body.style.removeProperty('overflow');\n\n if (this.previousBodyPadding !== null) {\n if (this.previousBodyPadding) {\n document.body.style.setProperty('padding-right', this.previousBodyPadding);\n } else {\n document.body.style.removeProperty('padding-right');\n }\n this.previousBodyPadding = null;\n }\n\n document.body.removeEventListener('touchmove', this.boundHandleTouchMove);\n document.body.style.removeProperty('touch-action');\n\n if (extreme_overflow !== false) {\n window.removeEventListener('wheel', this.boundPreventDefault);\n window.removeEventListener('mousewheel', this.boundPreventDefault);\n window.removeEventListener('scroll', this.boundPreventDefault);\n window.removeEventListener('DOMMouseScroll', this.boundPreventDefault);\n }\n }\n\n private handleTouchMove(event: Event): void {\n const targetNode = event.target as Node;\n const currentConfiguration = this.activeConfig();\n\n if (!this.isAllowedToScroll(targetNode) && (currentConfiguration === null || currentConfiguration?.handleTouchInput !== false)) {\n if (currentConfiguration === null || currentConfiguration?.mobileOnlyTouchPrevention !== true ||\n (currentConfiguration?.mobileOnlyTouchPrevention === true && ((!this.deviceTypeService.getDeviceState().isMobile || !this.deviceTypeService.getDeviceState().isTablet)\n && (this.windowDimensions().width < this.windowDimensionsService.breakpoints.sm)))) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n\n private isAllowedToScroll(targetNode: Node): boolean {\n const currentConfiguration = this.activeConfig();\n\n if (!currentConfiguration?.allowTouchInputOn || currentConfiguration.allowTouchInputOn.length === 0) { return true; }\n\n if (currentConfiguration.allowTouchInputOn.length === undefined) {\n return (currentConfiguration.allowTouchInputOn as unknown as Element).contains(targetNode);\n }\n\n for (const element of currentConfiguration.allowTouchInputOn) {\n if (element.contains(targetNode)) {\n return true;\n }\n }\n\n return false;\n }\n\n private preventDefault(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n }\n}","import { Injectable, OnDestroy, inject, signal, PLATFORM_ID, computed } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DeviceTheme } from '../types/device.types';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ThemingService implements OnDestroy {\n private readonly platformId = inject(PLATFORM_ID);\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private readonly _systemTheme = signal<DeviceTheme>(this.detectInitialSystemTheme());\n private readonly _applicationTheme = signal<DeviceTheme | null>(null);\n\n public readonly systemTheme = this._systemTheme.asReadonly();\n public readonly applicationTheme = this._applicationTheme.asReadonly();\n public readonly activeTheme = computed(() => this.applicationTheme() ?? this.systemTheme());\n\n private readonly systemTheme$ = toObservable(this._systemTheme);\n private readonly applicationTheme$ = toObservable(this._applicationTheme);\n\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n constructor() {\n if (this.isBrowser) {\n this.initSystemThemeListener();\n }\n }\n\n public ngOnDestroy(): void {\n if (this.mediaQueryList && this.mediaQueryListener) {\n this.mediaQueryList.removeEventListener('change', this.mediaQueryListener);\n }\n }\n\n public setApplicationTheme(theme: DeviceTheme): void {\n this._applicationTheme.set(theme);\n }\n\n /**\n * Returns an observable of the system theme. \n * Safe to call anywhere because the observable is pre-created in the constructor context.\n */\n public getSystemTheme$() {\n return this.systemTheme$;\n }\n\n /**\n * Returns an observable of the application theme.\n */\n public getApplicationTheme$() {\n return this.applicationTheme$;\n }\n\n private detectInitialSystemTheme(): DeviceTheme {\n if (!this.isBrowser) return 'light';\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n private initSystemThemeListener(): void {\n this.mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');\n\n this.mediaQueryListener = (event: MediaQueryListEvent) => {\n this._systemTheme.set(event.matches ? 'dark' : 'light');\n };\n\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n }\n}","export const SCROLL_LOCK_INSTANCE_IDENTIFIER = 'scroll_lock_instance_';","export function uuidv4() {\n return \"10000000-1000-4000-8000-100000000000\".replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));\n}","/*\n * Public API Surface of blocks-core\n */\n\nexport * from './lib/services/device-type.service';\nexport * from './lib/services/scroll-lock.service';\nexport * from './lib/services/window-dimension.service';\nexport * from './lib/services/theming.service';\n\nexport * from './lib/enums/desktop-os.enum';\nexport * from './lib/enums/mobile-os.enum';\n\nexport * from './lib/interfaces/device-state.interface';\nexport * from './lib/interfaces/scroll-lock-config.interface';\nexport * from './lib/interfaces/window-dimensions.interface';\n\nexport * from './lib/constants/window-dimension.constants';\nexport * from './lib/constants/scroll-lock.constants';\n\nexport * from './lib/types/device.types';\n\nexport * from './lib/helpers/uui4';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;IAAY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACjB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,QAAgB;AAChB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACvB,CAAC,EANW,SAAS,KAAT,SAAS,GAA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,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;2FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACPM,MAAM,+BAA+B,GAAG;;SCA/B,MAAM,GAAA;IAClB,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACjK;;ACFA;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"filip.mazev-blocks-core.mjs","sources":["../../../projects/blocks-core/src/lib/enums/desktop-os.enum.ts","../../../projects/blocks-core/src/lib/enums/mobile-os.enum.ts","../../../projects/blocks-core/src/lib/services/device-type.service.ts","../../../projects/blocks-core/src/lib/constants/window-dimension.constants.ts","../../../projects/blocks-core/src/lib/services/window-dimension.service.ts","../../../projects/blocks-core/src/lib/services/scroll-lock.service.ts","../../../projects/blocks-core/src/lib/services/theming.service.ts","../../../projects/blocks-core/src/lib/constants/scroll-lock.constants.ts","../../../projects/blocks-core/src/lib/helpers/uui4.ts","../../../projects/blocks-core/src/public-api.ts","../../../projects/blocks-core/src/filip.mazev-blocks-core.ts"],"sourcesContent":["export enum DesktopOS {\n Linux = 'linux',\n MacOS = 'mac_os',\n Unix = 'unix',\n Unknown = 'unknown',\n Windows = 'windows'\n}\n","export enum MobileOS {\n Android = 'android',\n iOS = 'ios',\n Unknown = 'unknown',\n WindowsPhone = 'Windows Phone'\n}\n","import { Injectable } from '@angular/core';\nimport { DesktopOS } from '../enums/desktop-os.enum';\nimport { MobileOS } from '../enums/mobile-os.enum';\nimport { DeviceState } from '../interfaces/device-state.interface';\nimport { DeviceOS, DeviceOrientationType, LegacyScreenOrientation, MSStreamWindow, OperaCapableWindow } from '../types/core.types';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DeviceTypeService {\n private userAgent?: string = navigator.userAgent || navigator.vendor || (window as OperaCapableWindow)?.opera || undefined;\n private readonly isDesktopDevice = !this.isMobileDevice() && !this.isTabletDevice();\n\n private supportedScreenOrientation =\n (screen?.orientation || {}).type ?? (screen as LegacyScreenOrientation).mozOrientation ?? (screen as LegacyScreenOrientation).msOrientation;\n\n private safariScreenOrientation: DeviceOrientationType =\n !screen?.orientation && matchMedia('(orientation: portrait)').matches ? 'portrait-primary' : 'landscape-primary';\n\n private initialScreenOrientation: DeviceOrientationType = this.supportedScreenOrientation ?? this.safariScreenOrientation ?? 'portrait-primary';\n private screenOrientation: DeviceOrientationType = this.initialScreenOrientation;\n\n constructor() {\n if (screen.orientation) {\n screen.orientation.addEventListener('change', (ev: Event) => {\n const orientation = ev.target as ScreenOrientation | null;\n if (orientation?.type) {\n this.screenOrientation = orientation.type;\n }\n });\n }\n }\n\n public isLandscapeOrientation(): boolean {\n return ['landscape-primary', 'landscape-secondary'].includes(this.screenOrientation);\n }\n\n public isPortraitOrientation(): boolean {\n return ['portrait-primary', 'portrait-secondary'].includes(this.screenOrientation);\n }\n\n public getDeviceState(): DeviceState {\n const isDesktop = this.isDesktopDevice;\n const isMobile = this.isMobileDevice();\n const isTablet = this.isTabletDevice();\n const mobileOS: MobileOS | undefined = this.getMobileOS();\n const isAndroidDevice = this.getDeviceOS() === MobileOS.Android;\n const isAppleDevice = this.getDeviceOS() === MobileOS.iOS || this.getDeviceOS() === DesktopOS.MacOS;\n const isUnknownMobileDevice = this.getDeviceOS() === MobileOS.Unknown;\n const desktopOS: DesktopOS | undefined = this.getDesktopOS();\n const isWindowsDesktop = this.getDeviceOS() === DesktopOS.Windows;\n const isLinuxOrUnixDesktop = this.getDeviceOS() === DesktopOS.Linux || this.getDeviceOS() === DesktopOS.Unix;\n\n return {\n isDesktop,\n desktopOS,\n isWindowsDesktop,\n isLinuxOrUnixDesktop,\n isMobile,\n mobileOS,\n isAndroidDevice,\n isAppleDevice,\n isUnknownMobileDevice,\n isTablet,\n isLandscapeOrientation: () => this.isLandscapeOrientation(),\n isPortraitOrientation: () => this.isPortraitOrientation()\n };\n }\n\n private isMobileDevice(): boolean {\n const regexs = [/(Android)(.+)(Mobile)/i, /BlackBerry/i, /iPhone|iPod/i, /Opera Mini/i, /IEMobile/i];\n return regexs.some((b) => this.userAgent?.match(b) !== null);\n }\n\n private isTabletDevice(): boolean {\n const regex = /(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/;\n return regex.test(this.userAgent?.toLowerCase() ?? '');\n }\n\n private getMobileOS(): MobileOS | undefined {\n if (this.isMobileDevice() && this.userAgent) {\n if (/windows phone/i.test(this.userAgent)) return MobileOS.WindowsPhone;\n else if (/android/i.test(this.userAgent)) return MobileOS.Android;\n else if (/iPad|iPhone|iPod/.test(this.userAgent) && !(window as MSStreamWindow).MSStream) return MobileOS.iOS;\n\n return MobileOS.Unknown;\n }\n return undefined;\n }\n\n private getDesktopOS(): DesktopOS | undefined {\n if (this.isDesktopDevice && this.userAgent) {\n if (this.userAgent.indexOf('Win') !== -1) return DesktopOS.Windows;\n else if (this.userAgent.indexOf('Mac') !== -1) return DesktopOS.MacOS;\n else if (this.userAgent.indexOf('X11') !== -1) return DesktopOS.Unix;\n else if (this.userAgent.indexOf('Linux') !== -1) return DesktopOS.Linux;\n\n return DesktopOS.Unknown;\n } else return undefined;\n }\n\n private getDeviceOS(): DeviceOS | undefined {\n return this.getMobileOS() ?? this.getDesktopOS();\n }\n}\n","export const BREAKPOINTS = {\n xs: 360,\n sm: 640,\n md: 768,\n lg: 1024,\n xl: 1280,\n '2xl': 1536,\n '3xl': 1920,\n '4xl': 2560\n} as const;\n","import { Injectable, inject, NgZone, PLATFORM_ID, signal, computed } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { fromEvent } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, map } from 'rxjs/operators';\nimport { BREAKPOINTS } from '../constants/window-dimension.constants';\nimport { WindowDimensions } from '../interfaces/window-dimensions.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class WindowDimensionsService {\n public readonly _dimensions = signal<WindowDimensions>(this.getCurrentDimensions());\n public readonly dimensions = this._dimensions.asReadonly();\n\n public readonly isMobile = computed(() => this.dimensions().width < BREAKPOINTS.md);\n public readonly isTablet = computed(() => this.dimensions().width >= BREAKPOINTS.md && this.dimensions().width < BREAKPOINTS.lg);\n public readonly isDesktop = computed(() => this.dimensions().width >= BREAKPOINTS.lg);\n\n public readonly breakpoints = BREAKPOINTS;\n private readonly ngZone = inject(NgZone);\n\n private readonly platformId = inject(PLATFORM_ID);\n\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n constructor() {\n this.initResizeListener();\n }\n\n private getCurrentDimensions(): WindowDimensions {\n if (!this.isBrowser) {\n return { width: 0, height: 0 };\n }\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n\n private initResizeListener(): void {\n if (!this.isBrowser) return;\n\n this.ngZone.runOutsideAngular(() => {\n fromEvent(window, 'resize')\n .pipe(\n debounceTime(150),\n map(() => this.getCurrentDimensions()),\n distinctUntilChanged((prev, curr) => prev.width === curr.width && prev.height === curr.height)\n )\n .subscribe((dims) => {\n this.ngZone.run(() => {\n this._dimensions.set(dims);\n });\n });\n });\n }\n}\n","import { Injectable, OnDestroy, inject, signal, computed } from '@angular/core';\nimport { DeviceTypeService } from './device-type.service';\nimport { WindowDimensionsService } from './window-dimension.service';\nimport { IScrollLockConfig } from '../interfaces/scroll-lock-config.interface';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ScrollLockService implements OnDestroy {\n public _isScrollDisabled = signal<boolean>(false);\n public readonly isScrollDisabled = this._isScrollDisabled.asReadonly();\n\n private deviceTypeService = inject(DeviceTypeService);\n private windowDimensionsService = inject(WindowDimensionsService);\n\n private activeLocks = new Map<string, IScrollLockConfig>();\n\n private previousBodyPadding: string | null = null;\n\n private activeConfig = computed(() => {\n if (this.activeLocks.size === 0) return null;\n const keys = Array.from(this.activeLocks.keys());\n const lastKey = keys[keys.length - 1];\n return this.activeLocks.get(lastKey) ?? null;\n });\n\n private windowDimensions = this.windowDimensionsService.dimensions;\n\n private boundHandleTouchMove = this.handleTouchMove.bind(this);\n private boundPreventDefault = this.preventDefault.bind(this);\n\n public ngOnDestroy(): void {\n this.activeLocks.clear();\n this.updateStateAndCleanup();\n }\n\n public disableScroll(usageId: string, config: IScrollLockConfig): void {\n const wasAlreadyDisabled = this._isScrollDisabled();\n\n this.activeLocks.set(usageId, config);\n this._isScrollDisabled.set(true);\n\n if (wasAlreadyDisabled) {\n return;\n }\n\n const documentWidth = document.documentElement.clientWidth;\n const windowWidth = window.innerWidth;\n const scrollBarWidth = windowWidth - documentWidth;\n\n if (scrollBarWidth > 0) {\n this.previousBodyPadding = document.body.style.paddingRight;\n\n const computedBodyPadding = parseInt(window.getComputedStyle(document.body).paddingRight, 10) || 0;\n const newPadding = computedBodyPadding + scrollBarWidth;\n\n document.body.style.setProperty('padding-right', `${newPadding}px`, 'important');\n }\n\n document.body.style.setProperty('overflow', 'hidden', 'important');\n\n if (config.handleTouchInput !== false) {\n document.body.style.setProperty('touch-action', 'none', 'important');\n }\n\n setTimeout(\n () => {\n if (!this._isScrollDisabled()) return;\n\n if (config.handleTouchInput === true) {\n document.body.addEventListener('touchmove', this.boundHandleTouchMove, { passive: false });\n }\n\n if (config.handleExtremeOverflow === true) {\n const options = { passive: false };\n window.addEventListener('wheel', this.boundPreventDefault, options);\n window.addEventListener('mousewheel', this.boundPreventDefault, options);\n window.addEventListener('scroll', this.boundPreventDefault, options);\n window.addEventListener('DOMMouseScroll', this.boundPreventDefault, options);\n }\n },\n (config.animationDuration ?? 0) + 10\n );\n }\n\n public enableScroll(usageId: string, extreme_overflow?: boolean): void {\n if (!this.activeLocks.has(usageId)) {\n return;\n }\n\n this.activeLocks.delete(usageId);\n\n if (this.activeLocks.size > 0) {\n return;\n }\n\n this.updateStateAndCleanup(extreme_overflow);\n }\n\n private updateStateAndCleanup(extreme_overflow?: boolean): void {\n this._isScrollDisabled.set(false);\n\n document.body.style.removeProperty('overflow');\n\n if (this.previousBodyPadding !== null) {\n if (this.previousBodyPadding) {\n document.body.style.setProperty('padding-right', this.previousBodyPadding);\n } else {\n document.body.style.removeProperty('padding-right');\n }\n this.previousBodyPadding = null;\n }\n\n document.body.removeEventListener('touchmove', this.boundHandleTouchMove);\n document.body.style.removeProperty('touch-action');\n\n if (extreme_overflow !== false) {\n window.removeEventListener('wheel', this.boundPreventDefault);\n window.removeEventListener('mousewheel', this.boundPreventDefault);\n window.removeEventListener('scroll', this.boundPreventDefault);\n window.removeEventListener('DOMMouseScroll', this.boundPreventDefault);\n }\n }\n\n private handleTouchMove(event: Event): void {\n const targetNode = event.target as Node;\n const currentConfiguration = this.activeConfig();\n\n if (!this.isAllowedToScroll(targetNode) && (currentConfiguration === null || currentConfiguration?.handleTouchInput !== false)) {\n if (\n currentConfiguration === null ||\n currentConfiguration?.mobileOnlyTouchPrevention !== true ||\n (currentConfiguration?.mobileOnlyTouchPrevention === true &&\n (!this.deviceTypeService.getDeviceState().isMobile || !this.deviceTypeService.getDeviceState().isTablet) &&\n this.windowDimensions().width < this.windowDimensionsService.breakpoints.sm)\n ) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n }\n\n private isAllowedToScroll(targetNode: Node): boolean {\n const currentConfiguration = this.activeConfig();\n\n if (!currentConfiguration?.allowTouchInputOn || currentConfiguration.allowTouchInputOn.length === 0) {\n return true;\n }\n\n if (currentConfiguration.allowTouchInputOn.length === undefined) {\n return (currentConfiguration.allowTouchInputOn as unknown as Element).contains(targetNode);\n }\n\n for (const element of currentConfiguration.allowTouchInputOn) {\n if (element.contains(targetNode)) {\n return true;\n }\n }\n\n return false;\n }\n\n private preventDefault(event: Event): void {\n event.preventDefault();\n event.stopPropagation();\n }\n}\n","import { Injectable, OnDestroy, inject, signal, PLATFORM_ID, computed } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DeviceTheme } from '../types/core.types';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ThemingService implements OnDestroy {\n public readonly _systemTheme = signal<DeviceTheme>(this.detectInitialSystemTheme());\n public readonly _applicationTheme = signal<DeviceTheme | null>(null);\n\n public readonly systemTheme = this._systemTheme.asReadonly();\n public readonly applicationTheme = this._applicationTheme.asReadonly();\n\n public readonly activeTheme = computed(() => this.applicationTheme() ?? this.systemTheme());\n private readonly platformId = inject(PLATFORM_ID);\n\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private readonly systemTheme$ = toObservable(this._systemTheme);\n private readonly applicationTheme$ = toObservable(this._applicationTheme);\n\n private mediaQueryList?: MediaQueryList;\n private mediaQueryListener?: (event: MediaQueryListEvent) => void;\n\n constructor() {\n if (this.isBrowser) {\n this.initSystemThemeListener();\n }\n }\n\n public ngOnDestroy(): void {\n if (this.mediaQueryList && this.mediaQueryListener) {\n this.mediaQueryList.removeEventListener('change', this.mediaQueryListener);\n }\n }\n\n public setApplicationTheme(theme: DeviceTheme): void {\n this._applicationTheme.set(theme);\n }\n\n /**\n * Returns an observable of the system theme.\n * Safe to call anywhere because the observable is pre-created in the constructor context.\n */\n public getSystemTheme$() {\n return this.systemTheme$;\n }\n\n /**\n * Returns an observable of the application theme.\n */\n public getApplicationTheme$() {\n return this.applicationTheme$;\n }\n\n private detectInitialSystemTheme(): DeviceTheme {\n if (!this.isBrowser) return 'light';\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';\n }\n\n private initSystemThemeListener(): void {\n this.mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');\n\n this.mediaQueryListener = (event: MediaQueryListEvent) => {\n this._systemTheme.set(event.matches ? 'dark' : 'light');\n };\n\n this.mediaQueryList.addEventListener('change', this.mediaQueryListener);\n }\n}\n","export const SCROLL_LOCK_INSTANCE_IDENTIFIER = 'scroll_lock_instance_';\n","export function uuidv4() {\n return '10000000-1000-4000-8000-100000000000'.replace(/[018]/g, (c) => (+c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (+c / 4)))).toString(16));\n}\n","/*\n * Public API Surface of blocks-core\n */\n\nexport * from './lib/services/device-type.service';\nexport * from './lib/services/scroll-lock.service';\nexport * from './lib/services/window-dimension.service';\nexport * from './lib/services/theming.service';\n\nexport * from './lib/enums/desktop-os.enum';\nexport * from './lib/enums/mobile-os.enum';\n\nexport * from './lib/interfaces/device-state.interface';\nexport * from './lib/interfaces/scroll-lock-config.interface';\nexport * from './lib/interfaces/window-dimensions.interface';\n\nexport * from './lib/constants/window-dimension.constants';\nexport * from './lib/constants/scroll-lock.constants';\n\nexport * from './lib/types/core.types';\n\nexport * from './lib/helpers/uui4';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;IAAY;AAAZ,CAAA,UAAY,SAAS,EAAA;AACnB,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,SAAA,CAAA,OAAA,CAAA,GAAA,QAAgB;AAChB,IAAA,SAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,SAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACrB,CAAC,EANW,SAAS,KAAT,SAAS,GAAA,EAAA,CAAA,CAAA;;ICAT;AAAZ,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAA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CAAA;AAAd,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA;;2FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACPM,MAAM,+BAA+B,GAAG;;SCA/B,MAAM,GAAA;IACpB,OAAO,sCAAsC,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC/J;;ACFA;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@filip.mazev/blocks-core",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  "./mixins": "./lib/styles/_mixins.scss",
@@ -33,21 +33,21 @@ interface DeviceState {
33
33
  }
34
34
 
35
35
  declare class DeviceTypeService {
36
- private userAgent;
37
- private isDesktopDevice;
36
+ private userAgent?;
37
+ private readonly isDesktopDevice;
38
38
  private supportedScreenOrientation;
39
39
  private safariScreenOrientation;
40
40
  private initialScreenOrientation;
41
41
  private screenOrientation;
42
42
  constructor();
43
- private isMobileDevice;
44
- private isTabletDevice;
45
43
  isLandscapeOrientation(): boolean;
46
44
  isPortraitOrientation(): boolean;
45
+ getDeviceState(): DeviceState;
46
+ private isMobileDevice;
47
+ private isTabletDevice;
47
48
  private getMobileOS;
48
49
  private getDesktopOS;
49
50
  private getDeviceOS;
50
- getDeviceState(): DeviceState;
51
51
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DeviceTypeService, never>;
52
52
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<DeviceTypeService>;
53
53
  }
@@ -61,17 +61,16 @@ interface IScrollLockConfig {
61
61
  }
62
62
 
63
63
  declare class ScrollLockService implements OnDestroy {
64
+ _isScrollDisabled: _angular_core.WritableSignal<boolean>;
65
+ readonly isScrollDisabled: _angular_core.Signal<boolean>;
64
66
  private deviceTypeService;
65
67
  private windowDimensionsService;
66
68
  private activeLocks;
67
- private _isScrollDisabled;
68
- readonly isScrollDisabled: _angular_core.Signal<boolean>;
69
69
  private previousBodyPadding;
70
70
  private activeConfig;
71
71
  private windowDimensions;
72
72
  private boundHandleTouchMove;
73
73
  private boundPreventDefault;
74
- constructor();
75
74
  ngOnDestroy(): void;
76
75
  disableScroll(usageId: string, config: IScrollLockConfig): void;
77
76
  enableScroll(usageId: string, extreme_overflow?: boolean): void;
@@ -89,10 +88,7 @@ interface WindowDimensions {
89
88
  }
90
89
 
91
90
  declare class WindowDimensionsService {
92
- private readonly ngZone;
93
- private readonly platformId;
94
- private readonly isBrowser;
95
- private readonly _dimensions;
91
+ readonly _dimensions: _angular_core.WritableSignal<WindowDimensions>;
96
92
  readonly dimensions: _angular_core.Signal<WindowDimensions>;
97
93
  readonly isMobile: _angular_core.Signal<boolean>;
98
94
  readonly isTablet: _angular_core.Signal<boolean>;
@@ -107,6 +103,9 @@ declare class WindowDimensionsService {
107
103
  readonly '3xl': 1920;
108
104
  readonly '4xl': 2560;
109
105
  };
106
+ private readonly ngZone;
107
+ private readonly platformId;
108
+ private readonly isBrowser;
110
109
  constructor();
111
110
  private getCurrentDimensions;
112
111
  private initResizeListener;
@@ -114,18 +113,28 @@ declare class WindowDimensionsService {
114
113
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<WindowDimensionsService>;
115
114
  }
116
115
 
117
- type DeviceTheme = "light" | "dark";
116
+ type DeviceTheme = 'light' | 'dark';
118
117
  type DeviceOS = DesktopOS | MobileOS;
119
118
  type DeviceOrientationType = 'portrait-primary' | 'landscape-primary' | 'portrait-secondary' | 'landscape-secondary';
119
+ type OperaCapableWindow = Window & {
120
+ opera?: string;
121
+ };
122
+ type LegacyScreenOrientation = Screen & {
123
+ mozOrientation?: DeviceOrientationType;
124
+ msOrientation?: DeviceOrientationType;
125
+ };
126
+ type MSStreamWindow = Window & {
127
+ MSStream?: unknown;
128
+ };
120
129
 
121
130
  declare class ThemingService implements OnDestroy {
122
- private readonly platformId;
123
- private readonly isBrowser;
124
- private readonly _systemTheme;
125
- private readonly _applicationTheme;
131
+ readonly _systemTheme: _angular_core.WritableSignal<DeviceTheme>;
132
+ readonly _applicationTheme: _angular_core.WritableSignal<DeviceTheme | null>;
126
133
  readonly systemTheme: _angular_core.Signal<DeviceTheme>;
127
134
  readonly applicationTheme: _angular_core.Signal<DeviceTheme | null>;
128
135
  readonly activeTheme: _angular_core.Signal<DeviceTheme>;
136
+ private readonly platformId;
137
+ private readonly isBrowser;
129
138
  private readonly systemTheme$;
130
139
  private readonly applicationTheme$;
131
140
  private mediaQueryList?;
@@ -164,4 +173,4 @@ declare const SCROLL_LOCK_INSTANCE_IDENTIFIER = "scroll_lock_instance_";
164
173
  declare function uuidv4(): string;
165
174
 
166
175
  export { BREAKPOINTS, DesktopOS, DeviceTypeService, MobileOS, SCROLL_LOCK_INSTANCE_IDENTIFIER, ScrollLockService, ThemingService, WindowDimensionsService, uuidv4 };
167
- export type { DeviceOS, DeviceOrientationType, DeviceState, DeviceTheme, IScrollLockConfig, WindowDimensions };
176
+ export type { DeviceOS, DeviceOrientationType, DeviceState, DeviceTheme, IScrollLockConfig, LegacyScreenOrientation, MSStreamWindow, OperaCapableWindow, WindowDimensions };