@absolutejs/absolute 0.20.0-beta.26 → 0.20.0-beta.28

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.
@@ -634,15 +634,23 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
634
634
  return;
635
635
  if (!object2(value))
636
636
  throw new TypeError(`${field} must be an object.`);
637
- const { privacyAccessedApis, pushNotifications, usageDescriptions } = value;
637
+ const {
638
+ privacyAccessedApis,
639
+ pushNotifications,
640
+ systemBars,
641
+ usageDescriptions
642
+ } = value;
638
643
  if (pushNotifications !== undefined && pushNotifications !== true)
639
644
  throw new TypeError(`${field}.pushNotifications must be true.`);
645
+ if (systemBars !== undefined && systemBars !== true)
646
+ throw new TypeError(`${field}.systemBars must be true.`);
640
647
  if (usageDescriptions !== undefined && (!Array.isArray(usageDescriptions) || !usageDescriptions.every((purpose) => typeof purpose === "string" && IOS_USAGE_DESCRIPTIONS.has(purpose))))
641
648
  throw new TypeError(`${field}.usageDescriptions contains an unsupported purpose.`);
642
649
  const privacy = iosPrivacyAccessedApis(privacyAccessedApis, `${field}.privacyAccessedApis`);
643
650
  return {
644
651
  ...privacy === undefined ? {} : { privacyAccessedApis: privacy },
645
652
  ...pushNotifications === true ? { pushNotifications: true } : {},
653
+ ...systemBars === true ? { systemBars: true } : {},
646
654
  ...usageDescriptions === undefined ? {} : { usageDescriptions: [...usageDescriptions] }
647
655
  };
648
656
  }, parseProvider = (name, value) => {
@@ -699,6 +707,7 @@ var DEVICES_PACKAGE = "@absolutejs/devices", CAPACITOR_ADAPTER = "@absolutejs/de
699
707
  return reasons ? [{ api, reasons: [...reasons].sort() }] : [];
700
708
  }),
701
709
  iosPushNotifications: plan.capabilities.some((name) => plan.providers[name]?.native?.ios?.pushNotifications === true),
710
+ iosSystemBars: plan.capabilities.some((name) => plan.providers[name]?.native?.ios?.systemBars === true),
702
711
  iosUsageDescriptions: [
703
712
  ...new Set(plan.capabilities.flatMap((name) => plan.providers[name]?.native?.ios?.usageDescriptions ?? []))
704
713
  ].sort()
@@ -6052,8 +6061,18 @@ var configureIos2 = async (config, plan) => {
6052
6061
  const path = join16(config.nativeProjectDirectory, "ios/App/App/Info.plist");
6053
6062
  const source = await readFile15(path, "utf8");
6054
6063
  const requirements = absoluteDeviceNativeRequirements(plan);
6055
- const content = requirements.iosUsageDescriptions.map((purpose) => ` <key>${IOS_KEYS[purpose]}</key>
6064
+ const existingSystemBars = source.match(/<key>UIViewControllerBasedStatusBarAppearance<\/key>\s*<(true|false)\s*\/>/u);
6065
+ const ownedStart = source.indexOf(START_MARKER2);
6066
+ const ownedEnd = source.indexOf(END_MARKER2);
6067
+ const ownsSystemBars = ownedStart >= 0 && ownedEnd > ownedStart && source.slice(ownedStart, ownedEnd).includes("UIViewControllerBasedStatusBarAppearance");
6068
+ if (requirements.iosSystemBars && existingSystemBars?.[1] === "false" && !ownsSystemBars)
6069
+ throw new TypeError("iOS system bars require UIViewControllerBasedStatusBarAppearance to be true.");
6070
+ const usageContent = requirements.iosUsageDescriptions.map((purpose) => ` <key>${IOS_KEYS[purpose]}</key>
6056
6071
  <string>${escapeXml2(iosDescription(config.appName, purpose))}</string>`).join(`
6072
+ `);
6073
+ const systemBarsContent = requirements.iosSystemBars && (existingSystemBars === null || ownsSystemBars) ? ` <key>UIViewControllerBasedStatusBarAppearance</key>
6074
+ <true/>` : "";
6075
+ const content = [usageContent, systemBarsContent].filter(Boolean).join(`
6057
6076
  `);
6058
6077
  const region = content ? ` ${START_MARKER2}
6059
6078
  ${content}
@@ -6932,5 +6951,5 @@ export {
6932
6951
  ABSOLUTE_ANDROID_RELEASE_FORMAT
6933
6952
  };
6934
6953
 
6935
- //# debugId=17F8DCA356CF789D64756E2164756E21
6954
+ //# debugId=70D55943FDDD4B5264756E2164756E21
6936
6955
  //# sourceMappingURL=index.js.map