bleam 0.0.12 → 0.0.14
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/ai.cjs +5 -4
- package/dist/ai.js +4 -3
- package/dist/app-storage-D8W4n8ey.cjs +39 -0
- package/dist/app-storage-Isi5Bo0R.js +34 -0
- package/dist/cli.cjs +149 -23
- package/dist/cli.d.cts +13 -0
- package/dist/cli.d.ts +13 -0
- package/dist/cli.js +149 -23
- package/dist/elements-DX_YUveu.d.ts +341 -0
- package/dist/elements-gEI8YGl1.d.cts +341 -0
- package/dist/elements.cjs +1031 -0
- package/dist/elements.d.cts +2 -0
- package/dist/elements.d.ts +2 -0
- package/dist/elements.js +999 -0
- package/dist/{files-BXVkPrPN.js → files-DErLhzCB.js} +5 -11
- package/dist/{files-DxaQ-Nv0.cjs → files-lMk-CpL_.cjs} +5 -11
- package/dist/files.cjs +1 -1
- package/dist/files.js +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.d.cts +1 -1
- package/dist/schema.d.ts +1 -1
- package/dist/schema.js +1 -1
- package/dist/secrets.cjs +146 -0
- package/dist/secrets.d.cts +14 -0
- package/dist/secrets.d.ts +14 -0
- package/dist/secrets.js +142 -0
- package/dist/{state-LssDgpff.cjs → state-Bm9GiRnU.cjs} +61 -47
- package/dist/{state-Dh3HLixb.js → state-D8Firo9w.js} +60 -41
- package/dist/state.cjs +3 -2
- package/dist/state.d.cts +1 -1
- package/dist/state.d.ts +1 -1
- package/dist/state.js +3 -2
- package/dist/window.d.cts +1 -1
- package/dist/window.d.ts +1 -1
- package/package.json +14 -11
- package/templates/basic/app/index.tsx +7 -129
- package/templates/foundation-models/app/index.tsx +100 -41
- package/templates/image-generation/app/index.tsx +2 -2
- package/templates/native/ios/Podfile.lock +6 -0
- package/templates/native/modules/bleam-runtime/ios/AIModule.swift +7 -8
- package/templates/native/package.json +6 -1
- package/templates/native/yarn.lock +5392 -3749
- package/templates/state/app/index.tsx +2 -2
- package/templates/text-generation/app/index.tsx +4 -4
- package/templates/updates/README.md +1 -1
- package/dist/native-sqlite-xcGdamRD.js +0 -64
- package/dist/native-sqlite-yQLD5s9i.cjs +0 -66
- package/dist/ui-1WepaMS4.d.cts +0 -92
- package/dist/ui-D7bRLYee.d.ts +0 -92
- package/dist/ui.cjs +0 -364
- package/dist/ui.d.cts +0 -2
- package/dist/ui.d.ts +0 -2
- package/dist/ui.js +0 -357
- /package/dist/{schema-B5BfdswF.js → schema-B7ELMpuI.js} +0 -0
- /package/dist/{schema-BnVZOXfu.cjs → schema-B7SLUBLN.cjs} +0 -0
- /package/dist/{schema-D5eImHxu.d.cts → schema-BWsDPc6c.d.cts} +0 -0
- /package/dist/{schema-SSjokbtw.d.ts → schema-DsXZBnvc.d.ts} +0 -0
package/dist/cli.js
CHANGED
|
@@ -177,7 +177,7 @@ function parseDevOptions(argv) {
|
|
|
177
177
|
function parseNewOptions(argv) {
|
|
178
178
|
const root = invocationRoot();
|
|
179
179
|
let projectRoot;
|
|
180
|
-
let template = "
|
|
180
|
+
let template = "basic";
|
|
181
181
|
for (let index = 0; index < argv.length; index += 1) {
|
|
182
182
|
const arg = argv[index];
|
|
183
183
|
if (arg === "--help" || arg === "-h") {
|
|
@@ -609,13 +609,14 @@ function writeBiomeConfig(configPath) {
|
|
|
609
609
|
}
|
|
610
610
|
}, null, 2)}\n`);
|
|
611
611
|
}
|
|
612
|
-
function writeProjectRuntimeConfig(projectRoot, config, origin) {
|
|
612
|
+
function writeProjectRuntimeConfig(projectRoot, config, origin, client) {
|
|
613
613
|
const projectConfigPath = path.join(projectRoot, ".bleam", "project.json");
|
|
614
614
|
mkdirSync(path.dirname(projectConfigPath), { recursive: true });
|
|
615
615
|
writeFileSync(projectConfigPath, `${JSON.stringify({
|
|
616
616
|
name: config.name,
|
|
617
|
+
id: client.projectId,
|
|
617
618
|
version: config.version,
|
|
618
|
-
bundleIdentifier:
|
|
619
|
+
bundleIdentifier: client.bundleIdentifier,
|
|
619
620
|
teamId: config.teamId,
|
|
620
621
|
appearance: config.appearance,
|
|
621
622
|
devServer: origin,
|
|
@@ -1154,19 +1155,127 @@ async function resolveRuntimeArtifact() {
|
|
|
1154
1155
|
throw new Error(`Failed to resolve the Bleam runtime.\n${runtimeResolutionDetails()}\n\nCause: ${error instanceof Error ? error.message : String(error)}`);
|
|
1155
1156
|
}
|
|
1156
1157
|
}
|
|
1157
|
-
function
|
|
1158
|
-
const
|
|
1158
|
+
function devProjectId(projectRoot) {
|
|
1159
|
+
const idPath = path.join(projectRoot, ".bleam", "project-id");
|
|
1160
|
+
if (existsSync(idPath)) {
|
|
1161
|
+
const projectId$1 = readFileSync(idPath, "utf8").trim();
|
|
1162
|
+
if (/^[0-9a-f]{32}$/i.test(projectId$1)) return projectId$1.toLowerCase();
|
|
1163
|
+
throw new Error(`Invalid Bleam project ID at ${prettyPath(idPath)}`);
|
|
1164
|
+
}
|
|
1165
|
+
const projectId = randomUUID().replaceAll("-", "");
|
|
1166
|
+
mkdirSync(path.dirname(idPath), { recursive: true });
|
|
1167
|
+
writeFileSync(idPath, `${projectId}\n`);
|
|
1168
|
+
return projectId;
|
|
1169
|
+
}
|
|
1170
|
+
function devBundleIdentifier(projectId) {
|
|
1171
|
+
return `dev.bleam.project.p${projectId}`;
|
|
1172
|
+
}
|
|
1173
|
+
function runBundleCommand(command, args) {
|
|
1174
|
+
const result = spawnSync(command, args, {
|
|
1175
|
+
encoding: "utf8",
|
|
1176
|
+
env: process.env
|
|
1177
|
+
});
|
|
1178
|
+
if (result.error) throw result.error;
|
|
1179
|
+
if (result.status !== 0) {
|
|
1180
|
+
const detail = result.stderr.trim() || result.stdout.trim();
|
|
1181
|
+
throw new Error(`${commandText(command, args)} failed${detail ? `: ${detail}` : ""}`);
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
function devAppFileName(name) {
|
|
1185
|
+
return `${name.replaceAll("/", "-")}.app`;
|
|
1186
|
+
}
|
|
1187
|
+
function setPlistValue(plistPath, key, type, value) {
|
|
1188
|
+
spawnSync("plutil", [
|
|
1189
|
+
"-remove",
|
|
1190
|
+
key,
|
|
1191
|
+
plistPath
|
|
1192
|
+
], { stdio: "ignore" });
|
|
1193
|
+
runBundleCommand("plutil", [
|
|
1194
|
+
"-insert",
|
|
1195
|
+
key,
|
|
1196
|
+
type,
|
|
1197
|
+
value,
|
|
1198
|
+
plistPath
|
|
1199
|
+
]);
|
|
1200
|
+
}
|
|
1201
|
+
function removePlistValue(plistPath, key) {
|
|
1202
|
+
spawnSync("plutil", [
|
|
1203
|
+
"-remove",
|
|
1204
|
+
key,
|
|
1205
|
+
plistPath
|
|
1206
|
+
], { stdio: "ignore" });
|
|
1207
|
+
}
|
|
1208
|
+
function personalizeRuntimeClient(options) {
|
|
1209
|
+
const appPlist = path.join(options.appPath, "Contents", "Info.plist");
|
|
1210
|
+
const servicePath = path.join(options.appPath, "Contents", "XPCServices", "GenerationService.xpc");
|
|
1211
|
+
const servicePlist = path.join(servicePath, "Contents", "Info.plist");
|
|
1212
|
+
setPlistValue(appPlist, "CFBundleIdentifier", "-string", options.bundleIdentifier);
|
|
1213
|
+
setPlistValue(appPlist, "CFBundleDisplayName", "-string", options.name);
|
|
1214
|
+
setPlistValue(appPlist, "CFBundleName", "-string", options.name);
|
|
1215
|
+
removePlistValue(appPlist, "AppGroupIdentifier");
|
|
1216
|
+
if (existsSync(servicePlist)) {
|
|
1217
|
+
setPlistValue(servicePlist, "CFBundleIdentifier", "-string", `${options.bundleIdentifier}.GenerationService`);
|
|
1218
|
+
removePlistValue(servicePlist, "AppGroupIdentifier");
|
|
1219
|
+
}
|
|
1220
|
+
if (options.iconPath) {
|
|
1221
|
+
const iconName = "BleamProjectIcon.png";
|
|
1222
|
+
cpSync(options.iconPath, path.join(options.appPath, "Contents", "Resources", iconName));
|
|
1223
|
+
setPlistValue(appPlist, "CFBundleIconFile", "-string", iconName);
|
|
1224
|
+
setPlistValue(appPlist, "CFBundleIcons", "-json", JSON.stringify({ CFBundlePrimaryIcon: {
|
|
1225
|
+
CFBundleIconFiles: ["BleamProjectIcon"],
|
|
1226
|
+
CFBundleIconName: "BleamProjectIcon"
|
|
1227
|
+
} }));
|
|
1228
|
+
}
|
|
1229
|
+
rmSync(path.join(options.appPath, "Contents", "embedded.provisionprofile"), { force: true });
|
|
1230
|
+
rmSync(path.join(servicePath, "Contents", "embedded.provisionprofile"), { force: true });
|
|
1231
|
+
if (existsSync(servicePath)) runBundleCommand("codesign", [
|
|
1232
|
+
"--force",
|
|
1233
|
+
"--sign",
|
|
1234
|
+
"-",
|
|
1235
|
+
"--timestamp=none",
|
|
1236
|
+
servicePath
|
|
1237
|
+
]);
|
|
1238
|
+
runBundleCommand("codesign", [
|
|
1239
|
+
"--force",
|
|
1240
|
+
"--sign",
|
|
1241
|
+
"-",
|
|
1242
|
+
"--timestamp=none",
|
|
1243
|
+
options.appPath
|
|
1244
|
+
]);
|
|
1245
|
+
runBundleCommand("codesign", [
|
|
1246
|
+
"--verify",
|
|
1247
|
+
"--deep",
|
|
1248
|
+
"--strict",
|
|
1249
|
+
options.appPath
|
|
1250
|
+
]);
|
|
1251
|
+
}
|
|
1252
|
+
function copyRuntimeClient(projectRoot, runtime, config) {
|
|
1253
|
+
const projectId = devProjectId(projectRoot);
|
|
1254
|
+
const bundleIdentifier = devBundleIdentifier(projectId);
|
|
1255
|
+
const clientRoot = path.join(projectRoot, ".bleam", "client");
|
|
1256
|
+
const appFileName = devAppFileName(config.name);
|
|
1257
|
+
const clientAppPath = path.join(clientRoot, appFileName);
|
|
1159
1258
|
console.log(`Preparing Bleam app at ${prettyPath(clientAppPath)}`);
|
|
1160
|
-
rmSync(
|
|
1259
|
+
rmSync(clientRoot, {
|
|
1161
1260
|
recursive: true,
|
|
1162
1261
|
force: true
|
|
1163
1262
|
});
|
|
1164
|
-
mkdirSync(
|
|
1263
|
+
mkdirSync(clientRoot, { recursive: true });
|
|
1165
1264
|
cpSync(runtime.appPath, clientAppPath, {
|
|
1166
1265
|
recursive: true,
|
|
1167
1266
|
verbatimSymlinks: true
|
|
1168
1267
|
});
|
|
1169
|
-
|
|
1268
|
+
personalizeRuntimeClient({
|
|
1269
|
+
appPath: clientAppPath,
|
|
1270
|
+
name: config.name,
|
|
1271
|
+
bundleIdentifier,
|
|
1272
|
+
iconPath: config.iconPath
|
|
1273
|
+
});
|
|
1274
|
+
return {
|
|
1275
|
+
appPath: clientAppPath,
|
|
1276
|
+
bundleIdentifier,
|
|
1277
|
+
projectId
|
|
1278
|
+
};
|
|
1170
1279
|
}
|
|
1171
1280
|
function cleanDevArtifacts(projectRoot) {
|
|
1172
1281
|
const bleamRoot = path.join(projectRoot, ".bleam");
|
|
@@ -1348,11 +1457,12 @@ function openRuntimeClient(appPath, projectConfigPath, manifest) {
|
|
|
1348
1457
|
if (code && code !== 0) console.error(`Failed to open Bleam runtime at ${appPath}`);
|
|
1349
1458
|
});
|
|
1350
1459
|
}
|
|
1351
|
-
function quitRuntimeClient() {
|
|
1352
|
-
|
|
1460
|
+
function quitRuntimeClient(bundleIdentifier) {
|
|
1461
|
+
const application = `application id ${JSON.stringify(bundleIdentifier)}`;
|
|
1462
|
+
spawnSync("osascript", ["-e", `if ${application} is running then tell ${application} to quit`], { stdio: "ignore" });
|
|
1353
1463
|
}
|
|
1354
|
-
async function launchRuntimeClient(appPath, projectConfigPath, manifest) {
|
|
1355
|
-
quitRuntimeClient();
|
|
1464
|
+
async function launchRuntimeClient(appPath, bundleIdentifier, projectConfigPath, manifest) {
|
|
1465
|
+
quitRuntimeClient(bundleIdentifier);
|
|
1356
1466
|
openRuntimeClient(appPath, projectConfigPath, manifest);
|
|
1357
1467
|
}
|
|
1358
1468
|
async function updateServiceHealthy(serviceUrl) {
|
|
@@ -1441,8 +1551,14 @@ async function startLocalUpdateService() {
|
|
|
1441
1551
|
serviceUrl
|
|
1442
1552
|
};
|
|
1443
1553
|
}
|
|
1444
|
-
function focusRuntimeClient() {
|
|
1445
|
-
|
|
1554
|
+
function focusRuntimeClient(bundleIdentifier) {
|
|
1555
|
+
const application = `application id ${JSON.stringify(bundleIdentifier)}`;
|
|
1556
|
+
const result = spawnSync("osascript", ["-e", `if ${application} is running then
|
|
1557
|
+
tell ${application} to activate
|
|
1558
|
+
return true
|
|
1559
|
+
end if
|
|
1560
|
+
return false`], { encoding: "utf8" });
|
|
1561
|
+
return result.status === 0 && result.stdout.trim() === "true";
|
|
1446
1562
|
}
|
|
1447
1563
|
function sendJson(res, status, value) {
|
|
1448
1564
|
res.writeHead(status, {
|
|
@@ -1581,12 +1697,14 @@ function setupInteractiveControls(options) {
|
|
|
1581
1697
|
if (key === "o") {
|
|
1582
1698
|
(async () => {
|
|
1583
1699
|
try {
|
|
1584
|
-
if (focusRuntimeClient()) {
|
|
1585
|
-
|
|
1700
|
+
if (focusRuntimeClient(options.bundleIdentifier)) {
|
|
1701
|
+
options.onOpen();
|
|
1702
|
+
console.log("Focused project app");
|
|
1586
1703
|
return;
|
|
1587
1704
|
}
|
|
1588
1705
|
console.log(`Opening Bleam app at ${prettyPath(options.clientAppPath)}`);
|
|
1589
|
-
await launchRuntimeClient(options.clientAppPath, options.projectConfigPath, options.manifest);
|
|
1706
|
+
await launchRuntimeClient(options.clientAppPath, options.bundleIdentifier, options.projectConfigPath, options.manifest);
|
|
1707
|
+
options.onOpen();
|
|
1590
1708
|
} catch (error) {
|
|
1591
1709
|
console.error(error instanceof Error ? error.message : String(error));
|
|
1592
1710
|
}
|
|
@@ -1770,11 +1888,11 @@ async function startDevServer(options) {
|
|
|
1770
1888
|
const config = readProjectConfig(options);
|
|
1771
1889
|
if (options.clean) cleanDevArtifacts(options.projectRoot);
|
|
1772
1890
|
const runtime = await resolveRuntimeArtifact();
|
|
1773
|
-
const
|
|
1891
|
+
const client = copyRuntimeClient(options.projectRoot, runtime, config);
|
|
1774
1892
|
console.log("Preparing Bleam dev workspace");
|
|
1775
1893
|
const workspaceRoot = createDevWorkspace(options.projectRoot, config);
|
|
1776
1894
|
const origin = `http://localhost:${options.port}`;
|
|
1777
|
-
const projectConfigPath = writeProjectRuntimeConfig(options.projectRoot, config, origin);
|
|
1895
|
+
const projectConfigPath = writeProjectRuntimeConfig(options.projectRoot, config, origin, client);
|
|
1778
1896
|
const updateService = await startLocalUpdateService();
|
|
1779
1897
|
const child = spawn(process.execPath, [
|
|
1780
1898
|
fileURLToPath(import.meta.url),
|
|
@@ -1815,7 +1933,7 @@ async function startDevServer(options) {
|
|
|
1815
1933
|
if (didCleanupDevSession) return;
|
|
1816
1934
|
didCleanupDevSession = true;
|
|
1817
1935
|
cleanupInteractiveControls();
|
|
1818
|
-
if (didLaunchRuntimeClient) quitRuntimeClient();
|
|
1936
|
+
if (didLaunchRuntimeClient) quitRuntimeClient(client.bundleIdentifier);
|
|
1819
1937
|
if (updateService.child?.exitCode === null) updateService.child.kill("SIGTERM");
|
|
1820
1938
|
};
|
|
1821
1939
|
const stop = (signal) => {
|
|
@@ -1841,15 +1959,19 @@ async function startDevServer(options) {
|
|
|
1841
1959
|
const manifest = await readDevManifest(origin);
|
|
1842
1960
|
cleanupInteractiveControls = setupInteractiveControls({
|
|
1843
1961
|
origin,
|
|
1844
|
-
clientAppPath,
|
|
1962
|
+
clientAppPath: client.appPath,
|
|
1963
|
+
bundleIdentifier: client.bundleIdentifier,
|
|
1845
1964
|
projectConfigPath,
|
|
1846
1965
|
manifest,
|
|
1966
|
+
onOpen: () => {
|
|
1967
|
+
didLaunchRuntimeClient = true;
|
|
1968
|
+
},
|
|
1847
1969
|
stop: () => stop("SIGINT")
|
|
1848
1970
|
});
|
|
1849
1971
|
if (options.run && process.env.BLEAM_NO_OPEN !== "1") try {
|
|
1850
1972
|
await waitForDevBundle(manifest.bundleUrl);
|
|
1851
|
-
console.log(`Opening
|
|
1852
|
-
await launchRuntimeClient(
|
|
1973
|
+
console.log(`Opening project app at ${prettyPath(client.appPath)}`);
|
|
1974
|
+
await launchRuntimeClient(client.appPath, client.bundleIdentifier, projectConfigPath, manifest);
|
|
1853
1975
|
didLaunchRuntimeClient = true;
|
|
1854
1976
|
} catch (error) {
|
|
1855
1977
|
console.error(`Initial app launch failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -1933,6 +2055,9 @@ if (process.env.VITEST !== "true") main().catch((error) => {
|
|
|
1933
2055
|
const __test = {
|
|
1934
2056
|
createProject,
|
|
1935
2057
|
createBuildNativeWorkspace,
|
|
2058
|
+
devAppFileName,
|
|
2059
|
+
devBundleIdentifier,
|
|
2060
|
+
devProjectId,
|
|
1936
2061
|
hasCurrentPodInstall,
|
|
1937
2062
|
installedAppPath,
|
|
1938
2063
|
installArchivedApp,
|
|
@@ -1943,6 +2068,7 @@ const __test = {
|
|
|
1943
2068
|
parseBuildOptions,
|
|
1944
2069
|
parseNewOptions,
|
|
1945
2070
|
parsePublishOtaOptions,
|
|
2071
|
+
personalizeRuntimeClient,
|
|
1946
2072
|
podInstallInputStamp,
|
|
1947
2073
|
replaceOrInsertPlistString
|
|
1948
2074
|
};
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import * as _nativescript_react_native31 from "@nativescript/react-native";
|
|
2
|
+
import * as react16 from "react";
|
|
3
|
+
import { ReactNode } from "react";
|
|
4
|
+
import { ColorValue, FlatListProps, PressableProps, StyleProp, TextInputProps, TextInputSubmitEditingEvent, TextProps, TextStyle, ViewProps, ViewStyle } from "react-native";
|
|
5
|
+
|
|
6
|
+
//#region src/elements/ai-status.d.ts
|
|
7
|
+
type MessageStatusValue = 'queued' | 'generating' | 'canceling' | 'completed' | 'failed' | 'canceled';
|
|
8
|
+
type MessageRole = 'user' | 'assistant';
|
|
9
|
+
type MessageStatusDisplay = {
|
|
10
|
+
symbol: string;
|
|
11
|
+
label: string;
|
|
12
|
+
color: string;
|
|
13
|
+
};
|
|
14
|
+
type ChatSubmitStatus = 'ready' | 'queued' | 'generating' | 'canceling' | 'failed' | 'canceled' | 'not-found';
|
|
15
|
+
declare function messageStatusDisplay(status: MessageStatusValue): MessageStatusDisplay;
|
|
16
|
+
declare function promptStatusGenerating(status: ChatSubmitStatus | undefined): status is "queued" | "generating" | "canceling";
|
|
17
|
+
declare function promptStatusSymbol(status: ChatSubmitStatus | undefined, generating: boolean): "stop.fill" | "exclamationmark.arrow.triangle.2.circlepath" | "arrow.up";
|
|
18
|
+
declare function promptStatusLabel(status: ChatSubmitStatus | undefined, generating: boolean): "Stop generating" | "Send after failure" | "Send after cancellation" | "Send message";
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/elements/shared.d.ts
|
|
21
|
+
type NativeStyle = ViewStyle & TextStyle;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region src/elements/blur-view.d.ts
|
|
24
|
+
type BlurIntensity = 'ultraThin' | 'thin' | 'regular' | 'thick' | 'chrome';
|
|
25
|
+
type BlurColorScheme = 'auto' | 'light' | 'dark';
|
|
26
|
+
type BlurViewProps = {
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
style?: StyleProp<NativeStyle>;
|
|
29
|
+
intensity?: BlurIntensity;
|
|
30
|
+
colorScheme?: BlurColorScheme;
|
|
31
|
+
};
|
|
32
|
+
declare const BlurView: _nativescript_react_native31.UIKitViewComponent<BlurViewProps, _nativescript_react_native31.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region src/elements/glass-shared.d.ts
|
|
35
|
+
type GlassStyle = 'regular' | 'clear' | 'none';
|
|
36
|
+
type GlassEffectStyleConfig = {
|
|
37
|
+
style: GlassStyle;
|
|
38
|
+
animate?: boolean;
|
|
39
|
+
animationDuration?: number;
|
|
40
|
+
};
|
|
41
|
+
type GlassVisualStyle = {
|
|
42
|
+
cornerRadius?: number;
|
|
43
|
+
borderWidth?: number;
|
|
44
|
+
borderColor?: ColorValue;
|
|
45
|
+
};
|
|
46
|
+
type GlassViewProps = {
|
|
47
|
+
children?: ReactNode;
|
|
48
|
+
style?: StyleProp<NativeStyle>;
|
|
49
|
+
glassStyle?: GlassVisualStyle;
|
|
50
|
+
glassEffectStyle?: GlassStyle | GlassEffectStyleConfig;
|
|
51
|
+
tintColor?: string;
|
|
52
|
+
isInteractive?: boolean;
|
|
53
|
+
};
|
|
54
|
+
type GlassContainerProps = {
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
style?: StyleProp<NativeStyle>;
|
|
57
|
+
glassStyle?: GlassVisualStyle;
|
|
58
|
+
spacing?: number;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region src/elements/glass-view.d.ts
|
|
62
|
+
declare const GlassView: _nativescript_react_native31.UIKitViewComponent<GlassViewProps, _nativescript_react_native31.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/elements/button.d.ts
|
|
65
|
+
type ButtonVariant = 'primary' | 'secondary' | 'plain';
|
|
66
|
+
type ButtonSize = 'small' | 'regular' | 'large';
|
|
67
|
+
type ButtonBaseProps = Omit<PressableProps, 'children' | 'disabled'> & {
|
|
68
|
+
label?: string;
|
|
69
|
+
icon?: ReactNode;
|
|
70
|
+
loading?: boolean;
|
|
71
|
+
disabled?: boolean;
|
|
72
|
+
size?: ButtonSize;
|
|
73
|
+
activeOpacity?: number;
|
|
74
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
75
|
+
};
|
|
76
|
+
type ButtonProps = ButtonBaseProps & {
|
|
77
|
+
variant?: ButtonVariant;
|
|
78
|
+
};
|
|
79
|
+
type GlassButtonProps = ButtonBaseProps & Pick<GlassViewProps, 'glassEffectStyle' | 'tintColor'> & {
|
|
80
|
+
glassStyle?: GlassVisualStyle;
|
|
81
|
+
};
|
|
82
|
+
declare function Button({
|
|
83
|
+
accessibilityRole,
|
|
84
|
+
accessibilityState,
|
|
85
|
+
activeOpacity,
|
|
86
|
+
disabled,
|
|
87
|
+
icon,
|
|
88
|
+
label,
|
|
89
|
+
labelStyle,
|
|
90
|
+
loading,
|
|
91
|
+
size,
|
|
92
|
+
style,
|
|
93
|
+
variant,
|
|
94
|
+
...props
|
|
95
|
+
}: ButtonProps): react16.JSX.Element;
|
|
96
|
+
declare function GlassButton({
|
|
97
|
+
accessibilityRole,
|
|
98
|
+
accessibilityState,
|
|
99
|
+
activeOpacity,
|
|
100
|
+
disabled,
|
|
101
|
+
glassEffectStyle,
|
|
102
|
+
glassStyle,
|
|
103
|
+
icon,
|
|
104
|
+
label,
|
|
105
|
+
labelStyle,
|
|
106
|
+
loading,
|
|
107
|
+
size,
|
|
108
|
+
style,
|
|
109
|
+
tintColor,
|
|
110
|
+
...props
|
|
111
|
+
}: GlassButtonProps): react16.JSX.Element;
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/elements/conversation.d.ts
|
|
114
|
+
type ConversationProps = ViewProps & {
|
|
115
|
+
followOutput?: boolean;
|
|
116
|
+
defaultFollowOutput?: boolean;
|
|
117
|
+
onFollowOutputChange?: (following: boolean) => void;
|
|
118
|
+
};
|
|
119
|
+
type ConversationContentProps<ItemT> = FlatListProps<ItemT>;
|
|
120
|
+
type ConversationEmptyStateProps = ViewProps & {
|
|
121
|
+
title?: string;
|
|
122
|
+
description?: string;
|
|
123
|
+
icon?: ReactNode;
|
|
124
|
+
titleStyle?: TextProps['style'];
|
|
125
|
+
descriptionStyle?: TextProps['style'];
|
|
126
|
+
};
|
|
127
|
+
type ConversationScrollButtonProps = Omit<PressableProps, 'onPress'> & {
|
|
128
|
+
accessibilityLabel?: string;
|
|
129
|
+
activeOpacity?: number;
|
|
130
|
+
onPress?: () => void;
|
|
131
|
+
};
|
|
132
|
+
type ConversationContextValue = {
|
|
133
|
+
followGeneration: number;
|
|
134
|
+
following: boolean;
|
|
135
|
+
isAtBottom: boolean;
|
|
136
|
+
updateAtBottom: (value: boolean) => void;
|
|
137
|
+
requestFollow: () => void;
|
|
138
|
+
};
|
|
139
|
+
declare function useConversation(): ConversationContextValue;
|
|
140
|
+
declare function Conversation({
|
|
141
|
+
children,
|
|
142
|
+
defaultFollowOutput,
|
|
143
|
+
followOutput,
|
|
144
|
+
onFollowOutputChange,
|
|
145
|
+
style,
|
|
146
|
+
...props
|
|
147
|
+
}: ConversationProps): react16.JSX.Element;
|
|
148
|
+
declare function ConversationContent<ItemT>({
|
|
149
|
+
contentContainerStyle,
|
|
150
|
+
data,
|
|
151
|
+
keyboardShouldPersistTaps,
|
|
152
|
+
onContentSizeChange,
|
|
153
|
+
onScroll,
|
|
154
|
+
renderItem,
|
|
155
|
+
scrollEventThrottle,
|
|
156
|
+
...props
|
|
157
|
+
}: ConversationContentProps<ItemT>): react16.JSX.Element;
|
|
158
|
+
declare function ConversationEmptyState({
|
|
159
|
+
children,
|
|
160
|
+
description,
|
|
161
|
+
descriptionStyle,
|
|
162
|
+
icon,
|
|
163
|
+
style,
|
|
164
|
+
title,
|
|
165
|
+
titleStyle,
|
|
166
|
+
...props
|
|
167
|
+
}: ConversationEmptyStateProps): react16.JSX.Element;
|
|
168
|
+
declare function ConversationScrollButton({
|
|
169
|
+
accessibilityLabel,
|
|
170
|
+
activeOpacity,
|
|
171
|
+
children,
|
|
172
|
+
onPress,
|
|
173
|
+
style,
|
|
174
|
+
...props
|
|
175
|
+
}: ConversationScrollButtonProps): react16.JSX.Element | null;
|
|
176
|
+
//#endregion
|
|
177
|
+
//#region src/elements/glass-container.d.ts
|
|
178
|
+
declare const GlassContainer: _nativescript_react_native31.UIKitViewComponent<GlassContainerProps, _nativescript_react_native31.UIKitContainerResult<UIVisualEffectView, UIView>>;
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/elements/label.d.ts
|
|
181
|
+
type LabelTone = 'primary' | 'secondary' | 'tertiary';
|
|
182
|
+
type LabelProps = {
|
|
183
|
+
children?: ReactNode;
|
|
184
|
+
text?: string;
|
|
185
|
+
tone?: LabelTone;
|
|
186
|
+
numberOfLines?: number;
|
|
187
|
+
style?: StyleProp<NativeStyle>;
|
|
188
|
+
};
|
|
189
|
+
declare const Label: _nativescript_react_native31.UIKitViewComponent<LabelProps, UILabel>;
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/elements/message.d.ts
|
|
192
|
+
type MessageProps = ViewProps & {
|
|
193
|
+
from?: 'user' | 'assistant';
|
|
194
|
+
};
|
|
195
|
+
type MessageContentProps = ViewProps;
|
|
196
|
+
type MessageTextProps = TextProps;
|
|
197
|
+
type MessageStatusProps = Omit<TextProps, 'children'> & {
|
|
198
|
+
status: MessageStatusValue;
|
|
199
|
+
label?: string;
|
|
200
|
+
showSymbol?: boolean;
|
|
201
|
+
};
|
|
202
|
+
type MessageActionsProps = ViewProps;
|
|
203
|
+
declare function Message({
|
|
204
|
+
children,
|
|
205
|
+
from,
|
|
206
|
+
style,
|
|
207
|
+
...props
|
|
208
|
+
}: MessageProps): react16.JSX.Element;
|
|
209
|
+
declare function MessageContent({
|
|
210
|
+
children,
|
|
211
|
+
style,
|
|
212
|
+
...props
|
|
213
|
+
}: MessageContentProps): react16.JSX.Element;
|
|
214
|
+
declare function MessageText({
|
|
215
|
+
style,
|
|
216
|
+
...props
|
|
217
|
+
}: MessageTextProps): react16.JSX.Element;
|
|
218
|
+
declare function MessageStatus({
|
|
219
|
+
label,
|
|
220
|
+
showSymbol,
|
|
221
|
+
status,
|
|
222
|
+
style,
|
|
223
|
+
...props
|
|
224
|
+
}: MessageStatusProps): react16.JSX.Element;
|
|
225
|
+
declare function MessageActions({
|
|
226
|
+
children,
|
|
227
|
+
style,
|
|
228
|
+
...props
|
|
229
|
+
}: MessageActionsProps): react16.JSX.Element;
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region src/elements/prompt-input.d.ts
|
|
232
|
+
type PromptInputMessage = {
|
|
233
|
+
text: string;
|
|
234
|
+
};
|
|
235
|
+
type PromptInputProps = ViewProps & {
|
|
236
|
+
defaultValue?: string;
|
|
237
|
+
disabled?: boolean;
|
|
238
|
+
onChangeText?: (text: string) => void;
|
|
239
|
+
onSubmit?: (message: PromptInputMessage) => void;
|
|
240
|
+
status?: ChatSubmitStatus;
|
|
241
|
+
value?: string;
|
|
242
|
+
};
|
|
243
|
+
type PromptInputBodyProps = ViewProps;
|
|
244
|
+
type PromptInputFooterProps = ViewProps;
|
|
245
|
+
type PromptInputHeaderProps = ViewProps;
|
|
246
|
+
type PromptInputToolsProps = ViewProps;
|
|
247
|
+
type PromptInputTextareaProps = Omit<TextInputProps, 'onSubmitEditing' | 'submitBehavior'> & {
|
|
248
|
+
onSubmitEditing?: (event: TextInputSubmitEditingEvent) => void;
|
|
249
|
+
submitOnEnter?: boolean;
|
|
250
|
+
};
|
|
251
|
+
type PromptInputSubmitProps = Omit<PressableProps, 'children' | 'onPress'> & {
|
|
252
|
+
activeOpacity?: number;
|
|
253
|
+
children?: ReactNode | ((state: {
|
|
254
|
+
generating: boolean;
|
|
255
|
+
}) => ReactNode);
|
|
256
|
+
generating?: boolean;
|
|
257
|
+
loading?: boolean;
|
|
258
|
+
onPress?: (message: PromptInputMessage) => void;
|
|
259
|
+
status?: ChatSubmitStatus;
|
|
260
|
+
};
|
|
261
|
+
type PromptInputContextValue = {
|
|
262
|
+
disabled: boolean;
|
|
263
|
+
generating: boolean;
|
|
264
|
+
setText: (text: string) => void;
|
|
265
|
+
status?: ChatSubmitStatus;
|
|
266
|
+
submit: () => void;
|
|
267
|
+
text: string;
|
|
268
|
+
};
|
|
269
|
+
declare function usePromptInput(): PromptInputContextValue;
|
|
270
|
+
declare function PromptInput({
|
|
271
|
+
children,
|
|
272
|
+
defaultValue,
|
|
273
|
+
disabled,
|
|
274
|
+
onChangeText,
|
|
275
|
+
onSubmit,
|
|
276
|
+
status,
|
|
277
|
+
style,
|
|
278
|
+
value,
|
|
279
|
+
...props
|
|
280
|
+
}: PromptInputProps): react16.JSX.Element;
|
|
281
|
+
declare function PromptInputHeader({
|
|
282
|
+
children,
|
|
283
|
+
style,
|
|
284
|
+
...props
|
|
285
|
+
}: PromptInputHeaderProps): react16.JSX.Element;
|
|
286
|
+
declare function PromptInputBody({
|
|
287
|
+
children,
|
|
288
|
+
style,
|
|
289
|
+
...props
|
|
290
|
+
}: PromptInputBodyProps): react16.JSX.Element;
|
|
291
|
+
declare function PromptInputFooter({
|
|
292
|
+
children,
|
|
293
|
+
style,
|
|
294
|
+
...props
|
|
295
|
+
}: PromptInputFooterProps): react16.JSX.Element;
|
|
296
|
+
declare function PromptInputTools({
|
|
297
|
+
children,
|
|
298
|
+
style,
|
|
299
|
+
...props
|
|
300
|
+
}: PromptInputToolsProps): react16.JSX.Element;
|
|
301
|
+
declare function PromptInputTextarea({
|
|
302
|
+
multiline,
|
|
303
|
+
onChangeText,
|
|
304
|
+
onSubmitEditing,
|
|
305
|
+
placeholder,
|
|
306
|
+
placeholderTextColor,
|
|
307
|
+
returnKeyType,
|
|
308
|
+
style,
|
|
309
|
+
submitOnEnter,
|
|
310
|
+
value,
|
|
311
|
+
...props
|
|
312
|
+
}: PromptInputTextareaProps): react16.JSX.Element;
|
|
313
|
+
declare function PromptInputSubmit({
|
|
314
|
+
accessibilityLabel,
|
|
315
|
+
accessibilityState,
|
|
316
|
+
activeOpacity,
|
|
317
|
+
children,
|
|
318
|
+
disabled: disabledProp,
|
|
319
|
+
generating,
|
|
320
|
+
loading,
|
|
321
|
+
onPress,
|
|
322
|
+
status,
|
|
323
|
+
style,
|
|
324
|
+
...props
|
|
325
|
+
}: PromptInputSubmitProps): react16.JSX.Element;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/elements/symbol.d.ts
|
|
328
|
+
type SymbolName = string;
|
|
329
|
+
type SymbolWeight = 'ultraLight' | 'thin' | 'light' | 'regular' | 'medium' | 'semibold' | 'bold' | 'heavy' | 'black';
|
|
330
|
+
type SymbolScale = 'small' | 'medium' | 'large';
|
|
331
|
+
type SymbolProps = {
|
|
332
|
+
symbol: SymbolName;
|
|
333
|
+
size?: number;
|
|
334
|
+
weight?: SymbolWeight;
|
|
335
|
+
scale?: SymbolScale;
|
|
336
|
+
color?: ColorValue;
|
|
337
|
+
style?: StyleProp<NativeStyle>;
|
|
338
|
+
};
|
|
339
|
+
declare const SFSymbol: _nativescript_react_native31.UIKitViewComponent<SymbolProps, UIImageView>;
|
|
340
|
+
//#endregion
|
|
341
|
+
export { GlassEffectStyleConfig as $, MessageText as A, ConversationEmptyStateProps as B, MessageActions as C, MessageProps as D, MessageContentProps as E, GlassContainer as F, Button as G, ConversationScrollButton as H, Conversation as I, ButtonVariant as J, ButtonProps as K, ConversationContent as L, Label as M, LabelProps as N, MessageStatus as O, LabelTone as P, GlassContainerProps as Q, ConversationContentProps as R, Message as S, MessageContent as T, ConversationScrollButtonProps as U, ConversationProps as V, useConversation as W, GlassButtonProps as X, GlassButton as Y, GlassView as Z, PromptInputTextarea as _, SymbolWeight as a, BlurView as at, PromptInputToolsProps as b, PromptInputBodyProps as c, MessageRole as ct, PromptInputHeader as d, messageStatusDisplay as dt, GlassStyle as et, PromptInputHeaderProps as f, promptStatusGenerating as ft, PromptInputSubmitProps as g, PromptInputSubmit as h, SymbolScale as i, BlurIntensity as it, MessageTextProps as j, MessageStatusProps as k, PromptInputFooter as l, MessageStatusDisplay as lt, PromptInputProps as m, promptStatusSymbol as mt, SymbolName as n, GlassVisualStyle as nt, PromptInput as o, BlurViewProps as ot, PromptInputMessage as p, promptStatusLabel as pt, ButtonSize as q, SymbolProps as r, BlurColorScheme as rt, PromptInputBody as s, ChatSubmitStatus as st, SFSymbol as t, GlassViewProps as tt, PromptInputFooterProps as u, MessageStatusValue as ut, PromptInputTextareaProps as v, MessageActionsProps as w, usePromptInput as x, PromptInputTools as y, ConversationEmptyState as z };
|