@rdlabo/ionic-angular-kit 0.0.22 → 0.0.23

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.
@@ -0,0 +1,32 @@
1
+ import { provideEnvironmentInitializer, inject, ApplicationRef } from '@angular/core';
2
+ import { Router, NavigationEnd } from '@angular/router';
3
+ import { LiveUpdate } from '@capawesome/capacitor-live-update';
4
+ import { Capacitor } from '@capacitor/core';
5
+ import { firstValueFrom, filter, take } from 'rxjs';
6
+
7
+ /**
8
+ * Marks a native Live Update bundle healthy after Angular is stable and the
9
+ * first route has rendered. Web builds are unaffected.
10
+ */
11
+ function provideLiveUpdateReadiness() {
12
+ return provideEnvironmentInitializer(() => {
13
+ if (!Capacitor.isNativePlatform())
14
+ return;
15
+ const appRef = inject(ApplicationRef);
16
+ const router = inject(Router);
17
+ void Promise.all([
18
+ firstValueFrom(appRef.isStable.pipe(filter(Boolean), take(1))),
19
+ firstValueFrom(router.events.pipe(filter((event) => event instanceof NavigationEnd), take(1))),
20
+ ])
21
+ .then(() => new Promise((resolve) => requestAnimationFrame(() => resolve())))
22
+ .then(() => LiveUpdate.ready())
23
+ .catch((error) => console.error('Failed to mark the Live Update bundle as ready.', error));
24
+ });
25
+ }
26
+
27
+ /**
28
+ * Generated bundle index. Do not edit.
29
+ */
30
+
31
+ export { provideLiveUpdateReadiness };
32
+ //# sourceMappingURL=rdlabo-ionic-angular-kit-live-update.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rdlabo-ionic-angular-kit-live-update.mjs","sources":["../../../projects/kit/live-update/src/live-update-readiness.provider.ts","../../../projects/kit/live-update/src/rdlabo-ionic-angular-kit-live-update.ts"],"sourcesContent":["import { ApplicationRef, inject, provideEnvironmentInitializer, type EnvironmentProviders } from '@angular/core';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { LiveUpdate } from '@capawesome/capacitor-live-update';\nimport { Capacitor } from '@capacitor/core';\nimport { filter, firstValueFrom, take } from 'rxjs';\n\n/**\n * Marks a native Live Update bundle healthy after Angular is stable and the\n * first route has rendered. Web builds are unaffected.\n */\nexport function provideLiveUpdateReadiness(): EnvironmentProviders {\n return provideEnvironmentInitializer(() => {\n if (!Capacitor.isNativePlatform()) return;\n\n const appRef = inject(ApplicationRef);\n const router = inject(Router);\n void Promise.all([\n firstValueFrom(appRef.isStable.pipe(filter(Boolean), take(1))),\n firstValueFrom(\n router.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n take(1),\n ),\n ),\n ])\n .then(() => new Promise<void>((resolve) => requestAnimationFrame(() => resolve())))\n .then(() => LiveUpdate.ready())\n .catch((error) => console.error('Failed to mark the Live Update bundle as ready.', error));\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAMA;;;AAGG;SACa,0BAA0B,GAAA;IACxC,OAAO,6BAA6B,CAAC,MAAK;AACxC,QAAA,IAAI,CAAC,SAAS,CAAC,gBAAgB,EAAE;YAAE;AAEnC,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC7B,KAAK,OAAO,CAAC,GAAG,CAAC;AACf,YAAA,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9D,cAAc,CACZ,MAAM,CAAC,MAAM,CAAC,IAAI,CAChB,MAAM,CAAC,CAAC,KAAK,KAAK,KAAK,YAAY,aAAa,CAAC,EACjD,IAAI,CAAC,CAAC,CAAC,CACR,CACF;SACF;aACE,IAAI,CAAC,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,KAAK,qBAAqB,CAAC,MAAM,OAAO,EAAE,CAAC,CAAC;aACjF,IAAI,CAAC,MAAM,UAAU,CAAC,KAAK,EAAE;AAC7B,aAAA,KAAK,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;AAC9F,IAAA,CAAC,CAAC;AACJ;;AC7BA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rdlabo/ionic-angular-kit",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^21.0.0",
6
6
  "@angular/core": "^21.0.0",
@@ -9,6 +9,7 @@
9
9
  "@ionic/angular": "^8.0.0",
10
10
  "@ionic/storage-angular": "^4.0.0",
11
11
  "@capacitor/core": ">=6.0.0 <9.0.0",
12
+ "@capawesome/capacitor-live-update": ">=6.0.0 <9.0.0",
12
13
  "@capacitor/haptics": ">=6.0.0 <9.0.0",
13
14
  "@capacitor/keyboard": ">=6.0.0 <9.0.0",
14
15
  "@capacitor/network": ">=6.0.0 <9.0.0",
@@ -22,6 +23,9 @@
22
23
  "rxjs": "^7.8.0"
23
24
  },
24
25
  "peerDependenciesMeta": {
26
+ "@capawesome/capacitor-live-update": {
27
+ "optional": true
28
+ },
25
29
  "@capacitor/preferences": {
26
30
  "optional": true
27
31
  },
@@ -67,6 +71,10 @@
67
71
  "types": "./types/rdlabo-ionic-angular-kit-auth-firebase-social.d.ts",
68
72
  "default": "./fesm2022/rdlabo-ionic-angular-kit-auth-firebase-social.mjs"
69
73
  },
74
+ "./live-update": {
75
+ "types": "./types/rdlabo-ionic-angular-kit-live-update.d.ts",
76
+ "default": "./fesm2022/rdlabo-ionic-angular-kit-live-update.mjs"
77
+ },
70
78
  "./printer": {
71
79
  "types": "./types/rdlabo-ionic-angular-kit-printer.d.ts",
72
80
  "default": "./fesm2022/rdlabo-ionic-angular-kit-printer.mjs"
@@ -0,0 +1,9 @@
1
+ import { EnvironmentProviders } from '@angular/core';
2
+
3
+ /**
4
+ * Marks a native Live Update bundle healthy after Angular is stable and the
5
+ * first route has rendered. Web builds are unaffected.
6
+ */
7
+ declare function provideLiveUpdateReadiness(): EnvironmentProviders;
8
+
9
+ export { provideLiveUpdateReadiness };