Compare commits

...
36 Commits
Author SHA1 Message Date
radoslaw.smolinski 3e17f92af1 1.9.5
CI / check (push) Canceled after 0s
2026-10-16 13:32:34 +02:00
radoslaw.smolinskiandClaude Opus 5.5 c83d2dec0c Merge 1.9.5: single-language Markdown route
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:32:31 +02:00
radoslaw.smolinskiandClaude Opus 5.5 df0f5e03c3 Single-language sites: Markdown route without the locale param; i18n docs corrected
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:32:31 +02:00
radoslaw.smolinski 67e8da6ec3 1.9.4
CI / check (push) Canceled after 0s
2026-10-16 13:11:10 +02:00
radoslaw.smolinskiandClaude Opus 5.5 191cf44361 Merge 1.9.4: link styles, system links, audit rules
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:11:08 +02:00
radoslaw.smolinskiandClaude Opus 5.5 6a0fefdbae Project-defined link styles, legal links from System Pages; audit catches content-keyed logic, Polish text in code, link fields in globals
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:11:08 +02:00
radoslaw.smolinski 0069b28941 1.9.3
CI / check (push) Canceled after 0s
2026-10-16 12:56:14 +02:00
radoslaw.smolinskiandClaude Opus 5.5 3da9d6b1d0 Merge 1.9.3: audit catches hand-rolled links
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 12:56:13 +02:00
radoslaw.smolinskiandClaude Opus 5.5 eb52253dc4 Audit: catch hand-rolled link resolution (hardcoded homepage slug, URL built from a slug); comment filter fix
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 12:56:13 +02:00
radoslaw.smolinski f88c342be5 1.9.2
CI / check (push) Canceled after 0s
2026-10-16 11:52:43 +02:00
radoslaw.smolinskiandClaude Opus 5.5 293cd9a541 Merge 1.9.2: import instead of code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:52:42 +02:00
radoslaw.smolinskiandClaude Opus 5.5 81e864bde9 Docs for 1.9.2: import instead of code; docs↔code consistency test; audit accepts one-line routes
- AGENT.md: §7 full capability catalog (need → import), §0b/§3/§6 on RenderForm, SiteProviders,
  createPageRoute, re-exported routes, plugin section fields, resolveLink/resolveNav
- PROGRAMISTA §2.4, §2.7–2.8 rewritten; §6 items 28–33 (28: FormRenderer leaked the Emails tab)
- forms, links, blocks, pages, consent, turnstile, notifications, seo, mcp, i18n, deployment docs
- ipal-form: RenderForm block, formClasses, CustomForm example (FormRenderer template removed),
  seed template handles steps and option labels per language
- ipal-nav, ipal-block, ipal-setup, ipal-upgrade, ipal-seo-check, ipal-consent-check, vibe.md
- ipal-audit: re-export routes and SiteProviders satisfy the mandatory set; flags form-engine copies,
  project section fields / navigation, server entries in client components
- test/docsConsistency: docs imports exist in code; every public export is documented
- CHANGELOG 1.9.2

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:52:29 +02:00
radoslaw.smolinskiandClaude Opus 5.5 412bf953a8 Import instead of code: panel forms (steps, choice lists, dates), layout, page route, GEO routes, links, section fields
- Forms: step and checkboxGroup field types (radio, date on), server validation for them,
  useBuilderForm (logic) + BuilderForm (unstyled default) + RenderForm (/rsc: rich text,
  bound action, public part of the form only — the Emails tab never reaches the browser)
- Notifications: next / back / stepOf texts
- createContentHelpers: getSiteShell, getFormTexts, getLinkOptions, resolveLink, resolveNav,
  resolvePageRedirect, one-line route handlers (llms, llms-full, md, mcp, health, indexnow, manifest)
- /rsc: SiteProviders, createPageRoute, createNotFoundPage
- resolveLink / resolveNav / homeSlugFrom, buildSectionHeaderField / buildSectionSettingsField
- Dev sandbox frontend built on these imports; tests (unit + real Payload)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:32:46 +02:00
radoslaw.smolinskiandClaude Opus 5.5 0cfd846dd1 Changelog: history back to 1.7.4, keep at least 20 versions
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:59:38 +02:00
radoslaw.smolinski 800ba30200 1.9.1
CI / check (push) Canceled after 0s
2026-10-16 10:56:18 +02:00
radoslaw.smolinskiandClaude Opus 5.5 0c5c6ac3e3 Merge 1.9.1: SEO/GEO, consent, security, forms seed, media, fluid
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:56:17 +02:00
radoslaw.smolinskiandClaude Opus 5.5 e301ff3d00 Release as 1.9.1 instead of 1.10.0
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 10:56:16 +02:00
radoslaw.smolinskiandClaude Opus 5.5 3986e70e5f Dev sandbox: enable consent log
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:27:13 +02:00
radoslaw.smolinskiandClaude Opus 5.5 de929422bb Docs for 1.10: mandatory set (18 items), setup skill, reference code, module docs, changelog
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:25:58 +02:00
radoslaw.smolinskiandClaude Opus 5.5 f52fbe6b12 Audits: performance, responsive and new mandatory items; seo-check content checks
ipal-audit: <video> outside Media, priority outside the hero, <Media> without
sizes, raw YouTube iframes, 100vh/h-screen, fixed pixel sizes, page JSON-LD,
upload sandbox headers, images preset, missing form seeds; accepts
createMarkdownRoute / createSubmitAction.
ipal-seo-check: exactly one h1, heading jumps, img alt and dimensions, LCP
priority, og:image, thin pages, internal links, X-Robots-Tag noindex left on
in production. Verified on bad and good fixtures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:22:55 +02:00
radoslaw.smolinskiandClaude Opus 5.5 69309b09e3 Fluid scaling to 1920px and height-aware variables; speed and responsive guidelines
- fluid-wide.css: the fluid.css variables stretched over 360→1920px (export
  @intecion/ipal-kit/fluid-wide.css); fluid.css values unchanged.
- New variables in both (unused until a project opts in): --ipal-measure,
  --ipal-container(-wide), --ipal-hero-min-h (svh), --ipal-fs-display-fit,
  --ipal-fs-h1-fit, --ipal-space-section-fit — keep the hero CTA above the fold
  on 1366×768. Verified in Chromium at 360…1920 widths.
- AGENT.md §6.11a (scaling, viewport test list incl. 13–15" laptops and 125/150 %
  zoom) and §6.11b (Core Web Vitals table: LCP image, sizes, placeholders, video
  modes, YouTube facade, images preset, fonts).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:21:38 +02:00
radoslaw.smolinskiandClaude Opus 5.5 55fc27a13f Media performance tools: image/video props, upload placeholders, images preset, YouTube facade
Headless helpers for the project's own <Media> (look stays in the project):
- mediaImageProps: dimensions from the doc (no CLS), lazy by default, LCP image
  gets preload + fetchPriority=high + eager (Next 16 replaced 'priority'),
  focal point → object-position, blur placeholder + dominant colour.
- MEDIA_SIZES suggestions for 'sizes' (any string still works).
- videoProps: 'background' (muted loop, respects reduced motion) or 'player'
  (controls, preload=none, poster).
- buildMediaPlaceholderHook/Field: tiny WebP blur + dominant colour at upload
  via the configured sharp (no new dependency).
- buildImagesConfig: AVIF/WebP, R2 remotePatterns, 31-day cache.
- <YouTubeEmbed> (/client): poster + button, youtube-nocookie iframe on click.
- buildCsp youtube allows the i.ytimg.com poster. kod-sekcji Media template
  uses the helpers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:19:38 +02:00
radoslaw.smolinskiandClaude Opus 5.5 f7466cf77f noindex tooling, content/noindex/component/testing guidelines for agents
- IPAL_NOINDEX=1: whole-site noindex for staging (robots Disallow /, robots
  meta noindex,nofollow, X-Robots-Tag via buildSecurityHeaders).
- Markdown mirrors and llms files: X-Robots-Tag noindex; Markdown adds a
  Link rel=canonical to the HTML page.
- buildNoindexField refuses noindex on the homepage and archive pages.
- AGENT.md §0c: writing pages for Google and AI (structure, answer-first,
  facts, E-E-A-T, entity consistency, sameAs, aiSummary, meta) and a
  when-to-noindex table (legal pages stay indexed by default; drafts instead
  of noindexed pages; staging via env).
- AGENT.md §6.0: ten component rules (small, Button styled once, buttons as
  '+ Add Button' array, variants, panel clarity); audit warns on buttons
  styled inside sections.
- AGENT.md §8a + smoke.spec.template.ts: what to test in a client project;
  PROGRAMISTA §8.1a: how the plugin itself is tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:13:44 +02:00
radoslaw.smolinskiandClaude Opus 5.5 8e2dd28b83 Form seed template: fields, confirmation, company notification and sender confirmation in every language
The ipal-form skill now requires seeding each form (scripts/seed-form-*.ts):
idempotent, reads the notification inbox from the panel and stops without
one, adds both e-mails ({{email}} is safe since submitForm accepts exactly one
address). Verified on the dev sandbox in pl + en. Dev sandbox enables forms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:08:56 +02:00
radoslaw.smolinskiandClaude Opus 5.5 9e49856611 Security review: drafts no longer public, submissions staff-only, safe links, upload sandbox
- Fix: resolveRoute served never-published drafts by URL (Payload's find
  returns them with _status 'draft') — also via Markdown, MCP get_page and
  metadata. Drafts are dropped on every branch; `draft: true` for previews.
- Fix: getArchiveEntries listed drafts in archive pages despite its comment;
  `_status: published` is added automatically when the collection has drafts.
- form-submissions readable only by editor+ (form-builder default: any account
  of the admin collection, incl. plain users from an open sign-up); delete admin.
- Forms stay public for rendering, but the Emails tab (recipients) is hidden
  from anonymous REST reads.
- safeHref: CMS links only http(s), mailto, tel, sms, #, / — javascript:, data:
  and control-character tricks are dropped in resolveLinkHref.
- Analytics IDs validated in the panel and before reaching the browser.
- buildUploadSecurityHeaders: sandbox CSP for /api/<upload>/file/* so an
  uploaded SVG can't run script on the site's origin.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 03:06:26 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ebf70d49bd Consent: withdrawal clears tool cookies, policy version, consent log, cookie scan; form input hardening
Consent (GDPR)
- Withdrawing consent now deletes GA/Meta/Ads/Clarity/LinkedIn/TikTok/Hotjar
  cookies (prefix patterns) on the host AND parent domains — previously only
  the locale cookie was removed and _ga & co. stayed. Projects extend the list
  via <ConsentProvider cookieMap>, merged with the defaults.
- Cookie Settings → Policy version: raising it asks every visitor again.
- <CookieBanner equalChoice>: Reject styled like Accept (UODO/EDPB), opt-in.
- Opt-in consent log (ipalKit({ consentLog: true }) + logEndpoint): random id,
  choices, version, time — no IP/UA; admin-only collection, retention purge.
- Cookie Settings → Cookies + getCookieTable + unstyled <CookieTable> (/rsc).
- Consent cookie gets Secure on HTTPS; consent id stored with the decision.
- ipal-consent-check: cookie-scan.mjs (before/after consent, known-tool
  catalog PL/EN, flags non-necessary cookies set before consent) and
  import-cookies.ts into the panel (idempotent, keeps editor edits).

Forms
- Server-side type checks per field from the panel definition: email = one
  address (blocks "a@x, b@y" recipient injection into {{email}} confirmations
  and CR/LF header injection), select/radio only configured options, numbers,
  booleans; objects/arrays rejected; control and bidi characters stripped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 02:31:58 +02:00
radoslaw.smolinskiandClaude Opus 5.5 c9a50abc33 SEO/GEO tools and project requests: site index, IndexNow, page JSON-LD, fixes
GEO / SEO
- collectSiteIndex: one list of public docs per locale (pages + archive
  entries) on sitemap rules; llms.txt/llms-full and MCP list_pages now include
  blog/content entries and every language. Fixes hard-coded "## Strony" heading
  and homepage not collapsing to the locale root in llms.txt.
- Markdown frontmatter: canonical url + updated date.
- Metadata: X/Twitter card, OG image width/height/alt, og:type article with
  published/modified times for entries.
- Fix: Site Settings "defaultShareImage" was never used — now the OG fallback.
- getPageJsonLd (createContentHelpers): WebPage/CollectionPage/BlogPosting,
  BreadcrumbList from the real route, FAQPage via a project mapper.
- IndexNow (opt-in ipalKit({ indexNow: true })): submit published URLs in all
  languages, key generated in Site Integrations or INDEXNOW_KEY, key route.
- sameAs profiles in Site Settings + sameAsUrls(); sitemap <image:image>.

From project reports
- Fix: package exports were missing ./env and ./fluid.css although the docs
  import them (TS2307); regression test checks every documented subpath.
- Fix: plugins run before Payload adds its default users collection, so roles
  and 2FA had nothing to attach to — ipalKit injects an auth collection when
  the project has none (project's own one wins). Audit no longer errors on it.
- createMarkdownRoute, createSubmitAction (/server, headers injected).
- formatOpeningHours (PL/EN/DE text → schema.org), used by
  buildLocalBusinessJsonLd, which also takes a schema.org `type`.
- buildNavigationJsonLd straight from the header global.
- buildCsp googleMaps: full Maps JS API domain set; values de-duplicated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 02:19:08 +02:00
radoslaw.smolinskiandClaude Opus 5.5 9e40d74bb3 Normalize bin path (npm pkg fix) to silence publish warning
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:27:21 +02:00
radoslaw.smolinski 050c9edf68 1.9.0 2026-10-16 01:26:27 +02:00
radoslaw.smolinskiandClaude Opus 5.5 d3e5efb9f8 Agent instructions: mandatory feature set (SEO, GEO, R2, Turnstile, forms) enforced by audits
- AGENT.md §0b: one table of everything every site must have (SEO meta/maps,
  JSON-LD, llms.txt + llms-full, Markdown, MCP, AI bots, R2, panel forms,
  Turnstile, consent, security, ops, system pages, zero hardcodes), the
  forbidden replacements (own forms, nodemailer, reCAPTCHA, hand-written
  JSON-LD, static SEO files, raw S3) and an `ipal-audit-skip:` escape hatch that
  needs a recorded client decision.
- ipal-audit: "missing: …" errors for every mandatory item and for plugin
  replacements; ipal-seo-check: runtime GEO checks (llms, Markdown, MCP,
  JSON-LD, AI bots, health). Both verified on bare and complete fixtures.
- Skills (setup, site, form, upgrade, audit, seo-check) and PROGRAMISTA.md
  wire the full set from step one; GEO is no longer "optional".
- Fix: createProxy({ markdown: true }) lets /md/... through — multilingual
  sites redirected /md/pl/x to /pl/md/pl/x, so the documented Markdown route
  never worked — and handles Accept: text/markdown.
- createContentHelpers({ markdownAlternate: true }) adds the text/markdown
  alternate link in generatePageMetadata.
- JSDoc/docs JSON-LD examples use JsonLdGraph; docs/CHANGELOG.md for 1.9.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:26:10 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ab854ef37a MCP site tools, Turnstile key alert, required 2FA injection, a11y, more tests
- MCP: new get_site_info and list_pages tools (public by design, published
  and indexable content only); search results collapse the homepage to root.
  New listContent() helper shared with searchContent.
- Dashboard alert when Turnstile is half-configured (it is silently off then).
- twoFactor.plugin is now required; the dynamic-import fallback (which never
  worked under Next and caused a Turbopack warning) is gone.
- a11y: cookie category checkboxes are labelled, buttons have type, test-email
  input is labelled; tab labels keep localized collection labels.
- IPAL_IP_HEADER: one-time production warning when unset, opt-in
  ipalEnvRules({ ipHeader: true }).
- Tests: SEO/robots/sitemap/hreflang, CSP, Markdown, consent, MCP, and a real
  Payload + SQLite integration test for forms and the roles guard (74 total).
- Drop unused mongodb-memory-server; dev .env.example for SQLite.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 01:15:19 +02:00
radoslaw.smolinskiandClaude Opus 5.5 86e69b0bcf Repo hygiene: stop tracking dist, CI, working dev sandbox
- dist/ no longer committed; prepare builds it for git installs and
  prepublishOnly runs clean + build + unit tests before every publish.
- Gitea Actions CI: typecheck, lint, unit tests, build on push/PR.
- New scripts: typecheck, test:watch; test:int runs once; lint covers src + test.
- dev/: drop the Mongo memory server and template route, opt out of 2FA,
  add the pages collection the SEO config expects, alias @intecion/ipal-kit/*
  to src, fix e2e credentials, regenerate types and import map.
- Remove stray src/index.tsgrep, dedupe .gitignore, README peer versions 3.90.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 00:22:04 +02:00
radoslaw.smolinskiandClaude Opus 5.5 4544cac69c Lint: fix all ESLint errors (391 -> 0), lint and typecheck tests
Mostly perfectionist import/key sorting and curly braces from --fix, plus:
- spread instead of .apply() in the Meta Pixel stub
- non-capturing group in the locale-code pattern
- React 19 use(Context) / <Context value> in TurnstileProvider
- email regex rewritten without super-linear backtracking (covered by a test)
- console.warn/error allowed (deliberate server diagnostics)
- test/tsconfig.json so the project service and tsc see test files

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 23:56:18 +02:00
radoslaw.smolinskiandClaude Opus 5.5 ce0a390351 Security: mandatory Turnstile when configured, admin-only test email, roles on create, safer client IP
- Turnstile is on only when both keys are set (panel or env); then submitForm
  requires a valid token, so a bot can no longer skip the check by omitting it.
  Not configured -> no widget, no check. New getTurnstileConfig() for layouts.
- /api/ipal/test-email now requires the admin role (403 for other users).
- roles field: create access is admin-only, so open sign-up can't self-assign admin.
- clientIp reads X-Forwarded-For from the right, accepts Headers, can be pinned
  via option or IPAL_IP_HEADER; exposed on search/MCP routes.
- Pluggable shared rate-limit store (setRateLimitStore) for multi-instance setups.
- Replace the template int.spec with real unit tests in test/ (44 tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 23:54:25 +02:00
radoslaw.smolinski aa284736c9 1.8.14 2026-10-15 22:24:35 +02:00
radoslaw.smolinski bd2fbaf8bf 2FA fixed 2026-10-15 22:24:28 +02:00
825 changed files with 11390 additions and 19045 deletions
+27
View File
@@ -0,0 +1,27 @@
# Runs on every push and pull request: typecheck, lint, unit tests, build.
# Gitea Actions uses the GitHub Actions syntax; needs a runner with Docker.
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
# --ignore-scripts: skip `prepare` (the build) here; it runs as its own step.
- run: pnpm install --frozen-lockfile --ignore-scripts
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test:int
- run: pnpm build
+2 -5
View File
@@ -50,9 +50,6 @@ next-env.d.ts
# local db & build artifacts
*.db
*.tgz
0
# local db & build artifacts
*.db
*.tgz
0
# build output — produced by `pnpm build` (prepare/prepublishOnly), not committed
/dist
+2 -1
View File
@@ -63,7 +63,7 @@ The plugin doesn't pull in the dependencies it shares with Payload — add them
yourself, in a version matching your Payload:
```bash
pnpm add @payloadcms/plugin-seo@3.84.1 @payloadcms/plugin-form-builder@3.84.1 \
pnpm add @payloadcms/plugin-seo@3.90.2 @payloadcms/plugin-form-builder@3.90.2 \
nodemailer lucide-react slugify server-only
```
@@ -115,6 +115,7 @@ Everything lives in the **[docs/](./docs)** directory. To get started:
- **[AGENT.md](./docs/agent/AGENT.md)** — rules for AI agents (Polish)
- **[PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** — setup, deployment, upgrades, releasing (Polish)
- **[README.md](./docs/README.md)** — index of the plugin's modules
- **[CHANGELOG.md](./docs/CHANGELOG.md)** — what changed per version and what projects must update (Polish)
---
Regular → Executable
View File
+2 -1
View File
@@ -1,2 +1,3 @@
DATABASE_URL=mongodb://127.0.0.1/payload-plugin-template
# SQLite file for the dev sandbox (default: ./payload.db). Delete the file to start fresh.
DATABASE_URI=file:./payload.db
PAYLOAD_SECRET=YOUR_SECRET_HERE
+9
View File
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->
## This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->
@@ -0,0 +1,18 @@
import { notFound, permanentRedirect } from 'next/navigation.js'
import { createPageRoute } from '@intecion/ipal-kit/rsc'
import { FormBlock } from '../../../../blocks/FormBlock.js'
import * as content from '../../../../lib/content.js'
import { sendForm } from '../actions.js'
export const revalidate = 3600
const route = createPageRoute(content, {
blockProps: async ({ locale }) => ({ formTexts: await content.getFormTexts(locale), sendForm }),
blocks: { formBlock: FormBlock },
notFound,
permanentRedirect,
})
export default route.Page
export const generateMetadata = route.generateMetadata
export const generateStaticParams = route.generateStaticParams
+7
View File
@@ -0,0 +1,7 @@
'use server'
import { headers } from 'next/headers.js'
import { createSubmitAction } from '@intecion/ipal-kit/server'
import { getCachedPayload } from '../../../lib/content.js'
export const sendForm = createSubmitAction({ getCachedPayload, headers })
+22
View File
@@ -0,0 +1,22 @@
import { notFound } from 'next/navigation.js'
import { CookieBanner } from '@intecion/ipal-kit/client'
import { SiteProviders } from '@intecion/ipal-kit/rsc'
import { getConfiguredLocales, getSiteShell } from '../../../lib/content.js'
import './styles.css'
type Props = { children: React.ReactNode; params: Promise<{ locale: string }> }
export default async function LocaleLayout({ children, params }: Props) {
const { locale } = await params
if (!(await getConfiguredLocales()).includes(locale)) notFound()
return (
<html lang={locale}>
<body>
<SiteProviders banner={<CookieBanner equalChoice />} logEndpoint="/api/ipal/consent" shell={await getSiteShell(locale)}>
<main>{children}</main>
</SiteProviders>
</body>
</html>
)
}
@@ -0,0 +1,6 @@
import { createNotFoundPage } from '@intecion/ipal-kit/rsc'
import { FormBlock } from '../../../blocks/FormBlock.js'
import * as content from '../../../lib/content.js'
export default createNotFoundPage(content, { blocks: { formBlock: FormBlock }, fallback: <h1>404</h1> })
+10
View File
@@ -0,0 +1,10 @@
/* Sandbox look — in a project this is the design system. */
body { font-family: system-ui, sans-serif; margin: 0 auto; max-width: 40rem; padding: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }
.field { grid-column: span 2; } .half { grid-column: span 1; }
.label, legend { display: block; font-weight: 600; margin-bottom: .25rem; }
.input { border: 1px solid #999; border-radius: 6px; box-sizing: border-box; padding: .5rem; width: 100%; }
.choices { border: 0; display: grid; gap: .25rem; margin: 0; padding: 0; } .choice { display: flex; gap: .5rem; }
.error { color: #b00020; } .progress { color: #555; } .step-title { font-size: 1.25rem; font-weight: 700; }
.actions { display: flex; gap: .5rem; margin-top: 1rem; } .btn { background: #111; border: 0; border-radius: 6px; color: #fff; padding: .6rem 1rem; }
.btn-secondary { background: #ddd; color: #111; } .success { background: #e7f7ec; padding: 1rem; }
+18
View File
@@ -1,6 +1,24 @@
import { OverviewComponent as OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaTitleComponent as MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaDescriptionComponent as MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { MetaImageComponent as MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { PreviewComponent as PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client'
import { IntegrationStatusBanner as IntegrationStatusBanner_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client'
import { MaskedField as MaskedField_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client'
import { TestEmailButton as TestEmailButton_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client'
import { IntegrationAlerts as IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin'
import { CollectionCards as CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1 } from '@payloadcms/next/rsc'
/** @type import('payload').ImportMap */
export const importMap = {
"@payloadcms/plugin-seo/client#OverviewComponent": OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#MetaTitleComponent": MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#MetaDescriptionComponent": MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#MetaImageComponent": MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@payloadcms/plugin-seo/client#PreviewComponent": PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860,
"@intecion/ipal-kit/client#IntegrationStatusBanner": IntegrationStatusBanner_630f031911beff97691b963f10a20a86,
"@intecion/ipal-kit/client#MaskedField": MaskedField_630f031911beff97691b963f10a20a86,
"@intecion/ipal-kit/client#TestEmailButton": TestEmailButton_630f031911beff97691b963f10a20a86,
"@intecion/ipal-kit/admin#IntegrationAlerts": IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23,
"@payloadcms/next/rsc#CollectionCards": CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1
}
+2
View File
@@ -0,0 +1,2 @@
export { mcpGET as GET, mcpPOST as POST } from '../../../lib/content.js'
export const dynamic = 'force-dynamic'
+2
View File
@@ -0,0 +1,2 @@
export { llmsRoute as GET } from '../../lib/content.js'
export const dynamic = 'force-dynamic'
-12
View File
@@ -1,12 +0,0 @@
import configPromise from '@payload-config'
import { getPayload } from 'payload'
export const GET = async (request: Request) => {
const payload = await getPayload({
config: configPromise,
})
return Response.json({
message: 'This is an example of a custom route.',
})
}
+16
View File
@@ -0,0 +1,16 @@
import type { FormNotificationTexts } from '@intecion/ipal-kit'
import { RenderForm, type SendFormAction } from '@intecion/ipal-kit/rsc'
// Classes set once per project — here plain names the sandbox CSS styles.
const formClasses = {
actions: 'actions', back: 'btn btn-secondary', choice: 'choice', choices: 'choices', error: 'error', field: 'field',
fieldHalf: 'half', fields: 'grid', form: 'form', formError: 'error', input: 'input', label: 'label', progress: 'progress',
select: 'input', stepTitle: 'step-title', submit: 'btn', success: 'success', textarea: 'input',
}
type Props = { form?: unknown; formTexts?: FormNotificationTexts; locale: string; sendForm?: SendFormAction }
export function FormBlock({ form, formTexts, locale, sendForm }: Props) {
if (!formTexts || !sendForm) return null
return <RenderForm action={sendForm} classNames={formClasses} form={form as never} locale={locale} requiredMark=" *" texts={formTexts} />
}
+4 -3
View File
@@ -1,12 +1,13 @@
import { expect, test } from '@playwright/test'
// this is an example Playwright e2e test
import { devUser } from './helpers/credentials.js'
test('should render admin panel logo', async ({ page }) => {
await page.goto('/admin')
// login
await page.fill('#field-email', '[email protected]')
await page.fill('#field-password', 'test')
await page.fill('#field-email', devUser.email)
await page.fill('#field-password', devUser.password)
await page.click('.form-submit button')
// should show dashboard
+7
View File
@@ -0,0 +1,7 @@
export const i18nConfig = {
defaultLocale: 'pl',
locales: [
{ code: 'pl', label: 'Polski' },
{ code: 'en', label: 'English' },
],
} as const
-52
View File
@@ -1,52 +0,0 @@
import type { Payload } from 'payload'
import config from '@payload-config'
import { createPayloadRequest, getPayload } from 'payload'
import { afterAll, beforeAll, describe, expect, test } from 'vitest'
import { customEndpointHandler } from '../src/endpoints/customEndpointHandler.js'
let payload: Payload
afterAll(async () => {
await payload.destroy()
})
beforeAll(async () => {
payload = await getPayload({ config })
})
describe('Plugin integration tests', () => {
test('should query custom endpoint added by plugin', async () => {
const request = new Request('http://localhost:3000/api/my-plugin-endpoint', {
method: 'GET',
})
const payloadRequest = await createPayloadRequest({ config, request })
const response = await customEndpointHandler(payloadRequest)
expect(response.status).toBe(200)
const data = await response.json()
expect(data).toMatchObject({
message: 'Hello from custom endpoint',
})
})
test('can create post with custom text field added by plugin', async () => {
const post = await payload.create({
collection: 'posts',
data: {
addedByPlugin: 'added by plugin',
},
})
expect(post.addedByPlugin).toBe('added by plugin')
})
test('plugin creates and seeds plugin-collection', async () => {
expect(payload.collections['plugin-collection']).toBeDefined()
const { docs } = await payload.find({ collection: 'plugin-collection' })
expect(docs).toHaveLength(1)
})
})
+11
View File
@@ -0,0 +1,11 @@
// Sandbox data layer — the same one line every project has (PROGRAMISTA §2.7).
import config from '@payload-config'
import { createContentHelpers } from '@intecion/ipal-kit'
import { i18nConfig } from '../i18n.config.js'
export const {
generatePageMetadata, generateStaticParams, getCachedPayload, getConfiguredLocales, getFormTexts, getLinkOptions,
getNotFoundPage, getPageJsonLd, getSettings, getSiteShell, healthRoute, i18n, llmsRoute, mcpGET, mcpPOST,
resolveNav, resolvePageRedirect, resolveRoute,
} = createContentHelpers({ baseUrl: 'http://localhost:3000', config, i18n: i18nConfig, mcp: { serverName: 'ipal-sandbox' } })
-1
View File
@@ -15,7 +15,6 @@ const nextConfig = {
return webpackConfig
},
serverExternalPackages: ['mongodb-memory-server'],
}
export default withPayload(nextConfig, { devBundleServerPackages: false })
+781 -25
View File
@@ -68,8 +68,12 @@ export interface Config {
blocks: {};
collections: {
users: User;
pages: Page;
posts: Post;
media: Media;
forms: Form;
'form-submissions': FormSubmission;
'consent-records': ConsentRecord;
'payload-kv': PayloadKv;
'payload-locked-documents': PayloadLockedDocument;
'payload-preferences': PayloadPreference;
@@ -78,8 +82,12 @@ export interface Config {
collectionsJoins: {};
collectionsSelect: {
users: UsersSelect<false> | UsersSelect<true>;
pages: PagesSelect<false> | PagesSelect<true>;
posts: PostsSelect<false> | PostsSelect<true>;
media: MediaSelect<false> | MediaSelect<true>;
forms: FormsSelect<false> | FormsSelect<true>;
'form-submissions': FormSubmissionsSelect<false> | FormSubmissionsSelect<true>;
'consent-records': ConsentRecordsSelect<false> | ConsentRecordsSelect<true>;
'payload-kv': PayloadKvSelect<false> | PayloadKvSelect<true>;
'payload-locked-documents': PayloadLockedDocumentsSelect<false> | PayloadLockedDocumentsSelect<true>;
'payload-preferences': PayloadPreferencesSelect<false> | PayloadPreferencesSelect<true>;
@@ -93,11 +101,13 @@ export interface Config {
'site-settings': SiteSetting;
'site-integrations': SiteIntegration;
'cookie-settings': CookieSetting;
notifications: Notification;
};
globalsSelect: {
'site-settings': SiteSettingsSelect<false> | SiteSettingsSelect<true>;
'site-integrations': SiteIntegrationsSelect<false> | SiteIntegrationsSelect<true>;
'cookie-settings': CookieSettingsSelect<false> | CookieSettingsSelect<true>;
notifications: NotificationsSelect<false> | NotificationsSelect<true>;
};
locale: 'pl' | 'en';
widgets: {
@@ -144,6 +154,7 @@ export interface User {
resetPasswordExpiration?: string | null;
salt?: string | null;
hash?: string | null;
resetPasswordRequestedAt?: string | null;
loginAttempts?: number | null;
lockUntil?: string | null;
sessions?:
@@ -158,10 +169,20 @@ export interface User {
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts".
* via the `definition` "pages".
*/
export interface Post {
export interface Page {
id: number;
title?: string | null;
slug?: string | null;
layout?:
| {
form?: (number | null) | Form;
id?: string | null;
blockName?: string | null;
blockType: 'formBlock';
}[]
| null;
meta?: {
title?: string | null;
description?: string | null;
@@ -169,10 +190,243 @@ export interface Post {
* Maximum upload file size: 12MB. Recommended file size for images is <500KB.
*/
image?: (number | null) | Media;
/**
* Use this exact text as the browser-tab title — no site name, no separator. Leave empty to compose the title automatically.
*/
titleOverride?: string | null;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "forms".
*/
export interface Form {
id: number;
title: string;
fields?:
| (
| {
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
defaultValue?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'checkbox';
}
| {
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'country';
}
| {
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'email';
}
| {
message?: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
id?: string | null;
blockName?: string | null;
blockType: 'message';
}
| {
name: string;
label?: string | null;
width?: number | null;
defaultValue?: number | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'number';
}
| {
name: string;
label?: string | null;
width?: number | null;
defaultValue?: string | null;
placeholder?: string | null;
options?:
| {
label: string;
value: string;
id?: string | null;
}[]
| null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'select';
}
| {
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'state';
}
| {
name: string;
label?: string | null;
width?: number | null;
defaultValue?: string | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'text';
}
| {
name: string;
label?: string | null;
width?: number | null;
defaultValue?: string | null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'textarea';
}
| {
/**
* Technical name, e.g. "services" — no spaces.
*/
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
options?:
| {
label: string;
value: string;
id?: string | null;
}[]
| null;
/**
* Empty = no minimum (Required = at least one).
*/
minSelected?: number | null;
/**
* Empty = no limit.
*/
maxSelected?: number | null;
id?: string | null;
blockName?: string | null;
blockType: 'checkboxGroup';
}
| {
name: string;
label?: string | null;
width?: number | null;
required?: boolean | null;
defaultValue?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'date';
}
| {
name: string;
label?: string | null;
width?: number | null;
defaultValue?: string | null;
options?:
| {
label: string;
value: string;
id?: string | null;
}[]
| null;
required?: boolean | null;
id?: string | null;
blockName?: string | null;
blockType: 'radio';
}
| {
/**
* Starts a new step: the fields below it (until the next Step) are shown together, with Next / Back buttons. Leave the form without Steps for a single-screen form.
*/
title?: string | null;
description?: string | null;
id?: string | null;
blockName?: string | null;
blockType: 'step';
}
)[]
| null;
submitButtonLabel?: string | null;
confirmationType?: ('message' | 'redirect') | null;
confirmationMessage?: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
redirect?: {
url: string;
};
emails?:
| {
emailTo?: string | null;
cc?: string | null;
bcc?: string | null;
replyTo?: string | null;
emailFrom?: string | null;
subject: string;
message?: {
root: {
type: string;
children: {
type: any;
version: number;
[k: string]: unknown;
}[];
direction: ('ltr' | 'rtl') | null;
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
indent: number;
version: number;
};
[k: string]: unknown;
} | null;
id?: string | null;
}[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "media".
@@ -191,6 +445,64 @@ export interface Media {
focalX?: number | null;
focalY?: number | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts".
*/
export interface Post {
id: number;
title?: string | null;
meta?: {
title?: string | null;
description?: string | null;
/**
* Maximum upload file size: 12MB. Recommended file size for images is <500KB.
*/
image?: (number | null) | Media;
/**
* Use this exact text as the browser-tab title — no site name, no separator. Leave empty to compose the title automatically.
*/
titleOverride?: string | null;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "form-submissions".
*/
export interface FormSubmission {
id: number;
form: number | Form;
submissionData?:
| {
field: string;
value: string;
id?: string | null;
}[]
| null;
updatedAt: string;
createdAt: string;
}
/**
* Proof of cookie consent: random id (also in the visitor cookie), choices, policy version, time. No personal data.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "consent-records".
*/
export interface ConsentRecord {
id: number;
consentId: string;
version: number;
choices?: {
necessary?: boolean | null;
functional?: boolean | null;
analytics?: boolean | null;
marketing?: boolean | null;
};
updatedAt: string;
createdAt: string;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-kv".
@@ -219,6 +531,10 @@ export interface PayloadLockedDocument {
relationTo: 'users';
value: number | User;
} | null)
| ({
relationTo: 'pages';
value: number | Page;
} | null)
| ({
relationTo: 'posts';
value: number | Post;
@@ -226,6 +542,18 @@ export interface PayloadLockedDocument {
| ({
relationTo: 'media';
value: number | Media;
} | null)
| ({
relationTo: 'forms';
value: number | Form;
} | null)
| ({
relationTo: 'form-submissions';
value: number | FormSubmission;
} | null)
| ({
relationTo: 'consent-records';
value: number | ConsentRecord;
} | null);
globalSlug?: string | null;
user: {
@@ -282,6 +610,7 @@ export interface UsersSelect<T extends boolean = true> {
resetPasswordExpiration?: T;
salt?: T;
hash?: T;
resetPasswordRequestedAt?: T;
loginAttempts?: T;
lockUntil?: T;
sessions?:
@@ -294,15 +623,46 @@ export interface UsersSelect<T extends boolean = true> {
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts_select".
* via the `definition` "pages_select".
*/
export interface PostsSelect<T extends boolean = true> {
export interface PagesSelect<T extends boolean = true> {
title?: T;
slug?: T;
layout?:
| T
| {
formBlock?:
| T
| {
form?: T;
id?: T;
blockName?: T;
};
};
meta?:
| T
| {
title?: T;
description?: T;
image?: T;
titleOverride?: T;
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "posts_select".
*/
export interface PostsSelect<T extends boolean = true> {
title?: T;
meta?:
| T
| {
title?: T;
description?: T;
image?: T;
titleOverride?: T;
};
updatedAt?: T;
createdAt?: T;
@@ -324,6 +684,229 @@ export interface MediaSelect<T extends boolean = true> {
focalX?: T;
focalY?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "forms_select".
*/
export interface FormsSelect<T extends boolean = true> {
title?: T;
fields?:
| T
| {
checkbox?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
defaultValue?: T;
id?: T;
blockName?: T;
};
country?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
id?: T;
blockName?: T;
};
email?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
id?: T;
blockName?: T;
};
message?:
| T
| {
message?: T;
id?: T;
blockName?: T;
};
number?:
| T
| {
name?: T;
label?: T;
width?: T;
defaultValue?: T;
required?: T;
id?: T;
blockName?: T;
};
select?:
| T
| {
name?: T;
label?: T;
width?: T;
defaultValue?: T;
placeholder?: T;
options?:
| T
| {
label?: T;
value?: T;
id?: T;
};
required?: T;
id?: T;
blockName?: T;
};
state?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
id?: T;
blockName?: T;
};
text?:
| T
| {
name?: T;
label?: T;
width?: T;
defaultValue?: T;
required?: T;
id?: T;
blockName?: T;
};
textarea?:
| T
| {
name?: T;
label?: T;
width?: T;
defaultValue?: T;
required?: T;
id?: T;
blockName?: T;
};
checkboxGroup?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
options?:
| T
| {
label?: T;
value?: T;
id?: T;
};
minSelected?: T;
maxSelected?: T;
id?: T;
blockName?: T;
};
date?:
| T
| {
name?: T;
label?: T;
width?: T;
required?: T;
defaultValue?: T;
id?: T;
blockName?: T;
};
radio?:
| T
| {
name?: T;
label?: T;
width?: T;
defaultValue?: T;
options?:
| T
| {
label?: T;
value?: T;
id?: T;
};
required?: T;
id?: T;
blockName?: T;
};
step?:
| T
| {
title?: T;
description?: T;
id?: T;
blockName?: T;
};
};
submitButtonLabel?: T;
confirmationType?: T;
confirmationMessage?: T;
redirect?:
| T
| {
url?: T;
};
emails?:
| T
| {
emailTo?: T;
cc?: T;
bcc?: T;
replyTo?: T;
emailFrom?: T;
subject?: T;
message?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "form-submissions_select".
*/
export interface FormSubmissionsSelect<T extends boolean = true> {
form?: T;
submissionData?:
| T
| {
field?: T;
value?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "consent-records_select".
*/
export interface ConsentRecordsSelect<T extends boolean = true> {
consentId?: T;
version?: T;
choices?:
| T
| {
necessary?: T;
functional?: T;
analytics?: T;
marketing?: T;
};
updatedAt?: T;
createdAt?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "payload-kv_select".
@@ -374,6 +957,18 @@ export interface SiteSetting {
* Used in page titles and Open Graph metadata.
*/
siteName: string;
/**
* Fallback meta description when a page has none. Also used for llms.txt and Open Graph.
*/
siteDescription?: string | null;
/**
* Which comes first in browser tabs.
*/
titleOrder?: ('page-first' | 'site-first') | null;
/**
* Separates the page title from the site name in browser tabs.
*/
titleSeparator?: ('|' | '–' | '-' | '·' | '/') | null;
/**
* Primary site logo.
*/
@@ -383,7 +978,16 @@ export interface SiteSetting {
*/
defaultShareImage?: (number | null) | Media;
/**
* Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend.
* Official profiles of this business (Google Business Profile, LinkedIn, Facebook, Wikipedia…). Tells search engines and AI which entity the site belongs to.
*/
sameAs?:
| {
url: string;
id?: string | null;
}[]
| null;
/**
* Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.
*/
favicon?: (number | null) | Media;
/**
@@ -404,13 +1008,29 @@ export interface SiteSetting {
export interface SiteIntegration {
id: number;
/**
* Google Analytics 4 Measurement ID.
* Google Analytics 4 Measurement ID. (Google — Consent Mode)
*/
ga4MeasurementId?: string | null;
/**
* Google Tag Manager container ID.
* Google Tag Manager container ID. (Google — Consent Mode)
*/
gtmContainerId?: string | null;
/**
* Meta (Facebook) Pixel ID. Loads only after MARKETING consent.
*/
metaPixelId?: string | null;
/**
* Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.
*/
clarityProjectId?: string | null;
/**
* LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.
*/
linkedInPartnerId?: string | null;
/**
* TikTok Pixel ID. Loads only after MARKETING consent.
*/
tiktokPixelId?: string | null;
/**
* Public site key rendered in the Turnstile widget.
*/
@@ -419,6 +1039,17 @@ export interface SiteIntegration {
* Secret key used for server-side verification.
*/
turnstileSecretKey?: string | null;
turnstileStatus?: {
state?: ('ok' | 'degraded') | null;
code?: string | null;
message?: string | null;
since?: string | null;
checkedAt?: string | null;
};
/**
* How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).
*/
emailTransport?: ('smtp' | 'graph') | null;
smtpHost?: string | null;
smtpPort?: number | null;
/**
@@ -437,22 +1068,17 @@ export interface SiteIntegration {
* Default "from" display name.
*/
smtpFromName?: string | null;
emailStatus?: {
state?: ('ok' | 'degraded') | null;
code?: string | null;
message?: string | null;
since?: string | null;
checkedAt?: string | null;
};
/**
* R2 bucket name.
* Key that proves this site owns its URLs to IndexNow (Bing, ChatGPT Search). Generated automatically — change only to rotate it.
*/
r2Bucket?: string | null;
/**
* R2 S3-compatible endpoint URL.
*/
r2Endpoint?: string | null;
/**
* R2 access key ID.
*/
r2AccessKeyId?: string | null;
/**
* R2 secret access key.
*/
r2SecretAccessKey?: string | null;
indexNowKey?: string | null;
updatedAt?: string | null;
createdAt?: string | null;
}
@@ -462,6 +1088,10 @@ export interface SiteIntegration {
*/
export interface CookieSetting {
id: number;
/**
* Raise by 1 when you add a tool or change the cookie policy — every visitor is asked for consent again.
*/
policyVersion: number;
/**
* Main consent message shown in the banner.
*/
@@ -470,6 +1100,10 @@ export interface CookieSetting {
* Heading for the detailed settings panel.
*/
settingsTitle?: string | null;
/**
* Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.
*/
privacyLinkLabel?: string | null;
/**
* Button labels.
*/
@@ -491,6 +1125,64 @@ export interface CookieSetting {
id?: string | null;
}[]
| null;
/**
* Cookies the site uses — shown on the cookie policy page (<CookieTable>). Fill it from a scan: ipal-consent-check → cookie-scan.
*/
cookies?:
| {
name: string;
/**
* e.g. Google, this site
*/
provider?: string | null;
category: 'necessary' | 'functional' | 'analytics' | 'marketing';
purpose?: string | null;
/**
* e.g. "2 years", "session"
*/
duration?: string | null;
id?: string | null;
}[]
| null;
updatedAt?: string | null;
createdAt?: string | null;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "notifications".
*/
export interface Notification {
id: number;
/**
* Messages shown after a form is submitted. Leave a field empty to use the built-in default.
*/
form?: {
success?: string | null;
error?: string | null;
rateLimited?: string | null;
turnstile?: string | null;
/**
* Shown on a validation error. Use {field} to insert the offending field name.
*/
validation?: string | null;
/**
* Shown when the GDPR consent checkbox is left unchecked.
*/
consent?: string | null;
notFound?: string | null;
/**
* Step-by-step forms: button to the next step.
*/
next?: string | null;
/**
* Step-by-step forms: button to the previous step.
*/
back?: string | null;
/**
* Progress — {current} and {total} are replaced.
*/
stepOf?: string | null;
};
updatedAt?: string | null;
createdAt?: string | null;
}
@@ -500,8 +1192,17 @@ export interface CookieSetting {
*/
export interface SiteSettingsSelect<T extends boolean = true> {
siteName?: T;
siteDescription?: T;
titleOrder?: T;
titleSeparator?: T;
logo?: T;
defaultShareImage?: T;
sameAs?:
| T
| {
url?: T;
id?: T;
};
favicon?: T;
defaultTheme?: T;
allowThemeToggle?: T;
@@ -516,18 +1217,38 @@ export interface SiteSettingsSelect<T extends boolean = true> {
export interface SiteIntegrationsSelect<T extends boolean = true> {
ga4MeasurementId?: T;
gtmContainerId?: T;
metaPixelId?: T;
clarityProjectId?: T;
linkedInPartnerId?: T;
tiktokPixelId?: T;
turnstileSiteKey?: T;
turnstileSecretKey?: T;
turnstileStatus?:
| T
| {
state?: T;
code?: T;
message?: T;
since?: T;
checkedAt?: T;
};
emailTransport?: T;
smtpHost?: T;
smtpPort?: T;
smtpUser?: T;
smtpPassword?: T;
smtpFromAddress?: T;
smtpFromName?: T;
r2Bucket?: T;
r2Endpoint?: T;
r2AccessKeyId?: T;
r2SecretAccessKey?: T;
emailStatus?:
| T
| {
state?: T;
code?: T;
message?: T;
since?: T;
checkedAt?: T;
};
indexNowKey?: T;
updatedAt?: T;
createdAt?: T;
globalType?: T;
@@ -537,8 +1258,10 @@ export interface SiteIntegrationsSelect<T extends boolean = true> {
* via the `definition` "cookie-settings_select".
*/
export interface CookieSettingsSelect<T extends boolean = true> {
policyVersion?: T;
message?: T;
settingsTitle?: T;
privacyLinkLabel?: T;
buttons?:
| T
| {
@@ -556,6 +1279,39 @@ export interface CookieSettingsSelect<T extends boolean = true> {
description?: T;
id?: T;
};
cookies?:
| T
| {
name?: T;
provider?: T;
category?: T;
purpose?: T;
duration?: T;
id?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
}
/**
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "notifications_select".
*/
export interface NotificationsSelect<T extends boolean = true> {
form?:
| T
| {
success?: T;
error?: T;
rateLimited?: T;
turnstile?: T;
validation?: T;
consent?: T;
notFound?: T;
next?: T;
back?: T;
stepOf?: T;
};
updatedAt?: T;
createdAt?: T;
globalType?: T;
+59 -64
View File
@@ -1,13 +1,13 @@
import { sqliteAdapter } from '@payloadcms/db-sqlite'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { ipalKit } from 'ipal-kit'
import { MongoMemoryReplSet } from 'mongodb-memory-server'
import { ipalKit } from '../src/index.js'
import path from 'path'
import { buildConfig } from 'payload'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
import { testEmailAdapter } from './helpers/testEmailAdapter.js'
import { i18nConfig } from './i18n.config.js'
import { seed } from './seed.js'
const filename = fileURLToPath(import.meta.url)
@@ -17,70 +17,65 @@ if (!process.env.ROOT_DIR) {
process.env.ROOT_DIR = dirname
}
const buildConfigWithMemoryDB = async () => {
if (process.env.NODE_ENV === 'test') {
const memoryDB = await MongoMemoryReplSet.create({
replSet: {
count: 3,
dbName: 'payloadmemory',
},
})
process.env.DATABASE_URL = `${memoryDB.getUri()}&retryWrites=true`
}
return buildConfig({
admin: {
importMap: {
baseDir: path.resolve(dirname),
},
export default buildConfig({
admin: {
importMap: {
baseDir: path.resolve(dirname),
},
collections: [
{
slug: 'users',
auth: true,
fields: [],
},
{
slug: 'posts',
fields: [],
},
{
slug: 'media',
fields: [],
upload: { staticDir: path.resolve(dirname, 'media') },
},
],
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI || 'file:./payload.db',
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
onInit: async (payload) => {
await seed(payload)
},
collections: [
{
slug: 'users',
auth: true,
fields: [],
},
plugins: [
ipalKit({
access: { authCollection: 'users' },
i18n: {
defaultLocale: 'pl',
locales: [
{ code: 'pl', label: 'Polski' },
{ code: 'en', label: 'English' },
],
{
slug: 'pages',
fields: [
{ name: 'title', type: 'text', localized: true },
{ name: 'slug', type: 'text', index: true, localized: true },
{
name: 'layout',
type: 'blocks',
blocks: [{ slug: 'formBlock', fields: [{ name: 'form', type: 'relationship', relationTo: 'forms' }] }],
},
seo: { collections: ['posts', 'pages'] },
}),
],
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',
sharp,
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
],
},
})
}
{
slug: 'posts',
fields: [{ name: 'title', type: 'text' }],
},
{
slug: 'media',
fields: [],
upload: { staticDir: path.resolve(dirname, 'media') },
},
],
export default buildConfigWithMemoryDB()
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI || 'file:./payload.db',
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
onInit: async (payload) => {
await seed(payload)
},
plugins: [
ipalKit({
access: { authCollection: 'users' },
i18n: i18nConfig,
consentLog: true,
forms: {},
seo: { collections: ['posts', 'pages'] },
// 2FA is enforced by default; the dev sandbox opts out so it boots without an authenticator.
twoFactor: false,
}),
],
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',
sharp,
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
})
+46
View File
@@ -22,4 +22,50 @@ export const seed = async (payload: Payload) => {
},
})
}
await seedContactPage(payload)
}
const text = (t: string) => ({
root: {
children: [{ children: [{ detail: 0, format: 0, mode: 'normal', style: '', text: t, type: 'text', version: 1 }], direction: null, format: '', indent: 0, type: 'paragraph', version: 1 }],
direction: null,
format: '',
indent: 0,
type: 'root',
version: 1,
},
})
/** A step-by-step quote form on /pl/kontakt — exercises RenderForm, steps, choice lists, dates. */
async function seedContactPage(payload: Payload) {
const { totalDocs } = await payload.count({ collection: 'pages', where: { slug: { equals: 'kontakt' } } })
if (totalDocs) {return}
const form = await payload.create({
collection: 'forms',
data: {
confirmationMessage: text('Dziękujemy! Odezwiemy się w ciągu 24 godzin.'),
confirmationType: 'message',
fields: [
{ blockType: 'step', title: 'Kontakt' },
{ name: 'name', blockType: 'text', label: 'Imię i nazwisko', required: true, width: 50 },
{ name: 'email', blockType: 'email', label: 'E-mail', required: true, width: 50 },
{ blockType: 'step', description: 'Zaznacz, czego potrzebujesz.', title: 'Projekt' },
{ name: 'services', blockType: 'checkboxGroup', label: 'Usługi', options: [{ label: 'Strona WWW', value: 'www' }, { label: 'SEO', value: 'seo' }, { label: 'Kampanie', value: 'ads' }], required: true },
{ name: 'budget', blockType: 'radio', label: 'Budżet', options: [{ label: 'do 10 tys.', value: 's' }, { label: 'powyżej 10 tys.', value: 'l' }], required: true },
{ name: 'deadline', blockType: 'date', label: 'Termin' },
{ blockType: 'message', message: text('Dane przetwarzamy wyłącznie w celu przygotowania wyceny.') },
{ name: 'consent', blockType: 'checkbox', label: 'Zgadzam się na przetwarzanie danych.', required: true },
],
submitButtonLabel: 'Wyślij zapytanie',
title: 'Wycena',
} as never,
})
const page = await payload.create({
collection: 'pages',
data: { layout: [{ blockType: 'formBlock', form: form.id }], slug: 'kontakt', title: 'Kontakt' } as never,
})
await payload.updateGlobal({ slug: 'site-settings' as never, data: { siteName: 'Sandbox' } as never })
payload.logger.info(`[seed] /pl/kontakt (page ${page.id}, form ${form.id})`)
}
+9
View File
@@ -27,6 +27,15 @@
],
"ipal-kit/rsc": [
"../src/exports/rsc.ts"
],
"@intecion/ipal-kit": [
"../src/index.ts"
],
"@intecion/ipal-kit/next/middleware": [
"../src/exports/next-middleware.ts"
],
"@intecion/ipal-kit/*": [
"../src/exports/*.ts"
]
},
"noEmit": true,
-10
View File
@@ -1,10 +0,0 @@
/**
* Entry point: @intecion/ipal-kit/admin
*
* Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's
* importMap can resolve them by a stable path when ipalKit injects
* admin.components.graphics.Logo/Icon.
*/
export { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js';
export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js';
export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js';
-11
View File
@@ -1,11 +0,0 @@
/**
* Entry point: @intecion/ipal-kit/admin
*
* Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's
* importMap can resolve them by a stable path when ipalKit injects
* admin.components.graphics.Logo/Icon.
*/ export { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js';
export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js';
export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js';
//# sourceMappingURL=admin.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/admin.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/admin\n *\n * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's\n * importMap can resolve them by a stable path when ipalKit injects\n * admin.components.graphics.Logo/Icon.\n */\nexport { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js'\nexport { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'\nexport { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'\n"],"names":["AdminLogo","AdminIcon","IntecionCredit","RowLabel","IntegrationAlerts"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,+BAA8B;AACnF,SAASC,QAAQ,QAAQ,2CAA0C;AACnE,SAASC,iBAAiB,QAAQ,+CAA8C"}
-35
View File
@@ -1,35 +0,0 @@
/**
* Entry point: ipal-kit/client
*
* Client-side ('use client') exports — React hooks, providers, and UI
* components. Kept separate from the main entry so server bundles don't pull in
* client-only code.
*/
export { useConsent, ConsentProvider, useConsentContext, CookieBanner, CookieButton, ConsentScript, } from '../modules/consent/client.js';
export type { CookieBannerClassNames } from '../modules/consent/client.js';
export { Turnstile } from '../modules/turnstile/client.js';
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
export { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js';
export type { A11yState, A11yTexts, A11yClassNames } from '../modules/accessibility/client.js';
export { switchLocalePath, buildLocalizedPath, getLocalizedSlugs, getLocaleCodes, } from '../modules/i18n/index.js';
export type { LocalizedSlugs, I18nConfig } from '../modules/i18n/index.js';
export type { TurnstileProps } from '../modules/turnstile/client.js';
export { LocaleView } from '../modules/pages/LocaleView.js';
export { Analytics } from '../modules/analytics/client.js';
export type { AnalyticsProps } from '../modules/analytics/client.js';
export { pushDataLayer } from '../modules/analytics/client.js';
export { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js';
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js';
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
export { AlternateLinksProvider, useAlternateLinks, useSetAlternateLinks, AlternateLinksUpdater, LanguageSwitcher, } from '../modules/i18n/index.js';
export type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js';
export { useForm } from '../modules/forms/useForm.js';
export type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js';
export { useContactForm } from '../modules/forms/useContactForm.js';
export type { ContactFormValues, ContactFormErrors, SubmitAction } from '../modules/forms/useContactForm.js';
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from '../modules/forms/validators.js';
export type { Rule } from '../modules/forms/validators.js';
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js';
export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js';
export type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js';
-29
View File
@@ -1,29 +0,0 @@
'use client';
/**
* Entry point: ipal-kit/client
*
* Client-side ('use client') exports — React hooks, providers, and UI
* components. Kept separate from the main entry so server bundles don't pull in
* client-only code.
*/ export { useConsent, ConsentProvider, useConsentContext, CookieBanner, CookieButton, ConsentScript } from '../modules/consent/client.js';
export { Turnstile } from '../modules/turnstile/client.js';
export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js';
export { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js';
// Pure i18n path helpers — no server/RSC deps, safe to import in client
// components (e.g. a LanguageSwitcher that computes locale URLs on the client).
export { switchLocalePath, buildLocalizedPath, getLocalizedSlugs, getLocaleCodes } from '../modules/i18n/index.js';
export { LocaleView } from '../modules/pages/LocaleView.js';
export { Analytics } from '../modules/analytics/client.js';
export { pushDataLayer } from '../modules/analytics/client.js';
export { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js';
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js';
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
export { AlternateLinksProvider, useAlternateLinks, useSetAlternateLinks, AlternateLinksUpdater, LanguageSwitcher } from '../modules/i18n/index.js';
export { useForm } from '../modules/forms/useForm.js';
export { useContactForm } from '../modules/forms/useContactForm.js';
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from '../modules/forms/validators.js';
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js';
export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js';
//# sourceMappingURL=client.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n useConsent,\n ConsentProvider,\n useConsentContext,\n CookieBanner,\n CookieButton,\n ConsentScript,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js'\nexport type { A11yState, A11yTexts, A11yClassNames } from '../modules/accessibility/client.js'\n\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n switchLocalePath,\n buildLocalizedPath,\n getLocalizedSlugs,\n getLocaleCodes,\n} from '../modules/i18n/index.js'\nexport type { LocalizedSlugs, I18nConfig } from '../modules/i18n/index.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\nexport { LocaleView } from '../modules/pages/LocaleView.js'\nexport { Analytics } from '../modules/analytics/client.js'\nexport type { AnalyticsProps } from '../modules/analytics/client.js'\nexport { pushDataLayer } from '../modules/analytics/client.js'\nexport { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport {\n AlternateLinksProvider,\n useAlternateLinks,\n useSetAlternateLinks,\n AlternateLinksUpdater,\n LanguageSwitcher,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type { ContactFormValues, ContactFormErrors, SubmitAction } from '../modules/forms/useContactForm.js'\nexport {\n buildValidator,\n isEmail,\n required,\n email,\n minLength,\n maxLength,\n checked,\n pattern,\n custom,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'\nexport type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'\n"],"names":["useConsent","ConsentProvider","useConsentContext","CookieBanner","CookieButton","ConsentScript","Turnstile","TurnstileProvider","useTurnstile","AccessibilityProvider","useAccessibility","AccessibilityWidget","switchLocalePath","buildLocalizedPath","getLocalizedSlugs","getLocaleCodes","LocaleView","Analytics","pushDataLayer","loadMetaPixel","loadClarity","loadLinkedIn","loadTikTok","MaskedField","IntegrationStatusBanner","TestEmailButton","AlternateLinksProvider","useAlternateLinks","useSetAlternateLinks","AlternateLinksUpdater","LanguageSwitcher","useForm","useContactForm","buildValidator","isEmail","required","email","minLength","maxLength","checked","pattern","custom","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","formAnalyticsOnSuccess"],"mappings":"AAAA;AACA;;;;;;CAMC,GACD,SACEA,UAAU,EACVC,eAAe,EACfC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,aAAa,QACR,+BAA8B;AAErC,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC;AAChF,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,qCAAoC;AAGjH,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,gBAAgB,EAChBC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,QACT,2BAA0B;AAGjC,SAASC,UAAU,QAAQ,iCAAgC;AAC3D,SAASC,SAAS,QAAQ,iCAAgC;AAE1D,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,aAAa,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iCAAgC;AACrG,SAASC,WAAW,QAAQ,wDAAuD;AACnF,SAASC,uBAAuB,QAAQ,qDAAoD;AAC5F,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SACEC,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,2BAA0B;AAEjC,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SAASC,cAAc,QAAQ,qCAAoC;AAEnE,SACEC,cAAc,EACdC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,MAAM,QACD,iCAAgC;AAEvC,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,sBAAsB,QAAQ,oCAAmC"}
-17
View File
@@ -1,17 +0,0 @@
/**
* Entry point: @intecion/ipal-kit/env
*
* Environment validation ONLY — zero imports beyond this module, no Payload,
* no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next
* also compiles for the Edge runtime: importing the package root there drags in
* Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile
* doesn't exist in target module").
*
* // src/instrumentation.ts
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
* export function register() {
* if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))
* }
*/
export { assertEnv, ipalEnvRules } from '../modules/env/index.js';
export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js';
-17
View File
@@ -1,17 +0,0 @@
/**
* Entry point: @intecion/ipal-kit/env
*
* Environment validation ONLY — zero imports beyond this module, no Payload,
* no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next
* also compiles for the Edge runtime: importing the package root there drags in
* Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile
* doesn't exist in target module").
*
* // src/instrumentation.ts
* import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'
* export function register() {
* if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))
* }
*/ export { assertEnv, ipalEnvRules } from '../modules/env/index.js';
//# sourceMappingURL=env.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/env.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/env\n *\n * Environment validation ONLY — zero imports beyond this module, no Payload,\n * no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next\n * also compiles for the Edge runtime: importing the package root there drags in\n * Payload / file-type / fs and crashes Turbopack (\"Export fileTypeFromFile\n * doesn't exist in target module\").\n *\n * // src/instrumentation.ts\n * import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'\n * export function register() {\n * if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))\n * }\n */\nexport { assertEnv, ipalEnvRules } from '../modules/env/index.js'\nexport type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js'\n"],"names":["assertEnv","ipalEnvRules"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GACD,SAASA,SAAS,EAAEC,YAAY,QAAQ,0BAAyB"}
-10
View File
@@ -1,10 +0,0 @@
/**
* Entry point: ipal-kit/next/middleware
*
* Re-exports the locale middleware factory and default matcher for use in a
* client project's middleware.ts. Kept as a thin re-export so the Next-facing
* surface is separate from the main package export.
*/
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js';
export type { LocaleMiddlewareResult } from '../modules/i18n/index.js';
export { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js';
-10
View File
@@ -1,10 +0,0 @@
/**
* Entry point: ipal-kit/next/middleware
*
* Re-exports the locale middleware factory and default matcher for use in a
* client project's middleware.ts. Kept as a thin re-export so the Next-facing
* surface is separate from the main package export.
*/ export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js';
export { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js';
//# sourceMappingURL=next-middleware.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/next-middleware.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/next/middleware\n *\n * Re-exports the locale middleware factory and default matcher for use in a\n * client project's middleware.ts. Kept as a thin re-export so the Next-facing\n * surface is separate from the main package export.\n */\nexport { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js'\nexport type { LocaleMiddlewareResult } from '../modules/i18n/index.js'\nexport { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js'\n"],"names":["createLocaleMiddleware","DEFAULT_MIDDLEWARE_MATCHER","createProxy","DEFAULT_PROXY_MATCHER"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,sBAAsB,EAAEC,0BAA0B,QAAQ,2BAA0B;AAE7F,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,2BAA0B"}
-13
View File
@@ -1,13 +0,0 @@
/**
* Entry point: ipal-kit/rsc
*
* Server-component exports. RenderBlocks is a React Server Component, so it
* lives here rather than in the main package entry to keep React out of the
* server-config bundle.
*/
export { RenderBlocks } from '../modules/blocks/index.js';
export type { BlockComponentMap, BlockData, EnhanceProps, RenderBlocksProps, } from '../modules/blocks/index.js';
export { RenderRichText } from '../modules/richtext/index.js';
export type { RenderRichTextProps } from '../modules/richtext/index.js';
export { JsonLdGraph } from '../modules/seo/index.js';
export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js';
-12
View File
@@ -1,12 +0,0 @@
/**
* Entry point: ipal-kit/rsc
*
* Server-component exports. RenderBlocks is a React Server Component, so it
* lives here rather than in the main package entry to keep React out of the
* server-config bundle.
*/ export { RenderBlocks } from '../modules/blocks/index.js';
export { RenderRichText } from '../modules/richtext/index.js';
export { JsonLdGraph } from '../modules/seo/index.js';
export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js';
//# sourceMappingURL=rsc.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/rsc.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/rsc\n *\n * Server-component exports. RenderBlocks is a React Server Component, so it\n * lives here rather than in the main package entry to keep React out of the\n * server-config bundle.\n */\nexport { RenderBlocks } from '../modules/blocks/index.js'\nexport type {\n BlockComponentMap,\n BlockData,\n EnhanceProps,\n RenderBlocksProps,\n} from '../modules/blocks/index.js'\nexport { RenderRichText } from '../modules/richtext/index.js'\nexport type { RenderRichTextProps } from '../modules/richtext/index.js'\nexport { JsonLdGraph } from '../modules/seo/index.js'\nexport { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'\n"],"names":["RenderBlocks","RenderRichText","JsonLdGraph","MediaPreconnect"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA4B;AAOzD,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASC,WAAW,QAAQ,0BAAyB;AACrD,SAASC,eAAe,QAAQ,wCAAuC"}
-18
View File
@@ -1,18 +0,0 @@
/**
* Entry point: ipal-kit/server
*
* Server-only runtime functions — these import 'server-only' (Turnstile secret,
* SMTP password, nodemailer). Kept OUT of the main entry so that loading the
* Payload config or running `payload generate:importmap` (both Node scripts,
* no bundler) never pulls in 'server-only', which throws outside a bundled
* server context.
*
* Import these only from Server Actions, route handlers, or server components —
* never from the Payload config or client code.
*/
export { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js';
export type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js';
export { sendEmail } from '../modules/email/index.js';
export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js';
export { submitForm } from '../modules/forms/index.js';
export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js';
-16
View File
@@ -1,16 +0,0 @@
/**
* Entry point: ipal-kit/server
*
* Server-only runtime functions — these import 'server-only' (Turnstile secret,
* SMTP password, nodemailer). Kept OUT of the main entry so that loading the
* Payload config or running `payload generate:importmap` (both Node scripts,
* no bundler) never pulls in 'server-only', which throws outside a bundled
* server context.
*
* Import these only from Server Actions, route handlers, or server components —
* never from the Payload config or client code.
*/ export { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js';
export { sendEmail } from '../modules/email/index.js';
export { submitForm } from '../modules/forms/index.js';
//# sourceMappingURL=server.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/server\n *\n * Server-only runtime functions — these import 'server-only' (Turnstile secret,\n * SMTP password, nodemailer). Kept OUT of the main entry so that loading the\n * Payload config or running `payload generate:importmap` (both Node scripts,\n * no bundler) never pulls in 'server-only', which throws outside a bundled\n * server context.\n *\n * Import these only from Server Actions, route handlers, or server components —\n * never from the Payload config or client code.\n */\nexport { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js'\nexport type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js'\nexport { sendEmail } from '../modules/email/index.js'\nexport type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'\nexport { submitForm } from '../modules/forms/index.js'\nexport type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'\n"],"names":["verifyTurnstile","checkTurnstile","sendEmail","submitForm"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,SAASA,eAAe,EAAEC,cAAc,QAAQ,gCAA+B;AAE/E,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,UAAU,QAAQ,4BAA2B"}
-8
View File
@@ -1,8 +0,0 @@
import type { Field } from 'payload';
/**
* Fields for the CookieSettings global — GDPR consent banner copy, editable
* per locale. The privacy-policy link TARGET is NOT stored here: it comes from
* the pages module (system page role 'privacyPolicy'), keeping one source of
* truth. Only the link's visible text lives here (privacyLinkLabel).
*/
export declare const cookieSettingsFields: Field[];
-96
View File
@@ -1,96 +0,0 @@
import { CONSENT_CATEGORIES } from '../../modules/consent/categories.js';
/**
* Fields for the CookieSettings global — GDPR consent banner copy, editable
* per locale. The privacy-policy link TARGET is NOT stored here: it comes from
* the pages module (system page role 'privacyPolicy'), keeping one source of
* truth. Only the link's visible text lives here (privacyLinkLabel).
*/ export const cookieSettingsFields = [
{
name: 'message',
type: 'textarea',
admin: {
description: 'Main consent message shown in the banner.'
},
localized: true
},
{
name: 'settingsTitle',
type: 'text',
admin: {
description: 'Heading for the detailed settings panel.'
},
localized: true
},
{
name: 'privacyLinkLabel',
type: 'text',
admin: {
description: 'Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.'
},
localized: true
},
{
name: 'buttons',
type: 'group',
admin: {
description: 'Button labels.'
},
fields: [
{
name: 'acceptAll',
type: 'text',
localized: true
},
{
name: 'reject',
type: 'text',
localized: true
},
{
name: 'settings',
type: 'text',
localized: true
},
{
name: 'save',
type: 'text',
localized: true
},
{
name: 'back',
type: 'text',
localized: true
}
]
},
{
name: 'categories',
type: 'array',
admin: {
description: 'Per-category titles and descriptions.'
},
fields: [
{
name: 'key',
type: 'select',
options: CONSENT_CATEGORIES.map((c)=>({
label: c,
value: c
})),
required: true
},
{
name: 'title',
type: 'text',
localized: true
},
{
name: 'description',
type: 'textarea',
localized: true
}
]
}
];
//# sourceMappingURL=fields.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/CookieSettings/fields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { CONSENT_CATEGORIES } from '../../modules/consent/categories.js'\n\n/**\n * Fields for the CookieSettings global — GDPR consent banner copy, editable\n * per locale. The privacy-policy link TARGET is NOT stored here: it comes from\n * the pages module (system page role 'privacyPolicy'), keeping one source of\n * truth. Only the link's visible text lives here (privacyLinkLabel).\n */\nexport const cookieSettingsFields: Field[] = [\n {\n name: 'message',\n type: 'textarea',\n admin: {\n description: 'Main consent message shown in the banner.',\n },\n localized: true,\n },\n {\n name: 'settingsTitle',\n type: 'text',\n admin: {\n description: 'Heading for the detailed settings panel.',\n },\n localized: true,\n },\n {\n name: 'privacyLinkLabel',\n type: 'text',\n admin: {\n description:\n 'Text of the privacy-policy link in the banner, e.g. \"Privacy policy\". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.',\n },\n localized: true,\n },\n {\n name: 'buttons',\n type: 'group',\n admin: {\n description: 'Button labels.',\n },\n fields: [\n { name: 'acceptAll', type: 'text', localized: true },\n { name: 'reject', type: 'text', localized: true },\n { name: 'settings', type: 'text', localized: true },\n { name: 'save', type: 'text', localized: true },\n { name: 'back', type: 'text', localized: true },\n ],\n },\n {\n name: 'categories',\n type: 'array',\n admin: {\n description: 'Per-category titles and descriptions.',\n },\n fields: [\n {\n name: 'key',\n type: 'select',\n options: CONSENT_CATEGORIES.map((c) => ({ label: c, value: c })),\n required: true,\n },\n { name: 'title', type: 'text', localized: true },\n { name: 'description', type: 'textarea', localized: true },\n ],\n },\n]\n"],"names":["CONSENT_CATEGORIES","cookieSettingsFields","name","type","admin","description","localized","fields","options","map","c","label","value","required"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,sCAAqC;AAExE;;;;;CAKC,GACD,OAAO,MAAMC,uBAAgC;IAC3C;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAE,QAAQ;YACN;gBAAEL,MAAM;gBAAaC,MAAM;gBAAQG,WAAW;YAAK;YACnD;gBAAEJ,MAAM;gBAAUC,MAAM;gBAAQG,WAAW;YAAK;YAChD;gBAAEJ,MAAM;gBAAYC,MAAM;gBAAQG,WAAW;YAAK;YAClD;gBAAEJ,MAAM;gBAAQC,MAAM;gBAAQG,WAAW;YAAK;YAC9C;gBAAEJ,MAAM;gBAAQC,MAAM;gBAAQG,WAAW;YAAK;SAC/C;IACH;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAE,QAAQ;YACN;gBACEL,MAAM;gBACNC,MAAM;gBACNK,SAASR,mBAAmBS,GAAG,CAAC,CAACC,IAAO,CAAA;wBAAEC,OAAOD;wBAAGE,OAAOF;oBAAE,CAAA;gBAC7DG,UAAU;YACZ;YACA;gBAAEX,MAAM;gBAASC,MAAM;gBAAQG,WAAW;YAAK;YAC/C;gBAAEJ,MAAM;gBAAeC,MAAM;gBAAYG,WAAW;YAAK;SAC1D;IACH;CACD,CAAA"}
-6
View File
@@ -1,6 +0,0 @@
import type { GlobalConfig } from 'payload';
/**
* Builds the CookieSettings global — consent banner copy managed by editors.
* Public read (the banner needs it on the frontend for anonymous visitors).
*/
export declare function buildCookieSettings(): GlobalConfig;
-19
View File
@@ -1,19 +0,0 @@
import { cookieSettingsFields } from './fields.js';
/**
* Builds the CookieSettings global — consent banner copy managed by editors.
* Public read (the banner needs it on the frontend for anonymous visitors).
*/ export function buildCookieSettings() {
return {
slug: 'cookie-settings',
access: {
read: ()=>true
},
admin: {
group: 'Settings'
},
fields: cookieSettingsFields,
label: 'Cookie Settings'
};
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/CookieSettings/index.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload'\n\nimport { cookieSettingsFields } from './fields.js'\n\n/**\n * Builds the CookieSettings global — consent banner copy managed by editors.\n * Public read (the banner needs it on the frontend for anonymous visitors).\n */\nexport function buildCookieSettings(): GlobalConfig {\n return {\n slug: 'cookie-settings',\n access: {\n read: () => true,\n },\n admin: {\n group: 'Settings',\n },\n fields: cookieSettingsFields,\n label: 'Cookie Settings',\n }\n}\n"],"names":["cookieSettingsFields","buildCookieSettings","slug","access","read","admin","group","fields","label"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,cAAa;AAElD;;;CAGC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQP;QACRQ,OAAO;IACT;AACF"}
-13
View File
@@ -1,13 +0,0 @@
import type { Field } from 'payload';
/**
* Fields for the Notifications global — localized user-facing texts for action
* results (form submission outcomes, and future contexts). Every text is
* localized: true so each language has its own value. Empty fields fall back to
* built-in English defaults (see modules/notifications/defaults).
*
* Grouped per context. `form` holds the outcomes of submitForm; more groups
* (e.g. `newsletter`, `system`) can be added the same way without touching
* consumers — getNotificationTexts resolves whatever exists, falling back
* per field.
*/
export declare const notificationsFields: Field[];
-82
View File
@@ -1,82 +0,0 @@
/**
* Fields for the Notifications global — localized user-facing texts for action
* results (form submission outcomes, and future contexts). Every text is
* localized: true so each language has its own value. Empty fields fall back to
* built-in English defaults (see modules/notifications/defaults).
*
* Grouped per context. `form` holds the outcomes of submitForm; more groups
* (e.g. `newsletter`, `system`) can be added the same way without touching
* consumers — getNotificationTexts resolves whatever exists, falling back
* per field.
*/ export const notificationsFields = [
{
name: 'form',
type: 'group',
admin: {
description: 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.'
},
fields: [
{
name: 'success',
type: 'text',
admin: {
placeholder: 'Thank you — your message has been sent.'
},
localized: true
},
{
name: 'error',
type: 'text',
admin: {
placeholder: 'Something went wrong. Please try again later.'
},
localized: true
},
{
name: 'rateLimited',
type: 'text',
admin: {
placeholder: 'Too many attempts. Please wait a moment and try again.'
},
localized: true
},
{
name: 'turnstile',
type: 'text',
admin: {
placeholder: 'Captcha verification failed. Please try again.'
},
localized: true
},
{
name: 'validation',
type: 'text',
admin: {
description: 'Shown on a validation error. Use {field} to insert the offending field name.',
placeholder: 'Please check the {field} field and try again.'
},
localized: true
},
{
name: 'consent',
type: 'text',
admin: {
description: 'Shown when the GDPR consent checkbox is left unchecked.',
placeholder: 'Please accept the privacy policy to continue.'
},
localized: true
},
{
name: 'notFound',
type: 'text',
admin: {
placeholder: 'This form is no longer available.'
},
localized: true
}
],
label: 'Form messages'
}
];
//# sourceMappingURL=fields.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/Notifications/fields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Fields for the Notifications global — localized user-facing texts for action\n * results (form submission outcomes, and future contexts). Every text is\n * localized: true so each language has its own value. Empty fields fall back to\n * built-in English defaults (see modules/notifications/defaults).\n *\n * Grouped per context. `form` holds the outcomes of submitForm; more groups\n * (e.g. `newsletter`, `system`) can be added the same way without touching\n * consumers — getNotificationTexts resolves whatever exists, falling back\n * per field.\n */\nexport const notificationsFields: Field[] = [\n {\n name: 'form',\n type: 'group',\n admin: {\n description:\n 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.',\n },\n fields: [\n {\n name: 'success',\n type: 'text',\n admin: { placeholder: 'Thank you — your message has been sent.' },\n localized: true,\n },\n {\n name: 'error',\n type: 'text',\n admin: { placeholder: 'Something went wrong. Please try again later.' },\n localized: true,\n },\n {\n name: 'rateLimited',\n type: 'text',\n admin: { placeholder: 'Too many attempts. Please wait a moment and try again.' },\n localized: true,\n },\n {\n name: 'turnstile',\n type: 'text',\n admin: { placeholder: 'Captcha verification failed. Please try again.' },\n localized: true,\n },\n {\n name: 'validation',\n type: 'text',\n admin: {\n description:\n 'Shown on a validation error. Use {field} to insert the offending field name.',\n placeholder: 'Please check the {field} field and try again.',\n },\n localized: true,\n },\n {\n name: 'consent',\n type: 'text',\n admin: {\n description: 'Shown when the GDPR consent checkbox is left unchecked.',\n placeholder: 'Please accept the privacy policy to continue.',\n },\n localized: true,\n },\n {\n name: 'notFound',\n type: 'text',\n admin: { placeholder: 'This form is no longer available.' },\n localized: true,\n },\n ],\n label: 'Form messages',\n },\n]\n"],"names":["notificationsFields","name","type","admin","description","fields","placeholder","localized","label"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,MAAMA,sBAA+B;IAC1C;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,QAAQ;YACN;gBACEJ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAA0C;gBAChEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAgD;gBACtEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAyD;gBAC/EC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAiD;gBACvEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aACE;oBACFE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aAAa;oBACbE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAoC;gBAC1DC,WAAW;YACb;SACD;QACDC,OAAO;IACT;CACD,CAAA"}
-7
View File
@@ -1,7 +0,0 @@
import type { GlobalConfig } from 'payload';
/**
* Builds the Notifications global — localized action-result texts. Readable by
* any authenticated panel user; server-side helpers read it with overrideAccess
* so the frontend can resolve texts without a session.
*/
export declare function buildNotifications(): GlobalConfig;
-20
View File
@@ -1,20 +0,0 @@
import { notificationsFields } from './fields.js';
/**
* Builds the Notifications global — localized action-result texts. Readable by
* any authenticated panel user; server-side helpers read it with overrideAccess
* so the frontend can resolve texts without a session.
*/ export function buildNotifications() {
return {
slug: 'notifications',
label: 'Notifications',
admin: {
group: 'Settings'
},
access: {
read: ()=>true
},
fields: notificationsFields
};
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/Notifications/index.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload'\nimport { notificationsFields } from './fields.js'\n\n/**\n * Builds the Notifications global — localized action-result texts. Readable by\n * any authenticated panel user; server-side helpers read it with overrideAccess\n * so the frontend can resolve texts without a session.\n */\nexport function buildNotifications(): GlobalConfig {\n return {\n slug: 'notifications',\n label: 'Notifications',\n admin: { group: 'Settings' },\n access: {\n read: () => true, // texts are public-facing (shown to end users)\n },\n fields: notificationsFields,\n }\n}\n"],"names":["notificationsFields","buildNotifications","slug","label","admin","group","access","read","fields"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAa;AAEjD;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,OAAO;QACPC,OAAO;YAAEC,OAAO;QAAW;QAC3BC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,QAAQR;IACV;AACF"}
@@ -1,20 +0,0 @@
import type { TextFieldClientComponent } from 'payload';
/**
* Masked text input for sensitive values (SMTP password, R2 secret key,
* Turnstile secret key, etc.).
*
* Renders the value as a password field (••••) so secrets aren't shown in
* plaintext on screen — protecting against shoulder-surfing and accidental
* exposure when the panel is open. The value is still stored and returned
* normally (UI masking, NOT hashing or encryption), because the plugin must
* read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the
* value when an authorised editor genuinely needs to check it.
*
* Uses a raw <input> driven by useField rather than @payloadcms/ui's TextInput,
* because TextInput doesn't expose inputProps, so there's no way to switch its
* inner input to type="password".
*
* Assigned via a field's admin.components.Field. Works on any `text` field.
*/
export declare const MaskedField: TextFieldClientComponent;
export default MaskedField;
-80
View File
@@ -1,80 +0,0 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useField, FieldLabel, FieldDescription } from '@payloadcms/ui';
import { useState } from 'react';
/**
* Masked text input for sensitive values (SMTP password, R2 secret key,
* Turnstile secret key, etc.).
*
* Renders the value as a password field (••••) so secrets aren't shown in
* plaintext on screen — protecting against shoulder-surfing and accidental
* exposure when the panel is open. The value is still stored and returned
* normally (UI masking, NOT hashing or encryption), because the plugin must
* read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the
* value when an authorised editor genuinely needs to check it.
*
* Uses a raw <input> driven by useField rather than @payloadcms/ui's TextInput,
* because TextInput doesn't expose inputProps, so there's no way to switch its
* inner input to type="password".
*
* Assigned via a field's admin.components.Field. Works on any `text` field.
*/ export const MaskedField = ({ field, path })=>{
const { value, setValue } = useField({
path
});
const [revealed, setRevealed] = useState(false);
const label = typeof field?.label === 'string' ? field.label : field?.name ?? path;
const description = field?.admin?.description;
return /*#__PURE__*/ _jsxs("div", {
className: "field-type text masked-field",
children: [
/*#__PURE__*/ _jsx(FieldLabel, {
label: label,
htmlFor: `field-${path}`
}),
/*#__PURE__*/ _jsxs("div", {
className: "field-type__wrap",
style: {
display: 'flex',
gap: '.5rem',
alignItems: 'center'
},
children: [
/*#__PURE__*/ _jsx("input", {
id: `field-${path}`,
type: revealed ? 'text' : 'password',
autoComplete: "off",
className: "field-type__input",
value: value ?? '',
onChange: (e)=>setValue(e.target.value),
style: {
flex: 1
}
}),
/*#__PURE__*/ _jsx("button", {
type: "button",
onClick: ()=>setRevealed((r)=>!r),
style: {
background: 'none',
border: 'none',
padding: '.25rem .5rem',
cursor: 'pointer',
font: 'inherit',
textDecoration: 'underline',
opacity: 0.75,
whiteSpace: 'nowrap'
},
children: revealed ? 'Hide' : 'Reveal'
})
]
}),
description && typeof description === 'string' ? /*#__PURE__*/ _jsx(FieldDescription, {
path: path,
description: description
}) : null
]
});
};
export default MaskedField;
//# sourceMappingURL=MaskedField.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/MaskedField.tsx"],"sourcesContent":["'use client'\n\nimport { useField, FieldLabel, FieldDescription } from '@payloadcms/ui'\nimport { useState } from 'react'\nimport type { TextFieldClientComponent } from 'payload'\n\n/**\n * Masked text input for sensitive values (SMTP password, R2 secret key,\n * Turnstile secret key, etc.).\n *\n * Renders the value as a password field (••••) so secrets aren't shown in\n * plaintext on screen — protecting against shoulder-surfing and accidental\n * exposure when the panel is open. The value is still stored and returned\n * normally (UI masking, NOT hashing or encryption), because the plugin must\n * read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the\n * value when an authorised editor genuinely needs to check it.\n *\n * Uses a raw <input> driven by useField rather than @payloadcms/ui's TextInput,\n * because TextInput doesn't expose inputProps, so there's no way to switch its\n * inner input to type=\"password\".\n *\n * Assigned via a field's admin.components.Field. Works on any `text` field.\n */\nexport const MaskedField: TextFieldClientComponent = ({ field, path }) => {\n const { value, setValue } = useField<string>({ path })\n const [revealed, setRevealed] = useState(false)\n\n const label =\n typeof field?.label === 'string' ? field.label : (field?.name ?? path)\n const description = field?.admin?.description\n\n return (\n <div className=\"field-type text masked-field\">\n <FieldLabel label={label} htmlFor={`field-${path}`} />\n\n <div className=\"field-type__wrap\" style={{ display: 'flex', gap: '.5rem', alignItems: 'center' }}>\n <input\n id={`field-${path}`}\n type={revealed ? 'text' : 'password'}\n autoComplete=\"off\"\n className=\"field-type__input\"\n value={value ?? ''}\n onChange={(e) => setValue(e.target.value)}\n style={{ flex: 1 }}\n />\n <button\n type=\"button\"\n onClick={() => setRevealed((r) => !r)}\n style={{\n background: 'none',\n border: 'none',\n padding: '.25rem .5rem',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'underline',\n opacity: 0.75,\n whiteSpace: 'nowrap',\n }}\n >\n {revealed ? 'Hide' : 'Reveal'}\n </button>\n </div>\n\n {description && typeof description === 'string' ? (\n <FieldDescription path={path} description={description} />\n ) : null}\n </div>\n )\n}\n\nexport default MaskedField\n"],"names":["useField","FieldLabel","FieldDescription","useState","MaskedField","field","path","value","setValue","revealed","setRevealed","label","name","description","admin","div","className","htmlFor","style","display","gap","alignItems","input","id","type","autoComplete","onChange","e","target","flex","button","onClick","r","background","border","padding","cursor","font","textDecoration","opacity","whiteSpace"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,iBAAgB;AACvE,SAASC,QAAQ,QAAQ,QAAO;AAGhC;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMC,cAAwC,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE;IACnE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGR,SAAiB;QAAEM;IAAK;IACpD,MAAM,CAACG,UAAUC,YAAY,GAAGP,SAAS;IAEzC,MAAMQ,QACJ,OAAON,OAAOM,UAAU,WAAWN,MAAMM,KAAK,GAAIN,OAAOO,QAAQN;IACnE,MAAMO,cAAcR,OAAOS,OAAOD;IAElC,qBACE,MAACE;QAAIC,WAAU;;0BACb,KAACf;gBAAWU,OAAOA;gBAAOM,SAAS,CAAC,MAAM,EAAEX,MAAM;;0BAElD,MAACS;gBAAIC,WAAU;gBAAmBE,OAAO;oBAAEC,SAAS;oBAAQC,KAAK;oBAASC,YAAY;gBAAS;;kCAC7F,KAACC;wBACCC,IAAI,CAAC,MAAM,EAAEjB,MAAM;wBACnBkB,MAAMf,WAAW,SAAS;wBAC1BgB,cAAa;wBACbT,WAAU;wBACVT,OAAOA,SAAS;wBAChBmB,UAAU,CAACC,IAAMnB,SAASmB,EAAEC,MAAM,CAACrB,KAAK;wBACxCW,OAAO;4BAAEW,MAAM;wBAAE;;kCAEnB,KAACC;wBACCN,MAAK;wBACLO,SAAS,IAAMrB,YAAY,CAACsB,IAAM,CAACA;wBACnCd,OAAO;4BACLe,YAAY;4BACZC,QAAQ;4BACRC,SAAS;4BACTC,QAAQ;4BACRC,MAAM;4BACNC,gBAAgB;4BAChBC,SAAS;4BACTC,YAAY;wBACd;kCAEC/B,WAAW,SAAS;;;;YAIxBI,eAAe,OAAOA,gBAAgB,yBACrC,KAACX;gBAAiBI,MAAMA;gBAAMO,aAAaA;iBACzC;;;AAGV,EAAC;AAED,eAAeT,YAAW"}
@@ -1,11 +0,0 @@
/**
* Admin UI: a small "send test email" tool for the SiteIntegrations email tab.
* Enter an address, click Send, and it POSTs to /api/ipal/test-email, which
* sends through the currently-selected transport (SMTP or Graph). Shows the
* result inline so you can confirm delivery — or read the exact error — without
* leaving the panel.
*
* Assigned via a `ui` field's admin.components.Field.
*/
export declare const TestEmailButton: () => import("react/jsx-runtime").JSX.Element;
export default TestEmailButton;
@@ -1,131 +0,0 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
/**
* Admin UI: a small "send test email" tool for the SiteIntegrations email tab.
* Enter an address, click Send, and it POSTs to /api/ipal/test-email, which
* sends through the currently-selected transport (SMTP or Graph). Shows the
* result inline so you can confirm delivery — or read the exact error — without
* leaving the panel.
*
* Assigned via a `ui` field's admin.components.Field.
*/ export const TestEmailButton = ()=>{
const [to, setTo] = useState('');
const [status, setStatus] = useState({
kind: 'idle'
});
const send = async ()=>{
if (!to.trim()) {
setStatus({
kind: 'error',
msg: 'Enter a recipient address.'
});
return;
}
setStatus({
kind: 'sending'
});
try {
const res = await fetch('/api/ipal/test-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
credentials: 'include',
body: JSON.stringify({
to: to.trim()
})
});
const data = await res.json();
if (data.ok) {
setStatus({
kind: 'ok',
msg: data.message ?? 'Test email sent.'
});
} else {
setStatus({
kind: 'error',
msg: data.error ?? 'Send failed.'
});
}
} catch {
setStatus({
kind: 'error',
msg: 'Request failed. Is the server running?'
});
}
};
return /*#__PURE__*/ _jsxs("div", {
className: "field-type",
style: {
marginTop: '1rem'
},
children: [
/*#__PURE__*/ _jsx("label", {
className: "field-label",
children: "Send a test email"
}),
/*#__PURE__*/ _jsx("p", {
style: {
opacity: 0.7,
fontSize: '.85rem',
marginTop: 0
},
children: "Sends through the transport selected above. Save your changes first."
}),
/*#__PURE__*/ _jsxs("div", {
style: {
display: 'flex',
gap: '.5rem',
alignItems: 'center',
flexWrap: 'wrap'
},
children: [
/*#__PURE__*/ _jsx("input", {
type: "email",
placeholder: "[email protected]",
value: to,
onChange: (e)=>setTo(e.target.value),
style: {
flex: 1,
minWidth: '220px'
}
}),
/*#__PURE__*/ _jsx("button", {
type: "button",
onClick: send,
disabled: status.kind === 'sending',
className: "btn btn--style-secondary",
style: {
whiteSpace: 'nowrap'
},
children: status.kind === 'sending' ? 'Sending…' : 'Send test'
})
]
}),
status.kind === 'ok' && /*#__PURE__*/ _jsxs("p", {
style: {
color: 'var(--theme-success-500, green)',
marginTop: '.5rem'
},
children: [
"✓ ",
status.msg
]
}),
status.kind === 'error' && /*#__PURE__*/ _jsxs("p", {
style: {
color: 'var(--theme-error-500, crimson)',
marginTop: '.5rem'
},
children: [
"✗ ",
status.msg
]
})
]
});
};
export default TestEmailButton;
//# sourceMappingURL=TestEmailButton.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/TestEmailButton.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\n/**\n * Admin UI: a small \"send test email\" tool for the SiteIntegrations email tab.\n * Enter an address, click Send, and it POSTs to /api/ipal/test-email, which\n * sends through the currently-selected transport (SMTP or Graph). Shows the\n * result inline so you can confirm delivery — or read the exact error — without\n * leaving the panel.\n *\n * Assigned via a `ui` field's admin.components.Field.\n */\nexport const TestEmailButton = () => {\n const [to, setTo] = useState('')\n const [status, setStatus] = useState<\n { kind: 'idle' } | { kind: 'sending' } | { kind: 'ok'; msg: string } | { kind: 'error'; msg: string }\n >({ kind: 'idle' })\n\n const send = async () => {\n if (!to.trim()) {\n setStatus({ kind: 'error', msg: 'Enter a recipient address.' })\n return\n }\n setStatus({ kind: 'sending' })\n try {\n const res = await fetch('/api/ipal/test-email', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'include',\n body: JSON.stringify({ to: to.trim() }),\n })\n const data = await res.json()\n if (data.ok) {\n setStatus({ kind: 'ok', msg: data.message ?? 'Test email sent.' })\n } else {\n setStatus({ kind: 'error', msg: data.error ?? 'Send failed.' })\n }\n } catch {\n setStatus({ kind: 'error', msg: 'Request failed. Is the server running?' })\n }\n }\n\n return (\n <div className=\"field-type\" style={{ marginTop: '1rem' }}>\n <label className=\"field-label\">Send a test email</label>\n <p style={{ opacity: 0.7, fontSize: '.85rem', marginTop: 0 }}>\n Sends through the transport selected above. Save your changes first.\n </p>\n <div style={{ display: 'flex', gap: '.5rem', alignItems: 'center', flexWrap: 'wrap' }}>\n <input\n type=\"email\"\n placeholder=\"[email protected]\"\n value={to}\n onChange={(e) => setTo(e.target.value)}\n style={{ flex: 1, minWidth: '220px' }}\n />\n <button\n type=\"button\"\n onClick={send}\n disabled={status.kind === 'sending'}\n className=\"btn btn--style-secondary\"\n style={{ whiteSpace: 'nowrap' }}\n >\n {status.kind === 'sending' ? 'Sending…' : 'Send test'}\n </button>\n </div>\n {status.kind === 'ok' && (\n <p style={{ color: 'var(--theme-success-500, green)', marginTop: '.5rem' }}>\n ✓ {status.msg}\n </p>\n )}\n {status.kind === 'error' && (\n <p style={{ color: 'var(--theme-error-500, crimson)', marginTop: '.5rem' }}>\n ✗ {status.msg}\n </p>\n )}\n </div>\n )\n}\n\nexport default TestEmailButton\n"],"names":["useState","TestEmailButton","to","setTo","status","setStatus","kind","send","trim","msg","res","fetch","method","headers","credentials","body","JSON","stringify","data","json","ok","message","error","div","className","style","marginTop","label","p","opacity","fontSize","display","gap","alignItems","flexWrap","input","type","placeholder","value","onChange","e","target","flex","minWidth","button","onClick","disabled","whiteSpace","color"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,QAAO;AAEhC;;;;;;;;CAQC,GACD,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,CAACC,IAAIC,MAAM,GAAGH,SAAS;IAC7B,MAAM,CAACI,QAAQC,UAAU,GAAGL,SAE1B;QAAEM,MAAM;IAAO;IAEjB,MAAMC,OAAO;QACX,IAAI,CAACL,GAAGM,IAAI,IAAI;YACdH,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAA6B;YAC7D;QACF;QACAJ,UAAU;YAAEC,MAAM;QAAU;QAC5B,IAAI;YACF,MAAMI,MAAM,MAAMC,MAAM,wBAAwB;gBAC9CC,QAAQ;gBACRC,SAAS;oBAAE,gBAAgB;gBAAmB;gBAC9CC,aAAa;gBACbC,MAAMC,KAAKC,SAAS,CAAC;oBAAEf,IAAIA,GAAGM,IAAI;gBAAG;YACvC;YACA,MAAMU,OAAO,MAAMR,IAAIS,IAAI;YAC3B,IAAID,KAAKE,EAAE,EAAE;gBACXf,UAAU;oBAAEC,MAAM;oBAAMG,KAAKS,KAAKG,OAAO,IAAI;gBAAmB;YAClE,OAAO;gBACLhB,UAAU;oBAAEC,MAAM;oBAASG,KAAKS,KAAKI,KAAK,IAAI;gBAAe;YAC/D;QACF,EAAE,OAAM;YACNjB,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAAyC;QAC3E;IACF;IAEA,qBACE,MAACc;QAAIC,WAAU;QAAaC,OAAO;YAAEC,WAAW;QAAO;;0BACrD,KAACC;gBAAMH,WAAU;0BAAc;;0BAC/B,KAACI;gBAAEH,OAAO;oBAAEI,SAAS;oBAAKC,UAAU;oBAAUJ,WAAW;gBAAE;0BAAG;;0BAG9D,MAACH;gBAAIE,OAAO;oBAAEM,SAAS;oBAAQC,KAAK;oBAASC,YAAY;oBAAUC,UAAU;gBAAO;;kCAClF,KAACC;wBACCC,MAAK;wBACLC,aAAY;wBACZC,OAAOpC;wBACPqC,UAAU,CAACC,IAAMrC,MAAMqC,EAAEC,MAAM,CAACH,KAAK;wBACrCb,OAAO;4BAAEiB,MAAM;4BAAGC,UAAU;wBAAQ;;kCAEtC,KAACC;wBACCR,MAAK;wBACLS,SAAStC;wBACTuC,UAAU1C,OAAOE,IAAI,KAAK;wBAC1BkB,WAAU;wBACVC,OAAO;4BAAEsB,YAAY;wBAAS;kCAE7B3C,OAAOE,IAAI,KAAK,YAAY,aAAa;;;;YAG7CF,OAAOE,IAAI,KAAK,sBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;YAGhBL,OAAOE,IAAI,KAAK,yBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;;;AAKvB,EAAC;AAED,eAAeR,gBAAe"}
-7
View File
@@ -1,7 +0,0 @@
import type { Field } from 'payload';
/**
* Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no
* read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only
* after the matching consent category is granted (see modules/analytics).
*/
export declare const analyticsFields: Field[];
-56
View File
@@ -1,56 +0,0 @@
/**
* Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no
* read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only
* after the matching consent category is granted (see modules/analytics).
*/ export const analyticsFields = [
{
name: 'ga4MeasurementId',
type: 'text',
admin: {
description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',
placeholder: 'G-XXXXXXXXXX'
}
},
{
name: 'gtmContainerId',
type: 'text',
admin: {
description: 'Google Tag Manager container ID. (Google — Consent Mode)',
placeholder: 'GTM-XXXXXXX'
}
},
{
name: 'metaPixelId',
type: 'text',
admin: {
description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',
placeholder: '1234567890123456'
}
},
{
name: 'clarityProjectId',
type: 'text',
admin: {
description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',
placeholder: 'abcdefghij'
}
},
{
name: 'linkedInPartnerId',
type: 'text',
admin: {
description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',
placeholder: '1234567'
}
},
{
name: 'tiktokPixelId',
type: 'text',
admin: {
description: 'TikTok Pixel ID. Loads only after MARKETING consent.',
placeholder: 'CXXXXXXXXXXXXXXXXXXX'
}
}
];
//# sourceMappingURL=analytics.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/analytics.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no\n * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only\n * after the matching consent category is granted (see modules/analytics).\n */\nexport const analyticsFields: Field[] = [\n {\n name: 'ga4MeasurementId',\n type: 'text',\n admin: {\n description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',\n placeholder: 'G-XXXXXXXXXX',\n },\n },\n {\n name: 'gtmContainerId',\n type: 'text',\n admin: {\n description: 'Google Tag Manager container ID. (Google — Consent Mode)',\n placeholder: 'GTM-XXXXXXX',\n },\n },\n {\n name: 'metaPixelId',\n type: 'text',\n admin: {\n description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',\n placeholder: '1234567890123456',\n },\n },\n {\n name: 'clarityProjectId',\n type: 'text',\n admin: {\n description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',\n placeholder: 'abcdefghij',\n },\n },\n {\n name: 'linkedInPartnerId',\n type: 'text',\n admin: {\n description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',\n placeholder: '1234567',\n },\n },\n {\n name: 'tiktokPixelId',\n type: 'text',\n admin: {\n description: 'TikTok Pixel ID. Loads only after MARKETING consent.',\n placeholder: 'CXXXXXXXXXXXXXXXXXXX',\n },\n },\n]\n"],"names":["analyticsFields","name","type","admin","description","placeholder"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;CACD,CAAA"}
-9
View File
@@ -1,9 +0,0 @@
import type { Field } from 'payload';
/**
* SMTP transport settings for outbound email.
*
* Protected at the global level (SiteIntegrations requires an authenticated
* user), so all fields — including the password — stay editable in the admin
* panel while remaining inaccessible to anonymous API requests.
*/
export declare const smtpFields: Field[];
-98
View File
@@ -1,98 +0,0 @@
import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js';
/**
* SMTP transport settings for outbound email.
*
* Protected at the global level (SiteIntegrations requires an authenticated
* user), so all fields — including the password — stay editable in the admin
* panel while remaining inaccessible to anonymous API requests.
*/ export const smtpFields = [
// Status written by mailAdapter on every send (throttled) — banner on this tab.
buildIntegrationStatusBanner('emailStatus', 'Email'),
{
name: 'emailTransport',
type: 'select',
admin: {
description: 'How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).'
},
defaultValue: 'smtp',
options: [
{
label: 'SMTP',
value: 'smtp'
},
{
label: 'Microsoft Graph (Exchange)',
value: 'graph'
}
]
},
{
type: 'row',
admin: {
// Hide SMTP fields when Graph is selected — they're not used then.
condition: (_, siblingData)=>siblingData?.emailTransport !== 'graph'
},
fields: [
{
name: 'smtpHost',
type: 'text',
admin: {
placeholder: 'smtp.example.com',
width: '70%'
}
},
{
name: 'smtpPort',
type: 'number',
admin: {
width: '30%'
},
defaultValue: 587
}
]
},
{
name: 'smtpUser',
type: 'text',
admin: {
description: 'SMTP account username.'
}
},
{
name: 'smtpPassword',
type: 'text',
admin: {
description: 'SMTP account password.',
// Masked in the UI (••••) — stored plaintext, readable for SMTP auth.
components: {
Field: '@intecion/ipal-kit/client#MaskedField'
}
}
},
{
name: 'smtpFromAddress',
type: 'email',
admin: {
description: 'Default "from" address for outgoing mail.'
}
},
{
name: 'smtpFromName',
type: 'text',
admin: {
description: 'Default "from" display name.'
}
},
{
name: 'emailTest',
type: 'ui',
admin: {
components: {
Field: '@intecion/ipal-kit/client#TestEmailButton'
}
}
},
buildIntegrationStatusField('emailStatus')
];
//# sourceMappingURL=smtp.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/smtp.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'\n\n/**\n * SMTP transport settings for outbound email.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so all fields — including the password — stay editable in the admin\n * panel while remaining inaccessible to anonymous API requests.\n */\nexport const smtpFields: Field[] = [\n // Status written by mailAdapter on every send (throttled) — banner on this tab.\n buildIntegrationStatusBanner('emailStatus', 'Email'),\n {\n name: 'emailTransport',\n type: 'select',\n admin: {\n description:\n 'How outbound email is sent. \"Microsoft Graph\" is only available when configured by the administrator (Intecion).',\n // The Graph option only makes sense when agency credentials exist in env.\n // We can't read process.env in the admin UI directly, so a client project\n // that hasn't set up Graph should filter this option via integrationsFields\n // override, or simply leave it on 'smtp'. The adapter enforces the real\n // availability at send time regardless of what's selected here.\n },\n defaultValue: 'smtp',\n options: [\n { label: 'SMTP', value: 'smtp' },\n { label: 'Microsoft Graph (Exchange)', value: 'graph' },\n ],\n },\n {\n type: 'row',\n admin: {\n // Hide SMTP fields when Graph is selected — they're not used then.\n condition: (_, siblingData) => siblingData?.emailTransport !== 'graph',\n },\n fields: [\n {\n name: 'smtpHost',\n type: 'text',\n admin: { placeholder: 'smtp.example.com', width: '70%' },\n },\n {\n name: 'smtpPort',\n type: 'number',\n admin: { width: '30%' },\n defaultValue: 587,\n },\n ],\n },\n {\n name: 'smtpUser',\n type: 'text',\n admin: {\n description: 'SMTP account username.',\n },\n },\n {\n name: 'smtpPassword',\n type: 'text',\n admin: {\n description: 'SMTP account password.',\n // Masked in the UI (••••) — stored plaintext, readable for SMTP auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n {\n name: 'smtpFromAddress',\n type: 'email',\n admin: {\n description: 'Default \"from\" address for outgoing mail.',\n },\n },\n {\n name: 'smtpFromName',\n type: 'text',\n admin: {\n description: 'Default \"from\" display name.',\n },\n },\n {\n name: 'emailTest',\n type: 'ui',\n admin: {\n components: {\n Field: '@intecion/ipal-kit/client#TestEmailButton',\n },\n },\n },\n buildIntegrationStatusField('emailStatus'),\n]\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","smtpFields","name","type","admin","description","defaultValue","options","label","value","condition","_","siblingData","emailTransport","fields","placeholder","width","components","Field"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,2BAA2B,QAAQ,0CAAyC;AAEnH;;;;;;CAMC,GACD,OAAO,MAAMC,aAAsB;IACjC,gFAAgF;IAChFF,6BAA6B,eAAe;IAC5C;QACEG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QAMJ;QACAC,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAQC,OAAO;YAAO;YAC/B;gBAAED,OAAO;gBAA8BC,OAAO;YAAQ;SACvD;IACH;IACA;QACEN,MAAM;QACNC,OAAO;YACL,mEAAmE;YACnEM,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,mBAAmB;QACjE;QACAC,QAAQ;YACN;gBACEZ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEW,aAAa;oBAAoBC,OAAO;gBAAM;YACzD;YACA;gBACEd,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEY,OAAO;gBAAM;gBACtBV,cAAc;YAChB;SACD;IACH;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,sEAAsE;YACtEY,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACA;QACEhB,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLa,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACAlB,4BAA4B;CAC7B,CAAA"}
-10
View File
@@ -1,10 +0,0 @@
import type { Field } from 'payload';
/**
* Cloudflare R2 storage credentials.
* Reserved for future use — media offloading to R2.
*
* Protected at the global level (SiteIntegrations requires an authenticated
* user), so the access keys stay editable in the admin panel while remaining
* inaccessible to anonymous API requests.
*/
export declare const storageFields: Field[];
-43
View File
@@ -1,43 +0,0 @@
/**
* Cloudflare R2 storage credentials.
* Reserved for future use — media offloading to R2.
*
* Protected at the global level (SiteIntegrations requires an authenticated
* user), so the access keys stay editable in the admin panel while remaining
* inaccessible to anonymous API requests.
*/ export const storageFields = [
{
name: 'r2Bucket',
type: 'text',
admin: {
description: 'R2 bucket name.'
}
},
{
name: 'r2Endpoint',
type: 'text',
admin: {
description: 'R2 S3-compatible endpoint URL.'
}
},
{
name: 'r2AccessKeyId',
type: 'text',
admin: {
description: 'R2 access key ID.'
}
},
{
name: 'r2SecretAccessKey',
type: 'text',
admin: {
description: 'R2 secret access key.',
// Masked in the UI (••••) — stored plaintext, readable for R2 auth.
components: {
Field: '@intecion/ipal-kit/client#MaskedField'
}
}
}
];
//# sourceMappingURL=storage.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/storage.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Cloudflare R2 storage credentials.\n * Reserved for future use — media offloading to R2.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so the access keys stay editable in the admin panel while remaining\n * inaccessible to anonymous API requests.\n */\nexport const storageFields: Field[] = [\n {\n name: 'r2Bucket',\n type: 'text',\n admin: {\n description: 'R2 bucket name.',\n },\n },\n {\n name: 'r2Endpoint',\n type: 'text',\n admin: {\n description: 'R2 S3-compatible endpoint URL.',\n },\n },\n {\n name: 'r2AccessKeyId',\n type: 'text',\n admin: {\n description: 'R2 access key ID.',\n },\n },\n {\n name: 'r2SecretAccessKey',\n type: 'text',\n admin: {\n description: 'R2 secret access key.',\n // Masked in the UI (••••) — stored plaintext, readable for R2 auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n]\n"],"names":["storageFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,oEAAoE;YACpEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;CACD,CAAA"}
-10
View File
@@ -1,10 +0,0 @@
import type { Field } from 'payload';
/**
* Cloudflare Turnstile credentials.
*
* siteKey is public (rendered in the widget); secretKey is used for
* server-side verification. Both are protected at the global level
* (SiteIntegrations requires an authenticated user) rather than per-field,
* so they remain editable in the admin panel.
*/
export declare const turnstileFields: Field[];
-33
View File
@@ -1,33 +0,0 @@
import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js';
/**
* Cloudflare Turnstile credentials.
*
* siteKey is public (rendered in the widget); secretKey is used for
* server-side verification. Both are protected at the global level
* (SiteIntegrations requires an authenticated user) rather than per-field,
* so they remain editable in the admin panel.
*/ export const turnstileFields = [
// Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.
buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),
{
name: 'turnstileSiteKey',
type: 'text',
admin: {
description: 'Public site key rendered in the Turnstile widget.'
}
},
{
name: 'turnstileSecretKey',
type: 'text',
admin: {
description: 'Secret key used for server-side verification.',
// Masked in the UI (••••) — stored plaintext, readable for verification.
components: {
Field: '@intecion/ipal-kit/client#MaskedField'
}
}
},
buildIntegrationStatusField('turnstileStatus')
];
//# sourceMappingURL=turnstile.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n // Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.\n buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n // Masked in the UI (••••) — stored plaintext, readable for verification.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n buildIntegrationStatusField('turnstileStatus'),\n]\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,2BAA2B,QAAQ,0CAAyC;AAEnH;;;;;;;CAOC,GACD,OAAO,MAAMC,kBAA2B;IACtC,8FAA8F;IAC9FF,6BAA6B,mBAAmB;IAChD;QACEG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,yEAAyE;YACzEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACAP,4BAA4B;CAC7B,CAAA"}
-19
View File
@@ -1,19 +0,0 @@
import type { Field, GlobalConfig } from 'payload';
type BuildSiteIntegrationsArgs = {
/** Extra fields injected by the client project */
additionalFields?: Field[];
};
/**
* Builds the SiteIntegrations global.
*
* Holds third-party service credentials. Access is enforced at the global
* level — the whole global requires an authenticated user — so secrets stay
* out of anonymous API responses while remaining editable in the admin panel
* and readable via the server-side Local API. (Field-level read:false was
* avoided because it also hides fields from the admin UI, making them
* impossible to enter.)
*
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
*/
export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;
export {};
-83
View File
@@ -1,83 +0,0 @@
import { isAdmin } from '../../modules/access/index.js';
import { analyticsFields } from './fields/analytics.js';
import { smtpFields } from './fields/smtp.js';
import { turnstileFields } from './fields/turnstile.js';
/**
* Builds the SiteIntegrations global.
*
* Holds third-party service credentials. Access is enforced at the global
* level — the whole global requires an authenticated user — so secrets stay
* out of anonymous API responses while remaining editable in the admin panel
* and readable via the server-side Local API. (Field-level read:false was
* avoided because it also hides fields from the admin UI, making them
* impossible to enter.)
*
* Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).
*/ export function buildSiteIntegrations({ additionalFields } = {}) {
return {
slug: 'site-integrations',
access: {
// Admin-only — secrets live here. Anonymous and non-admin users get
// nothing through the API; admins read/edit in the panel and via Local API.
read: ({ req: { user } })=>isAdmin(user),
update: ({ req: { user } })=>isAdmin(user)
},
admin: {
group: 'Settings'
},
fields: [
{
type: 'tabs',
tabs: [
{
fields: analyticsFields,
label: 'Analytics'
},
{
fields: turnstileFields,
label: 'Turnstile'
},
{
fields: smtpFields,
label: 'SMTP'
},
...additionalFields?.length ? [
{
fields: additionalFields,
label: 'Custom'
}
] : []
]
}
],
hooks: {
beforeChange: [
// Keys edited in the panel → clear that integration's old status, so a stale
// "not working" banner doesn't linger until the next form submission.
({ context, data, originalDoc })=>{
if (context?.ipalIntegrationStatus || !data) {
return data;
}
const changed = (k)=>k in data && data[k] !== originalDoc?.[k];
const cleared = {
checkedAt: null,
code: null,
message: null,
since: null,
state: null
};
if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {
data.turnstileStatus = cleared;
}
if (Object.keys(data).some((k)=>(k === 'emailTransport' || k.startsWith('smtp')) && changed(k))) {
data.emailStatus = cleared;
}
return data;
}
]
},
label: 'Site Integrations'
};
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n ...(additionalFields?.length\n ? [{ fields: additionalFields, label: 'Custom' }]\n : []),\n ],\n },\n ],\n hooks: {\n beforeChange: [\n // Keys edited in the panel → clear that integration's old status, so a stale\n // \"not working\" banner doesn't linger until the next form submission.\n ({ context, data, originalDoc }) => {\n if (context?.ipalIntegrationStatus || !data) {return data}\n const changed = (k: string) => k in data && data[k] !== originalDoc?.[k]\n const cleared = { checkedAt: null, code: null, message: null, since: null, state: null }\n if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {data.turnstileStatus = cleared}\n if (Object.keys(data).some((k) => (k === 'emailTransport' || k.startsWith('smtp')) && changed(k))) {\n data.emailStatus = cleared\n }\n return data\n },\n ],\n },\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length","hooks","beforeChange","context","data","originalDoc","ipalIntegrationStatus","changed","k","cleared","checkedAt","code","message","since","state","turnstileStatus","Object","keys","some","startsWith","emailStatus"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQb;wBAAiBgB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQZ;wBAAYe,OAAO;oBAAO;uBAChCZ,kBAAkBa,SAClB;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAC/C,EAAE;iBACP;YACH;SACD;QACDE,OAAO;YACLC,cAAc;gBACZ,6EAA6E;gBAC7E,sEAAsE;gBACtE,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,WAAW,EAAE;oBAC7B,IAAIF,SAASG,yBAAyB,CAACF,MAAM;wBAAC,OAAOA;oBAAI;oBACzD,MAAMG,UAAU,CAACC,IAAcA,KAAKJ,QAAQA,IAAI,CAACI,EAAE,KAAKH,aAAa,CAACG,EAAE;oBACxE,MAAMC,UAAU;wBAAEC,WAAW;wBAAMC,MAAM;wBAAMC,SAAS;wBAAMC,OAAO;wBAAMC,OAAO;oBAAK;oBACvF,IAAIP,QAAQ,yBAAyBA,QAAQ,qBAAqB;wBAACH,KAAKW,eAAe,GAAGN;oBAAO;oBACjG,IAAIO,OAAOC,IAAI,CAACb,MAAMc,IAAI,CAAC,CAACV,IAAM,AAACA,CAAAA,MAAM,oBAAoBA,EAAEW,UAAU,CAAC,OAAM,KAAMZ,QAAQC,KAAK;wBACjGJ,KAAKgB,WAAW,GAAGX;oBACrB;oBACA,OAAOL;gBACT;aACD;QACH;QACAL,OAAO;IACT;AACF"}
-6
View File
@@ -1,6 +0,0 @@
import type { Field } from 'payload';
/**
* General site identity fields.
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
*/
export declare const generalFields: Field[];
-103
View File
@@ -1,103 +0,0 @@
import { validateFaviconField } from '../../../modules/seo/index.js';
/**
* General site identity fields.
* Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).
*/ export const generalFields = [
{
name: 'siteName',
type: 'text',
admin: {
description: 'Used in page titles and Open Graph metadata.'
},
localized: true,
required: true
},
{
name: 'siteDescription',
type: 'textarea',
admin: {
description: 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.'
},
localized: true
},
{
name: 'titleOrder',
type: 'select',
admin: {
description: 'Which comes first in browser tabs.'
},
defaultValue: 'page-first',
options: [
{
label: 'Page first — About Us | Acme',
value: 'page-first'
},
{
label: 'Site first — Acme | About Us',
value: 'site-first'
}
]
},
{
name: 'titleSeparator',
type: 'select',
admin: {
description: 'Separates the page title from the site name in browser tabs.'
},
defaultValue: '|',
options: [
{
label: 'Pipe — Page | Site',
value: '|'
},
{
label: 'Dash — Page – Site',
value: '–'
},
{
label: 'Hyphen — Page - Site',
value: '-'
},
{
label: 'Bullet — Page · Site',
value: '·'
},
{
label: 'Slash — Page / Site',
value: '/'
}
]
},
{
name: 'logo',
type: 'upload',
admin: {
description: 'Primary site logo.'
},
relationTo: 'media'
},
{
name: 'defaultShareImage',
type: 'upload',
admin: {
description: 'Fallback Open Graph image when a page has none.'
},
relationTo: 'media'
},
{
name: 'favicon',
type: 'upload',
admin: {
description: 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.'
},
hooks: {
// Warn the editor if the favicon is too small / not square for Google.
beforeValidate: [
validateFaviconField
]
},
relationTo: 'media'
}
];
//# sourceMappingURL=general.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/general.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { validateFaviconField } from '../../../modules/seo/index.js'\n\n/**\n * General site identity fields.\n * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).\n */\nexport const generalFields: Field[] = [\n {\n name: 'siteName',\n type: 'text',\n admin: {\n description: 'Used in page titles and Open Graph metadata.',\n },\n localized: true,\n required: true,\n },\n {\n name: 'siteDescription',\n type: 'textarea',\n admin: {\n description:\n 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.',\n },\n localized: true,\n },\n {\n name: 'titleOrder',\n type: 'select',\n admin: {\n description: 'Which comes first in browser tabs.',\n },\n defaultValue: 'page-first',\n options: [\n { label: 'Page first — About Us | Acme', value: 'page-first' },\n { label: 'Site first — Acme | About Us', value: 'site-first' },\n ],\n },\n {\n name: 'titleSeparator',\n type: 'select',\n admin: {\n description: 'Separates the page title from the site name in browser tabs.',\n },\n defaultValue: '|',\n options: [\n { label: 'Pipe — Page | Site', value: '|' },\n { label: 'Dash — Page – Site', value: '–' },\n { label: 'Hyphen — Page - Site', value: '-' },\n { label: 'Bullet — Page · Site', value: '·' },\n { label: 'Slash — Page / Site', value: '/' },\n ],\n },\n {\n name: 'logo',\n type: 'upload',\n admin: {\n description: 'Primary site logo.',\n },\n relationTo: 'media',\n },\n {\n name: 'defaultShareImage',\n type: 'upload',\n admin: {\n description: 'Fallback Open Graph image when a page has none.',\n },\n relationTo: 'media',\n },\n {\n name: 'favicon',\n type: 'upload',\n admin: {\n description:\n 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',\n },\n hooks: {\n // Warn the editor if the favicon is too small / not square for Google.\n beforeValidate: [validateFaviconField],\n },\n relationTo: 'media',\n },\n]\n"],"names":["validateFaviconField","generalFields","name","type","admin","description","localized","required","defaultValue","options","label","value","relationTo","hooks","beforeValidate"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,gCAA+B;AAEpE;;;CAGC,GACD,OAAO,MAAMC,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;QACXC,UAAU;IACZ;IACA;QACEL,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAkCC,OAAO;YAAa;YAC/D;gBAAED,OAAO;gBAAkCC,OAAO;YAAa;SAChE;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAAyBC,OAAO;YAAI;SAC9C;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAQ,OAAO;YACL,uEAAuE;YACvEC,gBAAgB;gBAACd;aAAqB;QACxC;QACAY,YAAY;IACd;CACD,CAAA"}
-1
View File
@@ -1 +0,0 @@
export {};
-2
View File
@@ -1,2 +0,0 @@
//# sourceMappingURL=navigation.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/navigation.ts"],"names":[],"mappings":""}
-9
View File
@@ -1,9 +0,0 @@
import type { Field } from 'payload';
/**
* Theme behavior configuration.
*
* These are decisions, not visuals — the plugin stores them, the client
* template reads them and decides whether to render a toggle and which
* mode to start in. Appearance itself stays in the template.
*/
export declare const themeFields: Field[];
-37
View File
@@ -1,37 +0,0 @@
/**
* Theme behavior configuration.
*
* These are decisions, not visuals — the plugin stores them, the client
* template reads them and decides whether to render a toggle and which
* mode to start in. Appearance itself stays in the template.
*/ export const themeFields = [
{
name: 'defaultTheme',
type: 'select',
admin: {
description: 'Theme applied on a visitor’s first visit.'
},
defaultValue: 'light',
options: [
{
label: 'Light',
value: 'light'
},
{
label: 'Dark',
value: 'dark'
}
],
required: true
},
{
name: 'allowThemeToggle',
type: 'checkbox',
admin: {
description: 'Show a light/dark switch on the site.'
},
defaultValue: true
}
];
//# sourceMappingURL=theme.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/theme.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Theme behavior configuration.\n *\n * These are decisions, not visuals — the plugin stores them, the client\n * template reads them and decides whether to render a toggle and which\n * mode to start in. Appearance itself stays in the template.\n */\nexport const themeFields: Field[] = [\n {\n name: 'defaultTheme',\n type: 'select',\n admin: {\n description: 'Theme applied on a visitor’s first visit.',\n },\n defaultValue: 'light',\n options: [\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n ],\n required: true,\n },\n {\n name: 'allowThemeToggle',\n type: 'checkbox',\n admin: {\n description: 'Show a light/dark switch on the site.',\n },\n defaultValue: true,\n },\n]\n"],"names":["themeFields","name","type","admin","description","defaultValue","options","label","value","required"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,cAAuB;IAClC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAASC,OAAO;YAAQ;YACjC;gBAAED,OAAO;gBAAQC,OAAO;YAAO;SAChC;QACDC,UAAU;IACZ;IACA;QACER,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;IAChB;CACD,CAAA"}
-27
View File
@@ -1,27 +0,0 @@
import type { Field, GlobalConfig } from 'payload';
type BuildSiteSettingsArgs = {
/** Extra fields injected by the client project */
additionalFields?: Field[];
/**
* Fields for the "System Pages" tab — page assignments by role (homepage,
* privacy policy, collection archives). Assembled by the caller, which is the
* only place that knows which modules are enabled. The tab is omitted when
* this is empty.
*/
systemPageFields?: Field[];
};
/**
* Builds the SiteSettings global.
*
* Composes tabs out of field groups; it deliberately doesn't know where those
* groups come from. Earlier it imported the pages and content modules directly,
* which meant a global — a presentation-layer concern — had an opinion about
* blogs. Now the plugin's composition root passes fields in, and adding a new
* kind of page assignment needs no change here.
*
* Uses unnamed tabs — data stays flat (siteSettings.siteName, not
* siteSettings.general.siteName). Client-provided fields land in their own
* "Custom" tab so core data paths never shift.
*/
export declare function buildSiteSettings({ additionalFields, systemPageFields, }?: BuildSiteSettingsArgs): GlobalConfig;
export {};
-55
View File
@@ -1,55 +0,0 @@
import { generalFields } from './fields/general.js';
import { themeFields } from './fields/theme.js';
/**
* Builds the SiteSettings global.
*
* Composes tabs out of field groups; it deliberately doesn't know where those
* groups come from. Earlier it imported the pages and content modules directly,
* which meant a global — a presentation-layer concern — had an opinion about
* blogs. Now the plugin's composition root passes fields in, and adding a new
* kind of page assignment needs no change here.
*
* Uses unnamed tabs — data stays flat (siteSettings.siteName, not
* siteSettings.general.siteName). Client-provided fields land in their own
* "Custom" tab so core data paths never shift.
*/ export function buildSiteSettings({ additionalFields, systemPageFields } = {}) {
return {
slug: 'site-settings',
access: {
read: ()=>true
},
admin: {
group: 'Settings'
},
fields: [
{
type: 'tabs',
tabs: [
{
fields: generalFields,
label: 'General'
},
{
fields: themeFields,
label: 'Theme'
},
...systemPageFields?.length ? [
{
fields: systemPageFields,
label: 'System Pages'
}
] : [],
...additionalFields?.length ? [
{
fields: additionalFields,
label: 'Custom'
}
] : []
]
}
],
label: 'Site Settings'
};
}
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/globals/SiteSettings/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { generalFields } from './fields/general.js'\nimport { themeFields } from './fields/theme.js'\n\ntype BuildSiteSettingsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n /**\n * Fields for the \"System Pages\" tab — page assignments by role (homepage,\n * privacy policy, collection archives). Assembled by the caller, which is the\n * only place that knows which modules are enabled. The tab is omitted when\n * this is empty.\n */\n systemPageFields?: Field[]\n}\n\n/**\n * Builds the SiteSettings global.\n *\n * Composes tabs out of field groups; it deliberately doesn't know where those\n * groups come from. Earlier it imported the pages and content modules directly,\n * which meant a global — a presentation-layer concern — had an opinion about\n * blogs. Now the plugin's composition root passes fields in, and adding a new\n * kind of page assignment needs no change here.\n *\n * Uses unnamed tabs — data stays flat (siteSettings.siteName, not\n * siteSettings.general.siteName). Client-provided fields land in their own\n * \"Custom\" tab so core data paths never shift.\n */\nexport function buildSiteSettings({\n additionalFields,\n systemPageFields,\n}: BuildSiteSettingsArgs = {}): GlobalConfig {\n return {\n slug: 'site-settings',\n access: {\n read: () => true,\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n {\n fields: generalFields,\n label: 'General',\n },\n {\n fields: themeFields,\n label: 'Theme',\n },\n ...(systemPageFields?.length\n ? [{ fields: systemPageFields, label: 'System Pages' }]\n : []),\n ...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),\n ],\n },\n ],\n label: 'Site Settings',\n }\n}\n"],"names":["generalFields","themeFields","buildSiteSettings","additionalFields","systemPageFields","slug","access","read","admin","group","fields","type","tabs","label","length"],"mappings":"AAEA,SAASA,aAAa,QAAQ,sBAAqB;AACnD,SAASC,WAAW,QAAQ,oBAAmB;AAc/C;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,kBAAkB,EAChCC,gBAAgB,EAChBC,gBAAgB,EACM,GAAG,CAAC,CAAC;IAC3B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBACEF,QAAQV;wBACRa,OAAO;oBACT;oBACA;wBACEH,QAAQT;wBACRY,OAAO;oBACT;uBACIT,kBAAkBU,SAClB;wBAAC;4BAAEJ,QAAQN;4BAAkBS,OAAO;wBAAe;qBAAE,GACrD,EAAE;uBACFV,kBAAkBW,SAAS;wBAAC;4BAAEJ,QAAQP;4BAAkBU,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,OAAO;IACT;AACF"}
-76
View File
@@ -1,76 +0,0 @@
export { ipalKit } from './plugin.js';
export type { IpalOptions } from './types.js';
export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js';
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js';
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
export type { AccessOption, Role } from './modules/access/index.js';
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js';
export type { GlobalQueryOptions } from './modules/payload/index.js';
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG, } from './modules/payload/index.js';
export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js';
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js';
export type { SiteMetaConfig } from './modules/seo/index.js';
export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js';
export { createContentHelpers } from './modules/frontend/index.js';
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam, } from './modules/content/index.js';
export type { ArchiveEntries } from './modules/content/index.js';
export type { SearchResult } from './modules/content/index.js';
export { lexicalToMarkdown } from './modules/richtext/index.js';
export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js';
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, } from './modules/seo/index.js';
export type { LocaleMiddlewareResult } from './modules/i18n/index.js';
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER, } from './modules/i18n/index.js';
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
export { resolveLocalized } from './modules/i18n/index.js';
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts, } from './modules/consent/index.js';
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
export { graphAdapter } from './modules/email/graphAdapter.js';
export { mailAdapter } from './modules/email/mailAdapter.js';
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
export type { FormsOption, FormsCollectionOverrides, FormsFieldsOverride, } from './modules/forms/types.js';
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from './modules/forms/validators.js';
export type { Rule } from './modules/forms/validators.js';
export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js';
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
export { createHealthRoute } from './modules/health/index.js';
export { createMcpRoute } from './modules/mcp/index.js';
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js';
export type { AnalyticsConfig } from './modules/analytics/index.js';
export { getAnalyticsConfig } from './modules/analytics/index.js';
export { buildSlugField, toSlug } from './modules/slug/index.js';
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
export { buildSecurityHeaders } from './modules/security/index.js';
export { buildCsp } from './modules/security/index.js';
export type { BuildCspArgs } from './modules/security/index.js';
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
export { buildNoindexField } from './modules/seo/index.js';
export { recordIntegrationStatus, buildIntegrationStatusField, buildIntegrationStatusBanner } from './modules/integrations/index.js';
export type { IntegrationStatus, IntegrationState } from './modules/integrations/index.js';
export { rowLabel } from './modules/admin-ui/index.js';
export type { RowLabelProps } from './modules/admin-ui/index.js';
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
export type { LinkAppearance, LinkValue, BuildLinkFieldOptions, BuildLinksFieldOptions, ResolveLinkHrefOptions, } from './modules/links/index.js';
export { buildSpeakableJsonLd } from './modules/seo/index.js';
export { buildSummaryField } from './modules/seo/index.js';
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
export { buildArticleJsonLd } from './modules/seo/index.js';
export { buildLlmsTxt } from './modules/seo/index.js';
export { buildSitemapXml, buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './modules/seo/index.js';
export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js';
export { buildR2Storage } from './modules/storage/index.js';
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
export type { OptimizeUploadOptions } from './modules/media/index.js';
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
export type { A11yState } from './modules/accessibility/index.js';
export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js';
export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js';
-60
View File
@@ -1,60 +0,0 @@
export { ipalKit } from './plugin.js';
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG } from './modules/payload/index.js';
export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js';
export { createContentHelpers } from './modules/frontend/index.js';
export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam } from './modules/content/index.js';
// Lexical → Markdown (pure, no React) — for AI-readable output.
export { lexicalToMarkdown } from './modules/richtext/index.js';
export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './modules/seo/index.js';
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js';
export { resolveLocalized } from './modules/i18n/index.js';
export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts } from './modules/consent/index.js';
// Imported straight from the file, NOT from ./modules/email/index.js — that
// barrel re-exports sendEmail, which imports 'server-only' and would crash when
// Payload loads the config (or runs generate:importmap) as a plain Node script.
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
export { graphAdapter } from './modules/email/graphAdapter.js';
export { mailAdapter } from './modules/email/mailAdapter.js';
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
// Validation rules are pure — exported server-side too, for re-validating a
// submission inside a server action. (useForm/useContactForm are client-only →
// '@intecion/ipal-kit/client'.)
export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from './modules/forms/validators.js';
export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js';
// Panel-managed form analytics (config-time field builder).
export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js';
// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).
export { createHealthRoute } from './modules/health/index.js';
// Read-only MCP server (Claude/agents connect to the site and query it).
export { createMcpRoute } from './modules/mcp/index.js';
// Boot-time environment validation (fail fast on misconfigured deploys).
export { assertEnv, ipalEnvRules } from './modules/env/index.js';
export { getAnalyticsConfig } from './modules/analytics/index.js';
export { buildSlugField, toSlug } from './modules/slug/index.js';
export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js';
export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js';
export { buildSecurityHeaders } from './modules/security/index.js';
export { buildCsp } from './modules/security/index.js';
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
export { buildNoindexField } from './modules/seo/index.js';
export { recordIntegrationStatus, buildIntegrationStatusField, buildIntegrationStatusBanner } from './modules/integrations/index.js';
export { rowLabel } from './modules/admin-ui/index.js';
export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js';
export { buildSpeakableJsonLd } from './modules/seo/index.js';
export { buildSummaryField } from './modules/seo/index.js';
export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js';
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
export { buildArticleJsonLd } from './modules/seo/index.js';
export { buildLlmsTxt } from './modules/seo/index.js';
export { buildSitemapXml, buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './modules/seo/index.js';
export { buildR2Storage } from './modules/storage/index.js';
export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js';
export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js';
export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js';
//# sourceMappingURL=index.js.map
-1
View File
File diff suppressed because one or more lines are too long
-21
View File
@@ -1,21 +0,0 @@
import type { Access, FieldAccess } from 'payload';
import type { Role } from './types.js';
/**
* Collection-level access (returns boolean | Where).
* Use in collection `access.read/create/update/delete`.
*/
export declare const adminOnly: Access;
export declare const adminOrEditor: Access;
export declare const authenticated: Access;
/** Requires at least the given role. */
export declare const requireRole: (minimum: Role) => Access;
/** Admins see all; others are constrained to their own document. */
export declare const adminOrSelf: Access;
/**
* Field-level access (returns boolean only — no Where support).
* Use in field `access.read/update`.
*/
export declare const adminOnlyField: FieldAccess;
export declare const adminOrEditorField: FieldAccess;
/** Requires at least the given role, for field-level access. */
export declare const requireRoleField: (minimum: Role) => FieldAccess;
-29
View File
@@ -1,29 +0,0 @@
import { hasMinimumRole, isAdmin } from './predicates.js';
/**
* Collection-level access (returns boolean | Where).
* Use in collection `access.read/create/update/delete`.
*/ export const adminOnly = ({ req: { user } })=>isAdmin(user);
export const adminOrEditor = ({ req: { user } })=>hasMinimumRole(user, 'editor');
export const authenticated = ({ req: { user } })=>Boolean(user);
/** Requires at least the given role. */ export const requireRole = (minimum)=>({ req: { user } })=>hasMinimumRole(user, minimum);
/** Admins see all; others are constrained to their own document. */ export const adminOrSelf = ({ req: { user } })=>{
if (isAdmin(user)) {
return true;
}
if (!user) {
return false;
}
return {
id: {
equals: user.id
}
};
};
/**
* Field-level access (returns boolean only — no Where support).
* Use in field `access.read/update`.
*/ export const adminOnlyField = ({ req: { user } })=>isAdmin(user);
export const adminOrEditorField = ({ req: { user } })=>hasMinimumRole(user, 'editor');
/** Requires at least the given role, for field-level access. */ export const requireRoleField = (minimum)=>({ req: { user } })=>hasMinimumRole(user, minimum);
//# sourceMappingURL=access.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/modules/access/access.ts"],"sourcesContent":["import type { Access, FieldAccess } from 'payload'\n\nimport type { Role } from './types.js'\n\nimport { hasMinimumRole, isAdmin } from './predicates.js'\n\n/**\n * Collection-level access (returns boolean | Where).\n * Use in collection `access.read/create/update/delete`.\n */\nexport const adminOnly: Access = ({ req: { user } }) => isAdmin(user)\n\nexport const adminOrEditor: Access = ({ req: { user } }) => hasMinimumRole(user, 'editor')\n\nexport const authenticated: Access = ({ req: { user } }) => Boolean(user)\n\n/** Requires at least the given role. */\nexport const requireRole =\n (minimum: Role): Access =>\n ({ req: { user } }) =>\n hasMinimumRole(user, minimum)\n\n/** Admins see all; others are constrained to their own document. */\nexport const adminOrSelf: Access = ({ req: { user } }) => {\n if (isAdmin(user)) {return true}\n if (!user) {return false}\n return { id: { equals: user.id } }\n}\n\n/**\n * Field-level access (returns boolean only — no Where support).\n * Use in field `access.read/update`.\n */\nexport const adminOnlyField: FieldAccess = ({ req: { user } }) => isAdmin(user)\n\nexport const adminOrEditorField: FieldAccess = ({ req: { user } }) => hasMinimumRole(user, 'editor')\n\n/** Requires at least the given role, for field-level access. */\nexport const requireRoleField =\n (minimum: Role): FieldAccess =>\n ({ req: { user } }) =>\n hasMinimumRole(user, minimum)\n"],"names":["hasMinimumRole","isAdmin","adminOnly","req","user","adminOrEditor","authenticated","Boolean","requireRole","minimum","adminOrSelf","id","equals","adminOnlyField","adminOrEditorField","requireRoleField"],"mappings":"AAIA,SAASA,cAAc,EAAEC,OAAO,QAAQ,kBAAiB;AAEzD;;;CAGC,GACD,OAAO,MAAMC,YAAoB,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKH,QAAQG,MAAK;AAErE,OAAO,MAAMC,gBAAwB,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKJ,eAAeI,MAAM,UAAS;AAE1F,OAAO,MAAME,gBAAwB,CAAC,EAAEH,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKG,QAAQH,MAAK;AAEzE,sCAAsC,GACtC,OAAO,MAAMI,cACX,CAACC,UACD,CAAC,EAAEN,KAAK,EAAEC,IAAI,EAAE,EAAE,GAChBJ,eAAeI,MAAMK,SAAQ;AAEjC,kEAAkE,GAClE,OAAO,MAAMC,cAAsB,CAAC,EAAEP,KAAK,EAAEC,IAAI,EAAE,EAAE;IACnD,IAAIH,QAAQG,OAAO;QAAC,OAAO;IAAI;IAC/B,IAAI,CAACA,MAAM;QAAC,OAAO;IAAK;IACxB,OAAO;QAAEO,IAAI;YAAEC,QAAQR,KAAKO,EAAE;QAAC;IAAE;AACnC,EAAC;AAED;;;CAGC,GACD,OAAO,MAAME,iBAA8B,CAAC,EAAEV,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKH,QAAQG,MAAK;AAE/E,OAAO,MAAMU,qBAAkC,CAAC,EAAEX,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKJ,eAAeI,MAAM,UAAS;AAEpG,8DAA8D,GAC9D,OAAO,MAAMW,mBACX,CAACN,UACD,CAAC,EAAEN,KAAK,EAAEC,IAAI,EAAE,EAAE,GAChBJ,eAAeI,MAAMK,SAAQ"}
-6
View File
@@ -1,6 +0,0 @@
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField, } from './access.js';
export { injectRoles } from './injectRoles.js';
export { hasMinimumRole, isAdmin, isEditor } from './predicates.js';
export { buildRolesField } from './rolesField.js';
export type { AccessOption, Role } from './types.js';
export { ROLE_HIERARCHY } from './types.js';
-7
View File
@@ -1,7 +0,0 @@
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField } from './access.js';
export { injectRoles } from './injectRoles.js';
export { hasMinimumRole, isAdmin, isEditor } from './predicates.js';
export { buildRolesField } from './rolesField.js';
export { ROLE_HIERARCHY } from './types.js';
//# sourceMappingURL=index.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/modules/access/index.ts"],"sourcesContent":["export {\n adminOnly,\n adminOnlyField,\n adminOrEditor,\n adminOrEditorField,\n adminOrSelf,\n authenticated,\n requireRole,\n requireRoleField,\n} from './access.js'\nexport { injectRoles } from './injectRoles.js'\nexport { hasMinimumRole, isAdmin, isEditor } from './predicates.js'\nexport { buildRolesField } from './rolesField.js'\nexport type { AccessOption, Role } from './types.js'\nexport { ROLE_HIERARCHY } from './types.js'\n"],"names":["adminOnly","adminOnlyField","adminOrEditor","adminOrEditorField","adminOrSelf","authenticated","requireRole","requireRoleField","injectRoles","hasMinimumRole","isAdmin","isEditor","buildRolesField","ROLE_HIERARCHY"],"mappings":"AAAA,SACEA,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,WAAW,EACXC,aAAa,EACbC,WAAW,EACXC,gBAAgB,QACX,cAAa;AACpB,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,cAAc,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,kBAAiB;AACnE,SAASC,eAAe,QAAQ,kBAAiB;AAEjD,SAASC,cAAc,QAAQ,aAAY"}
-10
View File
@@ -1,10 +0,0 @@
import type { Config } from 'payload';
import type { AccessOption } from './types.js';
/**
* Injects the fixed `roles` field into the client's auth collection.
*
* The plugin owns the role definition; the client owns the collection. This
* finds the collection by slug and appends the field. We control the whole
* stack, so no conflict handling is needed — the field is simply added.
*/
export declare function injectRoles(config: Config, access: AccessOption): Config;
-27
View File
@@ -1,27 +0,0 @@
import { buildRolesField } from './rolesField.js';
/**
* Injects the fixed `roles` field into the client's auth collection.
*
* The plugin owns the role definition; the client owns the collection. This
* finds the collection by slug and appends the field. We control the whole
* stack, so no conflict handling is needed — the field is simply added.
*/ export function injectRoles(config, access) {
const rolesField = buildRolesField(access.defaultRole);
return {
...config,
collections: (config.collections ?? []).map((collection)=>{
if (collection.slug !== access.authCollection) {
return collection;
}
return {
...collection,
fields: [
...collection.fields,
rolesField
]
};
})
};
}
//# sourceMappingURL=injectRoles.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/modules/access/injectRoles.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport type { AccessOption } from './types.js'\n\nimport { buildRolesField } from './rolesField.js'\n\n/**\n * Injects the fixed `roles` field into the client's auth collection.\n *\n * The plugin owns the role definition; the client owns the collection. This\n * finds the collection by slug and appends the field. We control the whole\n * stack, so no conflict handling is needed — the field is simply added.\n */\nexport function injectRoles(config: Config, access: AccessOption): Config {\n const rolesField = buildRolesField(access.defaultRole)\n\n return {\n ...config,\n collections: (config.collections ?? []).map((collection) => {\n if (collection.slug !== access.authCollection) {\n return collection\n }\n return {\n ...collection,\n fields: [...collection.fields, rolesField],\n }\n }),\n }\n}\n"],"names":["buildRolesField","injectRoles","config","access","rolesField","defaultRole","collections","map","collection","slug","authCollection","fields"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kBAAiB;AAEjD;;;;;;CAMC,GACD,OAAO,SAASC,YAAYC,MAAc,EAAEC,MAAoB;IAC9D,MAAMC,aAAaJ,gBAAgBG,OAAOE,WAAW;IAErD,OAAO;QACL,GAAGH,MAAM;QACTI,aAAa,AAACJ,CAAAA,OAAOI,WAAW,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACC;YAC3C,IAAIA,WAAWC,IAAI,KAAKN,OAAOO,cAAc,EAAE;gBAC7C,OAAOF;YACT;YACA,OAAO;gBACL,GAAGA,UAAU;gBACbG,QAAQ;uBAAIH,WAAWG,MAAM;oBAAEP;iBAAW;YAC5C;QACF;IACF;AACF"}

Some files were not shown because too many files have changed in this diff Show More