@blotch/angular-lynx-native 22.3.2 → 22.3.3

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.
Files changed (53) hide show
  1. package/README.md +8 -2
  2. package/dist/android/project.d.ts +27 -3
  3. package/dist/android/project.d.ts.map +1 -1
  4. package/dist/android/project.js +80 -9
  5. package/dist/eject.d.ts.map +1 -1
  6. package/dist/eject.js +1 -0
  7. package/dist/files.d.ts +24 -0
  8. package/dist/files.d.ts.map +1 -0
  9. package/dist/files.js +41 -0
  10. package/dist/generate.d.ts +17 -2
  11. package/dist/generate.d.ts.map +1 -1
  12. package/dist/generate.js +68 -17
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +8 -1
  15. package/dist/ios/project.d.ts +21 -2
  16. package/dist/ios/project.d.ts.map +1 -1
  17. package/dist/ios/project.js +58 -2
  18. package/dist/options.d.ts +68 -0
  19. package/dist/options.d.ts.map +1 -1
  20. package/dist/options.js +27 -0
  21. package/dist/permissions.d.ts.map +1 -1
  22. package/dist/permissions.js +18 -3
  23. package/dist/plugins.d.ts +245 -0
  24. package/dist/plugins.d.ts.map +1 -0
  25. package/dist/plugins.js +1244 -0
  26. package/package.json +1 -1
  27. package/templates/android/README.md +12 -4
  28. package/templates/android/app/build.gradle.kts +27 -9
  29. package/templates/android/app/src/main/AndroidManifest.xml +5 -0
  30. package/templates/android/app/src/main/java/dev/angularlynx/shell/AngularLynxPlugins.kt +13 -0
  31. package/templates/android/app/src/main/java/dev/angularlynx/shell/AudioRecorderModule.kt +520 -0
  32. package/templates/android/app/src/main/java/dev/angularlynx/shell/EdgeToEdgeOverlay.kt +24 -0
  33. package/templates/android/app/src/main/java/dev/angularlynx/shell/EngineThreadHint.kt +156 -0
  34. package/templates/android/app/src/main/java/dev/angularlynx/shell/GeolocationModule.kt +557 -0
  35. package/templates/android/app/src/main/java/dev/angularlynx/shell/HostElementUI.kt +331 -0
  36. package/templates/android/app/src/main/java/dev/angularlynx/shell/ImagePickerModule.kt +143 -0
  37. package/templates/android/app/src/main/java/dev/angularlynx/shell/ImagePipeline.kt +83 -0
  38. package/templates/android/app/src/main/java/dev/angularlynx/shell/MainActivity.kt +153 -9
  39. package/templates/android/app/src/main/java/dev/angularlynx/shell/NetworkStatus.kt +121 -0
  40. package/templates/android/app/src/main/java/dev/angularlynx/shell/PermissionRequests.kt +10 -0
  41. package/templates/android/app/src/main/java/dev/angularlynx/shell/PhotoLibraryModule.kt +203 -16
  42. package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellApplication.kt +1 -8
  43. package/templates/android/app/src/main/java/dev/angularlynx/shell/ShellModule.kt +11 -1
  44. package/templates/android/app/src/main/res/xml/share_paths.xml +7 -2
  45. package/templates/ios/App/AngularLynxPlugins.swift +22 -0
  46. package/templates/ios/App/AnimationFrameRate.swift +66 -0
  47. package/templates/ios/App/AppDelegate.swift +3 -1
  48. package/templates/ios/App/AudioRecorderModule.swift +433 -0
  49. package/templates/ios/App/GeolocationModule.swift +455 -0
  50. package/templates/ios/App/HostElementUI.swift +270 -0
  51. package/templates/ios/App/ImagePickerModule.swift +160 -1
  52. package/templates/ios/App/LynxViewController.swift +66 -5
  53. package/templates/ios/App/NetworkStatus.swift +41 -0
package/dist/index.js CHANGED
@@ -96,7 +96,14 @@ export const buildNativeApp = async (options) => {
96
96
  ? `Using the ejected ${platform}/ project`
97
97
  : project.regenerated
98
98
  ? `Generated the ${platform} project`
99
- : `Reusing the generated ${platform} project (no config changes)`);
99
+ : project.pluginsUpdated
100
+ ? `Updated the native plugins in the generated ${platform} project`
101
+ : `Reusing the generated ${platform} project (no config changes)`);
102
+ // An ejected project has the plugins' files and registration eject wrote,
103
+ // and builds as it is.
104
+ if (project.ejected && app.nativePlugins.length > 0) {
105
+ (options.warn ?? log)(`nativePlugins doesn't apply to the ejected ${platform}/ project: it builds with the plugins' files and registration eject wrote into it. Change those in ${platform}/ itself.`);
106
+ }
100
107
  // On every build, not only when the project is generated, so a warning
101
108
  // isn't lost once the project is reused. An ejected project draws its
102
109
  // splash from its own files.
@@ -12,8 +12,10 @@ import { type ResolvedApp } from '../options.ts';
12
12
  * `storeReview`, the calendar module only in one with `calendar`, the
13
13
  * Sign in with Apple module only in one with `signInWithApple`, the
14
14
  * tracking module only in one with `permissions.tracking`, the NFC module
15
- * only in one with `permissions.nfc`, the motion module only in one with
16
- * `motion`, the Share Extension, its target and
15
+ * only in one with `permissions.nfc`, the audio recorder's module only in one
16
+ * with `permissions.microphone`, the geolocation module only in one with
17
+ * `permissions.location`, the motion module only in one with `motion`,
18
+ * the Share Extension, its target and
17
19
  * its module only in one with `shareTarget`, and the Wi-Fi module only in
18
20
  * one with `wifi`, with only the parts it turns on.
19
21
  */
@@ -29,12 +31,27 @@ export declare const IOS_CALENDAR_SOURCE = "App/CalendarModule.swift";
29
31
  * element, which only `signInWithApple` keeps.
30
32
  */
31
33
  export declare const IOS_APPLE_SIGN_IN_SOURCES: readonly ["App/AppleSignInModule.swift", "App/AppleSignInButton.swift"];
34
+ /**
35
+ * The module behind `LynxAudioRecorder`, which only `permissions.microphone`
36
+ * keeps.
37
+ */
38
+ export declare const IOS_AUDIO_RECORDER_SOURCE = "App/AudioRecorderModule.swift";
32
39
  /** The module behind `LynxNfc`, which only `permissions.nfc` keeps. */
33
40
  export declare const IOS_NFC_SOURCE = "App/NfcModule.swift";
41
+ /**
42
+ * LynxImagePicker's module, whose camera (`// angular-lynx:image-picker-camera`)
43
+ * only an app with `permissions.camera` keeps.
44
+ */
45
+ export declare const IOS_IMAGE_PICKER_SOURCE = "App/ImagePickerModule.swift";
34
46
  /** The module behind `LynxWifi`, which only `wifi` keeps. */
35
47
  export declare const IOS_WIFI_SOURCE = "App/WifiModule.swift";
36
48
  /** The module behind `LynxMotion`, which only `motion` keeps. */
37
49
  export declare const IOS_MOTION_SOURCE = "App/MotionModule.swift";
50
+ /**
51
+ * The module behind `LynxGeolocation`, which only `permissions.location`
52
+ * keeps.
53
+ */
54
+ export declare const IOS_GEOLOCATION_SOURCE = "App/GeolocationModule.swift";
38
55
  /**
39
56
  * The module behind `LynxTracking`, which only an app with
40
57
  * `permissions.tracking` keeps.
@@ -51,6 +68,8 @@ export declare const IOS_BIOMETRICS_SOURCES: readonly ["App/BiometricsModule.swi
51
68
  * which only an app with `filePicker` keeps.
52
69
  */
53
70
  export declare const IOS_FILE_PICKER_SOURCES: readonly ["App/FilePickerModule.swift"];
71
+ /** Where the plugins' Swift goes, a folder per plugin. */
72
+ export declare const IOS_PLUGIN_SOURCES = "App/Plugins";
54
73
  /**
55
74
  * The shell's photo library module, `AngularLynxPhotoLibrary`
56
75
  * (LynxPhotoLibrary), which only an app with `permissions.savePhotos` keeps.
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/ios/project.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,OAAO,EAGL,KAAK,WAAW,EAEjB,MAAM,eAAe,CAAC;AAkBvB;;;;;;;;;;;;;;;;GAgBG;AACH,wEAAwE;AACxE,eAAO,MAAM,0BAA0B,mCAAmC,CAAC;AAE3E,eAAO,MAAM,YAAY,EAAE,iBA6L1B,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AAErE,qEAAqE;AACrE,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,yBAAyB,yEAG5B,CAAC;AAEX,uEAAuE;AACvE,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,6DAA6D;AAC7D,eAAO,MAAM,eAAe,yBAAyB,CAAC;AAEtD,iEAAiE;AACjE,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,yCAA0C,CAAC;AAE9E;;;GAG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E1E;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,WAAW,KAAG,MAC2B,CAAC;AAE3E;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,SAAS,MAAM,EAAE,KAC3B,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CA6DjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAI,KAAK,WAAW,KAAG,MAiC7D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,+BAA+B,GAAI,KAAK,WAAW,KAAG,MAcrD,CAAC;AAgCf;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,EACf,KAAK,WAAW,KACf,MA6NF,CAAC"}
@@ -5,6 +5,7 @@ import { ANGLE_IOS_FRAMEWORKS } from "./frameworks.js";
5
5
  import { readPngSize } from "../png.js";
6
6
  import { APP_NAME_PLACEHOLDER, shortcutIdentifier, } from "../options.js";
7
7
  import { PERMISSION_MAP } from "../permissions.js";
8
+ import { checkIosResources, checkSwiftFileNames, checkSwiftTypes, copyPluginSources, iosPluginsSwift, readNativePlugins, } from "../plugins.js";
8
9
  import { IOS_IMAGE_SET, writeIosSplash } from "../splash.js";
9
10
  import { escapeXml, replaceMarker } from "../xml.js";
10
11
  const ORIENTATIONS = {
@@ -31,8 +32,10 @@ const ORIENTATIONS = {
31
32
  * `storeReview`, the calendar module only in one with `calendar`, the
32
33
  * Sign in with Apple module only in one with `signInWithApple`, the
33
34
  * tracking module only in one with `permissions.tracking`, the NFC module
34
- * only in one with `permissions.nfc`, the motion module only in one with
35
- * `motion`, the Share Extension, its target and
35
+ * only in one with `permissions.nfc`, the audio recorder's module only in one
36
+ * with `permissions.microphone`, the geolocation module only in one with
37
+ * `permissions.location`, the motion module only in one with `motion`,
38
+ * the Share Extension, its target and
36
39
  * its module only in one with `shareTarget`, and the Wi-Fi module only in
37
40
  * one with `wifi`, with only the parts it turns on.
38
41
  */
@@ -93,6 +96,20 @@ export const iosGenerator = {
93
96
  }
94
97
  writeIosSplash(dir, app, projectRoot);
95
98
  },
99
+ // The plugins' Swift, under App/ like the shell's own: App/ is a
100
+ // synchronized folder, which compiles every source file in it, so the
101
+ // project file needs no change. Their resources come with them, as the
102
+ // folder's: asset catalogs compiled with the shell's, other files copied
103
+ // into the app. The registration replaces the template's, which registers
104
+ // nothing.
105
+ writePlugins: (dir, app, projectRoot) => {
106
+ const plugins = readNativePlugins(app.nativePlugins, projectRoot);
107
+ checkSwiftFileNames(plugins, path.join(dir, 'App'));
108
+ checkSwiftTypes(plugins, path.join(dir, 'App'));
109
+ checkIosResources(plugins, path.join(dir, 'App'));
110
+ copyPluginSources(plugins, 'ios', path.join(dir, IOS_PLUGIN_SOURCES));
111
+ writeFileSync(path.join(dir, 'App/AngularLynxPlugins.swift'), iosPluginsSwift(plugins));
112
+ },
96
113
  leaveOut: (dir, features, app) => {
97
114
  // Face ID, Touch ID and the Keychain items behind them are only for an
98
115
  // app that says why it uses them: without NSFaceIDUsageDescription Face
@@ -144,6 +161,20 @@ export const iosGenerator = {
144
161
  if (!app.permissions.nfc) {
145
162
  removeTemplateFiles(dir, [IOS_NFC_SOURCE]);
146
163
  }
164
+ // App Store Connect flags an app whose code uses the microphone without
165
+ // NSMicrophoneUsageDescription (ITMS-90683), which only
166
+ // `permissions.microphone` writes, so the recorder goes with it.
167
+ // LynxViewController registers the module by name.
168
+ if (!app.permissions.microphone) {
169
+ removeTemplateFiles(dir, [IOS_AUDIO_RECORDER_SOURCE]);
170
+ }
171
+ // Core Location goes with its usage description, which only
172
+ // `permissions.location` writes: App Store Connect flags an app whose
173
+ // code uses Core Location without NSLocationWhenInUseUsageDescription
174
+ // (ITMS-90683), and iOS shows no prompt without it.
175
+ if (!app.permissions.location) {
176
+ removeTemplateFiles(dir, [IOS_GEOLOCATION_SOURCE]);
177
+ }
147
178
  // Saving to the photo library is only for an app that says why, with
148
179
  // its own reason for the prompt. Every app has a reason for the share
149
180
  // sheet's Save Image (see infoPlistEntries), but App Review asks about
@@ -157,6 +188,14 @@ export const iosGenerator = {
157
188
  // The location code especially, which App Store Connect flags in an app
158
189
  // without a location usage description.
159
190
  leaveOutWifi(dir, app.wifi, IOS_WIFI_SOURCE);
191
+ // LynxImagePicker's camera goes with NSCameraUsageDescription, which
192
+ // only `permissions.camera` writes: App Store Connect flags an app whose
193
+ // code uses the camera without it (ITMS-90683), and iOS ends one that
194
+ // opens the camera without it. Every other app keeps only the library
195
+ // picker (`// angular-lynx:image-picker-camera`).
196
+ if (!app.permissions.camera) {
197
+ removeMarkedLines(path.join(dir, IOS_IMAGE_PICKER_SOURCE), 'image-picker-camera');
198
+ }
160
199
  // An app that doesn't read the motion sensors (angular.json's `motion`)
161
200
  // ships no Core Motion or compass code it never calls. LynxViewController
162
201
  // registers the module by name, so the shell builds without it.
@@ -196,12 +235,27 @@ export const IOS_APPLE_SIGN_IN_SOURCES = [
196
235
  'App/AppleSignInModule.swift',
197
236
  'App/AppleSignInButton.swift',
198
237
  ];
238
+ /**
239
+ * The module behind `LynxAudioRecorder`, which only `permissions.microphone`
240
+ * keeps.
241
+ */
242
+ export const IOS_AUDIO_RECORDER_SOURCE = 'App/AudioRecorderModule.swift';
199
243
  /** The module behind `LynxNfc`, which only `permissions.nfc` keeps. */
200
244
  export const IOS_NFC_SOURCE = 'App/NfcModule.swift';
245
+ /**
246
+ * LynxImagePicker's module, whose camera (`// angular-lynx:image-picker-camera`)
247
+ * only an app with `permissions.camera` keeps.
248
+ */
249
+ export const IOS_IMAGE_PICKER_SOURCE = 'App/ImagePickerModule.swift';
201
250
  /** The module behind `LynxWifi`, which only `wifi` keeps. */
202
251
  export const IOS_WIFI_SOURCE = 'App/WifiModule.swift';
203
252
  /** The module behind `LynxMotion`, which only `motion` keeps. */
204
253
  export const IOS_MOTION_SOURCE = 'App/MotionModule.swift';
254
+ /**
255
+ * The module behind `LynxGeolocation`, which only `permissions.location`
256
+ * keeps.
257
+ */
258
+ export const IOS_GEOLOCATION_SOURCE = 'App/GeolocationModule.swift';
205
259
  /**
206
260
  * The module behind `LynxTracking`, which only an app with
207
261
  * `permissions.tracking` keeps.
@@ -218,6 +272,8 @@ export const IOS_BIOMETRICS_SOURCES = ['App/BiometricsModule.swift'];
218
272
  * which only an app with `filePicker` keeps.
219
273
  */
220
274
  export const IOS_FILE_PICKER_SOURCES = ['App/FilePickerModule.swift'];
275
+ /** Where the plugins' Swift goes, a folder per plugin. */
276
+ export const IOS_PLUGIN_SOURCES = 'App/Plugins';
221
277
  /**
222
278
  * The shell's photo library module, `AngularLynxPhotoLibrary`
223
279
  * (LynxPhotoLibrary), which only an app with `permissions.savePhotos` keeps.
package/dist/options.d.ts CHANGED
@@ -142,9 +142,71 @@ export type NativeAppOptions = {
142
142
  * first screen is drawn (see {@link SplashOptions}).
143
143
  */
144
144
  readonly splash?: SplashOptions;
145
+ /**
146
+ * The app's native plugins: each a folder, relative to the project root, of
147
+ * the Swift and Kotlin it adds to the generated projects, and the modules
148
+ * and elements to register from them (see plugins.ts).
149
+ */
150
+ readonly nativePlugins?: readonly NativePluginOptions[];
145
151
  readonly ios?: IosOptions;
146
152
  readonly android?: AndroidOptions;
147
153
  };
154
+ /**
155
+ * One of angular.json's `nativePlugins`: a folder of the app's own Swift and
156
+ * Kotlin, and what each platform registers from it. In angular.json, beside
157
+ * the app's other options, as Angular's `assets` and `fileReplacements` take
158
+ * objects: the builder's schema checks it and editors complete it, and
159
+ * `configurations` override it as they do any option.
160
+ *
161
+ * Each platform's keys are those of Lynx Autolink's `lynx.lib.json`
162
+ * (`platforms.ios.sourceDir`, `platforms.android.packageName` and
163
+ * `sourceDir`), so the same keys mean the same things, plus `modules` and
164
+ * `elements`, which name the classes to register: Autolink finds them from
165
+ * markers in the sources (`@LynxNativeModule`, `@LynxElement`), which Swift
166
+ * can't carry. A plugin isn't an Autolink library, so it has no
167
+ * `lynx.lib.json` of its own: its sources are compiled into the app, with no
168
+ * `build.gradle` or podspec, which Lynx's Autolink tools require of a folder
169
+ * with one.
170
+ */
171
+ export type NativePluginOptions = {
172
+ /** The plugin's folder, relative to the project root: `native/greeter`. */
173
+ readonly path: string;
174
+ readonly ios?: NativePluginPlatform;
175
+ readonly android?: NativePluginPlatform & {
176
+ /**
177
+ * The Java package the plugin's classes are in, as Autolink's
178
+ * `packageName`. A class named without one is in this package.
179
+ */
180
+ readonly packageName?: string;
181
+ /**
182
+ * The plugin's Android resources (`values/`, `values-night/`,
183
+ * `drawable/`, `font/`, …), relative to the plugin's folder, as a
184
+ * module's `src/main/res` is laid out. Defaults to `res` in the source
185
+ * folder when that folder is there. Autolink has no key for it: an
186
+ * Autolink library is a Gradle module with resources of its own.
187
+ */
188
+ readonly resDir?: string;
189
+ };
190
+ };
191
+ /** One platform's half of a native plugin. */
192
+ export type NativePluginPlatform = {
193
+ /**
194
+ * The folder of source files, relative to the plugin's folder, copied into
195
+ * the generated project: Swift on iOS, Kotlin and Java on Android. Defaults
196
+ * to `ios` or `android`, as Autolink's does, when that folder is there.
197
+ */
198
+ readonly sourceDir?: string;
199
+ /**
200
+ * Each native module, as the name the app's code calls it by
201
+ * (`getNativeModule('<name>')`) to its class.
202
+ */
203
+ readonly modules?: Readonly<Record<string, string>>;
204
+ /**
205
+ * Each native element, as the tag templates use (with a hyphen, as a
206
+ * custom element's) to its `LynxUI` class.
207
+ */
208
+ readonly elements?: Readonly<Record<string, string>>;
209
+ };
148
210
  /**
149
211
  * The launch screen: an image centered on a color, from the tap on the app's
150
212
  * icon until the app hides it (the runtime's `provideSplashScreen()`), or
@@ -394,6 +456,12 @@ export type ResolvedApp = {
394
456
  readonly splash: ResolvedSplash;
395
457
  /** `MyApp`: the iOS product (and so .app/.ipa) name. */
396
458
  readonly productName: string;
459
+ /**
460
+ * {@link NativeAppOptions.nativePlugins}, as listed: compact() would drop
461
+ * a platform given as `{}`, which takes its source folder by the default,
462
+ * where one left out adds nothing.
463
+ */
464
+ readonly nativePlugins: readonly NativePluginOptions[];
397
465
  /** `my-app`: the base name of Android artifacts. */
398
466
  readonly artifactName: string;
399
467
  readonly ios: IosOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,8DAA8D;IAC9D,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,WAAW,CAAC;IAC7C,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;;;;;OASG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAC;IAClD;;;;;OAKG;IACH,QA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 const PLUGIN_EXAMPLE = '{ "path": "native/greeter", "ios": { "modules": { "Greeter": "GreeterModule" } } }';
78
80
  /**
79
81
  * Applies defaults and validates the options, so the generators never see a
80
82
  * value that would produce a project Xcode or Gradle rejects later with a
@@ -190,6 +192,30 @@ export const resolveAppOptions = (rawOptions, defaults) => {
190
192
  !IOS_EXPORT_METHODS.includes(exportMethod)) {
191
193
  throw new NativeConfigError(`ios.export "${exportMethod}" is not valid. Use ${IOS_EXPORT_METHODS.join(' or ')}.`);
192
194
  }
195
+ // Only the list's shape here: each entry is read when the project is
196
+ // generated (readNativePlugins), which has the project root to find its
197
+ // folder in. Read from the options as given: compact() drops an empty
198
+ // object, which would then pass as no plugins rather than be rejected, and
199
+ // an empty platform, which isn't the same as none.
200
+ const nativePlugins = rawOptions.nativePlugins ?? [];
201
+ if (!Array.isArray(nativePlugins)) {
202
+ throw new NativeConfigError(`nativePlugins must list the app's plugins, e.g. [${PLUGIN_EXAMPLE}].`);
203
+ }
204
+ for (const entry of nativePlugins) {
205
+ // The folder alone was the entry while each plugin had a file of its own
206
+ // describing it. Angular's schema check stops one first in ng build, but
207
+ // not a caller of the builder's API.
208
+ if (typeof entry === 'string') {
209
+ throw new NativeConfigError(`nativePlugins entry "${entry}" is a folder alone. Give each plugin as an object with its folder as path and what it registers on each platform, e.g. ${PLUGIN_EXAMPLE}.`);
210
+ }
211
+ if (typeof entry !== 'object' ||
212
+ entry === null ||
213
+ Array.isArray(entry) ||
214
+ typeof entry.path !== 'string' ||
215
+ !entry.path) {
216
+ throw new NativeConfigError(`nativePlugins must give each plugin as an object with its folder, relative to the project root, as path, e.g. ${PLUGIN_EXAMPLE}.`);
217
+ }
218
+ }
193
219
  const productName = name.replace(/[^A-Za-z0-9]/g, '') || 'App';
194
220
  const artifactName = name
195
221
  .toLowerCase()
@@ -219,6 +245,7 @@ export const resolveAppOptions = (rawOptions, defaults) => {
219
245
  icon: options.icon,
220
246
  splash,
221
247
  productName,
248
+ nativePlugins: nativePlugins,
222
249
  artifactName,
223
250
  ios: options.ios ?? {},
224
251
  android,
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAEN;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,UAAU,EACV;IACE,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C,CA0GF,CAAC"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,GACN;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC,CAAC;AAEN;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CACjC,UAAU,EACV;IACE,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C,CAyHF,CAAC"}
@@ -14,6 +14,12 @@ export const PERMISSION_MAP = {
14
14
  android: ['android.permission.RECORD_AUDIO'],
15
15
  androidFeatures: ['android.hardware.microphone'],
16
16
  },
17
+ // Where the phone is, while the app is in use, through LynxGeolocation.
18
+ // iOS asks with this reason the first time the app asks for the location.
19
+ // Android asks at runtime for both, and Android 12 and later let the
20
+ // person grant only the coarse one ("Approximate"). The shells'
21
+ // geolocation module is only in apps that ask for this: App Store Connect
22
+ // flags an app whose code uses Core Location without the reason.
17
23
  location: {
18
24
  ios: ['NSLocationWhenInUseUsageDescription'],
19
25
  android: [
@@ -33,11 +39,20 @@ export const PERMISSION_MAP = {
33
39
  },
34
40
  // Adding to the photo library only, as the share sheet's Save Image and
35
41
  // LynxPhotoLibrary do. The shells' photo library module is only in apps
36
- // that ask for this. Android 10 and later need no permission for it, and
37
- // LynxPhotoLibrary saves nothing before that.
42
+ // that ask for this. Android 10 and later let an app add its own media
43
+ // without a permission; Android 7 to 9 need WRITE_EXTERNAL_STORAGE, which
44
+ // the module asks for as it first saves there. READ_EXTERNAL_STORAGE goes
45
+ // with it: Android 8 and 9 mount shared storage writable for an app only
46
+ // when it holds both, so with WRITE alone a save works until the app
47
+ // restarts. Declared here, it also stops Android adding READ by itself,
48
+ // uncapped. Both are capped at Android 9, so newer phones neither list nor
49
+ // grant them.
38
50
  savePhotos: {
39
51
  ios: ['NSPhotoLibraryAddUsageDescription'],
40
- android: [],
52
+ android: [
53
+ { name: 'android.permission.READ_EXTERNAL_STORAGE', maxSdkVersion: 28 },
54
+ { name: 'android.permission.WRITE_EXTERNAL_STORAGE', maxSdkVersion: 28 },
55
+ ],
41
56
  },
42
57
  contacts: {
43
58
  ios: ['NSContactsUsageDescription'],
@@ -0,0 +1,245 @@
1
+ import { type ListedFile } from './files.ts';
2
+ import { type NativePluginOptions } from './options.ts';
3
+ /**
4
+ * The file that described a native plugin, in its folder, before each
5
+ * plugin was described in angular.json's `nativePlugins` (issue #1051). A
6
+ * folder that still has one is refused, so what it says isn't left unread
7
+ * without a word: the build would leave out the modules and elements it
8
+ * names, which the app would find missing only when it runs.
9
+ */
10
+ export declare const LEGACY_PLUGIN_MANIFEST = "angular-lynx-plugin.json";
11
+ /** A plugin's platform, checked, with its sources as an absolute path. */
12
+ export type ResolvedPluginPlatform = {
13
+ readonly sourceDir?: string;
14
+ readonly modules: readonly {
15
+ readonly name: string;
16
+ readonly className: string;
17
+ }[];
18
+ readonly elements: readonly {
19
+ readonly tag: string;
20
+ readonly className: string;
21
+ }[];
22
+ };
23
+ /** A plugin's Android platform, checked, with its folders as absolute paths. */
24
+ export type ResolvedAndroidPlatform = ResolvedPluginPlatform & {
25
+ readonly resDir?: string;
26
+ };
27
+ /** A plugin as the generators use it. */
28
+ export type NativePlugin = {
29
+ /**
30
+ * The folder's name, which the copied sources go under in the generated
31
+ * project, so two plugins' files can't overwrite each other.
32
+ */
33
+ readonly name: string;
34
+ /** The plugin's folder. */
35
+ readonly dir: string;
36
+ readonly ios: ResolvedPluginPlatform;
37
+ readonly android: ResolvedAndroidPlatform;
38
+ };
39
+ type PlatformName = 'ios' | 'android';
40
+ /**
41
+ * The tags something else already draws, which a plugin's element would
42
+ * replace without a word: a behavior added later wins on Android.
43
+ *
44
+ * - The runtime's `LYNX_ELEMENT_TAGS` (`packages/runtime/src/lib/lynx-document/element-tags.ts`),
45
+ * which a test keeps this copy of.
46
+ * - Lynx's own on Android (`BuiltInUIRegistry` in the 4.1.0 AAR) that the
47
+ * runtime doesn't create: `component`, `list-container`, `inline-text`,
48
+ * `inline-image` and `bounce-view`.
49
+ * - XElement's `animax-view`, which the shells leave out but the name is
50
+ * still XElement's.
51
+ *
52
+ * Tags starting with {@link RESERVED_TAG_PREFIXES} are refused too.
53
+ */
54
+ export declare const RESERVED_TAGS: ReadonlySet<string>;
55
+ /**
56
+ * Reads and checks the plugins angular.json's `nativePlugins` lists, each a
57
+ * folder relative to the project root and what each platform registers from
58
+ * it. What's wrong is caught here, with the entry's folder in the message:
59
+ * the Swift and Kotlin the generators write from an entry would otherwise
60
+ * fail in Xcode or Gradle, far from it.
61
+ *
62
+ * @param entries - `nativePlugins` from the builder options.
63
+ * @param projectRoot - The Angular project's root folder.
64
+ * @throws NativeConfigError for anything a build would fail on, or a name
65
+ * that would replace one of Lynx's or the shell's.
66
+ */
67
+ export declare const readNativePlugins: (entries: readonly NativePluginOptions[], projectRoot: string) => readonly NativePlugin[];
68
+ /**
69
+ * Every file and folder the plugins' generated code comes from, sorted:
70
+ * everything under each plugin's folder. The folders too, empty ones
71
+ * included, as the resource checks refuse a folder Android reads nothing
72
+ * from. Call it once readNativePlugins has found each folder. What each entry
73
+ * registers is in angular.json, which the caller hashes with these.
74
+ *
75
+ * @param entries - `nativePlugins` from the builder options.
76
+ * @param projectRoot - The Angular project's root folder.
77
+ */
78
+ export declare const pluginInputFiles: (entries: readonly NativePluginOptions[], projectRoot: string) => readonly ListedFile[];
79
+ /**
80
+ * Copies each plugin's sources for `platform` into `<into>/<name>`, after
81
+ * deleting what an earlier copy left there, with copyFiles. On Android, the
82
+ * resource folder is left out, as copyPluginResources copies it.
83
+ *
84
+ * @param plugins - From readNativePlugins.
85
+ * @param platform - Which half of each plugin to copy.
86
+ * @param into - The folder, inside the generated project, the build compiles
87
+ * every source file under.
88
+ */
89
+ export declare const copyPluginSources: (plugins: readonly NativePlugin[], platform: PlatformName, into: string) => void;
90
+ /** A type a Swift or Objective-C file declares at its top level. */
91
+ export type SwiftType = {
92
+ readonly name: string;
93
+ /**
94
+ * Declared `private` or `fileprivate`, so seen only in its file: two files
95
+ * can each have one of a name, but not one beside a type the whole module
96
+ * sees, which Swift calls an invalid redeclaration.
97
+ */
98
+ readonly fileLocal: boolean;
99
+ };
100
+ /**
101
+ * The types a Swift or Objective-C file declares at its top level: `class`,
102
+ * `struct`, `enum`, `protocol`, `actor` and `typealias` at the start of a
103
+ * line, after any attributes and modifiers, and a class's primary
104
+ * `@interface`. Swift compiles every file of the app into one module, so two
105
+ * such types of one name fail the build, unless both are file-local. An
106
+ * Objective-C class extension (`@interface Helper ()`) or category
107
+ * (`@interface Helper (Extra)`) adds to a class declared elsewhere, as a
108
+ * `.m` does to its header's, so it declares nothing.
109
+ *
110
+ * A name the file declares twice is one type: the file is either declaring it
111
+ * in each branch of an `#if`, of which only one compiles, or failing in the
112
+ * compiler on its own, which names the file.
113
+ *
114
+ * @param source - The file's text.
115
+ * @param options - Whether the language's block comments nest: Swift's do,
116
+ * and Objective-C's, which are C's, don't.
117
+ */
118
+ export declare const swiftTypes: (source: string, { nested }?: {
119
+ readonly nested?: boolean;
120
+ }) => readonly SwiftType[];
121
+ /**
122
+ * Checks that no plugin's Swift declares a type the iOS shell or another
123
+ * plugin declares: the app's sources are one Swift module, and Xcode's
124
+ * "invalid redeclaration" names neither the plugin nor the fix. File-local
125
+ * types of one name in different files pass, as they do in Swift.
126
+ *
127
+ * @param plugins - From readNativePlugins.
128
+ * @param appDir - The generated project's App/ folder, with the shell's
129
+ * sources and not yet the plugins'.
130
+ * @throws NativeConfigError naming the plugin's file and the type.
131
+ */
132
+ export declare const checkSwiftTypes: (plugins: readonly NativePlugin[], appDir: string) => void;
133
+ /**
134
+ * Checks that no two Swift files of the app, the shell's and the plugins',
135
+ * have one name: the compiler takes a file name once in a module ("filename
136
+ * used twice"), wherever the files are, and, with names that differ only in
137
+ * capitals, writes their objects over each other on a Mac's disk. Objective-C
138
+ * files may share a name, as Xcode gives each object a name of its own.
139
+ *
140
+ * @param plugins - From readNativePlugins.
141
+ * @param appDir - The generated project's App/ folder, with the shell's
142
+ * sources at its top.
143
+ * @throws NativeConfigError naming the plugin's file and the other.
144
+ */
145
+ export declare const checkSwiftFileNames: (plugins: readonly NativePlugin[], appDir: string) => void;
146
+ /**
147
+ * Checks that no plugin's Kotlin or Java is in the Android shell's package,
148
+ * where a class of the same name as one of the shell's would fail the build.
149
+ *
150
+ * @param plugins - From readNativePlugins.
151
+ * @throws NativeConfigError naming the plugin's file.
152
+ */
153
+ export declare const checkJvmPackages: (plugins: readonly NativePlugin[]) => void;
154
+ /** A resource a plugin or the shell defines, as `R` names it. */
155
+ export type AndroidResource = {
156
+ /** `R`'s inner class: `color`, `style`, `drawable`, … */
157
+ readonly type: string;
158
+ /** `R`'s field, with a style's dots as underscores (`R.style.Theme_App`). */
159
+ readonly name: string;
160
+ /** The file that defines it, as messages name it. */
161
+ readonly file: string;
162
+ };
163
+ /**
164
+ * Every resource in an Android resource folder, as Gradle's merger and
165
+ * `R` see them: a file's by its folder's type and its name before the
166
+ * first dot (`drawable-hdpi/photo.9.png` is `drawable/photo`), and each
167
+ * value in a values file by its element. What Gradle would skip or refuse is
168
+ * refused here, with the file's name.
169
+ *
170
+ * @param resDir - The resource folder, laid out as `src/main/res`.
171
+ * @param label - The folder as messages name it.
172
+ * @throws NativeConfigError for a file or folder Android reads no
173
+ * resources from.
174
+ */
175
+ export declare const androidResources: (resDir: string, label: string) => readonly AndroidResource[];
176
+ /**
177
+ * Checks that no plugin's Android resources define one the shell or another
178
+ * plugin defines. Gradle merges every resource folder of the app into one
179
+ * `R`, so the same name would fail the build as a duplicate, or, across
180
+ * qualifiers (`values` and `values-night`), quietly give the app one
181
+ * plugin's resource in the other's place. A plugin may define a resource
182
+ * again under its own qualifiers, which is how it has a night color.
183
+ *
184
+ * @param plugins - From readNativePlugins.
185
+ * @param appDir - The generated project's `app/` folder, with the shell's
186
+ * resources (`src/main/res`, `src/debug/res`) and the `resValue`s in its
187
+ * `build.gradle.kts`.
188
+ * @throws NativeConfigError naming the plugin's file and the resource.
189
+ */
190
+ export declare const checkAndroidResources: (plugins: readonly NativePlugin[], appDir: string) => void;
191
+ /**
192
+ * Copies each plugin's Android resource folder to `<into>/<name>`, after
193
+ * deleting what an earlier copy left there. Each is a resource folder of the
194
+ * app module of its own (the template's `build.gradle.kts` adds every folder
195
+ * in `into`), so a plugin's `values/colors.xml` sits beside the shell's file
196
+ * of that name rather than over it. Links are copied as the files they
197
+ * point at, with copyFiles.
198
+ *
199
+ * @param plugins - From readNativePlugins and checkAndroidResources.
200
+ * @param into - The folder, inside the generated project, Gradle reads the
201
+ * plugins' resource folders from.
202
+ */
203
+ export declare const copyPluginResources: (plugins: readonly NativePlugin[], into: string) => void;
204
+ /**
205
+ * Checks that no plugin's iOS resources take a name the shell's or another
206
+ * plugin's have. App/ is a synchronized folder, so Xcode builds whatever the
207
+ * plugins' folders hold: their asset catalogs (`.xcassets`) are compiled
208
+ * with the shell's into the app's one `Assets.car`, where two assets of a
209
+ * name leave one, with only a warning; and every other file that isn't a
210
+ * source (a font, a JSON file, a `.lproj` folder's strings) is copied to the
211
+ * top of the app, out of its folders, where two files of a name, or one
212
+ * of the name of a file Xcode writes there (`Assets.car`, `PkgInfo`), fail
213
+ * the build with "Multiple commands produce".
214
+ *
215
+ * @param plugins - From readNativePlugins.
216
+ * @param appDir - The generated project's App/ folder. Only its own catalogs
217
+ * and files are the shell's: a copy of the plugins may be in App/Plugins.
218
+ * @throws NativeConfigError naming the plugin's file and the name.
219
+ */
220
+ export declare const checkIosResources: (plugins: readonly NativePlugin[], appDir: string) => void;
221
+ /**
222
+ * App/AngularLynxPlugins.swift: registers the plugins' modules and elements
223
+ * with the LynxView's config, which LynxViewController calls before it
224
+ * builds the view, after the shell's own. Per view rather than in
225
+ * LynxComponentRegistry, as Android's are with the LynxViewBuilder.
226
+ *
227
+ * A module's param is an `AngularLynxPluginHost`, which holds the view
228
+ * controller weakly: Lynx keeps a module's param for as long as the config
229
+ * (`LynxModuleWrapper.param` is strong), and the controller keeps the config
230
+ * through its LynxView, so the controller itself would never be freed.
231
+ *
232
+ * @param plugins - From readNativePlugins.
233
+ */
234
+ export declare const iosPluginsSwift: (plugins: readonly NativePlugin[]) => string;
235
+ /**
236
+ * AngularLynxPlugins.kt: registers the plugins' modules and elements with
237
+ * the LynxViewBuilder MainActivity builds its LynxView with, after the
238
+ * shell's own. A module gets the activity as its param, as the shell's own
239
+ * modules that need one do.
240
+ *
241
+ * @param plugins - From readNativePlugins.
242
+ */
243
+ export declare const androidPluginsKotlin: (plugins: readonly NativePlugin[]) => string;
244
+ export {};
245
+ //# sourceMappingURL=plugins.d.ts.map