Compare commits

...
139 Commits
Author SHA1 Message Date
radoslaw.smolinski 91d5e986c5 1.9.7
CI / check (push) Canceled after 0s
2026-10-16 20:53:26 +02:00
radoslaw.smolinskiandClaude Opus 5.5 080086adfe Forms: conditional fields and steps (Show only when)
Every form block (built-in, Checkbox group, Step, message) gets a showWhen
group: visible only when another field has one of the given values. A hidden
Step drops out with its fields; browser and server share visibleFields, so a
hidden field is neither required nor stored. GDPR consent is always enforced.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 20:53:25 +02:00
radoslaw.smolinski 8c1a8b0e8e 1.9.6
CI / check (push) Canceled after 0s
2026-10-16 13:51:33 +02:00
radoslaw.smolinskiandClaude Opus 5.5 002eef56d1 Changelog 1.9.6
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:51:31 +02:00
radoslaw.smolinskiandClaude Opus 5.5 924b5cf8be Markdown route: type-safe locale code read
CI / check (push) Canceled after 0s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:42:17 +02:00
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
radoslaw.smolinski eb436528d4 1.8.13 2026-10-15 15:53:39 +02:00
radoslaw.smolinski 70b676660d Fix turnstile 2026-10-15 15:53:32 +02:00
radoslaw.smolinski 7dc93ac5ed 1.8.12 2026-10-15 15:27:48 +02:00
radoslaw.smolinski 3bab8a0697 Fixed turnstile 2026-10-15 15:27:43 +02:00
radoslaw.smolinski 7ef7927e38 1.8.11 2026-10-14 13:28:12 +02:00
radoslaw.smolinski a7846d9770 mcp and content fix 2026-10-14 13:28:04 +02:00
radoslaw.smolinski 015092e773 1.8.10 2026-10-14 11:32:12 +02:00
radoslaw.smolinski f4d969ad29 Sitemap.xml fixed 2026-10-14 11:32:03 +02:00
radoslaw.smolinski fad5d778e8 1.8.9 2026-10-14 11:06:04 +02:00
radoslaw.smolinski 0f073b963e Added fluid skills support 2026-10-14 11:05:57 +02:00
radoslaw.smolinski 54c2d64cce 1.8.8 2026-10-14 10:41:00 +02:00
radoslaw.smolinski e29c919e5e Fix 2026-10-14 10:40:48 +02:00
radoslaw.smolinski 0f6bbd597b 1.8.7 2026-10-13 23:59:56 +02:00
radoslaw.smolinski 65437a144b Fix for routerhandlers.ts 2026-10-13 23:59:51 +02:00
radoslaw.smolinski e7ad64230a 1.8.6 2026-10-13 23:51:17 +02:00
radoslaw.smolinski 5af5033148 import fix in buildLinkField 2026-10-13 23:51:08 +02:00
radoslaw.smolinski 7572ec0c04 1.8.5 2026-10-13 23:41:13 +02:00
radoslaw.smolinski a24777b915 Sitemap.css is now builded in plugin 2026-10-13 23:41:05 +02:00
radoslaw.smolinski 562e7f2244 1.8.4 2026-10-13 19:07:17 +02:00
radoslaw.smolinski 80d8b7102c Added more agent skills 2026-10-13 19:07:03 +02:00
radoslaw.smolinski 0ccc7e5064 1.8.3 2026-10-13 18:04:46 +02:00
radoslaw.smolinski 3d467d7350 Added module Links 2026-10-13 18:04:37 +02:00
radoslaw.smolinski db05fe814b 1.8.2 2026-10-13 16:25:28 +02:00
radoslaw.smolinski 42df05af28 Added missing LocalView export to client.ts 2026-10-13 16:25:22 +02:00
radoslaw.smolinski 089b3a29ba 1.8.1 2026-10-13 15:58:39 +02:00
radoslaw.smolinski ab16d459ed 1.7.14 2026-10-13 15:58:07 +02:00
radoslaw.smolinski 786dd346a9 Fixed notfound headers, r2storage 2026-10-13 15:57:59 +02:00
radoslaw.smolinski 86c873e4e7 1.8.0 2026-10-13 00:46:04 +02:00
radoslaw.smolinski efe8253f64 Added skills for AGENTS 2026-10-13 00:45:52 +02:00
radoslaw.smolinski c0d9911d90 1.7.12 2026-10-13 00:36:25 +02:00
radoslaw.smolinski 103c796e9d Instruction clarification 2026-10-13 00:36:11 +02:00
radoslaw.smolinski c6f177a37d 1.7.10 2026-10-12 22:31:50 +02:00
radoslaw.smolinski 1a9c51a1fd Add fix for branding 2026-10-12 22:31:40 +02:00
radoslaw.smolinski 7f5ed75f9e 1.7.9 2026-10-12 19:47:37 +02:00
radoslaw.smolinski 4eb2b627f0 Analytics fix 2026-10-12 19:47:31 +02:00
radoslaw.smolinski a92fc02cdf 1.7.8 2026-10-12 17:32:41 +02:00
radoslaw.smolinski 7aebe24236 Added not-found support for sitesettings 2026-10-12 17:32:31 +02:00
radoslaw.smolinski c852d7bdae 1.7.7 2026-10-12 14:47:59 +02:00
radoslaw.smolinski 24fa3fdcdf Security fix for MCP 2026-10-12 14:47:50 +02:00
radoslaw.smolinski 73eacb09c2 1.7.6 2026-10-12 14:35:58 +02:00
radoslaw.smolinski 2665cfa7b6 noindex fix 2026-10-12 14:35:51 +02:00
radoslaw.smolinski 5c466b664c 1.7.4 2026-10-12 13:10:39 +02:00
radoslaw.smolinski 78e2f8fc7f Fixed 2fa and white-label 2026-10-12 13:10:34 +02:00
radoslaw.smolinski 13d669b757 fix(2fa): static import for @clocklimited/payload-2fa and @payload-config alias to prevent webpack runtime error 2026-10-12 12:47:28 +02:00
radoslaw.smolinski a3938cacd9 1.7.2 2026-10-12 12:18:01 +02:00
radoslaw.smolinski 2ef602b3ec 1.7.1 2026-10-12 12:17:53 +02:00
radoslaw.smolinski 1f55c2406e Added white-label support 2026-10-12 12:17:45 +02:00
radoslaw.smolinski 10d1806130 1.7.1 2026-10-11 14:46:56 +02:00
radoslaw.smolinski 6be783bc5a Added better support for GTM, improved accesibility 2026-10-11 14:46:47 +02:00
radoslaw.smolinski fd6fb426b3 1.7.0 2026-10-10 16:52:23 +02:00
radoslaw.smolinski 09925e4cfd feat: v1.7.0 — AI-readability suite, form engine & boilerplate helpers
AI / GEO:
- feat(content): lexicalToMarkdown, blocksToMarkdown, createMarkdownRenderer
  (+markdownResponse) — per-page Markdown for AI agents
- feat(content): markdown content negotiation + discovery (prefersMarkdown, markdownHref)
- feat(seo): buildRobots aiBots policy (allow/block-training/disallow)
- feat(seo): llms-full.txt mode in buildLlmsTxt/createLlmsTxtRoute
- feat(mcp): createMcpRoute — read-only MCP server (search_content, get_page)
- feat(content): searchContent + createSearchRoute — shared JSON search
- feat(seo): buildSpeakableJsonLd + buildSummaryField (aiSummary, auto-fill)

Forms:
- feat(forms): useForm/useContactForm + validators (logic-only, no markup)
- feat(forms): honeypot anti-spam (honeypotInputProps, isHoneypotTripped)

Helpers / hardening:
- feat(i18n): resolveLocalized — replaces ad-hoc getSafeString
- feat(hooks): buildCrossLocaleFieldSync — locales from config, no hardcoded list
- feat(seo): buildNoindexField — checkbox → meta.noindex, no
- feat(content): resolveRedirect — 301/308 from slugHistory
- feat(env): assertEnv + ipalEnvRules — fail-fast env validation
- feat(consent): ConsentScript — load third-party only after consent
- feat(health): createHealthRoute — Coolify/Docker DB liveness

Fixes:
- fix(seo): wrap getCachedPayload in try/catch in createManifestHandler
  (Docker/CI build no longer crashes when DB unreachable)

docs: migration.md (20 sections), new env.md/mcp.md, updated agents.md,
AGENTS-TEMPLATE.md, forms/hooks/content/seo/consent/deployment/richtext
2026-10-10 16:52:16 +02:00
radoslaw.smolinski e6eada5d39 1.6.6 2026-10-10 00:17:23 +02:00
radoslaw.smolinski 1b52060dce Added healhtRoute, honeypot, ConsentScript, asserEnv 2026-10-10 00:17:13 +02:00
radoslaw.smolinski 52977e67fc 1.6.5 2026-10-09 20:18:24 +02:00
radoslaw.smolinski b25f221a50 Added support for crossLocaleFieldSync 2026-10-09 20:18:16 +02:00
radoslaw.smolinski f9d3d9ae97 1.6.4 2026-10-09 19:10:25 +02:00
radoslaw.smolinski 962b9cb640 Fixed buildManifest.ts 2026-10-09 19:10:20 +02:00
radoslaw.smolinski 9b9bbc1a9f 1.6.3 2026-10-09 18:23:18 +02:00
radoslaw.smolinski abf2e7d40f Added form validators 2026-10-09 18:23:08 +02:00
radoslaw.smolinski d500d9412f 1.6.2 2026-10-09 18:00:32 +02:00
radoslaw.smolinski d034ddf990 Security patch for contact 2026-10-09 18:00:24 +02:00
radoslaw.smolinski 2dfacb0414 1.6.1 2026-10-09 17:25:28 +02:00
radoslaw.smolinski eb6efa26f6 Added JsonLdGraph.tsx 2026-10-09 17:25:22 +02:00
radoslaw.smolinski f5a4ceb5bf 1.6.0 2026-10-09 17:02:07 +02:00
radoslaw.smolinski d041fd4bc6 Added languageswitcher, alternatelinkscontext components support 2026-10-09 17:01:52 +02:00
radoslaw.smolinski e232e6d2a5 1.5.7 2026-10-09 16:44:39 +02:00
radoslaw.smolinski c738435fe0 Added richtext support, and helpers for proxy, llms route 2026-10-09 16:44:28 +02:00
radoslaw.smolinski cca2b20c3d 1.5.6 2026-09-28 19:44:34 +02:00
radoslaw.smolinski 105c454d73 Added OG support 2026-09-28 19:44:28 +02:00
radoslaw.smolinski cf6feefebc 1.5.5 2026-09-28 16:47:11 +02:00
radoslaw.smolinski 1857c8f771 Sitemap language normalize trough all websites 2026-09-28 16:47:06 +02:00
radoslaw.smolinski 542ad4ab9c 1.5.4 2026-09-28 16:35:00 +02:00
radoslaw.smolinski 9bf8599116 Fix for plugin.ts 2026-09-28 16:34:54 +02:00
radoslaw.smolinski 170c9a53f1 1.5.3 2026-09-28 16:25:36 +02:00
radoslaw.smolinski e0d5095099 Fix for sitemap.css n2 2026-09-28 16:22:49 +02:00
radoslaw.smolinski 08a8a10478 1.5.2 2026-09-28 16:13:46 +02:00
radoslaw.smolinski 7bbaf14d14 Fixed sitemap.css 2026-09-28 16:13:33 +02:00
radoslaw.smolinski b7d0b01122 1.5.1 2026-09-28 16:01:09 +02:00
radoslaw.smolinski 4627266577 2FA Fix 2026-09-28 16:01:03 +02:00
radoslaw.smolinski 471ec4b12a 1.5.0 2026-09-28 15:49:57 +02:00
radoslaw.smolinski 060a61fd41 Added secuirty 2FA for users 2026-09-28 15:49:36 +02:00
radoslaw.smolinski 7cef95225a 1.4.4 2026-09-28 14:57:54 +02:00
radoslaw.smolinski 0ae62226bc Path fix for sitemap css asset 2026-09-28 14:57:49 +02:00
radoslaw.smolinski 610ab6fdf5 1.4.3 2026-09-28 14:54:30 +02:00
radoslaw.smolinski 81275c0395 Added css asset for sitemap 2026-09-28 14:54:21 +02:00
radoslaw.smolinski 4a46651839 1.4.2 2026-09-28 14:47:19 +02:00
radoslaw.smolinski e7f06548fb Added styling for sitemap generator 2026-09-28 14:47:13 +02:00
radoslaw.smolinski e2a703fc72 1.4.1 2026-09-28 14:29:50 +02:00
radoslaw.smolinski de75d8374d Rebuilded sitemap generator 2026-09-28 14:29:42 +02:00
radoslaw.smolinski b807fbe69a 1.4.0 2026-09-26 22:30:13 +02:00
radoslaw.smolinski 827cd9bcbc Added accessibility support 2026-09-26 22:29:53 +02:00
radoslaw.smolinski fa2b607979 1.3.2 2026-09-26 20:07:35 +02:00
radoslaw.smolinski 4fe690e1e2 Added i18n exports 2026-09-26 20:07:29 +02:00
radoslaw.smolinski 3553daa086 1.3.1 2026-09-26 16:20:40 +02:00
radoslaw.smolinski a4c5bcfbdf Fix buildLlmsTxt.ts 2026-09-26 16:20:31 +02:00
radoslaw.smolinski 026c2696b6 1.3.0 2026-09-25 12:50:35 +02:00
radoslaw.smolinski 6cb4168f44 Turnstile improvement 2026-09-25 12:50:15 +02:00
radoslaw.smolinski b82ef82f50 Added protecting hooks 2026-09-25 12:42:38 +02:00
694 changed files with 25418 additions and 12953 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
+7 -6
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
```
@@ -71,7 +71,7 @@ pnpm add @payloadcms/[email protected] @payloadcms/[email protected] \
> If your project pulls a different major (e.g. `1.x`), you end up with two copies
> and confusing type errors. Pin your project to the same range.
From here, the guide takes over: **[docs/getting-started.md](./docs/getting-started.md)** —
From here, the guide takes over: **[docs/dev/PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** —
from an empty project to a working site.
---
@@ -104,7 +104,7 @@ npm version patch # 1.0.0 → 1.0.1
npm publish
```
Full checklist and troubleshooting: **[docs/publishing.md](./docs/publishing.md)**.
Full checklist and troubleshooting: **[docs/dev/PROGRAMISTA.md §8](./docs/dev/PROGRAMISTA.md)**.
---
@@ -112,9 +112,10 @@ Full checklist and troubleshooting: **[docs/publishing.md](./docs/publishing.md)
Everything lives in the **[docs/](./docs)** directory. To get started:
- **[getting-started.md](./docs/getting-started.md)** — project setup, step by step
- **[publishing.md](./docs/publishing.md)** — releasing new plugin versions
- **[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)
---
@@ -127,5 +128,5 @@ Everything lives in the **[docs/](./docs)** directory. To get started:
| two versions of `lucide-react` | your project pins a different major than the plugin's `^0.400.0` — align them |
| `missing secret key … to secure Payload` | `PAYLOAD_SECRET` isn't set in the runtime environment (not a plugin issue) |
If you get stuck, see **[docs/publishing.md](./docs/publishing.md)** or message the
If you get stuck, see **[docs/dev/PROGRAMISTA.md](./docs/dev/PROGRAMISTA.md)** or message the
team that maintains the plugin.
+61
View File
@@ -0,0 +1,61 @@
#!/usr/bin/env node
// ipal-skills — copies the ipal-kit agent skills into the project.
// pnpm ipal-skills → ./.agents/skills/ipal-*
// pnpm ipal-skills --dry-run → show what would change
// pnpm ipal-skills --dest .claude/skills
// Only folders named ipal-* are touched; the project's own skills stay as they are.
// ipal-* folders that no longer exist in the package are removed (renamed/retired skills).
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from 'node:fs'
import { dirname, join, relative, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
const args = process.argv.slice(2)
if (args.includes('--help') || args.includes('-h')) {
console.log('Usage: ipal-skills [--dest <dir>] [--dry-run]\nDefault dest: .agents/skills')
process.exit(0)
}
const dryRun = args.includes('--dry-run')
const destArg = args.indexOf('--dest')
const dest = resolve(process.cwd(), destArg >= 0 ? args[destArg + 1] ?? '' : '.agents/skills')
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
const src = join(pkgRoot, 'docs', 'agent', 'skills')
if (!existsSync(src)) {
console.error(`ipal-skills: no skills found in ${src} — is @intecion/ipal-kit installed with docs?`)
process.exit(1)
}
const isSkillDir = (base, name) => name.startsWith('ipal-') && statSync(join(base, name)).isDirectory()
const shipped = readdirSync(src).filter((n) => isSkillDir(src, n))
const existing = existsSync(dest) ? readdirSync(dest).filter((n) => isSkillDir(dest, n)) : []
const retired = existing.filter((n) => !shipped.includes(n))
if (!dryRun) mkdirSync(dest, { recursive: true })
for (const name of shipped) {
const action = existing.includes(name) ? 'update' : 'add '
console.log(`${action} ${name}`)
if (!dryRun) {
rmSync(join(dest, name), { recursive: true, force: true }) // drop files removed upstream
cpSync(join(src, name), join(dest, name), { recursive: true })
}
}
for (const name of retired) {
console.log(`remove ${name} (no longer in ipal-kit)`)
if (!dryRun) rmSync(join(dest, name), { recursive: true, force: true })
}
console.log(`${dryRun ? '[dry-run] ' : ''}${shipped.length} skill(s) → ${dest}`)
// Skills ship .ts/.tsx templates and scripts. A Next tsconfig ("include": ["**/*.tsx"]) would
// type-check them as project code and break `tsc` / `next build` → they must be excluded.
const tsconfig = join(process.cwd(), 'tsconfig.json')
const top = relative(process.cwd(), dest).split(/[\\/]/)[0]
if (existsSync(tsconfig) && top && !top.startsWith('..')) {
const text = readFileSync(tsconfig, 'utf8')
const exclude = text.match(/"exclude"\s*:\s*\[([^\]]*)\]/)?.[1] ?? ''
if (!exclude.includes(top)) {
console.warn(`\n⚠ tsconfig.json does not exclude "${top}" — skill templates would be type-checked and break the build.`)
console.warn(` Add it: "exclude": ["node_modules", "${top}"]`)
process.exitCode = 1
}
}
+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,
-16
View File
@@ -1,16 +0,0 @@
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
export { Analytics } from '../modules/analytics/client.js';
/**
* 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 { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext, } from '../modules/consent/client.js';
export type { CookieBannerClassNames } from '../modules/consent/client.js';
export { Turnstile } from '../modules/turnstile/client.js';
export type { TurnstileProps } from '../modules/turnstile/client.js';
export { resolveFormMessage } from '../modules/notifications/resolveFormMessage.js';
export type { FormNotificationTexts } from '../modules/notifications/types.js';
-15
View File
@@ -1,15 +0,0 @@
'use client';
export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js';
export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js';
export { Analytics } from '../modules/analytics/client.js';
/**
* 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 { ConsentProvider, CookieBanner, CookieButton, useConsent, useConsentContext } from '../modules/consent/client.js';
export { Turnstile } from '../modules/turnstile/client.js';
export { resolveFormMessage } from '../modules/notifications/resolveFormMessage.js';
//# sourceMappingURL=client.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport { Analytics } from '../modules/analytics/client.js'\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 ConsentProvider,\n CookieBanner,\n CookieButton,\n useConsent,\n useConsentContext,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\n\nexport { resolveFormMessage } from '../modules/notifications/resolveFormMessage.js'\nexport type { FormNotificationTexts } from '../modules/notifications/types.js'\n"],"names":["MaskedField","TestEmailButton","Analytics","ConsentProvider","CookieBanner","CookieButton","useConsent","useConsentContext","Turnstile","resolveFormMessage"],"mappings":"AAAA;AACA,SAASA,WAAW,QAAQ,wDAAuD;AACnF,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SAASC,SAAS,QAAQ,iCAAgC;AAC1D;;;;;;CAMC,GACD,SACEC,eAAe,EACfC,YAAY,EACZC,YAAY,EACZC,UAAU,EACVC,iBAAiB,QACZ,+BAA8B;AAErC,SAASC,SAAS,QAAQ,iCAAgC;AAG1D,SAASC,kBAAkB,QAAQ,iDAAgD"}
-9
View File
@@ -1,9 +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';
-9
View File
@@ -1,9 +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';
//# 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'\n"],"names":["createLocaleMiddleware","DEFAULT_MIDDLEWARE_MATCHER"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,sBAAsB,EAAEC,0BAA0B,QAAQ,2BAA0B"}
-10
View File
@@ -1,10 +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 { MediaPreconnect } from '../modules/storage/MediaPreconnect.js';
-10
View File
@@ -1,10 +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 { 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 { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'\n"],"names":["RenderBlocks","MediaPreconnect"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA4B;AAOzD,SAASC,eAAe,QAAQ,wCAAuC"}
-17
View File
@@ -1,17 +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 } 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 } 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 } 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","sendEmail","submitForm"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,SAASA,eAAe,QAAQ,gCAA+B;AAC/D,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,UAAU,QAAQ,4BAA2B"}
-7
View File
@@ -1,7 +0,0 @@
import type { Field } from 'payload';
/**
* Fields for the CookieSettings global — GDPR consent banner copy, editable
* per locale. The privacy-policy link is NOT stored here: it comes from the
* pages module (system page role 'privacyPolicy'), keeping one source of truth.
*/
export declare const cookieSettingsFields: Field[];
-87
View File
@@ -1,87 +0,0 @@
import { CONSENT_CATEGORIES } from '../../modules/consent/index.js';
/**
* Fields for the CookieSettings global — GDPR consent banner copy, editable
* per locale. The privacy-policy link is NOT stored here: it comes from the
* pages module (system page role 'privacyPolicy'), keeping one source of truth.
*/ 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: '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/index.js'\n\n/**\n * Fields for the CookieSettings global — GDPR consent banner copy, editable\n * per locale. The privacy-policy link is NOT stored here: it comes from the\n * pages module (system page role 'privacyPolicy'), keeping one source of truth.\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: '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,iCAAgC;AAEnE;;;;CAIC,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,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;
-17
View File
@@ -1,17 +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',
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 access: {\n read: () => true, // texts are public-facing (shown to end users)\n },\n fields: notificationsFields,\n }\n}\n"],"names":["notificationsFields","buildNotifications","slug","label","access","read","fields"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAa;AAEjD;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,OAAO;QACPC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,QAAQN;IACV;AACF"}
@@ -1,3 +0,0 @@
import type { TextFieldClientComponent } from 'payload';
export declare const MaskedField: TextFieldClientComponent;
export default MaskedField;
-54
View File
@@ -1,54 +0,0 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useState } from 'react';
export const MaskedField = (props)=>{
const { field, path, value: propValue, setValue: propSetValue, onChange: propOnChange } = props || {};
const [internalValue, setInternalValue] = useState(propValue ?? '');
const [revealed, setRevealed] = useState(false);
const label = typeof field?.label === 'string' ? field.label : field?.name ?? path;
const handleChange = (e)=>{
const newVal = e.target.value;
setInternalValue(newVal);
if (typeof propSetValue === 'function') {
propSetValue(newVal);
}
if (typeof propOnChange === 'function') {
propOnChange(e);
}
};
const currentValue = propValue !== undefined ? propValue : internalValue;
return /*#__PURE__*/ _jsxs("div", {
className: "field-type text",
children: [
label && /*#__PURE__*/ _jsx("label", {
className: "field-label",
children: label
}),
/*#__PURE__*/ _jsxs("div", {
style: {
display: 'flex',
gap: '.5rem'
},
children: [
/*#__PURE__*/ _jsx("input", {
autoComplete: "off",
onChange: handleChange,
style: {
flex: 1
},
type: revealed ? 'text' : 'password',
value: currentValue ?? ''
}),
/*#__PURE__*/ _jsx("button", {
onClick: ()=>setRevealed((r)=>!r),
type: "button",
children: revealed ? 'Hide' : 'Reveal'
})
]
})
]
});
};
export default MaskedField;
//# sourceMappingURL=MaskedField.js.map
@@ -1 +0,0 @@
{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/MaskedField.tsx"],"sourcesContent":["'use client'\nimport type { TextFieldClientComponent } from 'payload'\nimport { useState } from 'react'\n\nexport const MaskedField: TextFieldClientComponent = (props: any) => {\n const { field, path, value: propValue, setValue: propSetValue, onChange: propOnChange } = props || {}\n const [internalValue, setInternalValue] = useState(propValue ?? '')\n const [revealed, setRevealed] = useState(false)\n const label = typeof field?.label === 'string' ? field.label : (field?.name ?? path)\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newVal = e.target.value\n setInternalValue(newVal)\n if (typeof propSetValue === 'function') {\n propSetValue(newVal)\n }\n if (typeof propOnChange === 'function') {\n propOnChange(e)\n }\n }\n\n const currentValue = propValue !== undefined ? propValue : internalValue\n\n return (\n <div className=\"field-type text\">\n {label && <label className=\"field-label\">{label}</label>}\n <div style={{ display: 'flex', gap: '.5rem' }}>\n <input\n autoComplete=\"off\"\n onChange={handleChange}\n style={{ flex: 1 }}\n type={revealed ? 'text' : 'password'}\n value={currentValue ?? ''}\n />\n <button onClick={() => setRevealed((r) => !r)} type=\"button\">\n {revealed ? 'Hide' : 'Reveal'}\n </button>\n </div>\n </div>\n )\n}\n\nexport default MaskedField\n"],"names":["useState","MaskedField","props","field","path","value","propValue","setValue","propSetValue","onChange","propOnChange","internalValue","setInternalValue","revealed","setRevealed","label","name","handleChange","e","newVal","target","currentValue","undefined","div","className","style","display","gap","input","autoComplete","flex","type","button","onClick","r"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,QAAO;AAEhC,OAAO,MAAMC,cAAwC,CAACC;IACpD,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,OAAOC,SAAS,EAAEC,UAAUC,YAAY,EAAEC,UAAUC,YAAY,EAAE,GAAGR,SAAS,CAAC;IACpG,MAAM,CAACS,eAAeC,iBAAiB,GAAGZ,SAASM,aAAa;IAChE,MAAM,CAACO,UAAUC,YAAY,GAAGd,SAAS;IACzC,MAAMe,QAAQ,OAAOZ,OAAOY,UAAU,WAAWZ,MAAMY,KAAK,GAAIZ,OAAOa,QAAQZ;IAE/E,MAAMa,eAAe,CAACC;QACpB,MAAMC,SAASD,EAAEE,MAAM,CAACf,KAAK;QAC7BO,iBAAiBO;QACjB,IAAI,OAAOX,iBAAiB,YAAY;YACtCA,aAAaW;QACf;QACA,IAAI,OAAOT,iBAAiB,YAAY;YACtCA,aAAaQ;QACf;IACF;IAEA,MAAMG,eAAef,cAAcgB,YAAYhB,YAAYK;IAE3D,qBACE,MAACY;QAAIC,WAAU;;YACZT,uBAAS,KAACA;gBAAMS,WAAU;0BAAeT;;0BAC1C,MAACQ;gBAAIE,OAAO;oBAAEC,SAAS;oBAAQC,KAAK;gBAAQ;;kCAC1C,KAACC;wBACCC,cAAa;wBACbpB,UAAUQ;wBACVQ,OAAO;4BAAEK,MAAM;wBAAE;wBACjBC,MAAMlB,WAAW,SAAS;wBAC1BR,OAAOgB,gBAAgB;;kCAEzB,KAACW;wBAAOC,SAAS,IAAMnB,YAAY,CAACoB,IAAM,CAACA;wBAAIH,MAAK;kCACjDlB,WAAW,SAAS;;;;;;AAK/B,EAAC;AAED,eAAeZ,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', {
body: JSON.stringify({
to: to.trim()
}),
credentials: 'include',
headers: {
'Content-Type': 'application/json'
},
method: 'POST'
});
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: {
fontSize: '.85rem',
marginTop: 0,
opacity: 0.7
},
children: "Sends through the transport selected above. Save your changes first."
}),
/*#__PURE__*/ _jsxs("div", {
style: {
alignItems: 'center',
display: 'flex',
flexWrap: 'wrap',
gap: '.5rem'
},
children: [
/*#__PURE__*/ _jsx("input", {
onChange: (e)=>setTo(e.target.value),
placeholder: "[email protected]",
style: {
flex: 1,
minWidth: '220px'
},
type: "email",
value: to
}),
/*#__PURE__*/ _jsx("button", {
className: "btn btn--style-secondary",
disabled: status.kind === 'sending',
onClick: send,
style: {
whiteSpace: 'nowrap'
},
type: "button",
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: 'error'; msg: string }\n | { kind: 'idle' }\n | { kind: 'ok'; msg: string }\n | { kind: 'sending' }\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 body: JSON.stringify({ to: to.trim() }),\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\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={{ fontSize: '.85rem', marginTop: 0, opacity: 0.7 }}>\n Sends through the transport selected above. Save your changes first.\n </p>\n <div style={{ alignItems: 'center', display: 'flex', flexWrap: 'wrap', gap: '.5rem' }}>\n <input\n onChange={(e) => setTo(e.target.value)}\n placeholder=\"[email protected]\"\n style={{ flex: 1, minWidth: '220px' }}\n type=\"email\"\n value={to}\n />\n <button\n className=\"btn btn--style-secondary\"\n disabled={status.kind === 'sending'}\n onClick={send}\n style={{ whiteSpace: 'nowrap' }}\n type=\"button\"\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","body","JSON","stringify","credentials","headers","method","data","json","ok","message","error","div","className","style","marginTop","label","p","fontSize","opacity","alignItems","display","flexWrap","gap","input","onChange","e","target","value","placeholder","flex","minWidth","type","button","disabled","onClick","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,SAK1B;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,MAAMC,KAAKC,SAAS,CAAC;oBAAEZ,IAAIA,GAAGM,IAAI;gBAAG;gBACrCO,aAAa;gBACbC,SAAS;oBAAE,gBAAgB;gBAAmB;gBAC9CC,QAAQ;YACV;YACA,MAAMC,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,UAAU;oBAAUH,WAAW;oBAAGI,SAAS;gBAAI;0BAAG;;0BAG9D,MAACP;gBAAIE,OAAO;oBAAEM,YAAY;oBAAUC,SAAS;oBAAQC,UAAU;oBAAQC,KAAK;gBAAQ;;kCAClF,KAACC;wBACCC,UAAU,CAACC,IAAMlC,MAAMkC,EAAEC,MAAM,CAACC,KAAK;wBACrCC,aAAY;wBACZf,OAAO;4BAAEgB,MAAM;4BAAGC,UAAU;wBAAQ;wBACpCC,MAAK;wBACLJ,OAAOrC;;kCAET,KAAC0C;wBACCpB,WAAU;wBACVqB,UAAUzC,OAAOE,IAAI,KAAK;wBAC1BwC,SAASvC;wBACTkB,OAAO;4BAAEsB,YAAY;wBAAS;wBAC9BJ,MAAK;kCAEJvC,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"}
-6
View File
@@ -1,6 +0,0 @@
import type { Field } from 'payload';
/**
* Analytics configuration — GA4 measurement ID and GTM container ID.
* IDs are public (exposed client-side), so no read restriction needed.
*/
export declare const analyticsFields: Field[];
-23
View File
@@ -1,23 +0,0 @@
/**
* Analytics configuration — GA4 measurement ID and GTM container ID.
* IDs are public (exposed client-side), so no read restriction needed.
*/ export const analyticsFields = [
{
name: 'ga4MeasurementId',
type: 'text',
admin: {
description: 'Google Analytics 4 Measurement ID.',
placeholder: 'G-XXXXXXXXXX'
}
},
{
name: 'gtmContainerId',
type: 'text',
admin: {
description: 'Google Tag Manager container ID.',
placeholder: 'GTM-XXXXXXX'
}
}
];
//# 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 configuration — GA4 measurement ID and GTM container ID.\n * IDs are public (exposed client-side), so no read restriction needed.\n */\nexport const analyticsFields: Field[] = [\n {\n name: 'ga4MeasurementId',\n type: 'text',\n admin: {\n description: 'Google Analytics 4 Measurement ID.',\n placeholder: 'G-XXXXXXXXXX',\n },\n },\n {\n name: 'gtmContainerId',\n type: 'text',\n admin: {\n description: 'Google Tag Manager container ID.',\n placeholder: 'GTM-XXXXXXX',\n },\n },\n]\n"],"names":["analyticsFields","name","type","admin","description","placeholder"],"mappings":"AAEA;;;CAGC,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;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[];
-94
View File
@@ -1,94 +0,0 @@
/**
* 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 = [
{
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'
}
}
}
];
//# 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\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 {\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]\n"],"names":["smtpFields","name","type","admin","description","defaultValue","options","label","value","condition","_","siblingData","emailTransport","fields","placeholder","width","components","Field"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,aAAsB;IACjC;QACEC,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;CACD,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[];
-29
View File
@@ -1,29 +0,0 @@
/**
* 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 = [
{
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'
}
}
}
];
//# 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\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 {\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]\n"],"names":["turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA;;;;;;;CAOC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,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;CACD,CAAA"}
-23
View File
@@ -1,23 +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).
*
* Note: R2 storage credentials are NOT here — storage is infrastructure and
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
* consumed by buildR2Storage. See docs/storage.md.
*/
export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig;
export {};
-61
View File
@@ -1,61 +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).
*
* Note: R2 storage credentials are NOT here — storage is infrastructure and
* binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),
* consumed by buildR2Storage. See docs/storage.md.
*/ 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'
}
] : []
]
}
],
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 *\n * Note: R2 storage credentials are NOT here — storage is infrastructure and\n * binds at boot, so its config lives in .env (R2_BUCKET, R2_ENDPOINT, ...),\n * consumed by buildR2Storage. See docs/storage.md.\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 ? [{ fields: additionalFields, label: 'Custom' }] : []),\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"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;;;;;CAeC,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,SAAS;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,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"}
-47
View File
@@ -1,47 +0,0 @@
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 { AnalyticsConfig } from './modules/analytics/index.js';
export { getAnalyticsConfig } from './modules/analytics/index.js';
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent, } from './modules/consent/index.js';
export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js';
export type { ContentCollectionOption, ContentOption, ResolvedRoute, } from './modules/content/index.js';
export { archiveFieldName, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute, } from './modules/content/index.js';
export type { ArchiveEntries } from './modules/content/index.js';
export { graphAdapter } from './modules/email/graphAdapter.js';
export type { GraphAdapterArgs } from './modules/email/graphAdapter.js';
export { mailAdapter } from './modules/email/mailAdapter.js';
export type { MailAdapterArgs } from './modules/email/mailAdapter.js';
export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js';
export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js';
export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption, } from './modules/forms/types.js';
export { createContentHelpers } from './modules/frontend/index.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 { LocaleMiddlewareResult } from './modules/i18n/index.js';
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
export { normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage, } from './modules/notifications/index.js';
export type { FormNotificationTexts, NotificationTexts } from './modules/notifications/index.js';
export type { PagesOption, SystemPageRole } from './modules/pages/index.js';
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
export type { GlobalQueryOptions } from './modules/payload/index.js';
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG, } from './modules/payload/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 type { BuildSecurityHeadersArgs, SecurityHeader } from './modules/security/index.js';
export type { PageMetadata, SeoMeta, SeoOption } from './modules/seo/index.js';
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
export type { AutoFillMapping, RobotsRules, SitemapEntry } from './modules/seo/index.js';
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta, } from './modules/seo/index.js';
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField, } from './modules/seo/index.js';
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd, } from './modules/seo/index.js';
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd, } from './modules/seo/index.js';
export { buildArticleJsonLd } from './modules/seo/index.js';
export { buildSitemapXml } from './modules/seo/index.js';
export { buildLlmsTxt } from './modules/seo/index.js';
export { buildSlugField, toSlug } from './modules/slug/index.js';
export { buildR2Storage } from './modules/storage/index.js';
export { ipalKit } from './plugin.js';
export type { IpalOptions } from './types.js';
-34
View File
@@ -1,34 +0,0 @@
export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js';
export { getAnalyticsConfig } from './modules/analytics/index.js';
export { ACCEPT_ALL_CONSENT, CONSENT_CATEGORIES, CONSENT_COOKIE, CONSENT_MAX_AGE, CONSENT_VERSION, DEFAULT_CONSENT, getConsentTexts, parseConsent, REJECT_ALL_CONSENT, serializeConsent, setDefaultConsent, updateConsent } from './modules/consent/index.js';
export { archiveFieldName, buildArchivePath, buildEntryPath, getArchiveEntries, parsePageParam, resolveRoute } from './modules/content/index.js';
export { graphAdapter } from './modules/email/graphAdapter.js';
export { mailAdapter } from './modules/email/mailAdapter.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 { buildFormsPlugin } from './modules/forms/formsPluginConfig.js';
export { createContentHelpers } from './modules/frontend/index.js';
export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js';
export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js';
export { normalizeFilename, normalizeFilenameHook } from './modules/media/index.js';
export { getNotificationTexts, NOTIFICATION_FALLBACK, resolveFormMessage } from './modules/notifications/index.js';
export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js';
export { getGlobal, getSiteIntegrations, getSiteSettings, SITE_INTEGRATIONS_SLUG, SITE_SETTINGS_SLUG } from './modules/payload/index.js';
export { buildSecurityHeaders } from './modules/security/index.js';
export { buildCsp } from './modules/security/index.js';
export { buildHreflangAlternates, buildMetadata, composeTitle } from './modules/seo/index.js';
export { buildAutoFillMetaHook, buildRobots, buildSitemapEntries, createMetadataGenerator, createPageMetadata, injectAutoFillMeta } from './modules/seo/index.js';
export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js';
export { buildBreadcrumbJsonLd, buildSiteNavigationJsonLd, buildWebSiteJsonLd } from './modules/seo/index.js';
// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.
export { buildFaqJsonLd, buildLocalBusinessJsonLd, buildServiceJsonLd } from './modules/seo/index.js';
export { buildArticleJsonLd } from './modules/seo/index.js';
export { buildSitemapXml } from './modules/seo/index.js';
export { buildLlmsTxt } from './modules/seo/index.js';
export { buildSlugField, toSlug } from './modules/slug/index.js';
export { buildR2Storage } from './modules/storage/index.js';
export { ipalKit } from './plugin.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"}
-20
View File
@@ -1,20 +0,0 @@
import type { Role } from './types.js';
/**
* The plugin can't know the client's generated User type, and Payload types
* `req.user` loosely (UntypedUser | null). Predicates therefore accept an
* unknown-ish user and read `roles` defensively — no assumptions about shape
* beyond an optional roles array.
*/
type MaybeUser = {
roles?: null | Role[];
} | null | Record<string, unknown> | undefined;
/**
* True if the user holds at least the given role in the hierarchy.
* admin satisfies 'editor' and 'user'; editor satisfies 'user'.
*/
export declare function hasMinimumRole(user: MaybeUser, minimum: Role): boolean;
/** True if the user is an admin. */
export declare function isAdmin(user: MaybeUser): boolean;
/** True if the user is an editor or higher (editor, admin). */
export declare function isEditor(user: MaybeUser): boolean;
export {};
-32
View File
@@ -1,32 +0,0 @@
import { ROLE_HIERARCHY } from './types.js';
/** Safely extracts the roles array from a loosely-typed user. */ function getRoles(user) {
if (!user || typeof user !== 'object') {
return [];
}
const roles = user.roles;
if (!Array.isArray(roles)) {
return [];
}
return roles.filter((role)=>ROLE_HIERARCHY.includes(role));
}
/** Highest-privilege role index the user holds, or -1 if none. */ function highestRoleIndex(user) {
const roles = getRoles(user);
if (!roles.length) {
return -1;
}
return Math.max(...roles.map((role)=>ROLE_HIERARCHY.indexOf(role)));
}
/**
* True if the user holds at least the given role in the hierarchy.
* admin satisfies 'editor' and 'user'; editor satisfies 'user'.
*/ export function hasMinimumRole(user, minimum) {
return highestRoleIndex(user) >= ROLE_HIERARCHY.indexOf(minimum);
}
/** True if the user is an admin. */ export function isAdmin(user) {
return hasMinimumRole(user, 'admin');
}
/** True if the user is an editor or higher (editor, admin). */ export function isEditor(user) {
return hasMinimumRole(user, 'editor');
}
//# sourceMappingURL=predicates.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/modules/access/predicates.ts"],"sourcesContent":["import type { Role } from './types.js'\n\nimport { ROLE_HIERARCHY } from './types.js'\n\n/**\n * The plugin can't know the client's generated User type, and Payload types\n * `req.user` loosely (UntypedUser | null). Predicates therefore accept an\n * unknown-ish user and read `roles` defensively — no assumptions about shape\n * beyond an optional roles array.\n */\ntype MaybeUser = { roles?: null | Role[] } | null | Record<string, unknown> | undefined\n\n/** Safely extracts the roles array from a loosely-typed user. */\nfunction getRoles(user: MaybeUser): Role[] {\n if (!user || typeof user !== 'object') {return []}\n const roles = (user as { roles?: unknown }).roles\n if (!Array.isArray(roles)) {return []}\n return roles.filter((role): role is Role => ROLE_HIERARCHY.includes(role as Role))\n}\n\n/** Highest-privilege role index the user holds, or -1 if none. */\nfunction highestRoleIndex(user: MaybeUser): number {\n const roles = getRoles(user)\n if (!roles.length) {return -1}\n return Math.max(...roles.map((role) => ROLE_HIERARCHY.indexOf(role)))\n}\n\n/**\n * True if the user holds at least the given role in the hierarchy.\n * admin satisfies 'editor' and 'user'; editor satisfies 'user'.\n */\nexport function hasMinimumRole(user: MaybeUser, minimum: Role): boolean {\n return highestRoleIndex(user) >= ROLE_HIERARCHY.indexOf(minimum)\n}\n\n/** True if the user is an admin. */\nexport function isAdmin(user: MaybeUser): boolean {\n return hasMinimumRole(user, 'admin')\n}\n\n/** True if the user is an editor or higher (editor, admin). */\nexport function isEditor(user: MaybeUser): boolean {\n return hasMinimumRole(user, 'editor')\n}\n"],"names":["ROLE_HIERARCHY","getRoles","user","roles","Array","isArray","filter","role","includes","highestRoleIndex","length","Math","max","map","indexOf","hasMinimumRole","minimum","isAdmin","isEditor"],"mappings":"AAEA,SAASA,cAAc,QAAQ,aAAY;AAU3C,+DAA+D,GAC/D,SAASC,SAASC,IAAe;IAC/B,IAAI,CAACA,QAAQ,OAAOA,SAAS,UAAU;QAAC,OAAO,EAAE;IAAA;IACjD,MAAMC,QAAQ,AAACD,KAA6BC,KAAK;IACjD,IAAI,CAACC,MAAMC,OAAO,CAACF,QAAQ;QAAC,OAAO,EAAE;IAAA;IACrC,OAAOA,MAAMG,MAAM,CAAC,CAACC,OAAuBP,eAAeQ,QAAQ,CAACD;AACtE;AAEA,gEAAgE,GAChE,SAASE,iBAAiBP,IAAe;IACvC,MAAMC,QAAQF,SAASC;IACvB,IAAI,CAACC,MAAMO,MAAM,EAAE;QAAC,OAAO,CAAC;IAAC;IAC7B,OAAOC,KAAKC,GAAG,IAAIT,MAAMU,GAAG,CAAC,CAACN,OAASP,eAAec,OAAO,CAACP;AAChE;AAEA;;;CAGC,GACD,OAAO,SAASQ,eAAeb,IAAe,EAAEc,OAAa;IAC3D,OAAOP,iBAAiBP,SAASF,eAAec,OAAO,CAACE;AAC1D;AAEA,kCAAkC,GAClC,OAAO,SAASC,QAAQf,IAAe;IACrC,OAAOa,eAAeb,MAAM;AAC9B;AAEA,6DAA6D,GAC7D,OAAO,SAASgB,SAAShB,IAAe;IACtC,OAAOa,eAAeb,MAAM;AAC9B"}
-9
View File
@@ -1,9 +0,0 @@
import type { Field } from 'payload';
import type { Role } from './types.js';
/**
* Builds the fixed `roles` field the plugin injects into the auth collection.
*
* Saved to the JWT so role checks avoid a database lookup. Only admins can
* change roles, preventing privilege escalation by lower-privilege users.
*/
export declare function buildRolesField(defaultRole?: Role): Field;
-32
View File
@@ -1,32 +0,0 @@
import { isAdmin } from './predicates.js';
import { ROLE_HIERARCHY } from './types.js';
/**
* Builds the fixed `roles` field the plugin injects into the auth collection.
*
* Saved to the JWT so role checks avoid a database lookup. Only admins can
* change roles, preventing privilege escalation by lower-privilege users.
*/ export function buildRolesField(defaultRole = 'user') {
return {
name: 'roles',
type: 'select',
access: {
// Only admins may assign or change roles
update: ({ req: { user } })=>isAdmin(user)
},
admin: {
description: 'Role hierarchy: admin > editor > user.'
},
defaultValue: [
defaultRole
],
hasMany: true,
options: ROLE_HIERARCHY.map((role)=>({
label: role.charAt(0).toUpperCase() + role.slice(1),
value: role
})),
required: true,
saveToJWT: true
};
}
//# sourceMappingURL=rolesField.js.map
-1
View File
@@ -1 +0,0 @@
{"version":3,"sources":["../../../src/modules/access/rolesField.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport type { Role } from './types.js'\n\nimport { isAdmin } from './predicates.js'\nimport { ROLE_HIERARCHY } from './types.js'\n\n/**\n * Builds the fixed `roles` field the plugin injects into the auth collection.\n *\n * Saved to the JWT so role checks avoid a database lookup. Only admins can\n * change roles, preventing privilege escalation by lower-privilege users.\n */\nexport function buildRolesField(defaultRole: Role = 'user'): Field {\n return {\n name: 'roles',\n type: 'select',\n access: {\n // Only admins may assign or change roles\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n description: 'Role hierarchy: admin > editor > user.',\n },\n defaultValue: [defaultRole],\n hasMany: true,\n options: ROLE_HIERARCHY.map((role) => ({\n label: role.charAt(0).toUpperCase() + role.slice(1),\n value: role,\n })),\n required: true,\n saveToJWT: true,\n }\n}\n"],"names":["isAdmin","ROLE_HIERARCHY","buildRolesField","defaultRole","name","type","access","update","req","user","admin","description","defaultValue","hasMany","options","map","role","label","charAt","toUpperCase","slice","value","required","saveToJWT"],"mappings":"AAIA,SAASA,OAAO,QAAQ,kBAAiB;AACzC,SAASC,cAAc,QAAQ,aAAY;AAE3C;;;;;CAKC,GACD,OAAO,SAASC,gBAAgBC,cAAoB,MAAM;IACxD,OAAO;QACLC,MAAM;QACNC,MAAM;QACNC,QAAQ;YACN,yCAAyC;YACzCC,QAAQ,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKT,QAAQS;QACzC;QACAC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;YAACT;SAAY;QAC3BU,SAAS;QACTC,SAASb,eAAec,GAAG,CAAC,CAACC,OAAU,CAAA;gBACrCC,OAAOD,KAAKE,MAAM,CAAC,GAAGC,WAAW,KAAKH,KAAKI,KAAK,CAAC;gBACjDC,OAAOL;YACT,CAAA;QACAM,UAAU;QACVC,WAAW;IACb;AACF"}

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