Docs in English (part 1), seeding guide, Coolify deployment
- Translate to English every doc the code branches did not touch: AGENT.md, developer guide, vibe, CHANGELOG, docs index, module pages, all skills except ipal-seo-check (14 pages follow after the security/SEO merge). Placeholder marker is now [TO FILL: …]; skill resources renamed to section-code.md / nav-code.md. AGENT.md and the ipal-skills pointer block say the docs are in English. - docs/seeding.md: create-only, natural keys, never delete, no users or secrets, empty-field globals, fallbackLocale: false, dry run, backup and restore, production update guard, seeds vs migrations, Coolify Terminal. Seed templates gain --dry-run, the SEED_UPDATE production guard (IPAL_SEED_ALLOW_PROD_UPDATE), skip of edited records and a summary. "Seeding on production" rule block in AGENT.md. - Coolify is the single deployment path (deployment, env, developer guide, ipal-setup): build vs runtime env, migrations on container start (prodMigrations), health check and rolling updates, rollback, backups and restore, DNS/Let's Encrypt/CAA. R2: custom domain needs a Cloudflare zone; default is media served by the app (R2_PUBLIC_URL empty). - docsConsistency: no Polish prose outside code/quoted data (pending pages listed); IPAL_* names may also be read by shipped skill templates. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
6e3979bae6
commit
2d9f3e15d4
@@ -5,190 +5,192 @@ description: Complete map of everything @intecion/ipal-kit provides — every ip
|
||||
|
||||
# ipal-reference
|
||||
|
||||
## Jak używać
|
||||
- **Najpierw tutaj**, potem kod. Szukasz funkcji → `grep -n "<słowo>" resources/api.md`
|
||||
(`resources/api.md` — każdy eksport: import, do czego). Opis modułu:
|
||||
`node_modules/@intecion/ipal-kit/docs/<strona>.md` (kolumna „szczegóły”).
|
||||
- **Plugin pomaga, nie ogranicza:** każdy moduł da się wyłączyć, każdy domyślny element nadpisać,
|
||||
config projektu wygrywa, klocki (`build*`, `create*`) są eksportowane — złożysz z nich własną wersję.
|
||||
- Brak opcji / zachowanie niezgodne z docs → skill **ipal-plugin-gap** (raport). Nigdy nie łataj `node_modules`.
|
||||
- Stan opisany wg kodu 1.12.x. „obecnie zawsze” = nie ma dziś opcji wyłączenia (luka → ipal-plugin-gap).
|
||||
## How to use
|
||||
- **Look here first**, then at the code. Looking for a function → `grep -n "<word>" resources/api.md`
|
||||
(`resources/api.md` — every export: import, what it does). Module description:
|
||||
`node_modules/@intecion/ipal-kit/docs/<page>.md` (the "details" column).
|
||||
- **The plugin helps, never limits:** every module can be turned off, every default can be overridden,
|
||||
the project config wins, the building blocks (`build*`, `create*`) are exported — compose your own version from them.
|
||||
- Missing option / behaviour that does not match the docs → skill **ipal-plugin-gap** (report). Never patch `node_modules`.
|
||||
- Described per the 1.12.x code. "currently always" = no option to turn it off today (gap → ipal-plugin-gap).
|
||||
|
||||
## 1. Opcje `ipalKit({...})` (`IpalOptions`, `dist/types.d.ts`)
|
||||
## 1. `ipalKit({...})` options (`IpalOptions`, `dist/types.d.ts`)
|
||||
|
||||
| opcja | domyślnie | co dodaje / zmienia | jak wyłączyć / nadpisać |
|
||||
| option | default | what it adds / changes | how to turn off / override |
|
||||
|---|---|---|---|
|
||||
| `i18n` **(wymagane)** | — | `config.localization` (zawsze nadpisywane); walidacja od razu przy `ipalKit()` (rzuca przy złym configu) | jedno źródło: `src/i18n.config.ts`; własne `localization` w configu i tak zostanie nadpisane |
|
||||
| `i18n.defaultLocale` | — | `localization.defaultLocale`, przekierowanie `/` w proxy | musi być w `locales` |
|
||||
| `i18n` **(required)** | — | `config.localization` (always overwritten); validated right away in `ipalKit()` (throws on a bad config) | one source: `src/i18n.config.ts`; your own `localization` in the config gets overwritten anyway |
|
||||
| `i18n.defaultLocale` | — | `localization.defaultLocale`, `/` redirect in the proxy | must be in `locales` |
|
||||
| `i18n.fallback` | `true` | `localization.fallback` | `false` |
|
||||
| `i18n.locales[]` `{ code, label, rtl? }` | — | lista języków (min. 1); `rtl: true` → `rtl` w Payload | dodanie języka: skill **ipal-locale-add** |
|
||||
| `access` | brak | pole `roles` (`user` < `editor` < `admin`, `saveToJWT`) w kolekcji auth | pomiń → **brak ról**: nikt nie jest adminem dla Site Integrations, test e-maila, statystyk, consent-records; `form-submissions` czyta tylko editor+ |
|
||||
| `access.authCollection` | — (wymagane w `access`) | kolekcja, do której trafia `roles`; też slug wstrzykiwanej kolekcji auth | własna kolekcja o tym slugu wygrywa |
|
||||
| `access.defaultRole` | `'user'` | `defaultValue` pola `roles` | `'editor'` / `'admin'` |
|
||||
| `adminRoute` | `'/admin'` | `config.routes.admin`; link i widoki statystyk, `IntegrationAlerts` | projekt sam przenosi `app/(payload)/<route>/` i wpisuje route w matcher proxy (security.md) |
|
||||
| `twoFactor` | **brak = błąd** | `@clocklimited/payload-2fa` z `forceSetup: true` (TOTP wymuszone, sprawdzane też w API) | `twoFactor: false` (odradzane); pominięcie opcji rzuca `[ipal] twoFactor.issuer is required` |
|
||||
| `twoFactor.issuer` | — (wymagane) | nazwa w aplikacji uwierzytelniającej | — |
|
||||
| `twoFactor.plugin` | — (wymagane) | wstrzyknięty `payloadTotp` (plugin nie importuje peera) | brak funkcji → rzuca |
|
||||
| `twoFactor.collectionSlug` | `'users'` | kolekcja z 2FA | **nie** bierze `access.authCollection` — przy innym slugu podaj oba |
|
||||
| `whiteLabel` | brak | `admin.components.graphics.Logo/Icon` (`AdminLogo`/`AdminIcon`) z Site Settings + kredyt dostawcy | pomiń / `false`; `true` = domyślne |
|
||||
| `whiteLabel.settingsSlug` | `'site-settings'` | global, z którego czyta logo/nazwę | — |
|
||||
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | pola w Site Settings | dowolne pole upload/tekst |
|
||||
| `whiteLabel.titleSuffix` | brak | `admin.meta.titleSuffix` (tytuł karty) | — |
|
||||
| `whiteLabel.credit` | wł. | `IntecionCredit` w `afterLogin` i `afterNavLinks` | `false`; `{ text, url }` nadpisuje |
|
||||
| `pages` | brak | Site Settings → zakładki **System Pages** (role stron) i **Under construction** | pomiń → brak obu zakładek |
|
||||
| `pages.slug` | — (wymagane w `pages`) | kolekcja stron projektu (relacje System Pages, construction, IndexNow) | — |
|
||||
| `pages.roles` | wszystkie: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` | które przypisania pokazać | podzbiór tablicy |
|
||||
| `content` | brak | pole `<slug>Archive` w System Pages per kolekcja (URL wpisów = slug strony archiwum) | **bez `pages` ignorowane** (brak pól archiwum; IndexNow nadal działa) |
|
||||
| `content.collections[]` `{ slug, label?, perPage? }` | `label` = slug, `perPage` 10 | wpis do archiwum; ta sama wartość idzie do `createContentHelpers({ content })` | kolekcję tworzy projekt (skill **ipal-collection**) |
|
||||
| `seo` | brak | `@payloadcms/plugin-seo` (grupa `meta` + `titleOverride`), zakładki Content/SEO, hook auto-fill | pomiń |
|
||||
| `seo.collections` | — (wymagane) | kolekcje z `meta` | — |
|
||||
| `seo.autoFill` | `{ title: 'title', content: 'layout', descriptionLength: 155 }` | `beforeChange`: pusty `meta.title/description` z pól dokumentu | `false`; obiekt `{ title, description, content, descriptionLength }` |
|
||||
| `seo.descriptionCheck` | wł. (`settingsSlug: 'site-settings'`, `siteDescriptionField: 'siteDescription'`) | pole UI `MetaDescriptionCheck` pod opisem (pusty / powtórzony) | `false`; obiekt nadpisuje slug/pole |
|
||||
| `seo.fields` | `[]` | dodatkowe pola w grupie SEO | — |
|
||||
| `seo.generateTitle` / `generateDescription` | plugin-seo | podgląd / generowanie w panelu | własna funkcja `({ doc }) => string` |
|
||||
| — (brak opcji) | `uploadsCollection: 'media'` | obraz meta z kolekcji `media` | obecnie zawsze `media` (luka) |
|
||||
| `forms` | brak | `@payloadcms/plugin-form-builder`: kolekcje `forms`, `form-submissions` | pomiń |
|
||||
| `forms.adminGroup` | `'Forms'` | grupa w sidebarze | `false` = domyślna Payloada; `admin.group` w overrides wygrywa |
|
||||
| `forms.fields.*` | wł.: `checkbox`, `checkboxGroup`, `country`, `date`, `email`, `message`, `number`, `radio`, `select`, `state`, `step`, `text`, `textarea`, `time`; wył.: `payment` | typy bloków w kreatorze (wszystkie z „Show only when”) | `<typ>: false`; obiekt bloku podmienia; `payment: true` **nic nie robi** (przefiltrowane) — podaj obiekt bloku |
|
||||
| `forms.formOverrides` | etykiety Form/Forms, `emails` czytelne tylko dla zalogowanych | nadpisanie kolekcji `forms` (`fields: ({ defaultFields }) => …`, `slug`, `admin`, `access`…) | dowolny `CollectionConfig` |
|
||||
| `forms.formSubmissionOverrides` | create: zalogowani, read: editor+, delete: admin | nadpisanie `form-submissions` | `access.create` itd. wygrywa |
|
||||
| `forms.redirectRelationships` | brak | kolekcje, do których formularz przekierowuje | `['pages']` |
|
||||
| `forms.emailLayout` | `false` | `beforeEmail` z layoutem (logo, kolor, stopka) + zakładka Site Settings → **Emails**; `{{*:table}}` czytelne | `true` |
|
||||
| `forms.beforeEmail` | brak | własna modyfikacja maili (po layoucie) | funkcja form-buildera |
|
||||
| `forms.consentFieldName` | (`'consent'`) | **obecnie nieużywane przez plugin** — nazwę pola zgody podajesz w `createSubmitAction({ consentFieldName })` / `submitForm` | — |
|
||||
| `consentLog` | wył. | kolekcja `consent-records` + `POST /api/ipal/consent` (rate limit 20/min) | `true` / `{ retentionDays }` (domyślnie 1095) |
|
||||
| `stats` | wył. | kolekcja `stats-visits`, `POST /api/ipal/hit`, widok `/<admin>/stats`, link w nav, wykres na dashboardzie | `true` / obiekt |
|
||||
| `stats.retentionDays` / `timeZone` / `dashboard` | 90 / `'Europe/Warsaw'` / `true` | czas przechowania, granica dnia, `StatsWidget` | `dashboard: false` chowa wykres |
|
||||
| `indexNow` | `false` | hook `afterChange` (publikacja → IndexNow, tylko produkcja + https) w kolekcji `pages.slug ?? 'pages'` i każdej z `content` | `true` + trasa `indexnow-key.txt` |
|
||||
| `siteSettingsFields` | brak | zakładka **Custom** w Site Settings | `Field[]` |
|
||||
| `integrationsFields` | brak | zakładka **Custom** w Site Integrations | `Field[]` |
|
||||
| `enabled` | `true` | `false` → plugin **zwraca config bez zmian**: znikają wstrzyknięte kolekcje, globale, endpointy, 2FA, role (dane w bazie zostają, panel ich nie widzi); `i18n` i tak walidowane | `false` |
|
||||
| `i18n.locales[]` `{ code, label, rtl? }` | — | list of languages (min. 1); `rtl: true` → `rtl` in Payload | adding a language: skill **ipal-locale-add** |
|
||||
| `access` | none | `roles` field (`user` < `editor` < `admin`, `saveToJWT`) in the auth collection | omit → **no roles**: nobody is admin for Site Integrations, the e-mail test, stats, consent-records; `form-submissions` readable by editor+ only |
|
||||
| `access.authCollection` | — (required in `access`) | collection that gets `roles`; also the slug of the injected auth collection | your own collection with that slug wins |
|
||||
| `access.defaultRole` | `'user'` | `defaultValue` of the `roles` field | `'editor'` / `'admin'` |
|
||||
| `adminRoute` | `'/admin'` | `config.routes.admin`; stats link and views, `IntegrationAlerts` | the project moves `app/(payload)/<route>/` itself and adds the route to the proxy matcher (security.md) |
|
||||
| `twoFactor` | **none = error** | `@clocklimited/payload-2fa` with `forceSetup: true` (TOTP enforced, also checked in the API) | `twoFactor: false` (discouraged); omitting the option throws `[ipal] twoFactor.issuer is required` |
|
||||
| `twoFactor.issuer` | — (required) | name in the authenticator app | — |
|
||||
| `twoFactor.plugin` | — (required) | injected `payloadTotp` (the plugin does not import the peer) | missing function → throws |
|
||||
| `twoFactor.collectionSlug` | `'users'` | collection with 2FA | does **not** take `access.authCollection` — with a different slug, set both |
|
||||
| `whiteLabel` | none | `admin.components.graphics.Logo/Icon` (`AdminLogo`/`AdminIcon`) from Site Settings + vendor credit | omit / `false`; `true` = defaults |
|
||||
| `whiteLabel.settingsSlug` | `'site-settings'` | global it reads the logo/name from | — |
|
||||
| `whiteLabel.logoField` / `iconField` / `nameField` | `'logo'` / `'favicon'` / `'siteName'` | fields in Site Settings | any upload/text field |
|
||||
| `whiteLabel.titleSuffix` | none | `admin.meta.titleSuffix` (tab title) | — |
|
||||
| `whiteLabel.credit` | on | `IntecionCredit` in `afterLogin` and `afterNavLinks` | `false`; `{ text, url }` overrides |
|
||||
| `pages` | none | Site Settings → **System Pages** (page roles) and **Under construction** tabs | omit → neither tab |
|
||||
| `pages.slug` | — (required in `pages`) | the project's pages collection (System Pages relations, construction, IndexNow) | — |
|
||||
| `pages.roles` | all: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` | which assignments to show | subset of the array |
|
||||
| `content` | none | `<slug>Archive` field in System Pages per collection (entry URL = archive page slug) | **ignored without `pages`** (no archive fields; IndexNow still works) |
|
||||
| `content.collections[]` `{ slug, label?, perPage? }` | `label` = slug, `perPage` 10 | archive entry; the same value goes to `createContentHelpers({ content })` | the project creates the collection (skill **ipal-collection**) |
|
||||
| `seo` | none | `@payloadcms/plugin-seo` (`meta` group + `titleOverride`), Content/SEO tabs, auto-fill hook | omit |
|
||||
| `seo.collections` | — (required) | collections with `meta` | — |
|
||||
| `seo.autoFill` | `{ title: 'title', content: 'layout', descriptionLength: 155 }` | `beforeChange`: empty `meta.title/description` filled from document fields | `false`; object `{ title, description, content, descriptionLength }` |
|
||||
| `seo.descriptionCheck` | on (`settingsSlug: 'site-settings'`, `siteDescriptionField: 'siteDescription'`) | UI field `MetaDescriptionCheck` below the description (empty / duplicated) | `false`; object overrides slug/field |
|
||||
| `seo.fields` | `[]` | extra fields in the SEO group | — |
|
||||
| `seo.generateTitle` / `generateDescription` | plugin-seo | preview / generation in the panel | your own function `({ doc }) => string` |
|
||||
| — (no option) | `uploadsCollection: 'media'` | meta image from the `media` collection | currently always `media` (gap) |
|
||||
| `forms` | none | `@payloadcms/plugin-form-builder`: `forms`, `form-submissions` collections | omit |
|
||||
| `forms.adminGroup` | `'Forms'` | sidebar group | `false` = Payload default; `admin.group` in overrides wins |
|
||||
| `forms.fields.*` | on: `checkbox`, `checkboxGroup`, `country`, `date`, `email`, `message`, `number`, `radio`, `select`, `state`, `step`, `text`, `textarea`, `time`; off: `payment` | block types in the builder (all with "Show only when") | `<type>: false`; a block object replaces it; `payment: true` **does nothing** (filtered out) — pass a block object |
|
||||
| `forms.formOverrides` | Form/Forms labels, `emails` readable by logged-in users only | overrides the `forms` collection (`fields: ({ defaultFields }) => …`, `slug`, `admin`, `access`…) | any `CollectionConfig` |
|
||||
| `forms.formSubmissionOverrides` | create: logged-in, read: editor+, delete: admin | overrides `form-submissions` | `access.create` etc. wins |
|
||||
| `forms.redirectRelationships` | none | collections a form can redirect to | `['pages']` |
|
||||
| `forms.emailLayout` | `false` | `beforeEmail` with a layout (logo, colour, footer) + Site Settings → **Emails** tab; `{{*:table}}` readable | `true` |
|
||||
| `forms.beforeEmail` | none | your own e-mail changes (after the layout) | form-builder function |
|
||||
| `forms.consentFieldName` | (`'consent'`) | **currently unused by the plugin** — pass the consent field name in `createSubmitAction({ consentFieldName })` / `submitForm` | — |
|
||||
| `consentLog` | off | `consent-records` collection + `POST /api/ipal/consent` (rate limit 20/min) | `true` / `{ retentionDays }` (default 1095) |
|
||||
| `stats` | off | `stats-visits` collection, `POST /api/ipal/hit`, `/<admin>/stats` view, nav link, dashboard chart | `true` / object |
|
||||
| `stats.retentionDays` / `timeZone` / `dashboard` | 90 / `'Europe/Warsaw'` / `true` | retention, day boundary, `StatsWidget` | `dashboard: false` hides the chart |
|
||||
| `indexNow` | `false` | `afterChange` hook (publish → IndexNow, production + https only) in the `pages.slug ?? 'pages'` collection and each one from `content` | `true` + `indexnow-key.txt` route |
|
||||
| `siteSettingsFields` | none | **Custom** tab in Site Settings | `Field[]` |
|
||||
| `integrationsFields` | none | **Custom** tab in Site Integrations | `Field[]` |
|
||||
| `enabled` | `true` | `false` → the plugin **returns the config unchanged**: injected collections, globals, endpoints, 2FA and roles disappear (data stays in the database, the panel does not see it); `i18n` is validated anyway | `false` |
|
||||
|
||||
## 2. Co plugin wstrzykuje sam
|
||||
## 2. What the plugin adds by itself
|
||||
|
||||
| element | co | kontroluje | wyłączenie dziś |
|
||||
| element | what | controlled by | turning off today |
|
||||
|---|---|---|---|
|
||||
| kolekcja auth (`users`) | `{ slug, auth: true, useAsTitle: 'email' }`, gdy projekt jej nie ma (slug: `access.authCollection` → `twoFactor.collectionSlug` → `admin.user` → `'users'`) | własna kolekcja o tym slugu | własna wygrywa |
|
||||
| `forms`, `form-submissions` | form-builder + ipal bloki `step`, `checkboxGroup`, `time` | `forms` | pomiń `forms` |
|
||||
| `consent-records` | dowód zgody (id, wybory, wersja polityki) | `consentLog` | domyślnie wył. |
|
||||
| `stats-visits` | wizyty bez IP (admin czyta/usuwa) | `stats` | domyślnie wył. |
|
||||
| global `site-settings` | General, Theme, [System Pages], [Emails], [Under construction], [Custom]; publiczny odczyt | `pages`, `content`, `forms.emailLayout`, `siteSettingsFields` | **obecnie zawsze** |
|
||||
| global `site-integrations` | Analytics, Turnstile, SMTP, IndexNow, [Custom]; tylko admin | `integrationsFields` | **obecnie zawsze** |
|
||||
| global `cookie-settings` | teksty banera, kategorie, lista cookies | — | **obecnie zawsze** |
|
||||
| global `notifications` | komunikaty formularzy per język | — | **obecnie zawsze** |
|
||||
| `POST /api/ipal/test-email` | test SMTP/Graph (tylko admin) | — | **obecnie zawsze** |
|
||||
| `POST /api/ipal/consent` | zapis zgody | `consentLog` | wył. domyślnie |
|
||||
| `POST /api/ipal/hit` | odsłona do statystyk | `stats` | wył. domyślnie |
|
||||
| `localization` | z `i18n` | `i18n` | **obecnie zawsze** |
|
||||
| `routes.admin` | z `adminRoute` | `adminRoute` | — |
|
||||
| hook `beforeChange` auto-fill meta | w `seo.collections` | `seo.autoFill` | `autoFill: false` |
|
||||
| hook `afterChange` IndexNow | pages + content | `indexNow` | wył. domyślnie |
|
||||
| `onInit` | migracja przycisku Cookie Settings + log `[ipal] Plugin initialized.` (Twój `onInit` leci pierwszy) | — | **obecnie zawsze** |
|
||||
| auth collection (`users`) | `{ slug, auth: true, useAsTitle: 'email' }`, when the project has none (slug: `access.authCollection` → `twoFactor.collectionSlug` → `admin.user` → `'users'`) | your own collection with that slug | yours wins |
|
||||
| `forms`, `form-submissions` | form-builder + ipal blocks `step`, `checkboxGroup`, `time` | `forms` | omit `forms` |
|
||||
| `consent-records` | proof of consent (id, choices, policy version) | `consentLog` | off by default |
|
||||
| `stats-visits` | visits without IP (admin reads/deletes) | `stats` | off by default |
|
||||
| global `site-settings` | General, Theme, [System Pages], [Emails], [Under construction], [Custom]; public read | `pages`, `content`, `forms.emailLayout`, `siteSettingsFields` | **currently always** |
|
||||
| global `site-integrations` | Analytics, Turnstile, SMTP, IndexNow, [Custom]; admin only | `integrationsFields` | **currently always** |
|
||||
| global `cookie-settings` | banner texts, categories, cookie list | — | **currently always** |
|
||||
| global `notifications` | form messages per language | — | **currently always** |
|
||||
| `POST /api/ipal/test-email` | SMTP/Graph test (admin only) | — | **currently always** |
|
||||
| `POST /api/ipal/consent` | saves consent | `consentLog` | off by default |
|
||||
| `POST /api/ipal/hit` | page view for stats | `stats` | off by default |
|
||||
| `localization` | from `i18n` | `i18n` | **currently always** |
|
||||
| `routes.admin` | from `adminRoute` | `adminRoute` | — |
|
||||
| `beforeChange` meta auto-fill hook | in `seo.collections` | `seo.autoFill` | `autoFill: false` |
|
||||
| `afterChange` IndexNow hook | pages + content | `indexNow` | off by default |
|
||||
| `onInit` | Cookie Settings button migration + log `[ipal] Plugin initialized.` (your `onInit` runs first) | — | **currently always** |
|
||||
|
||||
**Import map** (`@intecion/ipal-kit/admin#…`) — po każdej zmianie opcji: `pnpm generate:importmap`
|
||||
(`pnpm payload generate:importmap`), inaczej panel jest pusty / brak komponentu.
|
||||
**Import map** (`@intecion/ipal-kit/admin#…`) — after every option change: `pnpm generate:importmap`
|
||||
(`pnpm payload generate:importmap`), otherwise the panel is blank / a component is missing.
|
||||
|
||||
| komponent | gdzie | warunek |
|
||||
| component | where | condition |
|
||||
|---|---|---|
|
||||
| `AdminLogo`, `AdminIcon` | `graphics.Logo/Icon` | `whiteLabel` |
|
||||
| `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` i `credit !== false` |
|
||||
| `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, widok, dashboard | `stats` (`dashboard: false` bez widgetu) |
|
||||
| `IntegrationAlerts` | `beforeDashboard` | **obecnie zawsze** (nic nie renderuje, gdy wszystko działa) |
|
||||
| `IntegrationStatusBanner` | pole UI w zakładkach Site Integrations | zawsze (z globalem) |
|
||||
| `MaskedField` | sekrety SMTP / Turnstile | zawsze |
|
||||
| `TestEmailButton` | Site Integrations → SMTP | zawsze |
|
||||
| `MetaDescriptionCheck` | pod `meta.description` | `seo` i `descriptionCheck !== false` |
|
||||
| `RowLabel` | etykiety wierszy array | tylko gdy projekt użyje `rowLabel(...)` (admin-ui) |
|
||||
| `IntecionCredit` | `afterLogin`, `afterNavLinks` | `whiteLabel` and `credit !== false` |
|
||||
| `StatsNavLink`, `StatsView` (`views.ipalStats`, `/stats`), `StatsWidget` (`beforeDashboard`) | nav, view, dashboard | `stats` (`dashboard: false` without the widget) |
|
||||
| `IntegrationAlerts` | `beforeDashboard` | **currently always** (renders nothing when everything works) |
|
||||
| `IntegrationStatusBanner` | UI field in the Site Integrations tabs | always (with the global) |
|
||||
| `MaskedField` | SMTP / Turnstile secrets | always |
|
||||
| `TestEmailButton` | Site Integrations → SMTP | always |
|
||||
| `MetaDescriptionCheck` | below `meta.description` | `seo` and `descriptionCheck !== false` |
|
||||
| `RowLabel` | array row labels | only when the project uses `rowLabel(...)` (admin-ui) |
|
||||
|
||||
## 3. Co projekt podpina sam
|
||||
## 3. What the project wires itself
|
||||
|
||||
Komplet obowiązkowy: AGENT.md §0b, skill **ipal-setup**; kontrola: **ipal-audit**, **ipal-seo-check**.
|
||||
`$U` = `NEXT_PUBLIC_SERVER_URL` (np. `http://localhost:3000`).
|
||||
Mandatory set: AGENT.md §0b, skill **ipal-setup**; checks: **ipal-audit**, **ipal-seo-check**.
|
||||
`$U` = `NEXT_PUBLIC_SERVER_URL` (e.g. `http://localhost:3000`).
|
||||
|
||||
| element | plik | minimalny przykład | jak sprawdzić | szczegóły |
|
||||
| element | file | minimal example | how to check | details |
|
||||
|---|---|---|---|---|
|
||||
| plugin | `src/payload.config.ts` | `plugins: [ipalKit({ i18n: i18nConfig, access: { authCollection: 'users' }, twoFactor: { issuer, plugin: payloadTotp }, … })]` | `pnpm dev` → log `[ipal] Plugin initialized.` | PROGRAMISTA §2.3 |
|
||||
| języki | `src/i18n.config.ts` | `export const i18nConfig = { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }] } as const satisfies I18nConfig` | `curl -sI $U/` → 3xx na `/pl` | i18n.md |
|
||||
| proxy | `src/proxy.ts` | `export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })` + `export const config = { matcher: ['/((?!api\|admin\|_next\|.*\\..*).*)'] }` (literał!) | `curl -sI $U/` → `/pl`; `curl -s -H 'Accept: text/markdown' $U/pl` → Markdown | i18n.md, PROGRAMISTA §2.6 |
|
||||
| proxy (Next 15 / własny) | `middleware`/`proxy.ts` | `createLocaleMiddleware({ config, … })` (`/next/middleware` lub główny entry) | jw. | i18n.md |
|
||||
| walidacja env | `src/instrumentation.ts` | `if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` z `@intecion/ipal-kit/env` | usuń zmienną → start pada z listą braków | env.md |
|
||||
| languages | `src/i18n.config.ts` | `export const i18nConfig = { defaultLocale: 'pl', locales: [{ code: 'pl', label: 'Polski' }] } as const satisfies I18nConfig` | `curl -sI $U/` → 3xx to `/pl` | i18n.md |
|
||||
| proxy | `src/proxy.ts` | `export const proxy = createProxy(i18nConfig, { NextResponse, markdown: true })` + `export const config = { matcher: ['/((?!api\|admin\|_next\|.*\\..*).*)'] }` (a literal!) | `curl -sI $U/` → `/pl`; `curl -s -H 'Accept: text/markdown' $U/pl` → Markdown | i18n.md, PROGRAMISTA §2.6 |
|
||||
| proxy (Next 15 / custom) | `middleware`/`proxy.ts` | `createLocaleMiddleware({ config, … })` (`/next/middleware` or the main entry) | as above | i18n.md |
|
||||
| env validation | `src/instrumentation.ts` | `if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true, ipHeader: true }))` from `@intecion/ipal-kit/env` | remove a variable → startup fails with the list of missing ones | env.md |
|
||||
| Next config | `next.config.ts` | `withPayload({ images: buildImagesConfig(), htmlLimitedBots: /Googlebot\|Bingbot…/i, headers: async () => [{ source: '/:path*', headers: buildSecurityHeaders({ hsts }) }, ...buildUploadSecurityHeaders()] })` | `curl -sI $U/pl \| grep -i 'x-content-type\|strict-transport'` | security.md, storage.md, PROGRAMISTA §2.9 |
|
||||
| CSP | `next.config.ts` | `buildCsp({ mode: 'report-only', … })` → potem `enforce` | konsola przeglądarki bez naruszeń | security.md |
|
||||
| dane / trasy | `src/lib/content.ts` | `export const { … } = createContentHelpers({ config, content, i18n: i18nConfig, baseUrl, markdownAlternate: true, summaryField: 'aiSummary', mcp: { serverName } })` | `pnpm tsc --noEmit` | frontend.md, PROGRAMISTA §2.7 |
|
||||
| layout | `app/(frontend)/[locale]/layout.tsx` | `const shell = await getSiteShell(locale)`; `<SiteProviders shell={shell} logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />} theme stats>` | HTML: `<script type="application/ld+json">` (WebSite+Organization), baner cookies | frontend.md, consent.md |
|
||||
| motyw | layout | `<SiteProviders theme>` (lub `<ThemeScript {...shell.theme} />` z `/rsc`), `<html suppressHydrationWarning>`; przełącznik `<ThemeSwitcher>` (`/client`) | `data-theme` na `<html>` przed hydracją | theme.md |
|
||||
| catch-all | `app/(frontend)/[locale]/[[...slug]]/page.tsx` | `export const revalidate = 3600`; `const route = createPageRoute(content, { blocks, notFound, permanentRedirect, blockProps })`; `export default route.Page`; `generateMetadata`, `generateStaticParams` | `curl -s $U/pl/<slug>` 200; zmień slug → stary daje 308 | frontend.md, pages.md |
|
||||
| 404 | `[locale]/not-found.tsx` + `notFoundView.ts` | `export default createNotFoundPage(content, { load: loadNotFoundView })`; `'use server'` `renderNotFoundView(content, { blocks }, locale)` | `curl -sI $U/pl/xyz` → 404 z treścią z System Pages | pages.md |
|
||||
| sitemap | `app/sitemap.xml/route.ts` | `export { sitemapRoute as GET } from '@/lib/content'` + `dynamic = 'force-dynamic'` (albo `sitemap.ts` z `sitemap` — nigdy oba) | `curl -s $U/sitemap.xml` (hreflang, styl XSL) | seo.md |
|
||||
| robots | `app/robots.ts` | `export { robots as default } from '@/lib/content'` | `curl -s $U/robots.txt` (Sitemap:, boty AI) | seo.md |
|
||||
| CSP | `next.config.ts` | `buildCsp({ mode: 'report-only', … })` → later `enforce` | browser console without violations | security.md |
|
||||
| data / routes | `src/lib/content.ts` | `export const { … } = createContentHelpers({ config, content, i18n: i18nConfig, baseUrl, markdownAlternate: true, summaryField: 'aiSummary', mcp: { serverName } })` | `pnpm tsc --noEmit` | frontend.md, PROGRAMISTA §2.7 |
|
||||
| layout | `app/(frontend)/[locale]/layout.tsx` | `const shell = await getSiteShell(locale)`; `<SiteProviders shell={shell} logEndpoint="/api/ipal/consent" banner={<CookieBanner equalChoice settings="detailed" />} theme stats>` | HTML: `<script type="application/ld+json">` (WebSite+Organization), cookie banner | frontend.md, consent.md |
|
||||
| theme | layout | `<SiteProviders theme>` (or `<ThemeScript {...shell.theme} />` from `/rsc`), `<html suppressHydrationWarning>`; switcher `<ThemeSwitcher>` (`/client`) | `data-theme` on `<html>` before hydration | theme.md |
|
||||
| catch-all | `app/(frontend)/[locale]/[[...slug]]/page.tsx` | `export const revalidate = 3600`; `const route = createPageRoute(content, { blocks, notFound, permanentRedirect, blockProps })`; `export default route.Page`; `generateMetadata`, `generateStaticParams` | `curl -s $U/pl/<slug>` 200; change the slug → the old one gives 308 | frontend.md, pages.md |
|
||||
| 404 | `[locale]/not-found.tsx` + `notFoundView.ts` | `export default createNotFoundPage(content, { load: loadNotFoundView })`; `'use server'` `renderNotFoundView(content, { blocks }, locale)` | `curl -sI $U/pl/xyz` → 404 with content from System Pages | pages.md |
|
||||
| sitemap | `app/sitemap.xml/route.ts` | `export { sitemapRoute as GET } from '@/lib/content'` + `dynamic = 'force-dynamic'` (or `sitemap.ts` with `sitemap` — never both) | `curl -s $U/sitemap.xml` (hreflang, XSL style) | seo.md |
|
||||
| robots | `app/robots.ts` | `export { robots as default } from '@/lib/content'` | `curl -s $U/robots.txt` (Sitemap:, AI bots) | seo.md |
|
||||
| manifest | `app/manifest.ts` | `export { manifest as default }` + `force-dynamic` | `curl -s $U/manifest.webmanifest` | seo.md |
|
||||
| llms | `app/llms.txt/route.ts`, `app/llms-full.txt/route.ts` | `export { llmsRoute as GET }` / `llmsFullRoute` + `force-dynamic` | `curl -s $U/llms.txt` | seo.md |
|
||||
| Markdown | `app/md/[locale]/[[...slug]]/route.ts` | `export { markdownRoute as GET }` + `force-dynamic` | `curl -s $U/md/pl` | content.md |
|
||||
| MCP | `app/api/mcp/route.ts` | `export { mcpGET as GET, mcpPOST as POST }` + `force-dynamic` | `curl -s -X POST $U/api/mcp -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'` | mcp.md |
|
||||
| health | `app/api/health/route.ts` | `export { healthRoute as GET }` + `force-dynamic` | `curl -s $U/api/health` → `"status":"ok"` (503 przy błędzie bazy) | deployment.md |
|
||||
| IndexNow klucz | `app/indexnow-key.txt/route.ts` | `export { indexNowKeyRoute as GET }` + `force-dynamic` | `curl -s $U/indexnow-key.txt` = klucz | seo.md |
|
||||
| wyszukiwarka (opcja) | `app/api/search/route.ts` | `export const GET = createSearchRoute({ getCachedPayload, config: i18nConfig, baseUrl })` | `curl -s "$U/api/search?q=test&locale=pl"` | content.md |
|
||||
| Pages | `src/collections/Pages.ts` | `buildSlugField({ from: 'title' })`, `buildNoindexField()`, `buildSummaryField()`, pole `slugHistory` + `trackSlugHistoryHook`, `buildRevalidateHook({ revalidatePath, config })` → `afterChange`/`afterDelete` | edycja w panelu → strona odświeża się bez deployu | slug.md, hooks.md, seo.md |
|
||||
| Pages — ochrona | jw. | `beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })]`; `setPublishedAtHook`, `buildCrossLocaleFieldSync(...)` wg potrzeby | usuń stronę główną → błąd | hooks.md |
|
||||
| Media | `src/collections/Media.ts` | `upload: { focalPoint: true }`, `hooks.beforeOperation: [normalizeFilenameHook, buildOptimizeUploadHook(), buildMediaPlaceholderHook()]`, pola `buildOptimizeUploadField()`, `buildMediaPlaceholderField()`, `alt` | upload `Zdjęcie Ś.JPG` → `zdjecie-s.jpg`, placeholder w dokumencie | media.md |
|
||||
| obraz na froncie | prymityw `Media` | `<Image {...mediaImageProps(media, { sizes })} />`, wideo `videoProps` | blur przed załadowaniem | media.md |
|
||||
| storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — zawsze (bez `R2_*` = dysk lokalny) | upload → URL z `R2_PUBLIC_URL` | storage.md |
|
||||
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP z panelu / Graph z env; też `panelSmtpAdapter`, `graphAdapter`, `sendEmail` z `/server`) | Site Integrations → SMTP → **Send test** | email.md |
|
||||
| formularze — akcja | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | wysyłka → dokument w Form Submissions + maile | forms.md, skill **ipal-form** |
|
||||
| formularze — render | blok formularza | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | formularz z panelu, Turnstile, komunikat z Notifications | forms.md |
|
||||
| Turnstile | panel / env | `TurnstileProvider` wpina `SiteProviders`; klucze w Site Integrations → Turnstile albo env; serwer: `verifyTurnstile` (`/server`) | widżet w formularzu; alert na dashboardzie przy złym kluczu | turnstile.md |
|
||||
| zgoda | layout + strona polityki | baner przez `SiteProviders`; tabela `<CookieTable rows={…} labels={…} />` (`/rsc`) z `getCookieTable` | `ipal-consent-check`; usuń cookie zgody → baner wraca | consent.md |
|
||||
| dowód zgody | config + layout | `consentLog: true` + `logEndpoint="/api/ipal/consent"` | po kliknięciu dokument w Consent Records | consent.md |
|
||||
| statystyki | config + layout | `stats: true` + `<SiteProviders stats={{ locale }}>` (lub `<PageStats locale />` w `ConsentProvider`) | `/<admin>/stats`; request `POST /api/ipal/hit` w Network | stats.md |
|
||||
| analityka | layout | `Analytics` wpina `SiteProviders` (ID z Site Integrations → Analytics) | GTM/GA ładuje się dopiero po zgodzie | analytics.md, gtm-meta-pixel.md |
|
||||
| JSON-LD dodatkowe | layout / `lib/content` | `jsonLd={[buildNavigationJsonLd(…)]}`; `siteJsonLd` → `buildLocalBusinessJsonLd` | Rich Results Test | seo.md |
|
||||
| linki i nawigacja | komponenty | `buildLinkField`/`buildLinksField` w polach; `resolveNav`, `resolveLink`, `getSystemLinks` | link w menu po zmianie sluga działa | links.md, skill **ipal-nav** |
|
||||
| bloki | `src/blocks/registry.ts` | `blocks` dla `createPageRoute`; pola `buildSectionHeaderField`, `buildSectionSettingsField` | blok widoczny na stronie | blocks.md, skill **ipal-block** |
|
||||
| języki w nagłówku | header | `<LanguageSwitcher>` (`/client`), `<AlternateLinksUpdater>` | przełączenie na `/en/<slug-en>` | i18n.md |
|
||||
| Tailwind | `styles.css` | `@import "@intecion/ipal-kit/fluid.css";` + `@source "…/node_modules/@intecion/ipal-kit/dist/**/*.js";` | baner cookies ma style | PROGRAMISTA §2.5 |
|
||||
| panel `/its` | `app/(payload)/its/…` | `adminRoute: '/its'` + `its` w matcherze proxy | `/its` logowanie, `/admin` 404 | security.md |
|
||||
| skille | `package.json` | `"ipal:skills": "ipal-skills"` | `.agents/skills/` aktualne | PROGRAMISTA §2.1a |
|
||||
| health | `app/api/health/route.ts` | `export { healthRoute as GET }` + `force-dynamic` | `curl -s $U/api/health` → `"status":"ok"` (503 on a database error) | deployment.md |
|
||||
| IndexNow key | `app/indexnow-key.txt/route.ts` | `export { indexNowKeyRoute as GET }` + `force-dynamic` | `curl -s $U/indexnow-key.txt` = the key | seo.md |
|
||||
| search (optional) | `app/api/search/route.ts` | `export const GET = createSearchRoute({ getCachedPayload, config: i18nConfig, baseUrl })` | `curl -s "$U/api/search?q=test&locale=pl"` | content.md |
|
||||
| Pages | `src/collections/Pages.ts` | `buildSlugField({ from: 'title' })`, `buildNoindexField()`, `buildSummaryField()`, `slugHistory` field + `trackSlugHistoryHook`, `buildRevalidateHook({ revalidatePath, config })` → `afterChange`/`afterDelete` | edit in the panel → the page refreshes without a deploy | slug.md, hooks.md, seo.md |
|
||||
| Pages — protection | as above | `beforeDelete: [buildPreventDeleteSystemPage({ settingsSlug: 'site-settings' })]`; `setPublishedAtHook`, `buildCrossLocaleFieldSync(...)` as needed | delete the homepage → error | hooks.md |
|
||||
| Media | `src/collections/Media.ts` | `upload: { focalPoint: true }`, `hooks.beforeOperation: [normalizeFilenameHook, buildOptimizeUploadHook(), buildMediaPlaceholderHook()]`, fields `buildOptimizeUploadField()`, `buildMediaPlaceholderField()`, `alt` | upload `Zdjęcie Ś.JPG` → `zdjecie-s.jpg`, placeholder in the document | media.md |
|
||||
| image on the frontend | `Media` primitive | `<Image {...mediaImageProps(media, { sizes })} />`, video `videoProps` | blur before load | media.md |
|
||||
| storage | `payload.config.ts` | `buildR2Storage(['media'], { s3Storage })` — always (without `R2_*` = local disk) | upload → URL from `R2_PUBLIC_URL` | storage.md |
|
||||
| e-mail | `payload.config.ts` | `email: mailAdapter()` (SMTP from the panel / Graph from env; also `panelSmtpAdapter`, `graphAdapter`, `sendEmail` from `/server`) | Site Integrations → SMTP → **Send test** | email.md |
|
||||
| forms — action | `app/(frontend)/[locale]/actions.ts` | `'use server'`; `export const sendForm = createSubmitAction({ getCachedPayload, headers })` (`/server`) | submit → document in Form Submissions + e-mails | forms.md, skill **ipal-form** |
|
||||
| forms — render | form block | `<RenderForm form={form} action={sendForm} locale={locale} texts={formTexts} classNames={formClasses} />` (`/rsc`) | form from the panel, Turnstile, message from Notifications | forms.md |
|
||||
| Turnstile | panel / env | `SiteProviders` wires `TurnstileProvider`; keys in Site Integrations → Turnstile or env; server: `verifyTurnstile` (`/server`) | widget in the form; dashboard alert on a bad key | turnstile.md |
|
||||
| consent | layout + policy page | banner via `SiteProviders`; table `<CookieTable rows={…} labels={…} />` (`/rsc`) from `getCookieTable` | `ipal-consent-check`; delete the consent cookie → the banner comes back | consent.md |
|
||||
| proof of consent | config + layout | `consentLog: true` + `logEndpoint="/api/ipal/consent"` | after a click, a document in Consent Records | consent.md |
|
||||
| stats | config + layout | `stats: true` + `<SiteProviders stats={{ locale }}>` (or `<PageStats locale />` inside `ConsentProvider`) | `/<admin>/stats`; `POST /api/ipal/hit` request in Network | stats.md |
|
||||
| analytics | layout | `SiteProviders` wires `Analytics` (ID from Site Integrations → Analytics) | GTM/GA loads only after consent | analytics.md, gtm-meta-pixel.md |
|
||||
| extra JSON-LD | layout / `lib/content` | `jsonLd={[buildNavigationJsonLd(…)]}`; `siteJsonLd` → `buildLocalBusinessJsonLd` | Rich Results Test | seo.md |
|
||||
| links and navigation | components | `buildLinkField`/`buildLinksField` in fields; `resolveNav`, `resolveLink`, `getSystemLinks` | a menu link still works after a slug change | links.md, skill **ipal-nav** |
|
||||
| blocks | `src/blocks/registry.ts` | `blocks` for `createPageRoute`; fields `buildSectionHeaderField`, `buildSectionSettingsField` | block visible on the page | blocks.md, skill **ipal-block** |
|
||||
| languages in the header | header | `<LanguageSwitcher>` (`/client`), `<AlternateLinksUpdater>` | switches to `/en/<slug-en>` | i18n.md |
|
||||
| Tailwind | `styles.css` | `@import "@intecion/ipal-kit/fluid.css";` + `@source "…/node_modules/@intecion/ipal-kit/dist/**/*.js";` | the cookie banner is styled | PROGRAMISTA §2.5 |
|
||||
| `/its` panel | `app/(payload)/its/…` | `adminRoute: '/its'` + `its` in the proxy matcher | `/its` login, `/admin` 404 | security.md |
|
||||
| skills | `package.json` | `"ipal:skills": "ipal-skills"` | `.agents/skills/` up to date | PROGRAMISTA §2.1a |
|
||||
|
||||
**Klucze `createContentHelpers` (eksporty `@/lib/content`)** — wszystkie leniwe i w cache na request:
|
||||
**`createContentHelpers` keys (exports of `@/lib/content`)** — all lazy and cached per request:
|
||||
|
||||
| klucz | użycie |
|
||||
| key | use |
|
||||
|---|---|
|
||||
| `getCachedPayload` | `await getCachedPayload()` — Local API (akcje, trasy) |
|
||||
| `getCachedPayload` | `await getCachedPayload()` — Local API (actions, routes) |
|
||||
| `getSettings(locale)` | Site Settings (`depth: 2`) |
|
||||
| `getConfiguredLocales()` | layout: `notFound()` dla obcego języka |
|
||||
| `resolveRoute`, `getEntries`, `getNotFoundPage`, `resolvePageRedirect` | własna strona / archiwum zamiast `createPageRoute` |
|
||||
| `generatePageMetadata`, `generateStaticParams`, `getPageJsonLd` | używa `createPageRoute`; ręcznie w własnych stronach |
|
||||
| `getConfiguredLocales()` | layout: `notFound()` for an unknown language |
|
||||
| `resolveRoute`, `getEntries`, `getNotFoundPage`, `resolvePageRedirect` | your own page / archive instead of `createPageRoute` |
|
||||
| `generatePageMetadata`, `generateStaticParams`, `getPageJsonLd` | used by `createPageRoute`; call by hand in your own pages |
|
||||
| `getSiteShell(locale)` | layout → `SiteProviders shell` |
|
||||
| `getFormTexts(locale)` | `blockProps` dla formularzy |
|
||||
| `getFormTexts(locale)` | `blockProps` for forms |
|
||||
| `getLinkOptions`, `getHomeSlug`, `resolveLink`, `resolveNav`, `getSystemLinks` | header, footer, CMSLink |
|
||||
| `getConstructionMode` | „strona w budowie” (construction.md) |
|
||||
| `sitemap`, `sitemapRoute`, `robots`, `manifest`, `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`, `mcpPOST`, `healthRoute`, `indexNowKeyRoute` | re-eksporty w `app/` (tabela wyżej) |
|
||||
| `i18n` | przekazany `I18nConfig` |
|
||||
| `getConstructionMode` | under-construction mode (construction.md) |
|
||||
| `sitemap`, `sitemapRoute`, `robots`, `manifest`, `llmsRoute`, `llmsFullRoute`, `markdownRoute`, `mcpGET`, `mcpPOST`, `healthRoute`, `indexNowKeyRoute` | re-exports in `app/` (table above) |
|
||||
| `i18n` | the `I18nConfig` passed in |
|
||||
|
||||
Opcje `createContentHelpers` (`baseUrl`, `pagesSlug`, `settingsSlug`, `redirectCollections`, `markdown`,
|
||||
`createContentHelpers` options (`baseUrl`, `pagesSlug`, `settingsSlug`, `redirectCollections`, `markdown`,
|
||||
`markdownAlternate`, `mcp`, `pageJsonLd`, `robots`, `siteJsonLd`, `sitemapImages`, `sitemapStyle`, `summaryField`)
|
||||
i co rzuca bez `i18n`: frontend.md. `SiteProviders` propsy: `shell`, `banner`, `cookieButton`, `analytics`,
|
||||
`cookieMap`, `jsonLd`, `logEndpoint`, `preconnect`, `stats`, `theme` — każdą część podmienisz albo `false`.
|
||||
and what throws without `i18n`: frontend.md. `SiteProviders` props: `shell`, `banner`, `cookieButton`, `analytics`,
|
||||
`cookieMap`, `jsonLd`, `logEndpoint`, `preconnect`, `stats`, `theme` — replace any part or set it to `false`.
|
||||
|
||||
## 4. Zmienne środowiskowe
|
||||
## 4. Environment variables
|
||||
|
||||
`.env` w dev, runtime hostingu (Coolify) na produkcji, `.env.example` bez wartości w repo. Walidacja: `ipalEnvRules(features)`.
|
||||
`.env` in dev, the hosting runtime (Coolify) in production, `.env.example` without values in the repo. Validation: `ipalEnvRules(features)`.
|
||||
|
||||
| zmienna | wymagana kiedy | skutek braku | gdzie ustawić |
|
||||
| variable | required when | effect when missing | where to set |
|
||||
|---|---|---|---|
|
||||
| `DATABASE_URI` | zawsze (Payload; `ipalEnvRules` zawsze) | brak bazy, start pada | env (nazwa: `databaseVar`) |
|
||||
| `PAYLOAD_SECRET` | zawsze | Payload nie startuje; `assertEnv` rzuca | env, ≥32 znaki, inny na prod (`secretVar`) |
|
||||
| `NEXT_PUBLIC_SERVER_URL` | zawsze (`kind: 'url'`) | sitemap/robots/canonical/JSON-LD/llms z origin `''` (względne), IndexNow nie wysyła, R2 względny URL bez prefiksu | env (`serverUrlVar`) |
|
||||
| `NODE_ENV` | nie (`development`/`production`/`test`) | `production` zaostrza: R2 i `IPAL_IP_HEADER` wymagane, IndexNow działa, ostrzeżenie o IP, `buildImagesConfig` prod | ustawia Next / hosting |
|
||||
| `R2_BUCKET`, `R2_ENDPOINT`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY` | `storage: true` + produkcja, albo gdy ustawiona choć jedna (wszystkie albo żadna) | dysk lokalny (na prod pliki znikają przy redeployu); niepełny komplet → ostrzeżenie | env |
|
||||
| `R2_PUBLIC_URL` | jak wyżej; na prod absolutny URL | uploady działają, obrazy się nie wyświetlają; samo `R2_PUBLIC_URL` w dev = media tylko do odczytu; `/media` dozwolone poza prod; używane też przez `buildImagesConfig`, `MediaPreconnect`, CSP | env |
|
||||
| `GRAPH_TENANT_ID`, `GRAPH_CLIENT_ID`, `GRAPH_CLIENT_SECRET`, `GRAPH_SENDER` | `emailGraph: true` / transport Graph w panelu | `mailAdapter` przechodzi na SMTP z panelu (log) | env (Exchange agencji) |
|
||||
| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | `turnstile: true` (nazwy: `siteKeyVar`/`secretVar`) | fallback dla kluczy z Site Integrations → Turnstile; brak obu → Turnstile wyłączony | panel (pierwszeństwo) albo env |
|
||||
| `INDEXNOW_KEY` | nie | klucz z Site Integrations → IndexNow (generowany) | env albo panel |
|
||||
| `IPAL_IP_HEADER` | `ipHeader: true` + produkcja | rate limit ufa dowolnemu nagłówkowi IP (spoofing) + ostrzeżenie na prod | env: `cf-connecting-ip` (Cloudflare) / `x-forwarded-for` (Traefik/nginx) |
|
||||
| `IPAL_NOINDEX` | nie; `1`/`true`/`yes` **tylko staging/preview** | — (ustawione: robots Disallow, meta noindex, `X-Robots-Tag`) | env stagingu |
|
||||
| `NEXT_RUNTIME` | ustawia Next | `instrumentation.ts` sprawdza `nodejs`; brak (skrypty, seed) → `buildRevalidateHook` nie rewaliduje | nie ustawiaj ręcznie |
|
||||
| `DATABASE_URI` | always (Payload; `ipalEnvRules` always) | no database, startup fails | env (name: `databaseVar`) |
|
||||
| `PAYLOAD_SECRET` | always | Payload does not start; `assertEnv` throws | env, ≥32 characters, different in prod (`secretVar`) |
|
||||
| `NEXT_PUBLIC_SERVER_URL` | always (`kind: 'url'`) | sitemap/robots/canonical/JSON-LD/llms with origin `''` (relative), IndexNow does not send, R2 relative URL without a prefix | env (`serverUrlVar`) |
|
||||
| `NODE_ENV` | no (`development`/`production`/`test`) | `production` is stricter: R2 and `IPAL_IP_HEADER` required, IndexNow works, IP warning, `buildImagesConfig` prod | set by Next / hosting |
|
||||
| `R2_BUCKET`, `R2_ENDPOINT`, `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY` | `storage: true` + production, or when at least one is set (all or none) | local disk (in prod files disappear on redeploy); incomplete set → warning | env |
|
||||
| `R2_PUBLIC_URL` | as above; absolute URL in prod | empty (default) → media served by the app at `/api/media/file/…` (Media needs `access.read: () => true`; with `ipalEnvRules({ storage: true })` make the rule optional, env.md); set it only for a media domain on Cloudflare (storage.md); `R2_PUBLIC_URL` alone in dev = media read-only; `/media` allowed outside prod; also used by `buildImagesConfig`, `MediaPreconnect`, CSP | env |
|
||||
| `GRAPH_TENANT_ID`, `GRAPH_CLIENT_ID`, `GRAPH_CLIENT_SECRET`, `GRAPH_SENDER` | `emailGraph: true` / Graph transport in the panel | `mailAdapter` falls back to SMTP from the panel (logged) | env (agency Exchange) |
|
||||
| `NEXT_PUBLIC_TURNSTILE_SITE_KEY`, `TURNSTILE_SECRET_KEY` | `turnstile: true` (names: `siteKeyVar`/`secretVar`) | fallback for keys from Site Integrations → Turnstile; neither set → Turnstile off | panel (takes precedence) or env |
|
||||
| `INDEXNOW_KEY` | no | key from Site Integrations → IndexNow (generated) | env or panel |
|
||||
| `IPAL_IP_HEADER` | `ipHeader: true` + production | rate limit trusts any IP header (spoofing) + warning in prod | env: `cf-connecting-ip` (Cloudflare) / `x-forwarded-for` (Traefik/nginx) |
|
||||
| `IPAL_NOINDEX` | no; `1`/`true`/`yes` **staging/preview only** | — (when set: robots Disallow, meta noindex, `X-Robots-Tag`) | staging env |
|
||||
| `NEXT_RUNTIME` | set by Next | `instrumentation.ts` checks for `nodejs`; missing (scripts, seed) → `buildRevalidateHook` does not revalidate | do not set by hand |
|
||||
|
||||
Szczegóły: env.md, deployment.md, PROGRAMISTA §3.
|
||||
Details: env.md, deployment.md, PROGRAMISTA §3.
|
||||
|
||||
**DNS** (A/AAAA, www, CAA, TXT Search Console, Bing, SPF/DKIM/DMARC domeny From, domena R2): plugin nic nie ustawia — lista rekordów z `dig` do sprawdzenia: `deployment.md` §6, skrót w **ipal-setup** etap 11.
|
||||
**DNS** (A/AAAA, www, CAA, Search Console TXT, Bing, SPF/DKIM/DMARC for the From domain, R2 domain): the plugin sets nothing — list of records to check with `dig`: `deployment.md` §6, summary in **ipal-setup** stage 11.
|
||||
|
||||
**Seeding** (content in pages, forms, globals): create-only, matched by a natural key, never delete, never seed users or secrets, dry run → backup → real run; updates on production only for untouched records and only with `IPAL_SEED_ALLOW_PROD_UPDATE=1`. Templates: `ipal-site/resources/seed-content.template.ts`, `ipal-form/resources/seed-form.template.ts`. Rules and Coolify steps: `node_modules/@intecion/ipal-kit/docs/seeding.md`.
|
||||
|
||||
@@ -1,576 +1,576 @@
|
||||
# ipal-kit — indeks eksportów
|
||||
# ipal-kit — export index
|
||||
|
||||
Każdy publiczny eksport `@intecion/ipal-kit` (wszystkie wejścia: root, `/client`, `/rsc`,
|
||||
`/server`, `/next/middleware`, `/admin`, `/env`), pogrupowany wg modułu. Szukaj grepem
|
||||
(`grep -n "nazwa" .agents/skills/ipal-reference/resources/api.md`), zanim napiszesz coś sam.
|
||||
Kolumna „Import z” — pierwsze wejście jest preferowane. Opcje pluginu, env, trasy i to, co
|
||||
projekt podpina: `../SKILL.md`. Szczegóły modułu: `node_modules/@intecion/ipal-kit/docs/<strona>.md`.
|
||||
Every public export of `@intecion/ipal-kit` (all entries: root, `/client`, `/rsc`,
|
||||
`/server`, `/next/middleware`, `/admin`, `/env`), grouped by module. Search with grep
|
||||
(`grep -n "name" .agents/skills/ipal-reference/resources/api.md`) before you write anything yourself.
|
||||
"Import from" column — the first entry is preferred. Plugin options, env, routes and what the
|
||||
project wires: `../SKILL.md`. Module details: `node_modules/@intecion/ipal-kit/docs/<page>.md`.
|
||||
|
||||
## Plugin (`plugin`, `types`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/dev/PROGRAMISTA.md`
|
||||
## Plugin (`plugin`, `types`) — details: `node_modules/@intecion/ipal-kit/docs/dev/PROGRAMISTA.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `ipalKit(options)` | `@intecion/ipal-kit` | Plugin Payload 3 (`plugins: [ipalKit({...})]`) — jedyny punkt wpięcia: dodaje globale (SiteSettings, SiteIntegrations, CookieSettings, Notifications), role, wymuszone 2FA, SEO, formularze, i18n (lokalizacja), white-label, statystyki, log zgód, endpointy `/api/ipal/*`; brak kolekcji auth → wstrzykuje prostą `users`. Waliduje `i18n` od razu (fail fast). `enabled: false` = schemat zostaje, zachowanie wyłączone. |
|
||||
| `ipalKit(options)` | `@intecion/ipal-kit` | Payload 3 plugin (`plugins: [ipalKit({...})]`) — the only wiring point: adds globals (SiteSettings, SiteIntegrations, CookieSettings, Notifications), roles, enforced 2FA, SEO, forms, i18n (localization), white-label, stats, consent log, `/api/ipal/*` endpoints; no auth collection → injects a simple `users`. Validates `i18n` right away (fail fast). `enabled: false` = schema stays, behaviour off. |
|
||||
|
||||
**Typy:** `IpalOptions` — opcje `ipalKit()`: `i18n`, `access`, `twoFactor` (`{ issuer, plugin: payloadTotp }` lub `false`), `whiteLabel`, `adminRoute`, `consentLog`, `content`, `forms`, `pages`, `seo`, `stats`, `indexNow`, `siteSettingsFields`, `integrationsFields`, `enabled`.
|
||||
**Types:** `IpalOptions` — `ipalKit()` options: `i18n`, `access`, `twoFactor` (`{ issuer, plugin: payloadTotp }` or `false`), `whiteLabel`, `adminRoute`, `consentLog`, `content`, `forms`, `pages`, `seo`, `stats`, `indexNow`, `siteSettingsFields`, `integrationsFields`, `enabled`.
|
||||
|
||||
## Admin (import map) (`admin`, `branding`, `admin-ui`, `globals/SiteIntegrations`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/white-label.md`, `…/docs/integrations.md`, `…/docs/email.md`, `…/docs/links.md`
|
||||
## Admin (import map) (`admin`, `branding`, `admin-ui`, `globals/SiteIntegrations`) — details: `node_modules/@intecion/ipal-kit/docs/white-label.md`, `…/docs/integrations.md`, `…/docs/email.md`, `…/docs/links.md`
|
||||
|
||||
Komponenty panelu z `@intecion/ipal-kit/admin` — projekt ich NIE importuje; plugin (lub helper) wpisuje ścieżkę `@intecion/ipal-kit/admin#Nazwa` do configu, Payload rozwiązuje ją przez import map.
|
||||
Admin panel components from `@intecion/ipal-kit/admin` — the project does NOT import them; the plugin (or a helper) writes the path `@intecion/ipal-kit/admin#Name` into the config, and Payload resolves it through the import map.
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `MaskedField` | `@intecion/ipal-kit/admin` | Pole tekstowe maskowane (••••, przycisk Reveal) dla sekretów w SiteIntegrations (hasło SMTP, klucz R2, sekret Turnstile) — maskowanie tylko w UI, nie szyfrowanie. Wstrzykiwany przez plugin; można też podpiąć do własnego pola `text` przez `admin.components.Field`, potem `pnpm generate:importmap`. |
|
||||
| `TestEmailButton` | `@intecion/ipal-kit/admin` | Przycisk „wyślij testowy e-mail” w zakładce e-mail SiteIntegrations — POST `/api/ipal/test-email` przez wybrany transport (SMTP/Graph), pokazuje wynik/błąd. Wstrzykiwany przez plugin — nie wołaj. |
|
||||
| `RowLabel` | `@intecion/ipal-kit/admin` | Tytuł wiersza tablicy w panelu z treści wiersza (np. „Szybka dostawa” zamiast „Item 01”). Nie podpinaj ręcznie — użyj `rowLabel()`; po dodaniu `pnpm generate:importmap`. |
|
||||
| `AdminLogo` | `@intecion/ipal-kit/admin` | Server Component: duże logo panelu (ekran logowania) z SiteSettings `logo`, fallback `siteName`. Wstrzykiwany przez plugin przy `whiteLabel`; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `AdminIcon` | `@intecion/ipal-kit/admin` | Server Component: mała ikona nawigacji panelu z SiteSettings `favicon`, fallback inicjały. Wstrzykiwany przez plugin przy `whiteLabel`; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `IntecionCredit` | `@intecion/ipal-kit/admin` | Linijka „Technology supported by Intecion.com” pod nawigacją i pod formularzem logowania (`variant: 'nav' \| 'login'`). Wstrzykiwany przez plugin przy `whiteLabel`; wyłączenie: `whiteLabel: { credit: false }`. |
|
||||
| `MaskedField` | `@intecion/ipal-kit/admin` | Masked text field (••••, Reveal button) for secrets in SiteIntegrations (SMTP password, R2 key, Turnstile secret) — masking in the UI only, not encryption. Injected by the plugin; you can also wire it to your own `text` field via `admin.components.Field`, then `pnpm generate:importmap`. |
|
||||
| `TestEmailButton` | `@intecion/ipal-kit/admin` | "Send test e-mail" button in the SiteIntegrations e-mail tab — POST `/api/ipal/test-email` through the selected transport (SMTP/Graph), shows the result/error. Injected by the plugin — do not call. |
|
||||
| `RowLabel` | `@intecion/ipal-kit/admin` | Array row title in the panel taken from the row content (e.g. "Fast delivery" instead of "Item 01"). Do not wire by hand — use `rowLabel()`; after adding, `pnpm generate:importmap`. |
|
||||
| `AdminLogo` | `@intecion/ipal-kit/admin` | Server Component: large panel logo (login screen) from SiteSettings `logo`, fallback `siteName`. Injected by the plugin with `whiteLabel`; after turning the option on, `pnpm generate:importmap`. |
|
||||
| `AdminIcon` | `@intecion/ipal-kit/admin` | Server Component: small panel nav icon from SiteSettings `favicon`, fallback initials. Injected by the plugin with `whiteLabel`; after turning the option on, `pnpm generate:importmap`. |
|
||||
| `IntecionCredit` | `@intecion/ipal-kit/admin` | The line "Technology supported by Intecion.com" below the nav and below the login form (`variant: 'nav' \| 'login'`). Injected by the plugin with `whiteLabel`; turn off: `whiteLabel: { credit: false }`. |
|
||||
|
||||
## Czytelne wiersze tablic w panelu (`admin-ui`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/links.md`
|
||||
## Readable array rows in the panel (`admin-ui`) — details: `node_modules/@intecion/ipal-kit/docs/links.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `rowLabel(fields, fallback = 'Item')` | `@intecion/ipal-kit` | Zwraca `{ RowLabel: { path, clientProps } }` do wstawienia w `admin.components` pola `array` — wiersz pokazuje pierwszą niepustą ścieżkę z `fields` (np. `'heading'`, `['name','link.label']`), inaczej „{fallback} 02”. Używaj w każdej tablicy projektu; `buildLinksField` ma go wbudowanego. Potem `pnpm generate:importmap`. |
|
||||
| `rowLabel(fields, fallback = 'Item')` | `@intecion/ipal-kit` | Returns `{ RowLabel: { path, clientProps } }` to put in `admin.components` of an `array` field — the row shows the first non-empty path from `fields` (e.g. `'heading'`, `['name','link.label']`), otherwise "{fallback} 02". Use it in every array in the project; `buildLinksField` has it built in. Then `pnpm generate:importmap`. |
|
||||
|
||||
**Typy:** `RowLabelProps` — props komponentu `RowLabel` (`fields`, `fallback`).
|
||||
**Types:** `RowLabelProps` — props of the `RowLabel` component (`fields`, `fallback`).
|
||||
|
||||
## Role i dostęp (`access`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/access.md`
|
||||
## Roles and access (`access`) — details: `node_modules/@intecion/ipal-kit/docs/access.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `adminOnly` | `@intecion/ipal-kit` | `Access` kolekcji: tylko rola `admin`. W `access.read/create/update/delete`. |
|
||||
| `adminOrEditor` | `@intecion/ipal-kit` | `Access` kolekcji: `editor` lub `admin`. Typowe dla treści edytowanych w panelu. |
|
||||
| `adminOrSelf` | `@intecion/ipal-kit` | `Access` kolekcji: admin widzi wszystko, zalogowany tylko własny dokument (`Where` `id = user.id`), anonim nic. Np. `users.read`. |
|
||||
| `authenticated` | `@intecion/ipal-kit` | `Access` kolekcji: dowolny zalogowany użytkownik. |
|
||||
| `requireRole(minimum)` | `@intecion/ipal-kit` | Fabryka `Access` kolekcji: co najmniej podana rola (`'user' \| 'editor' \| 'admin'`). |
|
||||
| `adminOnlyField` | `@intecion/ipal-kit` | `FieldAccess` (tylko boolean): pole tylko dla admina. W `field.access.read/update`. |
|
||||
| `adminOrEditorField` | `@intecion/ipal-kit` | `FieldAccess`: pole dla editora lub admina. |
|
||||
| `requireRoleField(minimum)` | `@intecion/ipal-kit` | Fabryka `FieldAccess`: co najmniej podana rola. |
|
||||
| `hasMinimumRole(user, minimum)` | `@intecion/ipal-kit` | Predykat → `boolean`: czy user ma rolę ≥ `minimum` (bezpiecznie czyta `user.roles`). Do własnej logiki dostępu/hooków. |
|
||||
| `isAdmin(user)` | `@intecion/ipal-kit` | Predykat → `boolean`: rola `admin`. |
|
||||
| `isEditor(user)` | `@intecion/ipal-kit` | Predykat → `boolean`: `editor` lub wyżej. |
|
||||
| `ROLE_HIERARCHY` | `@intecion/ipal-kit` | Stała `['user', 'editor', 'admin']` (od najniższej) — wyższa rola spełnia wymagania niższej. Pole `roles` wstrzykuje plugin do kolekcji auth (`access.authCollection`). |
|
||||
| `adminOnly` | `@intecion/ipal-kit` | Collection `Access`: `admin` role only. In `access.read/create/update/delete`. |
|
||||
| `adminOrEditor` | `@intecion/ipal-kit` | Collection `Access`: `editor` or `admin`. Typical for content edited in the panel. |
|
||||
| `adminOrSelf` | `@intecion/ipal-kit` | Collection `Access`: admin sees everything, a logged-in user only their own document (`Where` `id = user.id`), anonymous nothing. E.g. `users.read`. |
|
||||
| `authenticated` | `@intecion/ipal-kit` | Collection `Access`: any logged-in user. |
|
||||
| `requireRole(minimum)` | `@intecion/ipal-kit` | Collection `Access` factory: at least the given role (`'user' \| 'editor' \| 'admin'`). |
|
||||
| `adminOnlyField` | `@intecion/ipal-kit` | `FieldAccess` (boolean only): field for admin only. In `field.access.read/update`. |
|
||||
| `adminOrEditorField` | `@intecion/ipal-kit` | `FieldAccess`: field for editor or admin. |
|
||||
| `requireRoleField(minimum)` | `@intecion/ipal-kit` | `FieldAccess` factory: at least the given role. |
|
||||
| `hasMinimumRole(user, minimum)` | `@intecion/ipal-kit` | Predicate → `boolean`: whether the user has a role ≥ `minimum` (reads `user.roles` safely). For your own access logic/hooks. |
|
||||
| `isAdmin(user)` | `@intecion/ipal-kit` | Predicate → `boolean`: `admin` role. |
|
||||
| `isEditor(user)` | `@intecion/ipal-kit` | Predicate → `boolean`: `editor` or higher. |
|
||||
| `ROLE_HIERARCHY` | `@intecion/ipal-kit` | Constant `['user', 'editor', 'admin']` (lowest first) — a higher role meets the requirements of a lower one. The plugin injects the `roles` field into the auth collection (`access.authCollection`). |
|
||||
|
||||
**Typy:** `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (opcja `access` pluginu: `authCollection`, `defaultRole`).
|
||||
**Types:** `Role` (`'user' \| 'editor' \| 'admin'`), `AccessOption` (the plugin's `access` option: `authCollection`, `defaultRole`).
|
||||
|
||||
## Dostępność — widget (`accessibility`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/accessibility.md`
|
||||
## Accessibility — widget (`accessibility`) — details: `node_modules/@intecion/ipal-kit/docs/accessibility.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `AccessibilityProvider` | `@intecion/ipal-kit/client` | Provider preferencji dostępności: trzyma stan, zapisuje cookie `a11y-prefs`, ustawia atrybuty `data-a11y-*` na `<html>`. Owiń layout raz. Plugin nie dostarcza CSS — projekt stylizuje atrybuty. |
|
||||
| `AccessibilityWidget` | `@intecion/ipal-kit/client` | Pływający przycisk + panel opcji (rozmiar tekstu, interlinia, kontrast, skala szarości, podkreślanie linków, czytelna czcionka, redukcja ruchu, duży kursor). Props `classNames`, `texts` (domyślnie angielskie — tłumacz per locale). Wewnątrz `AccessibilityProvider`. |
|
||||
| `useAccessibility()` | `@intecion/ipal-kit/client` | Hook → `{ state, set(key, value), reset() }` — do własnego UI dostępności. Wewnątrz `AccessibilityProvider`. |
|
||||
| `A11Y_COOKIE` | `@intecion/ipal-kit` | Nazwa cookie preferencji: `'a11y-prefs'` — czytaj w SSR, by ustawić atrybuty bez mignięcia. |
|
||||
| `A11Y_DEFAULT` | `@intecion/ipal-kit` | Domyślny `A11yState` (wszystko wyłączone, `contrast: 'default'`, `textSize: 0`, `lineHeight: 0`). |
|
||||
| `parseA11y(raw)` | `@intecion/ipal-kit` | Wartość cookie → `A11yState` (przy błędzie `A11Y_DEFAULT`). Do SSR w layoucie. |
|
||||
| `serializeA11y(state)` | `@intecion/ipal-kit` | `A11yState` → string JSON do cookie. |
|
||||
| `a11yAttributes(state)` | `@intecion/ipal-kit` | `A11yState` → `{ 'data-a11y-*': string \| null }` (null = usuń atrybut). Do ustawienia atrybutów na `<html>` w SSR. |
|
||||
| `AccessibilityProvider` | `@intecion/ipal-kit/client` | Accessibility preferences provider: holds state, saves the `a11y-prefs` cookie, sets `data-a11y-*` attributes on `<html>`. Wrap the layout once. The plugin ships no CSS — the project styles the attributes. |
|
||||
| `AccessibilityWidget` | `@intecion/ipal-kit/client` | Floating button + options panel (text size, line height, contrast, grayscale, link underline, readable font, reduced motion, large cursor). Props `classNames`, `texts` (English by default — translate per locale). Inside `AccessibilityProvider`. |
|
||||
| `useAccessibility()` | `@intecion/ipal-kit/client` | Hook → `{ state, set(key, value), reset() }` — for your own accessibility UI. Inside `AccessibilityProvider`. |
|
||||
| `A11Y_COOKIE` | `@intecion/ipal-kit` | Preferences cookie name: `'a11y-prefs'` — read it in SSR to set attributes without a flash. |
|
||||
| `A11Y_DEFAULT` | `@intecion/ipal-kit` | Default `A11yState` (everything off, `contrast: 'default'`, `textSize: 0`, `lineHeight: 0`). |
|
||||
| `parseA11y(raw)` | `@intecion/ipal-kit` | Cookie value → `A11yState` (`A11Y_DEFAULT` on error). For SSR in the layout. |
|
||||
| `serializeA11y(state)` | `@intecion/ipal-kit` | `A11yState` → JSON string for the cookie. |
|
||||
| `a11yAttributes(state)` | `@intecion/ipal-kit` | `A11yState` → `{ 'data-a11y-*': string \| null }` (null = remove the attribute). To set attributes on `<html>` in SSR. |
|
||||
|
||||
**Typy:** `A11yState` (root i `/client`) — stan preferencji; `A11yTexts`, `A11yClassNames` (`/client`) — teksty i klasy `AccessibilityWidget`.
|
||||
**Types:** `A11yState` (root and `/client`) — preferences state; `A11yTexts`, `A11yClassNames` (`/client`) — `AccessibilityWidget` texts and classes.
|
||||
|
||||
## Analityka i piksele (`analytics`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/analytics.md`
|
||||
## Analytics and pixels (`analytics`) — details: `node_modules/@intecion/ipal-kit/docs/analytics.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getAnalyticsConfig(payload)` | `@intecion/ipal-kit` | Serwer: czyta publiczne ID tagów (GA4, GTM, Meta Pixel, Clarity, LinkedIn, TikTok) z SiteIntegrations, waliduje format → `Promise<AnalyticsConfig>`; wynik przekaż do `<Analytics>`. |
|
||||
| `Analytics` | `@intecion/ipal-kit/client` | Ładuje wszystkie skonfigurowane tagi z poszanowaniem zgody: Google przez Consent Mode, pozostałe dopiero po zgodzie kategorii (marketing / analytics). Props = `AnalyticsConfig` + `defer`, `deferTimeoutMs`. Renderuje nic; montuj raz wewnątrz `ConsentProvider`. Nie wstawiaj tagów ręcznie. |
|
||||
| `pushDataLayer(event, params?)` | `@intecion/ipal-kit/client` | Wrzuca zdarzenie do `window.dataLayer` GTM (SSR-safe, buforuje przed załadowaniem GTM). Np. `form_submit` po wysłaniu formularza (`docs/gtm-meta-pixel.md`). |
|
||||
| `loadMetaPixel(id)` | `@intecion/ipal-kit/client` | Niskopoziomowy loader Meta Pixel (idempotentny, PageView). `Analytics` woła go sam po zgodzie marketing — ręcznie tylko w nietypowych przypadkach, i tylko po zgodzie. |
|
||||
| `loadClarity(id)` | `@intecion/ipal-kit/client` | Loader Microsoft Clarity (kategoria analytics). `Analytics` woła sam — nie wołaj zwykle. |
|
||||
| `loadLinkedIn(partnerId)` | `@intecion/ipal-kit/client` | Loader LinkedIn Insight Tag (marketing). `Analytics` woła sam — nie wołaj zwykle. |
|
||||
| `loadTikTok(id)` | `@intecion/ipal-kit/client` | Loader TikTok Pixel (marketing). `Analytics` woła sam — nie wołaj zwykle. |
|
||||
| `getAnalyticsConfig(payload)` | `@intecion/ipal-kit` | Server: reads public tag IDs (GA4, GTM, Meta Pixel, Clarity, LinkedIn, TikTok) from SiteIntegrations, validates the format → `Promise<AnalyticsConfig>`; pass the result to `<Analytics>`. |
|
||||
| `Analytics` | `@intecion/ipal-kit/client` | Loads all configured tags respecting consent: Google through Consent Mode, the rest only after consent for the category (marketing / analytics). Props = `AnalyticsConfig` + `defer`, `deferTimeoutMs`. Renders nothing; mount once inside `ConsentProvider`. Do not add tags by hand. |
|
||||
| `pushDataLayer(event, params?)` | `@intecion/ipal-kit/client` | Pushes an event to the GTM `window.dataLayer` (SSR-safe, buffers before GTM loads). E.g. `form_submit` after a form is sent (`docs/gtm-meta-pixel.md`). |
|
||||
| `loadMetaPixel(id)` | `@intecion/ipal-kit/client` | Low-level Meta Pixel loader (idempotent, PageView). `Analytics` calls it itself after marketing consent — call by hand only in unusual cases, and only after consent. |
|
||||
| `loadClarity(id)` | `@intecion/ipal-kit/client` | Microsoft Clarity loader (analytics category). `Analytics` calls it itself — usually do not call. |
|
||||
| `loadLinkedIn(partnerId)` | `@intecion/ipal-kit/client` | LinkedIn Insight Tag loader (marketing). `Analytics` calls it itself — usually do not call. |
|
||||
| `loadTikTok(id)` | `@intecion/ipal-kit/client` | TikTok Pixel loader (marketing). `Analytics` calls it itself — usually do not call. |
|
||||
|
||||
**Typy:** `AnalyticsConfig` (root) — ID tagów z SiteIntegrations; `AnalyticsProps` (`/client`) — props `Analytics`.
|
||||
**Types:** `AnalyticsConfig` (root) — tag IDs from SiteIntegrations; `AnalyticsProps` (`/client`) — `Analytics` props.
|
||||
|
||||
## Bloki i sekcje (`blocks`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/blocks.md`
|
||||
## Blocks and sections (`blocks`) — details: `node_modules/@intecion/ipal-kit/docs/blocks.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `RenderBlocks` | `@intecion/ipal-kit/rsc` | Serwerowy renderer bloków: `{ blocks, components, enhanceProps? }` — każdy blok przez mapę `blockType → komponent`, nieznane pomija, bez dodatkowego markupu. Nie pisz własnej pętli po blokach. Bloki zagnieżdżone renderują własny `RenderBlocks` (mapy nie przekazuj propsem). |
|
||||
| `buildSectionHeaderField(opts?)` | `@intecion/ipal-kit` | Grupa pól `header` (eyebrow, heading, intro — lokalizowane) do każdego bloku sekcji; `interfaceName` `SectionHeaderData`. Opcje: `name`, `fields`, `interfaceName`. |
|
||||
| `buildSectionSettingsField(opts?)` | `@intecion/ipal-kit` | Grupa `settings` w sidebarze bloku: `anchor` (#id) + `background` (select, domyślnie Default/Muted/Inverted) + własne pola; zamiast `bgColor`/`sectionId` per blok. |
|
||||
| `RenderBlocks` | `@intecion/ipal-kit/rsc` | Server block renderer: `{ blocks, components, enhanceProps? }` — each block through a `blockType → component` map, skips unknown ones, no extra markup. Do not write your own loop over blocks. Nested blocks render their own `RenderBlocks` (do not pass the map as a prop). |
|
||||
| `buildSectionHeaderField(opts?)` | `@intecion/ipal-kit` | `header` field group (eyebrow, heading, intro — localized) for every section block; `interfaceName` `SectionHeaderData`. Options: `name`, `fields`, `interfaceName`. |
|
||||
| `buildSectionSettingsField(opts?)` | `@intecion/ipal-kit` | `settings` group in the block sidebar: `anchor` (#id) + `background` (select, default Default/Muted/Inverted) + your own fields; instead of a per-block `bgColor`/`sectionId`. |
|
||||
|
||||
**Typy:** `BlockData`, `BlockComponentMap`, `EnhanceProps`, `RenderBlocksProps` (`/rsc`) — dane bloku, mapa komponentów, enhancer propsów, props renderera; `SectionHeaderFieldOptions`, `SectionSettingsFieldOptions` (root) — opcje builderów pól sekcji.
|
||||
**Types:** `BlockData`, `BlockComponentMap`, `EnhanceProps`, `RenderBlocksProps` (`/rsc`) — block data, component map, props enhancer, renderer props; `SectionHeaderFieldOptions`, `SectionSettingsFieldOptions` (root) — options of the section field builders.
|
||||
|
||||
## Zgoda na cookies (`consent`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/consent.md`
|
||||
## Cookie consent (`consent`) — details: `node_modules/@intecion/ipal-kit/docs/consent.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `ConsentProvider` | `@intecion/ipal-kit/client` | Provider zgody: `{ texts, cookieMap?, logEndpoint? }` — stan zgody, cookie, Consent Mode, usuwanie cookies po wycofaniu zgody, opcjonalny POST decyzji do logu (`'/api/ipal/consent'`). Owiń layout raz; wymagany przez baner, `Analytics`, `ConsentScript`. |
|
||||
| `CookieBanner` | `@intecion/ipal-kit/client` | Baner zgody + ustawienia kategorii: `settings: 'inline' \| 'modal' \| 'detailed'`, `controls`, `equalChoice` (zalecane `true`), `order`, `settingsActions`, `icon`, `classNames`; kolory z CSS vars `--ipal-*`. Nie pisz własnego banera. |
|
||||
| `CookieButton` | `@intecion/ipal-kit/client` | Pływający przycisk ponownego otwarcia ustawień cookies (wycofanie zgody); ukryty, gdy baner widoczny. Prop `className`. |
|
||||
| `ConsentScript` | `@intecion/ipal-kit/client` | Ładuje skrypt zewnętrzny (`src` lub `code`) dopiero po zgodzie na `category` — dla dostawców bez Consent Mode (czat, Plausible itp.). Wewnątrz `ConsentProvider`. |
|
||||
| `CookieTable` | `@intecion/ipal-kit/rsc` | Server Component: tabela cookies na stronę polityki cookies — `{ rows, labels, categories?, caption?, classNames? }`; `rows` z `getCookieTable()`. |
|
||||
| `useConsent(options?)` | `@intecion/ipal-kit/client` | Niskopoziomowy hook stanu zgody → `{ state, decided, consentId, acceptAll, rejectAll, savePreferences, reopen }`. Zwykle używaj `ConsentProvider` + `useConsentContext` (provider woła go sam). |
|
||||
| `useConsentContext()` | `@intecion/ipal-kit/client` | Hook: wartość `useConsent` + `texts` z `ConsentProvider` — do własnego UI zależnego od zgody (np. `state.marketing`). Rzuca poza providerem. |
|
||||
| `getConsentTexts({ payload, config, locale?, privacyPolicy?, settingsSlug? })` | `@intecion/ipal-kit` | Serwer: teksty banera z globalu CookieSettings (fallback EN per pole) + link do polityki prywatności ze stron systemowych → `Promise<ConsentTexts>`; przekaż do `ConsentProvider texts`. |
|
||||
| `getCookieTable({ payload, locale? })` | `@intecion/ipal-kit` | Serwer: wiersze Cookie Settings → Cookies w jednym języku → `Promise<CookieTableRow[]>` (nie rzuca) — dla `CookieTable`. |
|
||||
| `setDefaultConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent default` (z `wait_for_update`). `Analytics` woła sam przed załadowaniem tagów Google — nie wołaj. |
|
||||
| `updateConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent update` po decyzji. `useConsent` woła sam — nie wołaj. |
|
||||
| `parseConsent(raw, version?)` | `@intecion/ipal-kit` | Wartość cookie zgody → `ConsentState \| null` (null: brak, błąd lub inna wersja polityki). Do bramkowania po stronie serwera. |
|
||||
| `readConsentRecord(raw, version?)` | `@intecion/ipal-kit` | Jak `parseConsent`, ale pełny rekord `{ id, state, timestamp, version } \| null`. |
|
||||
| `serializeConsent(state, version?, id?)` | `@intecion/ipal-kit` | `ConsentState` → zakodowana wartość cookie (z timestampem i wersją). Zwykle robi to provider. |
|
||||
| `CONSENT_COOKIE` | `@intecion/ipal-kit` | Nazwa cookie zgody: `'cookie-consent'`. |
|
||||
| `CONSENT_VERSION` | `@intecion/ipal-kit` | Domyślna wersja polityki: `1` (nadpisywana w panelu: Cookie Settings → Policy version; zmiana unieważnia stare zgody). |
|
||||
| `CONSENT_MAX_AGE` | `@intecion/ipal-kit` | Ważność cookie zgody w sekundach: 180 dni. |
|
||||
| `CONSENT_CATEGORIES` | `@intecion/ipal-kit` | `['necessary', 'functional', 'analytics', 'marketing']`; `necessary` zawsze włączona. |
|
||||
| `DEFAULT_CONSENT` | `@intecion/ipal-kit` | Stan przed decyzją: tylko `necessary: true`. |
|
||||
| `ACCEPT_ALL_CONSENT` | `@intecion/ipal-kit` | Wszystkie kategorie `true`. |
|
||||
| `REJECT_ALL_CONSENT` | `@intecion/ipal-kit` | Tylko `necessary: true` (kopia `DEFAULT_CONSENT`). |
|
||||
| `CONSENT_LOG_SLUG` | `@intecion/ipal-kit` | Slug kolekcji logu zgód: `'consent-records'`. |
|
||||
| `buildConsentLogCollection()` | `@intecion/ipal-kit` | Kolekcja logu zgód (id, wybory, wersja, czas — bez IP/danych osobowych; dowód zgody RODO art. 7(1)). Plugin podpina sam przy `consentLog: true` — nie wołaj. |
|
||||
| `buildConsentLogEndpoint({ retentionDays? })` | `@intecion/ipal-kit` | Endpoint `POST /api/ipal/consent` zapisujący decyzje, czyści rekordy starsze niż `retentionDays` (domyślnie 1095). Plugin podpina sam przy `consentLog` — nie wołaj. |
|
||||
| `ConsentProvider` | `@intecion/ipal-kit/client` | Consent provider: `{ texts, cookieMap?, logEndpoint? }` — consent state, cookie, Consent Mode, deleting cookies after consent is withdrawn, optional POST of the decision to the log (`'/api/ipal/consent'`). Wrap the layout once; required by the banner, `Analytics`, `ConsentScript`. |
|
||||
| `CookieBanner` | `@intecion/ipal-kit/client` | Consent banner + category settings: `settings: 'inline' \| 'modal' \| 'detailed'`, `controls`, `equalChoice` (recommended `true`), `order`, `settingsActions`, `icon`, `classNames`; colours from `--ipal-*` CSS vars. Do not write your own banner. |
|
||||
| `CookieButton` | `@intecion/ipal-kit/client` | Floating button that reopens the cookie settings (withdrawing consent); hidden while the banner is visible. Prop `className`. |
|
||||
| `ConsentScript` | `@intecion/ipal-kit/client` | Loads an external script (`src` or `code`) only after consent for `category` — for vendors without Consent Mode (chat, Plausible etc.). Inside `ConsentProvider`. |
|
||||
| `CookieTable` | `@intecion/ipal-kit/rsc` | Server Component: cookie table for the cookie policy page — `{ rows, labels, categories?, caption?, classNames? }`; `rows` from `getCookieTable()`. |
|
||||
| `useConsent(options?)` | `@intecion/ipal-kit/client` | Low-level consent state hook → `{ state, decided, consentId, acceptAll, rejectAll, savePreferences, reopen }`. Usually use `ConsentProvider` + `useConsentContext` (the provider calls it itself). |
|
||||
| `useConsentContext()` | `@intecion/ipal-kit/client` | Hook: the `useConsent` value + `texts` from `ConsentProvider` — for your own consent-dependent UI (e.g. `state.marketing`). Throws outside the provider. |
|
||||
| `getConsentTexts({ payload, config, locale?, privacyPolicy?, settingsSlug? })` | `@intecion/ipal-kit` | Server: banner texts from the CookieSettings global (EN fallback per field) + privacy policy link from the system pages → `Promise<ConsentTexts>`; pass to `ConsentProvider texts`. |
|
||||
| `getCookieTable({ payload, locale? })` | `@intecion/ipal-kit` | Server: Cookie Settings → Cookies rows in one language → `Promise<CookieTableRow[]>` (does not throw) — for `CookieTable`. |
|
||||
| `setDefaultConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent default` (with `wait_for_update`). `Analytics` calls it itself before loading Google tags — do not call. |
|
||||
| `updateConsent(state)` | `@intecion/ipal-kit` | Google Consent Mode `consent update` after the decision. `useConsent` calls it itself — do not call. |
|
||||
| `parseConsent(raw, version?)` | `@intecion/ipal-kit` | Consent cookie value → `ConsentState \| null` (null: missing, error or a different policy version). For server-side gating. |
|
||||
| `readConsentRecord(raw, version?)` | `@intecion/ipal-kit` | Like `parseConsent`, but the full record `{ id, state, timestamp, version } \| null`. |
|
||||
| `serializeConsent(state, version?, id?)` | `@intecion/ipal-kit` | `ConsentState` → encoded cookie value (with timestamp and version). Usually the provider does this. |
|
||||
| `CONSENT_COOKIE` | `@intecion/ipal-kit` | Consent cookie name: `'cookie-consent'`. |
|
||||
| `CONSENT_VERSION` | `@intecion/ipal-kit` | Default policy version: `1` (overridden in the panel: Cookie Settings → Policy version; changing it invalidates old consents). |
|
||||
| `CONSENT_MAX_AGE` | `@intecion/ipal-kit` | Consent cookie lifetime in seconds: 180 days. |
|
||||
| `CONSENT_CATEGORIES` | `@intecion/ipal-kit` | `['necessary', 'functional', 'analytics', 'marketing']`; `necessary` always on. |
|
||||
| `DEFAULT_CONSENT` | `@intecion/ipal-kit` | State before the decision: only `necessary: true`. |
|
||||
| `ACCEPT_ALL_CONSENT` | `@intecion/ipal-kit` | All categories `true`. |
|
||||
| `REJECT_ALL_CONSENT` | `@intecion/ipal-kit` | Only `necessary: true` (a copy of `DEFAULT_CONSENT`). |
|
||||
| `CONSENT_LOG_SLUG` | `@intecion/ipal-kit` | Consent log collection slug: `'consent-records'`. |
|
||||
| `buildConsentLogCollection()` | `@intecion/ipal-kit` | Consent log collection (id, choices, version, time — no IP/personal data; proof of consent under GDPR Art. 7(1)). The plugin wires it itself with `consentLog: true` — do not call. |
|
||||
| `buildConsentLogEndpoint({ retentionDays? })` | `@intecion/ipal-kit` | `POST /api/ipal/consent` endpoint that saves decisions and deletes records older than `retentionDays` (default 1095). The plugin wires it itself with `consentLog` — do not call. |
|
||||
|
||||
**Typy:** `ConsentCategory`, `ConsentState`, `ConsentTexts`, `CookieTableRow`, `ConsentLogOptions` (root) — kategorie, stan zgody, teksty banera, wiersz tabeli cookies, opcje logu; `CookieBannerAction`, `CookieSettingsAction`, `CookieBannerClassNames` (`/client`) — przyciski i klasy `CookieBanner`; `CookieTableLabels` (`/rsc`) — nagłówki kolumn `CookieTable`.
|
||||
**Types:** `ConsentCategory`, `ConsentState`, `ConsentTexts`, `CookieTableRow`, `ConsentLogOptions` (root) — categories, consent state, banner texts, cookie table row, log options; `CookieBannerAction`, `CookieSettingsAction`, `CookieBannerClassNames` (`/client`) — `CookieBanner` buttons and classes; `CookieTableLabels` (`/rsc`) — `CookieTable` column headers.
|
||||
|
||||
## Strona w budowie (`construction`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/construction.md`
|
||||
## Under construction (`construction`) — details: `node_modules/@intecion/ipal-kit/docs/construction.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `ConstructionNotice` | `@intecion/ipal-kit/client` | Popup „strona w budowie”: `{ mode, classNames? }` — otwiera się po przekierowaniu z zablokowanego adresu (`?notice=construction`) i przy kliknięciu linku do niedostępnej strony; teksty z panelu, nic nie renderuje przy wyłączonym trybie. W `[locale]/layout.tsx` z `mode={await getConstructionMode(locale)}`. |
|
||||
| `isPathAllowed(pathname, allowedPaths)` | `@intecion/ipal-kit` | Czy ścieżka jest dozwolona w trybie budowy (dokładne dopasowanie, bez końcowego `/`) → `boolean`. `createPageRoute` używa sam — ręcznie tylko we własnych trasach. |
|
||||
| `constructionNoticeHref(homePath)` | `@intecion/ipal-kit` | Adres przekierowania zablokowanej strony: `${homePath}?notice=construction`. `createPageRoute` używa sam. |
|
||||
| `CONSTRUCTION_NOTICE_PARAM` | `@intecion/ipal-kit` | Nazwa parametru zapytania otwierającego popup: `'notice'` (wartość `construction`). |
|
||||
| `ConstructionNotice` | `@intecion/ipal-kit/client` | "Under construction" popup: `{ mode, classNames? }` — opens after a redirect from a blocked address (`?notice=construction`) and on a click on a link to an unavailable page; texts from the panel, renders nothing when the mode is off. In `[locale]/layout.tsx` with `mode={await getConstructionMode(locale)}`. |
|
||||
| `isPathAllowed(pathname, allowedPaths)` | `@intecion/ipal-kit` | Whether the path is allowed in under-construction mode (exact match, no trailing `/`) → `boolean`. `createPageRoute` uses it itself — by hand only in your own routes. |
|
||||
| `constructionNoticeHref(homePath)` | `@intecion/ipal-kit` | Redirect address for a blocked page: `${homePath}?notice=construction`. `createPageRoute` uses it itself. |
|
||||
| `CONSTRUCTION_NOTICE_PARAM` | `@intecion/ipal-kit` | Name of the query parameter that opens the popup: `'notice'` (value `construction`). |
|
||||
|
||||
**Typy:** `ConstructionMode` (root i `/client`) — `{ enabled, allowedPaths, homePath, texts }` z `getConstructionMode(locale)`; `ConstructionNoticeClassNames` (`/client`) — klasy popupu.
|
||||
**Types:** `ConstructionMode` (root and `/client`) — `{ enabled, allowedPaths, homePath, texts }` from `getConstructionMode(locale)`; `ConstructionNoticeClassNames` (`/client`) — popup classes.
|
||||
|
||||
## Treści i routing (`content`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/content.md`
|
||||
## Content and routing (`content`) — details: `node_modules/@intecion/ipal-kit/docs/content.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `resolveRoute({ payload, locale, segments, page, content, draft? })` | `@intecion/ipal-kit` | rozstrzyga ścieżkę catch-all → `{ type: 'home'\|'page'\|'archive'\|'entry', doc, … }` albo `null` (404); zwykle przez `resolveRoute` z `createContentHelpers` |
|
||||
| `getArchiveEntries({ payload, collection, locale, page, perPage, sort?, where?, depth?, draft? })` | `@intecion/ipal-kit` | pobiera stronę wpisów archiwum (`ArchiveEntries`); domyślne ustawienia ma `getEntries` z `createContentHelpers` |
|
||||
| `archiveFieldName(slug)` | `@intecion/ipal-kit` | nazwa pola archiwum w System Pages (`'posts'` → `'postsArchive'`); plugin dodaje te pola sam |
|
||||
| `buildEntryPath({ locale, archiveSlug, entrySlug })` | `@intecion/ipal-kit` | ścieżka wpisu `/pl/artykuly/moj-post` (zawsze z prefiksem locale) |
|
||||
| `buildArchivePath({ locale, archiveSlug, page })` | `@intecion/ipal-kit` | ścieżka listingu z paginacją `?page=N` (strona 1 bez query) |
|
||||
| `parsePageParam(value)` | `@intecion/ipal-kit` | `?page=` → liczba ≥ 1 (śmieci/brak → 1) |
|
||||
| `resolveRedirect({ payload, locale, segments, config, homeSlug, collections? })` | `@intecion/ipal-kit` | szuka starego sluga w `slugHistory` → ścieżka do `permanentRedirect` albo `null`; para do `trackSlugHistoryHook` — nie pisz własnego lookupu |
|
||||
| `resolveNotFoundPage({ payload, locale, pagesSlug?, settingsSlug? })` | `@intecion/ipal-kit` | strona przypisana jako 404 w System Pages albo `null`; nie rzuca (z helperami: `getNotFoundPage`) |
|
||||
| `blocksToMarkdown(layout, { overrides? })` | `@intecion/ipal-kit` | bloki strony → Markdown po konwencji nazw pól (heading, body, items…) |
|
||||
| `createMarkdownRenderer({ content, collection?, layoutField?, overrides?, frontmatter?, baseUrl?, config? })` | `@intecion/ipal-kit` | zwraca `render({ payload, locale, slug })` → Markdown strony (GEO) albo `null` |
|
||||
| `createMarkdownRoute({ getCachedPayload, content, config, baseUrl })` | `@intecion/ipal-kit` | gotowy handler `GET` trasy `/md/...`; zwykle wystarczy `markdownRoute` z `createContentHelpers` |
|
||||
| `markdownResponse(md, { canonical? })` | `@intecion/ipal-kit` | `Response` `text/markdown` (noindex, `s-maxage`) albo 404 dla `null` |
|
||||
| `MARKDOWN_PREFIX` | `@intecion/ipal-kit` | stała `'/md'` — domyślny prefiks tras Markdown |
|
||||
| `markdownHref(pathname, prefix?)` | `@intecion/ipal-kit` | ścieżka strony → adres wersji Markdown (`/pl/o-nas` → `/md/pl/o-nas`), np. do `alternates.types` |
|
||||
| `prefersMarkdown(request \| headers \| accept)` | `@intecion/ipal-kit` | czy nagłówek `Accept` woli `text/markdown` (q-values); do własnego proxy — `createProxy({ markdown: true })` robi to sam |
|
||||
| `searchContent({ payload, query, config, locale?, limit?, baseUrl?, collection?, summaryField? })` | `@intecion/ipal-kit` | wyszukiwanie opublikowanych, indeksowalnych stron po tytule/opisie → `SearchResult[]`; nie rzuca |
|
||||
| `listContent({ payload, config, locale?, limit? })` | `@intecion/ipal-kit` | spis opublikowanych, indeksowalnych stron (bez zapytania) — używa go MCP `list_pages` |
|
||||
| `createSearchRoute({ getCachedPayload, config, baseUrl, defaultLimit?, rateLimit?, clientIp? })` | `@intecion/ipal-kit` | handler `GET` endpointu JSON wyszukiwarki (`?q=&locale=&limit=`), z limitem zapytań per IP |
|
||||
| `resolveRoute({ payload, locale, segments, page, content, draft? })` | `@intecion/ipal-kit` | resolves a catch-all path → `{ type: 'home'\|'page'\|'archive'\|'entry', doc, … }` or `null` (404); usually through `resolveRoute` from `createContentHelpers` |
|
||||
| `getArchiveEntries({ payload, collection, locale, page, perPage, sort?, where?, depth?, draft? })` | `@intecion/ipal-kit` | fetches a page of archive entries (`ArchiveEntries`); `getEntries` from `createContentHelpers` has the defaults |
|
||||
| `archiveFieldName(slug)` | `@intecion/ipal-kit` | name of the archive field in System Pages (`'posts'` → `'postsArchive'`); the plugin adds these fields itself |
|
||||
| `buildEntryPath({ locale, archiveSlug, entrySlug })` | `@intecion/ipal-kit` | entry path `/pl/artykuly/moj-post` (always with the locale prefix) |
|
||||
| `buildArchivePath({ locale, archiveSlug, page })` | `@intecion/ipal-kit` | listing path with `?page=N` pagination (page 1 without a query) |
|
||||
| `parsePageParam(value)` | `@intecion/ipal-kit` | `?page=` → number ≥ 1 (junk/missing → 1) |
|
||||
| `resolveRedirect({ payload, locale, segments, config, homeSlug, collections? })` | `@intecion/ipal-kit` | looks up an old slug in `slugHistory` → path for `permanentRedirect` or `null`; pairs with `trackSlugHistoryHook` — do not write your own lookup |
|
||||
| `resolveNotFoundPage({ payload, locale, pagesSlug?, settingsSlug? })` | `@intecion/ipal-kit` | page assigned as 404 in System Pages or `null`; does not throw (with the helpers: `getNotFoundPage`) |
|
||||
| `blocksToMarkdown(layout, { overrides? })` | `@intecion/ipal-kit` | page blocks → Markdown by field naming convention (heading, body, items…) |
|
||||
| `createMarkdownRenderer({ content, collection?, layoutField?, overrides?, frontmatter?, baseUrl?, config? })` | `@intecion/ipal-kit` | returns `render({ payload, locale, slug })` → page Markdown (GEO) or `null` |
|
||||
| `createMarkdownRoute({ getCachedPayload, content, config, baseUrl })` | `@intecion/ipal-kit` | ready `GET` handler for the `/md/...` route; usually `markdownRoute` from `createContentHelpers` is enough |
|
||||
| `markdownResponse(md, { canonical? })` | `@intecion/ipal-kit` | `Response` `text/markdown` (noindex, `s-maxage`) or 404 for `null` |
|
||||
| `MARKDOWN_PREFIX` | `@intecion/ipal-kit` | constant `'/md'` — default prefix of Markdown routes |
|
||||
| `markdownHref(pathname, prefix?)` | `@intecion/ipal-kit` | page path → Markdown version address (`/pl/o-nas` → `/md/pl/o-nas`), e.g. for `alternates.types` |
|
||||
| `prefersMarkdown(request \| headers \| accept)` | `@intecion/ipal-kit` | whether the `Accept` header prefers `text/markdown` (q-values); for your own proxy — `createProxy({ markdown: true })` does it itself |
|
||||
| `searchContent({ payload, query, config, locale?, limit?, baseUrl?, collection?, summaryField? })` | `@intecion/ipal-kit` | searches published, indexable pages by title/description → `SearchResult[]`; does not throw |
|
||||
| `listContent({ payload, config, locale?, limit? })` | `@intecion/ipal-kit` | list of published, indexable pages (no query) — used by MCP `list_pages` |
|
||||
| `createSearchRoute({ getCachedPayload, config, baseUrl, defaultLimit?, rateLimit?, clientIp? })` | `@intecion/ipal-kit` | `GET` handler for the JSON search endpoint (`?q=&locale=&limit=`), with a per-IP rate limit |
|
||||
|
||||
**Typy:** `ContentOption`, `ContentCollectionOption` — opcja `content` pluginu (kolekcje archiwalne: `slug`, `label`, `perPage`); `ResolvedRoute` — wynik `resolveRoute`; `ArchiveEntries` — strona wpisów (`docs`, `page`, `totalDocs`, `totalPages`, `hasPrevPage`, `hasNextPage`); `SearchResult` — wynik wyszukiwania (`title`, `url`, `description?`, `slug`).
|
||||
**Types:** `ContentOption`, `ContentCollectionOption` — the plugin's `content` option (archive collections: `slug`, `label`, `perPage`); `ResolvedRoute` — `resolveRoute` result; `ArchiveEntries` — a page of entries (`docs`, `page`, `totalDocs`, `totalPages`, `hasPrevPage`, `hasNextPage`); `SearchResult` — search result (`title`, `url`, `description?`, `slug`).
|
||||
|
||||
## E-mail (`email`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/email.md`
|
||||
## E-mail (`email`) — details: `node_modules/@intecion/ipal-kit/docs/email.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `mailAdapter({ smtp?, graph?, fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | zalecany adapter do `buildConfig({ email })`: przy każdej wysyłce wybiera SMTP albo Graph wg ustawienia w panelu i zapisuje status integracji; plugin sam `config.email` nie ustawia |
|
||||
| `panelSmtpAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | adapter Payloada wysyłający zawsze przez SMTP skonfigurowany w Site Integrations |
|
||||
| `graphAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | adapter Payloada przez Microsoft Graph (Exchange/M365; dane `GRAPH_*` z env) |
|
||||
| `sendEmail({ payload, to, subject, html, text?, from?, replyTo? })` | `@intecion/ipal-kit/server` | wysyłka własnego maila (Twój HTML) zawsze przez SMTP z panelu → `{ sent: true, messageId }` / `{ sent: false, error }`; nie rzuca; tylko kod serwerowy |
|
||||
| `mailAdapter({ smtp?, graph?, fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | recommended adapter for `buildConfig({ email })`: on every send picks SMTP or Graph per the panel setting and saves the integration status; the plugin does not set `config.email` itself |
|
||||
| `panelSmtpAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | Payload adapter that always sends through the SMTP configured in Site Integrations |
|
||||
| `graphAdapter({ fallbackFromAddress?, fallbackFromName? })` | `@intecion/ipal-kit` | Payload adapter through Microsoft Graph (Exchange/M365; `GRAPH_*` credentials from env) |
|
||||
| `sendEmail({ payload, to, subject, html, text?, from?, replyTo? })` | `@intecion/ipal-kit/server` | sends your own e-mail (your HTML) always through SMTP from the panel → `{ sent: true, messageId }` / `{ sent: false, error }`; does not throw; server code only |
|
||||
|
||||
**Typy:** `MailAdapterArgs`, `PanelSmtpAdapterArgs`, `GraphAdapterArgs` — opcje adapterów; `SendEmailArgs`, `SendEmailResult` (`/server`) — argumenty i wynik `sendEmail`.
|
||||
**Types:** `MailAdapterArgs`, `PanelSmtpAdapterArgs`, `GraphAdapterArgs` — adapter options; `SendEmailArgs`, `SendEmailResult` (`/server`) — `sendEmail` arguments and result.
|
||||
|
||||
## Zmienne środowiskowe (`env`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/env.md`
|
||||
## Environment variables (`env`) — details: `node_modules/@intecion/ipal-kit/docs/env.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `assertEnv(rules, { env?, label? })` | `@intecion/ipal-kit/env`, `@intecion/ipal-kit` | waliduje `process.env` wg reguł na starcie; zbiera wszystkie braki i rzuca jeden błąd |
|
||||
| `ipalEnvRules({ storage?, emailGraph?, ipHeader?, turnstile?, serverUrlVar?, secretVar?, databaseVar? })` | `@intecion/ipal-kit/env`, `@intecion/ipal-kit` | gotowy zestaw reguł (`DATABASE_URI`, `PAYLOAD_SECRET`, `NEXT_PUBLIC_SERVER_URL` + `R2_*`/`GRAPH_*`/Turnstile/`IPAL_IP_HEADER` wg używanych funkcji) do `assertEnv` |
|
||||
| `assertEnv(rules, { env?, label? })` | `@intecion/ipal-kit/env`, `@intecion/ipal-kit` | validates `process.env` against the rules at startup; collects every missing item and throws one error |
|
||||
| `ipalEnvRules({ storage?, emailGraph?, ipHeader?, turnstile?, serverUrlVar?, secretVar?, databaseVar? })` | `@intecion/ipal-kit/env`, `@intecion/ipal-kit` | ready rule set (`DATABASE_URI`, `PAYLOAD_SECRET`, `NEXT_PUBLIC_SERVER_URL` + `R2_*`/`GRAPH_*`/Turnstile/`IPAL_IP_HEADER` depending on the features used) for `assertEnv` |
|
||||
|
||||
**Typy:** `EnvRule`, `EnvKind` — reguła zmiennej (`name`, `required`, `kind`, `oneOf`, `validate`); `AssertEnvOptions` — opcje `assertEnv`; `IpalEnvFeatures` — argument `ipalEnvRules` (wszystkie z `/env` i root).
|
||||
**Types:** `EnvRule`, `EnvKind` — variable rule (`name`, `required`, `kind`, `oneOf`, `validate`); `AssertEnvOptions` — `assertEnv` options; `IpalEnvFeatures` — `ipalEnvRules` argument (all from `/env` and root).
|
||||
|
||||
## Warstwa frontu (`frontend`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/frontend.md`
|
||||
## Frontend layer (`frontend`) — details: `node_modules/@intecion/ipal-kit/docs/frontend.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createContentHelpers({ config, content?, i18n?, baseUrl?, … })` | `@intecion/ipal-kit` | fabryka `src/lib/content.ts`: cache'owane `getCachedPayload`, `getSettings`, `resolveRoute`, `getEntries`, `generatePageMetadata`, `getSiteShell`, `sitemap`, `robots`, `markdownRoute`, `healthRoute`, `mcpGET`/`mcpPOST`… — nie pisz tych wrapperów sam |
|
||||
| `createPageRoute(content, { blocks, notFound, permanentRedirect, redirect?, … })` | `@intecion/ipal-kit/rsc` | gotowa strona catch-all `[[...slug]]` → `{ Page, generateMetadata, generateStaticParams }` (bloki, redirecty slug history, JSON-LD, tryb „w budowie”); nie paginuje `?page=` |
|
||||
| `createNotFoundPage(content, { load } \| { blocks, fallback?, … })` | `@intecion/ipal-kit/rsc` | domyślny eksport `not-found.tsx` — strona 404 wybrana w panelu albo fallback (zalecany wariant leniwy z `load`) |
|
||||
| `renderNotFoundView(content, { blocks, fallback?, blockProps?, layoutField? }, locale)` | `@intecion/ipal-kit/rsc` | treść 404 w jednym języku — wołana z server action dla leniwego `createNotFoundPage({ load })` (pages.md) |
|
||||
| `SiteProviders` | `@intecion/ipal-kit/rsc` | komponent layoutu: `shell={await getSiteShell(locale)}` montuje consent, cookie banner, analytics, Turnstile, JSON-LD strony, theme script; nie montuje `AlternateLinksProvider` |
|
||||
| `createContentHelpers({ config, content?, i18n?, baseUrl?, … })` | `@intecion/ipal-kit` | factory for `src/lib/content.ts`: cached `getCachedPayload`, `getSettings`, `resolveRoute`, `getEntries`, `generatePageMetadata`, `getSiteShell`, `sitemap`, `robots`, `markdownRoute`, `healthRoute`, `mcpGET`/`mcpPOST`… — do not write these wrappers yourself |
|
||||
| `createPageRoute(content, { blocks, notFound, permanentRedirect, redirect?, … })` | `@intecion/ipal-kit/rsc` | ready `[[...slug]]` catch-all page → `{ Page, generateMetadata, generateStaticParams }` (blocks, slug history redirects, JSON-LD, under-construction mode); does not paginate `?page=` |
|
||||
| `createNotFoundPage(content, { load } \| { blocks, fallback?, … })` | `@intecion/ipal-kit/rsc` | default export of `not-found.tsx` — the 404 page chosen in the panel or a fallback (the lazy `load` variant is recommended) |
|
||||
| `renderNotFoundView(content, { blocks, fallback?, blockProps?, layoutField? }, locale)` | `@intecion/ipal-kit/rsc` | 404 content in one language — called from a server action for the lazy `createNotFoundPage({ load })` (pages.md) |
|
||||
| `SiteProviders` | `@intecion/ipal-kit/rsc` | layout component: `shell={await getSiteShell(locale)}` mounts consent, cookie banner, analytics, Turnstile, site JSON-LD, theme script; does not mount `AlternateLinksProvider` |
|
||||
|
||||
Pełne listy opcji `createContentHelpers` / `createPageRoute` / `SiteProviders` i zwracanych kluczy `@/lib/content`: `node_modules/@intecion/ipal-kit/docs/frontend.md`.
|
||||
Full option lists of `createContentHelpers` / `createPageRoute` / `SiteProviders` and the returned `@/lib/content` keys: `node_modules/@intecion/ipal-kit/docs/frontend.md`.
|
||||
|
||||
**Typy:** `ContentHelpers` — wynik `createContentHelpers`; `SiteShell` — dane layoutu z `getSiteShell` (consent, analytics, theme, jsonLd, settings, formTexts, turnstileSiteKey); `PageJsonLdOptions`, `EntryJsonLdContext` — opcje `getPageJsonLd` / własne węzły JSON-LD wpisów (root); `PageRouteOptions`, `NotFoundPageOptions`, `NotFoundViewOptions`, `SiteProvidersProps` (`/rsc`) — opcje `createPageRoute`, `createNotFoundPage`, `renderNotFoundView` i propsy `SiteProviders`.
|
||||
**Types:** `ContentHelpers` — `createContentHelpers` result; `SiteShell` — layout data from `getSiteShell` (consent, analytics, theme, jsonLd, settings, formTexts, turnstileSiteKey); `PageJsonLdOptions`, `EntryJsonLdContext` — `getPageJsonLd` options / your own JSON-LD nodes for entries (root); `PageRouteOptions`, `NotFoundPageOptions`, `NotFoundViewOptions`, `SiteProvidersProps` (`/rsc`) — options of `createPageRoute`, `createNotFoundPage`, `renderNotFoundView` and `SiteProviders` props.
|
||||
|
||||
## Health check (`health`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/deployment.md`
|
||||
## Health check (`health`) — details: `node_modules/@intecion/ipal-kit/docs/deployment.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createHealthRoute({ getCachedPayload, collection?, extra? })` | `@intecion/ipal-kit` | handler `GET` dla `app/api/health/route.ts`: round-trip do bazy → 200 `{ status: 'ok', db: 'up' }` / 503; zwykle wystarczy `healthRoute` z `createContentHelpers` |
|
||||
| `createHealthRoute({ getCachedPayload, collection?, extra? })` | `@intecion/ipal-kit` | `GET` handler for `app/api/health/route.ts`: database round-trip → 200 `{ status: 'ok', db: 'up' }` / 503; usually `healthRoute` from `createContentHelpers` is enough |
|
||||
|
||||
## Hooki kolekcji (`hooks`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/hooks.md`
|
||||
## Collection hooks (`hooks`) — details: `node_modules/@intecion/ipal-kit/docs/hooks.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildRevalidateHook({ revalidatePath, config, homeSlug? })` | `@intecion/ipal-kit` | → `{ afterChange, afterDelete }` odświeżające ISR ścieżek dokumentu we wszystkich językach; `revalidatePath` z `next/cache` wstrzykuje projekt |
|
||||
| `setPublishedAtHook` | `@intecion/ipal-kit` | `beforeChange`: ustawia `publishedAt` przy pierwszej publikacji (nie nadpisuje istniejącej daty) |
|
||||
| `trackSlugHistoryHook` | `@intecion/ipal-kit` | `beforeChange`: dopisuje stary slug do pola `slugHistory` (pole dodaj sam); odczyt robi `resolveRedirect` |
|
||||
| `buildPreventDeleteSystemPage({ settingsSlug?, roleFields? })` | `@intecion/ipal-kit` | `beforeDelete`: blokuje usunięcie strony przypisanej do roli systemowej (homepage, polityki) |
|
||||
| `buildValidateUniqueRole({ siblingFields })` | `@intecion/ipal-kit` | `beforeValidate` pola roli: jedna strona nie może mieć dwóch ról; plugin nie dokłada go do swoich pól — dopinasz sam |
|
||||
| `buildCrossLocaleFieldSync({ config, collection, fields, arrayField?, guardFlag? })` | `@intecion/ipal-kit` | `afterChange`: kopiuje wskazane pola (np. obrazki) w lokalizowanych `blocks` do pozostałych języków |
|
||||
| `buildRevalidateHook({ revalidatePath, config, homeSlug? })` | `@intecion/ipal-kit` | → `{ afterChange, afterDelete }` that revalidate ISR for the document paths in all languages; the project injects `revalidatePath` from `next/cache` |
|
||||
| `setPublishedAtHook` | `@intecion/ipal-kit` | `beforeChange`: sets `publishedAt` on first publish (does not overwrite an existing date) |
|
||||
| `trackSlugHistoryHook` | `@intecion/ipal-kit` | `beforeChange`: appends the old slug to the `slugHistory` field (add the field yourself); `resolveRedirect` reads it |
|
||||
| `buildPreventDeleteSystemPage({ settingsSlug?, roleFields? })` | `@intecion/ipal-kit` | `beforeDelete`: blocks deleting a page assigned to a system role (homepage, policies) |
|
||||
| `buildValidateUniqueRole({ siblingFields })` | `@intecion/ipal-kit` | `beforeValidate` for a role field: one page cannot have two roles; the plugin does not add it to its own fields — wire it yourself |
|
||||
| `buildCrossLocaleFieldSync({ config, collection, fields, arrayField?, guardFlag? })` | `@intecion/ipal-kit` | `afterChange`: copies the given fields (e.g. images) in localized `blocks` to the other languages |
|
||||
|
||||
## Języki i i18n (`i18n`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/i18n.md`
|
||||
## Languages and i18n (`i18n`) — details: `node_modules/@intecion/ipal-kit/docs/i18n.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getLocaleCodes(config)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | lista kodów języków z `I18nConfig` |
|
||||
| `getDefaultLocale(config)` | `@intecion/ipal-kit` | domyślny język z configu |
|
||||
| `isValidLocale(code, config)` | `@intecion/ipal-kit` | czy kod jest skonfigurowanym językiem |
|
||||
| `getLocaleDefinition(code, config)` | `@intecion/ipal-kit` | definicja języka `{ code, label, rtl? }` |
|
||||
| `getLocalizedSlugs({ slugField, config })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | pole slug z `locale: 'all'` → mapa `{ pl, en }` |
|
||||
| `buildLocalizedPath({ slugs, locale, config, homeSlug?, prefix? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | ścieżka strony w języku (home → root, jeden język → bez `/pl`); `undefined` gdy brak sluga |
|
||||
| `switchLocalePath({ slugs, targetLocale, config, homeSlug?, prefix? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | adres po zmianie języka bez 404 (brak tłumaczenia → archiwum albo `/{locale}`) |
|
||||
| `resolveLocalized(value, locale, fallback?)` | `@intecion/ipal-kit` | pole lokalizowane (string albo mapa) → tekst w danym języku |
|
||||
| `negotiateLocale({ config, cookieLocale, acceptLanguage })` | `@intecion/ipal-kit` | wybór języka: cookie → Accept-Language → domyślny |
|
||||
| `matchAcceptLanguage(header, config)` | `@intecion/ipal-kit` | dopasowanie nagłówka `Accept-Language` do skonfigurowanych języków |
|
||||
| `LOCALE_COOKIE_NAME` | `@intecion/ipal-kit` | stała `'NEXT_LOCALE'` — cookie wybranego języka (functional, zapis tylko za zgodą) |
|
||||
| `createProxy(i18nConfig, { NextResponse, markdown?, exposeHeaders?, consentCategory?, cookieName? })` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | zalecany `proxy.ts`: negocjacja języka, redirect `/` → `/{locale}`, cookie za zgodą, nagłówki `x-locale`/`x-pathname`, opcjonalnie trasy Markdown |
|
||||
| `createLocaleMiddleware({ config, cookieName? })` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | niższy poziom: funkcja `req → LocaleMiddlewareResult` do własnego proxy |
|
||||
| `DEFAULT_PROXY_MATCHER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | alias `DEFAULT_MIDDLEWARE_MATCHER` dla `createProxy`; w `config.matcher` wklej wartość jako literał |
|
||||
| `DEFAULT_MIDDLEWARE_MATCHER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | tablica `['/((?!api\|admin\|_next\|.*\\..*).*)']` (wyklucza `api`, `admin`, `_next`, pliki); w `config.matcher` wklej jako literał — Next czyta matcher statycznie |
|
||||
| `AlternateLinksProvider` | `@intecion/ipal-kit/client` | provider w layoutcie trzymający adresy bieżącej strony per język (dla `LanguageSwitcher`); `SiteProviders` go nie montuje |
|
||||
| `AlternateLinksUpdater` | `@intecion/ipal-kit/client` | `<AlternateLinksUpdater links={{ pl, en }} />` na stronie — zgłasza jej adresy w innych językach |
|
||||
| `LanguageSwitcher` | `@intecion/ipal-kit/client` | headless przełącznik języka (`config`, `currentLocale`, `classNames`, `renderLabel`) linkujący do adresów z kontekstu |
|
||||
| `useAlternateLinks()` | `@intecion/ipal-kit/client` | hook: `{ [locale]: url }` bieżącej strony — do własnego przełącznika |
|
||||
| `useSetAlternateLinks()` | `@intecion/ipal-kit/client` | hook-setter używany przez `AlternateLinksUpdater` (zwykle niepotrzebny) |
|
||||
| `getLocaleCodes(config)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | list of language codes from `I18nConfig` |
|
||||
| `getDefaultLocale(config)` | `@intecion/ipal-kit` | default language from the config |
|
||||
| `isValidLocale(code, config)` | `@intecion/ipal-kit` | whether the code is a configured language |
|
||||
| `getLocaleDefinition(code, config)` | `@intecion/ipal-kit` | language definition `{ code, label, rtl? }` |
|
||||
| `getLocalizedSlugs({ slugField, config })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | slug field from `locale: 'all'` → map `{ pl, en }` |
|
||||
| `buildLocalizedPath({ slugs, locale, config, homeSlug?, prefix? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | page path in a language (home → root, single language → no `/pl`); `undefined` when the slug is missing |
|
||||
| `switchLocalePath({ slugs, targetLocale, config, homeSlug?, prefix? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | address after a language switch without a 404 (no translation → archive or `/{locale}`) |
|
||||
| `resolveLocalized(value, locale, fallback?)` | `@intecion/ipal-kit` | localized field (string or map) → text in the given language |
|
||||
| `negotiateLocale({ config, cookieLocale, acceptLanguage })` | `@intecion/ipal-kit` | language choice: cookie → Accept-Language → default |
|
||||
| `matchAcceptLanguage(header, config)` | `@intecion/ipal-kit` | matches the `Accept-Language` header to the configured languages |
|
||||
| `LOCALE_COOKIE_NAME` | `@intecion/ipal-kit` | constant `'NEXT_LOCALE'` — cookie with the chosen language (functional, saved only with consent) |
|
||||
| `createProxy(i18nConfig, { NextResponse, markdown?, exposeHeaders?, consentCategory?, cookieName? })` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | recommended `proxy.ts`: language negotiation, redirect `/` → `/{locale}`, cookie with consent, `x-locale`/`x-pathname` headers, optional Markdown routes |
|
||||
| `createLocaleMiddleware({ config, cookieName? })` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | lower level: a `req → LocaleMiddlewareResult` function for your own proxy |
|
||||
| `DEFAULT_PROXY_MATCHER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | alias of `DEFAULT_MIDDLEWARE_MATCHER` for `createProxy`; paste the value into `config.matcher` as a literal |
|
||||
| `DEFAULT_MIDDLEWARE_MATCHER` | `@intecion/ipal-kit/next/middleware`, `@intecion/ipal-kit` | array `['/((?!api\|admin\|_next\|.*\\..*).*)']` (excludes `api`, `admin`, `_next`, files); paste into `config.matcher` as a literal — Next reads the matcher statically |
|
||||
| `AlternateLinksProvider` | `@intecion/ipal-kit/client` | layout provider that holds the current page's addresses per language (for `LanguageSwitcher`); `SiteProviders` does not mount it |
|
||||
| `AlternateLinksUpdater` | `@intecion/ipal-kit/client` | `<AlternateLinksUpdater links={{ pl, en }} />` on a page — reports its addresses in other languages |
|
||||
| `LanguageSwitcher` | `@intecion/ipal-kit/client` | headless language switcher (`config`, `currentLocale`, `classNames`, `renderLabel`) linking to the addresses from context |
|
||||
| `useAlternateLinks()` | `@intecion/ipal-kit/client` | hook: `{ [locale]: url }` of the current page — for your own switcher |
|
||||
| `useSetAlternateLinks()` | `@intecion/ipal-kit/client` | setter hook used by `AlternateLinksUpdater` (usually not needed) |
|
||||
|
||||
**Typy:** `I18nConfig`, `LocaleDefinition` — config języków (`defaultLocale`, `locales[{ code, label, rtl? }]`, `fallback`); `LocalizedSlugs` — mapa slugów per język; `LocaleMiddlewareResult` — wynik `createLocaleMiddleware` (`next`/`redirect` + cookie); `AlternateLinks`, `LanguageSwitcherClassNames` (`/client`) — mapa adresów per język i klasy przełącznika.
|
||||
**Types:** `I18nConfig`, `LocaleDefinition` — language config (`defaultLocale`, `locales[{ code, label, rtl? }]`, `fallback`); `LocalizedSlugs` — map of slugs per language; `LocaleMiddlewareResult` — `createLocaleMiddleware` result (`next`/`redirect` + cookie); `AlternateLinks`, `LanguageSwitcherClassNames` (`/client`) — map of addresses per language and switcher classes.
|
||||
|
||||
## Status integracji (`integrations`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/integrations.md`
|
||||
## Integration status (`integrations`) — details: `node_modules/@intecion/ipal-kit/docs/integrations.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | zapisuje stan własnej integracji w Site Integrations (tylko przy zmianie / co 10 min); nie rzuca. Dla e-maila i Turnstile plugin woła to sam — nie wołaj |
|
||||
| `buildIntegrationStatusField(name)` | `@intecion/ipal-kit` | ukryte pole-grupa statusu (`state`, `code`, `message`, `since`, `checkedAt`) do `integrationsFields` |
|
||||
| `buildIntegrationStatusBanner(statusField, label)` | `@intecion/ipal-kit` | pole UI z banerem statusu na zakładce integracji (`integrationsFields`; potem `pnpm generate:importmap`) |
|
||||
| `IntegrationAlerts` | `@intecion/ipal-kit/admin` | alert na dashboardzie o integracjach w stanie `degraded`; wstrzykiwany przez plugin zawsze (`beforeDashboard`); własne integracje: drugi egzemplarz z `checks` |
|
||||
| `IntegrationStatusBanner` | `@intecion/ipal-kit/admin` | baner statusu na zakładce; wstrzykiwany przez plugin / `buildIntegrationStatusBanner` przez import map (`pnpm generate:importmap`), projekt go nie importuje |
|
||||
| `recordIntegrationStatus(payload, field, previous, { state, code?, message? })` | `@intecion/ipal-kit` | saves the state of your own integration in Site Integrations (only on change / every 10 min); does not throw. For e-mail and Turnstile the plugin calls it itself — do not call |
|
||||
| `buildIntegrationStatusField(name)` | `@intecion/ipal-kit` | hidden status group field (`state`, `code`, `message`, `since`, `checkedAt`) for `integrationsFields` |
|
||||
| `buildIntegrationStatusBanner(statusField, label)` | `@intecion/ipal-kit` | UI field with a status banner on the integration tab (`integrationsFields`; then `pnpm generate:importmap`) |
|
||||
| `IntegrationAlerts` | `@intecion/ipal-kit/admin` | dashboard alert about integrations in the `degraded` state; always injected by the plugin (`beforeDashboard`); your own integrations: a second instance with `checks` |
|
||||
| `IntegrationStatusBanner` | `@intecion/ipal-kit/admin` | status banner on the tab; injected by the plugin / `buildIntegrationStatusBanner` through the import map (`pnpm generate:importmap`), the project does not import it |
|
||||
|
||||
**Typy:** `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus` — stan i zapisany status integracji.
|
||||
**Types:** `IntegrationState` (`'ok' | 'degraded'`), `IntegrationStatus` — integration state and saved status.
|
||||
|
||||
## Formularze (`forms`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/forms.md`
|
||||
## Forms (`forms`) — details: `node_modules/@intecion/ipal-kit/docs/forms.md`
|
||||
|
||||
Formularze buduje redaktor w panelu (kolekcja Forms). Projekt NIE pisze własnych formularzy: blok renderuje `<RenderForm>`, wysyłka idzie przez `sendForm = createSubmitAction(...)`.
|
||||
The editor builds forms in the panel (Forms collection). The project does NOT write its own forms: the block renders `<RenderForm>`, submission goes through `sendForm = createSubmitAction(...)`.
|
||||
|
||||
### Konfiguracja i pola panelu (config-time)
|
||||
### Configuration and panel fields (config-time)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildFormsPlugin(forms)` | `@intecion/ipal-kit` | Wpina `@payloadcms/plugin-form-builder` (Forms + Form Submissions, typy pól, zamknięty REST dla zgłoszeń); plugin podpina sam przy opcji `forms` — nie wołaj |
|
||||
| `stepBlock` | `@intecion/ipal-kit` | Blok form-buildera „Step” (podział formularza na kroki, z „Show only when”); plugin dodaje sam (`forms.fields.step`) — tylko do własnej konfiguracji form-buildera |
|
||||
| `checkboxGroupBlock` | `@intecion/ipal-kit` | Blok „Checkbox group” (wielokrotny wybór, `minSelected`/`maxSelected`, wartość `string[]`); plugin dodaje sam (`forms.fields.checkboxGroup`) |
|
||||
| `timeBlock` | `@intecion/ipal-kit` | Blok „Time” (`<input type="time">`, wartość `HH:MM`); plugin dodaje sam (`forms.fields.time`) |
|
||||
| `placeholderField` | `@intecion/ipal-kit` | Pole Payload `placeholder` (lokalizowana podpowiedź w pustym polu) do własnych bloków formularza |
|
||||
| `withPlaceholder(block)` | `@intecion/ipal-kit` | Dokleja `placeholderField` do bloku; wbudowane text/email/textarea/number plugin obsługuje sam — używaj dla własnego bloku (potem migracja) |
|
||||
| `buildFormAnalyticsFields()` | `@intecion/ipal-kit` | Zwraca grupę pól `analytics` (Event name, domyślnie `form_submit`, + Event parameters) do `forms.formOverrides.fields` — event GTM po wysłaniu ustawiany z panelu |
|
||||
| `buildFormsPlugin(forms)` | `@intecion/ipal-kit` | Wires `@payloadcms/plugin-form-builder` (Forms + Form Submissions, field types, closed REST for submissions); the plugin wires it itself with the `forms` option — do not call |
|
||||
| `stepBlock` | `@intecion/ipal-kit` | Form-builder "Step" block (splits the form into steps, with "Show only when"); the plugin adds it itself (`forms.fields.step`) — only for your own form-builder configuration |
|
||||
| `checkboxGroupBlock` | `@intecion/ipal-kit` | "Checkbox group" block (multiple choice, `minSelected`/`maxSelected`, value `string[]`); the plugin adds it itself (`forms.fields.checkboxGroup`) |
|
||||
| `timeBlock` | `@intecion/ipal-kit` | "Time" block (`<input type="time">`, value `HH:MM`); the plugin adds it itself (`forms.fields.time`) |
|
||||
| `placeholderField` | `@intecion/ipal-kit` | Payload `placeholder` field (localized hint in an empty field) for your own form blocks |
|
||||
| `withPlaceholder(block)` | `@intecion/ipal-kit` | Appends `placeholderField` to a block; the plugin handles the built-in text/email/textarea/number itself — use it for your own block (then a migration) |
|
||||
| `buildFormAnalyticsFields()` | `@intecion/ipal-kit` | Returns the `analytics` field group (Event name, default `form_submit`, + Event parameters) for `forms.formOverrides.fields` — GTM event after submit, set from the panel |
|
||||
|
||||
### Render (serwer → klient)
|
||||
### Render (server → client)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `RenderForm({ form, action, locale, texts, classNames?, values?, … })` | `@intecion/ipal-kit/rsc` | Formularz z panelu w bloku jedną linią (RSC): renderuje bloki message i potwierdzenie, wiąże `sendForm` z formularzem i językiem, rozwiązuje redirect, wysyła do przeglądarki tylko `publicForm`; `form` niepopulowany → nic |
|
||||
| `prepareBuilderForm({ form, action, locale, … })` | `@intecion/ipal-kit/rsc` | Serwerowa połowa `RenderForm` bez markupu → `PreparedBuilderForm` (albo `null`) do rozłożenia w `<BuilderForm>` w komponencie klienckim (np. konfigurator ze zmiennym `values`) |
|
||||
| `publicForm(form)` | `@intecion/ipal-kit/rsc` | Publiczna część dokumentu formularza (bez zakładki Emails, bez rich textu message, bezpieczny redirect URL) — gdy sam przekazujesz formularz do klienta; nigdy nie dawaj surowego dokumentu |
|
||||
| `BuilderForm(props)` | `@intecion/ipal-kit/client` | Kliencki renderer dowolnego formularza z panelu (kroki, wszystkie typy pól, Turnstile, honeypot, a11y), bez stylów — wygląd przez `classNames`, podmiana pól przez `renderField`; zwykle używany pośrednio przez `RenderForm` |
|
||||
| `useBuilderForm({ form, action, texts, values?, onSuccess?, navigate?, redirectHref? })` | `@intecion/ipal-kit/client` | Silnik formularza z panelu bez markupu (kroki, `next/back/goTo`, walidacja per krok, błędy z serwera, redirect, analityka, `getInputProps`/`getSelectProps`/…, `TurnstileWidget`) — dla własnego markupu formularza nietypowego |
|
||||
| `RenderForm({ form, action, locale, texts, classNames?, values?, … })` | `@intecion/ipal-kit/rsc` | A panel form in a block in one line (RSC): renders message blocks and the confirmation, binds `sendForm` to the form and language, resolves the redirect, sends only `publicForm` to the browser; `form` not populated → nothing |
|
||||
| `prepareBuilderForm({ form, action, locale, … })` | `@intecion/ipal-kit/rsc` | The server half of `RenderForm` without markup → `PreparedBuilderForm` (or `null`) to spread into `<BuilderForm>` in a client component (e.g. a configurator with changing `values`) |
|
||||
| `publicForm(form)` | `@intecion/ipal-kit/rsc` | Public part of the form document (no Emails tab, no message rich text, safe redirect URL) — when you pass the form to the client yourself; never pass the raw document |
|
||||
| `BuilderForm(props)` | `@intecion/ipal-kit/client` | Client renderer for any panel form (steps, all field types, Turnstile, honeypot, a11y), unstyled — look via `classNames`, field replacement via `renderField`; usually used indirectly through `RenderForm` |
|
||||
| `useBuilderForm({ form, action, texts, values?, onSuccess?, navigate?, redirectHref? })` | `@intecion/ipal-kit/client` | Panel form engine without markup (steps, `next/back/goTo`, per-step validation, server errors, redirect, analytics, `getInputProps`/`getSelectProps`/…, `TurnstileWidget`) — for your own markup of an unusual form |
|
||||
|
||||
### Czysta logika formularza z panelu (klient i serwer)
|
||||
### Pure panel form logic (client and server)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `visibleFields(fields, values)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Pola (z krokami i message) widoczne dla danych wartości wg „Show only when” — wspólna reguła przeglądarki i serwera (ukryte = niewymagane i niezapisywane) |
|
||||
| `splitSteps(fields, isShown?)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Dzieli listę pól na kroki po blokach `step` → `BuilderStep[]` (pomija ukryte, zachowuje oryginalny `index`) |
|
||||
| `inputFields(fields)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Tylko pola niosące wartość (mają `name`, nie `message`/`step`) |
|
||||
| `initialBuilderValues(fields)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Wartości startowe: checkbox → boolean, checkboxGroup → `string[]`, reszta → string (z `defaultValue`) |
|
||||
| `validateBuilderFields(fields, values, texts)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Błędy klienta (required, email, number, min/max zaznaczeń) → `{ [name]: komunikat }`, `{}` = OK; tekst z `texts.validation` z `{field}` |
|
||||
| `stepOfField(steps, name)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Indeks kroku zawierającego pole (powrót do kroku z błędem z serwera); brak → 0 |
|
||||
| `autoCompleteFor(field)` | `@intecion/ipal-kit/client` | Podpowiedź `autoComplete` z typu/nazwy pola (`email`, `country-name`, `name`, `tel`, `organization`) albo `undefined` |
|
||||
| `visibleFields(fields, values)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Fields (with steps and message) visible for the given values per "Show only when" — a rule shared by browser and server (hidden = not required and not saved) |
|
||||
| `splitSteps(fields, isShown?)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Splits the field list into steps at `step` blocks → `BuilderStep[]` (skips hidden ones, keeps the original `index`) |
|
||||
| `inputFields(fields)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Only fields that carry a value (have a `name`, not `message`/`step`) |
|
||||
| `initialBuilderValues(fields)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Initial values: checkbox → boolean, checkboxGroup → `string[]`, the rest → string (from `defaultValue`) |
|
||||
| `validateBuilderFields(fields, values, texts)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Client errors (required, email, number, min/max selected) → `{ [name]: message }`, `{}` = OK; text from `texts.validation` with `{field}` |
|
||||
| `stepOfField(steps, name)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Index of the step containing the field (go back to the step with a server error); none → 0 |
|
||||
| `autoCompleteFor(field)` | `@intecion/ipal-kit/client` | `autoComplete` hint from the field type/name (`email`, `country-name`, `name`, `tel`, `organization`) or `undefined` |
|
||||
|
||||
### Wysyłka (serwer)
|
||||
### Submission (server)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createSubmitAction({ getCachedPayload, headers, … })` | `@intecion/ipal-kit/server` | Tworzy server action `sendForm(formId, locale, values, token?)`: honeypot → `clientIp` → `submitForm` → tekst z Notifications; zwraca `SubmitActionResult`. Standard: `export const sendForm = createSubmitAction({ getCachedPayload, headers })` w `actions.ts` |
|
||||
| `submitForm({ payload, formId, data, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName? })` | `@intecion/ipal-kit/server` | Serwerowy rdzeń: rate limit → Turnstile → walidacja wg definicji z panelu (+ zgoda RODO) → zapis zgłoszenia; zwraca kod `SubmitFormResult`, nie tekst. Zwykle przez `createSubmitAction`; tylko server-only |
|
||||
| `createSubmitAction({ getCachedPayload, headers, … })` | `@intecion/ipal-kit/server` | Creates the server action `sendForm(formId, locale, values, token?)`: honeypot → `clientIp` → `submitForm` → text from Notifications; returns `SubmitActionResult`. Standard: `export const sendForm = createSubmitAction({ getCachedPayload, headers })` in `actions.ts` |
|
||||
| `submitForm({ payload, formId, data, turnstileToken?, ip?, locale?, maxPerMinute?, consentFieldName? })` | `@intecion/ipal-kit/server` | Server core: rate limit → Turnstile → validation against the panel definition (+ GDPR consent) → saves the submission; returns a `SubmitFormResult` code, not text. Usually through `createSubmitAction`; server-only |
|
||||
|
||||
### Honeypot
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `HONEYPOT_FIELD` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Stała: domyślna nazwa pola-pułapki `'company_url'` |
|
||||
| `honeypotInputProps(name?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Propsy ukrytego inputu (off-screen, `aria-hidden`, `tabIndex -1`) — `<input {...honeypotInputProps()} />`; `BuilderForm` dodaje sam |
|
||||
| `isHoneypotTripped(values, name?)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `true`, gdy pułapka wypełniona → udawany sukces bez zapisu; `createSubmitAction` sprawdza sam |
|
||||
| `HONEYPOT_FIELD` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Constant: default trap field name `'company_url'` |
|
||||
| `honeypotInputProps(name?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Props of the hidden input (off-screen, `aria-hidden`, `tabIndex -1`) — `<input {...honeypotInputProps()} />`; `BuilderForm` adds it itself |
|
||||
| `isHoneypotTripped(values, name?)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `true` when the trap is filled → fake success without saving; `createSubmitAction` checks it itself |
|
||||
|
||||
### Hooki niższego poziomu i walidatory (formularze spoza buildera)
|
||||
### Lower-level hooks and validators (forms outside the builder)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `useForm({ initialValues, submitAction, validate?, requireTurnstile?, onSuccess?, … })` | `@intecion/ipal-kit/client` | Generyczny silnik formularza bez markupu (stan, walidacja, token Turnstile, submit, sukces/błąd; `setField`, `handleSubmit`, `reset`) — dla formularzy spoza buildera (np. filtry); nie dla kontaktowych |
|
||||
| `useContactForm({ submitAction, requireTurnstile?, requireTopic?, requireConsent?, onSuccess?, … })` | `@intecion/ipal-kit/client` | Preset `useForm` dla stałego formularza kontaktowego (`name, email, phone, topic, message, consent`) — tylko gdy świadomie nie używasz buildera |
|
||||
| `buildValidator(schema)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Składa `Validator` z list reguł per pole (pierwsza błędna wygrywa); działa też na serwerze |
|
||||
| `required(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: niepuste, nie `null`, nie `false` |
|
||||
| `email(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: poprawny adres e-mail |
|
||||
| `minLength(n, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: string min. `n` znaków (po trim) |
|
||||
| `maxLength(n, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: string max. `n` znaków (po trim) |
|
||||
| `checked(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: checkbox musi być `true` |
|
||||
| `pattern(re, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła: zgodność z regexem (puste pomijane — łącz z `required`) |
|
||||
| `custom(test, msg)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Reguła z dowolnego predykatu `(value, values) => boolean` |
|
||||
| `isEmail(v)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Samodzielne sprawdzenie e-maila → boolean |
|
||||
| `useForm({ initialValues, submitAction, validate?, requireTurnstile?, onSuccess?, … })` | `@intecion/ipal-kit/client` | Generic form engine without markup (state, validation, Turnstile token, submit, success/error; `setField`, `handleSubmit`, `reset`) — for forms outside the builder (e.g. filters); not for contact forms |
|
||||
| `useContactForm({ submitAction, requireTurnstile?, requireTopic?, requireConsent?, onSuccess?, … })` | `@intecion/ipal-kit/client` | `useForm` preset for a fixed contact form (`name, email, phone, topic, message, consent`) — only when you deliberately do not use the builder |
|
||||
| `buildValidator(schema)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Builds a `Validator` from per-field rule lists (the first failing one wins); also works on the server |
|
||||
| `required(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: non-empty, not `null`, not `false` |
|
||||
| `email(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: valid e-mail address |
|
||||
| `minLength(n, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: string of at least `n` characters (after trim) |
|
||||
| `maxLength(n, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: string of at most `n` characters (after trim) |
|
||||
| `checked(msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: the checkbox must be `true` |
|
||||
| `pattern(re, msg?)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule: matches a regex (empty values skipped — combine with `required`) |
|
||||
| `custom(test, msg)` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit` | Rule from any predicate `(value, values) => boolean` |
|
||||
| `isEmail(v)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Standalone e-mail check → boolean |
|
||||
|
||||
### Analityka
|
||||
### Analytics
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `formAnalyticsOnSuccess(config)` | `@intecion/ipal-kit/client` | Z `form.analytics` (panel) robi handler `onSuccess`, który robi `pushDataLayer(event, params)` (wartość `$pole` z wysłanych danych; pusty event = no-op); `useBuilderForm` woła sam — ręcznie tylko przy `useForm`/`useContactForm` |
|
||||
| `formAnalyticsOnSuccess(config)` | `@intecion/ipal-kit/client` | Turns `form.analytics` (panel) into an `onSuccess` handler that calls `pushDataLayer(event, params)` (a value like `$topic` — `$` + field name — is taken from the submitted data; empty event = no-op); `useBuilderForm` calls it itself — by hand only with `useForm`/`useContactForm` |
|
||||
|
||||
**Typy:** `BuilderField`, `BuilderOption`, `BuilderStep`, `BuilderFormDoc`, `BuilderFormTexts`, `FieldCondition` (root, `/client`; `BuilderOption` tylko `/client`) — kształt formularza z panelu, pola, opcji, kroku, tekstów i warunku „Show only when”. `BuilderFormProps`, `BuilderFormClassNames`, `BuilderFieldRenderArgs`, `BuilderFormAction`, `BuilderFormApi`, `UseBuilderFormOptions` (`/client`) — propsy/klasy/`renderField` `BuilderForm`, związana akcja i wynik `useBuilderForm`. `RenderFormProps`, `SendFormAction`, `PrepareBuilderFormArgs`, `PreparedBuilderForm` (`/rsc`) — propsy `RenderForm`, sygnatura `sendForm`, wejście/wyjście `prepareBuilderForm`. `SubmitFormArgs`, `SubmitFormResult`, `SubmitActionResult` (`/server`) — argumenty i kody wyniku `submitForm` oraz wynik `sendForm` (`{ success, message, reason?, field? }`). `FormErrors`, `FormSubmitAction`, `Validator`, `Rule` (root, `/client`), `ContactFormValues`, `ContactFormErrors`, `SubmitAction` (`/client`) — typy `useForm`/`useContactForm` i walidatorów. `FormAnalyticsConfig` (`/client`) — konfiguracja analityki formularza z panelu. `FormsOption`, `FormsCollectionOverrides`, `FormsFieldsOverride` (root) — opcja `forms` pluginu i nadpisania kolekcji.
|
||||
**Types:** `BuilderField`, `BuilderOption`, `BuilderStep`, `BuilderFormDoc`, `BuilderFormTexts`, `FieldCondition` (root, `/client`; `BuilderOption` only `/client`) — shape of the panel form, field, option, step, texts and the "Show only when" condition. `BuilderFormProps`, `BuilderFormClassNames`, `BuilderFieldRenderArgs`, `BuilderFormAction`, `BuilderFormApi`, `UseBuilderFormOptions` (`/client`) — `BuilderForm` props/classes/`renderField`, the bound action and the `useBuilderForm` result. `RenderFormProps`, `SendFormAction`, `PrepareBuilderFormArgs`, `PreparedBuilderForm` (`/rsc`) — `RenderForm` props, `sendForm` signature, `prepareBuilderForm` input/output. `SubmitFormArgs`, `SubmitFormResult`, `SubmitActionResult` (`/server`) — `submitForm` arguments and result codes, and the `sendForm` result (`{ success, message, reason?, field? }`). `FormErrors`, `FormSubmitAction`, `Validator`, `Rule` (root, `/client`), `ContactFormValues`, `ContactFormErrors`, `SubmitAction` (`/client`) — `useForm`/`useContactForm` and validator types. `FormAnalyticsConfig` (`/client`) — form analytics configuration from the panel. `FormsOption`, `FormsCollectionOverrides`, `FormsFieldsOverride` (root) — the plugin's `forms` option and collection overrides.
|
||||
|
||||
## Linki (`links`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/links.md`
|
||||
## Links (`links`) — details: `node_modules/@intecion/ipal-kit/docs/links.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildLinkField(options?)` | `@intecion/ipal-kit` | JEDNO pole linku (grupa): strona / URL (też mailto:, tel:, #) / plik + label, nowa karta, `appearance`; typ `CmsLink*` w payload-types. Używaj do każdego CTA zamiast własnych `ctaLabel`/`buttonUrl` |
|
||||
| `buildLinksField(options?)` | `@intecion/ipal-kit` | Tablica 0..N linków (`links`, domyślnie max 2, wiersze „Button”) — przyciski sekcji |
|
||||
| `resolveLinkHref(link, { locale, config, homeSlug?, archives?, pagesSlug? })` | `@intecion/ipal-kit` | Wartość linku → href albo `null` (pusty / brak strony w języku / niebezpieczny URL); strona musi być populowana |
|
||||
| `resolveLink(link, options)` | `@intecion/ipal-kit` | Link z panelu → `ResolvedLink` (`href`, `label`, `newTab`, `internal`, `targetProps`, `appearance`) albo `null` — do własnego `CMSLink` |
|
||||
| `resolveNav(items, { locale, config, homeSlug?, linkField?, childrenField? })` | `@intecion/ipal-kit` | Pozycje menu z globala Header/Footer → serializowalne `NavItem[]` (dowolna głębokość, martwe linki pominięte) |
|
||||
| `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Linki do stron systemowych z Site Settings (privacy/cookies/terms) z tytułem strony jako labelem → `SystemLink[]`; w projekcie zwykle `getSystemLinks` z `lib/content` |
|
||||
| `homeSlugFrom(settings, field?)` | `@intecion/ipal-kit` | Slug strony głównej z `SiteSettings.homepage` (populowanej) albo `undefined` |
|
||||
| `safeHref(url)` | `@intecion/ipal-kit` | URL, gdy bezpieczny (http(s), mailto, tel, sms, #, ścieżka `/`), inaczej `null` — blokuje `javascript:`/`data:` |
|
||||
| `buildLinkField(options?)` | `@intecion/ipal-kit` | ONE link field (group): page / URL (also mailto:, tel:, #) / file + label, new tab, `appearance`; `CmsLink*` type in payload-types. Use it for every CTA instead of your own `ctaLabel`/`buttonUrl` |
|
||||
| `buildLinksField(options?)` | `@intecion/ipal-kit` | Array of 0..N links (`links`, max 2 by default, "Button" rows) — section buttons |
|
||||
| `resolveLinkHref(link, { locale, config, homeSlug?, archives?, pagesSlug? })` | `@intecion/ipal-kit` | Link value → href or `null` (empty / page missing in the language / unsafe URL); the page must be populated |
|
||||
| `resolveLink(link, options)` | `@intecion/ipal-kit` | Panel link → `ResolvedLink` (`href`, `label`, `newTab`, `internal`, `targetProps`, `appearance`) or `null` — for your own `CMSLink` |
|
||||
| `resolveNav(items, { locale, config, homeSlug?, linkField?, childrenField? })` | `@intecion/ipal-kit` | Menu items from the Header/Footer global → serializable `NavItem[]` (any depth, dead links skipped) |
|
||||
| `resolveSystemLinks(settings, { locale, config, roles?, … })` | `@intecion/ipal-kit` | Links to system pages from Site Settings (privacy/cookies/terms) with the page title as the label → `SystemLink[]`; in a project usually `getSystemLinks` from `lib/content` |
|
||||
| `homeSlugFrom(settings, field?)` | `@intecion/ipal-kit` | Homepage slug from `SiteSettings.homepage` (populated) or `undefined` |
|
||||
| `safeHref(url)` | `@intecion/ipal-kit` | The URL when safe (http(s), mailto, tel, sms, #, `/` path), otherwise `null` — blocks `javascript:`/`data:` |
|
||||
|
||||
**Typy:** `BuildLinkFieldOptions`, `BuildLinksFieldOptions`, `LinkAppearance`, `LinkAppearanceOption` — opcje pól linku i style; `LinkValue`, `ResolveLinkHrefOptions`, `ResolvedLink`, `NavItem`, `ResolveNavOptions`, `SystemLink` — wartość linku z panelu, opcje i wyniki resolverów.
|
||||
**Types:** `BuildLinkFieldOptions`, `BuildLinksFieldOptions`, `LinkAppearance`, `LinkAppearanceOption` — link field options and styles; `LinkValue`, `ResolveLinkHrefOptions`, `ResolvedLink`, `NavItem`, `ResolveNavOptions`, `SystemLink` — panel link value, resolver options and results.
|
||||
|
||||
## MCP (`mcp`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/mcp.md`
|
||||
## MCP (`mcp`) — details: `node_modules/@intecion/ipal-kit/docs/mcp.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createMcpRoute({ getCachedPayload, config, baseUrl?, serverName?, … })` | `@intecion/ipal-kit` | Read-only serwer MCP strony (JSON-RPC: `get_site_info`, `list_pages`, `search_content`, `get_page`) jako route handler → `{ GET, POST }` w `app/api/mcp/route.ts`; z rate limitem per IP. Zwykle przez `mcpGET`/`mcpPOST` z `lib/content` |
|
||||
| `createMcpRoute({ getCachedPayload, config, baseUrl?, serverName?, … })` | `@intecion/ipal-kit` | Read-only MCP server for the site (JSON-RPC: `get_site_info`, `list_pages`, `search_content`, `get_page`) as a route handler → `{ GET, POST }` in `app/api/mcp/route.ts`; with a per-IP rate limit. Usually through `mcpGET`/`mcpPOST` from `lib/content` |
|
||||
|
||||
## Media (`media`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/media.md`
|
||||
## Media (`media`) — details: `node_modules/@intecion/ipal-kit/docs/media.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `mediaImageProps(resource, { sizes?, priority?, alt?, placeholderColor? })` | `@intecion/ipal-kit` | Propsy `next/image` dla uploadu-obrazu (wymiary, focal point → `objectPosition`, blur placeholder, `preload` dla LCP) albo `null` (wideo/PDF/ID) — do własnego `<Media>` |
|
||||
| `videoProps(resource, { mode?, poster?, reducedMotion? })` | `@intecion/ipal-kit` | Atrybuty `<video>` dla uploadu-wideo (`'background'`: autoplay/muted/loop; `'player'`: controls, `preload="none"`) albo `null` |
|
||||
| `MEDIA_SIZES` | `@intecion/ipal-kit` | Stałe gotowe wartości `sizes`: `full`, `half`, `third`, `quarter`, `thumb` |
|
||||
| `normalizeFilename(filename)` | `@intecion/ipal-kit` | Slugifikuje nazwę pliku z zachowaniem rozszerzenia (`"Zdjęcie 1.JPG"` → `"zdjecie-1.jpg"`) |
|
||||
| `normalizeFilenameHook` | `@intecion/ipal-kit` | Hook `beforeOperation` kolekcji upload (Media) normalizujący nazwę pliku; projekt dopina w swojej kolekcji Media |
|
||||
| `buildOptimizeUploadHook(options?)` | `@intecion/ipal-kit` | Hook `beforeOperation`: blokuje za duże JPG/PNG/wideo, po zgodzie redaktora konwertuje obraz do WebP (sharp z `buildConfig`); dopina projekt w Media |
|
||||
| `buildOptimizeUploadField(name?)` | `@intecion/ipal-kit` | Checkbox zgody „Optimize this upload” (domyślnie `optimizeOnUpload`) do Media, w parze z `buildOptimizeUploadHook` |
|
||||
| `buildMediaPlaceholderHook({ field?, size? })` | `@intecion/ipal-kit` | Hook `beforeOperation` liczący przy uploadzie mini-podgląd blur (base64 WebP) i kolor dominujący; dopina projekt w Media |
|
||||
| `buildMediaPlaceholderField(name?)` | `@intecion/ipal-kit` | Ukryta grupa pól na placeholder (czytana przez `mediaImageProps`), w parze z `buildMediaPlaceholderHook` |
|
||||
| `mediaImageProps(resource, { sizes?, priority?, alt?, placeholderColor? })` | `@intecion/ipal-kit` | `next/image` props for an image upload (dimensions, focal point → `objectPosition`, blur placeholder, `preload` for LCP) or `null` (video/PDF/ID) — for your own `<Media>` |
|
||||
| `videoProps(resource, { mode?, poster?, reducedMotion? })` | `@intecion/ipal-kit` | `<video>` attributes for a video upload (`'background'`: autoplay/muted/loop; `'player'`: controls, `preload="none"`) or `null` |
|
||||
| `MEDIA_SIZES` | `@intecion/ipal-kit` | Ready constant `sizes` values: `full`, `half`, `third`, `quarter`, `thumb` |
|
||||
| `normalizeFilename(filename)` | `@intecion/ipal-kit` | Slugifies a file name, keeping the extension (`"Zdjęcie 1.JPG"` → `"zdjecie-1.jpg"`) |
|
||||
| `normalizeFilenameHook` | `@intecion/ipal-kit` | `beforeOperation` hook for an upload collection (Media) that normalizes the file name; the project adds it to its Media collection |
|
||||
| `buildOptimizeUploadHook(options?)` | `@intecion/ipal-kit` | `beforeOperation` hook: blocks oversized JPG/PNG/video, converts the image to WebP after the editor agrees (sharp from `buildConfig`); the project adds it to Media |
|
||||
| `buildOptimizeUploadField(name?)` | `@intecion/ipal-kit` | "Optimize this upload" consent checkbox (default `optimizeOnUpload`) for Media, paired with `buildOptimizeUploadHook` |
|
||||
| `buildMediaPlaceholderHook({ field?, size? })` | `@intecion/ipal-kit` | `beforeOperation` hook that computes a tiny blur preview (base64 WebP) and the dominant colour on upload; the project adds it to Media |
|
||||
| `buildMediaPlaceholderField(name?)` | `@intecion/ipal-kit` | Hidden field group for the placeholder (read by `mediaImageProps`), paired with `buildMediaPlaceholderHook` |
|
||||
|
||||
**Typy:** `MediaImageOptions`, `MediaImageProps`, `VideoMode`, `VideoProps` — opcje i wynik `mediaImageProps`/`videoProps`; `OptimizeUploadOptions` — limity i jakość `buildOptimizeUploadHook`.
|
||||
**Types:** `MediaImageOptions`, `MediaImageProps`, `VideoMode`, `VideoProps` — options and result of `mediaImageProps`/`videoProps`; `OptimizeUploadOptions` — limits and quality of `buildOptimizeUploadHook`.
|
||||
|
||||
## Powiadomienia (`notifications`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/notifications.md`
|
||||
## Notifications (`notifications`) — details: `node_modules/@intecion/ipal-kit/docs/notifications.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getNotificationTexts({ payload, locale? })` | `@intecion/ipal-kit` | Czyta global Notifications w języku → `NotificationTexts` (`form.success`, `error`, `validation`, `next`, `back`, `stepOf`, …) z fallbackiem EN per pole; źródło `texts` dla `RenderForm` (zwykle `getFormTexts` z `lib/content`) |
|
||||
| `resolveFormMessage(result, texts)` | `@intecion/ipal-kit` | Kod `SubmitFormResult` → tekst z panelu (`{field}` wstawiane przy `validation`, `error` bez szczegółów wyjątku); `createSubmitAction` woła sam |
|
||||
| `NOTIFICATION_FALLBACK` | `@intecion/ipal-kit` | Stała: wbudowane angielskie teksty `form.*` używane, gdy pole w panelu jest puste |
|
||||
| `getNotificationTexts({ payload, locale? })` | `@intecion/ipal-kit` | Reads the Notifications global in a language → `NotificationTexts` (`form.success`, `error`, `validation`, `next`, `back`, `stepOf`, …) with an EN fallback per field; source of `texts` for `RenderForm` (usually `getFormTexts` from `lib/content`) |
|
||||
| `resolveFormMessage(result, texts)` | `@intecion/ipal-kit` | `SubmitFormResult` code → text from the panel (`{field}` filled in for `validation`, `error` without exception details); `createSubmitAction` calls it itself |
|
||||
| `NOTIFICATION_FALLBACK` | `@intecion/ipal-kit` | Constant: built-in English `form.*` texts used when a panel field is empty |
|
||||
|
||||
**Typy:** `NotificationTexts`, `FormNotificationTexts` — rozwiązane teksty powiadomień (grupa `form`).
|
||||
**Types:** `NotificationTexts`, `FormNotificationTexts` — resolved notification texts (`form` group).
|
||||
|
||||
## Strony systemowe (`pages`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/pages.md`
|
||||
## System pages (`pages`) — details: `node_modules/@intecion/ipal-kit/docs/pages.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getSystemPagePath({ page, locale, config, homeSlug? })` | `@intecion/ipal-kit` | Strona przypisana w Site Settings (czytana z `locale: 'all'`) → ścieżka w języku (`/pl` dla strony głównej, `/en/privacy-policy`) albo `undefined` |
|
||||
| `ALL_SYSTEM_PAGE_ROLES` | `@intecion/ipal-kit` | Stała: wszystkie role stron systemowych w stałej kolejności: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` |
|
||||
| `LocaleView({ views, defaultLocale })` | `@intecion/ipal-kit/client` | Wybiera z gotowych widoków per język ten z URL (`/en/...`) — w `not-found.tsx` bez `headers()` (trasa zostaje statyczna); używany przez `createNotFoundPage` |
|
||||
| `NotFoundLoader({ load, locales, defaultLocale })` | `@intecion/ipal-kit/client` | Leniwa treść 404: pobiera widok z server action dopiero przy wyświetleniu 404 (mniejszy payload RSC każdej strony); używany przez `createNotFoundPage(content, { load })` |
|
||||
| `getSystemPagePath({ page, locale, config, homeSlug? })` | `@intecion/ipal-kit` | Page assigned in Site Settings (read with `locale: 'all'`) → path in the language (`/pl` for the homepage, `/en/privacy-policy`) or `undefined` |
|
||||
| `ALL_SYSTEM_PAGE_ROLES` | `@intecion/ipal-kit` | Constant: all system page roles in a fixed order: `homepage`, `notFound`, `privacyPolicy`, `cookiePolicy`, `termsOfService` |
|
||||
| `LocaleView({ views, defaultLocale })` | `@intecion/ipal-kit/client` | Picks, from ready per-language views, the one from the URL (`/en/...`) — in `not-found.tsx` without `headers()` (the route stays static); used by `createNotFoundPage` |
|
||||
| `NotFoundLoader({ load, locales, defaultLocale })` | `@intecion/ipal-kit/client` | Lazy 404 content: fetches the view from a server action only when the 404 is shown (smaller RSC payload on every page); used by `createNotFoundPage(content, { load })` |
|
||||
|
||||
**Typy:** `PagesOption` (opcja `pages: { slug, roles? }` pluginu), `SystemPageRole` (rola strony systemowej).
|
||||
**Types:** `PagesOption` (the plugin's `pages: { slug, roles? }` option), `SystemPageRole` (system page role).
|
||||
|
||||
## Globale Payload (`payload`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/payload-helpers.md`
|
||||
## Payload globals (`payload`) — details: `node_modules/@intecion/ipal-kit/docs/payload-helpers.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getSiteSettings<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Czyta global Site Settings (typ generowany `SiteSetting` jako `T`) |
|
||||
| `getSiteIntegrations<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Czyta global Site Integrations z sekretami (Local API omija access) — tylko serwer, nigdy surowo do klienta |
|
||||
| `getGlobal<T>(payload, slug, { locale?, depth? })` | `@intecion/ipal-kit` | Cienki wrapper `payload.findGlobal` dla dowolnego globala (też projektu) |
|
||||
| `SITE_SETTINGS_SLUG` | `@intecion/ipal-kit` | Stała: slug globala `'site-settings'` |
|
||||
| `SITE_INTEGRATIONS_SLUG` | `@intecion/ipal-kit` | Stała: slug globala `'site-integrations'` |
|
||||
| `getSiteSettings<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site Settings global (generated type `SiteSetting` as `T`) |
|
||||
| `getSiteIntegrations<T>(payload, { locale?, depth? })` | `@intecion/ipal-kit` | Reads the Site Integrations global with secrets (the Local API bypasses access) — server only, never raw to the client |
|
||||
| `getGlobal<T>(payload, slug, { locale?, depth? })` | `@intecion/ipal-kit` | Thin `payload.findGlobal` wrapper for any global (the project's too) |
|
||||
| `SITE_SETTINGS_SLUG` | `@intecion/ipal-kit` | Constant: global slug `'site-settings'` |
|
||||
| `SITE_INTEGRATIONS_SLUG` | `@intecion/ipal-kit` | Constant: global slug `'site-integrations'` |
|
||||
|
||||
**Typy:** `GlobalQueryOptions` — `{ locale?, depth? }` helperów globali.
|
||||
**Types:** `GlobalQueryOptions` — `{ locale?, depth? }` of the global helpers.
|
||||
|
||||
## Rich text (`richtext`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/richtext.md`
|
||||
## Rich text (`richtext`) — details: `node_modules/@intecion/ipal-kit/docs/richtext.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `RenderRichText({ data, converters?, className?, headingIds? })` | `@intecion/ipal-kit/rsc` | Renderuje pole richText (Lexical) przez oficjalny konwerter Payloada; własne klasy przez `converters`, `headingIds` dodaje kotwice na nagłówkach (te same id co `extractHeadings`). Zamiast ręcznego renderera. |
|
||||
| `extractHeadings(data, { levels? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/rsc` | Lista `{ id, level, text }` nagłówków (domyślnie h2) do spisu treści — id zgodne z `RenderRichText headingIds`. |
|
||||
| `headingText(node)` | `@intecion/ipal-kit` | Czysty tekst węzła Lexical (nagłówek z pogrubieniami, linkami…). |
|
||||
| `buildTableOfContentsField({ name? })` | `@intecion/ipal-kit` | Pole grupy `tableOfContents` (show + lokalizowana etykieta) do bloku/sekcji tekstu — przełącznik spisu treści w panelu. |
|
||||
| `TableOfContents({ items, label?, classNames?, offset? })` | `@intecion/ipal-kit/client` | Spis treści bez stylów (`<nav>` z linkami); w przeglądarce podświetla czytaną sekcję (`aria-current`, `classNames.linkActive`). Karm `extractHeadings`. |
|
||||
| `lexicalToMarkdown(data)` | `@intecion/ipal-kit` | Lexical → Markdown (bez zależności) — dla wyjścia dla AI (Markdown stron, llms-full.txt); nie do renderowania na stronie. |
|
||||
| `RenderRichText({ data, converters?, className?, headingIds? })` | `@intecion/ipal-kit/rsc` | Renders a richText (Lexical) field through Payload's official converter; your own classes via `converters`, `headingIds` adds anchors to headings (the same ids as `extractHeadings`). Instead of a hand-written renderer. |
|
||||
| `extractHeadings(data, { levels? })` | `@intecion/ipal-kit`, `@intecion/ipal-kit/rsc` | List of headings `{ id, level, text }` (h2 by default) for a table of contents — ids match `RenderRichText headingIds`. |
|
||||
| `headingText(node)` | `@intecion/ipal-kit` | Plain text of a Lexical node (a heading with bold, links…). |
|
||||
| `buildTableOfContentsField({ name? })` | `@intecion/ipal-kit` | `tableOfContents` group field (show + localized label) for a text block/section — table of contents toggle in the panel. |
|
||||
| `TableOfContents({ items, label?, classNames?, offset? })` | `@intecion/ipal-kit/client` | Unstyled table of contents (`<nav>` with links); in the browser it highlights the section being read (`aria-current`, `classNames.linkActive`). Feed it `extractHeadings`. |
|
||||
| `lexicalToMarkdown(data)` | `@intecion/ipal-kit` | Lexical → Markdown (no dependencies) — for AI output (page Markdown, llms-full.txt); not for rendering on the page. |
|
||||
|
||||
**Typy:** `ExtractHeadingsOptions`, `HeadingItem`, `HeadingLevel` (root) — opcje i wynik ekstrakcji nagłówków; `RenderRichTextProps` (`/rsc`) — propsy renderera; `TableOfContentsProps`, `TableOfContentsClassNames` (`/client`) — propsy i klasy spisu treści.
|
||||
**Types:** `ExtractHeadingsOptions`, `HeadingItem`, `HeadingLevel` (root) — heading extraction options and result; `RenderRichTextProps` (`/rsc`) — renderer props; `TableOfContentsProps`, `TableOfContentsClassNames` (`/client`) — table of contents props and classes.
|
||||
|
||||
## Bezpieczeństwo (`security`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/security.md`
|
||||
## Security (`security`) — details: `node_modules/@intecion/ipal-kit/docs/security.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildSecurityHeaders({ hsts?, additional?, coop?, frameOptions?, permissionsPolicy?, referrerPolicy?, … })` | `@intecion/ipal-kit` | Zwraca `SecurityHeader[]` (HSTS, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy, COOP; przy `IPAL_NOINDEX` także `X-Robots-Tag`) do `headers()` w `next.config.ts`. CSP dokładasz przez `additional`. |
|
||||
| `buildCsp({ mode?, r2Url?, turnstile?, analytics?, googleMaps?, youtube?, extra? })` | `@intecion/ipal-kit` | Zwraca `{ key, value }` z utwardzonym CSP (`base-uri`, `object-src` itd.) + źródła dla włączonych integracji; wrzuć do `additional`. Zacznij od `mode: 'report-only'`. |
|
||||
| `buildUploadSecurityHeaders({ collections? })` | `@intecion/ipal-kit` | Wpisy `headers()` dla `/api/<upload>/file/*` (domyślnie `media`): pliki z dysku wyświetlane, nigdy wykonywane (sandbox). Potrzebne przy mediach bez R2. |
|
||||
| `buildSecurityHeaders({ hsts?, additional?, coop?, frameOptions?, permissionsPolicy?, referrerPolicy?, … })` | `@intecion/ipal-kit` | Returns `SecurityHeader[]` (HSTS, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy, COOP; with `IPAL_NOINDEX` also `X-Robots-Tag`) for `headers()` in `next.config.ts`. Add CSP via `additional`. |
|
||||
| `buildCsp({ mode?, r2Url?, turnstile?, analytics?, googleMaps?, youtube?, extra? })` | `@intecion/ipal-kit` | Returns `{ key, value }` with a hardened CSP (`base-uri`, `object-src` etc.) + sources for the enabled integrations; put it into `additional`. Start with `mode: 'report-only'`. |
|
||||
| `buildUploadSecurityHeaders({ collections? })` | `@intecion/ipal-kit` | `headers()` entries for `/api/<upload>/file/*` (`media` by default): files from disk are displayed, never executed (sandbox). Needed for media without R2. |
|
||||
|
||||
**Typy:** `BuildCspArgs`, `BuildSecurityHeadersArgs` — opcje builderów; `SecurityHeader` — `{ key, value }` w kształcie Next.js.
|
||||
**Types:** `BuildCspArgs`, `BuildSecurityHeadersArgs` — builder options; `SecurityHeader` — `{ key, value }` in the Next.js shape.
|
||||
|
||||
## SEO (`seo`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/seo.md`
|
||||
## SEO (`seo`) — details: `node_modules/@intecion/ipal-kit/docs/seo.md`
|
||||
|
||||
Większość tras i metadanych jest już gotowa w `createContentHelpers` (`generatePageMetadata`, `sitemap`, `sitemapRoute`, `robots`, `llmsRoute`, `llmsFullRoute`, `manifest`, `indexNowKeyRoute`, `getPageJsonLd`, `getSiteShell().jsonLd`) — funkcje niżej są ich klockami; sięgaj po nie, gdy trasa nie trzyma się konwencji.
|
||||
Most routes and metadata are already ready in `createContentHelpers` (`generatePageMetadata`, `sitemap`, `sitemapRoute`, `robots`, `llmsRoute`, `llmsFullRoute`, `manifest`, `indexNowKeyRoute`, `getPageJsonLd`, `getSiteShell().jsonLd`) — the functions below are their building blocks; reach for them when a route does not follow the conventions.
|
||||
|
||||
### Metadane (generateMetadata)
|
||||
### Metadata (generateMetadata)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `createPageMetadata({ config, baseUrl, content?, … })` | `@intecion/ipal-kit` | Generator metadanych strony z podpiętymi resolverami konwencji pluginu (Pages, SiteSettings, `meta`, System Pages, archiwa); wołasz z `{ payload, locale, slug }`. Normalnie przez `generatePageMetadata` z `createContentHelpers`. |
|
||||
| `createMetadataGenerator({ config, baseUrl, resolveDocument, … })` | `@intecion/ipal-kit` | Jak wyżej, ale z własnymi resolverami — dla tras o niestandardowych konwencjach. |
|
||||
| `buildMetadata({ meta, siteName, locale, config, slugs, baseUrl, … })` | `@intecion/ipal-kit` | Składa obiekt `Metadata` Next.js (title, canonical, hreflang, OG, Twitter, robots) z gotowych danych; nic nie pobiera. Najniższy poziom. |
|
||||
| `composeTitle({ pageTitle, siteName, separator?, order? })` | `@intecion/ipal-kit` | Pełny tytuł „Strona \| Firma” (lub odwrotnie), bez dublowania nazwy serwisu. |
|
||||
| `buildHreflangAlternates({ slugs, config, baseUrl? })` | `@intecion/ipal-kit` | Mapa locale → URL do `alternates.languages`. |
|
||||
| `slugsAcrossLocales({ payload, collection, id, config })` | `@intecion/ipal-kit` | Slug dokumentu we wszystkich językach (osobne zapytanie, depth 0) — wejście do hreflang. |
|
||||
| `readSiteMetaConfig({ payload, locale, pagesSlug?, settingsSlug?, settings? })` | `@intecion/ipal-kit` | Czyta z SiteSettings: nazwę serwisu, separator (z paddingiem), kolejność tytułu, slug strony głównej per język, domyślny opis i obraz OG. |
|
||||
| `buildIconsMetadata(favicon)` | `@intecion/ipal-kit` | `icons` (favicon, apple-touch-icon) z uploadu faviconu w panelu — raz w `generateMetadata` root layoutu. |
|
||||
| `createManifestHandler({ getCachedPayload, config, settingsSlug? })` | `@intecion/ipal-kit` | Handler `app/manifest.ts` z SiteSettings; bez bazy przy buildzie zwraca minimalny manifest. Zwykle `manifest` z `createContentHelpers`. |
|
||||
| `NoSnippet({ as?, children })` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit/rsc` | Opakowanie z `data-nosnippet` — trzyma powtarzalny tekst (stopka: adres, godziny, telefon) poza snippetami Google. Nie owijaj `<main>`. |
|
||||
| `createPageMetadata({ config, baseUrl, content?, … })` | `@intecion/ipal-kit` | Page metadata generator with the plugin's convention resolvers wired in (Pages, SiteSettings, `meta`, System Pages, archives); call it with `{ payload, locale, slug }`. Normally through `generatePageMetadata` from `createContentHelpers`. |
|
||||
| `createMetadataGenerator({ config, baseUrl, resolveDocument, … })` | `@intecion/ipal-kit` | As above, but with your own resolvers — for routes with non-standard conventions. |
|
||||
| `buildMetadata({ meta, siteName, locale, config, slugs, baseUrl, … })` | `@intecion/ipal-kit` | Builds a Next.js `Metadata` object (title, canonical, hreflang, OG, Twitter, robots) from ready data; fetches nothing. The lowest level. |
|
||||
| `composeTitle({ pageTitle, siteName, separator?, order? })` | `@intecion/ipal-kit` | Full title "Page \| Company" (or the other way round), without duplicating the site name. |
|
||||
| `buildHreflangAlternates({ slugs, config, baseUrl? })` | `@intecion/ipal-kit` | Map locale → URL for `alternates.languages`. |
|
||||
| `slugsAcrossLocales({ payload, collection, id, config })` | `@intecion/ipal-kit` | Document slug in all languages (separate query, depth 0) — input for hreflang. |
|
||||
| `readSiteMetaConfig({ payload, locale, pagesSlug?, settingsSlug?, settings? })` | `@intecion/ipal-kit` | Reads from SiteSettings: site name, separator (with padding), title order, homepage slug per language, default description and OG image. |
|
||||
| `buildIconsMetadata(favicon)` | `@intecion/ipal-kit` | `icons` (favicon, apple-touch-icon) from the favicon upload in the panel — once in the root layout `generateMetadata`. |
|
||||
| `createManifestHandler({ getCachedPayload, config, settingsSlug? })` | `@intecion/ipal-kit` | `app/manifest.ts` handler from SiteSettings; without a database at build time it returns a minimal manifest. Usually `manifest` from `createContentHelpers`. |
|
||||
| `NoSnippet({ as?, children })` | `@intecion/ipal-kit/client`, `@intecion/ipal-kit/rsc` | Wrapper with `data-nosnippet` — keeps repeated text (footer: address, hours, phone) out of Google snippets. Do not wrap `<main>`. |
|
||||
|
||||
### JSON-LD (schema.org)
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `JsonLdGraph({ schemas })` | `@intecion/ipal-kit/rsc` | Renderuje węzły jako jeden `@graph` w `<script type="application/ld+json">` z bezpieczną serializacją; pomija null. Zamiast ręcznego `<script>`. |
|
||||
| `buildWebSiteJsonLd({ name, url, search? })` | `@intecion/ipal-kit` | WebSite (opcjonalnie SearchAction). Site-wide; `getSiteShell().jsonLd` już go zawiera. |
|
||||
| `buildOrganizationJsonLd({ name, url, logo?, sameAs? })` | `@intecion/ipal-kit` | Organization (marka, logo, profile). Site-wide; `getSiteShell().jsonLd` już go zawiera. |
|
||||
| `sameAsUrls(settings)` | `@intecion/ipal-kit` | URL-e profili z SiteSettings → `sameAs` dla Organization/LocalBusiness. |
|
||||
| `buildLocalBusinessJsonLd({ name, url, telephone?, address?, openingHours?, … })` | `@intecion/ipal-kit` | LocalBusiness (local SEO); dane z panelu, `@type` możesz nadpisać podtypem. |
|
||||
| `formatOpeningHours(input)` | `@intecion/ipal-kit` | Godziny wpisane po ludzku (PL/EN/DE) → `string[]` w formacie schema.org `openingHours`; nieczytelne pomija. |
|
||||
| `buildWebPageJsonLd({ name, url, description?, inLanguage?, dateModified?, … })` | `@intecion/ipal-kit` | WebPage dla jednej strony; `getPageJsonLd` z `createContentHelpers` buduje go sam. |
|
||||
| `buildBreadcrumbJsonLd(crumbs)` | `@intecion/ipal-kit` | BreadcrumbList z `[{ name, url }]`; null dla ≤1 elementu. `getPageJsonLd` buduje go sam. |
|
||||
| `buildFaqJsonLd(items)` | `@intecion/ipal-kit` | FAQPage z `[{ question, answer }]` widocznych na stronie; null dla pustej listy. |
|
||||
| `buildArticleJsonLd({ headline, url, datePublished, author?, image?, type?, … })` | `@intecion/ipal-kit` | Article/BlogPosting dla wpisów; `getPageJsonLd` buduje go dla kolekcji treści. |
|
||||
| `buildProductJsonLd({ name, url, sku?, image?, price?, … })` | `@intecion/ipal-kit` | Product (Offer tylko gdy jest cena — „na zapytanie” bez Offer). |
|
||||
| `buildServiceJsonLd({ name, providerName, url, areaServed?, … })` | `@intecion/ipal-kit` | Service dla strony usługi. |
|
||||
| `buildSpeakableJsonLd({ url, cssSelectors?, id? })` | `@intecion/ipal-kit` | WebPage ze `speakable` — wskazuje fragmenty do czytania/cytowania przez asystentów. |
|
||||
| `buildSiteNavigationJsonLd(items)` | `@intecion/ipal-kit` | SiteNavigationElement z `[{ name, url }]`; null dla pustej nawigacji. |
|
||||
| `buildNavigationJsonLd({ items, baseUrl, locale, config, homeSlug })` | `@intecion/ipal-kit` | To samo prosto z `navItems` globala Header (rozwiązuje linki per język, pomija zewnętrzne, deduplikuje). |
|
||||
| `JsonLdGraph({ schemas })` | `@intecion/ipal-kit/rsc` | Renders nodes as one `@graph` in `<script type="application/ld+json">` with safe serialization; skips null. Instead of a hand-written `<script>`. |
|
||||
| `buildWebSiteJsonLd({ name, url, search? })` | `@intecion/ipal-kit` | WebSite (optionally SearchAction). Site-wide; `getSiteShell().jsonLd` already includes it. |
|
||||
| `buildOrganizationJsonLd({ name, url, logo?, sameAs? })` | `@intecion/ipal-kit` | Organization (brand, logo, profiles). Site-wide; `getSiteShell().jsonLd` already includes it. |
|
||||
| `sameAsUrls(settings)` | `@intecion/ipal-kit` | Profile URLs from SiteSettings → `sameAs` for Organization/LocalBusiness. |
|
||||
| `buildLocalBusinessJsonLd({ name, url, telephone?, address?, openingHours?, … })` | `@intecion/ipal-kit` | LocalBusiness (local SEO); data from the panel, you can override `@type` with a subtype. |
|
||||
| `formatOpeningHours(input)` | `@intecion/ipal-kit` | Hours typed in human form (PL/EN/DE) → `string[]` in the schema.org `openingHours` format; skips unreadable ones. |
|
||||
| `buildWebPageJsonLd({ name, url, description?, inLanguage?, dateModified?, … })` | `@intecion/ipal-kit` | WebPage for a single page; `getPageJsonLd` from `createContentHelpers` builds it itself. |
|
||||
| `buildBreadcrumbJsonLd(crumbs)` | `@intecion/ipal-kit` | BreadcrumbList from `[{ name, url }]`; null for ≤1 item. `getPageJsonLd` builds it itself. |
|
||||
| `buildFaqJsonLd(items)` | `@intecion/ipal-kit` | FAQPage from `[{ question, answer }]` visible on the page; null for an empty list. |
|
||||
| `buildArticleJsonLd({ headline, url, datePublished, author?, image?, type?, … })` | `@intecion/ipal-kit` | Article/BlogPosting for entries; `getPageJsonLd` builds it for content collections. |
|
||||
| `buildProductJsonLd({ name, url, sku?, image?, price?, … })` | `@intecion/ipal-kit` | Product (Offer only when there is a price — "price on request" without Offer). |
|
||||
| `buildServiceJsonLd({ name, providerName, url, areaServed?, … })` | `@intecion/ipal-kit` | Service for a service page. |
|
||||
| `buildSpeakableJsonLd({ url, cssSelectors?, id? })` | `@intecion/ipal-kit` | WebPage with `speakable` — points to the parts for assistants to read/quote. |
|
||||
| `buildSiteNavigationJsonLd(items)` | `@intecion/ipal-kit` | SiteNavigationElement from `[{ name, url }]`; null for empty navigation. |
|
||||
| `buildNavigationJsonLd({ items, baseUrl, locale, config, homeSlug })` | `@intecion/ipal-kit` | The same straight from the Header global's `navItems` (resolves links per language, skips external ones, deduplicates). |
|
||||
|
||||
### Sitemap, robots, llms.txt
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildSitemapEntries({ payload, config, baseUrl, content? })` | `@intecion/ipal-kit` | Wszystkie publiczne URL-e (strony + archiwa) z hreflang i lastmod; pomija drafty i noindex. Zwykle `sitemap` z `createContentHelpers`. |
|
||||
| `buildSitemapXml(entries, { cssUrl? })` | `@intecion/ipal-kit` | Serializuje wpisy do XML (opcjonalnie z `xml-stylesheet`). |
|
||||
| `createSitemapRouteHandler(sitemap, { style?, cssUrl? })` | `@intecion/ipal-kit` | Handler `GET /sitemap.xml` (XML + wbudowany CSS pod `?style`). Zwykle `sitemapRoute` z `createContentHelpers`; nie trzymaj obok `app/sitemap.ts`. |
|
||||
| `buildSitemapCss({ title?, credit?, accent? })` | `@intecion/ipal-kit` | CSS wyglądu sitemapy w przeglądarce (serwowany przez handler). |
|
||||
| `SITEMAP_STYLE_PARAM` | `@intecion/ipal-kit` | `'style'` — parametr URL sitemapy zwracający CSS zamiast XML. |
|
||||
| `DEFAULT_SITEMAP_CREDIT` | `@intecion/ipal-kit` | `'Technology by Intecion.com'` — domyślna linia pod nagłówkiem sitemapy. |
|
||||
| `buildRobots({ baseUrl, aiBots?, disallowParams?, extraDisallow?, … })` | `@intecion/ipal-kit` | Reguły `app/robots.ts`: blokuje admin/API, wskazuje sitemapę, jawnie wpuszcza boty AI (`aiBots: 'allow' \| 'block-training' \| 'disallow'`); przy `IPAL_NOINDEX` blokuje wszystko. Zwykle `robots` z `createContentHelpers`. |
|
||||
| `AI_ASSISTANT_BOTS` | `@intecion/ipal-kit` | Lista user-agentów botów asystentów/wyszukiwarek AI (ClaudeBot, PerplexityBot…). |
|
||||
| `AI_TRAINING_BOTS` | `@intecion/ipal-kit` | Lista user-agentów crawlerów trenujących modele (GPTBot, Google-Extended…). |
|
||||
| `buildLlmsTxt({ payload, config, baseUrl, full?, content?, summaryField?, … })` | `@intecion/ipal-kit` | Treść `/llms.txt` (lub `llms-full.txt` przy `full`) z panelu, te same reguły co sitemap. |
|
||||
| `createLlmsTxtRoute({ getCachedPayload, config, baseUrl, full?, … })` | `@intecion/ipal-kit` | Gotowy handler `GET` dla `/llms.txt` / `/llms-full.txt`. Zwykle `llmsRoute` / `llmsFullRoute` z `createContentHelpers`. |
|
||||
| `collectSiteIndex({ payload, config, baseUrl?, content?, locales?, … })` | `@intecion/ipal-kit` | Wspólny indeks publicznych dokumentów per język (URL, tytuł, opis, daty) — źródło dla llms.txt, MCP `list_pages`, IndexNow. Użyj, zanim napiszesz własne listowanie serwisu. |
|
||||
| `buildSitemapEntries({ payload, config, baseUrl, content? })` | `@intecion/ipal-kit` | All public URLs (pages + archives) with hreflang and lastmod; skips drafts and noindex. Usually `sitemap` from `createContentHelpers`. |
|
||||
| `buildSitemapXml(entries, { cssUrl? })` | `@intecion/ipal-kit` | Serializes entries to XML (optionally with `xml-stylesheet`). |
|
||||
| `createSitemapRouteHandler(sitemap, { style?, cssUrl? })` | `@intecion/ipal-kit` | `GET /sitemap.xml` handler (XML + built-in CSS under `?style`). Usually `sitemapRoute` from `createContentHelpers`; do not keep `app/sitemap.ts` next to it. |
|
||||
| `buildSitemapCss({ title?, credit?, accent? })` | `@intecion/ipal-kit` | CSS for how the sitemap looks in a browser (served by the handler). |
|
||||
| `SITEMAP_STYLE_PARAM` | `@intecion/ipal-kit` | `'style'` — sitemap URL parameter that returns CSS instead of XML. |
|
||||
| `DEFAULT_SITEMAP_CREDIT` | `@intecion/ipal-kit` | `'Technology by Intecion.com'` — default line below the sitemap heading. |
|
||||
| `buildRobots({ baseUrl, aiBots?, disallowParams?, extraDisallow?, … })` | `@intecion/ipal-kit` | `app/robots.ts` rules: blocks admin/API, points to the sitemap, explicitly allows AI bots (`aiBots: 'allow' \| 'block-training' \| 'disallow'`); with `IPAL_NOINDEX` blocks everything. Usually `robots` from `createContentHelpers`. |
|
||||
| `AI_ASSISTANT_BOTS` | `@intecion/ipal-kit` | List of user agents of AI assistant/search bots (ClaudeBot, PerplexityBot…). |
|
||||
| `AI_TRAINING_BOTS` | `@intecion/ipal-kit` | List of user agents of model-training crawlers (GPTBot, Google-Extended…). |
|
||||
| `buildLlmsTxt({ payload, config, baseUrl, full?, content?, summaryField?, … })` | `@intecion/ipal-kit` | `/llms.txt` content (or `llms-full.txt` with `full`) from the panel, same rules as the sitemap. |
|
||||
| `createLlmsTxtRoute({ getCachedPayload, config, baseUrl, full?, … })` | `@intecion/ipal-kit` | Ready `GET` handler for `/llms.txt` / `/llms-full.txt`. Usually `llmsRoute` / `llmsFullRoute` from `createContentHelpers`. |
|
||||
| `collectSiteIndex({ payload, config, baseUrl?, content?, locales?, … })` | `@intecion/ipal-kit` | Shared index of public documents per language (URL, title, description, dates) — the source for llms.txt, MCP `list_pages`, IndexNow. Use it before you write your own site listing. |
|
||||
|
||||
### IndexNow
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildIndexNowHook({ config, contentCollection?, baseUrl?, settingsSlug? })` | `@intecion/ipal-kit` | Hook `afterChange`: po publikacji wysyła URL-e we wszystkich językach do IndexNow (w tle, tylko produkcja). Przy `ipalKit({ indexNow: true })` plugin podpina sam na pages i kolekcjach treści — nie wołaj. |
|
||||
| `submitToIndexNow({ payload, urls, baseUrl? })` | `@intecion/ipal-kit` | Ręczny POST paczki URL-i do IndexNow; nigdy nie rzuca, zwraca `boolean`. |
|
||||
| `createIndexNowKeyRoute({ getCachedPayload })` | `@intecion/ipal-kit` | Handler `GET` pliku klucza (`/indexnow-key.txt`) do weryfikacji. Zwykle `indexNowKeyRoute` z `createContentHelpers`. |
|
||||
| `getIndexNowKey(payload)` | `@intecion/ipal-kit` | Klucz IndexNow: env `INDEXNOW_KEY`, potem Site Integrations; `''` gdy brak. |
|
||||
| `INDEXNOW_KEY_ENV` | `@intecion/ipal-kit` | `'INDEXNOW_KEY'` — nazwa zmiennej env z kluczem. |
|
||||
| `INDEXNOW_KEY_PATH` | `@intecion/ipal-kit` | `'/indexnow-key.txt'` — ścieżka trasy pliku klucza. |
|
||||
| `buildIndexNowHook({ config, contentCollection?, baseUrl?, settingsSlug? })` | `@intecion/ipal-kit` | `afterChange` hook: after publish, sends the URLs in all languages to IndexNow (in the background, production only). With `ipalKit({ indexNow: true })` the plugin wires it itself on pages and content collections — do not call. |
|
||||
| `submitToIndexNow({ payload, urls, baseUrl? })` | `@intecion/ipal-kit` | Manual POST of a batch of URLs to IndexNow; never throws, returns `boolean`. |
|
||||
| `createIndexNowKeyRoute({ getCachedPayload })` | `@intecion/ipal-kit` | `GET` handler for the key file (`/indexnow-key.txt`) for verification. Usually `indexNowKeyRoute` from `createContentHelpers`. |
|
||||
| `getIndexNowKey(payload)` | `@intecion/ipal-kit` | IndexNow key: env `INDEXNOW_KEY`, then Site Integrations; `''` when missing. |
|
||||
| `INDEXNOW_KEY_ENV` | `@intecion/ipal-kit` | `'INDEXNOW_KEY'` — name of the env variable with the key. |
|
||||
| `INDEXNOW_KEY_PATH` | `@intecion/ipal-kit` | `'/indexnow-key.txt'` — path of the key file route. |
|
||||
|
||||
### Pola, auto-fill, admin
|
||||
### Fields, auto-fill, admin
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildNoindexField(args?)` | `@intecion/ipal-kit` | Checkbox `noindex` w sidebarze kolekcji: wyklucza stronę z sitemap, llms.txt, wyszukiwarki i daje `robots: noindex, follow`. Dodajesz do `fields` kolekcji (plugin tego nie robi). |
|
||||
| `buildSummaryField(args?)` | `@intecion/ipal-kit` | Lokalizowane pole `aiSummary` (auto-fill z treści, gdy puste) — opis dla AI; potem `summaryField: 'aiSummary'` w llms/search/MCP. |
|
||||
| `buildAutoFillMetaHook(mapping?)` | `@intecion/ipal-kit` | Hook `beforeChange` wypełniający puste `meta.title`/`meta.description` z treści. Plugin podpina sam na kolekcjach `seo.collections` (opcja `seo.autoFill`) — nie wołaj. |
|
||||
| `injectAutoFillMeta(config, seo)` | `@intecion/ipal-kit` | Wstrzykuje powyższy hook do kolekcji SEO. Plugin podpina sam — nie wołaj. |
|
||||
| `SKIP_AUTO_FILL` | `@intecion/ipal-kit` | `'ipalSkipAutoFill'` — klucz `context` (`context: { [SKIP_AUTO_FILL]: true }`) wyłączający auto-fill meta i AI summary przy zapisie (migracje, skrypty). |
|
||||
| `validateFaviconField` | `@intecion/ipal-kit` | `FieldHook` ostrzegający, gdy favicon < 48×48 lub nie kwadratowy. Plugin podpina sam na polu faviconu w SiteSettings — wołaj tylko przy własnym polu faviconu. |
|
||||
| `MetaDescriptionCheck` | `@intecion/ipal-kit/admin` | Podpowiedź pod meta description w zakładce SEO (opis zdublowany z globalnym lub innym dokumentem). Wstrzykiwany przez plugin; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `buildNoindexField(args?)` | `@intecion/ipal-kit` | `noindex` checkbox in the collection sidebar: excludes the page from the sitemap, llms.txt, search, and gives `robots: noindex, follow`. Add it to the collection's `fields` (the plugin does not). |
|
||||
| `buildSummaryField(args?)` | `@intecion/ipal-kit` | Localized `aiSummary` field (auto-filled from content when empty) — a description for AI; then `summaryField: 'aiSummary'` in llms/search/MCP. |
|
||||
| `buildAutoFillMetaHook(mapping?)` | `@intecion/ipal-kit` | `beforeChange` hook that fills empty `meta.title`/`meta.description` from content. The plugin wires it itself on the `seo.collections` collections (option `seo.autoFill`) — do not call. |
|
||||
| `injectAutoFillMeta(config, seo)` | `@intecion/ipal-kit` | Injects the hook above into the SEO collections. The plugin wires it itself — do not call. |
|
||||
| `SKIP_AUTO_FILL` | `@intecion/ipal-kit` | `'ipalSkipAutoFill'` — `context` key (`context: { [SKIP_AUTO_FILL]: true }`) that turns off meta auto-fill and the AI summary on save (migrations, scripts). |
|
||||
| `validateFaviconField` | `@intecion/ipal-kit` | `FieldHook` that warns when the favicon is < 48×48 or not square. The plugin wires it itself on the favicon field in SiteSettings — call it only for your own favicon field. |
|
||||
| `MetaDescriptionCheck` | `@intecion/ipal-kit/admin` | Hint below the meta description in the SEO tab (description duplicated from the global or another document). Injected by the plugin; after turning the option on, `pnpm generate:importmap`. |
|
||||
|
||||
**Typy:** `PageMetadata`, `OgImage` — wynik `buildMetadata` i obraz OG; `SeoMeta`, `SeoOption`, `AutoFillMapping` — grupa `meta`, opcja `seo` pluginu i mapowanie auto-fill; `SiteMetaConfig` — wynik `readSiteMetaConfig`; `RobotsOptions`, `RobotsRules` — opcje i wynik `buildRobots`; `SitemapEntry`, `SitemapRouteOptions`, `SitemapStyleOptions` — wpis sitemapy, opcje handlera i wyglądu; `CollectSiteIndexArgs`, `SiteIndexEntry` — argumenty i wpis `collectSiteIndex`; `NoSnippetProps` (`/client`, `/rsc`) — propsy `NoSnippet`.
|
||||
**Types:** `PageMetadata`, `OgImage` — `buildMetadata` result and OG image; `SeoMeta`, `SeoOption`, `AutoFillMapping` — the `meta` group, the plugin's `seo` option and the auto-fill mapping; `SiteMetaConfig` — `readSiteMetaConfig` result; `RobotsOptions`, `RobotsRules` — `buildRobots` options and result; `SitemapEntry`, `SitemapRouteOptions`, `SitemapStyleOptions` — sitemap entry, handler and style options; `CollectSiteIndexArgs`, `SiteIndexEntry` — `collectSiteIndex` arguments and entry; `NoSnippetProps` (`/client`, `/rsc`) — `NoSnippet` props.
|
||||
|
||||
## Rate limit i IP klienta (`shared`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/forms.md`
|
||||
## Rate limit and client IP (`shared`) — details: `node_modules/@intecion/ipal-kit/docs/forms.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `clientIp(source, { header?, trustedProxies? })` | `@intecion/ipal-kit` | IP klienta z `Request` lub `Headers` (`clientIp(await headers())` w server action): `cf-connecting-ip`, `x-real-ip`, potem XFF liczone od prawej; `''` gdy brak. W produkcji przypnij `header` (lub env `IPAL_IP_HEADER`). |
|
||||
| `setRateLimitStore(store \| null)` | `@intecion/ipal-kit` | Wspólny magazyn (np. Redis) dla wszystkich limiterów pluginu (formularze, zgody, MCP…); `null` = pamięć procesu. Wołaj raz przy starcie, gdy działa kilka instancji. |
|
||||
| `clientIp(source, { header?, trustedProxies? })` | `@intecion/ipal-kit` | Client IP from a `Request` or `Headers` (`clientIp(await headers())` in a server action): `cf-connecting-ip`, `x-real-ip`, then XFF counted from the right; `''` when missing. In production pin `header` (or env `IPAL_IP_HEADER`). |
|
||||
| `setRateLimitStore(store \| null)` | `@intecion/ipal-kit` | Shared store (e.g. Redis) for all plugin limiters (forms, consents, MCP…); `null` = process memory. Call once at startup when several instances run. |
|
||||
|
||||
**Typy:** `ClientIpOptions` — opcje `clientIp`; `RateLimitStore` — kontrakt magazynu (`hit(id, cost, windowMs)` → `{ count, resetAt }`).
|
||||
**Types:** `ClientIpOptions` — `clientIp` options; `RateLimitStore` — store contract (`hit(id, cost, windowMs)` → `{ count, resetAt }`).
|
||||
|
||||
## Slug (`slug`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/slug.md`
|
||||
## Slug (`slug`) — details: `node_modules/@intecion/ipal-kit/docs/slug.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildSlugField({ from?, name?, localized?, required?, overrides? })` | `@intecion/ipal-kit` | Pole slug generowane z `title` (domyślnie) tylko gdy puste, per język — nigdy nie nadpisuje ręcznego. Do `fields` kolekcji. |
|
||||
| `toSlug(input)` | `@intecion/ipal-kit` | String → slug URL (diakrytyki, np. „Strona główna” → `strona-glowna`). |
|
||||
| `buildSlugField({ from?, name?, localized?, required?, overrides? })` | `@intecion/ipal-kit` | Slug field generated from `title` (by default) only when empty, per language — never overwrites a manual one. For the collection's `fields`. |
|
||||
| `toSlug(input)` | `@intecion/ipal-kit` | String → URL slug (diacritics, e.g. "Strona główna" → `strona-glowna`). |
|
||||
|
||||
## Statystyki (`stats`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/stats.md`
|
||||
## Stats (`stats`) — details: `node_modules/@intecion/ipal-kit/docs/stats.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `PageStats({ locale?, endpoint? })` | `@intecion/ipal-kit/client` | Beacon odsłony do `/api/ipal/hit` (bez zgody anonimowo, ze zgodą analytics cookie `ipal_vid`). Montuj raz w layoucie wewnątrz `<ConsentProvider>` albo przez `stats` w `<SiteProviders>`. |
|
||||
| `STATS_SLUG` | `@intecion/ipal-kit` | `'stats-visits'` — slug kolekcji wizyt (dodawanej przez `ipalKit({ stats })`). |
|
||||
| `VISITOR_COOKIE` | `@intecion/ipal-kit/client` | `'ipal_vid'` — cookie identyfikatora odwiedzającego (tylko po zgodzie analytics). |
|
||||
| `StatsView` | `@intecion/ipal-kit/admin` | Widok `/admin/stats` (30 dni, top strony, referrery, urządzenia, historia odwiedzającego). Wstrzykiwany przez plugin; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `StatsWidget` | `@intecion/ipal-kit/admin` | Karta z wykresem 30 dni na dashboardzie (`stats.dashboard`). Wstrzykiwany przez plugin; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `StatsNavLink` | `@intecion/ipal-kit/admin` | Link do `/admin/stats` w nawigacji panelu. Wstrzykiwany przez plugin; po włączeniu opcji `pnpm generate:importmap`. |
|
||||
| `PageStats({ locale?, endpoint? })` | `@intecion/ipal-kit/client` | Page view beacon to `/api/ipal/hit` (anonymous without consent, with analytics consent the `ipal_vid` cookie). Mount once in the layout inside `<ConsentProvider>` or via `stats` in `<SiteProviders>`. |
|
||||
| `STATS_SLUG` | `@intecion/ipal-kit` | `'stats-visits'` — slug of the visits collection (added by `ipalKit({ stats })`). |
|
||||
| `VISITOR_COOKIE` | `@intecion/ipal-kit/client` | `'ipal_vid'` — visitor ID cookie (only after analytics consent). |
|
||||
| `StatsView` | `@intecion/ipal-kit/admin` | `/admin/stats` view (30 days, top pages, referrers, devices, visitor history). Injected by the plugin; after turning the option on, `pnpm generate:importmap`. |
|
||||
| `StatsWidget` | `@intecion/ipal-kit/admin` | Dashboard card with a 30-day chart (`stats.dashboard`). Injected by the plugin; after turning the option on, `pnpm generate:importmap`. |
|
||||
| `StatsNavLink` | `@intecion/ipal-kit/admin` | Link to `/admin/stats` in the panel nav. Injected by the plugin; after turning the option on, `pnpm generate:importmap`. |
|
||||
|
||||
**Typy:** `StatsOptions` — opcja `ipalKit({ stats })` (`dashboard`, `retentionDays`, `timeZone`); `StatsVisit`, `StatsPage` — dokument wizyty i odsłona w nim; `PageStatsProps` (`/client`) — propsy `PageStats`.
|
||||
**Types:** `StatsOptions` — the `ipalKit({ stats })` option (`dashboard`, `retentionDays`, `timeZone`); `StatsVisit`, `StatsPage` — visit document and a page view in it; `PageStatsProps` (`/client`) — `PageStats` props.
|
||||
|
||||
## Media i storage (`storage`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/storage.md`
|
||||
## Media and storage (`storage`) — details: `node_modules/@intecion/ipal-kit/docs/storage.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `buildR2Storage(collections, { s3Storage })` | `@intecion/ipal-kit` | Plugin storage Cloudflare R2 z env (`R2_*`); bez env no-op (dysk lokalny). `s3Storage` z `@payloadcms/storage-s3` wstrzykuje projekt. Do `plugins` w configu. |
|
||||
| `buildImagesConfig({ publicUrl?, serverUrl?, extraHosts?, production? })` | `@intecion/ipal-kit` | Domyślne `images` dla `next.config.ts`: AVIF/WebP, `remotePatterns` dla R2 i mediów z aplikacji, cache 31 dni. |
|
||||
| `MediaPreconnect()` | `@intecion/ipal-kit/rsc` | `<link rel="preconnect">` + `dns-prefetch` do domeny `R2_PUBLIC_URL`; nic, gdy brak env. W `<head>` layoutu. |
|
||||
| `YouTubeEmbed({ videoId, title, playLabel, poster?, note?, classNames? })` | `@intecion/ipal-kit/client` | Lekki YouTube: poster + przycisk, player `youtube-nocookie` dopiero po kliknięciu (bez cookies i JS przy ładowaniu). Bez stylów. |
|
||||
| `buildR2Storage(collections, { s3Storage })` | `@intecion/ipal-kit` | Cloudflare R2 storage plugin from env (`R2_*`); without env a no-op (local disk). The project injects `s3Storage` from `@payloadcms/storage-s3`. For `plugins` in the config. |
|
||||
| `buildImagesConfig({ publicUrl?, serverUrl?, extraHosts?, production? })` | `@intecion/ipal-kit` | Default `images` for `next.config.ts`: AVIF/WebP, `remotePatterns` for R2 and media from the app, 31-day cache. |
|
||||
| `MediaPreconnect()` | `@intecion/ipal-kit/rsc` | `<link rel="preconnect">` + `dns-prefetch` to the `R2_PUBLIC_URL` domain; nothing when the env is missing. `SiteProviders` already renders it (`preconnect={false}` turns it off); by hand: top of `<body>`, never an explicit `<head>`. |
|
||||
| `YouTubeEmbed({ videoId, title, playLabel, poster?, note?, classNames? })` | `@intecion/ipal-kit/client` | Lightweight YouTube: poster + button, the `youtube-nocookie` player only after a click (no cookies or JS on load). Unstyled. |
|
||||
|
||||
**Typy:** `ImagesConfig` — wynik `buildImagesConfig`.
|
||||
**Types:** `ImagesConfig` — `buildImagesConfig` result.
|
||||
|
||||
## Motyw jasny/ciemny (`theme`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/theme.md`
|
||||
## Light/dark theme (`theme`) — details: `node_modules/@intecion/ipal-kit/docs/theme.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `ThemeScript({ allowToggle?, defaultTheme? })` | `@intecion/ipal-kit/rsc` | Inline script ustawiający `data-theme` na `<html>` przed malowaniem (bez mignięcia). Pierwszy w `<body>` lub `theme` w `<SiteProviders>`; `<html suppressHydrationWarning>`. |
|
||||
| `ThemeSwitcher({ label?, classNames?, renderIcon? })` | `@intecion/ipal-kit/client` | Przełącznik bez stylów (`<button role="switch">`, ikony light/dark); aktywną ikonę stylujesz z CSS (`[data-theme=dark]`). |
|
||||
| `useTheme()` | `@intecion/ipal-kit/client` | Hook `{ theme, setTheme, toggle }`; `theme` = null na serwerze — nie styluj od niego. |
|
||||
| `applyTheme(theme, { persist?, transitionMs? })` | `@intecion/ipal-kit/client` | Ustawia motyw na `<html>` i zapamiętuje w localStorage. |
|
||||
| `readDocumentTheme()` | `@intecion/ipal-kit/client` | Aktualny motyw z `<html>` lub null. |
|
||||
| `themeConfigFrom(settings)` | `@intecion/ipal-kit` | Opcje motywu z dokumentu SiteSettings (to, co trzyma `getSiteShell(locale).theme`). |
|
||||
| `themeScript({ allowToggle, defaultTheme })` | `@intecion/ipal-kit` | Treść skryptu, którą renderuje `ThemeScript` — gdy wstawiasz ją sam. |
|
||||
| `ThemeScript({ allowToggle?, defaultTheme? })` | `@intecion/ipal-kit/rsc` | Inline script that sets `data-theme` on `<html>` before paint (no flash). First in `<body>` or `theme` in `<SiteProviders>`; `<html suppressHydrationWarning>`. |
|
||||
| `ThemeSwitcher({ label?, classNames?, renderIcon? })` | `@intecion/ipal-kit/client` | Unstyled switcher (`<button role="switch">`, light/dark icons); style the active icon in CSS (`[data-theme=dark]`). |
|
||||
| `useTheme()` | `@intecion/ipal-kit/client` | Hook `{ theme, setTheme, toggle }`; `theme` = null on the server — do not style from it. |
|
||||
| `applyTheme(theme, { persist?, transitionMs? })` | `@intecion/ipal-kit/client` | Sets the theme on `<html>` and remembers it in localStorage. |
|
||||
| `readDocumentTheme()` | `@intecion/ipal-kit/client` | Current theme from `<html>` or null. |
|
||||
| `themeConfigFrom(settings)` | `@intecion/ipal-kit` | Theme options from the SiteSettings document (what `getSiteShell(locale).theme` holds). |
|
||||
| `themeScript({ allowToggle, defaultTheme })` | `@intecion/ipal-kit` | The script content that `ThemeScript` renders — when you insert it yourself. |
|
||||
| `isTheme(value)` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | Type guard `'light' \| 'dark'`. |
|
||||
| `isThemeSetting(value)` | `@intecion/ipal-kit` | Type guard `'system' \| 'light' \| 'dark'`. |
|
||||
| `THEME_ATTRIBUTE` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `'data-theme'` — atrybut na `<html>` (wariant Tailwind `dark`). |
|
||||
| `THEME_STORAGE_KEY` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `'ipal-theme'` — klucz localStorage z wyborem odwiedzającego. |
|
||||
| `THEME_SWITCHING_ATTRIBUTE` | `@intecion/ipal-kit/client` | `'data-theme-switching'` — chwilowo na `<html>` przy przełączaniu (do przejścia kolorów). |
|
||||
| `THEME_ATTRIBUTE` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `'data-theme'` — attribute on `<html>` (Tailwind `dark` variant). |
|
||||
| `THEME_STORAGE_KEY` | `@intecion/ipal-kit`, `@intecion/ipal-kit/client` | `'ipal-theme'` — localStorage key with the visitor's choice. |
|
||||
| `THEME_SWITCHING_ATTRIBUTE` | `@intecion/ipal-kit/client` | `'data-theme-switching'` — briefly on `<html>` while switching (for the colour transition). |
|
||||
|
||||
**Typy:** `Theme`, `ThemeSetting`, `ThemeConfig` (root, `/client`) — motyw, ustawienie z panelu i opcje motywu; `ThemeScriptProps` (`/rsc`), `ThemeSwitcherProps`, `ThemeSwitcherClassNames` (`/client`) — propsy komponentów.
|
||||
**Types:** `Theme`, `ThemeSetting`, `ThemeConfig` (root, `/client`) — theme, setting from the panel and theme options; `ThemeScriptProps` (`/rsc`), `ThemeSwitcherProps`, `ThemeSwitcherClassNames` (`/client`) — component props.
|
||||
|
||||
## Turnstile (`turnstile`) — szczegóły: `node_modules/@intecion/ipal-kit/docs/turnstile.md`
|
||||
## Turnstile (`turnstile`) — details: `node_modules/@intecion/ipal-kit/docs/turnstile.md`
|
||||
|
||||
| Eksport | Import z | Do czego / kiedy |
|
||||
| Export | Import from | What it does / when |
|
||||
|---|---|---|
|
||||
| `getTurnstileConfig(payload)` | `@intecion/ipal-kit` | `{ enabled, siteKey }` z Site Integrations (fallback env); włączone tylko gdy są oba klucze. W layoucie serwerowym → `TurnstileProvider`. |
|
||||
| `TurnstileProvider({ siteKey, children })` | `@intecion/ipal-kit/client` | Dostarcza site key całej aplikacji; przy `siteKey` null widgety nic nie renderują. |
|
||||
| `useTurnstile()` | `@intecion/ipal-kit/client` | W formularzu: `{ token, TurnstileWidget, reset, … }`; token przekazujesz do `submitForm`. Wymaga providera. |
|
||||
| `useOptionalTurnstile()` | `@intecion/ipal-kit/client` | Jak `useTurnstile`, ale bez providera zwraca `enabled: false` zamiast rzucać — dla współdzielonych komponentów. |
|
||||
| `Turnstile({ siteKey, onToken, theme? })` | `@intecion/ipal-kit/client` | Surowy widget z jawnym kluczem — gdy nie używasz providera. |
|
||||
| `verifyTurnstile({ token, payload, ip?, onConfigError? })` | `@intecion/ipal-kit/server` | Weryfikacja tokenu po stronie serwera → `boolean` (`degraded` domyślnie przepuszcza). `submitForm` robi to sam — wołaj tylko we własnych akcjach. |
|
||||
| `checkTurnstile({ token, payload, ip? })` | `@intecion/ipal-kit/server` | Jak wyżej, ale zwraca `{ outcome: 'pass' \| 'reject' \| 'degraded', code? }` i aktualizuje status integracji w panelu. |
|
||||
| `getTurnstileConfig(payload)` | `@intecion/ipal-kit` | `{ enabled, siteKey }` from Site Integrations (env fallback); enabled only when both keys are set. In the server layout → `TurnstileProvider`. |
|
||||
| `TurnstileProvider({ siteKey, children })` | `@intecion/ipal-kit/client` | Provides the site key to the whole app; with `siteKey` null the widgets render nothing. |
|
||||
| `useTurnstile()` | `@intecion/ipal-kit/client` | In a form: `{ token, TurnstileWidget, reset, … }`; pass the token to `submitForm`. Requires the provider. |
|
||||
| `useOptionalTurnstile()` | `@intecion/ipal-kit/client` | Like `useTurnstile`, but without a provider it returns `enabled: false` instead of throwing — for shared components. |
|
||||
| `Turnstile({ siteKey, onToken, theme? })` | `@intecion/ipal-kit/client` | Raw widget with an explicit key — when you do not use the provider. |
|
||||
| `verifyTurnstile({ token, payload, ip?, onConfigError? })` | `@intecion/ipal-kit/server` | Server-side token verification → `boolean` (`degraded` lets it through by default). `submitForm` does this itself — call it only in your own actions. |
|
||||
| `checkTurnstile({ token, payload, ip? })` | `@intecion/ipal-kit/server` | As above, but returns `{ outcome: 'pass' \| 'reject' \| 'degraded', code? }` and updates the integration status in the panel. |
|
||||
|
||||
**Typy:** `TurnstileConfig` (root) — wynik `getTurnstileConfig`; `TurnstileCheck`, `TurnstileOutcome` (`/server`) — wynik weryfikacji; `TurnstileProps`, `TurnstileTheme` (`/client`) — propsy i motyw widgetu.
|
||||
**Types:** `TurnstileConfig` (root) — `getTurnstileConfig` result; `TurnstileCheck`, `TurnstileOutcome` (`/server`) — verification result; `TurnstileProps`, `TurnstileTheme` (`/client`) — widget props and theme.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user