@adminide-stack/yantra-mobile 12.0.108 → 12.0.109
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/lib/compute.js +57 -1
- package/lib/compute.js.map +1 -1
- package/lib/config/env-config.js +8 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/appArt.js +2 -1
- package/lib/features/apps/appArt.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +11 -0
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +2 -1
- package/lib/features/apps/nativeAppHandoff.js.map +1 -1
- package/lib/features/health/healthSyncStore.js +7 -1
- package/lib/features/health/healthSyncStore.js.map +1 -1
- package/lib/features/messaging/useChatViewer.js +3 -2
- package/lib/features/messaging/useChatViewer.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +474 -0
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -0
- package/lib/features/webbuilder/brandKitStorage.js +69 -0
- package/lib/features/webbuilder/brandKitStorage.js.map +1 -0
- package/lib/features/webbuilder/buildFragments.js +360 -0
- package/lib/features/webbuilder/buildFragments.js.map +1 -0
- package/lib/features/webbuilder/components/BottomTabs.js +65 -0
- package/lib/features/webbuilder/components/BottomTabs.js.map +1 -0
- package/lib/features/webbuilder/components/BrandKitSheet.js +197 -0
- package/lib/features/webbuilder/components/BrandKitSheet.js.map +1 -0
- package/lib/features/webbuilder/components/CodeView.js +99 -0
- package/lib/features/webbuilder/components/CodeView.js.map +1 -0
- package/lib/features/webbuilder/components/Composer.js +217 -0
- package/lib/features/webbuilder/components/Composer.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewFrame.js +72 -0
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewPlaceholder.js +107 -0
- package/lib/features/webbuilder/components/PreviewPlaceholder.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewScreen.js +200 -0
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -0
- package/lib/features/webbuilder/components/ProjectChat.js +580 -0
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -0
- package/lib/features/webbuilder/components/ProjectsScreen.js +339 -0
- package/lib/features/webbuilder/components/ProjectsScreen.js.map +1 -0
- package/lib/features/webbuilder/components/PublishSheet.js +143 -0
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -0
- package/lib/features/webbuilder/components/SiteScoreSheet.js +73 -0
- package/lib/features/webbuilder/components/SiteScoreSheet.js.map +1 -0
- package/lib/features/webbuilder/components/StudioHome.js +367 -0
- package/lib/features/webbuilder/components/StudioHome.js.map +1 -0
- package/lib/features/webbuilder/components/TemplateCard.js +73 -0
- package/lib/features/webbuilder/components/TemplateCard.js.map +1 -0
- package/lib/features/webbuilder/components/TemplatesSheet.js +178 -0
- package/lib/features/webbuilder/components/TemplatesSheet.js.map +1 -0
- package/lib/features/webbuilder/components/VersionsSheet.js +57 -0
- package/lib/features/webbuilder/components/VersionsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/ui.js +291 -0
- package/lib/features/webbuilder/components/ui.js.map +1 -0
- package/lib/features/webbuilder/nativeWebBuilderRegistry.js +15 -0
- package/lib/features/webbuilder/nativeWebBuilderRegistry.js.map +1 -0
- package/lib/features/webbuilder/studioCatalog.js +147 -0
- package/lib/features/webbuilder/studioCatalog.js.map +1 -0
- package/lib/features/webbuilder/webbuilderPrompts.js +42 -0
- package/lib/features/webbuilder/webbuilderPrompts.js.map +1 -0
- package/lib/features/webbuilder/webbuilderTheme.js +63 -0
- package/lib/features/webbuilder/webbuilderTheme.js.map +1 -0
- package/lib/features/webbuilder/workflow.js +540 -0
- package/lib/features/webbuilder/workflow.js.map +1 -0
- package/lib/hooks/useChatApi.js +7 -2
- package/lib/hooks/useChatApi.js.map +1 -1
- package/lib/hooks/useChatStream.js +1 -1
- package/lib/hooks/useChatStream.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +106 -0
- package/lib/screens/WebBuilderNative/index.js +71 -0
- package/lib/screens/WebBuilderNative/index.js.map +1 -0
- package/lib/screens/WebBuilderNative/useCodeAssistantCatalog.js +45 -0
- package/lib/screens/WebBuilderNative/useCodeAssistantCatalog.js.map +1 -0
- package/lib/screens/WebBuilderNative/useWebBuilderGallery.js +125 -0
- package/lib/screens/WebBuilderNative/useWebBuilderGallery.js.map +1 -0
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +408 -0
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -0
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +88 -0
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {useState,useEffect,useCallback}from'react';import {sanitizeBrandKit}from'./studioCatalog.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var _a;
|
|
21
|
+
let AsyncStorage = null;
|
|
22
|
+
try {
|
|
23
|
+
AsyncStorage = (_a = require("@react-native-async-storage/async-storage").default) != null ? _a : null;
|
|
24
|
+
} catch (e) {
|
|
25
|
+
AsyncStorage = null;
|
|
26
|
+
}
|
|
27
|
+
const BRAND_KIT_KEY = "yantra.webbuilder.brandKit.v1";
|
|
28
|
+
async function readBrandKit() {
|
|
29
|
+
try {
|
|
30
|
+
const raw = await (AsyncStorage == null ? void 0 : AsyncStorage.getItem(BRAND_KIT_KEY));
|
|
31
|
+
return raw ? sanitizeBrandKit(JSON.parse(raw)) : null;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function writeBrandKit(kit) {
|
|
37
|
+
try {
|
|
38
|
+
if (!AsyncStorage) return false;
|
|
39
|
+
if (kit) await AsyncStorage.setItem(BRAND_KIT_KEY, JSON.stringify(kit));
|
|
40
|
+
else await AsyncStorage.removeItem(BRAND_KIT_KEY);
|
|
41
|
+
return true;
|
|
42
|
+
} catch (e) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function useBrandKit() {
|
|
47
|
+
const [brand, setBrand] = useState(null);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
let alive = true;
|
|
50
|
+
void readBrandKit().then((kit) => {
|
|
51
|
+
if (alive) setBrand(kit);
|
|
52
|
+
});
|
|
53
|
+
return () => {
|
|
54
|
+
alive = false;
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
57
|
+
const saveBrand = useCallback(async (kit) => {
|
|
58
|
+
const clean = kit ? sanitizeBrandKit(__spreadProps(__spreadValues({}, kit), {
|
|
59
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
60
|
+
})) : null;
|
|
61
|
+
const ok = await writeBrandKit(clean);
|
|
62
|
+
if (ok) setBrand(clean);
|
|
63
|
+
return ok;
|
|
64
|
+
}, []);
|
|
65
|
+
return {
|
|
66
|
+
brand,
|
|
67
|
+
saveBrand
|
|
68
|
+
};
|
|
69
|
+
}export{BRAND_KIT_KEY,readBrandKit,useBrandKit,writeBrandKit};//# sourceMappingURL=brandKitStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brandKitStorage.js","sources":["../../../src/features/webbuilder/brandKitStorage.ts"],"sourcesContent":["/**\n * The Brand kit on this device. The web keeps it per browser (localStorage)\n * until there is an account-level store; the phone keeps it the same way, in\n * AsyncStorage. Reads and writes never throw: a binary without the module, or\n * a failed write, just means no saved kit.\n */\nimport { useCallback, useEffect, useState } from 'react';\nimport { sanitizeBrandKit, type BrandKit } from './studioCatalog';\n\ntype StorageLike = {\n getItem: (key: string) => Promise<string | null>;\n setItem: (key: string, value: string) => Promise<void>;\n removeItem: (key: string) => Promise<void>;\n};\n\nlet AsyncStorage: StorageLike | null = null;\ntry {\n // eslint-disable-next-line @typescript-eslint/no-var-requires, global-require\n AsyncStorage = require('@react-native-async-storage/async-storage').default ?? null;\n} catch {\n AsyncStorage = null;\n}\n\n/** Same key as the web surface, so the two read alike. */\nexport const BRAND_KIT_KEY = 'yantra.webbuilder.brandKit.v1';\n\nexport async function readBrandKit(): Promise<BrandKit | null> {\n try {\n const raw = await AsyncStorage?.getItem(BRAND_KIT_KEY);\n return raw ? sanitizeBrandKit(JSON.parse(raw)) : null;\n } catch {\n return null;\n }\n}\n\nexport async function writeBrandKit(kit: BrandKit | null): Promise<boolean> {\n try {\n if (!AsyncStorage) return false;\n if (kit) await AsyncStorage.setItem(BRAND_KIT_KEY, JSON.stringify(kit));\n else await AsyncStorage.removeItem(BRAND_KIT_KEY);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function useBrandKit(): { brand: BrandKit | null; saveBrand: (kit: BrandKit | null) => Promise<boolean> } {\n const [brand, setBrand] = useState<BrandKit | null>(null);\n useEffect(() => {\n let alive = true;\n void readBrandKit().then((kit) => {\n if (alive) setBrand(kit);\n });\n return () => {\n alive = false;\n };\n }, []);\n const saveBrand = useCallback(async (kit: BrandKit | null) => {\n const clean = kit ? sanitizeBrandKit({ ...kit, updatedAt: new Date().toISOString() }) : null;\n const ok = await writeBrandKit(clean);\n if (ok) setBrand(clean);\n return ok;\n }, []);\n return { brand, saveBrand };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,EAAA;AAaA,IAAI,YAAmC,GAAA,IAAA;AACvC,IAAI;AAEF,EAAA,YAAA,GAAA,CAAe,EAAQ,GAAA,OAAA,CAAA,2CAA2C,CAAE,CAAA,OAAA,KAArD,IAAgE,GAAA,EAAA,GAAA,IAAA;AACjF,CAAQ,CAAA,OAAA,CAAA,EAAA;AACN,EAAe,YAAA,GAAA,IAAA;AACjB;AAGO,MAAM,aAAgB,GAAA;AAC7B,eAAsB,YAAyC,GAAA;AAC7D,EAAI,IAAA;AACF,IAAM,MAAA,GAAA,GAAM,OAAM,YAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,YAAA,CAAc,OAAQ,CAAA,aAAA,CAAA,CAAA;AACxC,IAAA,OAAO,MAAM,gBAAiB,CAAA,IAAA,CAAK,KAAM,CAAA,GAAG,CAAC,CAAI,GAAA,IAAA;AAAA,GAC3C,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,IAAA;AAAA;AAEX;AACA,eAAsB,cAAc,GAAwC,EAAA;AAC1E,EAAI,IAAA;AACF,IAAI,IAAA,CAAC,cAAqB,OAAA,KAAA;AAC1B,IAAI,IAAA,GAAA,QAAW,YAAa,CAAA,OAAA,CAAQ,eAAe,IAAK,CAAA,SAAA,CAAU,GAAG,CAAC,CAAA;AAAA,SAAO,MAAM,YAAa,CAAA,UAAA,CAAW,aAAa,CAAA;AACxH,IAAO,OAAA,IAAA;AAAA,GACD,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,KAAA;AAAA;AAEX;AACO,SAAS,WAGd,GAAA;AACA,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAA0B,IAAI,CAAA;AACxD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,KAAQ,GAAA,IAAA;AACZ,IAAK,KAAA,YAAA,EAAe,CAAA,IAAA,CAAK,CAAO,GAAA,KAAA;AAC9B,MAAI,IAAA,KAAA,WAAgB,GAAG,CAAA;AAAA,KACxB,CAAA;AACD,IAAA,OAAO,MAAM;AACX,MAAQ,KAAA,GAAA,KAAA;AAAA,KACV;AAAA,GACF,EAAG,EAAE,CAAA;AACL,EAAM,MAAA,SAAA,GAAY,WAAY,CAAA,OAAO,GAAyB,KAAA;AAC5D,IAAA,MAAM,KAAQ,GAAA,GAAA,GAAM,gBAAiB,CAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EAChC,GADgC,CAAA,EAAA;AAAA,MAEnC,SAAW,EAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,WAAY;AAAA,MACnC,CAAI,GAAA,IAAA;AACL,IAAM,MAAA,EAAA,GAAK,MAAM,aAAA,CAAc,KAAK,CAAA;AACpC,IAAI,IAAA,EAAA,WAAa,KAAK,CAAA;AACtB,IAAO,OAAA,EAAA;AAAA,GACT,EAAG,EAAE,CAAA;AACL,EAAO,OAAA;AAAA,IACL,KAAA;AAAA,IACA;AAAA,GACF;AACF"}
|
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
function asObject(value) {
|
|
2
|
+
if (!value) return null;
|
|
3
|
+
if (typeof value === "object") return Array.isArray(value) ? null : value;
|
|
4
|
+
if (typeof value === "string") {
|
|
5
|
+
const trimmed = value.trim();
|
|
6
|
+
if (!trimmed.startsWith("{")) return null;
|
|
7
|
+
try {
|
|
8
|
+
const parsed = JSON.parse(trimmed);
|
|
9
|
+
return parsed && typeof parsed === "object" ? parsed : null;
|
|
10
|
+
} catch (e) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function str(value) {
|
|
17
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
18
|
+
}
|
|
19
|
+
function accountRecords(record) {
|
|
20
|
+
return Object.values(record).map((v) => asObject(v)).filter((v) => v !== null);
|
|
21
|
+
}
|
|
22
|
+
function pick(records, key) {
|
|
23
|
+
var _a;
|
|
24
|
+
for (const record of records) {
|
|
25
|
+
const value = str(record[key]) || str((_a = asObject(record.fragment)) == null ? void 0 : _a[key]);
|
|
26
|
+
if (value) return value;
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
const LIVE_SANDBOX = /^https?:\/\/\d+-[a-z0-9]+(\.|\/|$)/i;
|
|
31
|
+
function sandboxPreviewUrl(url, sandboxId) {
|
|
32
|
+
const given = str(url);
|
|
33
|
+
if (given) {
|
|
34
|
+
if (/^https?:\/\/\d+-[a-z0-9]+\/?$/i.test(given)) return `${given.replace(/\/$/, "")}.e2b.dev`;
|
|
35
|
+
return given;
|
|
36
|
+
}
|
|
37
|
+
const id = str(sandboxId);
|
|
38
|
+
return id ? `https://3000-${id}.e2b.dev` : null;
|
|
39
|
+
}
|
|
40
|
+
function httpOrigin(value) {
|
|
41
|
+
const match = /^(https?:\/\/[^/?#]+)/i.exec((value != null ? value : "").trim());
|
|
42
|
+
return match && !LIVE_SANDBOX.test(match[1]) ? match[1] : null;
|
|
43
|
+
}
|
|
44
|
+
function coverDisplayUrl(cover, path, cdnOrigin) {
|
|
45
|
+
const raw = str(cover);
|
|
46
|
+
if (!raw || LIVE_SANDBOX.test(raw)) return null;
|
|
47
|
+
if (/^https?:\/\//i.test(raw)) return raw.split("?")[0];
|
|
48
|
+
const key = raw.replace(/^\/+/, "");
|
|
49
|
+
if (!/\/uploads\//i.test(`/${key}`) && !/\.(png|jpe?g|webp|gif|svg)$/i.test(key)) return null;
|
|
50
|
+
const origin = httpOrigin(path) || httpOrigin(cdnOrigin);
|
|
51
|
+
return origin ? `${origin}/${key}` : null;
|
|
52
|
+
}
|
|
53
|
+
function readFragment(post) {
|
|
54
|
+
if (!post || typeof post !== "object") return null;
|
|
55
|
+
const p = post;
|
|
56
|
+
const cfg = p.propsConfiguration || {};
|
|
57
|
+
const contents = asObject(cfg.contents) || asObject(cfg.content) || {};
|
|
58
|
+
const contentsProps = asObject(contents.props) || {};
|
|
59
|
+
const props = asObject(p.props) || {};
|
|
60
|
+
const fragment = asObject(contentsProps.fragment) || asObject(contents.fragment) || asObject(cfg.fragment) || asObject(props.fragment) || asObject(p.fragment) || null;
|
|
61
|
+
const f = fragment || {};
|
|
62
|
+
const sandboxUrl = str(f.sandboxUrl) || str(f.url) || str(p.sandboxUrl) || str(contents.sandboxUrl);
|
|
63
|
+
const sandboxId = str(f.sandboxId) || str(p.sandboxId) || str(contents.sandboxId) || str(cfg.sandboxId);
|
|
64
|
+
const publish = asObject(f.publish);
|
|
65
|
+
const liveUrl = str(f.customDomainUrl) || str(f.cloudflareUrl) || str(f.deployUrl) || str(publish == null ? void 0 : publish.url) || void 0;
|
|
66
|
+
const attachment = asObject(props.attachment) || asObject(contents.attachment) || {};
|
|
67
|
+
const isCreatingSandbox = f.isCreatingSandbox === true || contents.isCreatingSandbox === true || p.isCreatingSandbox === true;
|
|
68
|
+
const isDeploying = attachment.isDeploying === true || f.isDeploying === true;
|
|
69
|
+
if (!sandboxUrl && !sandboxId && !liveUrl && !fragment && !isCreatingSandbox && !isDeploying) return null;
|
|
70
|
+
const files = f.files && typeof f.files === "object" ? f.files : null;
|
|
71
|
+
const coverSources = [f, props, contents, contentsProps, p, ...accountRecords(props), ...accountRecords(contents)];
|
|
72
|
+
const coverImageUrl = [pick(coverSources, "coverImageUrl"), pick(coverSources, "previewImageUrl"), str(f.cover)].find((c) => c && !LIVE_SANDBOX.test(c));
|
|
73
|
+
return {
|
|
74
|
+
sandboxUrl,
|
|
75
|
+
sandboxId,
|
|
76
|
+
liveUrl,
|
|
77
|
+
files,
|
|
78
|
+
title: str(f.title),
|
|
79
|
+
projectId: str(f.projectId) || str(contentsProps.projectId),
|
|
80
|
+
template: str(f.templateId) || str(f.template) || str(contentsProps.template) || str(contents.template),
|
|
81
|
+
coverImageUrl,
|
|
82
|
+
coverImagePath: pick(coverSources, "coverImagePath"),
|
|
83
|
+
isCreatingSandbox,
|
|
84
|
+
isDeploying
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
const PREVIEW_LINK = /https?:\/\/\d+-([a-z0-9]+)\.e2b\.(?:dev|app)(?:\/[^\s)\]"'<>]*)?/i;
|
|
88
|
+
function linkFragment(post) {
|
|
89
|
+
const p = post != null ? post : {};
|
|
90
|
+
const text = typeof p.message === "string" ? p.message : "";
|
|
91
|
+
const match = PREVIEW_LINK.exec(text);
|
|
92
|
+
if (!match) return null;
|
|
93
|
+
return {
|
|
94
|
+
sandboxUrl: match[0].replace(/[.,;:!?]+$/, ""),
|
|
95
|
+
sandboxId: match[1],
|
|
96
|
+
isCreatingSandbox: false,
|
|
97
|
+
isDeploying: false
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function postTime(post) {
|
|
101
|
+
const p = post != null ? post : {};
|
|
102
|
+
const raw = p.updatedAt || p.createdAt;
|
|
103
|
+
const ms = typeof raw === "number" ? raw : Date.parse(String(raw != null ? raw : ""));
|
|
104
|
+
return Number.isFinite(ms) ? ms : 0;
|
|
105
|
+
}
|
|
106
|
+
function chronological(posts) {
|
|
107
|
+
return [...posts].sort((a, b) => postTime(a) - postTime(b));
|
|
108
|
+
}
|
|
109
|
+
function isUserPost(post) {
|
|
110
|
+
var _a, _b, _c, _d, _e;
|
|
111
|
+
const p = post != null ? post : {};
|
|
112
|
+
const contents = asObject((_a = p.propsConfiguration) == null ? void 0 : _a.contents) || {};
|
|
113
|
+
const props = asObject(p.props) || {};
|
|
114
|
+
const role = String((_e = (_d = (_b = props.role) != null ? _b : contents.role) != null ? _d : (_c = asObject(contents.props)) == null ? void 0 : _c.role) != null ? _e : "").toUpperCase();
|
|
115
|
+
return role === "USER";
|
|
116
|
+
}
|
|
117
|
+
const DEFAULT_TEMPLATE = "vite-react";
|
|
118
|
+
function buildsFromPosts(posts, fallbackTitle, cdnOrigin) {
|
|
119
|
+
var _a;
|
|
120
|
+
const fallback = fallbackTitle != null ? fallbackTitle : "Web app";
|
|
121
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
122
|
+
let lastKey = null;
|
|
123
|
+
const fragments = chronological(posts).filter((post) => !isUserPost(post)).map((post) => {
|
|
124
|
+
var _a2;
|
|
125
|
+
return {
|
|
126
|
+
post,
|
|
127
|
+
fragment: (_a2 = readFragment(post)) != null ? _a2 : linkFragment(post)
|
|
128
|
+
};
|
|
129
|
+
}).filter((row) => row.fragment !== null && Boolean(row.fragment.sandboxUrl || row.fragment.liveUrl || row.fragment.coverImageUrl));
|
|
130
|
+
for (const {
|
|
131
|
+
post,
|
|
132
|
+
fragment
|
|
133
|
+
} of fragments) {
|
|
134
|
+
const previewUrl = sandboxPreviewUrl(fragment.sandboxUrl, fragment.sandboxId);
|
|
135
|
+
const key = fragment.sandboxId || previewUrl || "";
|
|
136
|
+
const target = key || (fragment.liveUrl || fragment.coverImageUrl ? lastKey : null);
|
|
137
|
+
if (target) {
|
|
138
|
+
const existing = byKey.get(target);
|
|
139
|
+
byKey.set(target, {
|
|
140
|
+
key: target,
|
|
141
|
+
title: fragment.title || (existing == null ? void 0 : existing.title) || fallback,
|
|
142
|
+
previewUrl: previewUrl || (existing == null ? void 0 : existing.previewUrl) || null,
|
|
143
|
+
sandboxId: fragment.sandboxId || (existing == null ? void 0 : existing.sandboxId) || null,
|
|
144
|
+
projectId: fragment.projectId || (existing == null ? void 0 : existing.projectId) || null,
|
|
145
|
+
liveUrl: fragment.liveUrl || (existing == null ? void 0 : existing.liveUrl) || null,
|
|
146
|
+
files: fragment.files || (existing == null ? void 0 : existing.files) || null,
|
|
147
|
+
templateId: fragment.template || (existing == null ? void 0 : existing.templateId) || DEFAULT_TEMPLATE,
|
|
148
|
+
coverUrl: coverDisplayUrl(fragment.coverImageUrl, fragment.coverImagePath, cdnOrigin) || (existing == null ? void 0 : existing.coverUrl) || null,
|
|
149
|
+
updatedAt: Math.max(postTime(post), (_a = existing == null ? void 0 : existing.updatedAt) != null ? _a : 0)
|
|
150
|
+
});
|
|
151
|
+
lastKey = target;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return [...byKey.values()].filter((b) => b.previewUrl || b.liveUrl).sort((a, b) => b.updatedAt - a.updatedAt);
|
|
155
|
+
}
|
|
156
|
+
function pendingWork(posts) {
|
|
157
|
+
const newest = chronological(posts).map((post) => readFragment(post)).filter((f) => f !== null).pop();
|
|
158
|
+
if (!newest) return null;
|
|
159
|
+
if (newest.isCreatingSandbox && !newest.sandboxUrl && !newest.sandboxId) return "creating";
|
|
160
|
+
if (newest.isDeploying && !newest.liveUrl) return "publishing";
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
function isGenericTitle(title) {
|
|
164
|
+
const t = (title || "").trim().toLowerCase();
|
|
165
|
+
return !t || t === "generated page" || t === "generated project" || t === "generated with cdecli" || t === "ai assistant" || t === "web app" || /^build \d+$/.test(t) || /^build\s+me\b/.test(t) || /^remix\s+the\b/.test(t) || /^(build|chat)[- ]channel\b/.test(t) || t.startsWith("selected skill") || /^code[\s_-]?assist/.test(t);
|
|
166
|
+
}
|
|
167
|
+
const TITLE_STOP_WORDS = /* @__PURE__ */ new Set(["a", "an", "the", "create", "build", "make", "please", "me", "my", "for", "with", "simple", "using", "from", "template", "to", "and", "or", "remix", "yantra"]);
|
|
168
|
+
function titleCase(words) {
|
|
169
|
+
return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(" ");
|
|
170
|
+
}
|
|
171
|
+
function cleanPrompt(text) {
|
|
172
|
+
return text.replace(/^\[webbuilder context:[^\]]*\]\s*/i, "").replace(/^build\s*me\s*:\s*/i, "").replace(/\s+/g, " ").trim();
|
|
173
|
+
}
|
|
174
|
+
function titleFromPrompt(message) {
|
|
175
|
+
var _a, _b;
|
|
176
|
+
const raw = (message || "").replace(/^\[webbuilder context:[^\]]*\]\s*/i, "").trim();
|
|
177
|
+
if (!raw) return null;
|
|
178
|
+
const buildMe = (_b = (_a = raw.match(/^\s*Build me:\s*(.+)$/im)) == null ? void 0 : _a[1]) == null ? void 0 : _b.trim();
|
|
179
|
+
if (!buildMe && /^(change|update|rename|fix|edit|add|remove|delete|improve|make|refactor)\b/i.test(raw)) {
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
const source = (buildMe || raw.split(/\n+/)[0] || "").replace(/^["']|["']$/g, "");
|
|
183
|
+
const words = source.replace(/[^\w\s-]/g, " ").split(/\s+/).filter((w) => w.length > 1 && !TITLE_STOP_WORDS.has(w.toLowerCase())).slice(0, 3);
|
|
184
|
+
if (!words.length) return null;
|
|
185
|
+
const title = titleCase(words);
|
|
186
|
+
return isGenericTitle(title) ? null : title;
|
|
187
|
+
}
|
|
188
|
+
function titleFromPackageJson(files) {
|
|
189
|
+
var _a;
|
|
190
|
+
if (!files) return null;
|
|
191
|
+
const raw = (_a = Object.entries(files).find(([path]) => /(^|\/)package\.json$/.test(path))) == null ? void 0 : _a[1];
|
|
192
|
+
if (!raw) return null;
|
|
193
|
+
try {
|
|
194
|
+
const name = String(JSON.parse(raw).name || "").trim();
|
|
195
|
+
if (!name || name === "vite-react" || name === "project") return null;
|
|
196
|
+
return name.replace(/^@[^/]+\//, "").replace(/[-_]+/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
197
|
+
} catch (e) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function resolveSiteTitle(opts) {
|
|
202
|
+
const candidates = [opts.fragmentTitle, titleFromPrompt(opts.userPrompt), opts.channelTitle, titleFromPackageJson(opts.files)];
|
|
203
|
+
const found = candidates.find((c) => c && !isGenericTitle(c));
|
|
204
|
+
return (found || "Generated Page").trim();
|
|
205
|
+
}
|
|
206
|
+
function lastMessageHasCover(channel) {
|
|
207
|
+
var _a;
|
|
208
|
+
return Boolean((_a = readFragment(channel.lastMessage)) == null ? void 0 : _a.coverImageUrl);
|
|
209
|
+
}
|
|
210
|
+
function projectFromPosts(channel, posts, cdnOrigin) {
|
|
211
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
212
|
+
const channelId = str(channel.id);
|
|
213
|
+
if (!channelId) return null;
|
|
214
|
+
const builds = buildsFromPosts(posts, "", cdnOrigin);
|
|
215
|
+
const latest = builds[0];
|
|
216
|
+
if (!latest) return null;
|
|
217
|
+
const userPrompts = chronological(posts).filter((post) => isUserPost(post) && str(post.message)).map((post) => String(post.message));
|
|
218
|
+
const brief = (_a = userPrompts.find((m) => /build\s*me\s*:/i.test(m))) != null ? _a : userPrompts[0];
|
|
219
|
+
const channelTitle = [channel.displayName, channel.title].map((t) => str(t)).find((t) => t && !isGenericTitle(t));
|
|
220
|
+
const title = resolveSiteTitle({
|
|
221
|
+
fragmentTitle: latest.title,
|
|
222
|
+
channelTitle,
|
|
223
|
+
userPrompt: brief,
|
|
224
|
+
files: latest.files
|
|
225
|
+
});
|
|
226
|
+
const updated = Date.parse(String((_c = (_b = channel.updatedAt) != null ? _b : channel.createdAt) != null ? _c : ""));
|
|
227
|
+
return {
|
|
228
|
+
channelId,
|
|
229
|
+
title,
|
|
230
|
+
updatedAt: Math.max(Number.isFinite(updated) ? updated : 0, latest.updatedAt),
|
|
231
|
+
previewUrl: latest.previewUrl,
|
|
232
|
+
liveUrl: (_e = (_d = builds.find((b) => b.liveUrl)) == null ? void 0 : _d.liveUrl) != null ? _e : null,
|
|
233
|
+
coverUrl: (_g = (_f = builds.find((b) => b.coverUrl)) == null ? void 0 : _f.coverUrl) != null ? _g : null,
|
|
234
|
+
templateId: latest.templateId
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
function cacheBustedUrl(url, nonce) {
|
|
238
|
+
const [base, hash = ""] = url.split("#");
|
|
239
|
+
const clean = base.replace(/([?&])wb=[^&]*(&|$)/, "$1").replace(/[?&]$/, "");
|
|
240
|
+
const sep = clean.includes("?") ? "&" : "?";
|
|
241
|
+
return `${clean}${sep}wb=${nonce}${hash ? `#${hash}` : ""}`;
|
|
242
|
+
}
|
|
243
|
+
function publishSlug(title) {
|
|
244
|
+
const slug = title.toLowerCase().normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 58).replace(/-+$/, "");
|
|
245
|
+
return slug || "my-site";
|
|
246
|
+
}
|
|
247
|
+
function isValidPublishSlug(value) {
|
|
248
|
+
return /^[a-z0-9](?:[a-z0-9-]{0,56}[a-z0-9])?$/.test(value);
|
|
249
|
+
}
|
|
250
|
+
function displayHost(url) {
|
|
251
|
+
const match = /^https?:\/\/([^/?#]+)/i.exec((url != null ? url : "").trim());
|
|
252
|
+
return match ? match[1] : (url != null ? url : "").trim();
|
|
253
|
+
}
|
|
254
|
+
function relativeTime(ms, now = Date.now()) {
|
|
255
|
+
if (!ms) return "";
|
|
256
|
+
const diff = Math.max(0, now - ms);
|
|
257
|
+
const min = Math.floor(diff / 6e4);
|
|
258
|
+
if (min < 1) return "just now";
|
|
259
|
+
if (min < 60) return `${min} min ago`;
|
|
260
|
+
const hours = Math.floor(min / 60);
|
|
261
|
+
if (hours < 24) return `${hours} h ago`;
|
|
262
|
+
if (hours < 48) return "Yesterday";
|
|
263
|
+
const d = new Date(ms);
|
|
264
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
265
|
+
return `${d.getDate()} ${months[d.getMonth()]}`;
|
|
266
|
+
}
|
|
267
|
+
function isThinkingPost(post) {
|
|
268
|
+
var _a, _b, _c;
|
|
269
|
+
const p = post != null ? post : {};
|
|
270
|
+
const props = asObject(p.props) || {};
|
|
271
|
+
const attachment = asObject(props.attachment) || {};
|
|
272
|
+
const msg = String((_a = p.message) != null ? _a : "").trim().toLowerCase();
|
|
273
|
+
return String((_b = p.type) != null ? _b : "").toUpperCase() === "THINKING" || Boolean((_c = props.thinking) != null ? _c : props.isThinking) || props.kind === "thinking" || Boolean(attachment.isThinking) || msg === "thinking..." || msg === "initializing..." || msg === "initializing\u2026";
|
|
274
|
+
}
|
|
275
|
+
function readFragmentStatus(p) {
|
|
276
|
+
var _a, _b, _c, _d;
|
|
277
|
+
const contents = asObject((_a = p.propsConfiguration) == null ? void 0 : _a.contents) || {};
|
|
278
|
+
return str((_c = asObject((_b = asObject(contents.props)) == null ? void 0 : _b.fragment)) == null ? void 0 : _c.statusText) || str((_d = asObject(contents.fragment)) == null ? void 0 : _d.statusText);
|
|
279
|
+
}
|
|
280
|
+
function progressText(post) {
|
|
281
|
+
var _a, _b, _c;
|
|
282
|
+
const p = post != null ? post : {};
|
|
283
|
+
const props = asObject(p.props) || {};
|
|
284
|
+
const thought = str((_a = asObject(props.attachment)) == null ? void 0 : _a.thought);
|
|
285
|
+
if (thought) return thought;
|
|
286
|
+
const status = str((_b = asObject(props.fragment)) == null ? void 0 : _b.statusText) || str(readFragmentStatus(p));
|
|
287
|
+
if (status) return status;
|
|
288
|
+
return isThinkingPost(post) ? (_c = str(p.message)) != null ? _c : null : null;
|
|
289
|
+
}
|
|
290
|
+
function isErrorPost(post) {
|
|
291
|
+
var _a, _b;
|
|
292
|
+
const p = post != null ? post : {};
|
|
293
|
+
const props = asObject(p.props) || {};
|
|
294
|
+
const contents = asObject((_a = p.propsConfiguration) == null ? void 0 : _a.contents) || {};
|
|
295
|
+
const f = asObject(props.fragment) || asObject((_b = asObject(contents.props)) == null ? void 0 : _b.fragment) || asObject(contents.fragment) || {};
|
|
296
|
+
return f.isError === true || f.type === "error";
|
|
297
|
+
}
|
|
298
|
+
function transcriptFromPosts(posts) {
|
|
299
|
+
var _a;
|
|
300
|
+
const out = [];
|
|
301
|
+
for (const post of chronological(posts)) {
|
|
302
|
+
const p = post;
|
|
303
|
+
const text = str(p.message);
|
|
304
|
+
if (text && !isThinkingPost(post)) {
|
|
305
|
+
const user = isUserPost(post);
|
|
306
|
+
out.push({
|
|
307
|
+
id: String((_a = p.id) != null ? _a : `${user ? "u" : "a"}-${out.length}`),
|
|
308
|
+
role: user ? "user" : "assistant",
|
|
309
|
+
content: user ? cleanPrompt(text) || text : text,
|
|
310
|
+
createdAt: postTime(post)
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return out;
|
|
315
|
+
}
|
|
316
|
+
function turnState(posts, since) {
|
|
317
|
+
var _a, _b;
|
|
318
|
+
const after = chronological(posts).filter((post) => postTime(post) >= since - 2e3);
|
|
319
|
+
let progress = null;
|
|
320
|
+
for (const post of after) {
|
|
321
|
+
if (!isUserPost(post)) {
|
|
322
|
+
if (isErrorPost(post)) {
|
|
323
|
+
const p = post;
|
|
324
|
+
return {
|
|
325
|
+
status: "failed",
|
|
326
|
+
progress: null,
|
|
327
|
+
error: (_a = str(p.message)) != null ? _a : "The build failed."
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
const fragment = readFragment(post);
|
|
331
|
+
if (fragment && (fragment.sandboxUrl || fragment.liveUrl) && !isThinkingPost(post)) {
|
|
332
|
+
return {
|
|
333
|
+
status: "done",
|
|
334
|
+
progress: null,
|
|
335
|
+
error: null
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
progress = (_b = progressText(post)) != null ? _b : progress;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
const newest = after.filter((post) => !isUserPost(post)).pop();
|
|
342
|
+
if (newest && !isThinkingPost(newest) && !progressText(newest) && str(newest.message)) {
|
|
343
|
+
return {
|
|
344
|
+
status: "done",
|
|
345
|
+
progress: null,
|
|
346
|
+
error: null
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
return {
|
|
350
|
+
status: "running",
|
|
351
|
+
progress,
|
|
352
|
+
error: null
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function hasWorkflowPosts(posts) {
|
|
356
|
+
return posts.some((post) => readFragment(post) !== null);
|
|
357
|
+
}
|
|
358
|
+
function stripAgentNote(content) {
|
|
359
|
+
return content.replace(/\n*\[Template\][\s\S]*$/, "").trim();
|
|
360
|
+
}export{DEFAULT_TEMPLATE,buildsFromPosts,cacheBustedUrl,cleanPrompt,coverDisplayUrl,displayHost,hasWorkflowPosts,isErrorPost,isGenericTitle,isThinkingPost,isValidPublishSlug,lastMessageHasCover,pendingWork,progressText,projectFromPosts,publishSlug,readFragment,relativeTime,resolveSiteTitle,sandboxPreviewUrl,stripAgentNote,titleFromPrompt,transcriptFromPosts,turnState};//# sourceMappingURL=buildFragments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildFragments.js","sources":["../../../src/features/webbuilder/buildFragments.ts"],"sourcesContent":["/**\n * Reads builds out of a build chat's posts.\n *\n * The build workflow posts its result as a \"fragment\" on an assistant post:\n * sandbox id and preview URL, the source files, and after a publish the live\n * address. Native twin of the web host's `creationsFromMessages`\n * (browser `pages/webbuilder/remoteWebbuilder.ts`) and the surface's\n * `extractFragmentFromSource` lookup order: `propsConfiguration.contents`\n * first (where the real fragment lives; `props` is account-scoped), then the\n * post's own fields. Pure, so the host and jest can both use it.\n */\nimport type { WebBuilderBuild, WebBuilderProject } from './types';\n\ntype Loose = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any\n\ninterface Fragment {\n sandboxUrl?: string;\n sandboxId?: string;\n liveUrl?: string;\n files?: Record<string, string> | null;\n title?: string;\n projectId?: string;\n /** Stack the build was made from (`vite-react`, `nextjs`), shown on the tile. */\n template?: string;\n /** Screenshot of the build: an object key or a full URL. */\n coverImageUrl?: string;\n /** CDN origin the cover key was stored under. */\n coverImagePath?: string;\n isCreatingSandbox: boolean;\n isDeploying: boolean;\n}\n\n/** `contents` arrives as an object or, from some resolvers, as JSON text. */\nfunction asObject(value: unknown): Loose | null {\n if (!value) return null;\n if (typeof value === 'object') return Array.isArray(value) ? null : (value as Loose);\n if (typeof value === 'string') {\n const trimmed = value.trim();\n if (!trimmed.startsWith('{')) return null;\n try {\n const parsed = JSON.parse(trimmed);\n return parsed && typeof parsed === 'object' ? (parsed as Loose) : null;\n } catch {\n return null;\n }\n }\n return null;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\n/** `props` is account-scoped (`props[\"<accountId>\"] = {…}`): the records one level down. */\nfunction accountRecords(record: Loose): Loose[] {\n return Object.values(record)\n .map((v) => asObject(v))\n .filter((v): v is Loose => v !== null);\n}\n\n/** First non-empty string among `key` on each record (and on its `fragment`). */\nfunction pick(records: Loose[], key: string): string | undefined {\n for (const record of records) {\n const value = str(record[key]) || str(asObject(record.fragment)?.[key]);\n if (value) return value;\n }\n return undefined;\n}\n\n/** A live sandbox URL (`https://3000-<id>.e2b.dev`) - never a cover. */\nconst LIVE_SANDBOX = /^https?:\\/\\/\\d+-[a-z0-9]+(\\.|\\/|$)/i;\n\n/**\n * The preview origin for a sandbox. A bare `https://3000-<id>` (no domain) is\n * the E2B default domain, as the surface's `liveSandboxIframeSrc` maps it.\n */\nexport function sandboxPreviewUrl(url: string | undefined, sandboxId: string | undefined): string | null {\n const given = str(url);\n if (given) {\n if (/^https?:\\/\\/\\d+-[a-z0-9]+\\/?$/i.test(given)) return `${given.replace(/\\/$/, '')}.e2b.dev`;\n return given;\n }\n const id = str(sandboxId);\n return id ? `https://3000-${id}.e2b.dev` : null;\n}\n\nfunction httpOrigin(value: string | undefined): string | null {\n const match = /^(https?:\\/\\/[^/?#]+)/i.exec((value ?? '').trim());\n return match && !LIVE_SANDBOX.test(match[1]) ? match[1] : null;\n}\n\n/**\n * The image to show for a cover - the web `resolveCoverDisplayUrl`: an object\n * key joined to the origin it was stored under, else to the app's CDN, else a\n * full https URL as given. A live sandbox URL is never a cover.\n */\nexport function coverDisplayUrl(cover: string | undefined, path?: string, cdnOrigin?: string): string | null {\n const raw = str(cover);\n if (!raw || LIVE_SANDBOX.test(raw)) return null;\n if (/^https?:\\/\\//i.test(raw)) return raw.split('?')[0];\n const key = raw.replace(/^\\/+/, '');\n if (!/\\/uploads\\//i.test(`/${key}`) && !/\\.(png|jpe?g|webp|gif|svg)$/i.test(key)) return null;\n const origin = httpOrigin(path) || httpOrigin(cdnOrigin);\n return origin ? `${origin}/${key}` : null;\n}\n\nexport function readFragment(post: unknown): Fragment | null {\n if (!post || typeof post !== 'object') return null;\n const p = post as Loose;\n const cfg: Loose = p.propsConfiguration || {};\n const contents: Loose = asObject(cfg.contents) || asObject(cfg.content) || {};\n const contentsProps: Loose = asObject(contents.props) || {};\n const props: Loose = asObject(p.props) || {};\n const fragment: Loose | null =\n asObject(contentsProps.fragment) ||\n asObject(contents.fragment) ||\n asObject(cfg.fragment) ||\n asObject(props.fragment) ||\n asObject(p.fragment) ||\n null;\n const f: Loose = fragment || {};\n const sandboxUrl = str(f.sandboxUrl) || str(f.url) || str(p.sandboxUrl) || str(contents.sandboxUrl);\n const sandboxId = str(f.sandboxId) || str(p.sandboxId) || str(contents.sandboxId) || str(cfg.sandboxId);\n const publish = asObject(f.publish);\n const liveUrl =\n str(f.customDomainUrl) || str(f.cloudflareUrl) || str(f.deployUrl) || str(publish?.url) || undefined;\n const attachment = asObject(props.attachment) || asObject(contents.attachment) || {};\n const isCreatingSandbox =\n f.isCreatingSandbox === true || contents.isCreatingSandbox === true || p.isCreatingSandbox === true;\n const isDeploying = attachment.isDeploying === true || f.isDeploying === true;\n if (!sandboxUrl && !sandboxId && !liveUrl && !fragment && !isCreatingSandbox && !isDeploying) return null;\n const files = f.files && typeof f.files === 'object' ? (f.files as Record<string, string>) : null;\n // The cover rides on the fragment, the post's props, or an account record of either.\n const coverSources = [f, props, contents, contentsProps, p, ...accountRecords(props), ...accountRecords(contents)];\n const coverImageUrl = [\n pick(coverSources, 'coverImageUrl'),\n pick(coverSources, 'previewImageUrl'),\n str(f.cover),\n ].find((c) => c && !LIVE_SANDBOX.test(c));\n return {\n sandboxUrl,\n sandboxId,\n liveUrl,\n files,\n title: str(f.title),\n projectId: str(f.projectId) || str(contentsProps.projectId),\n template: str(f.templateId) || str(f.template) || str(contentsProps.template) || str(contents.template),\n coverImageUrl,\n coverImagePath: pick(coverSources, 'coverImagePath'),\n isCreatingSandbox,\n isDeploying,\n };\n}\n\n/** A live sandbox preview the agent named in its reply (`https://3000-<id>.e2b.dev/…`). */\nconst PREVIEW_LINK = /https?:\\/\\/\\d+-([a-z0-9]+)\\.e2b\\.(?:dev|app)(?:\\/[^\\s)\\]\"'<>]*)?/i;\n\n/**\n * A build named only in the agent's words: the agent-chat lane (template remix,\n * questions answered by building) replies with the preview link and posts no\n * fragment, so the link is the build.\n */\nfunction linkFragment(post: unknown): Fragment | null {\n const p = (post ?? {}) as Loose;\n const text = typeof p.message === 'string' ? p.message : '';\n const match = PREVIEW_LINK.exec(text);\n if (!match) return null;\n return {\n sandboxUrl: match[0].replace(/[.,;:!?]+$/, ''),\n sandboxId: match[1],\n isCreatingSandbox: false,\n isDeploying: false,\n };\n}\n\nfunction postTime(post: unknown): number {\n const p = (post ?? {}) as Loose;\n const raw = p.updatedAt || p.createdAt;\n const ms = typeof raw === 'number' ? raw : Date.parse(String(raw ?? ''));\n return Number.isFinite(ms) ? ms : 0;\n}\n\n/** Posts in the order they happened (the query is not sorted). */\nfunction chronological(posts: readonly unknown[]): unknown[] {\n return [...posts].sort((a, b) => postTime(a) - postTime(b));\n}\n\nfunction isUserPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const props = asObject(p.props) || {};\n const role = String(props.role ?? contents.role ?? asObject(contents.props)?.role ?? '').toUpperCase();\n return role === 'USER';\n}\n\n/** The stack label the web tile shows when a build does not name one. */\nexport const DEFAULT_TEMPLATE = 'vite-react';\n\n/**\n * Newest-first builds of one site. A later post about the same sandbox (a\n * publish, a re-post, its screenshot) updates that build.\n */\nexport function buildsFromPosts(\n posts: readonly unknown[],\n fallbackTitle?: string,\n cdnOrigin?: string,\n): WebBuilderBuild[] {\n const fallback = fallbackTitle ?? 'Web app';\n const byKey = new Map<string, WebBuilderBuild>();\n let lastKey: string | null = null;\n // The web hydrate's rule: a build is an ASSISTANT post with something to show - a\n // preview URL, a live address or a screenshot. A user turn carries the sandbox it\n // edits (and a bare sandbox id is a turn in flight), neither is a build.\n const fragments = chronological(posts)\n .filter((post) => !isUserPost(post))\n .map((post) => ({ post, fragment: readFragment(post) ?? linkFragment(post) }))\n .filter(\n (row): row is { post: unknown; fragment: Fragment } =>\n row.fragment !== null &&\n Boolean(row.fragment.sandboxUrl || row.fragment.liveUrl || row.fragment.coverImageUrl),\n );\n for (const { post, fragment } of fragments) {\n const previewUrl = sandboxPreviewUrl(fragment.sandboxUrl, fragment.sandboxId);\n const key = fragment.sandboxId || previewUrl || '';\n // A publish or screenshot post may name no sandbox: it belongs to the latest build.\n const target: string | null = key || (fragment.liveUrl || fragment.coverImageUrl ? lastKey : null);\n if (target) {\n const existing = byKey.get(target);\n byKey.set(target, {\n key: target,\n title: fragment.title || existing?.title || fallback,\n previewUrl: previewUrl || existing?.previewUrl || null,\n sandboxId: fragment.sandboxId || existing?.sandboxId || null,\n projectId: fragment.projectId || existing?.projectId || null,\n liveUrl: fragment.liveUrl || existing?.liveUrl || null,\n files: fragment.files || existing?.files || null,\n templateId: fragment.template || existing?.templateId || DEFAULT_TEMPLATE,\n coverUrl:\n coverDisplayUrl(fragment.coverImageUrl, fragment.coverImagePath, cdnOrigin) ||\n existing?.coverUrl ||\n null,\n updatedAt: Math.max(postTime(post), existing?.updatedAt ?? 0),\n });\n lastKey = target;\n }\n }\n return [...byKey.values()].filter((b) => b.previewUrl || b.liveUrl).sort((a, b) => b.updatedAt - a.updatedAt);\n}\n\n/** The newest post flags a sandbox still being created or a publish still running. */\nexport function pendingWork(posts: readonly unknown[]): 'creating' | 'publishing' | null {\n const newest = chronological(posts)\n .map((post) => readFragment(post))\n .filter((f): f is Fragment => f !== null)\n .pop();\n if (!newest) return null;\n if (newest.isCreatingSandbox && !newest.sandboxUrl && !newest.sandboxId) return 'creating';\n if (newest.isDeploying && !newest.liveUrl) return 'publishing';\n return null;\n}\n\n// ── Titles: the web surface's `resolveArtifactTitle` rules ─────────────────\n\n/** Not a product name: what the workflow and the chat call a site before it has one. */\nexport function isGenericTitle(title?: string | null): boolean {\n const t = (title || '').trim().toLowerCase();\n return (\n !t ||\n t === 'generated page' ||\n t === 'generated project' ||\n t === 'generated with cdecli' ||\n t === 'ai assistant' ||\n t === 'web app' ||\n /^build \\d+$/.test(t) ||\n /^build\\s+me\\b/.test(t) ||\n /^remix\\s+the\\b/.test(t) ||\n /^(build|chat)[- ]channel\\b/.test(t) ||\n t.startsWith('selected skill') ||\n /^code[\\s_-]?assist/.test(t)\n );\n}\n\nconst TITLE_STOP_WORDS = new Set([\n 'a',\n 'an',\n 'the',\n 'create',\n 'build',\n 'make',\n 'please',\n 'me',\n 'my',\n 'for',\n 'with',\n 'simple',\n 'using',\n 'from',\n 'template',\n 'to',\n 'and',\n 'or',\n 'remix',\n 'yantra',\n]);\n\nfunction titleCase(words: string[]): string {\n return words.map((w) => w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()).join(' ');\n}\n\n/** The person's words, without the internal lines a turn carries. */\nexport function cleanPrompt(text: string): string {\n return text\n .replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '')\n .replace(/^build\\s*me\\s*:\\s*/i, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n\n/**\n * Product name from a brief: \"Build me: todo app\" -> \"Todo App\". An edit\n * (\"make the header blue\") is not a name.\n */\nexport function titleFromPrompt(message?: string | null): string | null {\n const raw = (message || '').replace(/^\\[webbuilder context:[^\\]]*\\]\\s*/i, '').trim();\n if (!raw) return null;\n const buildMe = raw.match(/^\\s*Build me:\\s*(.+)$/im)?.[1]?.trim();\n if (!buildMe && /^(change|update|rename|fix|edit|add|remove|delete|improve|make|refactor)\\b/i.test(raw)) {\n return null;\n }\n const source = (buildMe || raw.split(/\\n+/)[0] || '').replace(/^[\"']|[\"']$/g, '');\n const words = source\n .replace(/[^\\w\\s-]/g, ' ')\n .split(/\\s+/)\n .filter((w) => w.length > 1 && !TITLE_STOP_WORDS.has(w.toLowerCase()))\n .slice(0, 3);\n if (!words.length) return null;\n const title = titleCase(words);\n return isGenericTitle(title) ? null : title;\n}\n\n/** `package.json` name of the build (\"bakery-site\" -> \"Bakery Site\"). */\nfunction titleFromPackageJson(files?: Record<string, string> | null): string | null {\n if (!files) return null;\n const raw = Object.entries(files).find(([path]) => /(^|\\/)package\\.json$/.test(path))?.[1];\n if (!raw) return null;\n try {\n const name = String((JSON.parse(raw) as { name?: string }).name || '').trim();\n if (!name || name === 'vite-react' || name === 'project') return null;\n return name\n .replace(/^@[^/]+\\//, '')\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\n } catch {\n return null;\n }\n}\n\n/** The build's own title, then the brief's product name, the chat's name, the package name. */\nexport function resolveSiteTitle(opts: {\n fragmentTitle?: string | null;\n channelTitle?: string | null;\n userPrompt?: string | null;\n files?: Record<string, string> | null;\n}): string {\n const candidates = [\n opts.fragmentTitle,\n titleFromPrompt(opts.userPrompt),\n opts.channelTitle,\n titleFromPackageJson(opts.files),\n ];\n const found = candidates.find((c) => c && !isGenericTitle(c));\n return (found || 'Generated Page').trim();\n}\n\n// ── Sites ──────────────────────────────────────────────────────────────────\n\nexport interface ChannelLike {\n id?: string | null;\n title?: string | null;\n displayName?: string | null;\n updatedAt?: unknown;\n createdAt?: unknown;\n lastMessage?: unknown;\n}\n\n/** True when the newest build in `lastMessage` already carries a cover - the web skips the thread read then. */\nexport function lastMessageHasCover(channel: ChannelLike): boolean {\n return Boolean(readFragment(channel.lastMessage)?.coverImageUrl);\n}\n\n/**\n * A site from one chat's posts, the way the web gallery hydrates a tile: only\n * a chat with a build is a site; its name follows `resolveSiteTitle`.\n */\nexport function projectFromPosts(\n channel: ChannelLike,\n posts: readonly unknown[],\n cdnOrigin?: string,\n): WebBuilderProject | null {\n const channelId = str(channel.id);\n if (!channelId) return null;\n const builds = buildsFromPosts(posts, '', cdnOrigin);\n const latest = builds[0];\n if (!latest) return null;\n const userPrompts = chronological(posts)\n .filter((post) => isUserPost(post) && str((post as Loose).message))\n .map((post) => String((post as Loose).message));\n // The brief names the product (\"Build me: …\"); a later message (\"the live preview is\n // not loading\") never does, so only the brief - or failing that the first ask - counts.\n const brief = userPrompts.find((m) => /build\\s*me\\s*:/i.test(m)) ?? userPrompts[0];\n const channelTitle = [channel.displayName, channel.title].map((t) => str(t)).find((t) => t && !isGenericTitle(t));\n const title = resolveSiteTitle({\n fragmentTitle: latest.title,\n channelTitle,\n userPrompt: brief,\n files: latest.files,\n });\n const updated = Date.parse(String(channel.updatedAt ?? channel.createdAt ?? ''));\n return {\n channelId,\n title,\n updatedAt: Math.max(Number.isFinite(updated) ? updated : 0, latest.updatedAt),\n previewUrl: latest.previewUrl,\n liveUrl: builds.find((b) => b.liveUrl)?.liveUrl ?? null,\n coverUrl: builds.find((b) => b.coverUrl)?.coverUrl ?? null,\n templateId: latest.templateId,\n };\n}\n\n/** `?wb=<n>` on the preview so a rebuilt sandbox is fetched again, not served from cache. */\nexport function cacheBustedUrl(url: string, nonce: number | string): string {\n const [base, hash = ''] = url.split('#');\n const clean = base.replace(/([?&])wb=[^&]*(&|$)/, '$1').replace(/[?&]$/, '');\n const sep = clean.includes('?') ? '&' : '?';\n return `${clean}${sep}wb=${nonce}${hash ? `#${hash}` : ''}`;\n}\n\n/**\n * The publish name the web dialog suggests: the site's title as a slug,\n * `[a-z0-9-]`, at most 58 characters (`<name>.pages.dev`).\n */\nexport function publishSlug(title: string): string {\n const slug = title\n .toLowerCase()\n .normalize('NFKD')\n .replace(/[\\u0300-\\u036f]/g, '')\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '')\n .slice(0, 58)\n .replace(/-+$/, '');\n return slug || 'my-site';\n}\n\nexport function isValidPublishSlug(value: string): boolean {\n return /^[a-z0-9](?:[a-z0-9-]{0,56}[a-z0-9])?$/.test(value);\n}\n\n/** Display host of a URL: `https://bakery.pages.dev/` -> `bakery.pages.dev`. */\nexport function displayHost(url: string | null | undefined): string {\n const match = /^https?:\\/\\/([^/?#]+)/i.exec((url ?? '').trim());\n return match ? match[1] : (url ?? '').trim();\n}\n\n/** \"just now\", \"5 min ago\", \"3 h ago\", \"Yesterday\", \"12 Oct\". */\nexport function relativeTime(ms: number, now = Date.now()): string {\n if (!ms) return '';\n const diff = Math.max(0, now - ms);\n const min = Math.floor(diff / 60_000);\n if (min < 1) return 'just now';\n if (min < 60) return `${min} min ago`;\n const hours = Math.floor(min / 60);\n if (hours < 24) return `${hours} h ago`;\n if (hours < 48) return 'Yesterday';\n const d = new Date(ms);\n const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return `${d.getDate()} ${months[d.getMonth()]}`;\n}\n\n// ── The agent transcript: the build chat's posts, as the web Agent pane shows them ──\n\n/** A live progress row (web `isThinkingPost`): shown as the agent's status, never kept. */\nexport function isThinkingPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const attachment = asObject(props.attachment) || {};\n const msg = String(p.message ?? '')\n .trim()\n .toLowerCase();\n return (\n String(p.type ?? '').toUpperCase() === 'THINKING' ||\n Boolean(props.thinking ?? props.isThinking) ||\n props.kind === 'thinking' ||\n Boolean(attachment.isThinking) ||\n msg === 'thinking...' ||\n msg === 'initializing...' ||\n msg === 'initializing…'\n );\n}\n\nfunction readFragmentStatus(p: Loose): string | undefined {\n const contents = asObject(p.propsConfiguration?.contents) || {};\n return (\n str(asObject(asObject(contents.props)?.fragment)?.statusText) || str(asObject(contents.fragment)?.statusText)\n );\n}\n\n/** The workflow's progress line on a post: its thought, else the fragment's status. */\nexport function progressText(post: unknown): string | null {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const thought = str(asObject(props.attachment)?.thought);\n if (thought) return thought;\n const status = str(asObject(props.fragment)?.statusText) || str(readFragmentStatus(p));\n if (status) return status;\n return isThinkingPost(post) ? (str(p.message) ?? null) : null;\n}\n\n/** A post the workflow wrote when the build failed (`fragment.isError` / `type: 'error'`). */\nexport function isErrorPost(post: unknown): boolean {\n const p = (post ?? {}) as Loose;\n const props = asObject(p.props) || {};\n const contents = asObject(p.propsConfiguration?.contents) || {};\n const f =\n asObject(props.fragment) || asObject(asObject(contents.props)?.fragment) || asObject(contents.fragment) || {};\n return f.isError === true || f.type === 'error';\n}\n\nexport interface TranscriptMessage {\n id: string;\n role: 'user' | 'assistant';\n content: string;\n createdAt: number;\n}\n\n/**\n * The conversation in a build chat: the person's turns and the agent's replies,\n * oldest first, without progress rows or empty build markers.\n */\nexport function transcriptFromPosts(posts: readonly unknown[]): TranscriptMessage[] {\n const out: TranscriptMessage[] = [];\n for (const post of chronological(posts)) {\n const p = post as Loose;\n const text = str(p.message);\n if (text && !isThinkingPost(post)) {\n const user = isUserPost(post);\n out.push({\n id: String(p.id ?? `${user ? 'u' : 'a'}-${out.length}`),\n role: user ? 'user' : 'assistant',\n content: user ? cleanPrompt(text) || text : text,\n createdAt: postTime(post),\n });\n }\n }\n return out;\n}\n\n/** How a turn started at `since` is going, read from the posts that arrived after it. */\nexport function turnState(\n posts: readonly unknown[],\n since: number,\n): { status: 'running' | 'done' | 'failed'; progress: string | null; error: string | null } {\n // A clock skew allowance, as the web ignores posts older than start - 2 s.\n const after = chronological(posts).filter((post) => postTime(post) >= since - 2_000);\n let progress: string | null = null;\n for (const post of after) {\n if (!isUserPost(post)) {\n if (isErrorPost(post)) {\n const p = post as Loose;\n return { status: 'failed', progress: null, error: str(p.message) ?? 'The build failed.' };\n }\n const fragment = readFragment(post);\n if (fragment && (fragment.sandboxUrl || fragment.liveUrl) && !isThinkingPost(post)) {\n return { status: 'done', progress: null, error: null };\n }\n progress = progressText(post) ?? progress;\n }\n }\n // A plain answer (the agent asked a question, or replied without building) ends\n // the turn too - unless progress rows keep arriving after it.\n const newest = after.filter((post) => !isUserPost(post)).pop() as Loose | undefined;\n if (newest && !isThinkingPost(newest) && !progressText(newest) && str(newest.message)) {\n return { status: 'done', progress: null, error: null };\n }\n return { status: 'running', progress, error: null };\n}\n\n/**\n * The chat was built through the build workflow (its posts carry fragments):\n * edits go back through the workflow. A chat without any is an agent-chat site\n * (a template remix), and its turns stay in the agent chat.\n */\nexport function hasWorkflowPosts(posts: readonly unknown[]): boolean {\n return posts.some((post) => readFragment(post) !== null);\n}\n\n/** The person's words, without the agent-only template note a remix turn carries. */\nexport function stripAgentNote(content: string): string {\n return content.replace(/\\n*\\[Template\\][\\s\\S]*$/, '').trim();\n}\n"],"names":["_a"],"mappings":"AAgCA,SAAS,SAAS,KAA8B,EAAA;AAC9C,EAAI,IAAA,CAAC,OAAc,OAAA,IAAA;AACnB,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA,OAAO,MAAM,OAAQ,CAAA,KAAK,IAAI,IAAO,GAAA,KAAA;AACpE,EAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAC7B,IAAM,MAAA,OAAA,GAAU,MAAM,IAAK,EAAA;AAC3B,IAAA,IAAI,CAAC,OAAA,CAAQ,UAAW,CAAA,GAAG,GAAU,OAAA,IAAA;AACrC,IAAI,IAAA;AACF,MAAM,MAAA,MAAA,GAAS,IAAK,CAAA,KAAA,CAAM,OAAO,CAAA;AACjC,MAAA,OAAO,MAAU,IAAA,OAAO,MAAW,KAAA,QAAA,GAAW,MAAkB,GAAA,IAAA;AAAA,KAC1D,CAAA,OAAA,CAAA,EAAA;AACN,MAAO,OAAA,IAAA;AAAA;AACT;AAEF,EAAO,OAAA,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Ae,OAAyB,EAAA;AACtD,EAAA,OAAO,OAAQ,CAAA,OAAA,CAAQ,yBAA2B,EAAA,EAAE,EAAE,IAAK,EAAA;AAC7D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {StyleSheet,View}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap}from'../../inbox/components/Tap.js';const BOTTOM_TABS_SPACE = 92;
|
|
2
|
+
const TABS = [{
|
|
3
|
+
id: "create",
|
|
4
|
+
label: "Create",
|
|
5
|
+
icon: "home-outline",
|
|
6
|
+
iconActive: "home"
|
|
7
|
+
}, {
|
|
8
|
+
id: "projects",
|
|
9
|
+
label: "Projects",
|
|
10
|
+
icon: "view-grid-outline",
|
|
11
|
+
iconActive: "view-grid"
|
|
12
|
+
}];
|
|
13
|
+
function BottomTabs({
|
|
14
|
+
tab,
|
|
15
|
+
onTab,
|
|
16
|
+
theme,
|
|
17
|
+
bottomInset
|
|
18
|
+
}) {
|
|
19
|
+
return /* @__PURE__ */ jsx(View, { pointerEvents: "box-none", style: [styles.dock, {
|
|
20
|
+
bottom: Math.max(bottomInset, 12)
|
|
21
|
+
}], children: /* @__PURE__ */ jsx(View, { style: [styles.pill, {
|
|
22
|
+
backgroundColor: theme.card,
|
|
23
|
+
borderColor: theme.border,
|
|
24
|
+
shadowColor: theme.isDark ? "#000" : "#1c1917"
|
|
25
|
+
}], accessibilityRole: "tablist", children: TABS.map((t) => {
|
|
26
|
+
const active = t.id === tab;
|
|
27
|
+
return /* @__PURE__ */ jsx(Tap, { onPress: () => onTab(t.id), accessibilityRole: "tab", accessibilityState: {
|
|
28
|
+
selected: active
|
|
29
|
+
}, accessibilityLabel: t.label, style: [styles.tab, active && {
|
|
30
|
+
backgroundColor: theme.accent
|
|
31
|
+
}], pressedStyle: styles.pressed, testID: `webbuilder-tab-${t.id}`, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: active ? t.iconActive : t.icon, size: 25, color: active ? theme.accentInk : theme.muted }) }, t.id);
|
|
32
|
+
}) }) });
|
|
33
|
+
}
|
|
34
|
+
const styles = StyleSheet.create({
|
|
35
|
+
dock: {
|
|
36
|
+
position: "absolute",
|
|
37
|
+
left: 0,
|
|
38
|
+
right: 0,
|
|
39
|
+
alignItems: "center"
|
|
40
|
+
},
|
|
41
|
+
pill: {
|
|
42
|
+
flexDirection: "row",
|
|
43
|
+
gap: 6,
|
|
44
|
+
padding: 6,
|
|
45
|
+
borderRadius: 999,
|
|
46
|
+
borderWidth: StyleSheet.hairlineWidth,
|
|
47
|
+
shadowOpacity: 0.12,
|
|
48
|
+
shadowRadius: 20,
|
|
49
|
+
shadowOffset: {
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 8
|
|
52
|
+
},
|
|
53
|
+
elevation: 8
|
|
54
|
+
},
|
|
55
|
+
tab: {
|
|
56
|
+
width: 88,
|
|
57
|
+
height: 52,
|
|
58
|
+
borderRadius: 999,
|
|
59
|
+
alignItems: "center",
|
|
60
|
+
justifyContent: "center"
|
|
61
|
+
},
|
|
62
|
+
pressed: {
|
|
63
|
+
opacity: 0.6
|
|
64
|
+
}
|
|
65
|
+
});export{BOTTOM_TABS_SPACE,BottomTabs};//# sourceMappingURL=BottomTabs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BottomTabs.js","sources":["../../../../src/features/webbuilder/components/BottomTabs.tsx"],"sourcesContent":["/**\n * Web Builder's two places - Create and Projects - as the Lovable app shows\n * them: an icon-only pill floating over the content, the current place on a\n * soft capsule. Labels stay for screen readers.\n */\nimport React from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { Tap } from '../../inbox/components/Tap';\nimport type { WebBuilderTheme } from '../webbuilderTheme';\nimport type { IconName } from './ui';\n\nexport type HomeTab = 'create' | 'projects';\n\n/** Height the pill takes over the content, for the screens' bottom padding. */\nexport const BOTTOM_TABS_SPACE = 92;\n\nconst TABS: Array<{ id: HomeTab; label: string; icon: IconName; iconActive: IconName }> = [\n { id: 'create', label: 'Create', icon: 'home-outline', iconActive: 'home' },\n { id: 'projects', label: 'Projects', icon: 'view-grid-outline', iconActive: 'view-grid' },\n];\n\nexport function BottomTabs({\n tab,\n onTab,\n theme,\n bottomInset,\n}: {\n tab: HomeTab;\n onTab: (tab: HomeTab) => void;\n theme: WebBuilderTheme;\n bottomInset: number;\n}) {\n return (\n <View pointerEvents=\"box-none\" style={[styles.dock, { bottom: Math.max(bottomInset, 12) }]}>\n <View\n style={[\n styles.pill,\n {\n backgroundColor: theme.card,\n borderColor: theme.border,\n shadowColor: theme.isDark ? '#000' : '#1c1917',\n },\n ]}\n accessibilityRole=\"tablist\"\n >\n {TABS.map((t) => {\n const active = t.id === tab;\n return (\n <Tap\n key={t.id}\n onPress={() => onTab(t.id)}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected: active }}\n accessibilityLabel={t.label}\n style={[styles.tab, active && { backgroundColor: theme.accent }]}\n pressedStyle={styles.pressed}\n testID={`webbuilder-tab-${t.id}`}\n >\n <MaterialCommunityIcons\n name={active ? t.iconActive : t.icon}\n size={25}\n color={active ? theme.accentInk : theme.muted}\n />\n </Tap>\n );\n })}\n </View>\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n dock: { position: 'absolute', left: 0, right: 0, alignItems: 'center' },\n pill: {\n flexDirection: 'row',\n gap: 6,\n padding: 6,\n borderRadius: 999,\n borderWidth: StyleSheet.hairlineWidth,\n shadowOpacity: 0.12,\n shadowRadius: 20,\n shadowOffset: { width: 0, height: 8 },\n elevation: 8,\n },\n tab: { width: 88, height: 52, borderRadius: 999, alignItems: 'center', justifyContent: 'center' },\n pressed: { opacity: 0.6 },\n});\n"],"names":[],"mappings":"uLAcO,MAAM,iBAAoB,GAAA;AACjC,MAAM,OAKD,CAAC;AAAA,EACJ,EAAI,EAAA,QAAA;AAAA,EACJ,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAA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