@aglyn/plugins-commerce 1.0.0-beta.207 → 1.0.0-beta.209
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-commerce",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.209",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-next": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
33
|
-
"@aglyn/shared-util-email": "1.0.0-beta.
|
|
34
|
-
"@aglyn/shared-util-http": "1.0.0-beta.
|
|
35
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
36
|
-
"@aglyn/shared-util-tools": "1.0.0-beta.
|
|
37
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
38
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
39
|
-
"@aglyn/tenant-runtime": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.209",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.209",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.209",
|
|
31
|
+
"@aglyn/shared-ui-next": "1.0.0-beta.209",
|
|
32
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.209",
|
|
33
|
+
"@aglyn/shared-util-email": "1.0.0-beta.209",
|
|
34
|
+
"@aglyn/shared-util-http": "1.0.0-beta.209",
|
|
35
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.209",
|
|
36
|
+
"@aglyn/shared-util-tools": "1.0.0-beta.209",
|
|
37
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.209",
|
|
38
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.209",
|
|
39
|
+
"@aglyn/tenant-runtime": "1.0.0-beta.209",
|
|
40
40
|
"@stripe/react-stripe-js": "^3.10.0",
|
|
41
41
|
"@stripe/stripe-js": "^5.10.0",
|
|
42
42
|
"@swc/helpers": "0.5.23",
|
|
@@ -21,9 +21,10 @@ import { useSnackbar } from "@aglyn/shared-ui-snackstack";
|
|
|
21
21
|
import { Button, FormControlLabel, MenuItem, Stack, Switch, TextField, Typography } from "@mui/material";
|
|
22
22
|
import { doc, setDoc } from "firebase/firestore";
|
|
23
23
|
import { useCallback, useState } from "react";
|
|
24
|
-
import { useFirestore } from "@aglyn/tenant-feature-instance";
|
|
24
|
+
import { useFirestore, useUser } from "@aglyn/tenant-feature-instance";
|
|
25
25
|
import { useFirestoreDoc, writeGuardedBySeed } from "@aglyn/tenant-feature-instance";
|
|
26
26
|
import { hostPublicOrigin, pluginDocsHelp } from "@aglyn/aglyn";
|
|
27
|
+
import { announceSiteWideChange } from "@aglyn/aglyn/app-utils/announce-site-wide-change";
|
|
27
28
|
/**
|
|
28
29
|
* Store settings (AGL-295) on `hosts/{hostId}/settings/store`: the PDP
|
|
29
30
|
* template screen (drives /products/{slug}), currency display, checkout
|
|
@@ -33,6 +34,7 @@ import { hostPublicOrigin, pluginDocsHelp } from "@aglyn/aglyn";
|
|
|
33
34
|
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _current_pdpScreenId, _current_collectionScreenId, _current_currency, _current_termsUrl, _current_receiptFooter;
|
|
34
35
|
const { hostId } = props;
|
|
35
36
|
const firestore = useFirestore();
|
|
37
|
+
const { data: user } = useUser();
|
|
36
38
|
const { enqueueSnackbar } = useSnackbar();
|
|
37
39
|
const { data: store, status: storeStatus, /**
|
|
38
40
|
* The settings doc this form is seeded from is unconfirmed by the server
|
|
@@ -123,6 +125,13 @@ import { hostPublicOrigin, pluginDocsHelp } from "@aglyn/aglyn";
|
|
|
123
125
|
});
|
|
124
126
|
}
|
|
125
127
|
setDraft(null);
|
|
128
|
+
// The product and collection templates, the currency and the checkout
|
|
129
|
+
// rules render on the live store with no publish step: drop its cached
|
|
130
|
+
// pages so they show now rather than within the hour.
|
|
131
|
+
void announceSiteWideChange({
|
|
132
|
+
user,
|
|
133
|
+
hostId
|
|
134
|
+
});
|
|
126
135
|
enqueueSnackbar('Store settings saved', {
|
|
127
136
|
variant: 'success',
|
|
128
137
|
persist: false
|
|
@@ -131,6 +140,7 @@ import { hostPublicOrigin, pluginDocsHelp } from "@aglyn/aglyn";
|
|
|
131
140
|
current,
|
|
132
141
|
firestore,
|
|
133
142
|
hostId,
|
|
143
|
+
user,
|
|
134
144
|
enqueueSnackbar,
|
|
135
145
|
storeStatus,
|
|
136
146
|
storeFromCache
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/store-settings-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Button,\n FormControlLabel,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { doc, setDoc } from 'firebase/firestore'\nimport { useCallback, useState } from 'react'\nimport { useFirestore } from '@aglyn/tenant-feature-instance'\nimport {\n useFirestoreDoc,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport { hostPublicOrigin, pluginDocsHelp } from '@aglyn/aglyn'\n\nexport interface StoreSettingsCardProps {\n hostId: string\n}\n\ninterface StoreSettings {\n /** Screen rendered for /products/{slug} with product tokens (AGL-292). */\n pdpScreenId?: string\n /** Screen rendered for /collections/{slug} (AGL-298). */\n collectionScreenId?: string\n currency?: string\n guestCheckout?: boolean\n termsUrl?: string\n receiptFooter?: string\n}\n\n/**\n * Store settings (AGL-295) on `hosts/{hostId}/settings/store`: the PDP\n * template screen (drives /products/{slug}), currency display, checkout\n * preferences, and receipt branding. Tax and shipping have their own\n * cards; store password/maintenance live in Site Protection.\n */\nexport function StoreSettingsCard(props: StoreSettingsCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { enqueueSnackbar } = useSnackbar()\n const {\n data: store,\n status: storeStatus,\n /**\n * The settings doc this form is seeded from is unconfirmed by the server\n * (AGL-1358). `current` is `draft ?? {…store}` and the save writes all\n * six keys, so `merge: true` protects only the tax and shipping maps that\n * belong to other cards — never this card's own fields. Against a cached\n * read, changing the currency rewrites `guestCheckout`, and the two\n * template ids fall back to `|| null`, which is how a storefront's\n * product and collection URLs start returning 404.\n */\n fromCache: storeFromCache,\n } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId, 'settings', 'store'),\n [firestore, hostId],\n )\n const { data: host } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId),\n [firestore, hostId],\n )\n const [draft, setDraft] = useState<StoreSettings | null>(null)\n const current: StoreSettings = draft ?? {\n pdpScreenId: store?.pdpScreenId ?? '',\n collectionScreenId: store?.collectionScreenId ?? '',\n currency: store?.currency ?? 'USD',\n guestCheckout: store?.guestCheckout !== false,\n termsUrl: store?.termsUrl ?? '',\n receiptFooter: store?.receiptFooter ?? '',\n }\n const update = (patch: Partial<StoreSettings>) =>\n setDraft({ ...current, ...patch })\n\n /**\n * Google Merchant Center feed address (AGL-2249).\n *\n * `server/feed.ts` has served this since AGL-299, and the only place the\n * URL was ever written down was that file's own docblock — so the feature\n * was built, deployed, and undiscoverable. A feed nobody can find is a\n * shopping channel nobody switches on.\n *\n * Through `hostPublicOrigin` rather than a hand-built string, because a\n * store on a custom domain must be told ITS name: the feed's `<link>`\n * elements are built from the request host, so submitting the `.aglyn.app`\n * address for a site that serves on `shop.example.com` would put the wrong\n * domain on every item in Merchant Center.\n *\n * Undefined until the host doc lands, and undefined forever for a host with\n * neither a cname nor a subdomain — `hostPublicOrigin` returns undefined\n * rather than a half-built URL, and a copyable half-URL is worse than none.\n */\n const feedUrl = host\n ? (() => {\n const origin = hostPublicOrigin(host)\n return origin\n ? `${origin}/api/commerce/feed?hostId=${hostId}`\n : undefined\n })()\n : undefined\n\n // Host screen directory: {screenId: path} (AGL-292 template pick).\n const screenEntries = Object.entries(\n (host?.screens ?? {}) as Record<string, string>,\n ).sort(([, a], [, b]) => String(a).localeCompare(String(b)))\n\n const handleSave = useCallback(async () => {\n /**\n * Refuse a save whose seed the server never confirmed (AGL-1358).\n *\n * There is no create path to exempt, and that is deliberate rather than\n * an oversight: unlike a new row at a fresh uid, this writes a FIXED\n * document path, so the all-defaults `current` produced when the cache\n * has never seen this doc is not the harmless blank a fresh uid would\n * be. It would put `USD`, guest checkout on and two null template ids\n * over whatever the server really holds.\n *\n * The guard WRAPS the write — an early return is a shape you can keep\n * while losing the protection.\n */\n const verdict = await writeGuardedBySeed(\n {\n subject: 'store settings',\n unreadable: storeStatus === 'error',\n fromCache: storeFromCache,\n },\n async () => {\n await setDoc(\n doc(firestore, 'hosts', hostId, 'settings', 'store'),\n {\n pdpScreenId: current.pdpScreenId || null,\n collectionScreenId: current.collectionScreenId || null,\n currency: current.currency ?? 'USD',\n guestCheckout: current.guestCheckout !== false,\n termsUrl: current.termsUrl || null,\n receiptFooter: current.receiptFooter || null,\n },\n { merge: true },\n )\n },\n )\n // Before `setDraft(null)`, so a refusal keeps every typed value on\n // screen. A save that silently does nothing sends the user back to\n // retype a form that will be refused again just as quietly.\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, {\n variant: 'warning',\n persist: false,\n })\n }\n setDraft(null)\n enqueueSnackbar('Store settings saved', {\n variant: 'success',\n persist: false,\n })\n }, [current, firestore, hostId, enqueueSnackbar, storeStatus, storeFromCache])\n\n return (\n <CardDisplay\n header={'Store settings'}\n help={pluginDocsHelp('commerce')}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={1.5}>\n <TextField\n label=\"Product page template\"\n value={current.pdpScreenId ?? ''}\n onChange={(event) => update({ pdpScreenId: event.target.value })}\n size=\"small\"\n select\n helperText={\n 'Screen rendered at /products/{slug} — design it in the ' +\n 'besigner with the Product detail block and {{product.*}} tokens.'\n }\n >\n <MenuItem value=\"\">{'None (product URLs 404)'}</MenuItem>\n {screenEntries.map(([screenId, path]) => (\n <MenuItem key={screenId} value={screenId}>\n {`/${path === '/' ? '' : path}`}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n label=\"Collection page template\"\n value={current.collectionScreenId ?? ''}\n onChange={(event) =>\n update({ collectionScreenId: event.target.value })\n }\n size=\"small\"\n select\n helperText={\n 'Screen rendered at /collections/{slug} — drop a Product grid ' +\n 'with source \"A collection\" and {{collection.*}} tokens.'\n }\n >\n <MenuItem value=\"\">{'None (collection URLs 404)'}</MenuItem>\n {screenEntries.map(([screenId, path]) => (\n <MenuItem key={screenId} value={screenId}>\n {`/${path === '/' ? '' : path}`}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n label=\"Currency\"\n value={current.currency ?? 'USD'}\n onChange={(event) => update({ currency: event.target.value })}\n size=\"small\"\n select\n sx={{ maxWidth: 200 }}\n helperText=\"Charges settle in USD; more currencies are coming\"\n >\n <MenuItem value=\"USD\">{'USD ($)'}</MenuItem>\n </TextField>\n <FormControlLabel\n control={\n <Switch\n size=\"small\"\n checked={current.guestCheckout !== false}\n onChange={(event) =>\n update({ guestCheckout: event.target.checked })\n }\n />\n }\n label=\"Allow guest checkout (no account required)\"\n />\n <TextField\n label=\"Terms URL\"\n value={current.termsUrl ?? ''}\n onChange={(event) => update({ termsUrl: event.target.value })}\n size=\"small\"\n placeholder=\"/terms\"\n helperText=\"Linked from checkout when set\"\n />\n <TextField\n label=\"Receipt footer\"\n value={current.receiptFooter ?? ''}\n onChange={(event) => update({ receiptFooter: event.target.value })}\n size=\"small\"\n multiline\n minRows={2}\n placeholder=\"Thanks for supporting our shop!\"\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Password protection and maintenance mode live under Site ' +\n 'Protection.'}\n </Typography>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"small\"\n disabled={!draft}\n onClick={handleSave}\n sx={{ alignSelf: 'flex-start' }}\n >\n {'Save store settings'}\n </Button>\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Product feed'}</Typography>\n {feedUrl ? (\n <>\n <TextField\n label=\"Google Merchant Center feed URL\"\n value={feedUrl}\n size=\"small\"\n slotProps={{ input: { readOnly: true } }}\n onFocus={(event) => event.target.select()}\n helperText={\n 'Paste this into Merchant Center → Products → Feeds as a ' +\n 'scheduled fetch. It lists every active product with price ' +\n 'and availability, and refreshes itself.'\n }\n />\n <Button\n size=\"small\"\n sx={{ alignSelf: 'flex-start' }}\n onClick={() => {\n void navigator.clipboard?.writeText(feedUrl).then(() =>\n enqueueSnackbar('Feed URL copied', {\n variant: 'success',\n persist: false,\n }),\n )\n }}\n >\n {'Copy feed URL'}\n </Button>\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Publish this site to a subdomain or custom domain to get its ' +\n 'Google Merchant Center feed URL.'}\n </Typography>\n )}\n </Stack>\n </Stack>\n </CardDisplay>\n )\n}\nStoreSettingsCard.displayName = 'StoreSettingsCard'\n\nexport default StoreSettingsCard\n"],"names":["CardDisplay","useSnackbar","Button","FormControlLabel","MenuItem","Stack","Switch","TextField","Typography","doc","setDoc","useCallback","useState","useFirestore","useFirestoreDoc","writeGuardedBySeed","hostPublicOrigin","pluginDocsHelp","StoreSettingsCard","props","current","hostId","firestore","enqueueSnackbar","data","store","status","storeStatus","fromCache","storeFromCache","host","draft","setDraft","pdpScreenId","collectionScreenId","currency","guestCheckout","termsUrl","receiptFooter","update","patch","feedUrl","origin","undefined","screenEntries","Object","entries","screens","sort","a","b","String","localeCompare","handleSave","verdict","subject","unreadable","merge","ok","message","variant","persist","header","help","contentGutterX","contentGutterY","spacing","label","value","onChange","event","target","size","select","helperText","map","screenId","path","sx","maxWidth","control","checked","placeholder","multiline","minRows","color","disabled","onClick","alignSelf","slotProps","input","readOnly","onFocus","navigator","clipboard","writeText","then","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,WAAW,QAAQ,uBAAsB;AAClD,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,GAAG,EAAEC,MAAM,QAAQ,qBAAoB;AAChD,SAASC,WAAW,EAAEC,QAAQ,QAAQ,QAAO;AAC7C,SAASC,YAAY,QAAQ,iCAAgC;AAC7D,SACEC,eAAe,EACfC,kBAAkB,QACb,iCAAgC;AACvC,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,eAAc;AAiB/D;;;;;CAKC,GACD,OAAO,SAASC,kBAAkBC,KAA6B;iDAkI9CC,sBAkBAA,6BAoBAA,mBAuBAA,mBAQAA;IAtMf,MAAM,EAAEC,MAAM,EAAE,GAAGF;IACnB,MAAMG,YAAYT;IAClB,MAAM,EAAEU,eAAe,EAAE,GAAGtB;IAC5B,MAAM,EACJuB,MAAMC,KAAK,EACXC,QAAQC,WAAW,EACnB;;;;;;;;KAQC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ACLW,SAAS;oBACTC,SAAS;oBACTF,aAAY;;8BAEd,KAAC1E;oBAAWoD,SAAQ;oBAAUyB,OAAM;8BACjC,8DACC;;8BAEJ,KAACnF;oBACC0D,SAAQ;oBACRyB,OAAM;oBACNb,MAAK;oBACLc,UAAU,CAACvD;oBACXwD,SAASlC;oBACTyB,IAAI;wBAAEU,WAAW;oBAAa;8BAE7B;;8BAEH,MAACnF;oBAAM6D,SAAS;;sCACd,KAAC1D;4BAAWoD,SAAQ;sCAAa;;wBAChCnB,wBACC;;8CACE,KAAClC;oCACC4D,OAAM;oCACNC,OAAO3B;oCACP+B,MAAK;oCACLiB,WAAW;wCAAEC,OAAO;4CAAEC,UAAU;wCAAK;oCAAE;oCACvCC,SAAS,CAACtB,QAAUA,MAAMC,MAAM,CAACE,MAAM;oCACvCC,YACE,6DACA,+DACA;;8CAGJ,KAACxE;oCACCsE,MAAK;oCACLM,IAAI;wCAAEU,WAAW;oCAAa;oCAC9BD,SAAS;4CACFM;wCAAL,OAAKA,uBAAAA,UAAUC,SAAS,qBAAnBD,qBAAqBE,SAAS,CAACtD,SAASuD,IAAI,CAAC,IAChDzE,gBAAgB,mBAAmB;gDACjCqC,SAAS;gDACTC,SAAS;4CACX;oCAEJ;8CAEC;;;2CAIL,KAACrD;4BAAWoD,SAAQ;4BAAQyB,OAAM;sCAC/B,kEACC;;;;;;;AAOhB;AACAnE,kBAAkB+E,WAAW,GAAG;AAEhC,eAAe/E,kBAAiB"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../libs/plugins/commerce/src/lib/components/console/store-settings-card.component.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport { CardDisplay } from '@aglyn/shared-ui-jsx'\nimport { useSnackbar } from '@aglyn/shared-ui-snackstack'\nimport {\n Button,\n FormControlLabel,\n MenuItem,\n Stack,\n Switch,\n TextField,\n Typography,\n} from '@mui/material'\nimport { doc, setDoc } from 'firebase/firestore'\nimport { useCallback, useState } from 'react'\nimport { useFirestore, useUser } from '@aglyn/tenant-feature-instance'\nimport {\n useFirestoreDoc,\n writeGuardedBySeed,\n} from '@aglyn/tenant-feature-instance'\nimport { hostPublicOrigin, pluginDocsHelp } from '@aglyn/aglyn'\nimport { announceSiteWideChange } from '@aglyn/aglyn/app-utils/announce-site-wide-change'\n\nexport interface StoreSettingsCardProps {\n hostId: string\n}\n\ninterface StoreSettings {\n /** Screen rendered for /products/{slug} with product tokens (AGL-292). */\n pdpScreenId?: string\n /** Screen rendered for /collections/{slug} (AGL-298). */\n collectionScreenId?: string\n currency?: string\n guestCheckout?: boolean\n termsUrl?: string\n receiptFooter?: string\n}\n\n/**\n * Store settings (AGL-295) on `hosts/{hostId}/settings/store`: the PDP\n * template screen (drives /products/{slug}), currency display, checkout\n * preferences, and receipt branding. Tax and shipping have their own\n * cards; store password/maintenance live in Site Protection.\n */\nexport function StoreSettingsCard(props: StoreSettingsCardProps) {\n const { hostId } = props\n const firestore = useFirestore()\n const { data: user } = useUser()\n const { enqueueSnackbar } = useSnackbar()\n const {\n data: store,\n status: storeStatus,\n /**\n * The settings doc this form is seeded from is unconfirmed by the server\n * (AGL-1358). `current` is `draft ?? {…store}` and the save writes all\n * six keys, so `merge: true` protects only the tax and shipping maps that\n * belong to other cards — never this card's own fields. Against a cached\n * read, changing the currency rewrites `guestCheckout`, and the two\n * template ids fall back to `|| null`, which is how a storefront's\n * product and collection URLs start returning 404.\n */\n fromCache: storeFromCache,\n } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId, 'settings', 'store'),\n [firestore, hostId],\n )\n const { data: host } = useFirestoreDoc<any>(\n () => doc(firestore, 'hosts', hostId),\n [firestore, hostId],\n )\n const [draft, setDraft] = useState<StoreSettings | null>(null)\n const current: StoreSettings = draft ?? {\n pdpScreenId: store?.pdpScreenId ?? '',\n collectionScreenId: store?.collectionScreenId ?? '',\n currency: store?.currency ?? 'USD',\n guestCheckout: store?.guestCheckout !== false,\n termsUrl: store?.termsUrl ?? '',\n receiptFooter: store?.receiptFooter ?? '',\n }\n const update = (patch: Partial<StoreSettings>) =>\n setDraft({ ...current, ...patch })\n\n /**\n * Google Merchant Center feed address (AGL-2249).\n *\n * `server/feed.ts` has served this since AGL-299, and the only place the\n * URL was ever written down was that file's own docblock — so the feature\n * was built, deployed, and undiscoverable. A feed nobody can find is a\n * shopping channel nobody switches on.\n *\n * Through `hostPublicOrigin` rather than a hand-built string, because a\n * store on a custom domain must be told ITS name: the feed's `<link>`\n * elements are built from the request host, so submitting the `.aglyn.app`\n * address for a site that serves on `shop.example.com` would put the wrong\n * domain on every item in Merchant Center.\n *\n * Undefined until the host doc lands, and undefined forever for a host with\n * neither a cname nor a subdomain — `hostPublicOrigin` returns undefined\n * rather than a half-built URL, and a copyable half-URL is worse than none.\n */\n const feedUrl = host\n ? (() => {\n const origin = hostPublicOrigin(host)\n return origin\n ? `${origin}/api/commerce/feed?hostId=${hostId}`\n : undefined\n })()\n : undefined\n\n // Host screen directory: {screenId: path} (AGL-292 template pick).\n const screenEntries = Object.entries(\n (host?.screens ?? {}) as Record<string, string>,\n ).sort(([, a], [, b]) => String(a).localeCompare(String(b)))\n\n const handleSave = useCallback(async () => {\n /**\n * Refuse a save whose seed the server never confirmed (AGL-1358).\n *\n * There is no create path to exempt, and that is deliberate rather than\n * an oversight: unlike a new row at a fresh uid, this writes a FIXED\n * document path, so the all-defaults `current` produced when the cache\n * has never seen this doc is not the harmless blank a fresh uid would\n * be. It would put `USD`, guest checkout on and two null template ids\n * over whatever the server really holds.\n *\n * The guard WRAPS the write — an early return is a shape you can keep\n * while losing the protection.\n */\n const verdict = await writeGuardedBySeed(\n {\n subject: 'store settings',\n unreadable: storeStatus === 'error',\n fromCache: storeFromCache,\n },\n async () => {\n await setDoc(\n doc(firestore, 'hosts', hostId, 'settings', 'store'),\n {\n pdpScreenId: current.pdpScreenId || null,\n collectionScreenId: current.collectionScreenId || null,\n currency: current.currency ?? 'USD',\n guestCheckout: current.guestCheckout !== false,\n termsUrl: current.termsUrl || null,\n receiptFooter: current.receiptFooter || null,\n },\n { merge: true },\n )\n },\n )\n // Before `setDraft(null)`, so a refusal keeps every typed value on\n // screen. A save that silently does nothing sends the user back to\n // retype a form that will be refused again just as quietly.\n if (!verdict.ok) {\n return void enqueueSnackbar(verdict.message, {\n variant: 'warning',\n persist: false,\n })\n }\n setDraft(null)\n // The product and collection templates, the currency and the checkout\n // rules render on the live store with no publish step: drop its cached\n // pages so they show now rather than within the hour.\n void announceSiteWideChange({ user, hostId })\n enqueueSnackbar('Store settings saved', {\n variant: 'success',\n persist: false,\n })\n }, [\n current,\n firestore,\n hostId,\n user,\n enqueueSnackbar,\n storeStatus,\n storeFromCache,\n ])\n\n return (\n <CardDisplay\n header={'Store settings'}\n help={pluginDocsHelp('commerce')}\n contentGutterX\n contentGutterY\n >\n <Stack spacing={1.5}>\n <TextField\n label=\"Product page template\"\n value={current.pdpScreenId ?? ''}\n onChange={(event) => update({ pdpScreenId: event.target.value })}\n size=\"small\"\n select\n helperText={\n 'Screen rendered at /products/{slug} — design it in the ' +\n 'besigner with the Product detail block and {{product.*}} tokens.'\n }\n >\n <MenuItem value=\"\">{'None (product URLs 404)'}</MenuItem>\n {screenEntries.map(([screenId, path]) => (\n <MenuItem key={screenId} value={screenId}>\n {`/${path === '/' ? '' : path}`}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n label=\"Collection page template\"\n value={current.collectionScreenId ?? ''}\n onChange={(event) =>\n update({ collectionScreenId: event.target.value })\n }\n size=\"small\"\n select\n helperText={\n 'Screen rendered at /collections/{slug} — drop a Product grid ' +\n 'with source \"A collection\" and {{collection.*}} tokens.'\n }\n >\n <MenuItem value=\"\">{'None (collection URLs 404)'}</MenuItem>\n {screenEntries.map(([screenId, path]) => (\n <MenuItem key={screenId} value={screenId}>\n {`/${path === '/' ? '' : path}`}\n </MenuItem>\n ))}\n </TextField>\n <TextField\n label=\"Currency\"\n value={current.currency ?? 'USD'}\n onChange={(event) => update({ currency: event.target.value })}\n size=\"small\"\n select\n sx={{ maxWidth: 200 }}\n helperText=\"Charges settle in USD; more currencies are coming\"\n >\n <MenuItem value=\"USD\">{'USD ($)'}</MenuItem>\n </TextField>\n <FormControlLabel\n control={\n <Switch\n size=\"small\"\n checked={current.guestCheckout !== false}\n onChange={(event) =>\n update({ guestCheckout: event.target.checked })\n }\n />\n }\n label=\"Allow guest checkout (no account required)\"\n />\n <TextField\n label=\"Terms URL\"\n value={current.termsUrl ?? ''}\n onChange={(event) => update({ termsUrl: event.target.value })}\n size=\"small\"\n placeholder=\"/terms\"\n helperText=\"Linked from checkout when set\"\n />\n <TextField\n label=\"Receipt footer\"\n value={current.receiptFooter ?? ''}\n onChange={(event) => update({ receiptFooter: event.target.value })}\n size=\"small\"\n multiline\n minRows={2}\n placeholder=\"Thanks for supporting our shop!\"\n />\n <Typography variant=\"caption\" color=\"text.secondary\">\n {'Password protection and maintenance mode live under Site ' +\n 'Protection.'}\n </Typography>\n <Button\n variant=\"contained\"\n color=\"primary\"\n size=\"small\"\n disabled={!draft}\n onClick={handleSave}\n sx={{ alignSelf: 'flex-start' }}\n >\n {'Save store settings'}\n </Button>\n <Stack spacing={0.5}>\n <Typography variant=\"subtitle2\">{'Product feed'}</Typography>\n {feedUrl ? (\n <>\n <TextField\n label=\"Google Merchant Center feed URL\"\n value={feedUrl}\n size=\"small\"\n slotProps={{ input: { readOnly: true } }}\n onFocus={(event) => event.target.select()}\n helperText={\n 'Paste this into Merchant Center → Products → Feeds as a ' +\n 'scheduled fetch. It lists every active product with price ' +\n 'and availability, and refreshes itself.'\n }\n />\n <Button\n size=\"small\"\n sx={{ alignSelf: 'flex-start' }}\n onClick={() => {\n void navigator.clipboard?.writeText(feedUrl).then(() =>\n enqueueSnackbar('Feed URL copied', {\n variant: 'success',\n persist: false,\n }),\n )\n }}\n >\n {'Copy feed URL'}\n </Button>\n </>\n ) : (\n <Typography variant=\"body2\" color=\"text.secondary\">\n {'Publish this site to a subdomain or custom domain to get its ' +\n 'Google Merchant Center feed URL.'}\n </Typography>\n )}\n </Stack>\n </Stack>\n </CardDisplay>\n )\n}\nStoreSettingsCard.displayName = 'StoreSettingsCard'\n\nexport default StoreSettingsCard\n"],"names":["CardDisplay","useSnackbar","Button","FormControlLabel","MenuItem","Stack","Switch","TextField","Typography","doc","setDoc","useCallback","useState","useFirestore","useUser","useFirestoreDoc","writeGuardedBySeed","hostPublicOrigin","pluginDocsHelp","announceSiteWideChange","StoreSettingsCard","props","current","hostId","firestore","data","user","enqueueSnackbar","store","status","storeStatus","fromCache","storeFromCache","host","draft","setDraft","pdpScreenId","collectionScreenId","currency","guestCheckout","termsUrl","receiptFooter","update","patch","feedUrl","origin","undefined","screenEntries","Object","entries","screens","sort","a","b","String","localeCompare","handleSave","verdict","subject","unreadable","merge","ok","message","variant","persist","header","help","contentGutterX","contentGutterY","spacing","label","value","onChange","event","target","size","select","helperText","map","screenId","path","sx","maxWidth","control","checked","placeholder","multiline","minRows","color","disabled","onClick","alignSelf","slotProps","input","readOnly","onFocus","navigator","clipboard","writeText","then","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;;AAEA,SAASA,WAAW,QAAQ,uBAAsB;AAClD,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SACEC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,EACRC,KAAK,EACLC,MAAM,EACNC,SAAS,EACTC,UAAU,QACL,gBAAe;AACtB,SAASC,GAAG,EAAEC,MAAM,QAAQ,qBAAoB;AAChD,SAASC,WAAW,EAAEC,QAAQ,QA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