@craft-native/ios 0.0.237 → 0.0.238
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.
- package/dist/cli.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +9 -1
- package/dist/testing.d.ts +2 -0
- package/package.json +1 -1
- package/templates/CraftApp.swift +376 -88
- package/templates/CraftHeartRate.swift +141 -44
- package/templates/CraftNativeActions.swift +46 -48
- package/templates/CraftNativeScreen.swift +11 -4
- package/templates/CraftPersistentStorage.swift +99 -0
- package/templates/CraftRecordingArchive.swift +85 -0
- package/templates/testing/DriverTests.swift.template +8 -1
package/dist/cli.js
CHANGED
|
@@ -958,6 +958,8 @@ function writeShell(output, config) {
|
|
|
958
958
|
cpSync(join3(TEMPLATES_DIR, "CraftMusic.swift"), join3(output, "Sources", "CraftMusic.swift"));
|
|
959
959
|
cpSync(join3(TEMPLATES_DIR, "CraftBluetooth.swift"), join3(output, "Sources", "CraftBluetooth.swift"));
|
|
960
960
|
cpSync(join3(TEMPLATES_DIR, "CraftHeartRate.swift"), join3(output, "Sources", "CraftHeartRate.swift"));
|
|
961
|
+
cpSync(join3(TEMPLATES_DIR, "CraftRecordingArchive.swift"), join3(output, "Sources", "CraftRecordingArchive.swift"));
|
|
962
|
+
cpSync(join3(TEMPLATES_DIR, "CraftPersistentStorage.swift"), join3(output, "Sources", "CraftPersistentStorage.swift"));
|
|
961
963
|
cpSync(join3(TEMPLATES_DIR, "CraftScheduledWorkouts.swift"), join3(output, "Sources", "CraftScheduledWorkouts.swift"));
|
|
962
964
|
cpSync(join3(TEMPLATES_DIR, "CraftNativeMutation.swift"), join3(output, "Sources", "CraftNativeMutation.swift"));
|
|
963
965
|
cpSync(join3(TEMPLATES_DIR, "CraftNativeUI.swift"), join3(output, "Sources", "CraftNativeUI.swift"));
|
package/dist/index.d.ts
CHANGED
|
@@ -274,6 +274,11 @@ export interface CraftTab {
|
|
|
274
274
|
title: string;
|
|
275
275
|
/** An SF Symbol name. */
|
|
276
276
|
symbol?: string;
|
|
277
|
+
/** Native selected-tab icon overrides; retained pushed screens keep their owning tab's policy. */
|
|
278
|
+
selectedSymbol?: string;
|
|
279
|
+
selectedIconTint?: string;
|
|
280
|
+
/** False suppresses the legacy pulse while selected; omission uses the legacy policy. */
|
|
281
|
+
selectedIconPulse?: boolean;
|
|
277
282
|
}
|
|
278
283
|
/** `/a//b/?q#h` → `/a/b`, the way the shell and the page compare paths. Null for a relative path. */
|
|
279
284
|
export declare function normalizeNativePath(raw: string): string | null;
|
package/dist/index.js
CHANGED
|
@@ -133,13 +133,19 @@ function initSimulatorDriver(options) {
|
|
|
133
133
|
throw new Error("The simulator driver requires iOS 17.0 or newer");
|
|
134
134
|
if (!["http:", "https:"].includes(new URL(control).protocol))
|
|
135
135
|
throw new Error("controlUrl must use HTTP or HTTPS");
|
|
136
|
+
const tabIdentifiers = Object.entries(options.tabIdentifiers ?? {});
|
|
137
|
+
for (const [name2, identifier] of tabIdentifiers) {
|
|
138
|
+
if (!name2.trim() || !identifier.trim())
|
|
139
|
+
throw new Error("Tab names and native identifiers must be nonempty");
|
|
140
|
+
}
|
|
136
141
|
const replacements = {
|
|
137
142
|
PROJECT_NAME: name,
|
|
138
143
|
BUNDLE_PREFIX: prefix,
|
|
139
144
|
IOS_VERSION: version,
|
|
140
145
|
BUNDLE_ID: swiftString(bundleId),
|
|
141
146
|
CONTROL_URL: swiftString(control),
|
|
142
|
-
TABS: `[${(options.tabs ?? []).map(swiftString).join(", ")}]
|
|
147
|
+
TABS: `[${(options.tabs ?? []).map(swiftString).join(", ")}]`,
|
|
148
|
+
TAB_IDENTIFIERS: tabIdentifiers.length ? `[${tabIdentifiers.map(([name2, identifier]) => `${swiftString(name2)}: ${swiftString(identifier)}`).join(", ")}]` : "[:]"
|
|
143
149
|
};
|
|
144
150
|
for (const [source, destination] of [
|
|
145
151
|
["HostApp.swift", "Host/HostApp.swift"],
|
|
@@ -1141,6 +1147,8 @@ function writeShell(output, config) {
|
|
|
1141
1147
|
cpSync(join3(TEMPLATES_DIR, "CraftMusic.swift"), join3(output, "Sources", "CraftMusic.swift"));
|
|
1142
1148
|
cpSync(join3(TEMPLATES_DIR, "CraftBluetooth.swift"), join3(output, "Sources", "CraftBluetooth.swift"));
|
|
1143
1149
|
cpSync(join3(TEMPLATES_DIR, "CraftHeartRate.swift"), join3(output, "Sources", "CraftHeartRate.swift"));
|
|
1150
|
+
cpSync(join3(TEMPLATES_DIR, "CraftRecordingArchive.swift"), join3(output, "Sources", "CraftRecordingArchive.swift"));
|
|
1151
|
+
cpSync(join3(TEMPLATES_DIR, "CraftPersistentStorage.swift"), join3(output, "Sources", "CraftPersistentStorage.swift"));
|
|
1144
1152
|
cpSync(join3(TEMPLATES_DIR, "CraftScheduledWorkouts.swift"), join3(output, "Sources", "CraftScheduledWorkouts.swift"));
|
|
1145
1153
|
cpSync(join3(TEMPLATES_DIR, "CraftNativeMutation.swift"), join3(output, "Sources", "CraftNativeMutation.swift"));
|
|
1146
1154
|
cpSync(join3(TEMPLATES_DIR, "CraftNativeUI.swift"), join3(output, "Sources", "CraftNativeUI.swift"));
|
package/dist/testing.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface SimulatorDriverOptions {
|
|
|
7
7
|
deploymentTarget?: string;
|
|
8
8
|
controlUrl?: string;
|
|
9
9
|
tabs?: readonly string[];
|
|
10
|
+
/** Stable native accessibility identifiers for tabs whose labels can change. */
|
|
11
|
+
tabIdentifiers?: Readonly<Record<string, string>>;
|
|
10
12
|
/** Bundle a wire-protocol journey and save native XCTest attachments. No control server is needed on physical devices. */
|
|
11
13
|
script?: string;
|
|
12
14
|
}
|