From 0a2374db180d66bdde242892f387c8e1ea45f5bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Smoli=C5=84ski?= Date: Tue, 27 Oct 2026 15:46:25 +0100 Subject: [PATCH] Docs: admin languages and texts, wording rule for agents, new screen names Co-Authored-By: Claude Opus 5.5 --- docs/access.md | 6 +- docs/accessibility.md | 2 + docs/agent/AGENT.md | 86 +++++++++++-------- docs/agent/skills/ipal-block/SKILL.md | 5 +- docs/agent/skills/ipal-collection/SKILL.md | 7 +- docs/agent/skills/ipal-consent-check/SKILL.md | 22 ++--- docs/agent/skills/ipal-debug/SKILL.md | 4 +- docs/agent/skills/ipal-form/SKILL.md | 10 +-- docs/agent/skills/ipal-locale-add/SKILL.md | 10 +-- docs/agent/skills/ipal-nav/SKILL.md | 6 +- .../skills/ipal-nav/resources/nav-code.md | 6 +- docs/agent/skills/ipal-reference/SKILL.md | 65 +++++++------- .../skills/ipal-reference/resources/api.md | 50 ++++++----- docs/agent/skills/ipal-seo-check/SKILL.md | 6 +- docs/agent/skills/ipal-setup/SKILL.md | 36 ++++---- docs/agent/skills/ipal-site/SKILL.md | 14 +-- docs/agent/skills/ipal-upgrade/SKILL.md | 16 ++-- docs/analytics.md | 6 +- docs/consent.md | 25 +++--- docs/construction.md | 10 +-- docs/content.md | 10 +-- docs/cookie-scanner.md | 40 ++++----- docs/deployment.md | 14 +-- docs/dev/PROGRAMISTA.md | 48 +++++------ docs/dev/admin-ux.md | 51 +++++------ docs/dev/vibe.md | 8 +- docs/email.md | 20 ++--- docs/env.md | 2 +- docs/forms.md | 17 ++-- docs/frontend.md | 12 +-- docs/gtm-meta-pixel.md | 6 +- docs/hooks.md | 8 +- docs/i18n.md | 40 +++++++++ docs/integrations.md | 24 ++++-- docs/lightbox.md | 8 +- docs/links.md | 6 +- docs/mcp.md | 6 +- docs/notifications.md | 7 +- docs/pages.md | 12 +-- docs/payload-helpers.md | 4 +- docs/security.md | 2 +- docs/seo.md | 42 ++++----- docs/stats.md | 4 +- docs/theme.md | 10 +-- docs/turnstile.md | 10 +-- 45 files changed, 443 insertions(+), 360 deletions(-) diff --git a/docs/access.md b/docs/access.md index 7f204ae..d1931c4 100644 --- a/docs/access.md +++ b/docs/access.md @@ -41,8 +41,8 @@ only checks that someone is logged in. | Resource | Read | Write | How to change | |---|---|---|---| | auth collection **injected** by the plugin, with roles | admin: everyone; others: only themselves | `create` / `delete` / `unlock`: admin; `update`: admin or self | `access.authAccess`, or your own collection | -| Site Settings, Cookie Settings, Notifications | public | `editor+` | `globalOverrides` | -| Site Integrations | admin | admin | `globalOverrides` | +| Site settings, Cookie banner, Notifications | public | `editor+` | `globalOverrides` | +| Site integrations | admin | admin | `globalOverrides` | | Forms | public (Emails tab only `editor+`) | `editor+` | `forms.formOverrides.access`, the Emails field in `formOverrides.fields` | | Form submissions | `editor+` | REST `create`: logged-in users; `delete`: admin | `forms.formSubmissionOverrides.access` | @@ -66,7 +66,7 @@ keeps Payload's default rules — without roles all accounts are equal. > **Without `access` there is no `roles` field**, so `isAdmin` always returns `false`. The plugin's own > staff features therefore check with `userMeetsRole(req, minimum)`: when the user's auth collection has no > `roles` field, every logged-in account passes (as in Payload's default — without roles all accounts are -> equal). That keeps Site Integrations, the settings globals, `/api/ipal/test-email`, stats, consent records +> equal). That keeps Site integrations, the settings globals, `/api/ipal/test-email`, stats, consent records > and form submissions reachable. To narrow them without roles: `globalOverrides` for the globals, > `forms.formSubmissionOverrides` for submissions, or add `access` to get roles. diff --git a/docs/accessibility.md b/docs/accessibility.md index 7658a1f..27d8c1e 100644 --- a/docs/accessibility.md +++ b/docs/accessibility.md @@ -166,6 +166,8 @@ The provider re-applies and syncs on the client anyway. This only removes the fl ### State and attributes (`A11yState`) Cookie `a11y-prefs` (`A11Y_COOKIE`, JSON, `path=/`, `max-age` 1 year, `samesite=lax`). +Widget texts: `texts` prop wins, otherwise `A11Y_DEFAULT_TEXTS[locale]` (`en`, `pl`; prop `locale`, +incl. `texts.on` / `texts.off` for the switches). The helpers `A11Y_COOKIE`, `A11Y_DEFAULT`, `parseA11y`, `serializeA11y`, `a11yAttributes` are in `@intecion/ipal-kit` (not in `/client`). The `A11yState` type is in both entries. diff --git a/docs/agent/AGENT.md b/docs/agent/AGENT.md index 400c50f..b9562d7 100644 --- a/docs/agent/AGENT.md +++ b/docs/agent/AGENT.md @@ -62,7 +62,8 @@ Write new rules, AGENTS.md entries and plugin-gap reports in English. 6. **A section = a composition of UI primitives.** `buildLinksField()` + ``, upload + ``, `
` + ``. No `ctaLabel`/`pdfUrl` fields. **A clear panel** (§6.5a): repeated items = an "+ Add …" array with `rowLabel`, never - `cta1`/`cta2`; labels in English, short; no empty "just in case" fields. + `cta1`/`cta2`; labels short and in the panel's languages (`{ en, pl }`, guide + `docs/dev/admin-ux.md`); no empty "just in case" fields. 7. **Renderers from the plugin:** `RenderBlocks` (not a `switch`), `RenderRichText` (not your own Lexical parser), `useForm` (not hand-made form plumbing). 8. **No `any` and no `@ts-ignore`.** Types from `@/payload-types`, `unknown` + guard. @@ -96,21 +97,21 @@ site), **P** = a test in the panel. Full code: PROGRAMISTA.md §2. | # | Area | What must exist (file) | Plugin API | Check | |---|---|---|---|---| | 1 | i18n + routing | `src/proxy.ts`, `[locale]/[[...slug]]/page.tsx` = `createPageRoute(content, {…})` + a literal `revalidate`, `not-found.tsx` = `createNotFoundPage(content, { load })` + `notFoundView.ts` (`renderNotFoundView`) | `createProxy`, `createContentHelpers`, `createPageRoute`, `createNotFoundPage` (`/rsc`) | A, S | -| 2 | **SEO** — meta | `generateMetadata` in every page route; favicon and OG from Site Settings; `htmlLimitedBots` in `next.config.ts`; SEO tab + `buildNoindexField` in Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S | +| 2 | **SEO** — meta | `generateMetadata` in every page route; favicon and OG from Site settings; `htmlLimitedBots` in `next.config.ts`; SEO tab + `buildNoindexField` in Pages | `generatePageMetadata`, `buildIconsMetadata`, `buildNoindexField` | A, S | | 3 | **SEO** — maps | `src/app/sitemap.xml/route.ts` (`export { sitemapRoute as GET }` + `force-dynamic`), `src/app/robots.ts` (`export { getRobots as default }` + `force-dynamic` — AI bots from the panel), `src/app/manifest.ts` — re-exports from `lib/content` | `sitemapRoute`, `getRobots` (or `robots` without the panel), `manifest` | A, S | -| 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site Settings → Search & AI** (Google, Bing, Yandex), `generatePageMetadata` adds the `` itself; sitemap `https:///sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P | -| 4 | **SEO** — structured data | layout: `` gives `WebSite` + `Organization` (`sameAs`) from Site Settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: ``; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S | +| 3a | **Search Console / Bing** | recommended: **domain verification via DNS** (TXT record, deployment.md §6) — the plugin does nothing, the verification fields stay empty; only for URL-prefix verification: code in **Site settings → Search engines** (Google, Bing, Yandex), `generatePageMetadata` adds the `` itself; sitemap `https:///sitemap.xml` submitted in GSC and Bing | panel (optional), `verificationFrom` | P | +| 4 | **SEO** — structured data | layout: `` gives `WebSite` + `Organization` (`sameAs`) from Site settings; local business → `createContentHelpers({ siteJsonLd })` with `buildLocalBusinessJsonLd` (`type`, hours → `formatOpeningHours`); navigation: ``; page: `createPageRoute` adds `getPageJsonLd` (WebPage/BlogPosting, breadcrumbs, FAQ — `pageJsonLd: { faq }`) | `getSiteShell`, `SiteProviders`, `build*JsonLd`, `getPageJsonLd` | A, S | | 5 | **GEO** — llms | `src/app/llms.txt/route.ts` (`llmsRoute`) and `src/app/llms-full.txt/route.ts` (`llmsFullRoute`) from `lib/content`; the `buildSummaryField()` field in Pages, `summaryField: 'aiSummary'` in `createContentHelpers` | `llmsRoute`, `llmsFullRoute`, `buildSummaryField` | A, S | | 6 | **GEO** — Markdown | `src/app/md/[locale]/[[...slug]]/route.ts` (single-language: `src/app/md/[[...slug]]/route.ts`) = `export { markdownRoute as GET } from '@/lib/content'`; `createContentHelpers({ markdownAlternate: true })` (link in ``); `createProxy(…, { NextResponse, markdown: true })` (without it `/md/…` gets redirected to a language) | `markdownRoute`, `markdownAlternate`, `createProxy({ markdown })` | A, S | | 7 | **GEO** — MCP | `src/app/api/mcp/route.ts` = `export { mcpGET as GET, mcpPOST as POST } from '@/lib/content'` (public — AI browses the site: `get_site_info`, `list_pages`, `search_content`, `get_page`); name: `createContentHelpers({ mcp: { serverName } })` | `mcpGET`, `mcpPOST` | A, S | -| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site Settings → Search & AI → AI crawlers (works only with `getRobots`); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IPAL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S | +| 8 | **GEO** — AI bots + IndexNow | robots **lets in** AI bots (default `aiBots: 'allow'`; block only on a client decision); AI bot policy and per-bot exceptions — Site settings → Search engines → AI assistants (works only with `getRobots`); `ipalKit({ indexNow: true })` + `src/app/indexnow-key.txt/route.ts` (`indexNowKeyRoute`; publishing → Bing/ChatGPT Search within minutes; IndexNow sends nothing with `IPAL_NOINDEX=1`) | `buildRobots`, `getRobots`, `indexNowKeyRoute` | A, S | | 9 | **Media / R2 / speed** | `Media` with `focalPoint`, `normalizeFilenameHook`, `buildOptimizeUploadHook`, `buildMediaPlaceholderHook` + field; **always** `buildR2Storage(['media'], { s3Storage })` + `@payloadcms/storage-s3`; `R2_*` in `.env.example`; ``; `images: buildImagesConfig()` and `buildUploadSecurityHeaders()` in `next.config.ts`; the project's `` via `mediaImageProps`/`videoProps` (§6.11b) | `buildR2Storage`, `mediaImageProps`, `videoProps`, `buildImagesConfig` | A, S | | 10 | **Forms** | every form from a **seed** (`scripts/seed-form-*.ts`: fields, confirmation, mail to the company **and** confirmation to the customer, every language); a block with `` + `formClasses.ts` (look, once); `actions.ts` = `createSubmitAction({ getCachedPayload, headers })`; `forms: {…}` in `ipalKit`; `email: mailAdapter()` | `RenderForm` (`/rsc`), `createSubmitAction`, `mailAdapter` | A, P | -| 11 | **Turnstile** | `` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site Integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P | -| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `ipalKit({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → the editor accepts; or cookie-scan → import) — feeds `` on the policy page **and** the lists in the `detailed` window; Cookie Settings → Detail labels in every language | consent.md, analytics.md | A, `ipal-consent-check` | +| 11 | **Turnstile** | `` in `[locale]/layout.tsx` (wires `TurnstileProvider` with the key from the panel); `RenderForm` renders the widget; keys in Site integrations | `SiteProviders`, `getTurnstileConfig`, `TurnstileProvider` | A, P | +| 12 | Consent + analytics | Consent Mode: `'advanced'` (default — the Google tag loads at once with every signal `denied`) or `'basic'` (`` — no request to Google before consent; a client who wants zero requests), the choice goes to "Project decisions"; `ipalKit({ consentLog: true })` (without it the `/api/ipal/consent` endpoint does not exist) + `}>` (ConsentProvider, banner, CookieButton, Analytics in the right order); settings window mode (`settings`: `inline` / `modal` / `detailed`) per the design, brief is silent → `detailed`, the decision goes to "Project decisions"; tool IDs in the panel; the cookie list from a scan (`cookieScanner: true` → *Cookie review* → **Scan cookies** → the editor accepts; or cookie-scan → import) — feeds `` on the policy page **and** the lists in the `detailed` window; Cookie banner → Settings window → Cookie list headings in every language | consent.md, analytics.md | A, `ipal-consent-check` | | 13 | Security | `buildSecurityHeaders` in `next.config.ts`; `twoFactor: { issuer, plugin: payloadTotp }`; CSP `report-only` → `enforce`; `IPAL_IP_HEADER` in production | security.md, forms.md | A | | 14 | Operations | `src/app/api/health/route.ts` (`healthRoute`); `src/instrumentation.ts` with `assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))`; staging with `IPAL_NOINDEX=1`; smoke tests (§8a) | `healthRoute`, `assertEnv`, `ipalEnvRules` | A | -| 15 | System pages | Site Settings → System Pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P | +| 15 | System pages | Site settings → System pages: homepage, 404, privacy policy, cookies; legal links in the footer by role (`getSystemLinks(locale)`) | `getSystemLinks`, `getSystemPagePath`, `getNotFoundPage` | P | | 16 | **Nothing hardcoded** | every text, link, image, file, company data from the panel; domains and keys from `.env` (§2) | — | A, P | | 17 | **Content** | one h1, the answer at the start of each section, facts, internal links, FAQ from real questions, `aiSummary`, sameAs, consistent company data (§0c) | — | S, P | | 18 | **Scaling** | `fluid.css` / `fluid-wide.css`, hero on `--ipal-hero-min-h`, the screen list in §6.11a (including 1366×768) | — | A, browser | @@ -132,9 +133,9 @@ Do not make the provider or the widget conditional in code — always wire them. | reCAPTCHA, hCaptcha, your own captcha | a second mechanism, no status in the panel | Turnstile from the plugin | | a hand-written `` in a block on a staging page → the next crawl reports `_fbp` as a violation and the dashboard shows the warning. @@ -274,10 +274,10 @@ ipalKit({ | Violation (cookie or key) | seen **before consent** and its review entry's category is not `necessary` — an entry without a category counts too, until an editor classifies it | | Violation (request) | a request **before consent** to a tracker host (`DEFAULT_TRACKER_HOSTS`: Meta, LinkedIn, TikTok, Clarity, Bing, Hotjar, YouTube). Google's tag hosts (`GOOGLE_TAG_HOSTS`) count only with `consentMode: 'basic'` — in `advanced` (the plugin's default) the Google tag may load before consent with every signal denied | | Review entries | `seenBeforeConsent`, `violation` and `violationDetail` ("before consent on /, /about") — from the **latest crawl only**: every crawl clears the previous flags | -| Cookie crawl global | latest result only (no history): status, started / finished, by whom, pages, counts, violations, third-party hosts, error | +| Cookie check global (`cookie-crawl`) | latest result only (no history): status, started / finished, by whom, pages, counts, violations, third-party hosts, error | | "Accept all" not found | the second run had no consent — the global's error says so (`crawl.acceptSelector` for a custom banner) | | Dashboard | a warning above the dashboard after a crawl with violations or new unknown cookies, or a failed crawl (`crawl.dashboard: false` turns it off) | -| E-mail | opt-in per site: *Settings → Cookie crawl → E-mail warnings to* (admin; comma-separated). Sent after a crawl with violations or new unknown cookies, through the project's Payload email adapter (`email: mailAdapter()`, email.md). Empty = no e-mail | +| E-mail | opt-in per site: *Privacy → Cookie check → E-mail warnings to* (admin; comma-separated). Sent after a crawl with violations or new unknown cookies, through the project's Payload email adapter (`email: mailAdapter()`, email.md). Empty = no e-mail | A crawl still "running" after 30 minutes counts as failed (the service never reported back), and a new one may start. One crawl per site at a time (`409` otherwise). @@ -379,7 +379,7 @@ open proxy), runs Chromium as the image's non-root user, and keeps nothing after The same crawl, without the service: `cd services/cookie-crawler && npm install && npx playwright install chromium`, then `node cli.mjs https://acme.pl --pages 10` prints the result as JSON (exit code 1 when anything but the consent cookie is stored before consent). It does not know the site's -categories — the panel's **Crawl site** gives the verdict. `ipal-consent-check` → cookie-scan +categories — the panel's **Check site** gives the verdict. `ipal-consent-check` → cookie-scan (`cookie-scan.mjs`) stays the quick check for projects without the service; paste the names it reports as unknown into **More cookie names**. @@ -388,7 +388,7 @@ as unknown into **More cookie names**. - **Turn off the crawl only:** omit `crawl` (default) — no `cookie-crawl` global, no crawl endpoints, no dashboard warning, no violation fields; `dashboard: false` keeps the crawl without the warning. - **Turn off:** omit `cookieScanner` (default). Turning it off later keeps no endpoint and no - collection; Cookie Settings → Cookies keeps every row (it is still edited by hand or by the skill's + collection; Cookie banner → Cookie list keeps every row (it is still edited by hand or by the skill's import script). - **Override:** `collectionOverrides` (access, admin, hooks), `access` (who scans), `labels`, `databaseCategories`, `integrations` (change or drop a built-in), `syncAccepted: false`; for the diff --git a/docs/deployment.md b/docs/deployment.md index 4bdbeb2..99e3529 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -38,7 +38,7 @@ GRAPH_CLIENT_SECRET= GRAPH_SENDER=noreply@mailservice.intecion.net # shared mailbox ``` All 4 are needed. When Graph is selected in the panel and one is missing — `mailAdapter()` sends through -the SMTP from the panel and reports it in Site Integrations (status `graph-unavailable`). See email.md. +the SMTP from the panel and reports it in Site integrations (status `graph-unavailable`). See email.md. ### Storage — R2 (OPTIONAL in dev, recommended in production) @@ -72,7 +72,7 @@ URLs point at that domain. Outside production, `R2_PUBLIC_URL` alone → read-on | `R2_SECRET_ACCESS_KEY` | ⬜ (✅ prod) | storage | R2 secret | | `R2_PUBLIC_URL` | ⬜ (✅ prod only with `storage: { requirePublicUrl: true }`) | storage | media domain attached to the bucket; empty = media through the app (§6); dev: also the `/media` path | | `IPAL_IP_HEADER` | ⬜ (✅ prod) | forms | header with the real IP for the rate limit (`cf-connecting-ip`, `x-forwarded-for`); without it, a warning in the log | -| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | ⬜ | forms | fallback when the Turnstile keys are not in Site Integrations | +| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | ⬜ | forms | fallback when the Turnstile keys are not in Site integrations | | `INDEXNOW_KEY` | ⬜ | SEO | IndexNow key (takes precedence over the key from the panel) | | `IPAL_COOKIE_SCAN_URL`, `IPAL_COOKIE_SCAN_TOKEN` | ⬜ (✅ prod with `ipalEnvRules({ cookieCrawl: true })`) | consent | cookie crawl (`cookieScanner.crawl`): the shared scanner service's URL and this site's token ([cookie-scanner.md](./cookie-scanner.md#browser-crawl)) | | `IPAL_NOINDEX` | ⬜ | SEO | `1`/`true`/`yes` **on staging only** — the whole site is noindex (robots, meta, `X-Robots-Tag`) | @@ -83,7 +83,7 @@ startup when these variables are missing. **Rule:** all secrets are agency/infrastructure variables — in `.env` (dev) and the Coolify app's Environment Variables (prod, §4.2), NEVER in the repo. Per-project data editable by the -editor goes to the PANEL (Site Settings, Site Integrations), not to env. +editor goes to the PANEL (Site settings, Site integrations), not to env. ### .env.example — always in the repo @@ -378,7 +378,7 @@ the container disk → add a Coolify **Persistent Storage** volume for the uploa ### Integrations in the panel Mail (SMTP/Graph) and Turnstile errors are visible in the panel after deploy: an alert on the dashboard and a banner on -the Site Integrations tab — see [integrations.md](./integrations.md). +the Site integrations tab — see [integrations.md](./integrations.md). ### Other hosts @@ -423,7 +423,7 @@ checks with `dig` after propagation. Check on the zone's authoritative server | 9 | Media in R2 | **default: none** — `R2_PUBLIC_URL` empty, media served by the app; with a media domain: the R2 Custom Domain in the Cloudflare account that hosts that zone (see below) | — | through the app: `curl -sI https://klient.pl/api/media/file/` → 200; media domain: `curl -sI https:///` → 200 (root `/` may return 404, storage.md) | **Which domain gets SPF/DKIM/DMARC (rows 6–8)** — the one in the **From** address of sent mail: -- **SMTP from the panel** transport → the domain from the *From address* field in Site Integrations (usually the client's +- **SMTP from the panel** transport → the domain from the *From address* field in Site integrations (usually the client's domain); the records come from that mailbox's provider; - **Graph** transport → From is always `GRAPH_SENDER` (agency mailbox, [email.md](./email.md)) — SPF/DKIM/DMARC are set once for the agency domain, not per project; the address from the panel goes into Reply-To. @@ -447,13 +447,13 @@ be attached. Options, in order of preference: 3. A reverse proxy/cache on the Coolify server (`media.klient.pl` → the bucket) — possible, more moving parts. 4. `*.r2.dev` — rate-limited, **dev/testing only**, never production. -**Cookie crawler (once per team, not per site):** `cookie-crawler.` → `A`/`AAAA` to the Coolify server running the scanner service ([cookie-scanner.md](./cookie-scanner.md#scanner-service-on-coolify)). A site using `cookieScanner.crawl` needs no record of its own. +**Cookie checker (once per team, not per site):** `cookie-crawler.` → `A`/`AAAA` to the Coolify server running the scanner service ([cookie-scanner.md](./cookie-scanner.md#scanner-service-on-coolify)). A site using `cookieScanner.crawl` needs no record of its own. **No DNS records needed:** Turnstile (hostname list set in the Cloudflare panel on the widget, not in DNS), IndexNow (key file served by the app), llms.txt, MCP, Markdown, sitemap. **Search Console through DNS, not a meta tag.** We verify with a TXT record (row 4) — it covers -all protocols and subdomains. The meta tag verification fields in Site Settings (if the plugin +all protocols and subdomains. The meta tag verification fields in Site settings (if the plugin version has them) are **optional and normally empty**. We do not use the Search Console API — submit the sitemap `https://klient.pl/sitemap.xml` once by hand in GSC (and in Bing). diff --git a/docs/dev/PROGRAMISTA.md b/docs/dev/PROGRAMISTA.md index e29b557..9bbdb5b 100644 --- a/docs/dev/PROGRAMISTA.md +++ b/docs/dev/PROGRAMISTA.md @@ -160,12 +160,12 @@ export default buildConfig({ ipalKit({ i18n: i18nConfig, access: { authCollection: 'users' }, - pages: { slug: 'pages' }, // System Pages (homepage, 404, policies) + pages: { slug: 'pages' }, // System pages (homepage, 404, policies) content: contentConfig, // collections with an archive (blog…), optional seo: { collections: ['pages'] }, forms: { redirectRelationships: ['pages'] }, twoFactor: { issuer: 'Nazwa Klienta', plugin: payloadTotp }, - whiteLabel: true, // logo/name from Site Settings in the admin panel + whiteLabel: true, // logo/name from Site settings in the admin panel indexNow: true, // publish → Bing / ChatGPT Search (production) consentLog: true, // proof of consent (GDPR Art. 7(1)), no personal data // adminRoute: '/its', // + move app/(payload)/admin → its and put `its` in the proxy matcher (§2.6) @@ -288,7 +288,7 @@ 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() - const shell = await getSiteShell(locale) // consent, analytics, Turnstile, site JSON-LD, Site Settings + const shell = await getSiteShell(locale) // consent, analytics, Turnstile, site JSON-LD, Site settings return ( {/* NO — Next manages it itself */} @@ -304,7 +304,7 @@ export default async function LocaleLayout({ children, params }: Props) { } ``` `SiteProviders` wires things in the right order: `MediaPreconnect`, `JsonLdGraph` (WebSite + Organization -from Site Settings), `ConsentProvider` → `TurnstileProvider` (always — it turns itself off without keys) → +from Site settings), `ConsentProvider` → `TurnstileProvider` (always — it turns itself off without keys) → banner, `CookieButton`, `Analytics` (inside consent). It adds no markup. You can change or turn off every part: `banner={}` / `false`, `cookieButton`, `analytics={{ defer: true }}` / `false`, `jsonLd={[buildNavigationJsonLd(…)]}`, `cookieMap`, @@ -312,7 +312,7 @@ turn off every part: `banner={}` / `false`, `co Pick the consent settings window with the banner's `settings` prop: `'inline'` (default — categories in the bar), `'modal'` (small window in the center) or `'detailed'` (large window: each category with a switch, a description and -an expandable list of cookies from Cookie Settings → Cookies). Example: +an expandable list of cookies from Cookie banner → Cookie list). Example: `banner={}` — description: consent.md, the `settings="detailed"` section. @@ -367,7 +367,7 @@ export default createNotFoundPage(content, { load: loadNotFoundView }) export { sitemapRoute as GET } from '@/lib/content' export const dynamic = 'force-dynamic' -// src/app/robots.ts — robots from code + the AI crawler policy from Site Settings → Search & AI +// src/app/robots.ts — robots from code + the AI crawler policy from Site settings → Search engines export { getRobots as default } from '@/lib/content' export const dynamic = 'force-dynamic' @@ -384,7 +384,7 @@ export const dynamic = 'force-dynamic' export { markdownRoute as GET } from '@/lib/content' export const dynamic = 'force-dynamic' -// src/app/indexnow-key.txt/route.ts — IndexNow key (from Site Integrations or INDEXNOW_KEY) +// src/app/indexnow-key.txt/route.ts — IndexNow key (from Site integrations or INDEXNOW_KEY) export { indexNowKeyRoute as GET } from '@/lib/content' export const dynamic = 'force-dynamic' @@ -429,14 +429,14 @@ pnpm dev ### 2.11 Configuration in the admin panel (`/admin`) 1. First user (admin) + 2FA setup. -2. **Site Settings → General** — site name, logo, favicon (PNG). +2. **Site settings → General** — site name, logo, favicon (PNG). 3. **Pages** — the homepage with a title **in every language** (empty EN slug = 404 on `/en`). -4. **Site Settings → System Pages** — Homepage (without it `/pl` → 404), 404, +4. **Site settings → System pages** — Homepage (without it `/pl` → 404), 404, policies; archives of content collections. -5. **Cookie Settings** — banner texts per language; **Cookies** (list from the scan, `ipal-consent-check`) and **Detail +5. **Cookie banner** — banner texts per language; **Cookies** (list from the scan, `ipal-consent-check`) and **Detail labels** (captions of the list in the `settings="detailed"` window) — also in every language. 6. **Notifications** — form messages per language. -7. **Site Integrations** — SMTP/Graph (From Name, From Address), Turnstile, analytics/pixel +7. **Site integrations** — SMTP/Graph (From Name, From Address), Turnstile, analytics/pixel IDs, IndexNow (integrations.md). Mail / Turnstile problems show as an alert on the dashboard and a banner on the tab. @@ -457,7 +457,7 @@ pnpm dev | `R2_PUBLIC_URL` | ⬜ | **empty by default** — media served through the app (`/api/media/file/…`); a media domain whose zone is on Cloudflare only for media-heavy sites (storage.md, deployment.md §6); in dev alone = read-only media | | `NODE_ENV` | ⬜ | `development` / `production` / `test` — `production` tightens the `ipalEnvRules` rules (R2, `IPAL_IP_HEADER`) | | `IPAL_NOINDEX` | ⬜ | `1` **only on staging / preview** — the whole site out of Google (robots, meta, header) | -| `INDEXNOW_KEY` | ⬜ | IndexNow key, when not set in the admin panel (Site Integrations → IndexNow generates one itself) | +| `INDEXNOW_KEY` | ⬜ | IndexNow key, when not set in the admin panel (Site integrations → IndexNow generates one itself) | | `IPAL_IP_HEADER` | ✅ prod | header with the real IP for the rate limit: `cf-connecting-ip` behind Cloudflare, `x-forwarded-for` behind plain Traefik/nginx (forms.md) | | `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | ⬜ | fallback when the Turnstile keys are not in the admin panel (`ipalEnvRules({ turnstile: true })` makes them required) | @@ -545,7 +545,7 @@ Test without a database: `DATABASE_URI=mongodb://invalid-host:27017/x pnpm build ### 4.6 Email — SMTP or Graph Client on M365/Exchange → Graph (SMTP AUTH is often turned off). Own SMTP/Gmail → -SMTP. The switch is in the admin panel (Site Integrations → SMTP → Email Transport). +SMTP. The switch is in the admin panel (Site integrations → SMTP → Email Transport). Graph, one-time: App registration in Azure, the `Mail.Send` application permission + **Grant admin consent**, the `GRAPH_*` variables. `from.address` always = `GRAPH_SENDER` (otherwise `ErrorSendAsDenied`); sender name from the admin panel; the @@ -559,7 +559,7 @@ visitor's address goes into `replyTo`. More: email.md. the policies and terms — we are not a law firm. Put this in the contract. - [ ] Policy pages created (privacy, cookies, terms if there are services/sales/accounts) -- [ ] Roles assigned in System Pages; content filled in (not a placeholder); `noindex` on policies +- [ ] Roles assigned in System pages; content filled in (not a placeholder); `noindex` on policies - [ ] The banner shows on the first visit; "Reject" is as easy as "Accept" - [ ] Pixels (Meta, LinkedIn, TikTok) and Clarity do **not** load before consent (check Network). GA4/GTM load right away in Consent Mode v2 with default `denied` (advanced mode: @@ -610,10 +610,10 @@ Do one item at a time, build, check. Order by importance: | 15j | the form front end sends `fetch('/api/form-submissions')` (from this version REST returns 403 for anonymous users) | rewrite as a server action + `submitForm` (skill `ipal-form`) | forms.md | | 15k | Turnstile secret saved by code (`updateGlobal` in `onInit` / an action) or own `verify` without `remoteip` | delete the workaround: secret in the admin panel or env `TURNSTILE_SECRET_KEY`; the plugin does not send `remoteip` and logs the rejection reason | turnstile.md | | 15l | a Turnstile outage blocked forms | nothing in the project: on an error on our side the plugin accepts the submission and shows an alert in the admin panel; `generate:importmap`, Postgres: `migrate:create` | turnstile.md | -| 15m | own plugin moving Notifications into a group; `formOverrides`/`formSubmissionOverrides` only for labels and the admin group | delete — the plugin itself puts Notifications → Settings, and forms → the "Forms" group with labels (`forms.adminGroup`) | forms.md | -| 15n | mail errors visible only in logs | nothing in the project: `mailAdapter()` shows the send error on the dashboard and in Site Integrations → SMTP; `generate:importmap`, Postgres: `migrate:create` | email.md | -| 16 | Hard-coded 404 | 404 role in System Pages + `getNotFoundPage` | pages.md | -| 16a | `privacyPolicy: { label: 'Polityka prywatności', … }` in the layout | delete the whole parameter; enter the text in Cookie Settings → Privacy link label | consent.md | +| 15m | own plugin moving Notifications into a group; `formOverrides`/`formSubmissionOverrides` only for labels and the admin group | delete — the plugin itself puts Form messages → Settings, and forms → the "Forms" group with labels (`forms.adminGroup`) | forms.md | +| 15n | mail errors visible only in logs | nothing in the project: `mailAdapter()` shows the send error on the dashboard and in Site integrations → SMTP; `generate:importmap`, Postgres: `migrate:create` | email.md | +| 16 | Hard-coded 404 | 404 role in System pages + `getNotFoundPage` | pages.md | +| 16a | `privacyPolicy: { label: 'Polityka prywatności', … }` in the layout | delete the whole parameter; enter the text in Cookie banner → Privacy link label | consent.md | | 17 | **AI/GEO (mandatory since 1.9.0)** | llms.txt + llms-full.txt, the `/md/…` route, `markdownAlternate: true`, `prefersMarkdown` in the proxy, `/api/mcp`, `buildSummaryField`, AI bots allowed — AGENT.md §0b | content.md, seo.md, mcp.md | | 18 | **1.9.0** — `TurnstileProvider siteKey` from `getSiteIntegrations(…).turnstileSiteKey` | `getTurnstileConfig(payload).siteKey`. Note: with both keys set `submitForm` **requires** a token — a form without the widget will be rejected | turnstile.md | | 19 | **1.9.0** — `twoFactor: { issuer }` without `plugin` | add `plugin: payloadTotp` (the fallback with a dynamic import was removed — startup fails with an error) | security.md | @@ -622,11 +622,11 @@ Do one item at a time, build, check. Order by importance: | 22 | **1.9.1** — hand-written `actions.ts` / `md` route / no form seed | `createSubmitAction`, `createMarkdownRoute`, seed from `ipal-form` (mail to the company + to the visitor) | forms.md, content.md | | 23 | **1.9.1** — `createProxy` without `markdown: true` | add it — otherwise `/md/…` redirects to `/pl/md/…` | content.md | | 24 | **1.9.1** — page JSON-LD assembled by hand | `getPageJsonLd`, `buildNavigationJsonLd`, `sameAsUrls`, `formatOpeningHours` | seo.md | -| 25 | **1.9.1** — consent: version, log, table | Cookie Settings → Policy version; `consentLog: true` + `logEndpoint`; ``; scan + ``; Postgres: `migrate:create` | consent.md | +| 25 | **1.9.1** — consent: version, log, table | Cookie banner → Policy version; `consentLog: true` + `logEndpoint`; ``; scan + ``; Postgres: `migrate:create` | consent.md | | 26 | **1.9.1** — media: `priority`, no placeholders, `images` in next.config | `` through `mediaImageProps`/`videoProps`, `buildMediaPlaceholderHook`, `buildImagesConfig`, `buildUploadSecurityHeaders` | media.md, storage.md | | 27 | **1.9.1** — staging indexed | `IPAL_NOINDEX=1` in the staging env | seo.md | | 28 | **1.9.2** — own `FormRenderer` (a copy of the engine on `useForm`) | **security:** it passed the whole form document, including the Emails tab, to the browser (company addresses in the HTML). Block → ``, styling into `formClasses.ts`, delete `FormRenderer.tsx`; unusual form → `useBuilderForm` | forms.md | -| 29 | **1.9.2** — multi-step forms / choice lists built in code | admin panel: the **Step**, **Radio**, **Checkbox group**, **Date** blocks; Notifications → next / back / stepOf; Postgres: `migrate:create` | forms.md | +| 29 | **1.9.2** — multi-step forms / choice lists built in code | admin panel: the **Step**, **Radio**, **Checkbox group**, **Date** blocks; Form messages → next / back / stepOf; Postgres: `migrate:create` | forms.md | | 30 | **1.9.2** — layout assembled by hand (ConsentProvider, TurnstileProvider, Analytics, JsonLdGraph, MediaPreconnect) | `` — the same options (banner, analytics, jsonLd, logEndpoint) | PROGRAMISTA §2.8 | | 31 | **1.9.2** — catch-all page and `not-found.tsx` written by hand | `createPageRoute(content, {…})` / `createNotFoundPage(content, {…})` from `/rsc`; `revalidate` stays a literal | pages.md | | 32 | **1.9.2** — llms/md/mcp/health/indexnow/manifest routes with configuration in every file | re-export from `lib/content` (`llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`/`mcpPOST`, `healthRoute`, `indexNowKeyRoute`, `manifest`); `summaryField`, `mcp` once in `createContentHelpers` | PROGRAMISTA §2.7 | @@ -643,9 +643,9 @@ Do one item at a time, build, check. Order by importance: | 43 | **1.11.1** — `` sets the background color only for JPEG | delete the condition — `mediaImageProps` does it itself (`placeholderColor`) | media.md | | 44 | **1.11.1** — `CmsLink['appearance']` replaced with an own type because the type depended on field order | types per shape: `CmsLink`, `CmsLinkPlain`, `CmsLinkNoLabel`; `pnpm generate:types` and fix the imports | links.md | | 45 | **1.11.1** — format description in a form field label / time as text | the **Placeholder** field in the admin panel, the **Time** type; Postgres: `migrate:create` | forms.md | -| 46 | **1.12.3** — own cookie settings window / cookie list in the banner written in the project | `` (list from Cookie Settings → Cookies, captions: Detail labels); delete your own version; Postgres: `migrate:create` | consent.md | -| 47 | **1.13.0** — staff access, Search & AI, seed scripts, workarounds around plugin globals | without `access`: every logged-in account gets the staff features → `access` or `globalOverrides` / `formOverrides` / `formSubmissionOverrides` / `collectionOverrides`; with `access`: staff need `editor`/`admin`; Postgres: `migrate:create`; check `settingsDepth`, `sitemap()` throwing, 2FA slug, client IP; own seed code → `@intecion/ipal-kit/seed`; global hooks/access plugins → `revalidatePath` / `globalOverrides` | CHANGELOG 1.13.0, AGENT.md §7.1, seo.md, seeding.md | -| 48 | **image lightbox** (release after 1.13.0) — own image modal (`useState(index)` + `div role="dialog"`), `glightbox` / other lightbox library, thumbnails linking to the raw file in a new tab | `ipalKit({ lightbox: true })` + Postgres `migrate:create`; ``; `` around the thumbnail; delete the old dialog and `pnpm remove glightbox`; old label fields → Notifications → Lightbox | lightbox.md → "Replacing a hand-made modal" | +| 46 | **1.12.3** — own cookie settings window / cookie list in the banner written in the project | `` (list from Cookie banner → Cookie list, captions: Detail labels); delete your own version; Postgres: `migrate:create` | consent.md | +| 47 | **1.13.0** — staff access, Search engines, seed scripts, workarounds around plugin globals | without `access`: every logged-in account gets the staff features → `access` or `globalOverrides` / `formOverrides` / `formSubmissionOverrides` / `collectionOverrides`; with `access`: staff need `editor`/`admin`; Postgres: `migrate:create`; check `settingsDepth`, `sitemap()` throwing, 2FA slug, client IP; own seed code → `@intecion/ipal-kit/seed`; global hooks/access plugins → `revalidatePath` / `globalOverrides` | CHANGELOG 1.13.0, AGENT.md §7.1, seo.md, seeding.md | +| 48 | **image lightbox** (release after 1.13.0) — own image modal (`useState(index)` + `div role="dialog"`), `glightbox` / other lightbox library, thumbnails linking to the raw file in a new tab | `ipalKit({ lightbox: true })` + Postgres `migrate:create`; ``; `` around the thumbnail; delete the old dialog and `pnpm remove glightbox`; old label fields → Form messages → Image viewer | lightbox.md → "Replacing a hand-made modal" | After updating the package: `pnpm ipal:skills` (new skill versions), `pnpm payload generate:importmap`, `rm -rf .next`, restart dev, grep for the new symbol in `node_modules/@intecion/ipal-kit/dist`. @@ -668,7 +668,7 @@ After updating the package: `pnpm ipal:skills` (new skill versions), `pnpm paylo | Banner without styles | no Tailwind or no `@source` for the plugin | | `/admin`, `/_next` → 500 | the proxy matcher is not an inline literal | | `slug.join is not a function` | `[slug]` instead of `[[...slug]]` | -| `/pl` → 404 | Homepage not assigned in System Pages | +| `/pl` → 404 | Homepage not assigned in System pages | | `/en/*` → 404, `/pl/*` works | empty title/slug in EN | | `Missing and ` | root layout deleted, and `[locale]/layout.tsx` does not have them | | Routes `ƒ` despite `generateStaticParams` | the build does not see the database (§4.3) | diff --git a/docs/dev/admin-ux.md b/docs/dev/admin-ux.md index 9b8b859..dcd4534 100644 --- a/docs/dev/admin-ux.md +++ b/docs/dev/admin-ux.md @@ -28,7 +28,8 @@ not the code. Every screen must be clear to them without a developer at hand. Errors an editor can see never name env vars, config files or packages; the developer detail goes to the server log. - **No package or vendor names** (ipal-kit, Intecion) in labels, descriptions, test e-mails - or messages. "Ask your administrator" instead of "configured by Intecion". + or messages. "Ask your administrator" instead of "configured by Intecion". The one exception is + the vendor credit under the navigation (`whiteLabel.credit`), which exists to name the vendor. ## 2. Length @@ -74,27 +75,27 @@ Use these terms everywhere: labels, descriptions, docs, toasts. Never a synonym. | Concept | English | Polish | Not | |---|---|---|---| -| The admin panel | admin panel | panel administracyjny | CMS, backend, dashboard (for the whole panel) | -| A web page in the CMS | page | strona | site (for one page), document | -| The whole website | site | witryna | website, page, domain | -| A blog/news entry | post | wpis | article (unless the project calls it so) | -| Electronic mail | e-mail | e-mail | email, mail | -| Cookie consent | consent | zgoda | permission, opt-in | -| Cookie consent banner | cookie banner | baner cookies | popup, consent bar, CookieBanner | -| Form entry sent by a visitor | submission | zgłoszenie | entry, response, lead | -| Built-in visit counting | statistics | statystyki | analytics (= Google Analytics etc.), stats | -| Third-party tracking tools | analytics | analityka | tracking, pixels (in labels) | -| Anti-spam check on forms | spam protection (Cloudflare Turnstile) | ochrona przed spamem | captcha, Turnstile (alone) | -| Image shown when a link is shared | share image | obraz udostępniania | Open Graph image, OG image, meta image | -| Text shown under a result in Google | description (search result) | opis (w wynikach wyszukiwania) | meta description | -| Title in the browser tab / Google | page title | tytuł strony | meta title, SEO title | -| Web address part after the domain | address (URL) | adres (URL) | slug, path, route | -| The visible name of a field in a form | label | etykieta | name (= technical key) | -| Technical key of a form field | field key | klucz pola | name | -| Search engines and AI | search engines, AI assistants | wyszukiwarki, asystenci AI | crawlers, bots (except the advanced bot rules) | -| Outgoing e-mail server | e-mail sending | wysyłka e-mail | transport, SMTP (as a tab name) | -| Under-construction mode | maintenance mode | tryb prac technicznych | under construction, coming soon | -| Role | role: admin, editor, user | rola: administrator, redaktor, użytkownik | | +| The admin panel | admin panel | `panel administracyjny` | CMS, backend, dashboard (for the whole panel) | +| A web page in the CMS | page | `strona` | site (for one page), document | +| The whole website | site | `witryna` | website, page, domain | +| A blog/news entry | post | `wpis` | article (unless the project calls it so) | +| Electronic mail | e-mail | `e-mail` | email, mail | +| Cookie consent | consent | `zgoda` | permission, opt-in | +| Cookie consent banner | cookie banner | `baner cookies` | popup, consent bar, CookieBanner | +| Form entry sent by a visitor | submission | `zgłoszenie` | entry, response, lead | +| Built-in visit counting | statistics | `statystyki` | analytics (= Google Analytics etc.), stats | +| Third-party tracking tools | analytics | `analityka` | tracking, pixels (in labels) | +| Anti-spam check on forms | spam protection (Cloudflare Turnstile) | `ochrona przed spamem` | captcha, Turnstile (alone) | +| Image shown when a link is shared | share image | `obraz udostępniania` | Open Graph image, OG image, meta image | +| Text shown under a result in Google | description (search result) | `opis (w wynikach wyszukiwania)` | meta description | +| Title in the browser tab / Google | page title | `tytuł strony` | meta title, SEO title | +| Web address part after the domain | address (URL) | `adres (URL)` | slug, path, route | +| The visible name of a field in a form | label | `etykieta` | name (= technical key) | +| Technical key of a form field | field key | `klucz pola` | name | +| Search engines and AI | search engines, AI assistants | `wyszukiwarki, asystenci AI` | crawlers, bots (except the advanced bot rules) | +| Outgoing e-mail server | e-mail sending | `wysyłka e-mail` | transport, SMTP (as a tab name) | +| Under-construction mode | maintenance mode | `tryb prac technicznych` | under construction, coming soon | +| Role | role: admin, editor, user | `rola: administrator, redaktor, użytkownik` | | Product names that stay as they are: Google Analytics 4, Google Tag Manager, Meta Pixel, Microsoft Clarity, LinkedIn Insight Tag, TikTok Pixel, Cloudflare Turnstile, @@ -121,7 +122,7 @@ in parentheses after a plain name). - **Checkbox:** label states the "on" state as a positive: "Show theme switch", not "Disable theme switch" / "Allow Theme Toggle". - **Empty-means-default fields:** say it once, the same way everywhere: - "Leave empty to use the default." (pl: „Zostaw puste, aby użyć domyślnej wartości."). + "Leave empty to use the default." (pl: `Zostaw puste, aby użyć domyślnej wartości.`). The default itself goes in the placeholder. - **Number fields** state the unit in the label: "Session length (minutes)". - **Danger** (consent reset, secret rotation): say the consequence, plainly: @@ -154,8 +155,8 @@ Rules: - Fields that only work with another setting (`admin.condition`) hide until they apply, rather than explaining in a description when they apply. - Admin navigation: collections and globals sit in a few fixed groups — - **Content**, **Forms**, **Settings**, **Privacy**, **Statistics** (pl: Treści, Formularze, - Ustawienia, Prywatność, Statystyki). Settings holds configuration only; logs and records + **Content**, **Forms**, **Settings**, **Privacy**, **Statistics** (pl: `Treści`, `Formularze`, + `Ustawienia`, `Prywatność`, `Statystyki`). Settings holds configuration only; logs and records (consent log, visits) go to their own group. A nav link or view the user cannot open is hidden, never shown with "You do not have access". - A global or collection is named for what the editor finds in it ("Form messages"), not diff --git a/docs/dev/vibe.md b/docs/dev/vibe.md index ad29127..771d380 100644 --- a/docs/dev/vibe.md +++ b/docs/dev/vibe.md @@ -188,7 +188,7 @@ Do this according to PROGRAMISTA.md §2.8–2.9 and seo.md: api/health/route.ts — every route that reads the database with export const dynamic = 'force-dynamic', - next.config.ts: htmlLimitedBots, buildSecurityHeaders, - page metadata through generatePageMetadata from lib/content (shared cache), favicon through buildIconsMetadata, -- JSON-LD: Organization + WebSite come from SiteProviders using Site Settings; local business → siteJsonLd in createContentHelpers (seo.md), +- JSON-LD: Organization + WebSite come from SiteProviders using Site settings; local business → siteJsonLd in createContentHelpers (seo.md), - src/instrumentation.ts with assertEnv(ipalEnvRules(...)) imported from @intecion/ipal-kit/env (env.md). No CSP yet — that comes in step 14. Plan first. @@ -208,7 +208,7 @@ Do this according to AGENT.md §6.8, code from node_modules/@intecion/ipal-kit/d - globals/Company.ts for market : name, address, , phone, email — all localized where it is text, - menu through resolveNav from lib/content (plugin, NOT lib/navigation.ts), components/layout/Header.tsx, Footer.tsx, MobileNav.tsx, -- legal links in the footer from System Pages roles, NOT by hand, +- legal links in the footer from System pages roles, NOT by hand, - the project's own globals (Header, Footer, Company) get buildGlobalRevalidateHook (afterChange); plugin globals refresh through ipalKit({ revalidatePath }). Wire it into [locale]/layout.tsx. a11y labels from the admin panel. Plan first. @@ -260,7 +260,7 @@ Do this according to forms.md, turnstile.md, email.md: - RenderForm handles the honeypot and the GTM event from the admin panel by itself (forms.md). Plan first. ``` -Check: admin panel → Site Integrations → Send test; submitting the form without consent → rejected. +Check: admin panel → Site integrations → Send test; submitting the form without consent → rejected. --- @@ -268,7 +268,7 @@ Check: admin panel → Site Integrations → Send test; submitting the form with ``` Verify and finish according to consent.md and analytics.md: -- Analytics through SiteProviders (inside consent), IDs only from Site Integrations, +- Analytics through SiteProviders (inside consent), IDs only from Site integrations, - whether to turn on defer (Core Web Vitals) — , - Meta Pixel: (never both), - policy link in the banner: automatic (no privacyPolicy parameter in the code). diff --git a/docs/email.md b/docs/email.md index 29ea42a..e5a398e 100644 --- a/docs/email.md +++ b/docs/email.md @@ -17,7 +17,7 @@ install it. Graph is plain `fetch`, no extra packages. No plugin options — SMTP (`smtpHost`, `smtpPort` (default 587), `smtpUser`, `smtpPassword`, `smtpFromAddress`, `smtpFromName`) and `emailTransport` live in -SiteIntegrations (SMTP tab). The editor configures them in the panel. The plugin does **not** set +SiteIntegrations (E-mail sending tab). The editor configures them in the panel. The plugin does **not** set `config.email` — you wire the adapter yourself (below). ## Front — sendEmail (server) @@ -41,7 +41,7 @@ if (result.sent) { ``` - Always the SMTP from the panel (not Graph, not `mailAdapter`); without `smtpHost`/`smtpUser`/`smtpPassword` - → `{ sent: false, error: 'SMTP is not configured in Site Integrations.' }`. + → `{ sent: false, error: 'SMTP is not configured in Site integrations.' }`. - `from` overrides the address (the name still comes from `smtpFromName`); without `from` and without `smtpFromAddress` → `{ sent: false, error: 'No from-address configured.' }`. - **The HTML is your argument** — the plugin has no templates, it sends what you pass. @@ -95,7 +95,7 @@ mail will not go out. ## Masking secrets in the panel (MaskedField) -Sensitive fields in Site Integrations (`smtpPassword`, `turnstileSecretKey`) are +Sensitive fields in Site integrations (`smtpPassword`, `turnstileSecretKey`) are masked in the UI — they show `••••` instead of plaintext, with a Reveal/Hide button. This is UI masking, NOT hashing or encryption: the value in the database is plaintext (it must be recoverable for SMTP / Turnstile authentication). @@ -144,7 +144,7 @@ import { mailAdapter } from '@intecion/ipal-kit' email: mailAdapter(), // SMTP or Graph — chosen in the panel, on EVERY send ``` -`mailAdapter` is a dispatcher: it reads `emailTransport` from Site Integrations on every +`mailAdapter` is a dispatcher: it reads `emailTransport` from Site integrations on every send (no value → `'smtp'`), so the switch in the panel works without a restart. Graph only when all 4 `GRAPH_*` variables are in env — otherwise a clear log and fallback to SMTP (mail is not lost silently). @@ -197,13 +197,13 @@ import { mailAdapter } from '@intecion/ipal-kit' email: mailAdapter() ``` -Panel → Site Integrations → SMTP → **Email Transport** (SMTP / Microsoft Graph). +Panel → Site integrations → SMTP → **Email Transport** (SMTP / Microsoft Graph). The dispatcher reads this choice per send. Guard: if Graph is selected but the secrets are missing in .env → log + fallback to SMTP (no silent failure). ## Test send — button in the panel -The SMTP tab has a **Send test** button: enter an address, click, and a test +The E-mail sending tab has a **Send test** button: enter an address, click, and a test mail goes out through the CURRENT transport (`payload.sendEmail`). It shows the result (✓/✗ with the error). Endpoint `POST /api/ipal/test-email`, body `{ to }` (`admin` role only — needs roles from the `access` option: not logged in → 401, other role → 403, bad address → 400, failed send → 502). @@ -216,10 +216,10 @@ Save your changes before the test — the endpoint reads from the database, not ## Send status in the panel -`mailAdapter()` stores the send result in Site Integrations (at most once per 10 min +`mailAdapter()` stores the send result in Site integrations (at most once per 10 min while an error persists, immediately when the state changes). When sending fails: -- **Dashboard** — a red alert with the cause and a link to Site Integrations, -- **Site Integrations → SMTP** — a banner with the error (e.g. `SMTP: connect ECONNREFUSED …`, +- **Dashboard** — a red alert with the cause and a link to Site integrations, +- **Site integrations → SMTP** — a banner with the error (e.g. `SMTP: connect ECONNREFUSED …`, `SMTP: SMTP is not configured…`, `SMTP: Invalid login: 535 …`, `Microsoft Graph: Graph sendMail failed (403).`) and the time. @@ -234,7 +234,7 @@ send (e.g. **Send test**) the current one appears. ## Turn off, override, extend - **Turn off:** the plugin does not set `config.email` itself — without `email:` in `buildConfig` Payload uses - its mock (mail only in the console). The SMTP fields in Site Integrations and the endpoint + its mock (mail only in the console). The SMTP fields in Site integrations and the endpoint `POST /api/ipal/test-email` are currently always added. - **Choosing the transport:** `mailAdapter()` (the panel decides) or a fixed `panelSmtpAdapter()` / `graphAdapter()`; any other Payload adapter (e.g. `@payloadcms/email-nodemailer`) also works — diff --git a/docs/env.md b/docs/env.md index 3fccaa3..2d28820 100644 --- a/docs/env.md +++ b/docs/env.md @@ -85,7 +85,7 @@ read; DB/secret are Payload variables — their names can be overridden. that always uses a media domain). **`turnstile: true`** makes both Turnstile variables **required**, even though the plugin takes the keys -from the panel first (Site Integrations) and env is only a fallback — turn it on only when you keep the keys +from the panel first (Site integrations) and env is only a fallback — turn it on only when you keep the keys in env. The plugin also reads (outside the preset — add your own rules if you want to validate them): diff --git a/docs/forms.md b/docs/forms.md index 9e02bc6..fa3f55b 100644 --- a/docs/forms.md +++ b/docs/forms.md @@ -57,7 +57,7 @@ ipalKit({ | `fields` | see below | builder field types; `false` turns a type off, an object (block) replaces it; `true` = the default ipal block | | `redirectRelationships` | — | collections a form can redirect to | | `formOverrides` / `formSubmissionOverrides` | — | collection overrides (`fields` as a function + any collection settings) | -| `emailLayout` | `false` | nice emails + the Site Settings → Emails tab | +| `emailLayout` | `false` | nice emails + the Site settings → E-mails tab | | `beforeEmail` | — | the form-builder's `beforeEmail` (after the layout, when `emailLayout`) | | `consentFieldName` | `'consent'` | name of the GDPR consent field for `submitForm` / `createSubmitAction` (the call's argument wins) | @@ -82,7 +82,7 @@ import { RenderForm } from '@intecion/ipal-kit/rsc' ``` - `form` — the relation from the block (depth ≥ 1; an ID or null → nothing renders), - `action` — `sendForm` from `createSubmitAction` (below), `texts` — `getFormTexts(locale)` from `lib/content` - (Notifications → Form messages), + (Form messages → Form messages), - `classNames` — the **only** place for looks (`src/components/forms/formClasses.ts`, template in ipal-form); the plugin has no styles at all. Keys: `form, progress, step, stepTitle, stepDescription, fields, field, fieldHalf, fieldFull, label, input, textarea, select, checkbox, checkboxLabel, choices, @@ -118,7 +118,7 @@ the time block: `timeBlock`. New fields in form blocks = a migration (`pnpm payl A **Step** block (title, description, per language) starts a new screen; fields above the first Step are screen 1. `BuilderForm`: "Step 1 of 3" (`stepOf`), Next validates only the current step, Back keeps the values, focus moves to the new step, Turnstile is on the last step, a field error from the server goes back -to the step with that field. Button texts: Notifications → Form messages → `next`, `back`, `stepOf`. +to the step with that field. Button texts: Form messages → `next`, `back`, `stepOf`. ### Conditional fields and steps ("Show only when") Every form block (built-in, **Checkbox group**, **Step**, message) has a @@ -275,7 +275,7 @@ messages the editor configured (Forms → form → Emails), through email: mailAdapter(), // from '@intecion/ipal-kit' — SMTP or Graph according to the panel (email.md) ``` -Then they go through the transport chosen in Site Integrations (SMTP or Graph). The editor sets recipients, subject and +Then they go through the transport chosen in Site integrations (SMTP or Graph). The editor sets recipients, subject and body (placeholders: `{{field}}`, `{{*}}`, `{{*:table}}`) without touching the code. `submitForm` is responsible only for Turnstile verification and storing. It stores the submission in the page's language @@ -291,7 +291,7 @@ forms: { emailLayout: true } // optional: beforeEmail: (emails, args) instead of values (Checkbox group too), a checked checkbox = ✓, empty answers skipped, groups by step (Step titles). Only fields the visitor saw (the server does not store fields hidden by a condition). - Every email gets a **template** (tables + inline CSS — Gmail, Outlook, Apple Mail): a header with the logo, - the body from the panel, a footer. Settings: **Site Settings → Emails** — logo (**PNG/JPG**, SVG does not work in + the body from the panel, a footer. Settings: **Site settings → Emails** — logo (**PNG/JPG**, SVG does not work in Gmail/Outlook; empty = the site name), accent colour (hex), footer (per language). The link to the site and the absolute logo address come from `serverURL` in `buildConfig` (set it from `NEXT_PUBLIC_SERVER_URL`). - An error while building the template never blocks sending — the original email goes out, the error goes to the log. @@ -532,8 +532,11 @@ const f = useForm({ initialValues, submitAction, validate }) ### Validators (pure — also server-side) `required`, `email`, `minLength`, `maxLength`, `checked`, `pattern`, `custom`, -`isEmail`, `buildValidator`. Each takes its own message. They are pure (no -`'use client'`), so you can use the same rules to re-validate in a server action. +`isEmail`, `buildValidator`. Each takes its own message; without one it uses the English +default from `VALIDATION_MESSAGES` (type `ValidationMessages`). `localizedRules(locale)` returns the +same rules with the defaults in the page language (`validationMessages(locale)`: Polish for `pl`, +English otherwise). They are pure (no `'use client'`), so you can use the same rules to +re-validate in a server action. ### errors are a STRING, not a boolean diff --git a/docs/frontend.md b/docs/frontend.md index cb81e61..b4546f8 100644 --- a/docs/frontend.md +++ b/docs/frontend.md @@ -38,8 +38,8 @@ and shared by the helpers (generateMetadata and the page share queries). | `mcp` | — | `{ serverName, serverVersion, rateLimit, maxBatch, clientIp, isPathVisible }` for `mcpGET`/`mcpPOST` (mcp.md) | | `pageJsonLd` | — | default `getPageJsonLd` options: `breadcrumbs`, `entryType`, `entries`, `faq`, `pageType` | | `robots` | — | `RobotsOptions` for `robots` and `getRobots` (seo.md); `aiBotRules: [{ userAgent, access }]` = per-bot exceptions from code (the panel's rules come after them) | -| `settingsDepth` | `1` | depth of `getSettings`: Site Settings relations arrive as documents, theirs as ids (the archive page is read separately at depth 2); `2` = every request pays for more | -| `siteJsonLd` | WebSite + Organization from Site Settings | a function replaces it, `false` = none | +| `settingsDepth` | `1` | depth of `getSettings`: Site settings relations arrive as documents, theirs as ids (the archive page is read separately at depth 2); `2` = every request pays for more | +| `siteJsonLd` | WebSite + Organization from Site settings | a function replaces it, `false` = none | | `sitemapEntries` | — | `(entries) => entries` — final sitemap list: add URLs of your own routes, remove some, set `priority` | | `sitemapImages` | the document's SEO image | `(doc) => url[]` | | `sitemapOptions` | `{ maxUrls: 10000, cacheControl: 'public, max-age=0, s-maxage=3600, stale-while-revalidate=86400', memoSeconds: 300 }` | `sitemapRoute`: above `maxUrls` it serves a `` with `?part=N` parts (`Infinity` = never split); `cacheControl: false` = no header; `memoSeconds: 0` = no in-process memo | @@ -56,14 +56,14 @@ and shared by the helpers (generateMetadata and the page share queries). | `getSettings` | `(locale)` — SiteSettings, `depth: 1` (`settingsDepth`), one read per language per request | | `resolveRoute` | `(locale, segments, page)` → `ResolvedRoute \| null` (content.md) | | `getEntries` | `(collection, locale, page, perPage)` → `ArchiveEntries` | -| `getNotFoundPage` | `(locale)` — 404 page from System Pages or `null`, does not throw (pages.md) | +| `getNotFoundPage` | `(locale)` — 404 page from System pages or `null`, does not throw (pages.md) | | `generatePageMetadata` | `(locale, segments, page = 1)` → `Metadata` for `generateMetadata` | | `getPageJsonLd` | `(locale, segments, options?)` → nodes for `` (WebPage / BlogPosting / CollectionPage, BreadcrumbList, FAQPage); `[]` for noindex | | `generateStaticParams` | see below | | `sitemap` | `app/sitemap.ts`: `export { sitemap as default }` (does not split; a database error throws at runtime, `[]` only during `next build`) | | `sitemapRoute` | `app/sitemap.xml/route.ts`: `export { sitemapRoute as GET }` | | `robots` | `app/robots.ts`: `export { robots as default }` — rules from code only (sync) | -| `getRobots` | `app/robots.ts`: `export { getRobots as default }` + `export const dynamic = 'force-dynamic'` — `robots` plus the AI crawler policy and per-bot rules from Site Settings → Search & AI, read per request; database unreachable → the code options | +| `getRobots` | `app/robots.ts`: `export { getRobots as default }` + `export const dynamic = 'force-dynamic'` — `robots` plus the AI crawler policy and per-bot rules from Site settings → Search engines, read per request; database unreachable → the code options | | `manifest` | `app/manifest.ts`: `export { manifest as default }` | | `llmsRoute`, `llmsFullRoute` | `app/llms.txt/route.ts`, `app/llms-full.txt/route.ts` (seo.md) | | `markdownRoute` | `app/md/[locale]/[[...slug]]/route.ts` (content.md) | @@ -157,7 +157,7 @@ It does not mount `AlternateLinksProvider` (i18n.md) — add it yourself if you | `analytics` | on | extra `` props or `false` = no tags | | `cookieMap` | — | extra cookies per category to clean up after consent is withdrawn | | `jsonLd` | `[]` | extra JSON-LD nodes | -| `lightbox` | off | `true` / `{ texts, classNames, icons, loop, unstyled }` → one `` for the site; texts from `shell.lightboxTexts` (Notifications → Lightbox) — lightbox.md | +| `lightbox` | off | `true` / `{ texts, classNames, icons, loop, unstyled }` → one `` for the site; texts from `shell.lightboxTexts` (Form messages → Image viewer) — lightbox.md | | `preconnect` | `true` | `` to the media origin | | `stats` | off | `true`/props → `` (stats.md) | | `theme` | `false` | `` before the first paint (theme.md) | @@ -171,6 +171,6 @@ It does not mount `AlternateLinksProvider` (i18n.md) — add it yourself if you - `createPageRoute`: your own view through `render`, your own 404/redirect through `onMissing`, extra block props through `blockProps`, JSON-LD through `jsonLd`. - `SiteProviders`: `lightbox` is off by default; for `renderImage` / `renderDialog` (functions) mount `` yourself in a client component instead (lightbox.md). - `SiteProviders`: `banner`, `cookieButton`, `analytics` accept your own element or `false`; `analytics={{ consentMode: 'basic' }}` = no request to Google before consent (default `'advanced'`: the tag loads with every signal `denied`). -- Search & AI from the panel: `robots` instead of `getRobots` ignores it; your own robots: `buildRobots({ ...robotsOptionsFrom(settings), … })`; drop the verification tags: `const { verification, ...meta } = await generatePageMetadata(…)`. +- Search engines from the panel: `robots` instead of `getRobots` ignores it; your own robots: `buildRobots({ ...robotsOptionsFrom(settings), … })`; drop the verification tags: `const { verification, ...meta } = await generatePageMetadata(…)`. - Construction filter in Markdown / MCP: `markdown: { isPathVisible: () => true }`, `mcp: { isPathVisible: () => true }`; in the sitemap and llms.txt: `underConstructionSeo: false`. - `createPageRoute` pagination and the `generateStaticParams` scope currently cannot be changed with an option — only with your own code. diff --git a/docs/gtm-meta-pixel.md b/docs/gtm-meta-pixel.md index 3fbf463..bbdd699 100644 --- a/docs/gtm-meta-pixel.md +++ b/docs/gtm-meta-pixel.md @@ -14,7 +14,7 @@ Related: [analytics.md](./analytics.md), [consent.md](./consent.md), ## What the plugin does FOR you (you do not configure this in code) - **Loads the GTM container** — `Analytics` takes the `GTM Container ID` from the panel - (Settings → Site Integrations). Zero code. + (Settings → Site integrations). Zero code. - **Consent Mode v2** — before loading the container it sends `consent default` (the saved decision or everything `denied`), and after a click in the banner `consent update`. The GTM container itself loads **before consent** (advanced mode) — that is why @@ -33,7 +33,7 @@ Integrations empty (otherwise the plugin loads a second pixel → double countin ## 0. Prerequisites (Payload panel) -1. **GTM Container ID** in Settings → Site Integrations (`GTM-XXXXXXX`). +1. **GTM Container ID** in Settings → Site integrations (`GTM-XXXXXXX`). 2. **Cookie banner** active (`CookieBanner` + `ConsentProvider`) — otherwise Consent Mode gets no decision. 3. **Analytics field on the form** — add `buildFormAnalyticsFields()` to the @@ -189,7 +189,7 @@ forms + analytics modules, not GTM configuration. ## Turn off, override, extend -- **Turn off:** empty *GTM Container ID* in Site Integrations = the container does not load; empty +- **Turn off:** empty *GTM Container ID* in Site integrations = the container does not load; empty *Event name* on the form = no `form_submit`. - **Override:** event name and parameters per form in the panel; instead of `formAnalyticsOnSuccess` you can call `pushDataLayer(event, params)` in `onSuccess` with your own data. diff --git a/docs/hooks.md b/docs/hooks.md index 124df4c..c5dbfbb 100644 --- a/docs/hooks.md +++ b/docs/hooks.md @@ -61,12 +61,12 @@ in the Local API call. ### Globals — buildGlobalRevalidateHook / `ipalKit({ revalidatePath })` -A global (Site Settings, Cookie Settings, the project's menu) feeds the layout of **every** page — logo, menu, +A global (Site settings, Cookie banner, the project's menu) feeds the layout of **every** page — logo, menu, consent texts, analytics IDs. Without revalidation, ISR pages kept the old values until the end of the `revalidate` window. Saving a global → `revalidatePath('/', 'layout')` (the whole site). ```ts -// payload.config.ts — the plugin's globals (Site Settings, Site Integrations, Cookie Settings, Notifications) +// payload.config.ts — the plugin's globals (Site settings, Site integrations, Cookie banner, Notifications) import { revalidatePath } from 'next/cache' ipalKit({ …, revalidatePath }) @@ -113,9 +113,9 @@ import { buildPreventDeleteSystemPage } from '@intecion/ipal-kit' hooks: { beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })] } ``` -It reads Site Settings in the same `req` (the delete transaction). +It reads Site settings in the same `req` (the delete transaction). -To delete — first detach the role in Site Settings (a deliberate decision). +To delete — first detach the role in Site settings (a deliberate decision). Options: `settingsSlug` (`'site-settings'`), `roleFields` (default `['homepage', 'privacyPolicy', 'cookiePolicy', 'termsOfService']` — **without `notFound`**; the 404 page and diff --git a/docs/i18n.md b/docs/i18n.md index 7bb92d3..914b6f1 100644 --- a/docs/i18n.md +++ b/docs/i18n.md @@ -375,6 +375,45 @@ export const config = { matcher: ['/((?!api|admin|_next|.*\\..*).*)'] } Use `DEFAULT_PROXY_MATCHER` as a reference value, but if Next complains about the matcher — paste it inline. This is a Next limitation, not a plugin one. +## Admin panel languages and texts + +The site's content languages (`i18n.locales`) and the **admin panel's** language are +separate. The panel's language is what each user picks in *Account → Language*. + +- **Default:** when the project's `buildConfig` has no `i18n.supportedLanguages`, ipal-kit + sets English and Polish. A project that sets its own list keeps it, untouched: + + ```ts + import { en } from 'payload/i18n/en' + import { de } from 'payload/i18n/de' + + export default buildConfig({ i18n: { supportedLanguages: { en, de } }, /* … */ }) + ``` + +- **Field and global texts** the plugin ships (labels, descriptions, options, tabs, groups) + are `{ en, pl }` objects (type `AdminText`). Change one through the override options — + `globalOverrides`, `collectionOverrides` — like any other field setting. +- **Component texts** (statistics view, test e-mail, integration alerts, cookie scan…) live in + `adminTexts` (`{ en: {…}, pl: {…} }`) and are read through Payload's translations under + the `ipal` namespace. Override any key per language; your value wins: + + ```ts + export default buildConfig({ + i18n: { translations: { pl: { ipal: { statsHeading: 'Ruch na stronie' } } } }, + }) + ``` + + A language the plugin has no texts for (e.g. `de`) gets the English ones until you + add yours. +- **Building blocks** for your own admin components: `ipalT(t, key, vars)` reads a plugin + text through Payload's `t`; `formatNumber(n, language)` and `formatDateTime(iso, language, timeZone?)` + format in the admin language; `defineTexts({ en, pl })` declares a text set whose Polish keys + must match the English ones; `ADMIN_LANGUAGES` lists the plugin's languages; + `applyAdminI18n(config)` is the config step itself (already applied by `ipalKit`). +- **Wording rules** for every label you add: [dev/admin-ux.md](./dev/admin-ux.md). +- **Verify:** switch *Account → Language* to Polski — every plugin global, collection and + view reads in Polish; `pnpm test` runs `test/adminUx.test.ts` in the plugin. + ## Turn off, override, extend - `i18n` is required — the module cannot be turned off; one language = mode without the `/pl` prefix. @@ -382,3 +421,4 @@ about the matcher — paste it inline. This is a Next limitation, not a plugin o - Proxy: `createProxy` with options (`consentCategory`, `cookieName`, `exposeHeaders`, `markdown`, `policyVersion`) or your own proxy on `createLocaleMiddleware` + `negotiateLocale` / `matchAcceptLanguage`. - Switcher: `LanguageSwitcher` (`classNames`, `renderLabel`) or your own on `useAlternateLinks()`. - Paths: `buildLocalizedPath` / `switchLocalePath` with `homeSlug` and `prefix` — for your own link helpers. +- Admin languages: your own `i18n.supportedLanguages` wins over the plugin's en + pl default; component texts via `i18n.translations..ipal.`. diff --git a/docs/integrations.md b/docs/integrations.md index c058b73..c803f13 100644 --- a/docs/integrations.md +++ b/docs/integrations.md @@ -1,4 +1,4 @@ -# integrations — the Site Integrations global and integration status in the admin panel +# integrations — the Site integrations global and integration status in the admin panel External service keys edited in the admin panel, plus a notice for the editor when one of them stops working — no crons, no polling: the server records the status when it actually uses an integration. @@ -6,7 +6,7 @@ stops working — no crons, no polling: the server records the status when it ac Related: [email.md](./email.md) (SMTP/Graph), [turnstile.md](./turnstile.md), [analytics.md](./analytics.md), [seo.md](./seo.md) (IndexNow), [deployment.md](./deployment.md). -## The `site-integrations` global (panel: Settings → Site Integrations) +## The `site-integrations` global (panel: Settings → Site integrations) Currently always added by the plugin. Tabs (unnamed — flat data, e.g. `ga4MeasurementId`): @@ -36,7 +36,7 @@ The "Send test" button (SMTP) calls `POST /api/ipal/test-email` (endpoint curren - **Changing keys in the admin panel** (Turnstile, `emailTransport` / `smtp*`) clears that integration's old status. - **`IntegrationAlerts`** (`@intecion/ipal-kit/admin`) — the plugin always wires it into `admin.components.beforeDashboard`: a list of integrations in the `degraded` state + Turnstile key - problems + an "Open Site Integrations" link (from `adminRoute`). When everything works it renders nothing. + problems + an "Open Site integrations" link (from `adminRoute`). When everything works it renders nothing. - **`IntegrationStatusBanner`** (`/admin`) — a banner on the tab: red on error (message, code, since when), a green line after a fix, nothing before first use. @@ -49,7 +49,9 @@ import { buildIntegrationStatusBanner, buildIntegrationStatusField, recordIntegr ipalKit({ integrationsFields: [ - buildIntegrationStatusBanner('crmStatus', 'CRM'), // UI field `crmStatusBanner` + // UI field `crmStatusBanner`; label as a string or { en, pl }; optional third argument + // { failing, hint } = keys of your own texts in i18n.translations..ipal + buildIntegrationStatusBanner('crmStatus', { en: 'CRM', pl: 'CRM' }), { name: 'crmApiKey', type: 'text' }, buildIntegrationStatusField('crmStatus'), // hidden group: state, code, message, since, checkedAt ], @@ -62,10 +64,14 @@ await recordIntegrationStatus(payload, 'crmStatus', previous, { state: 'ok' }) After adding the banner: `pnpm payload generate:importmap`; Postgres: `migrate:create`. -Types: `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus`. The dashboard -`IntegrationAlerts` checks only `emailStatus` and `turnstileStatus` by default (prop `checks`) — -to show your own integration, wire a second `IntegrationAlerts` with `checks: { crmStatus: 'CRM' }` -into `beforeDashboard`. +Types: `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus`, `IntegrationLabel` +(`string | { en, pl }`), `IntegrationBannerTexts` (`{ failing, hint }` — text keys). Without +texts the banner says "{label} is not working."; the plugin's own banners use +`statusEmailFailing` / `statusEmailHint` and `statusTurnstileFailing` / `statusTurnstileHint` +(override per language in `i18n.translations..ipal`, see i18n.md "Admin panel languages and texts"). +The dashboard `IntegrationAlerts` checks only `emailStatus` and `turnstileStatus` by default +(prop `checks`, labels as strings or `{ en, pl }`) — to show your own integration, wire a second +`IntegrationAlerts` with `checks: { crmStatus: 'CRM' }` into `beforeDashboard`. ## Turn off / override @@ -73,5 +79,5 @@ into `beforeDashboard`. are **currently always added** — there is no option to turn them off. Workaround: a project plugin wired after `ipalKit()` that removes / replaces the entry in `config.globals`, `config.endpoints` or `admin.components.beforeDashboard`. -- Extension: `integrationsFields` (Custom tab). The plugin's tabs, access and labels cannot +- Extension: `integrationsFields` (the *More* tab). The plugin's tabs, access and labels cannot currently be overridden with an option. diff --git a/docs/lightbox.md b/docs/lightbox.md index 91c22d1..8d12a11 100644 --- a/docs/lightbox.md +++ b/docs/lightbox.md @@ -170,8 +170,8 @@ drops every inline style; style with `classNames` (`dialog`, `figure`, `image`, | Feature | Default | Turn off / override | |---|---|---| | Whole feature | off — nothing renders without a trigger | don't use the components | -| Notifications → Lightbox labels | off | `ipalKit({ lightbox: true })`; `lightboxNotificationFields` for your own global; `globalOverrides.notifications` | -| Texts | panel → `LIGHTBOX_FALLBACK` (English) | `texts` on the provider / trigger / dialog; `resolveLightboxTexts` | +| Form messages → Image viewer labels | off | `ipalKit({ lightbox: true })`; `lightboxNotificationFields` for your own global; `globalOverrides.notifications` | +| Texts | panel → `lightboxFallback(locale)` (`LIGHTBOX_FALLBACK_PL` on `pl`, else `LIGHTBOX_FALLBACK`) | `texts` on the provider / trigger / dialog; `resolveLightboxTexts` | | Provider in `SiteProviders` | off | `lightbox` prop; or your own `` in a client component | | Large image markup | `` | `renderImage={({ image, imgProps, index }) => }` (provider, client only) | | The whole viewer | `LightboxDialog` | `renderDialog={(props) => }` — same props, your markup | @@ -181,7 +181,7 @@ drops every inline style; style with `classNames` (`dialog`, `figure`, `image`, | Look | inline styles from `--ipal-lightbox-*` | CSS variables; `unstyled` + `classNames` + `data-ipal` | Building blocks: `lightboxImage`, `lightboxIndex` (wrap / clamp), `formatLightboxCounter`, -`resolveLightboxTexts`, `LIGHTBOX_FALLBACK`, `prefersReducedMotion`, `useOptionalLightbox` (null +`resolveLightboxTexts(texts, locale?)`, `LIGHTBOX_FALLBACK`, `LIGHTBOX_FALLBACK_PL`, `lightboxFallback`, `prefersReducedMotion`, `useOptionalLightbox` (null outside a provider), `useLightbox`, `LightboxDialog`. ## Replacing a hand-made modal (migration) @@ -191,7 +191,7 @@ Projects built before this feature open images in different ways: a `glightbox` to the shared lightbox: 1. **Config:** `ipalKit({ lightbox: true })`, then `pnpm payload migrate:create` (Postgres) and commit - the migration. Fill **Settings → Notifications → Lightbox** in every language — copy the labels + the migration. Fill **Forms → Form messages → Image viewer** in every language — copy the labels from the old block fields (e.g. `closeLabel`, `prevLabel`, `nextLabel`) or seed them. 2. **Layout:** ``. 3. **Gallery block:** replace the clickable `
` / custom `