@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
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState}from'react';import {StyleSheet,View,Text,TextInput,ActivityIndicator,Alert,Linking}from'react-native';import {Tap,DIM}from'../../inbox/components/Tap.js';import {connectorConnectUrl}from'../web/integrations/catalog.js';import {offerReason,formatYearly,parseDomainSearch,domainFailure,purchaseConfirmText}from'../web/publish/domainShop.js';import {SecondaryButton}from'./ui.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
|
+
const dataOf = (data) => data && typeof data === "object" ? data : {};
|
|
21
|
+
function DomainFinder({
|
|
22
|
+
build,
|
|
23
|
+
tools,
|
|
24
|
+
appUrl,
|
|
25
|
+
onBought,
|
|
26
|
+
onPick,
|
|
27
|
+
theme
|
|
28
|
+
}) {
|
|
29
|
+
const [query, setQuery] = useState("");
|
|
30
|
+
const [phase, setPhase] = useState({
|
|
31
|
+
kind: "idle"
|
|
32
|
+
});
|
|
33
|
+
const [needsCloudflare, setNeedsCloudflare] = useState(false);
|
|
34
|
+
const [buying, setBuying] = useState(null);
|
|
35
|
+
const [note, setNote] = useState(null);
|
|
36
|
+
const connectUrl = appUrl ? connectorConnectUrl(appUrl, "cloudflare-api-key") : null;
|
|
37
|
+
const run = (action, params, timeoutMs) => tools.run(build, action, params, timeoutMs).then((r) => {
|
|
38
|
+
var _a;
|
|
39
|
+
return {
|
|
40
|
+
successful: r.successful,
|
|
41
|
+
data: dataOf(r.data),
|
|
42
|
+
error: (_a = r.error) != null ? _a : void 0
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
const search = async () => {
|
|
46
|
+
const q = query.trim();
|
|
47
|
+
if (!q) return;
|
|
48
|
+
setPhase({
|
|
49
|
+
kind: "searching"
|
|
50
|
+
});
|
|
51
|
+
setNote(null);
|
|
52
|
+
const own = await run("WEBBUILDER_DOMAIN_SEARCH", {
|
|
53
|
+
query: q,
|
|
54
|
+
limit: 8,
|
|
55
|
+
useOwnCloudflare: true
|
|
56
|
+
}, 6e4);
|
|
57
|
+
if (own.successful) {
|
|
58
|
+
setNeedsCloudflare(false);
|
|
59
|
+
setPhase({
|
|
60
|
+
kind: "results",
|
|
61
|
+
view: parseDomainSearch(own.data)
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
const ownWhy = domainFailure(own);
|
|
66
|
+
if (ownWhy === "not-available") {
|
|
67
|
+
setPhase({
|
|
68
|
+
kind: "unavailable",
|
|
69
|
+
text: "Domain search needs the latest connector."
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const shared = await run("WEBBUILDER_DOMAIN_SEARCH", {
|
|
74
|
+
query: q,
|
|
75
|
+
limit: 8
|
|
76
|
+
}, 6e4);
|
|
77
|
+
setNeedsCloudflare(ownWhy === "needs-cloudflare");
|
|
78
|
+
if (shared.successful) {
|
|
79
|
+
setPhase({
|
|
80
|
+
kind: "results",
|
|
81
|
+
view: __spreadProps(__spreadValues({}, parseDomainSearch(shared.data)), {
|
|
82
|
+
canBuy: false
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setPhase({
|
|
88
|
+
kind: "unavailable",
|
|
89
|
+
text: domainFailure(shared) === "platform" ? "Domain search is not available on this workspace yet. You can still connect a domain you own." : (shared.error || "Could not search for domains.").split("\n")[0]
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const buy = async (o) => {
|
|
93
|
+
var _a;
|
|
94
|
+
setBuying(o.domain);
|
|
95
|
+
setNote(null);
|
|
96
|
+
const r = await run("WEBBUILDER_DOMAIN_BUY", {
|
|
97
|
+
domain: o.domain,
|
|
98
|
+
confirmPrice: o.price,
|
|
99
|
+
currency: o.currency,
|
|
100
|
+
useOwnCloudflare: true
|
|
101
|
+
}, 12e4).finally(() => setBuying(null));
|
|
102
|
+
if (r.successful) {
|
|
103
|
+
const inner = dataOf((_a = r.data.data) != null ? _a : r.data);
|
|
104
|
+
const {
|
|
105
|
+
state
|
|
106
|
+
} = inner;
|
|
107
|
+
if (state && state !== "succeeded") {
|
|
108
|
+
setNote({
|
|
109
|
+
tone: "info",
|
|
110
|
+
text: `Cloudflare is still registering ${o.domain}. Connect it in a minute.`
|
|
111
|
+
});
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
setNote({
|
|
115
|
+
tone: "info",
|
|
116
|
+
text: `${o.domain} is yours. Connecting it to your site\u2026`
|
|
117
|
+
});
|
|
118
|
+
onBought(o.domain);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
if (domainFailure(r) === "needs-cloudflare") setNeedsCloudflare(true);
|
|
122
|
+
setNote({
|
|
123
|
+
tone: "error",
|
|
124
|
+
text: (r.error || `Could not buy ${o.domain}.`).split("\n")[0]
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
const confirmBuy = (o) => Alert.alert("Confirm purchase", purchaseConfirmText(o), [{
|
|
128
|
+
text: "Cancel",
|
|
129
|
+
style: "cancel"
|
|
130
|
+
}, {
|
|
131
|
+
text: `Buy for ${formatYearly(o.price, o.currency)}`,
|
|
132
|
+
onPress: () => {
|
|
133
|
+
buy(o).catch(() => void 0);
|
|
134
|
+
}
|
|
135
|
+
}]);
|
|
136
|
+
const view = phase.kind === "results" ? phase.view : null;
|
|
137
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.root, {
|
|
138
|
+
borderTopColor: theme.border
|
|
139
|
+
}], testID: "webbuilder-domain-finder", children: [
|
|
140
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.title, {
|
|
141
|
+
color: theme.ink
|
|
142
|
+
}], children: "Don't have a domain? Find one" }),
|
|
143
|
+
/* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
144
|
+
/* @__PURE__ */ jsx(TextInput, { value: query, onChangeText: setQuery, placeholder: "Your business or a name you like", placeholderTextColor: theme.faint, maxLength: 100, autoCapitalize: "none", autoCorrect: false, returnKeyType: "search", onSubmitEditing: () => {
|
|
145
|
+
search().catch(() => void 0);
|
|
146
|
+
}, accessibilityLabel: "Search for a domain", style: [styles.input, {
|
|
147
|
+
color: theme.ink,
|
|
148
|
+
borderColor: theme.border,
|
|
149
|
+
backgroundColor: theme.screen
|
|
150
|
+
}] }),
|
|
151
|
+
/* @__PURE__ */ jsx(SecondaryButton, { label: "Search", icon: "magnify", onPress: () => {
|
|
152
|
+
if (query.trim()) search().catch(() => void 0);
|
|
153
|
+
}, theme })
|
|
154
|
+
] }),
|
|
155
|
+
phase.kind === "searching" ? /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
156
|
+
/* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.accent }),
|
|
157
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
158
|
+
color: theme.muted
|
|
159
|
+
}], children: "Checking names with the registry\u2026" })
|
|
160
|
+
] }) : null,
|
|
161
|
+
phase.kind === "unavailable" ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
162
|
+
color: theme.muted
|
|
163
|
+
}], children: phase.text }) : null,
|
|
164
|
+
view && !view.offers.length ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
165
|
+
color: theme.muted
|
|
166
|
+
}], children: "No names found. Try another word." }) : null,
|
|
167
|
+
view == null ? void 0 : view.offers.map((o) => {
|
|
168
|
+
const why = offerReason(o);
|
|
169
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.offer, {
|
|
170
|
+
borderColor: theme.border
|
|
171
|
+
}], children: [
|
|
172
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.domain, {
|
|
173
|
+
color: why ? theme.muted : theme.ink
|
|
174
|
+
}], numberOfLines: 1, children: o.domain }),
|
|
175
|
+
why ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
176
|
+
color: theme.muted
|
|
177
|
+
}], children: why }) : null,
|
|
178
|
+
!why ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
179
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
180
|
+
color: theme.muted
|
|
181
|
+
}], children: formatYearly(o.price, o.currency) }),
|
|
182
|
+
view.canBuy && o.price !== void 0 ? /* @__PURE__ */ jsx(Tap, { onPress: buying ? void 0 : () => confirmBuy(o), accessibilityRole: "button", pressedStyle: DIM, style: [styles.pill, {
|
|
183
|
+
backgroundColor: theme.accent
|
|
184
|
+
}], children: buying === o.domain ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.screen }) : /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, {
|
|
185
|
+
color: theme.screen
|
|
186
|
+
}], children: "Buy" }) }) : /* @__PURE__ */ jsx(Tap, { onPress: () => onPick(o.domain), accessibilityRole: "button", pressedStyle: DIM, style: [styles.pill, {
|
|
187
|
+
backgroundColor: theme.chip
|
|
188
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, {
|
|
189
|
+
color: theme.ink
|
|
190
|
+
}], children: "Use this" }) })
|
|
191
|
+
] }) : null
|
|
192
|
+
] }, o.domain);
|
|
193
|
+
}),
|
|
194
|
+
view && !view.canBuy ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
195
|
+
color: theme.muted
|
|
196
|
+
}], children: needsCloudflare && connectUrl ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
+
"To buy here,",
|
|
198
|
+
" ",
|
|
199
|
+
/* @__PURE__ */ jsx(Text, { style: {
|
|
200
|
+
color: theme.accent,
|
|
201
|
+
fontWeight: "600"
|
|
202
|
+
}, onPress: () => {
|
|
203
|
+
Linking.openURL(connectUrl).catch(() => void 0);
|
|
204
|
+
}, children: "connect your Cloudflare account" }),
|
|
205
|
+
" ",
|
|
206
|
+
"(with Registrar access). Or buy the name anywhere and connect it with Use this."
|
|
207
|
+
] }) : "Buy the name with any registrar, then connect it with Use this." }) : null,
|
|
208
|
+
note ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
209
|
+
color: note.tone === "error" ? theme.crit : theme.muted
|
|
210
|
+
}], children: note.text }) : null
|
|
211
|
+
] });
|
|
212
|
+
}
|
|
213
|
+
const styles = StyleSheet.create({
|
|
214
|
+
root: {
|
|
215
|
+
gap: 10,
|
|
216
|
+
paddingTop: 16,
|
|
217
|
+
borderTopWidth: StyleSheet.hairlineWidth
|
|
218
|
+
},
|
|
219
|
+
title: {
|
|
220
|
+
fontSize: 15,
|
|
221
|
+
fontWeight: "700"
|
|
222
|
+
},
|
|
223
|
+
row: {
|
|
224
|
+
flexDirection: "row",
|
|
225
|
+
alignItems: "center",
|
|
226
|
+
gap: 8
|
|
227
|
+
},
|
|
228
|
+
input: {
|
|
229
|
+
flex: 1,
|
|
230
|
+
borderWidth: 1,
|
|
231
|
+
borderRadius: 12,
|
|
232
|
+
paddingHorizontal: 14,
|
|
233
|
+
paddingVertical: 11,
|
|
234
|
+
fontSize: 16
|
|
235
|
+
},
|
|
236
|
+
help: {
|
|
237
|
+
fontSize: 13,
|
|
238
|
+
lineHeight: 18
|
|
239
|
+
},
|
|
240
|
+
offer: {
|
|
241
|
+
flexDirection: "row",
|
|
242
|
+
alignItems: "center",
|
|
243
|
+
gap: 10,
|
|
244
|
+
paddingVertical: 8,
|
|
245
|
+
borderBottomWidth: StyleSheet.hairlineWidth
|
|
246
|
+
},
|
|
247
|
+
domain: {
|
|
248
|
+
flex: 1,
|
|
249
|
+
fontSize: 15,
|
|
250
|
+
fontWeight: "600"
|
|
251
|
+
},
|
|
252
|
+
pill: {
|
|
253
|
+
paddingHorizontal: 14,
|
|
254
|
+
paddingVertical: 7,
|
|
255
|
+
borderRadius: 999,
|
|
256
|
+
minWidth: 54,
|
|
257
|
+
alignItems: "center"
|
|
258
|
+
},
|
|
259
|
+
pillLabel: {
|
|
260
|
+
fontSize: 13,
|
|
261
|
+
fontWeight: "700"
|
|
262
|
+
}
|
|
263
|
+
});export{DomainFinder};//# sourceMappingURL=DomainFinder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DomainFinder.js","sources":["../../../../src/features/webbuilder/components/DomainFinder.tsx"],"sourcesContent":["/**\n * \"Don't have a domain? Find one\" - the web DomainFinder (0.13): names with their yearly price from the\n * registry (yantra-webbuilder WEBBUILDER_DOMAIN_SEARCH, Cloudflare Registrar). On the person's own\n * Cloudflare account a name can be bought here (WEBBUILDER_DOMAIN_BUY: non-refundable, so a confirmation\n * shows the price and renewal first) and is then connected; otherwise \"Use this\" fills the domain field\n * and a link connects Cloudflare.\n */\nimport React, { useState } from 'react';\nimport { ActivityIndicator, Alert, Linking, StyleSheet, Text, TextInput, View } from 'react-native';\nimport { DIM, Tap } from '../../inbox/components/Tap';\nimport { connectorConnectUrl } from '../web/integrations/catalog';\nimport {\n domainFailure,\n formatYearly,\n offerReason,\n parseDomainSearch,\n purchaseConfirmText,\n type DomainOffer,\n type DomainSearchView,\n} from '../web/publish/domainShop';\nimport type { WebBuilderBuild, WebBuilderPublishTools } from '../types';\nimport type { WebBuilderTheme } from '../webbuilderTheme';\nimport { SecondaryButton } from './ui';\n\ntype Phase =\n | { kind: 'idle' }\n | { kind: 'searching' }\n | { kind: 'results'; view: DomainSearchView }\n | { kind: 'unavailable'; text: string };\n\nconst dataOf = (data: unknown): Record<string, unknown> =>\n data && typeof data === 'object' ? (data as Record<string, unknown>) : {};\n\nexport function DomainFinder({\n build,\n tools,\n appUrl,\n onBought,\n onPick,\n theme,\n}: {\n build: WebBuilderBuild;\n tools: WebBuilderPublishTools;\n appUrl?: string | null;\n /** Bought here: connect it now. */\n onBought: (domain: string) => void;\n /** A name the person will buy elsewhere: it goes into the domain field. */\n onPick: (domain: string) => void;\n theme: WebBuilderTheme;\n}) {\n const [query, setQuery] = useState('');\n const [phase, setPhase] = useState<Phase>({ kind: 'idle' });\n const [needsCloudflare, setNeedsCloudflare] = useState(false);\n const [buying, setBuying] = useState<string | null>(null);\n const [note, setNote] = useState<{ tone: 'error' | 'info'; text: string } | null>(null);\n const connectUrl = appUrl ? connectorConnectUrl(appUrl, 'cloudflare-api-key') : null;\n const run = (action: string, params: Record<string, unknown>, timeoutMs: number) =>\n tools.run(build, action, params, timeoutMs).then((r) => ({\n successful: r.successful,\n data: dataOf(r.data),\n error: r.error ?? undefined,\n }));\n\n const search = async () => {\n const q = query.trim();\n if (!q) return;\n setPhase({ kind: 'searching' });\n setNote(null);\n // The person's own account first (it can buy); the workspace's for names and prices only.\n const own = await run('WEBBUILDER_DOMAIN_SEARCH', { query: q, limit: 8, useOwnCloudflare: true }, 60_000);\n if (own.successful) {\n setNeedsCloudflare(false);\n setPhase({ kind: 'results', view: parseDomainSearch(own.data) });\n return;\n }\n const ownWhy = domainFailure(own);\n if (ownWhy === 'not-available') {\n setPhase({ kind: 'unavailable', text: 'Domain search needs the latest connector.' });\n return;\n }\n const shared = await run('WEBBUILDER_DOMAIN_SEARCH', { query: q, limit: 8 }, 60_000);\n setNeedsCloudflare(ownWhy === 'needs-cloudflare');\n if (shared.successful) {\n setPhase({ kind: 'results', view: { ...parseDomainSearch(shared.data), canBuy: false } });\n return;\n }\n setPhase({\n kind: 'unavailable',\n text:\n domainFailure(shared) === 'platform'\n ? 'Domain search is not available on this workspace yet. You can still connect a domain you own.'\n : (shared.error || 'Could not search for domains.').split('\\n')[0],\n });\n };\n\n const buy = async (o: DomainOffer) => {\n setBuying(o.domain);\n setNote(null);\n const r = await run(\n 'WEBBUILDER_DOMAIN_BUY',\n { domain: o.domain, confirmPrice: o.price, currency: o.currency, useOwnCloudflare: true },\n 120_000,\n ).finally(() => setBuying(null));\n if (r.successful) {\n const inner = dataOf(r.data.data ?? r.data);\n const { state } = inner;\n if (state && state !== 'succeeded') {\n setNote({ tone: 'info', text: `Cloudflare is still registering ${o.domain}. Connect it in a minute.` });\n return;\n }\n setNote({ tone: 'info', text: `${o.domain} is yours. Connecting it to your site…` });\n onBought(o.domain);\n return;\n }\n if (domainFailure(r) === 'needs-cloudflare') setNeedsCloudflare(true);\n setNote({ tone: 'error', text: (r.error || `Could not buy ${o.domain}.`).split('\\n')[0] });\n };\n // Non-refundable: the price and renewal are confirmed first (web).\n const confirmBuy = (o: DomainOffer) =>\n Alert.alert('Confirm purchase', purchaseConfirmText(o), [\n { text: 'Cancel', style: 'cancel' },\n {\n text: `Buy for ${formatYearly(o.price, o.currency)}`,\n onPress: () => {\n buy(o).catch(() => undefined);\n },\n },\n ]);\n\n const view = phase.kind === 'results' ? phase.view : null;\n return (\n <View style={[styles.root, { borderTopColor: theme.border }]} testID=\"webbuilder-domain-finder\">\n <Text style={[styles.title, { color: theme.ink }]}>Don't have a domain? Find one</Text>\n <View style={styles.row}>\n <TextInput\n value={query}\n onChangeText={setQuery}\n placeholder=\"Your business or a name you like\"\n placeholderTextColor={theme.faint}\n maxLength={100}\n autoCapitalize=\"none\"\n autoCorrect={false}\n returnKeyType=\"search\"\n onSubmitEditing={() => {\n search().catch(() => undefined);\n }}\n accessibilityLabel=\"Search for a domain\"\n style={[\n styles.input,\n { color: theme.ink, borderColor: theme.border, backgroundColor: theme.screen },\n ]}\n />\n <SecondaryButton\n label=\"Search\"\n icon=\"magnify\"\n onPress={() => {\n if (query.trim()) search().catch(() => undefined);\n }}\n theme={theme}\n />\n </View>\n {phase.kind === 'searching' ? (\n <View style={styles.row}>\n <ActivityIndicator size=\"small\" color={theme.accent} />\n <Text style={[styles.help, { color: theme.muted }]}>Checking names with the registry…</Text>\n </View>\n ) : null}\n {phase.kind === 'unavailable' ? (\n <Text style={[styles.help, { color: theme.muted }]}>{phase.text}</Text>\n ) : null}\n {view && !view.offers.length ? (\n <Text style={[styles.help, { color: theme.muted }]}>No names found. Try another word.</Text>\n ) : null}\n {view?.offers.map((o) => {\n const why = offerReason(o);\n return (\n <View key={o.domain} style={[styles.offer, { borderColor: theme.border }]}>\n <Text style={[styles.domain, { color: why ? theme.muted : theme.ink }]} numberOfLines={1}>\n {o.domain}\n </Text>\n {why ? <Text style={[styles.help, { color: theme.muted }]}>{why}</Text> : null}\n {!why ? (\n <>\n <Text style={[styles.help, { color: theme.muted }]}>\n {formatYearly(o.price, o.currency)}\n </Text>\n {view.canBuy && o.price !== undefined ? (\n <Tap\n onPress={buying ? undefined : () => confirmBuy(o)}\n accessibilityRole=\"button\"\n pressedStyle={DIM}\n style={[styles.pill, { backgroundColor: theme.accent }]}\n >\n {buying === o.domain ? (\n <ActivityIndicator size=\"small\" color={theme.screen} />\n ) : (\n <Text style={[styles.pillLabel, { color: theme.screen }]}>Buy</Text>\n )}\n </Tap>\n ) : (\n <Tap\n onPress={() => onPick(o.domain)}\n accessibilityRole=\"button\"\n pressedStyle={DIM}\n style={[styles.pill, { backgroundColor: theme.chip }]}\n >\n <Text style={[styles.pillLabel, { color: theme.ink }]}>Use this</Text>\n </Tap>\n )}\n </>\n ) : null}\n </View>\n );\n })}\n {view && !view.canBuy ? (\n <Text style={[styles.help, { color: theme.muted }]}>\n {needsCloudflare && connectUrl ? (\n <>\n To buy here,{' '}\n <Text\n style={{ color: theme.accent, fontWeight: '600' }}\n onPress={() => {\n Linking.openURL(connectUrl).catch(() => undefined);\n }}\n >\n connect your Cloudflare account\n </Text>{' '}\n (with Registrar access). Or buy the name anywhere and connect it with Use this.\n </>\n ) : (\n 'Buy the name with any registrar, then connect it with Use this.'\n )}\n </Text>\n ) : null}\n {note ? (\n <Text style={[styles.help, { color: note.tone === 'error' ? theme.crit : theme.muted }]}>\n {note.text}\n </Text>\n ) : null}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n root: { gap: 10, paddingTop: 16, borderTopWidth: StyleSheet.hairlineWidth },\n title: { fontSize: 15, fontWeight: '700' },\n row: { flexDirection: 'row', alignItems: 'center', gap: 8 },\n input: { flex: 1, borderWidth: 1, borderRadius: 12, paddingHorizontal: 14, paddingVertical: 11, fontSize: 16 },\n help: { fontSize: 13, lineHeight: 18 },\n offer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n paddingVertical: 8,\n borderBottomWidth: StyleSheet.hairlineWidth,\n },\n domain: { flex: 1, fontSize: 15, fontWeight: '600' },\n pill: { paddingHorizontal: 14, paddingVertical: 7, borderRadius: 999, minWidth: 54, alignItems: 'center' },\n pillLabel: { fontSize: 13, fontWeight: '700' },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA0BA,MAAM,MAAA,GAAS,CAAC,IAA2C,KAAA,IAAA,IAAQ,OAAO,IAAS,KAAA,QAAA,GAAW,OAAkC,EAAC;AAC1H,SAAS,YAAa,CAAA;AAAA,EAC3B,KAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CASG,EAAA;AACD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAS,EAAE,CAAA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Ae,EAAA,KAAA;AAAA,IACf,UAAY,EAAA,QAAA;AAAA,IACZ,GAAK,EAAA,EAAA;AAAA,IACL,eAAiB,EAAA,CAAA;AAAA,IACjB,mBAAmB,UAAW,CAAA;AAAA,GAChC;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,CAAA;AAAA,IACN,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,IAAM,EAAA;AAAA,IACJ,iBAAmB,EAAA,EAAA;AAAA,IACnB,eAAiB,EAAA,CAAA;AAAA,IACjB,YAAc,EAAA,GAAA;AAAA,IACd,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,SAAW,EAAA;AAAA,IACT,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useCallback,useEffect}from'react';import {StyleSheet,View,Text,ActivityIndicator,TextInput,ScrollView,Alert}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Tap,DIM}from'../../inbox/components/Tap.js';import {DRAFTS_OUTDATED_MESSAGE}from'../drafts.js';import {suggestDraftName,DRAFT_NAME_MAX,MAX_OPEN_DRAFTS,projectChangedSinceDraft}from'../web/project/drafts.js';import {SecondaryButton,PrimaryButton,Sheet}from'./ui.js';function Pill({
|
|
2
|
+
label,
|
|
3
|
+
onPress,
|
|
4
|
+
primary,
|
|
5
|
+
danger,
|
|
6
|
+
theme
|
|
7
|
+
}) {
|
|
8
|
+
let bg = theme.chip;
|
|
9
|
+
let fg = theme.ink;
|
|
10
|
+
if (primary) {
|
|
11
|
+
bg = theme.accent;
|
|
12
|
+
fg = theme.screen;
|
|
13
|
+
} else if (danger) fg = theme.crit;
|
|
14
|
+
return /* @__PURE__ */ jsx(Tap, { onPress, accessibilityRole: "button", pressedStyle: DIM, style: [styles.pill, {
|
|
15
|
+
backgroundColor: bg
|
|
16
|
+
}], children: /* @__PURE__ */ jsx(Text, { style: [styles.pillLabel, {
|
|
17
|
+
color: fg
|
|
18
|
+
}], children: label }) });
|
|
19
|
+
}
|
|
20
|
+
function DraftsSheet({
|
|
21
|
+
visible,
|
|
22
|
+
project,
|
|
23
|
+
drafts,
|
|
24
|
+
openDraftId,
|
|
25
|
+
canEdit,
|
|
26
|
+
onOpen,
|
|
27
|
+
onAccepted,
|
|
28
|
+
onClose,
|
|
29
|
+
theme
|
|
30
|
+
}) {
|
|
31
|
+
const [list, setList] = useState(void 0);
|
|
32
|
+
const [name, setName] = useState("");
|
|
33
|
+
const [step, setStep] = useState(null);
|
|
34
|
+
const [busyId, setBusyId] = useState(null);
|
|
35
|
+
const [renaming, setRenaming] = useState(null);
|
|
36
|
+
const [error, setError] = useState(null);
|
|
37
|
+
const load = useCallback(() => {
|
|
38
|
+
if (!drafts) return;
|
|
39
|
+
setList(void 0);
|
|
40
|
+
drafts.list().then((l) => {
|
|
41
|
+
setList(l);
|
|
42
|
+
if (l) setName(suggestDraftName(l));
|
|
43
|
+
}).catch(() => setList(null));
|
|
44
|
+
}, [drafts]);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (!visible) return;
|
|
47
|
+
setError(null);
|
|
48
|
+
setRenaming(null);
|
|
49
|
+
load();
|
|
50
|
+
}, [visible, load]);
|
|
51
|
+
const create = async () => {
|
|
52
|
+
if (!drafts || !project) return;
|
|
53
|
+
setError(null);
|
|
54
|
+
setStep("Starting\u2026");
|
|
55
|
+
const r = await drafts.create(project, name, setStep).finally(() => setStep(null));
|
|
56
|
+
if (!r.ok || !r.draft) {
|
|
57
|
+
setError(r.error || "Couldn't make the draft.");
|
|
58
|
+
load();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
onOpen(r.draft);
|
|
62
|
+
onClose();
|
|
63
|
+
};
|
|
64
|
+
const accept = async (d) => {
|
|
65
|
+
if (!drafts || !project) return;
|
|
66
|
+
const head = await drafts.projectHead(project);
|
|
67
|
+
const go = async () => {
|
|
68
|
+
setBusyId(d.id);
|
|
69
|
+
const r = await drafts.accept(project, d).finally(() => setBusyId(null));
|
|
70
|
+
if (!r.ok) {
|
|
71
|
+
setError(r.error || "Couldn't accept the draft.");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
onOpen(null);
|
|
75
|
+
onAccepted();
|
|
76
|
+
load();
|
|
77
|
+
};
|
|
78
|
+
Alert.alert(`Accept "${d.name}"?`, projectChangedSinceDraft(d, head) ? "The project changed after this copy was made. Accepting replaces those changes with the draft." : "The project becomes this draft: its preview, code and next publish.", [{
|
|
79
|
+
text: "Cancel",
|
|
80
|
+
style: "cancel"
|
|
81
|
+
}, {
|
|
82
|
+
text: "Accept into project",
|
|
83
|
+
onPress: () => {
|
|
84
|
+
go().catch(() => void 0);
|
|
85
|
+
}
|
|
86
|
+
}]);
|
|
87
|
+
};
|
|
88
|
+
const remove = (d) => {
|
|
89
|
+
if (!drafts || !project) return;
|
|
90
|
+
Alert.alert(`Delete "${d.name}"?`, "Its changes are lost. The project stays as it is.", [{
|
|
91
|
+
text: "Cancel",
|
|
92
|
+
style: "cancel"
|
|
93
|
+
}, {
|
|
94
|
+
text: "Delete",
|
|
95
|
+
style: "destructive",
|
|
96
|
+
onPress: () => {
|
|
97
|
+
setBusyId(d.id);
|
|
98
|
+
drafts.remove(project, d).then((r) => {
|
|
99
|
+
if (!r.ok) setError(r.error || "Couldn't delete the draft.");
|
|
100
|
+
else if (openDraftId === d.id) onOpen(null);
|
|
101
|
+
load();
|
|
102
|
+
}).catch(() => void 0).finally(() => setBusyId(null));
|
|
103
|
+
}
|
|
104
|
+
}]);
|
|
105
|
+
};
|
|
106
|
+
const rename = async () => {
|
|
107
|
+
if (!drafts || !project || !renaming || !list) return;
|
|
108
|
+
const d = list.find((x) => x.id === renaming.id);
|
|
109
|
+
if (!d) return;
|
|
110
|
+
setBusyId(d.id);
|
|
111
|
+
const r = await drafts.rename(project, d, renaming.name).finally(() => setBusyId(null));
|
|
112
|
+
if (!r.ok) setError(r.error || "Couldn't rename the draft.");
|
|
113
|
+
setRenaming(null);
|
|
114
|
+
load();
|
|
115
|
+
};
|
|
116
|
+
let body;
|
|
117
|
+
if (list === void 0) body = /* @__PURE__ */ jsx(ActivityIndicator, { color: theme.accent, style: styles.spin });
|
|
118
|
+
else if (list === null) body = /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
119
|
+
color: theme.muted
|
|
120
|
+
}], children: DRAFTS_OUTDATED_MESSAGE });
|
|
121
|
+
else {
|
|
122
|
+
body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
123
|
+
list.map((d) => {
|
|
124
|
+
const open = openDraftId === d.id;
|
|
125
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.row, {
|
|
126
|
+
borderColor: open ? theme.accent : theme.border
|
|
127
|
+
}], children: [
|
|
128
|
+
(renaming == null ? void 0 : renaming.id) === d.id ? /* @__PURE__ */ jsxs(View, { style: styles.renameRow, children: [
|
|
129
|
+
/* @__PURE__ */ jsx(TextInput, { value: renaming.name, onChangeText: (v) => setRenaming({
|
|
130
|
+
id: d.id,
|
|
131
|
+
name: v
|
|
132
|
+
}), maxLength: DRAFT_NAME_MAX, autoFocus: true, accessibilityLabel: "Draft name", style: [styles.input, styles.grow, {
|
|
133
|
+
color: theme.ink,
|
|
134
|
+
borderColor: theme.border
|
|
135
|
+
}] }),
|
|
136
|
+
/* @__PURE__ */ jsx(SecondaryButton, { label: "Save", onPress: () => {
|
|
137
|
+
rename().catch(() => void 0);
|
|
138
|
+
}, theme })
|
|
139
|
+
] }) : /* @__PURE__ */ jsxs(View, { style: styles.rowHead, children: [
|
|
140
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "source-branch", size: 18, color: theme.muted }),
|
|
141
|
+
/* @__PURE__ */ jsxs(View, { style: styles.grow, children: [
|
|
142
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.name, {
|
|
143
|
+
color: theme.ink
|
|
144
|
+
}], numberOfLines: 1, children: d.name }),
|
|
145
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
146
|
+
color: theme.muted
|
|
147
|
+
}], children: open ? "Open now" : "A private copy of the project" })
|
|
148
|
+
] }),
|
|
149
|
+
busyId === d.id ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: theme.accent }) : null
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsxs(View, { style: styles.actions, children: [
|
|
152
|
+
/* @__PURE__ */ jsx(Pill, { label: open ? "Back to project" : "Open", onPress: () => {
|
|
153
|
+
onOpen(open ? null : d);
|
|
154
|
+
onClose();
|
|
155
|
+
}, theme }),
|
|
156
|
+
canEdit ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ jsx(Pill, { label: "Accept", primary: true, onPress: () => {
|
|
158
|
+
accept(d).catch(() => void 0);
|
|
159
|
+
}, theme }),
|
|
160
|
+
/* @__PURE__ */ jsx(Pill, { label: "Rename", onPress: () => setRenaming({
|
|
161
|
+
id: d.id,
|
|
162
|
+
name: d.name
|
|
163
|
+
}), theme }),
|
|
164
|
+
/* @__PURE__ */ jsx(Pill, { label: "Delete", danger: true, onPress: () => remove(d), theme })
|
|
165
|
+
] }) : null
|
|
166
|
+
] })
|
|
167
|
+
] }, d.id);
|
|
168
|
+
}),
|
|
169
|
+
!list.length ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
170
|
+
color: theme.muted
|
|
171
|
+
}], children: "No drafts yet. A draft is a private copy of the project: try changes there, then accept them." }) : null,
|
|
172
|
+
canEdit && list.length < MAX_OPEN_DRAFTS ? /* @__PURE__ */ jsxs(View, { style: styles.newDraft, children: [
|
|
173
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.section, {
|
|
174
|
+
color: theme.muted
|
|
175
|
+
}], children: "NEW DRAFT" }),
|
|
176
|
+
/* @__PURE__ */ jsx(TextInput, { value: name, onChangeText: setName, maxLength: DRAFT_NAME_MAX, placeholder: "Draft name", placeholderTextColor: theme.faint, accessibilityLabel: "New draft name", style: [styles.input, {
|
|
177
|
+
color: theme.ink,
|
|
178
|
+
borderColor: theme.border,
|
|
179
|
+
backgroundColor: theme.screen
|
|
180
|
+
}] }),
|
|
181
|
+
/* @__PURE__ */ jsx(PrimaryButton, { label: step || "Make a draft", icon: "content-copy", busy: Boolean(step), disabled: !(project == null ? void 0 : project.sandboxId) || !name.trim(), onPress: () => {
|
|
182
|
+
create().catch(() => void 0);
|
|
183
|
+
}, theme, testID: "webbuilder-draft-create" })
|
|
184
|
+
] }) : null
|
|
185
|
+
] });
|
|
186
|
+
}
|
|
187
|
+
return /* @__PURE__ */ jsx(Sheet, { visible, title: "Drafts", onClose, theme, testID: "webbuilder-drafts", children: /* @__PURE__ */ jsxs(ScrollView, { style: styles.scroll, contentContainerStyle: styles.body, keyboardShouldPersistTaps: "handled", children: [
|
|
188
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
189
|
+
color: theme.muted
|
|
190
|
+
}], children: "Try changes on a copy, then accept them into the project. A draft is never published until it is accepted." }),
|
|
191
|
+
error ? /* @__PURE__ */ jsx(Text, { style: [styles.help, {
|
|
192
|
+
color: theme.crit
|
|
193
|
+
}], children: error }) : null,
|
|
194
|
+
body
|
|
195
|
+
] }) });
|
|
196
|
+
}
|
|
197
|
+
function DraftBanner({
|
|
198
|
+
name,
|
|
199
|
+
onAccept,
|
|
200
|
+
onBack,
|
|
201
|
+
theme
|
|
202
|
+
}) {
|
|
203
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.banner, {
|
|
204
|
+
backgroundColor: theme.accentSoft,
|
|
205
|
+
borderColor: theme.accent
|
|
206
|
+
}], testID: "webbuilder-draft-banner", children: [
|
|
207
|
+
/* @__PURE__ */ jsxs(View, { style: styles.rowHead, children: [
|
|
208
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "source-branch", size: 16, color: theme.accent }),
|
|
209
|
+
/* @__PURE__ */ jsxs(Text, { style: [styles.help, styles.grow, {
|
|
210
|
+
color: theme.ink
|
|
211
|
+
}], children: [
|
|
212
|
+
"You're in the draft ",
|
|
213
|
+
/* @__PURE__ */ jsx(Text, { style: styles.name, children: name }),
|
|
214
|
+
". Changes stay in this copy until you accept them."
|
|
215
|
+
] })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ jsxs(View, { style: styles.actions, children: [
|
|
218
|
+
/* @__PURE__ */ jsx(Pill, { label: "Accept into project", primary: true, onPress: onAccept, theme }),
|
|
219
|
+
/* @__PURE__ */ jsx(Pill, { label: "Back to project", onPress: onBack, theme })
|
|
220
|
+
] })
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
const styles = StyleSheet.create({
|
|
224
|
+
scroll: {
|
|
225
|
+
flexGrow: 0,
|
|
226
|
+
flexShrink: 1
|
|
227
|
+
},
|
|
228
|
+
body: {
|
|
229
|
+
gap: 10,
|
|
230
|
+
paddingBottom: 16
|
|
231
|
+
},
|
|
232
|
+
spin: {
|
|
233
|
+
paddingVertical: 20
|
|
234
|
+
},
|
|
235
|
+
help: {
|
|
236
|
+
fontSize: 13,
|
|
237
|
+
lineHeight: 18
|
|
238
|
+
},
|
|
239
|
+
section: {
|
|
240
|
+
fontSize: 12,
|
|
241
|
+
fontWeight: "700",
|
|
242
|
+
letterSpacing: 0.6
|
|
243
|
+
},
|
|
244
|
+
row: {
|
|
245
|
+
gap: 10,
|
|
246
|
+
padding: 12,
|
|
247
|
+
borderRadius: 14,
|
|
248
|
+
borderWidth: 1
|
|
249
|
+
},
|
|
250
|
+
rowHead: {
|
|
251
|
+
flexDirection: "row",
|
|
252
|
+
alignItems: "center",
|
|
253
|
+
gap: 10
|
|
254
|
+
},
|
|
255
|
+
renameRow: {
|
|
256
|
+
flexDirection: "row",
|
|
257
|
+
alignItems: "center",
|
|
258
|
+
gap: 8
|
|
259
|
+
},
|
|
260
|
+
grow: {
|
|
261
|
+
flex: 1
|
|
262
|
+
},
|
|
263
|
+
name: {
|
|
264
|
+
fontSize: 15,
|
|
265
|
+
fontWeight: "600"
|
|
266
|
+
},
|
|
267
|
+
actions: {
|
|
268
|
+
flexDirection: "row",
|
|
269
|
+
flexWrap: "wrap",
|
|
270
|
+
gap: 8
|
|
271
|
+
},
|
|
272
|
+
pill: {
|
|
273
|
+
paddingHorizontal: 12,
|
|
274
|
+
paddingVertical: 7,
|
|
275
|
+
borderRadius: 999
|
|
276
|
+
},
|
|
277
|
+
pillLabel: {
|
|
278
|
+
fontSize: 13,
|
|
279
|
+
fontWeight: "600"
|
|
280
|
+
},
|
|
281
|
+
newDraft: {
|
|
282
|
+
gap: 10,
|
|
283
|
+
paddingTop: 6
|
|
284
|
+
},
|
|
285
|
+
banner: {
|
|
286
|
+
gap: 8,
|
|
287
|
+
padding: 12,
|
|
288
|
+
borderRadius: 14,
|
|
289
|
+
borderWidth: 1
|
|
290
|
+
},
|
|
291
|
+
input: {
|
|
292
|
+
borderWidth: 1,
|
|
293
|
+
borderRadius: 12,
|
|
294
|
+
paddingHorizontal: 14,
|
|
295
|
+
paddingVertical: 12,
|
|
296
|
+
fontSize: 16
|
|
297
|
+
}
|
|
298
|
+
});export{DraftBanner,DraftsSheet};//# sourceMappingURL=DraftsSheet.js.map
|