@adminide-stack/yantra-mobile 12.0.166 → 12.0.167
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/assets/kinds/character.webp +0 -0
- package/lib/assets/kinds/image.webp +0 -0
- package/lib/assets/kinds/video.webp +0 -0
- package/lib/assets/kinds/website.webp +0 -0
- package/lib/bridge/handlers/NavigationBridgeHandler.js +3 -2
- package/lib/bridge/handlers/NavigationBridgeHandler.js.map +1 -1
- package/lib/components/CustomDrawer.js +6 -2
- package/lib/components/CustomDrawer.js.map +1 -1
- package/lib/features/agent-chat/NativeAgentChat.js +17 -3
- package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
- package/lib/features/chat/ApprovalCard.js +8 -2
- package/lib/features/chat/ApprovalCard.js.map +1 -1
- package/lib/features/chat/AskUserCard.js +5 -3
- package/lib/features/chat/AskUserCard.js.map +1 -1
- package/lib/features/chat/ComposerModeSwitch.js +147 -0
- package/lib/features/chat/ComposerModeSwitch.js.map +1 -0
- package/lib/features/templates/__tests__/buildKinds.test.ts +54 -0
- package/lib/features/templates/__tests__/buildTemplateCards.test.ts +58 -6
- package/lib/features/templates/__tests__/templateSuggestion.test.ts +30 -0
- package/lib/features/templates/buildKinds.js +114 -0
- package/lib/features/templates/buildKinds.js.map +1 -0
- package/lib/features/templates/buildKinds.ts +189 -0
- package/lib/features/templates/buildTemplateCards.js +63 -18
- package/lib/features/templates/buildTemplateCards.js.map +1 -1
- package/lib/features/templates/buildTemplateCards.ts +88 -18
- package/lib/features/templates/index.ts +2 -0
- package/lib/features/templates/templateSuggestion.js +34 -0
- package/lib/features/templates/templateSuggestion.js.map +1 -0
- package/lib/features/templates/templateSuggestion.ts +57 -0
- package/lib/features/webbuilder/WebBuilderExperience.js +188 -28
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/approvalsLink.js +6 -0
- package/lib/features/webbuilder/approvalsLink.js.map +1 -0
- package/lib/features/webbuilder/buildFragments.js +19 -4
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/components/CloudSheet.js +18 -5
- package/lib/features/webbuilder/components/CloudSheet.js.map +1 -1
- package/lib/features/webbuilder/components/CodeView.js +7 -3
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/DomainFinder.js +263 -0
- package/lib/features/webbuilder/components/DomainFinder.js.map +1 -0
- package/lib/features/webbuilder/components/DraftsSheet.js +298 -0
- package/lib/features/webbuilder/components/DraftsSheet.js.map +1 -0
- package/lib/features/webbuilder/components/ImageEditPanel.js +266 -0
- package/lib/features/webbuilder/components/ImageEditPanel.js.map +1 -0
- package/lib/features/webbuilder/components/MentionMenu.js +155 -0
- package/lib/features/webbuilder/components/MentionMenu.js.map +1 -0
- package/lib/features/webbuilder/components/NotesSheet.js +138 -0
- package/lib/features/webbuilder/components/NotesSheet.js.map +1 -0
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +17 -3
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +200 -15
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/components/ShareSheet.js +48 -6
- package/lib/features/webbuilder/components/ShareSheet.js.map +1 -1
- package/lib/features/webbuilder/components/SiteCopyProgress.js +169 -0
- package/lib/features/webbuilder/components/SiteCopyProgress.js.map +1 -0
- package/lib/features/webbuilder/components/SiteStatusSheet.js +145 -2
- package/lib/features/webbuilder/components/SiteStatusSheet.js.map +1 -1
- package/lib/features/webbuilder/drafts.js +167 -0
- package/lib/features/webbuilder/drafts.js.map +1 -0
- package/lib/features/webbuilder/maskPng.js +113 -0
- package/lib/features/webbuilder/maskPng.js.map +1 -0
- package/lib/features/webbuilder/previewProbe.js.map +1 -1
- package/lib/features/webbuilder/stepLabels.js +21 -1
- package/lib/features/webbuilder/stepLabels.js.map +1 -1
- package/lib/features/webbuilder/web/chat/mentions.js +106 -0
- package/lib/features/webbuilder/web/chat/mentions.js.map +1 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js +121 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js.map +1 -0
- package/lib/features/webbuilder/web/code/imageEdit.js +30 -0
- package/lib/features/webbuilder/web/code/imageEdit.js.map +1 -0
- package/lib/features/webbuilder/web/design/linkedDesign.js +26 -0
- package/lib/features/webbuilder/web/design/linkedDesign.js.map +1 -0
- package/lib/features/webbuilder/web/project/buildLink.js +3 -0
- package/lib/features/webbuilder/web/project/buildLink.js.map +1 -0
- package/lib/features/webbuilder/web/project/drafts.js +57 -0
- package/lib/features/webbuilder/web/project/drafts.js.map +1 -0
- package/lib/features/webbuilder/web/project/navHistory.js +7 -0
- package/lib/features/webbuilder/web/project/navHistory.js.map +1 -0
- package/lib/features/webbuilder/web/project/serverSettings.js +15 -4
- package/lib/features/webbuilder/web/project/serverSettings.js.map +1 -1
- package/lib/features/webbuilder/web/publish/domainShop.js +79 -0
- package/lib/features/webbuilder/web/publish/domainShop.js.map +1 -0
- package/lib/features/webbuilder/web/publish/publishRequest.js +11 -0
- package/lib/features/webbuilder/web/publish/publishRequest.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/freshness.js +13 -0
- package/lib/features/webbuilder/web/publish/review/freshness.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/ignores.js +94 -0
- package/lib/features/webbuilder/web/publish/review/ignores.js.map +1 -0
- package/lib/features/webbuilder/web/publish/review/seo.js +230 -0
- package/lib/features/webbuilder/web/publish/review/seo.js.map +1 -0
- package/lib/features/webbuilder/web/publish/siteHealth.js +27 -3
- package/lib/features/webbuilder/web/publish/siteHealth.js.map +1 -1
- package/lib/features/webbuilder/web/publish/siteInsights.js +120 -3
- package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -1
- package/lib/features/webbuilder/web/sharing/shareLink.js +9 -0
- package/lib/features/webbuilder/web/sharing/shareLink.js.map +1 -0
- package/lib/features/webbuilder/web/webServices.js +1 -1
- package/lib/features/webbuilder/web/webServices.js.map +1 -1
- package/lib/hooks/useMarketplaceTemplateCards.js +3 -4
- package/lib/hooks/useMarketplaceTemplateCards.js.map +1 -1
- package/lib/hooks/useMarketplaceTemplateGroups.js +12 -5
- package/lib/hooks/useMarketplaceTemplateGroups.js.map +1 -1
- package/lib/hooks/useTemplatesResourceUri.js +12 -0
- package/lib/hooks/useTemplatesResourceUri.js.map +1 -0
- package/lib/screens/Chat/index.js +4 -22
- package/lib/screens/Chat/index.js.map +1 -1
- package/lib/screens/Home/HomeScreen.js +165 -179
- package/lib/screens/Home/HomeScreen.js.map +1 -1
- package/lib/screens/Home/components/BuildKindPicker.js +248 -0
- package/lib/screens/Home/components/BuildKindPicker.js.map +1 -0
- package/lib/screens/Home/components/BuildTemplatesSection.js +556 -117
- package/lib/screens/Home/components/BuildTemplatesSection.js.map +1 -1
- package/lib/screens/Home/components/KindThumb.js +444 -0
- package/lib/screens/Home/components/KindThumb.js.map +1 -0
- package/lib/screens/Home/components/TemplateSuggestionBanner.js +73 -0
- package/lib/screens/Home/components/TemplateSuggestionBanner.js.map +1 -0
- package/lib/screens/Home/components/buildTheme.js +68 -0
- package/lib/screens/Home/components/buildTheme.js.map +1 -0
- package/lib/screens/WebBuilder/index.js +11 -1
- package/lib/screens/WebBuilder/index.js.map +1 -1
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +55 -0
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js +4 -0
- package/lib/screens/WebBuilderNative/codeWorkspaceApi.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +31 -4
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +1 -0
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +5 -5
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useEffect,useMemo,useCallback}from'react';import {StyleSheet,Text,View,TextInput,ScrollView,Linking,ActivityIndicator,Clipboard,Alert}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {publishSlug,displayHost,isValidPublishSlug}from'../buildFragments.js';import {EXPORT_TARGETS}from'../exportCode.js';import {publishKind,projectNameOfLiveUrl,normalizeDomain,isValidDomain,AI_BUSY_TEXT,publishStatusLine,publishPrimaryLabel,parsePrePublishReport,reviewFindings,findingsForTab,scoreBadges,TAB_EMPTY,UNPUBLISH_ACTION,unpublishParams,plainActionError,SEVERITY_LABEL,CUSTOM_DOMAIN_ACTION,domainStatusParams,parseDomainDns,isNotAttachedError,dnsStateText,REGISTRAR_GUIDES,domainSteps,formatTtl,recordHostLabel,recordValueLabel,dnsStateLabel,removeDomainParams,attachDomainParams}from'../publishTools.js';import {publishStepFromText,laterStep,publishSteps,formatElapsed}from'../web/publish/publishSteps.js';import {PrimaryButton,Sheet,SecondaryButton}from'./ui.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useEffect,useMemo,useCallback}from'react';import {StyleSheet,Text,View,TextInput,ScrollView,Linking,ActivityIndicator,Clipboard,Alert}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {publishSlug,displayHost,isValidPublishSlug}from'../buildFragments.js';import {EXPORT_TARGETS}from'../exportCode.js';import {publishKind,projectNameOfLiveUrl,normalizeDomain,isValidDomain,AI_BUSY_TEXT,publishStatusLine,publishPrimaryLabel,parsePrePublishReport,reviewFindings,findingsForTab,scoreBadges,TAB_EMPTY,UNPUBLISH_ACTION,unpublishParams,plainActionError,SEVERITY_LABEL,CUSTOM_DOMAIN_ACTION,domainStatusParams,parseDomainDns,isNotAttachedError,dnsStateText,REGISTRAR_GUIDES,domainSteps,formatTtl,recordHostLabel,recordValueLabel,dnsStateLabel,removeDomainParams,attachDomainParams}from'../publishTools.js';import {ignoreFor,withIgnore,ignoreSummary,withoutIgnore,IGNORE_REASONS,IGNORE_REASON_LABEL}from'../web/publish/review/ignores.js';import {checkAge}from'../web/publish/review/freshness.js';import {PUBLISH_REQUEST_NOTE_MAX}from'../web/publish/publishRequest.js';import {DomainFinder}from'./DomainFinder.js';import {buildSeoProbeCommand,parseSeoProbeOutput,seoOpportunities,parseSeoHtml,moreOpportunitiesText}from'../web/publish/review/seo.js';import {publishStepFromText,laterStep,publishSteps,formatElapsed}from'../web/publish/publishSteps.js';import {PrimaryButton,Sheet,SecondaryButton}from'./ui.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -205,7 +205,8 @@ function DomainPage({
|
|
|
205
205
|
aiBusy,
|
|
206
206
|
onPublishWithDomain,
|
|
207
207
|
onBack,
|
|
208
|
-
theme
|
|
208
|
+
theme,
|
|
209
|
+
appUrl = null
|
|
209
210
|
}) {
|
|
210
211
|
var _a2;
|
|
211
212
|
const [input, setInput] = useState("");
|
|
@@ -245,10 +246,11 @@ function DomainPage({
|
|
|
245
246
|
alive = false;
|
|
246
247
|
};
|
|
247
248
|
}, [projectName, live, status]);
|
|
248
|
-
const
|
|
249
|
-
const valid = isValidDomain(
|
|
250
|
-
const attach = async () => {
|
|
251
|
-
|
|
249
|
+
const typedInput = normalizeDomain(input);
|
|
250
|
+
const valid = isValidDomain(typedInput);
|
|
251
|
+
const attach = async (value) => {
|
|
252
|
+
const typed = value ? normalizeDomain(value) : typedInput;
|
|
253
|
+
if (!isValidDomain(typed)) return;
|
|
252
254
|
if (!live) {
|
|
253
255
|
onPublishWithDomain(typed);
|
|
254
256
|
return;
|
|
@@ -358,7 +360,14 @@ function DomainPage({
|
|
|
358
360
|
] }) : null,
|
|
359
361
|
/* @__PURE__ */ jsx(PrimaryButton, { label: live ? "Add domain" : "Publish with this domain", onPress: () => {
|
|
360
362
|
attach().catch(() => void 0);
|
|
361
|
-
}, theme, busy: busy === "attach", disabled: !valid || !live && aiBusy, testID: "webbuilder-domain-submit" })
|
|
363
|
+
}, theme, busy: busy === "attach", disabled: !valid || !live && aiBusy, testID: "webbuilder-domain-submit" }),
|
|
364
|
+
/* @__PURE__ */ jsx(DomainFinder, { build, tools, appUrl, onBought: (d) => {
|
|
365
|
+
setInput(d);
|
|
366
|
+
attach(d).catch(() => void 0);
|
|
367
|
+
}, onPick: (d) => {
|
|
368
|
+
setInput(d);
|
|
369
|
+
setError(null);
|
|
370
|
+
}, theme })
|
|
362
371
|
] }),
|
|
363
372
|
error ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
364
373
|
color: theme.crit
|
|
@@ -382,6 +391,7 @@ function FindingCard({
|
|
|
382
391
|
finding,
|
|
383
392
|
onFix,
|
|
384
393
|
fixDisabled,
|
|
394
|
+
onSetAside,
|
|
385
395
|
theme
|
|
386
396
|
}) {
|
|
387
397
|
const problem = finding.status === "problem";
|
|
@@ -414,7 +424,10 @@ function FindingCard({
|
|
|
414
424
|
}], children: finding.why }) : null,
|
|
415
425
|
finding.fixText && onFix ? /* @__PURE__ */ jsx(SecondaryButton, { label: "Fix with AI", icon: "auto-fix", onPress: () => {
|
|
416
426
|
if (!fixDisabled && finding.fixText) onFix(finding.fixText);
|
|
417
|
-
}, theme }) : null
|
|
427
|
+
}, theme }) : null,
|
|
428
|
+
onSetAside && problem && !finding.blocks ? /* @__PURE__ */ jsx(Tap, { onPress: onSetAside, accessibilityRole: "button", pressedStyle: DIM, style: styles.setAside, children: /* @__PURE__ */ jsx(Text, { style: [styles.rowHint, {
|
|
429
|
+
color: theme.muted
|
|
430
|
+
}], children: "Set aside" }) }) : null
|
|
418
431
|
] });
|
|
419
432
|
}
|
|
420
433
|
function ReviewPage({
|
|
@@ -425,7 +438,10 @@ function ReviewPage({
|
|
|
425
438
|
onPublish,
|
|
426
439
|
onBack,
|
|
427
440
|
theme,
|
|
428
|
-
step = null
|
|
441
|
+
step = null,
|
|
442
|
+
ignores = [],
|
|
443
|
+
onIgnoresChange,
|
|
444
|
+
liveUrl = null
|
|
429
445
|
}) {
|
|
430
446
|
const [tab, setTab] = useState("security");
|
|
431
447
|
const [report, setReport] = useState(null);
|
|
@@ -449,7 +465,42 @@ function ReviewPage({
|
|
|
449
465
|
alive = false;
|
|
450
466
|
};
|
|
451
467
|
}, [build, tools, nonce]);
|
|
452
|
-
const
|
|
468
|
+
const all = useMemo(() => reviewFindings(report), [report]);
|
|
469
|
+
const isAside = (f) => f.status === "problem" && !f.blocks && Boolean(ignoreFor(ignores, f.key));
|
|
470
|
+
const findings = all.filter((f) => !isAside(f));
|
|
471
|
+
const asideHere = all.filter(isAside).filter((f) => findingsForTab([f], tab).length > 0);
|
|
472
|
+
const age = checkAge(report == null ? void 0 : report.ranAt);
|
|
473
|
+
const setAside = (key) => {
|
|
474
|
+
if (!onIgnoresChange) return;
|
|
475
|
+
Alert.alert("Set aside", "Why? Everyone on the project sees this.", [...IGNORE_REASONS.map((reason) => ({
|
|
476
|
+
text: IGNORE_REASON_LABEL[reason],
|
|
477
|
+
onPress: () => onIgnoresChange(withIgnore(ignores, {
|
|
478
|
+
key,
|
|
479
|
+
reason
|
|
480
|
+
}))
|
|
481
|
+
})), {
|
|
482
|
+
text: "Cancel",
|
|
483
|
+
style: "cancel"
|
|
484
|
+
}]);
|
|
485
|
+
};
|
|
486
|
+
const [ideas, setIdeas] = useState(null);
|
|
487
|
+
useEffect(() => {
|
|
488
|
+
if (tab !== "seo" || ideas || !build.sandboxId) return void 0;
|
|
489
|
+
let alive = true;
|
|
490
|
+
tools.run(build, "WEBBUILDER_RUN_COMMAND", {
|
|
491
|
+
sandbox_id: build.sandboxId,
|
|
492
|
+
command: buildSeoProbeCommand()
|
|
493
|
+
}, 6e4).then((r) => {
|
|
494
|
+
if (!alive) return;
|
|
495
|
+
const d = r.data && typeof r.data === "object" ? r.data : {};
|
|
496
|
+
const probe = parseSeoProbeOutput(typeof d.stdout === "string" ? d.stdout : "");
|
|
497
|
+
setIdeas(seoOpportunities(probe.html ? parseSeoHtml(probe.html) : null, probe.facts));
|
|
498
|
+
}).catch(() => alive && setIdeas([]));
|
|
499
|
+
return () => {
|
|
500
|
+
alive = false;
|
|
501
|
+
};
|
|
502
|
+
}, [tab, ideas, build, tools]);
|
|
503
|
+
const shownIdeas = (ideas != null ? ideas : []).filter((o) => !ignoreFor(ignores, `opp:${o.id}`));
|
|
453
504
|
const critical = findings.filter((f) => f.status === "problem" && f.blocks).length;
|
|
454
505
|
const blocked = critical > 0 || Boolean(step == null ? void 0 : step.serverBlocked);
|
|
455
506
|
const shown = findingsForTab(findings, tab);
|
|
@@ -497,7 +548,66 @@ function ReviewPage({
|
|
|
497
548
|
color: theme.muted
|
|
498
549
|
}], children: empty.body })
|
|
499
550
|
] }) : null,
|
|
500
|
-
!loading
|
|
551
|
+
!loading && age ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
552
|
+
color: age.stale ? theme.warn : theme.muted
|
|
553
|
+
}], children: age.stale ? `${age.text}. Packages get new security advisories after a site ships: run the checks again before you publish.` : age.text }) : null,
|
|
554
|
+
!loading ? shown.map((f) => /* @__PURE__ */ jsx(FindingCard, { finding: f, onFix, fixDisabled: aiBusy, onSetAside: onIgnoresChange ? () => setAside(f.key) : void 0, theme }, f.key)) : null,
|
|
555
|
+
!loading && tab === "seo" && shownIdeas.length ? /* @__PURE__ */ jsxs(View, { style: styles.ideas, children: [
|
|
556
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
557
|
+
color: theme.ink
|
|
558
|
+
}], children: "Growth ideas" }),
|
|
559
|
+
shownIdeas.map((o) => /* @__PURE__ */ jsxs(View, { style: [styles.finding, {
|
|
560
|
+
borderColor: theme.border
|
|
561
|
+
}], children: [
|
|
562
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.rowLabel, {
|
|
563
|
+
color: theme.ink
|
|
564
|
+
}], children: o.title }),
|
|
565
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.note, {
|
|
566
|
+
color: theme.muted
|
|
567
|
+
}], children: o.why }),
|
|
568
|
+
/* @__PURE__ */ jsxs(View, { style: styles.ideaActions, children: [
|
|
569
|
+
onFix ? /* @__PURE__ */ jsx(SecondaryButton, { label: "Work on this", icon: "creation", onPress: () => {
|
|
570
|
+
if (!aiBusy) onFix(o.work);
|
|
571
|
+
}, theme }) : null,
|
|
572
|
+
onIgnoresChange ? /* @__PURE__ */ jsx(Tap, { onPress: () => onIgnoresChange(withIgnore(ignores, {
|
|
573
|
+
key: `opp:${o.id}`,
|
|
574
|
+
reason: "later"
|
|
575
|
+
})), accessibilityRole: "button", pressedStyle: DIM, style: styles.setAside, children: /* @__PURE__ */ jsx(Text, { style: [styles.rowHint, {
|
|
576
|
+
color: theme.muted
|
|
577
|
+
}], children: "Skip" }) }) : null
|
|
578
|
+
] })
|
|
579
|
+
] }, o.id)),
|
|
580
|
+
onFix ? /* @__PURE__ */ jsx(Tap, { onPress: () => {
|
|
581
|
+
if (!aiBusy) onFix(moreOpportunitiesText(liveUrl, shownIdeas));
|
|
582
|
+
}, accessibilityRole: "button", pressedStyle: DIM, style: styles.setAside, children: /* @__PURE__ */ jsx(Text, { style: [styles.rowHint, {
|
|
583
|
+
color: theme.accent
|
|
584
|
+
}], children: "Find more ideas with AI" }) }) : null
|
|
585
|
+
] }) : null,
|
|
586
|
+
!loading && asideHere.length ? /* @__PURE__ */ jsxs(View, { style: styles.ideas, children: [
|
|
587
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles.rowLabel, {
|
|
588
|
+
color: theme.muted
|
|
589
|
+
}], children: [
|
|
590
|
+
"Set aside (",
|
|
591
|
+
asideHere.length,
|
|
592
|
+
")"
|
|
593
|
+
] }),
|
|
594
|
+
asideHere.map((f) => {
|
|
595
|
+
const entry = ignoreFor(ignores, f.key);
|
|
596
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.asideRow, children: [
|
|
597
|
+
/* @__PURE__ */ jsxs(View, { style: styles.rowText, children: [
|
|
598
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.note, {
|
|
599
|
+
color: theme.ink
|
|
600
|
+
}], children: f.title }),
|
|
601
|
+
entry ? /* @__PURE__ */ jsx(Text, { style: [styles.rowHint, {
|
|
602
|
+
color: theme.muted
|
|
603
|
+
}], children: ignoreSummary(entry) }) : null
|
|
604
|
+
] }),
|
|
605
|
+
onIgnoresChange ? /* @__PURE__ */ jsx(Tap, { onPress: () => onIgnoresChange(withoutIgnore(ignores, f.key)), accessibilityRole: "button", pressedStyle: DIM, style: styles.setAside, children: /* @__PURE__ */ jsx(Text, { style: [styles.rowHint, {
|
|
606
|
+
color: theme.accent
|
|
607
|
+
}], children: "Restore" }) }) : null
|
|
608
|
+
] }, f.key);
|
|
609
|
+
})
|
|
610
|
+
] }) : null,
|
|
501
611
|
aiBusy && shown.some((f) => f.fixText) ? /* @__PURE__ */ jsxs(Text, { style: [styles.help, {
|
|
502
612
|
color: theme.muted
|
|
503
613
|
}], children: [
|
|
@@ -521,6 +631,47 @@ function ReviewPage({
|
|
|
521
631
|
] })
|
|
522
632
|
] });
|
|
523
633
|
}
|
|
634
|
+
function AskToPublish({
|
|
635
|
+
ask,
|
|
636
|
+
theme
|
|
637
|
+
}) {
|
|
638
|
+
const [note, setNote] = useState("");
|
|
639
|
+
const [state, setState] = useState({
|
|
640
|
+
kind: "idle"
|
|
641
|
+
});
|
|
642
|
+
if (state.kind === "sent") {
|
|
643
|
+
return /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
644
|
+
color: theme.good
|
|
645
|
+
}], testID: "webbuilder-publish-request-sent", children: "Sent. The owners see your request in the project's comments." });
|
|
646
|
+
}
|
|
647
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.askToPublish, children: [
|
|
648
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
649
|
+
color: theme.muted
|
|
650
|
+
}], children: "You have view access, so you can't publish. Ask the owners: they see the request in the project's comments." }),
|
|
651
|
+
/* @__PURE__ */ jsx(TextInput, { value: note, onChangeText: setNote, maxLength: PUBLISH_REQUEST_NOTE_MAX, placeholder: "Add a note (optional)", placeholderTextColor: theme.faint, accessibilityLabel: "A note for the owners", style: [styles.askInput, {
|
|
652
|
+
color: theme.ink,
|
|
653
|
+
borderColor: theme.border,
|
|
654
|
+
backgroundColor: theme.screen
|
|
655
|
+
}] }),
|
|
656
|
+
/* @__PURE__ */ jsx(PrimaryButton, { label: "Ask to publish", icon: "rocket-launch-outline", busy: state.kind === "sending", onPress: () => {
|
|
657
|
+
setState({
|
|
658
|
+
kind: "sending"
|
|
659
|
+
});
|
|
660
|
+
ask(note).then((r) => setState(r.ok ? {
|
|
661
|
+
kind: "sent"
|
|
662
|
+
} : {
|
|
663
|
+
kind: "error",
|
|
664
|
+
text: r.message || "Could not send the request."
|
|
665
|
+
})).catch(() => setState({
|
|
666
|
+
kind: "error",
|
|
667
|
+
text: "Could not send the request."
|
|
668
|
+
}));
|
|
669
|
+
}, theme, testID: "webbuilder-ask-to-publish" }),
|
|
670
|
+
state.kind === "error" ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
671
|
+
color: theme.crit
|
|
672
|
+
}], children: state.text }) : null
|
|
673
|
+
] });
|
|
674
|
+
}
|
|
524
675
|
function usePublishSteps(publishing, progressText, live) {
|
|
525
676
|
var _a2;
|
|
526
677
|
const [run, setRun] = useState(null);
|
|
@@ -612,7 +763,11 @@ function PublishSheet({
|
|
|
612
763
|
onFixWithAi,
|
|
613
764
|
onUnpublished,
|
|
614
765
|
onSiteStatus,
|
|
615
|
-
progressText = null
|
|
766
|
+
progressText = null,
|
|
767
|
+
reviewIgnores = [],
|
|
768
|
+
onReviewIgnoresChange,
|
|
769
|
+
askToPublish,
|
|
770
|
+
appUrl = null
|
|
616
771
|
}) {
|
|
617
772
|
const steps = usePublishSteps(publishing, progressText, Boolean(liveUrl));
|
|
618
773
|
const [page, setPage] = useState("menu");
|
|
@@ -711,12 +866,12 @@ function PublishSheet({
|
|
|
711
866
|
color: theme.muted
|
|
712
867
|
}], children: "There is nothing to publish yet. Build the site first, then publish it here." });
|
|
713
868
|
} else if (page === "domain" && tools) {
|
|
714
|
-
body = /* @__PURE__ */ jsx(DomainPage, { build, live: kind !== "never", projectName, tools, aiBusy, onPublishWithDomain: (domain) => {
|
|
869
|
+
body = /* @__PURE__ */ jsx(DomainPage, { build, live: kind !== "never", projectName, tools, aiBusy, appUrl, onPublishWithDomain: (domain) => {
|
|
715
870
|
setPendingDomain(domain);
|
|
716
871
|
setPage("name");
|
|
717
872
|
}, onBack: () => setPage("menu"), theme });
|
|
718
873
|
} else if (page === "review" && tools) {
|
|
719
|
-
body = /* @__PURE__ */ jsx(ReviewPage, { build, tools, aiBusy, onFix: onFixWithAi ? (text) => {
|
|
874
|
+
body = /* @__PURE__ */ jsx(ReviewPage, { build, tools, ignores: reviewIgnores, onIgnoresChange: onReviewIgnoresChange, liveUrl, aiBusy, onFix: onFixWithAi ? (text) => {
|
|
720
875
|
onClose();
|
|
721
876
|
onFixWithAi(text);
|
|
722
877
|
} : void 0, onPublish: (force) => {
|
|
@@ -828,7 +983,9 @@ function PublishSheet({
|
|
|
828
983
|
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
829
984
|
color: theme.muted
|
|
830
985
|
}], children: "This takes a minute or two. You can keep editing; the address appears here when it is live." })
|
|
831
|
-
] }) :
|
|
986
|
+
] }) : null,
|
|
987
|
+
!(publishing && !starting) && askToPublish ? /* @__PURE__ */ jsx(AskToPublish, { ask: askToPublish, theme }) : null,
|
|
988
|
+
!(publishing && !starting) && !askToPublish ? /* @__PURE__ */ jsx(PrimaryButton, { label: publishPrimaryLabel(kind), icon: "rocket-launch-outline", onPress: primary, theme, busy: starting, disabled: !onPublish || Boolean(blocked), testID: "webbuilder-publish-primary" }) : null,
|
|
832
989
|
blocked ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
833
990
|
color: theme.muted
|
|
834
991
|
}], children: blocked }) : null,
|
|
@@ -879,6 +1036,34 @@ function PublishSheet({
|
|
|
879
1036
|
return /* @__PURE__ */ jsx(Sheet, { visible, title, onClose, theme, testID: "webbuilder-publish-sheet", children: body });
|
|
880
1037
|
}
|
|
881
1038
|
const styles = StyleSheet.create({
|
|
1039
|
+
setAside: {
|
|
1040
|
+
alignSelf: "flex-start",
|
|
1041
|
+
paddingVertical: 4
|
|
1042
|
+
},
|
|
1043
|
+
askToPublish: {
|
|
1044
|
+
gap: 10
|
|
1045
|
+
},
|
|
1046
|
+
askInput: {
|
|
1047
|
+
borderWidth: 1,
|
|
1048
|
+
borderRadius: 12,
|
|
1049
|
+
paddingHorizontal: 14,
|
|
1050
|
+
paddingVertical: 12,
|
|
1051
|
+
fontSize: 16
|
|
1052
|
+
},
|
|
1053
|
+
ideas: {
|
|
1054
|
+
gap: 8,
|
|
1055
|
+
paddingTop: 8
|
|
1056
|
+
},
|
|
1057
|
+
ideaActions: {
|
|
1058
|
+
flexDirection: "row",
|
|
1059
|
+
alignItems: "center",
|
|
1060
|
+
gap: 12
|
|
1061
|
+
},
|
|
1062
|
+
asideRow: {
|
|
1063
|
+
flexDirection: "row",
|
|
1064
|
+
alignItems: "center",
|
|
1065
|
+
gap: 10
|
|
1066
|
+
},
|
|
882
1067
|
runSteps: {
|
|
883
1068
|
gap: 8,
|
|
884
1069
|
paddingVertical: 4
|