@webx-ui/module-inbox 0.9.1 → 0.11.0

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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"FormEditorPage-C3ULFulJ.js","sources":["../src/FormAntispam.vue","../src/FormEmbed.vue","../src/FormGeneral.vue","../src/recipients.ts","../src/FormNotifications.vue","../src/FormEditorPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useTranslate } from '@webx-ui/module-admin'\nimport {\n WxAlert,\n WxCard,\n WxFormItem,\n WxInputNumber,\n WxSelect,\n WxSwitch,\n WxText,\n} from '@webx-ui/core'\nimport { option } from './options'\nimport type { CaptchaProvider, CaptchaSite, FormOptions } from './types'\n\n/**\n * The four layers in front of the door (§7), as the three anybody would want to change.\n *\n * The origin check is not here: it is not a dial, it is a fact about where the site is served\n * from, and it lives in the configuration with the rest of the deployment. The captcha keys\n * are not here either — they are the site's, one pair for every form, and a secret repeated\n * in each form's settings is a secret scattered over rows (§5).\n *\n * What is here is what the site has, under the select: a reCAPTCHA key of the wrong kind is\n * the widget's \"Invalid key type\" and nothing else, and the select alone gives an editor no\n * way of knowing which kind the site expects.\n */\nconst options = defineModel<FormOptions>({ required: true })\n\nconst props = defineProps<{\n /** From the form as the server sent it; absent on a server older than this. */\n site?: Record<CaptchaProvider, CaptchaSite>\n}>()\n\nconst t = useTranslate('webx-inbox')\n\nconst honeypot = option<boolean>(options, 'antispam.honeypot', true)\nconst seconds = option<number>(options, 'antispam.min_seconds', 3)\nconst throttle = option<number>(options, 'antispam.throttle', 5)\nconst captcha = option<string>(options, 'antispam.captcha', 'off')\n\nconst captchas = computed(() => [\n { value: 'off', label: t('panel.captcha-off') },\n { value: 'recaptcha', label: t('panel.captcha-recaptcha') },\n { value: 'turnstile', label: t('panel.captcha-turnstile') },\n])\n\n/** The provider chosen and what the site has for it, or null for none. */\nconst chosen = computed(() => {\n const provider = captcha.value\n\n if (provider !== 'recaptcha' && provider !== 'turnstile') return null\n\n return { provider, site: props.site?.[provider] ?? null }\n})\n\nconst kind = computed(() => {\n const site = chosen.value?.site\n\n return site ? t(`panel.captcha-${chosen.value!.provider}-${site.type}`) : null\n})\n</script>\n\n<template>\n <wx-card>\n <wx-form-item :help=\"t('panel.honeypot-help')\">\n <wx-switch v-model=\"honeypot\" :label=\"t('panel.honeypot')\" />\n </wx-form-item>\n\n <wx-form-item :label=\"t('panel.min-seconds')\" :help=\"t('panel.min-seconds-help')\">\n <wx-input-number v-model=\"seconds\" :min=\"0\" :max=\"120\" />\n </wx-form-item>\n\n <wx-form-item :label=\"t('panel.throttle')\" :help=\"t('panel.throttle-help')\">\n <wx-input-number v-model=\"throttle\" :min=\"0\" :max=\"120\" />\n </wx-form-item>\n\n <wx-form-item :label=\"t('panel.captcha')\" :help=\"t('panel.captcha-keys')\">\n <wx-select v-model=\"captcha\" :options=\"captchas\" />\n </wx-form-item>\n\n <wx-text v-if=\"kind\" size=\"sm\" tone=\"muted\">{{ kind }}</wx-text>\n\n <wx-alert\n v-if=\"chosen?.site && !chosen.site.configured\"\n type=\"warning\"\n variant=\"soft\"\n :closable=\"false\"\n :description=\"t('panel.captcha-unconfigured')\"\n />\n </wx-card>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { useAdmin, useTranslate } from '@webx-ui/module-admin'\nimport { toast, WxAction, WxCard, WxTable, WxText, type TableColumn } from '@webx-ui/core'\nimport { useInboxMessages } from './i18n'\nimport type { InboxField, InboxForm } from './types'\n\n/**\n * How the form gets onto a page.\n *\n * Two answers and both are one line, because the module's whole public half is one tag (§10):\n * a template prints it, and a block type prints the same thing so that an editor never opens\n * a template at all.\n *\n * Under them, the names. A hidden field is filled in by the page it stands on — the address\n * somebody wrote from, the product they were looking at, the campaign that brought them — and\n * the only way to fill one in is to know what it is called (§2.6).\n *\n * Where a block's template lives depends on the site: with `module-blocks` it is written in\n * the panel's Blocks section, and a hint pointing at `resources/views/blocks/…` sent people\n * looking for a file that is not there. Without it, a block type is the site's own view.\n */\nconst props = defineProps<{ form: InboxForm; slug: string; fields: InboxField[] }>()\n\nuseInboxMessages()\nconst t = useTranslate('webx-inbox')\nconst admin = useAdmin()\n\nconst hasBlocks = computed(\n () => admin.state.manifest?.modules.some((module) => module.id === 'blocks') ?? false,\n)\n\nconst blade = computed(() => `<x-webx-inbox::form slug=\"${props.slug}\" />`)\n\nconst block = computed(() =>\n hasBlocks.value\n ? blade.value\n : `{{-- resources/views/blocks/contact.blade.php --}}\\n<x-webx-inbox::form slug=\"${props.slug}\" />`,\n)\n\n/** The first hidden field, so the example fills a name this form actually has. */\nconst hidden = computed(\n () => props.fields.find((field) => field.type === 'hidden' && field.is_enabled)?.key ?? 'page',\n)\n\nconst extras = computed(\n () =>\n `<x-webx-inbox::form slug=\"${props.slug}\" :values=\"['${hidden.value}' => url()->current()]\" />\\n` +\n `<x-webx-inbox::form slug=\"${props.slug}\" placement=\"footer\" />`,\n)\n\nconst columns = computed<TableColumn<InboxField>[]>(() => [\n { key: 'key', label: t('fields.name') },\n { key: 'title', label: t('fields.title') },\n { key: 'type', label: t('fields.type'), hideBelow: 520 },\n])\n\n/** Only the ones a page can actually fill in or a visitor can actually answer. */\nconst listed = computed(() => props.fields.filter((field) => field.is_enabled))\n\nasync function copy(text: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(text)\n toast.success(t('panel.copied'))\n } catch {\n // A browser that refuses the clipboard — an insecure origin, a denied permission — still\n // shows the line, and selecting it by hand is what anybody does next anyway.\n }\n}\n</script>\n\n<template>\n <div class=\"wx-inbox-embed\">\n <wx-card :title=\"t('panel.embed-blade')\">\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.embed-blade-help') }}</wx-text>\n\n <div class=\"wx-inbox-embed__snippet\">\n <code>{{ blade }}</code>\n <wx-action icon=\"copy\" :title=\"t('panel.copy')\" @click=\"copy(blade)\" />\n </div>\n </wx-card>\n\n <wx-card :title=\"t('panel.embed-block')\">\n <wx-text size=\"sm\" tone=\"muted\">\n {{ t(hasBlocks ? 'panel.embed-block-panel-help' : 'panel.embed-block-help') }}\n </wx-text>\n\n <div class=\"wx-inbox-embed__snippet\">\n <code>{{ block }}</code>\n <wx-action icon=\"copy\" :title=\"t('panel.copy')\" @click=\"copy(block)\" />\n </div>\n </wx-card>\n\n <wx-card :title=\"t('panel.embed-extras')\">\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.embed-extras-help') }}</wx-text>\n\n <div class=\"wx-inbox-embed__snippet\">\n <code>{{ extras }}</code>\n <wx-action icon=\"copy\" :title=\"t('panel.copy')\" @click=\"copy(extras)\" />\n </div>\n </wx-card>\n\n <wx-card :title=\"t('panel.embed-names')\">\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.embed-names-help') }}</wx-text>\n\n <wx-table\n :data=\"listed\"\n :columns=\"columns\"\n row-key=\"id\"\n flush\n :empty-text=\"t('fields.no-fields')\"\n >\n <template #cell-key=\"{ row }\">\n <wx-text mono size=\"sm\">fields[{{ row.key }}]</wx-text>\n </template>\n\n <template #cell-title=\"{ row }\">\n {{ Object.values(row.title)[0] ?? row.key }}\n </template>\n\n <template #cell-type=\"{ row }\">\n {{ t(`fields.type-${row.type}`) }}\n </template>\n </wx-table>\n </wx-card>\n </div>\n</template>\n\n<style scoped>\n.wx-inbox-embed {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-16);\n}\n\n.wx-inbox-embed__snippet {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n margin-top: var(--wx-space-12);\n padding: var(--wx-space-10) var(--wx-space-12);\n border: 1px solid var(--wx-border-default);\n border-radius: var(--wx-radius-md);\n background: var(--wx-bg-subtle);\n}\n\n.wx-inbox-embed__snippet code {\n flex: 1 1 auto;\n min-width: 0;\n overflow-x: auto;\n white-space: pre;\n font-family: var(--wx-font-family-mono);\n font-size: var(--wx-font-size-sm);\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue'\nimport { emptyLink, useTranslate, WxLinkPicker, type LinkValue } from '@webx-ui/module-admin'\nimport { WxCard, WxFormItem, WxInput, WxSwitch, type LocalizedValue } from '@webx-ui/core'\nimport LocalizedRichText from './LocalizedRichText.vue'\nimport { option } from './options'\nimport type { FormOptions } from './types'\n\n/**\n * What the form is, and what it says once it has been sent.\n *\n * The two halves are on two cards because they are read at two different times: the first is\n * set up once, the second is the sentence a visitor sees and is rewritten whenever the\n * marketing does.\n */\ndefineProps<{ errors: Record<string, string[]> }>()\n\nconst settings = defineModel<{ slug: string; title: LocalizedValue; is_enabled: boolean }>(\n 'settings',\n { required: true },\n)\n\nconst options = defineModel<FormOptions>('options', { required: true })\n\nconst t = useTranslate('webx-inbox')\n\nconst heading = option<LocalizedValue>(options, 'thank-you.heading', {})\nconst text = option<LocalizedValue>(options, 'thank-you.text', {})\nconst submit = option<LocalizedValue>(options, 'design.submit-text', {})\n/*\n * Where the visitor goes instead of the thank-you: a link like a menu item's — a record of the\n * site, which the server opens in the visitor's language, or an address. Nothing chosen is\n * \"Nowhere\", the thank-you in place of the form. A plain string is what a form saved before the\n * choice holds, and it is an address.\n */\nconst stored = option<LinkValue | string | null>(options, 'redirect', null)\n\nconst redirect = computed<LinkValue | null>({\n get: (): LinkValue => {\n const value = stored.value\n\n if (typeof value === 'string') return { ...emptyLink(), target: 'url', url: value }\n\n return value ?? { ...emptyLink(), target: 'none' }\n },\n set: (value: LinkValue | null) => {\n stored.value = value === null || value.target === 'none' ? null : value\n },\n})\n</script>\n\n<template>\n <div class=\"wx-inbox-general\">\n <wx-card>\n <wx-form-item :label=\"t('panel.title')\" :error=\"errors.title?.[0]\" required>\n <wx-input v-model=\"settings.title\" localized />\n </wx-form-item>\n\n <wx-form-item\n :label=\"t('panel.slug')\"\n :help=\"t('panel.slug-help')\"\n :error=\"errors.slug?.[0]\"\n required\n >\n <wx-input v-model=\"settings.slug\" placeholder=\"contact\" />\n </wx-form-item>\n\n <wx-form-item :help=\"t('panel.is-enabled-help')\">\n <wx-switch v-model=\"settings.is_enabled\" :label=\"t('panel.is-enabled')\" />\n </wx-form-item>\n </wx-card>\n\n <wx-card :title=\"t('panel.after-sending')\">\n <wx-form-item :label=\"t('panel.submit-text')\">\n <wx-input v-model=\"submit\" localized />\n </wx-form-item>\n\n <wx-form-item :label=\"t('panel.thank-you-heading')\">\n <wx-input v-model=\"heading\" localized />\n </wx-form-item>\n\n <!-- Printed raw on the site, which is why it is written where formatting is possible. -->\n <wx-form-item :label=\"t('panel.thank-you-text')\">\n <localized-rich-text v-model=\"text\" />\n </wx-form-item>\n\n <wx-form-item\n :label=\"t('panel.redirect')\"\n :help=\"t('panel.redirect-help')\"\n :error=\"errors['options.redirect']?.[0]\"\n >\n <!-- A redirect is not clicked: a new tab and rel mean nothing for it. -->\n <wx-link-picker v-model=\"redirect\" :attributes=\"false\" />\n </wx-form-item>\n </wx-card>\n </div>\n</template>\n\n<style scoped>\n.wx-inbox-general {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-16);\n}\n</style>\n","import type { Recipient, RecipientProblem, RecipientState } from './types'\n\n/**\n * Whether a letter would reach somebody, judged on the recipients as they stand in the editor.\n *\n * The server says it for what was saved (`InboxForm.recipients`): who is deleted, who is\n * switched off. The editor has to say it before a save too, so this reads the list being edited\n * and borrows the server's verdict only for the administrators it already knows about — one\n * picked a moment ago from the list of people who may read the section is somebody who exists.\n */\n\n/** Loose on purpose: the server checks the address for real, this only spots an empty line. */\nconst ADDRESS = /^[^\\s@]+@[^\\s@]+$/\n\nexport function isAdmin(recipient: Recipient): recipient is { admin_id: number } {\n return 'admin_id' in recipient\n}\n\n/** Why this recipient would not get a letter, or null when it would. */\nexport function problemOf(\n recipient: Recipient,\n reported: RecipientState[] = [],\n): RecipientProblem | null {\n if (isAdmin(recipient)) {\n const known = reported.find(\n (one) => one.type === 'admin' && one.admin_id === recipient.admin_id,\n )\n\n return known?.problem ?? null\n }\n\n return ADDRESS.test((recipient.email ?? '').trim()) ? null : 'invalid_email'\n}\n\n/** Whether anybody on the list would be written to. */\nexport function reachesAnybody(\n recipients: Recipient[] | undefined,\n reported: RecipientState[] = [],\n): boolean {\n return (recipients ?? []).some((recipient) => problemOf(recipient, reported) === null)\n}\n","<script setup lang=\"ts\">\nimport { computed, onMounted, ref } from 'vue'\nimport { useRouter } from 'vue-router'\nimport { useAdmin, useTranslate, WxRelationsField } from '@webx-ui/module-admin'\nimport {\n confirm,\n WxAction,\n WxAlert,\n WxButton,\n WxIcon,\n WxCard,\n WxFormItem,\n WxInput,\n WxLink,\n WxRadioGroup,\n WxSelect,\n WxSpace,\n WxText,\n} from '@webx-ui/core'\nimport { createInboxApi } from './api'\nimport { option } from './options'\nimport { isAdmin, problemOf } from './recipients'\nimport type {\n FormOptions,\n InboxField,\n InboxRecipient,\n NotifyVia,\n Recipient,\n RecipientState,\n} from './types'\n\n/**\n * Who hears that something arrived (§9) — one card, and one way of hearing it.\n *\n * On top, the field whose answer is the visitor's address: both ways use it — the letter as its\n * Reply-To, a channel as `{{reply_to}}`. Below it the choice of how, when the notifications\n * module is installed, and only the half that was chosen. A submission goes one way: a letter to\n * the addresses and a message in a chat about the same thing was the same news twice, and a form\n * set up for one way kept sending the other because nobody had emptied it. The half not chosen is\n * kept as it is on the form, so switching back finds it where it was.\n *\n * Two kinds of recipient of a letter, and they are not interchangeable. An administrator is\n * written to at the address on their account and in the language they keep the panel in; a typed\n * address is written to in the language the submission came in. The administrators offered are\n * the ones who may open a submission — a notification is a link, and sending one to somebody who\n * gets a 403 looks like the panel is broken rather than like the form is.\n *\n * The channels are asked of the event's target on the server (NOTIFICATIONS §15.2), so this\n * package needs nothing of that module's code; a site without it sees the letter and nothing else.\n */\nconst props = defineProps<{\n fields: InboxField[]\n errors: Record<string, string[]>\n /** What the server said about the saved list: who is deleted or switched off. */\n reported?: RecipientState[]\n /** Whether the notifications module is installed — the server says so on the form. */\n notifications?: boolean\n /** How the form tells, as the server worked it out for a form saved before the choice. */\n via?: NotifyVia\n}>()\n\nconst options = defineModel<FormOptions>({ required: true })\n\nconst context = useAdmin()\nconst api = createInboxApi(context)\nconst t = useTranslate('webx-inbox')\n\nconst admins = ref<InboxRecipient[]>([])\n\nconst recipients = option<Recipient[]>(options, 'recipients', [])\nconst emailField = option<string>(options, 'email_field', '')\nconst channels = option<number[]>(options, 'notify_channels', [])\n\n/*\n * The form's own choice, or what the server worked out for one saved before there was a choice —\n * written into the options the moment somebody picks, so a form that loses its channels later\n * does not quietly change its way with them.\n */\nconst via = computed<NotifyVia>({\n get: () => options.value.notify_via ?? props.via ?? 'email',\n set: (value) => {\n options.value = { ...options.value, notify_via: value }\n },\n})\n\nconst viaOptions = computed(() => [\n { value: 'email', label: t('panel.via-email') },\n { value: 'channels', label: t('panel.via-channels') },\n])\n\n/* Without the module there is no choice to make, and the letter is what goes. */\nconst byLetter = computed(() => !props.notifications || via.value === 'email')\n\nconst router = useRouter()\n\n/* The channels are set up in their own section; only somebody who may do it gets the way there. */\nconst canSetUp = computed(() => context.can('notifications.manage'))\nconst channelsLink = computed(() => `${context.basePath}/notifications`.replace(/\\/{2,}/g, '/'))\n\n/* Inside the panel, without loading it again: the address is for a middle click. */\nfunction setUpChannels(event: MouseEvent): void {\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.button !== 0) return\n\n event.preventDefault()\n void router.push('/notifications')\n}\n\nonMounted(async () => {\n try {\n admins.value = await api.recipients()\n } catch {\n // Only the shortcut is gone: an address can still be typed, and that is the half of this\n // that has to work.\n }\n})\n\nconst adminOptions = computed(() =>\n admins.value.map((admin) => ({ value: admin.id, label: `${admin.name} · ${admin.email}` })),\n)\n\n/**\n * The fields that could hold the visitor's address, plus the option of naming none — by their\n * label, which is what the editor wrote; the machine name is beside it only to tell two alike.\n */\nconst emailOptions = computed(() => [\n { value: '', label: t('panel.no-email-field') },\n ...props.fields\n .filter((field) => field.type === 'email')\n .map((field) => ({ value: field.key, label: fieldLabel(field) })),\n])\n\nfunction fieldLabel(field: InboxField): string {\n const title = Object.values(field.title ?? {}).find(\n (line): line is string => typeof line === 'string' && line.trim() !== '',\n )\n\n if (title === undefined) return field.name ?? field.key\n\n return field.name ? `${title} · ${field.name}` : title\n}\n\n/*\n * Only the administrators' problems are said beside the row: an address being typed is not\n * wrong yet, and the server refuses a bad one on save in words of its own.\n */\nfunction adminProblem(recipient: Recipient): string | null {\n if (!isAdmin(recipient)) return null\n\n const problem = problemOf(recipient, props.reported)\n\n return problem === null ? null : t(`panel.recipient-${problem}`)\n}\n\nfunction add(recipient: Recipient): void {\n recipients.value = [...recipients.value, recipient]\n}\n\n/**\n * A recipient goes behind a question, unless there is nothing there to lose.\n *\n * The row that was just added and never filled in is a blank line, and asking about a blank\n * line teaches the reader to click through the question without reading it — which is the\n * one thing a confirmation must not do.\n */\nasync function remove(index: number): Promise<void> {\n const recipient = recipients.value[index]\n const written =\n recipient !== undefined && (isAdmin(recipient) || (recipient.email ?? '').trim() !== '')\n\n if (written) {\n const agreed = await confirm({\n title: t('panel.remove-recipient-title'),\n message: t('panel.remove-recipient-text'),\n confirmText: t('panel.remove'),\n cancelText: t('panel.cancel'),\n tone: 'danger',\n })\n\n if (!agreed) return\n }\n\n recipients.value = recipients.value.filter((_, at) => at !== index)\n}\n\nfunction setAdmin(index: number, id: number): void {\n recipients.value = recipients.value.map((one, at) => (at === index ? { admin_id: id } : one))\n}\n\nfunction setEmail(index: number, email: string): void {\n recipients.value = recipients.value.map((one, at) => (at === index ? { email } : one))\n}\n</script>\n\n<template>\n <wx-card\n class=\"wx-inbox-notifications\"\n :title=\"props.notifications ? undefined : t('panel.recipients')\"\n >\n <wx-form-item\n :label=\"t('panel.email-field')\"\n :help=\"\n props.notifications ? t('panel.email-field-help-channels') : t('panel.email-field-help')\n \"\n :error=\"errors['options.email_field']?.[0]\"\n >\n <wx-select v-model=\"emailField\" :options=\"emailOptions\" />\n </wx-form-item>\n\n <wx-form-item v-if=\"props.notifications\" :label=\"t('panel.notify-via')\">\n <wx-radio-group v-model=\"via\" :options=\"viaOptions\" inline />\n </wx-form-item>\n\n <section v-if=\"byLetter\" class=\"wx-inbox-notifications__way\" data-way=\"email\">\n <wx-text v-if=\"props.notifications\" weight=\"medium\">{{ t('panel.recipients') }}</wx-text>\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.recipients-help') }}</wx-text>\n\n <wx-alert\n v-if=\"errors['options.recipients']\"\n type=\"danger\"\n variant=\"soft\"\n :description=\"errors['options.recipients']?.[0]\"\n />\n\n <div class=\"wx-inbox-recipients\">\n <wx-text v-if=\"recipients.length === 0\" size=\"sm\" tone=\"placeholder\">\n {{ t('panel.no-recipients') }}\n </wx-text>\n\n <div\n v-for=\"(recipient, index) in recipients\"\n :key=\"index\"\n class=\"wx-inbox-recipients__item\"\n >\n <div class=\"wx-inbox-recipients__row\">\n <wx-select\n v-if=\"isAdmin(recipient)\"\n :model-value=\"recipient.admin_id\"\n :options=\"adminOptions\"\n @update:model-value=\"(id) => setAdmin(index, Number(id))\"\n />\n <wx-input\n v-else\n :model-value=\"recipient.email\"\n type=\"email\"\n placeholder=\"sales@example.com\"\n @update:model-value=\"(email) => setEmail(index, String(email))\"\n />\n\n <!-- Red, like every other way of taking something away in the panel: the colour is\n what tells the two buttons of a row apart before either is read. -->\n <wx-action\n icon=\"trash\"\n tone=\"danger\"\n :title=\"t('panel.remove')\"\n @click=\"remove(index)\"\n />\n </div>\n <wx-text v-if=\"adminProblem(recipient)\" size=\"sm\" tone=\"danger\">\n {{ adminProblem(recipient) }}\n </wx-text>\n </div>\n </div>\n\n <wx-space size=\"sm\">\n <wx-button\n variant=\"outline\"\n icon=\"user\"\n :disabled=\"adminOptions.length === 0\"\n @click=\"add({ admin_id: Number(adminOptions[0]?.value) })\"\n >\n {{ t('panel.add-admin') }}\n </wx-button>\n <wx-button variant=\"outline\" @click=\"add({ email: '' })\">\n <template #icon><wx-icon name=\"mail\" /></template>\n {{ t('panel.add-email') }}\n </wx-button>\n </wx-space>\n </section>\n\n <section v-else class=\"wx-inbox-notifications__way\" data-way=\"channels\">\n <wx-text weight=\"medium\">{{ t('panel.notify-through') }}</wx-text>\n <wx-text size=\"sm\" tone=\"muted\">{{ t('panel.notify-through-help') }}</wx-text>\n\n <div class=\"wx-inbox-channels\">\n <wx-relations-field\n v-model=\"channels\"\n target=\"notify-inbox-submission\"\n :sortable=\"false\"\n :add-text=\"t('panel.pick-channels')\"\n :empty-text=\"t('panel.no-channels')\"\n :none-text=\"t('panel.no-channels-yet')\"\n />\n <wx-link v-if=\"canSetUp\" :href=\"channelsLink\" size=\"sm\" @click=\"setUpChannels\">{{\n t('panel.set-up-channels')\n }}</wx-link>\n </div>\n </section>\n </wx-card>\n</template>\n\n<style scoped>\n/*\n * One way of telling under the shared field and the choice: its title, its help, its list. The\n * rows of a way sit closer than the form items above them — they are one answer, not three.\n */\n.wx-inbox-notifications__way {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n}\n\n/*\n * As wide as a field, because that is what each row is: an address is typed into it and read\n * back off it. The rows are not form items — one of them is a select, the next an input, and\n * both carry a bin — so the cap that a form item applies has to be said here.\n */\n.wx-inbox-recipients {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-8);\n margin-block: var(--wx-space-8) var(--wx-space-12);\n max-width: var(--wx-field-max-width, 640px);\n}\n\n.wx-inbox-channels {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--wx-space-8);\n margin-block-start: var(--wx-space-8);\n max-width: var(--wx-field-max-width, 640px);\n}\n\n.wx-inbox-channels > :first-child {\n align-self: stretch;\n}\n\n.wx-inbox-recipients__item {\n display: flex;\n flex-direction: column;\n gap: var(--wx-space-4);\n}\n\n.wx-inbox-recipients__row {\n display: flex;\n align-items: center;\n gap: var(--wx-space-8);\n}\n\n.wx-inbox-recipients__row > :first-child {\n flex: 1 1 auto;\n min-width: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, reactive, ref, watch } from 'vue'\nimport { useRoute, useRouter } from 'vue-router'\nimport { useAdmin, useErrorText, useTranslate, WxScreenHead } from '@webx-ui/module-admin'\nimport {\n localizedValue,\n toast,\n useLocales,\n WxActionBar,\n WxAlert,\n WxBadge,\n WxButton,\n WxCard,\n WxSkeleton,\n WxTab,\n WxTabs,\n type LocalizedValue,\n} from '@webx-ui/core'\nimport FieldList from './FieldList.vue'\nimport FormAntispam from './FormAntispam.vue'\nimport FormEmbed from './FormEmbed.vue'\nimport FormGeneral from './FormGeneral.vue'\nimport FormNotifications from './FormNotifications.vue'\nimport { createInboxApi } from './api'\nimport { reachesAnybody } from './recipients'\nimport { useInboxMessages } from './i18n'\nimport type { FormOptions, InboxField, InboxForm, Recipient } from './types'\n\n/**\n * One form: what it is called, what it asks, who hears about it, and how it is put on a page.\n *\n * Five tabs and one save. The fields are the exception — a question is written in its own\n * dialog and saved on its own, because it is a row with an identity (§2.1) and because a\n * dragged order that waited for a save button would be an order nobody trusts.\n */\nconst props = withDefaults(defineProps<{ base?: string }>(), { base: '/inbox' })\n\nconst context = useAdmin()\nconst api = createInboxApi(context)\nconst route = useRoute()\nconst router = useRouter()\nconst locales = useLocales()\nuseInboxMessages()\n\nconst t = useTranslate('webx-inbox')\n/* Not the server's `message`: the panel says how a request failed in its own words. */\nconst message = useErrorText()\n\nconst form = ref<InboxForm | null>(null)\nconst fields = ref<InboxField[]>([])\nconst loading = ref(true)\nconst saving = ref(false)\nconst errors = ref<Record<string, string[]>>({})\n\nconst settings = reactive<{ slug: string; title: LocalizedValue; is_enabled: boolean }>({\n slug: '',\n title: {},\n is_enabled: true,\n})\n\nconst options = ref<FormOptions>({})\n\nconst TABS = ['general', 'fields', 'notifications', 'antispam', 'embed']\n\n/* Opened on the tab the address names, so the audit's \"open\" lands on the recipients. */\nconst tab = ref(TABS.includes(String(route.query.tab)) ? String(route.query.tab) : 'general')\n\n/*\n * Said above the tabs and not only inside Notifications: a form that tells nobody works in\n * every way somebody can see — the site thanks the visitor, the panel keeps the enquiry — so\n * the only place the gap shows is a line nobody went looking for.\n */\nconst silent = computed(\n () =>\n settings.is_enabled &&\n !reachesAnybody(options.value.recipients as Recipient[] | undefined, form.value?.recipients) &&\n !channelsSend.value,\n)\n\n/*\n * A channel chosen and switched on tells somebody too. One chosen since the form was loaded is\n * taken at its word until the save says otherwise: the server names only what was saved.\n */\nconst channelsSend = computed(() => {\n if (form.value?.notifications !== true) return false\n\n const reported = form.value.channels ?? []\n\n return (options.value.notify_channels ?? []).some(\n (id) => reported.find((channel) => channel.id === id)?.sends ?? true,\n )\n})\n\nconst canManage = computed(() => context.can('inbox.manage'))\n\nconst id = computed(() => Number(route.params.id))\n\nconst name = computed(() =>\n form.value === null ? '' : localizedValue(settings.title, locales.active.value, settings.slug),\n)\n\n/** Where a submission would come back to: the section, with this form already chosen. */\nconst backTo = computed(() => `${props.base}?form=${id.value}`)\n\nasync function load(): Promise<void> {\n loading.value = true\n\n try {\n const loaded = await api.form(id.value)\n\n form.value = loaded\n fields.value = loaded.fields ?? []\n settings.slug = loaded.slug\n settings.title = { ...loaded.title }\n settings.is_enabled = loaded.is_enabled\n options.value = { ...loaded.options }\n } catch (error) {\n toast.danger(message(error))\n void router.replace(props.base)\n } finally {\n loading.value = false\n }\n}\n\nwatch(id, () => void load(), { immediate: true })\n\nasync function save(): Promise<void> {\n saving.value = true\n errors.value = {}\n\n try {\n const saved = await api.saveForm(id.value, {\n slug: settings.slug.trim(),\n title: settings.title,\n is_enabled: settings.is_enabled,\n options: options.value,\n })\n\n form.value = saved\n toast.success(t('panel.saved'))\n } catch (error) {\n const body = (error as { body?: { errors?: Record<string, string[]> } }).body\n\n if (body?.errors) {\n errors.value = body.errors\n toast.danger(t('panel.failed'))\n } else {\n toast.danger(message(error))\n }\n } finally {\n saving.value = false\n }\n}\n</script>\n\n<template>\n <!--\n Not a screen that fills its column, whatever the first draft said. `data-wx-fill` makes the\n screen exactly as tall as the window, and nothing inside these tabs scrolls on its own — so\n a form longer than the window grew straight through the box, and the save bar, which is the\n next thing in the column, was drawn across the middle of it with fields still going on\n underneath. What this screen wants is the ordinary thing: the page scrolls, the bar sticks\n to the bottom of it, and `WxMain` gives the screen a floor to push that bar down to.\n -->\n <div class=\"wx-inbox-editor\">\n <!-- On a card, like everything else on this screen: a bare skeleton flush against the\n page is a shape the form that follows it never takes, so the screen jumps twice —\n once when the card appears around it, once when the fields land inside. -->\n <wx-card v-if=\"loading\">\n <wx-skeleton title :rows=\"8\" />\n </wx-card>\n\n <template v-else-if=\"form\">\n <wx-screen-head\n class=\"wx-inbox-editor__head\"\n :title=\"name\"\n :subtitle=\"form.slug\"\n :back=\"backTo\"\n :back-label=\"t('panel.forms')\"\n >\n <template #title-after>\n <wx-badge v-if=\"!settings.is_enabled\" type=\"default\">{{ t('panel.off') }}</wx-badge>\n </template>\n </wx-screen-head>\n\n <!--\n Every tab is mounted at once and the hidden ones keep their state: somebody who wrote\n a thank-you, went to look at the fields and came back should find it still written.\n -->\n <wx-alert\n v-if=\"silent\"\n class=\"wx-inbox-editor__silent\"\n type=\"warning\"\n variant=\"soft\"\n :closable=\"false\"\n :title=\"t('panel.notifies-nobody')\"\n :description=\"t('panel.notifies-nobody-text')\"\n />\n\n <wx-tabs v-model=\"tab\" class=\"wx-inbox-editor__tabs\" keep-alive>\n <wx-tab value=\"general\" :label=\"t('panel.tab-general')\">\n <form-general v-model:settings=\"settings\" v-model:options=\"options\" :errors=\"errors\" />\n </wx-tab>\n\n <wx-tab value=\"fields\" :label=\"t('panel.tab-fields')\">\n <field-list v-model=\"fields\" :form=\"form\" :can-manage=\"canManage\" />\n </wx-tab>\n\n <wx-tab value=\"notifications\" :label=\"t('panel.tab-notifications')\">\n <form-notifications\n v-model=\"options\"\n :fields=\"fields\"\n :errors=\"errors\"\n :reported=\"form.recipients\"\n :notifications=\"form.notifications\"\n :via=\"form.notify_via\"\n />\n </wx-tab>\n\n <wx-tab value=\"antispam\" :label=\"t('panel.tab-antispam')\">\n <form-antispam v-model=\"options\" :site=\"form.captcha\" />\n </wx-tab>\n\n <wx-tab value=\"embed\" :label=\"t('panel.tab-embed')\">\n <form-embed :form=\"form\" :slug=\"settings.slug\" :fields=\"fields\" />\n </wx-tab>\n </wx-tabs>\n\n <wx-action-bar v-if=\"canManage\">\n <wx-button type=\"primary\" :loading=\"saving\" @click=\"save\">{{ t('panel.save') }}</wx-button>\n </wx-action-bar>\n </template>\n </div>\n</template>\n\n<style scoped>\n.wx-inbox-editor {\n display: flex;\n flex-direction: column;\n /* The panel's own step, which is smaller on a phone than on a desktop. */\n gap: var(--wx-gap, var(--wx-space-16));\n}\n\n/* The tabs take what is left of the column, so the save bar under them is at its bottom\n rather than under the last field. Nothing inside them scrolls on its own — the page does. */\n/* The address it posts to, in the type an address is written in. */\n.wx-inbox-editor__head :deep(.wx-screen-head__subtitle) {\n font-family: var(--wx-font-family-mono);\n}\n\n.wx-inbox-editor__tabs {\n flex: 1 1 auto;\n}\n</style>\n"],"names":["options","_useModel","__props","props","t","useTranslate","honeypot","option","seconds","throttle","captcha","captchas","computed","chosen","provider","kind","site","_createBlock","_unref","WxCard","_createVNode","WxFormItem","WxSwitch","$event","WxInputNumber","WxSelect","WxText","WxAlert","useInboxMessages","admin","useAdmin","hasBlocks","module","blade","block","hidden","field","extras","columns","listed","copy","text","toast","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","WxAction","_cache","_createTextVNode","_toDisplayString","_hoisted_3","_hoisted_4","WxTable","_withCtx","row","settings","heading","submit","stored","redirect","value","emptyLink","WxInput","LocalizedRichText","WxLinkPicker","ADDRESS","isAdmin","recipient","problemOf","reported","one","reachesAnybody","recipients","context","api","createInboxApi","admins","ref","emailField","channels","via","viaOptions","byLetter","router","useRouter","canSetUp","channelsLink","setUpChannels","event","onMounted","adminOptions","emailOptions","fieldLabel","title","line","adminProblem","problem","add","remove","index","confirm","_","at","setAdmin","id","setEmail","email","WxRadioGroup","_Fragment","_renderList","WxSpace","WxButton","WxIcon","_hoisted_5","WxRelationsField","WxLink","route","useRoute","locales","useLocales","message","useErrorText","form","fields","loading","saving","errors","reactive","tab","silent","channelsSend","channel","canManage","name","localizedValue","backTo","load","loaded","error","watch","save","saved","body","WxSkeleton","WxScreenHead","WxBadge","WxTabs","WxTab","FormGeneral","FieldList","FormNotifications","FormAntispam","FormEmbed","WxActionBar"],"mappings":";;;;;;;;;;;;;;;AA2BA,UAAMA,IAAUC,EAAwBC,GAAA,YAAmB,GAErDC,IAAQD,GAKRE,IAAIC,EAAa,YAAY,GAE7BC,IAAWC,EAAgBP,GAAS,qBAAqB,EAAI,GAC7DQ,IAAUD,EAAeP,GAAS,wBAAwB,CAAC,GAC3DS,IAAWF,EAAeP,GAAS,qBAAqB,CAAC,GACzDU,IAAUH,EAAeP,GAAS,oBAAoB,KAAK,GAE3DW,IAAWC,EAAS,MAAM;AAAA,MAC9B,EAAE,OAAO,OAAO,OAAOR,EAAE,mBAAmB,EAAA;AAAA,MAC5C,EAAE,OAAO,aAAa,OAAOA,EAAE,yBAAyB,EAAA;AAAA,MACxD,EAAE,OAAO,aAAa,OAAOA,EAAE,yBAAyB,EAAA;AAAA,IAAE,CAC3D,GAGKS,IAASD,EAAS,MAAM;AAC5B,YAAME,IAAWJ,EAAQ;AAEzB,aAAII,MAAa,eAAeA,MAAa,cAAoB,OAE1D,EAAE,UAAAA,GAAU,MAAMX,EAAM,OAAOW,CAAQ,KAAK,KAAA;AAAA,IACrD,CAAC,GAEKC,IAAOH,EAAS,MAAM;AAC1B,YAAMI,IAAOH,EAAO,OAAO;AAE3B,aAAOG,IAAOZ,EAAE,iBAAiBS,EAAO,MAAO,QAAQ,IAAIG,EAAK,IAAI,EAAE,IAAI;AAAA,IAC5E,CAAC;2BAICC,EA0BUC,EAAAC,CAAA,GAAA,MAAA;AAAA,iBAzBR,MAEe;AAAA,QAFfC,EAEeF,EAAAG,CAAA,GAAA;AAAA,UAFA,MAAMH,EAAAd,CAAA,EAAC,qBAAA;AAAA,QAAA;qBACpB,MAA6D;AAAA,YAA7DgB,EAA6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