diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..ab92fa2 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,27 @@ +# Runs on every push and pull request: typecheck, lint, unit tests, build. +# Gitea Actions uses the GitHub Actions syntax; needs a runner with Docker. +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: pnpm/action-setup@v4 + with: + version: 10 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: pnpm + # --ignore-scripts: skip `prepare` (the build) here; it runs as its own step. + - run: pnpm install --frozen-lockfile --ignore-scripts + - run: pnpm typecheck + - run: pnpm lint + - run: pnpm test:int + - run: pnpm build diff --git a/.gitignore b/.gitignore index 8b58e0d..8d48409 100644 --- a/.gitignore +++ b/.gitignore @@ -50,9 +50,6 @@ next-env.d.ts # local db & build artifacts *.db *.tgz -0 -# local db & build artifacts -*.db -*.tgz -0 +# build output — produced by `pnpm build` (prepare/prepublishOnly), not committed +/dist diff --git a/README.md b/README.md index ef2e1b4..db09514 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ The plugin doesn't pull in the dependencies it shares with Payload — add them yourself, in a version matching your Payload: ```bash -pnpm add @payloadcms/plugin-seo@3.84.1 @payloadcms/plugin-form-builder@3.84.1 \ +pnpm add @payloadcms/plugin-seo@3.90.2 @payloadcms/plugin-form-builder@3.90.2 \ nodemailer lucide-react slugify server-only ``` diff --git a/dev/app/(payload)/admin/importMap.js b/dev/app/(payload)/admin/importMap.js index af86423..70312dd 100644 --- a/dev/app/(payload)/admin/importMap.js +++ b/dev/app/(payload)/admin/importMap.js @@ -1,6 +1,24 @@ +import { OverviewComponent as OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client' +import { MetaTitleComponent as MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client' +import { MetaDescriptionComponent as MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client' +import { MetaImageComponent as MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client' +import { PreviewComponent as PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860 } from '@payloadcms/plugin-seo/client' +import { IntegrationStatusBanner as IntegrationStatusBanner_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client' +import { MaskedField as MaskedField_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client' +import { TestEmailButton as TestEmailButton_630f031911beff97691b963f10a20a86 } from '@intecion/ipal-kit/client' +import { IntegrationAlerts as IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23 } from '@intecion/ipal-kit/admin' import { CollectionCards as CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1 } from '@payloadcms/next/rsc' /** @type import('payload').ImportMap */ export const importMap = { + "@payloadcms/plugin-seo/client#OverviewComponent": OverviewComponent_a8a977ebc872c5d5ea7ee689724c0860, + "@payloadcms/plugin-seo/client#MetaTitleComponent": MetaTitleComponent_a8a977ebc872c5d5ea7ee689724c0860, + "@payloadcms/plugin-seo/client#MetaDescriptionComponent": MetaDescriptionComponent_a8a977ebc872c5d5ea7ee689724c0860, + "@payloadcms/plugin-seo/client#MetaImageComponent": MetaImageComponent_a8a977ebc872c5d5ea7ee689724c0860, + "@payloadcms/plugin-seo/client#PreviewComponent": PreviewComponent_a8a977ebc872c5d5ea7ee689724c0860, + "@intecion/ipal-kit/client#IntegrationStatusBanner": IntegrationStatusBanner_630f031911beff97691b963f10a20a86, + "@intecion/ipal-kit/client#MaskedField": MaskedField_630f031911beff97691b963f10a20a86, + "@intecion/ipal-kit/client#TestEmailButton": TestEmailButton_630f031911beff97691b963f10a20a86, + "@intecion/ipal-kit/admin#IntegrationAlerts": IntegrationAlerts_7568fe47d582ff15ce85d2e1873c2c23, "@payloadcms/next/rsc#CollectionCards": CollectionCards_f9c02e79a4aed9a3924487c0cd4cafb1 } diff --git a/dev/app/my-route/route.ts b/dev/app/my-route/route.ts deleted file mode 100644 index 0755886..0000000 --- a/dev/app/my-route/route.ts +++ /dev/null @@ -1,12 +0,0 @@ -import configPromise from '@payload-config' -import { getPayload } from 'payload' - -export const GET = async (request: Request) => { - const payload = await getPayload({ - config: configPromise, - }) - - return Response.json({ - message: 'This is an example of a custom route.', - }) -} diff --git a/dev/e2e.spec.ts b/dev/e2e.spec.ts index 240fa0b..e50aca2 100644 --- a/dev/e2e.spec.ts +++ b/dev/e2e.spec.ts @@ -1,12 +1,13 @@ import { expect, test } from '@playwright/test' -// this is an example Playwright e2e test +import { devUser } from './helpers/credentials.js' + test('should render admin panel logo', async ({ page }) => { await page.goto('/admin') // login - await page.fill('#field-email', 'dev@payloadcms.com') - await page.fill('#field-password', 'test') + await page.fill('#field-email', devUser.email) + await page.fill('#field-password', devUser.password) await page.click('.form-submit button') // should show dashboard diff --git a/dev/next.config.mjs b/dev/next.config.mjs index eb786db..3f740fc 100644 --- a/dev/next.config.mjs +++ b/dev/next.config.mjs @@ -15,7 +15,6 @@ const nextConfig = { return webpackConfig }, - serverExternalPackages: ['mongodb-memory-server'], } export default withPayload(nextConfig, { devBundleServerPackages: false }) diff --git a/dev/payload-types.ts b/dev/payload-types.ts index 4c99049..12fa8d5 100644 --- a/dev/payload-types.ts +++ b/dev/payload-types.ts @@ -68,6 +68,7 @@ export interface Config { blocks: {}; collections: { users: User; + pages: Page; posts: Post; media: Media; 'payload-kv': PayloadKv; @@ -78,6 +79,7 @@ export interface Config { collectionsJoins: {}; collectionsSelect: { users: UsersSelect | UsersSelect; + pages: PagesSelect | PagesSelect; posts: PostsSelect | PostsSelect; media: MediaSelect | MediaSelect; 'payload-kv': PayloadKvSelect | PayloadKvSelect; @@ -93,11 +95,13 @@ export interface Config { 'site-settings': SiteSetting; 'site-integrations': SiteIntegration; 'cookie-settings': CookieSetting; + notifications: Notification; }; globalsSelect: { 'site-settings': SiteSettingsSelect | SiteSettingsSelect; 'site-integrations': SiteIntegrationsSelect | SiteIntegrationsSelect; 'cookie-settings': CookieSettingsSelect | CookieSettingsSelect; + notifications: NotificationsSelect | NotificationsSelect; }; locale: 'pl' | 'en'; widgets: { @@ -144,6 +148,7 @@ export interface User { resetPasswordExpiration?: string | null; salt?: string | null; hash?: string | null; + resetPasswordRequestedAt?: string | null; loginAttempts?: number | null; lockUntil?: string | null; sessions?: @@ -158,10 +163,11 @@ export interface User { } /** * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "posts". + * via the `definition` "pages". */ -export interface Post { +export interface Page { id: number; + title?: string | null; meta?: { title?: string | null; description?: string | null; @@ -169,6 +175,10 @@ export interface Post { * Maximum upload file size: 12MB. Recommended file size for images is <500KB. */ image?: (number | null) | Media; + /** + * Use this exact text as the browser-tab title — no site name, no separator. Leave empty to compose the title automatically. + */ + titleOverride?: string | null; }; updatedAt: string; createdAt: string; @@ -191,6 +201,28 @@ export interface Media { focalX?: number | null; focalY?: number | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "posts". + */ +export interface Post { + id: number; + title?: string | null; + meta?: { + title?: string | null; + description?: string | null; + /** + * Maximum upload file size: 12MB. Recommended file size for images is <500KB. + */ + image?: (number | null) | Media; + /** + * Use this exact text as the browser-tab title — no site name, no separator. Leave empty to compose the title automatically. + */ + titleOverride?: string | null; + }; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "payload-kv". @@ -219,6 +251,10 @@ export interface PayloadLockedDocument { relationTo: 'users'; value: number | User; } | null) + | ({ + relationTo: 'pages'; + value: number | Page; + } | null) | ({ relationTo: 'posts'; value: number | Post; @@ -282,6 +318,7 @@ export interface UsersSelect { resetPasswordExpiration?: T; salt?: T; hash?: T; + resetPasswordRequestedAt?: T; loginAttempts?: T; lockUntil?: T; sessions?: @@ -294,15 +331,34 @@ export interface UsersSelect { } /** * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "posts_select". + * via the `definition` "pages_select". */ -export interface PostsSelect { +export interface PagesSelect { + title?: T; meta?: | T | { title?: T; description?: T; image?: T; + titleOverride?: T; + }; + updatedAt?: T; + createdAt?: T; +} +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "posts_select". + */ +export interface PostsSelect { + title?: T; + meta?: + | T + | { + title?: T; + description?: T; + image?: T; + titleOverride?: T; }; updatedAt?: T; createdAt?: T; @@ -374,6 +430,18 @@ export interface SiteSetting { * Used in page titles and Open Graph metadata. */ siteName: string; + /** + * Fallback meta description when a page has none. Also used for llms.txt and Open Graph. + */ + siteDescription?: string | null; + /** + * Which comes first in browser tabs. + */ + titleOrder?: ('page-first' | 'site-first') | null; + /** + * Separates the page title from the site name in browser tabs. + */ + titleSeparator?: ('|' | '–' | '-' | '·' | '/') | null; /** * Primary site logo. */ @@ -383,7 +451,7 @@ export interface SiteSetting { */ defaultShareImage?: (number | null) | Media; /** - * Square source icon (PNG or SVG) for the browser tab. Rendered by the frontend. + * Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata. */ favicon?: (number | null) | Media; /** @@ -404,13 +472,29 @@ export interface SiteSetting { export interface SiteIntegration { id: number; /** - * Google Analytics 4 Measurement ID. + * Google Analytics 4 Measurement ID. (Google — Consent Mode) */ ga4MeasurementId?: string | null; /** - * Google Tag Manager container ID. + * Google Tag Manager container ID. (Google — Consent Mode) */ gtmContainerId?: string | null; + /** + * Meta (Facebook) Pixel ID. Loads only after MARKETING consent. + */ + metaPixelId?: string | null; + /** + * Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent. + */ + clarityProjectId?: string | null; + /** + * LinkedIn Insight Tag partner ID. Loads only after MARKETING consent. + */ + linkedInPartnerId?: string | null; + /** + * TikTok Pixel ID. Loads only after MARKETING consent. + */ + tiktokPixelId?: string | null; /** * Public site key rendered in the Turnstile widget. */ @@ -419,6 +503,17 @@ export interface SiteIntegration { * Secret key used for server-side verification. */ turnstileSecretKey?: string | null; + turnstileStatus?: { + state?: ('ok' | 'degraded') | null; + code?: string | null; + message?: string | null; + since?: string | null; + checkedAt?: string | null; + }; + /** + * How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion). + */ + emailTransport?: ('smtp' | 'graph') | null; smtpHost?: string | null; smtpPort?: number | null; /** @@ -437,22 +532,13 @@ export interface SiteIntegration { * Default "from" display name. */ smtpFromName?: string | null; - /** - * R2 bucket name. - */ - r2Bucket?: string | null; - /** - * R2 S3-compatible endpoint URL. - */ - r2Endpoint?: string | null; - /** - * R2 access key ID. - */ - r2AccessKeyId?: string | null; - /** - * R2 secret access key. - */ - r2SecretAccessKey?: string | null; + emailStatus?: { + state?: ('ok' | 'degraded') | null; + code?: string | null; + message?: string | null; + since?: string | null; + checkedAt?: string | null; + }; updatedAt?: string | null; createdAt?: string | null; } @@ -470,6 +556,10 @@ export interface CookieSetting { * Heading for the detailed settings panel. */ settingsTitle?: string | null; + /** + * Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used. + */ + privacyLinkLabel?: string | null; /** * Button labels. */ @@ -494,12 +584,42 @@ export interface CookieSetting { updatedAt?: string | null; createdAt?: string | null; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "notifications". + */ +export interface Notification { + id: number; + /** + * Messages shown after a form is submitted. Leave a field empty to use the built-in default. + */ + form?: { + success?: string | null; + error?: string | null; + rateLimited?: string | null; + turnstile?: string | null; + /** + * Shown on a validation error. Use {field} to insert the offending field name. + */ + validation?: string | null; + /** + * Shown when the GDPR consent checkbox is left unchecked. + */ + consent?: string | null; + notFound?: string | null; + }; + updatedAt?: string | null; + createdAt?: string | null; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "site-settings_select". */ export interface SiteSettingsSelect { siteName?: T; + siteDescription?: T; + titleOrder?: T; + titleSeparator?: T; logo?: T; defaultShareImage?: T; favicon?: T; @@ -516,18 +636,37 @@ export interface SiteSettingsSelect { export interface SiteIntegrationsSelect { ga4MeasurementId?: T; gtmContainerId?: T; + metaPixelId?: T; + clarityProjectId?: T; + linkedInPartnerId?: T; + tiktokPixelId?: T; turnstileSiteKey?: T; turnstileSecretKey?: T; + turnstileStatus?: + | T + | { + state?: T; + code?: T; + message?: T; + since?: T; + checkedAt?: T; + }; + emailTransport?: T; smtpHost?: T; smtpPort?: T; smtpUser?: T; smtpPassword?: T; smtpFromAddress?: T; smtpFromName?: T; - r2Bucket?: T; - r2Endpoint?: T; - r2AccessKeyId?: T; - r2SecretAccessKey?: T; + emailStatus?: + | T + | { + state?: T; + code?: T; + message?: T; + since?: T; + checkedAt?: T; + }; updatedAt?: T; createdAt?: T; globalType?: T; @@ -539,6 +678,7 @@ export interface SiteIntegrationsSelect { export interface CookieSettingsSelect { message?: T; settingsTitle?: T; + privacyLinkLabel?: T; buttons?: | T | { @@ -560,6 +700,26 @@ export interface CookieSettingsSelect { createdAt?: T; globalType?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "notifications_select". + */ +export interface NotificationsSelect { + form?: + | T + | { + success?: T; + error?: T; + rateLimited?: T; + turnstile?: T; + validation?: T; + consent?: T; + notFound?: T; + }; + updatedAt?: T; + createdAt?: T; + globalType?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "collections_widget". diff --git a/dev/payload.config.ts b/dev/payload.config.ts index 67f2a91..c73cc56 100644 --- a/dev/payload.config.ts +++ b/dev/payload.config.ts @@ -1,7 +1,6 @@ import { sqliteAdapter } from '@payloadcms/db-sqlite' import { lexicalEditor } from '@payloadcms/richtext-lexical' -import { ipalKit } from 'ipal-kit' -import { MongoMemoryReplSet } from 'mongodb-memory-server' +import { ipalKit } from '../src/index.js' import path from 'path' import { buildConfig } from 'payload' import sharp from 'sharp' @@ -17,70 +16,61 @@ if (!process.env.ROOT_DIR) { process.env.ROOT_DIR = dirname } -const buildConfigWithMemoryDB = async () => { - if (process.env.NODE_ENV === 'test') { - const memoryDB = await MongoMemoryReplSet.create({ - replSet: { - count: 3, - dbName: 'payloadmemory', - }, - }) - - process.env.DATABASE_URL = `${memoryDB.getUri()}&retryWrites=true` - } - - return buildConfig({ - admin: { - importMap: { - baseDir: path.resolve(dirname), - }, +export default buildConfig({ + admin: { + importMap: { + baseDir: path.resolve(dirname), }, - collections: [ - { - slug: 'users', - auth: true, - fields: [], - }, - { - slug: 'posts', - fields: [], - }, - { - slug: 'media', - fields: [], - upload: { staticDir: path.resolve(dirname, 'media') }, - }, - ], + }, + collections: [ + { + slug: 'users', + auth: true, + fields: [], + }, + { + slug: 'pages', + fields: [{ name: 'title', type: 'text' }], + }, + { + slug: 'posts', + fields: [{ name: 'title', type: 'text' }], + }, + { + slug: 'media', + fields: [], + upload: { staticDir: path.resolve(dirname, 'media') }, + }, + ], - db: sqliteAdapter({ - client: { - url: process.env.DATABASE_URI || 'file:./payload.db', + db: sqliteAdapter({ + client: { + url: process.env.DATABASE_URI || 'file:./payload.db', + }, + }), + editor: lexicalEditor(), + email: testEmailAdapter, + onInit: async (payload) => { + await seed(payload) + }, + plugins: [ + ipalKit({ + access: { authCollection: 'users' }, + i18n: { + defaultLocale: 'pl', + locales: [ + { code: 'pl', label: 'Polski' }, + { code: 'en', label: 'English' }, + ], }, + seo: { collections: ['posts', 'pages'] }, + // 2FA is enforced by default; the dev sandbox opts out so it boots without an authenticator. + twoFactor: false, }), - editor: lexicalEditor(), - email: testEmailAdapter, - onInit: async (payload) => { - await seed(payload) - }, - plugins: [ - ipalKit({ - access: { authCollection: 'users' }, - i18n: { - defaultLocale: 'pl', - locales: [ - { code: 'pl', label: 'Polski' }, - { code: 'en', label: 'English' }, - ], - }, - seo: { collections: ['posts', 'pages'] }, - }), - ], - secret: process.env.PAYLOAD_SECRET || 'test-secret_key', - sharp, - typescript: { - outputFile: path.resolve(dirname, 'payload-types.ts'), - }, - }) -} - -export default buildConfigWithMemoryDB() + ], + secret: process.env.PAYLOAD_SECRET || 'test-secret_key', + sharp, + typescript: { + outputFile: path.resolve(dirname, 'payload-types.ts'), + }, +}) diff --git a/dev/tsconfig.json b/dev/tsconfig.json index 29b411e..0bc30d1 100644 --- a/dev/tsconfig.json +++ b/dev/tsconfig.json @@ -27,6 +27,15 @@ ], "ipal-kit/rsc": [ "../src/exports/rsc.ts" + ], + "@intecion/ipal-kit": [ + "../src/index.ts" + ], + "@intecion/ipal-kit/next/middleware": [ + "../src/exports/next-middleware.ts" + ], + "@intecion/ipal-kit/*": [ + "../src/exports/*.ts" ] }, "noEmit": true, diff --git a/dist/exports/admin.d.ts b/dist/exports/admin.d.ts deleted file mode 100644 index 54da71a..0000000 --- a/dist/exports/admin.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Entry point: @intecion/ipal-kit/admin - * - * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's - * importMap can resolve them by a stable path when ipalKit injects - * admin.components.graphics.Logo/Icon. - */ -export { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js'; -export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'; -export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'; diff --git a/dist/exports/admin.js b/dist/exports/admin.js deleted file mode 100644 index bfc7aac..0000000 --- a/dist/exports/admin.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Entry point: @intecion/ipal-kit/admin - * - * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's - * importMap can resolve them by a stable path when ipalKit injects - * admin.components.graphics.Logo/Icon. - */ export { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js'; -export { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'; -export { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'; - -//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/dist/exports/admin.js.map b/dist/exports/admin.js.map deleted file mode 100644 index 388002d..0000000 --- a/dist/exports/admin.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/admin.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/admin\n *\n * Admin-panel UI components (white-label branding, array row labels). Separate export so Payload's\n * importMap can resolve them by a stable path when ipalKit injects\n * admin.components.graphics.Logo/Icon.\n */\nexport { AdminLogo, AdminIcon, IntecionCredit } from '../modules/branding/index.js'\nexport { RowLabel } from '../modules/admin-ui/RowLabelComponent.js'\nexport { IntegrationAlerts } from '../modules/integrations/IntegrationAlerts.js'\n"],"names":["AdminLogo","AdminIcon","IntecionCredit","RowLabel","IntegrationAlerts"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,+BAA8B;AACnF,SAASC,QAAQ,QAAQ,2CAA0C;AACnE,SAASC,iBAAiB,QAAQ,+CAA8C"} \ No newline at end of file diff --git a/dist/exports/client.d.ts b/dist/exports/client.d.ts deleted file mode 100644 index edec64a..0000000 --- a/dist/exports/client.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * Entry point: ipal-kit/client - * - * Client-side ('use client') exports — React hooks, providers, and UI - * components. Kept separate from the main entry so server bundles don't pull in - * client-only code. - */ -export { useConsent, ConsentProvider, useConsentContext, CookieBanner, CookieButton, ConsentScript, } from '../modules/consent/client.js'; -export type { CookieBannerClassNames } from '../modules/consent/client.js'; -export { Turnstile } from '../modules/turnstile/client.js'; -export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'; -export { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js'; -export type { A11yState, A11yTexts, A11yClassNames } from '../modules/accessibility/client.js'; -export { switchLocalePath, buildLocalizedPath, getLocalizedSlugs, getLocaleCodes, } from '../modules/i18n/index.js'; -export type { LocalizedSlugs, I18nConfig } from '../modules/i18n/index.js'; -export type { TurnstileProps } from '../modules/turnstile/client.js'; -export { LocaleView } from '../modules/pages/LocaleView.js'; -export { Analytics } from '../modules/analytics/client.js'; -export type { AnalyticsProps } from '../modules/analytics/client.js'; -export { pushDataLayer } from '../modules/analytics/client.js'; -export { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js'; -export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'; -export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'; -export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'; -export { AlternateLinksProvider, useAlternateLinks, useSetAlternateLinks, AlternateLinksUpdater, LanguageSwitcher, } from '../modules/i18n/index.js'; -export type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'; -export { useForm } from '../modules/forms/useForm.js'; -export type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'; -export { useContactForm } from '../modules/forms/useContactForm.js'; -export type { ContactFormValues, ContactFormErrors, SubmitAction } from '../modules/forms/useContactForm.js'; -export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from '../modules/forms/validators.js'; -export type { Rule } from '../modules/forms/validators.js'; -export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'; -export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'; -export type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'; diff --git a/dist/exports/client.js b/dist/exports/client.js deleted file mode 100644 index 7628273..0000000 --- a/dist/exports/client.js +++ /dev/null @@ -1,29 +0,0 @@ -'use client'; -/** - * Entry point: ipal-kit/client - * - * Client-side ('use client') exports — React hooks, providers, and UI - * components. Kept separate from the main entry so server bundles don't pull in - * client-only code. - */ export { useConsent, ConsentProvider, useConsentContext, CookieBanner, CookieButton, ConsentScript } from '../modules/consent/client.js'; -export { Turnstile } from '../modules/turnstile/client.js'; -export { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'; -export { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js'; -// Pure i18n path helpers — no server/RSC deps, safe to import in client -// components (e.g. a LanguageSwitcher that computes locale URLs on the client). -export { switchLocalePath, buildLocalizedPath, getLocalizedSlugs, getLocaleCodes } from '../modules/i18n/index.js'; -export { LocaleView } from '../modules/pages/LocaleView.js'; -export { Analytics } from '../modules/analytics/client.js'; -export { pushDataLayer } from '../modules/analytics/client.js'; -export { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js'; -export { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'; -export { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'; -export { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'; -export { AlternateLinksProvider, useAlternateLinks, useSetAlternateLinks, AlternateLinksUpdater, LanguageSwitcher } from '../modules/i18n/index.js'; -export { useForm } from '../modules/forms/useForm.js'; -export { useContactForm } from '../modules/forms/useContactForm.js'; -export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from '../modules/forms/validators.js'; -export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'; -export { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'; - -//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/dist/exports/client.js.map b/dist/exports/client.js.map deleted file mode 100644 index 7045752..0000000 --- a/dist/exports/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/client.ts"],"sourcesContent":["'use client'\n/**\n * Entry point: ipal-kit/client\n *\n * Client-side ('use client') exports — React hooks, providers, and UI\n * components. Kept separate from the main entry so server bundles don't pull in\n * client-only code.\n */\nexport {\n useConsent,\n ConsentProvider,\n useConsentContext,\n CookieBanner,\n CookieButton,\n ConsentScript,\n} from '../modules/consent/client.js'\nexport type { CookieBannerClassNames } from '../modules/consent/client.js'\nexport { Turnstile } from '../modules/turnstile/client.js'\nexport { TurnstileProvider, useTurnstile } from '../modules/turnstile/client.js'\nexport { AccessibilityProvider, useAccessibility, AccessibilityWidget } from '../modules/accessibility/client.js'\nexport type { A11yState, A11yTexts, A11yClassNames } from '../modules/accessibility/client.js'\n\n// Pure i18n path helpers — no server/RSC deps, safe to import in client\n// components (e.g. a LanguageSwitcher that computes locale URLs on the client).\nexport {\n switchLocalePath,\n buildLocalizedPath,\n getLocalizedSlugs,\n getLocaleCodes,\n} from '../modules/i18n/index.js'\nexport type { LocalizedSlugs, I18nConfig } from '../modules/i18n/index.js'\nexport type { TurnstileProps } from '../modules/turnstile/client.js'\nexport { LocaleView } from '../modules/pages/LocaleView.js'\nexport { Analytics } from '../modules/analytics/client.js'\nexport type { AnalyticsProps } from '../modules/analytics/client.js'\nexport { pushDataLayer } from '../modules/analytics/client.js'\nexport { loadMetaPixel, loadClarity, loadLinkedIn, loadTikTok } from '../modules/analytics/client.js'\nexport { MaskedField } from '../globals/SiteIntegrations/components/MaskedField.js'\nexport { IntegrationStatusBanner } from '../modules/integrations/IntegrationStatusBanner.js'\nexport { TestEmailButton } from '../globals/SiteIntegrations/components/TestEmailButton.js'\nexport {\n AlternateLinksProvider,\n useAlternateLinks,\n useSetAlternateLinks,\n AlternateLinksUpdater,\n LanguageSwitcher,\n} from '../modules/i18n/index.js'\nexport type { AlternateLinks, LanguageSwitcherClassNames } from '../modules/i18n/index.js'\nexport { useForm } from '../modules/forms/useForm.js'\nexport type { FormErrors, FormSubmitAction, Validator } from '../modules/forms/useForm.js'\nexport { useContactForm } from '../modules/forms/useContactForm.js'\nexport type { ContactFormValues, ContactFormErrors, SubmitAction } from '../modules/forms/useContactForm.js'\nexport {\n buildValidator,\n isEmail,\n required,\n email,\n minLength,\n maxLength,\n checked,\n pattern,\n custom,\n} from '../modules/forms/validators.js'\nexport type { Rule } from '../modules/forms/validators.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from '../modules/forms/honeypot.js'\nexport { formAnalyticsOnSuccess } from '../modules/forms/formAnalytics.js'\nexport type { FormAnalyticsConfig } from '../modules/forms/formAnalytics.js'\n"],"names":["useConsent","ConsentProvider","useConsentContext","CookieBanner","CookieButton","ConsentScript","Turnstile","TurnstileProvider","useTurnstile","AccessibilityProvider","useAccessibility","AccessibilityWidget","switchLocalePath","buildLocalizedPath","getLocalizedSlugs","getLocaleCodes","LocaleView","Analytics","pushDataLayer","loadMetaPixel","loadClarity","loadLinkedIn","loadTikTok","MaskedField","IntegrationStatusBanner","TestEmailButton","AlternateLinksProvider","useAlternateLinks","useSetAlternateLinks","AlternateLinksUpdater","LanguageSwitcher","useForm","useContactForm","buildValidator","isEmail","required","email","minLength","maxLength","checked","pattern","custom","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","formAnalyticsOnSuccess"],"mappings":"AAAA;AACA;;;;;;CAMC,GACD,SACEA,UAAU,EACVC,eAAe,EACfC,iBAAiB,EACjBC,YAAY,EACZC,YAAY,EACZC,aAAa,QACR,+BAA8B;AAErC,SAASC,SAAS,QAAQ,iCAAgC;AAC1D,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,iCAAgC;AAChF,SAASC,qBAAqB,EAAEC,gBAAgB,EAAEC,mBAAmB,QAAQ,qCAAoC;AAGjH,wEAAwE;AACxE,gFAAgF;AAChF,SACEC,gBAAgB,EAChBC,kBAAkB,EAClBC,iBAAiB,EACjBC,cAAc,QACT,2BAA0B;AAGjC,SAASC,UAAU,QAAQ,iCAAgC;AAC3D,SAASC,SAAS,QAAQ,iCAAgC;AAE1D,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,aAAa,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,QAAQ,iCAAgC;AACrG,SAASC,WAAW,QAAQ,wDAAuD;AACnF,SAASC,uBAAuB,QAAQ,qDAAoD;AAC5F,SAASC,eAAe,QAAQ,4DAA2D;AAC3F,SACEC,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,qBAAqB,EACrBC,gBAAgB,QACX,2BAA0B;AAEjC,SAASC,OAAO,QAAQ,8BAA6B;AAErD,SAASC,cAAc,QAAQ,qCAAoC;AAEnE,SACEC,cAAc,EACdC,OAAO,EACPC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,SAAS,EACTC,OAAO,EACPC,OAAO,EACPC,MAAM,QACD,iCAAgC;AAEvC,SAASC,cAAc,EAAEC,kBAAkB,EAAEC,iBAAiB,QAAQ,+BAA8B;AACpG,SAASC,sBAAsB,QAAQ,oCAAmC"} \ No newline at end of file diff --git a/dist/exports/env.d.ts b/dist/exports/env.d.ts deleted file mode 100644 index 20237fc..0000000 --- a/dist/exports/env.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Entry point: @intecion/ipal-kit/env - * - * Environment validation ONLY — zero imports beyond this module, no Payload, - * no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next - * also compiles for the Edge runtime: importing the package root there drags in - * Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile - * doesn't exist in target module"). - * - * // src/instrumentation.ts - * import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env' - * export function register() { - * if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true })) - * } - */ -export { assertEnv, ipalEnvRules } from '../modules/env/index.js'; -export type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js'; diff --git a/dist/exports/env.js b/dist/exports/env.js deleted file mode 100644 index 001e068..0000000 --- a/dist/exports/env.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Entry point: @intecion/ipal-kit/env - * - * Environment validation ONLY — zero imports beyond this module, no Payload, - * no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next - * also compiles for the Edge runtime: importing the package root there drags in - * Payload / file-type / fs and crashes Turbopack ("Export fileTypeFromFile - * doesn't exist in target module"). - * - * // src/instrumentation.ts - * import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env' - * export function register() { - * if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true })) - * } - */ export { assertEnv, ipalEnvRules } from '../modules/env/index.js'; - -//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/dist/exports/env.js.map b/dist/exports/env.js.map deleted file mode 100644 index 3569b19..0000000 --- a/dist/exports/env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/env.ts"],"sourcesContent":["/**\n * Entry point: @intecion/ipal-kit/env\n *\n * Environment validation ONLY — zero imports beyond this module, no Payload,\n * no Node built-ins, no React. Safe for Next's instrumentation.ts, which Next\n * also compiles for the Edge runtime: importing the package root there drags in\n * Payload / file-type / fs and crashes Turbopack (\"Export fileTypeFromFile\n * doesn't exist in target module\").\n *\n * // src/instrumentation.ts\n * import { assertEnv, ipalEnvRules } from '@intecion/ipal-kit/env'\n * export function register() {\n * if (process.env.NEXT_RUNTIME === 'nodejs') assertEnv(ipalEnvRules({ storage: true }))\n * }\n */\nexport { assertEnv, ipalEnvRules } from '../modules/env/index.js'\nexport type { AssertEnvOptions, EnvKind, EnvRule, IpalEnvFeatures } from '../modules/env/index.js'\n"],"names":["assertEnv","ipalEnvRules"],"mappings":"AAAA;;;;;;;;;;;;;;CAcC,GACD,SAASA,SAAS,EAAEC,YAAY,QAAQ,0BAAyB"} \ No newline at end of file diff --git a/dist/exports/next-middleware.d.ts b/dist/exports/next-middleware.d.ts deleted file mode 100644 index a2e8d73..0000000 --- a/dist/exports/next-middleware.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Entry point: ipal-kit/next/middleware - * - * Re-exports the locale middleware factory and default matcher for use in a - * client project's middleware.ts. Kept as a thin re-export so the Next-facing - * surface is separate from the main package export. - */ -export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js'; -export type { LocaleMiddlewareResult } from '../modules/i18n/index.js'; -export { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js'; diff --git a/dist/exports/next-middleware.js b/dist/exports/next-middleware.js deleted file mode 100644 index 00268f7..0000000 --- a/dist/exports/next-middleware.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Entry point: ipal-kit/next/middleware - * - * Re-exports the locale middleware factory and default matcher for use in a - * client project's middleware.ts. Kept as a thin re-export so the Next-facing - * surface is separate from the main package export. - */ export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js'; -export { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js'; - -//# sourceMappingURL=next-middleware.js.map \ No newline at end of file diff --git a/dist/exports/next-middleware.js.map b/dist/exports/next-middleware.js.map deleted file mode 100644 index 53d10d0..0000000 --- a/dist/exports/next-middleware.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/next-middleware.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/next/middleware\n *\n * Re-exports the locale middleware factory and default matcher for use in a\n * client project's middleware.ts. Kept as a thin re-export so the Next-facing\n * surface is separate from the main package export.\n */\nexport { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from '../modules/i18n/index.js'\nexport type { LocaleMiddlewareResult } from '../modules/i18n/index.js'\nexport { createProxy, DEFAULT_PROXY_MATCHER } from '../modules/i18n/index.js'\n"],"names":["createLocaleMiddleware","DEFAULT_MIDDLEWARE_MATCHER","createProxy","DEFAULT_PROXY_MATCHER"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,sBAAsB,EAAEC,0BAA0B,QAAQ,2BAA0B;AAE7F,SAASC,WAAW,EAAEC,qBAAqB,QAAQ,2BAA0B"} \ No newline at end of file diff --git a/dist/exports/rsc.d.ts b/dist/exports/rsc.d.ts deleted file mode 100644 index 52c86e6..0000000 --- a/dist/exports/rsc.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Entry point: ipal-kit/rsc - * - * Server-component exports. RenderBlocks is a React Server Component, so it - * lives here rather than in the main package entry to keep React out of the - * server-config bundle. - */ -export { RenderBlocks } from '../modules/blocks/index.js'; -export type { BlockComponentMap, BlockData, EnhanceProps, RenderBlocksProps, } from '../modules/blocks/index.js'; -export { RenderRichText } from '../modules/richtext/index.js'; -export type { RenderRichTextProps } from '../modules/richtext/index.js'; -export { JsonLdGraph } from '../modules/seo/index.js'; -export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'; diff --git a/dist/exports/rsc.js b/dist/exports/rsc.js deleted file mode 100644 index a38ff48..0000000 --- a/dist/exports/rsc.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Entry point: ipal-kit/rsc - * - * Server-component exports. RenderBlocks is a React Server Component, so it - * lives here rather than in the main package entry to keep React out of the - * server-config bundle. - */ export { RenderBlocks } from '../modules/blocks/index.js'; -export { RenderRichText } from '../modules/richtext/index.js'; -export { JsonLdGraph } from '../modules/seo/index.js'; -export { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'; - -//# sourceMappingURL=rsc.js.map \ No newline at end of file diff --git a/dist/exports/rsc.js.map b/dist/exports/rsc.js.map deleted file mode 100644 index fe084e9..0000000 --- a/dist/exports/rsc.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/rsc.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/rsc\n *\n * Server-component exports. RenderBlocks is a React Server Component, so it\n * lives here rather than in the main package entry to keep React out of the\n * server-config bundle.\n */\nexport { RenderBlocks } from '../modules/blocks/index.js'\nexport type {\n BlockComponentMap,\n BlockData,\n EnhanceProps,\n RenderBlocksProps,\n} from '../modules/blocks/index.js'\nexport { RenderRichText } from '../modules/richtext/index.js'\nexport type { RenderRichTextProps } from '../modules/richtext/index.js'\nexport { JsonLdGraph } from '../modules/seo/index.js'\nexport { MediaPreconnect } from '../modules/storage/MediaPreconnect.js'\n"],"names":["RenderBlocks","RenderRichText","JsonLdGraph","MediaPreconnect"],"mappings":"AAAA;;;;;;CAMC,GACD,SAASA,YAAY,QAAQ,6BAA4B;AAOzD,SAASC,cAAc,QAAQ,+BAA8B;AAE7D,SAASC,WAAW,QAAQ,0BAAyB;AACrD,SAASC,eAAe,QAAQ,wCAAuC"} \ No newline at end of file diff --git a/dist/exports/server.d.ts b/dist/exports/server.d.ts deleted file mode 100644 index 80d6e76..0000000 --- a/dist/exports/server.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Entry point: ipal-kit/server - * - * Server-only runtime functions — these import 'server-only' (Turnstile secret, - * SMTP password, nodemailer). Kept OUT of the main entry so that loading the - * Payload config or running `payload generate:importmap` (both Node scripts, - * no bundler) never pulls in 'server-only', which throws outside a bundled - * server context. - * - * Import these only from Server Actions, route handlers, or server components — - * never from the Payload config or client code. - */ -export { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js'; -export type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js'; -export { sendEmail } from '../modules/email/index.js'; -export type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'; -export { submitForm } from '../modules/forms/index.js'; -export type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'; diff --git a/dist/exports/server.js b/dist/exports/server.js deleted file mode 100644 index 38d31d3..0000000 --- a/dist/exports/server.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Entry point: ipal-kit/server - * - * Server-only runtime functions — these import 'server-only' (Turnstile secret, - * SMTP password, nodemailer). Kept OUT of the main entry so that loading the - * Payload config or running `payload generate:importmap` (both Node scripts, - * no bundler) never pulls in 'server-only', which throws outside a bundled - * server context. - * - * Import these only from Server Actions, route handlers, or server components — - * never from the Payload config or client code. - */ export { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js'; -export { sendEmail } from '../modules/email/index.js'; -export { submitForm } from '../modules/forms/index.js'; - -//# sourceMappingURL=server.js.map \ No newline at end of file diff --git a/dist/exports/server.js.map b/dist/exports/server.js.map deleted file mode 100644 index fc9e7af..0000000 --- a/dist/exports/server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../src/exports/server.ts"],"sourcesContent":["/**\n * Entry point: ipal-kit/server\n *\n * Server-only runtime functions — these import 'server-only' (Turnstile secret,\n * SMTP password, nodemailer). Kept OUT of the main entry so that loading the\n * Payload config or running `payload generate:importmap` (both Node scripts,\n * no bundler) never pulls in 'server-only', which throws outside a bundled\n * server context.\n *\n * Import these only from Server Actions, route handlers, or server components —\n * never from the Payload config or client code.\n */\nexport { verifyTurnstile, checkTurnstile } from '../modules/turnstile/index.js'\nexport type { TurnstileCheck, TurnstileOutcome } from '../modules/turnstile/index.js'\nexport { sendEmail } from '../modules/email/index.js'\nexport type { SendEmailArgs, SendEmailResult } from '../modules/email/index.js'\nexport { submitForm } from '../modules/forms/index.js'\nexport type { SubmitFormArgs, SubmitFormResult } from '../modules/forms/index.js'\n"],"names":["verifyTurnstile","checkTurnstile","sendEmail","submitForm"],"mappings":"AAAA;;;;;;;;;;;CAWC,GACD,SAASA,eAAe,EAAEC,cAAc,QAAQ,gCAA+B;AAE/E,SAASC,SAAS,QAAQ,4BAA2B;AAErD,SAASC,UAAU,QAAQ,4BAA2B"} \ No newline at end of file diff --git a/dist/globals/CookieSettings/fields.d.ts b/dist/globals/CookieSettings/fields.d.ts deleted file mode 100644 index 30c4792..0000000 --- a/dist/globals/CookieSettings/fields.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Field } from 'payload'; -/** - * Fields for the CookieSettings global — GDPR consent banner copy, editable - * per locale. The privacy-policy link TARGET is NOT stored here: it comes from - * the pages module (system page role 'privacyPolicy'), keeping one source of - * truth. Only the link's visible text lives here (privacyLinkLabel). - */ -export declare const cookieSettingsFields: Field[]; diff --git a/dist/globals/CookieSettings/fields.js b/dist/globals/CookieSettings/fields.js deleted file mode 100644 index 1011e1d..0000000 --- a/dist/globals/CookieSettings/fields.js +++ /dev/null @@ -1,96 +0,0 @@ -import { CONSENT_CATEGORIES } from '../../modules/consent/categories.js'; -/** - * Fields for the CookieSettings global — GDPR consent banner copy, editable - * per locale. The privacy-policy link TARGET is NOT stored here: it comes from - * the pages module (system page role 'privacyPolicy'), keeping one source of - * truth. Only the link's visible text lives here (privacyLinkLabel). - */ export const cookieSettingsFields = [ - { - name: 'message', - type: 'textarea', - admin: { - description: 'Main consent message shown in the banner.' - }, - localized: true - }, - { - name: 'settingsTitle', - type: 'text', - admin: { - description: 'Heading for the detailed settings panel.' - }, - localized: true - }, - { - name: 'privacyLinkLabel', - type: 'text', - admin: { - description: 'Text of the privacy-policy link in the banner, e.g. "Privacy policy". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.' - }, - localized: true - }, - { - name: 'buttons', - type: 'group', - admin: { - description: 'Button labels.' - }, - fields: [ - { - name: 'acceptAll', - type: 'text', - localized: true - }, - { - name: 'reject', - type: 'text', - localized: true - }, - { - name: 'settings', - type: 'text', - localized: true - }, - { - name: 'save', - type: 'text', - localized: true - }, - { - name: 'back', - type: 'text', - localized: true - } - ] - }, - { - name: 'categories', - type: 'array', - admin: { - description: 'Per-category titles and descriptions.' - }, - fields: [ - { - name: 'key', - type: 'select', - options: CONSENT_CATEGORIES.map((c)=>({ - label: c, - value: c - })), - required: true - }, - { - name: 'title', - type: 'text', - localized: true - }, - { - name: 'description', - type: 'textarea', - localized: true - } - ] - } -]; - -//# sourceMappingURL=fields.js.map \ No newline at end of file diff --git a/dist/globals/CookieSettings/fields.js.map b/dist/globals/CookieSettings/fields.js.map deleted file mode 100644 index 55c9921..0000000 --- a/dist/globals/CookieSettings/fields.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/CookieSettings/fields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { CONSENT_CATEGORIES } from '../../modules/consent/categories.js'\n\n/**\n * Fields for the CookieSettings global — GDPR consent banner copy, editable\n * per locale. The privacy-policy link TARGET is NOT stored here: it comes from\n * the pages module (system page role 'privacyPolicy'), keeping one source of\n * truth. Only the link's visible text lives here (privacyLinkLabel).\n */\nexport const cookieSettingsFields: Field[] = [\n {\n name: 'message',\n type: 'textarea',\n admin: {\n description: 'Main consent message shown in the banner.',\n },\n localized: true,\n },\n {\n name: 'settingsTitle',\n type: 'text',\n admin: {\n description: 'Heading for the detailed settings panel.',\n },\n localized: true,\n },\n {\n name: 'privacyLinkLabel',\n type: 'text',\n admin: {\n description:\n 'Text of the privacy-policy link in the banner, e.g. \"Privacy policy\". The link target is the page assigned as Privacy Policy in Site Settings → System Pages. Empty → the page title is used.',\n },\n localized: true,\n },\n {\n name: 'buttons',\n type: 'group',\n admin: {\n description: 'Button labels.',\n },\n fields: [\n { name: 'acceptAll', type: 'text', localized: true },\n { name: 'reject', type: 'text', localized: true },\n { name: 'settings', type: 'text', localized: true },\n { name: 'save', type: 'text', localized: true },\n { name: 'back', type: 'text', localized: true },\n ],\n },\n {\n name: 'categories',\n type: 'array',\n admin: {\n description: 'Per-category titles and descriptions.',\n },\n fields: [\n {\n name: 'key',\n type: 'select',\n options: CONSENT_CATEGORIES.map((c) => ({ label: c, value: c })),\n required: true,\n },\n { name: 'title', type: 'text', localized: true },\n { name: 'description', type: 'textarea', localized: true },\n ],\n },\n]\n"],"names":["CONSENT_CATEGORIES","cookieSettingsFields","name","type","admin","description","localized","fields","options","map","c","label","value","required"],"mappings":"AAEA,SAASA,kBAAkB,QAAQ,sCAAqC;AAExE;;;;;CAKC,GACD,OAAO,MAAMC,uBAAgC;IAC3C;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAE,QAAQ;YACN;gBAAEL,MAAM;gBAAaC,MAAM;gBAAQG,WAAW;YAAK;YACnD;gBAAEJ,MAAM;gBAAUC,MAAM;gBAAQG,WAAW;YAAK;YAChD;gBAAEJ,MAAM;gBAAYC,MAAM;gBAAQG,WAAW;YAAK;YAClD;gBAAEJ,MAAM;gBAAQC,MAAM;gBAAQG,WAAW;YAAK;YAC9C;gBAAEJ,MAAM;gBAAQC,MAAM;gBAAQG,WAAW;YAAK;SAC/C;IACH;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAE,QAAQ;YACN;gBACEL,MAAM;gBACNC,MAAM;gBACNK,SAASR,mBAAmBS,GAAG,CAAC,CAACC,IAAO,CAAA;wBAAEC,OAAOD;wBAAGE,OAAOF;oBAAE,CAAA;gBAC7DG,UAAU;YACZ;YACA;gBAAEX,MAAM;gBAASC,MAAM;gBAAQG,WAAW;YAAK;YAC/C;gBAAEJ,MAAM;gBAAeC,MAAM;gBAAYG,WAAW;YAAK;SAC1D;IACH;CACD,CAAA"} \ No newline at end of file diff --git a/dist/globals/CookieSettings/index.d.ts b/dist/globals/CookieSettings/index.d.ts deleted file mode 100644 index 3e21127..0000000 --- a/dist/globals/CookieSettings/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { GlobalConfig } from 'payload'; -/** - * Builds the CookieSettings global — consent banner copy managed by editors. - * Public read (the banner needs it on the frontend for anonymous visitors). - */ -export declare function buildCookieSettings(): GlobalConfig; diff --git a/dist/globals/CookieSettings/index.js b/dist/globals/CookieSettings/index.js deleted file mode 100644 index eef7b2f..0000000 --- a/dist/globals/CookieSettings/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import { cookieSettingsFields } from './fields.js'; -/** - * Builds the CookieSettings global — consent banner copy managed by editors. - * Public read (the banner needs it on the frontend for anonymous visitors). - */ export function buildCookieSettings() { - return { - slug: 'cookie-settings', - access: { - read: ()=>true - }, - admin: { - group: 'Settings' - }, - fields: cookieSettingsFields, - label: 'Cookie Settings' - }; -} - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/globals/CookieSettings/index.js.map b/dist/globals/CookieSettings/index.js.map deleted file mode 100644 index f2c58d5..0000000 --- a/dist/globals/CookieSettings/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/CookieSettings/index.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload'\n\nimport { cookieSettingsFields } from './fields.js'\n\n/**\n * Builds the CookieSettings global — consent banner copy managed by editors.\n * Public read (the banner needs it on the frontend for anonymous visitors).\n */\nexport function buildCookieSettings(): GlobalConfig {\n return {\n slug: 'cookie-settings',\n access: {\n read: () => true,\n },\n admin: {\n group: 'Settings',\n },\n fields: cookieSettingsFields,\n label: 'Cookie Settings',\n }\n}\n"],"names":["cookieSettingsFields","buildCookieSettings","slug","access","read","admin","group","fields","label"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,cAAa;AAElD;;;CAGC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQP;QACRQ,OAAO;IACT;AACF"} \ No newline at end of file diff --git a/dist/globals/Notifications/fields.d.ts b/dist/globals/Notifications/fields.d.ts deleted file mode 100644 index ea36397..0000000 --- a/dist/globals/Notifications/fields.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { Field } from 'payload'; -/** - * Fields for the Notifications global — localized user-facing texts for action - * results (form submission outcomes, and future contexts). Every text is - * localized: true so each language has its own value. Empty fields fall back to - * built-in English defaults (see modules/notifications/defaults). - * - * Grouped per context. `form` holds the outcomes of submitForm; more groups - * (e.g. `newsletter`, `system`) can be added the same way without touching - * consumers — getNotificationTexts resolves whatever exists, falling back - * per field. - */ -export declare const notificationsFields: Field[]; diff --git a/dist/globals/Notifications/fields.js b/dist/globals/Notifications/fields.js deleted file mode 100644 index 3aef297..0000000 --- a/dist/globals/Notifications/fields.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Fields for the Notifications global — localized user-facing texts for action - * results (form submission outcomes, and future contexts). Every text is - * localized: true so each language has its own value. Empty fields fall back to - * built-in English defaults (see modules/notifications/defaults). - * - * Grouped per context. `form` holds the outcomes of submitForm; more groups - * (e.g. `newsletter`, `system`) can be added the same way without touching - * consumers — getNotificationTexts resolves whatever exists, falling back - * per field. - */ export const notificationsFields = [ - { - name: 'form', - type: 'group', - admin: { - description: 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.' - }, - fields: [ - { - name: 'success', - type: 'text', - admin: { - placeholder: 'Thank you — your message has been sent.' - }, - localized: true - }, - { - name: 'error', - type: 'text', - admin: { - placeholder: 'Something went wrong. Please try again later.' - }, - localized: true - }, - { - name: 'rateLimited', - type: 'text', - admin: { - placeholder: 'Too many attempts. Please wait a moment and try again.' - }, - localized: true - }, - { - name: 'turnstile', - type: 'text', - admin: { - placeholder: 'Captcha verification failed. Please try again.' - }, - localized: true - }, - { - name: 'validation', - type: 'text', - admin: { - description: 'Shown on a validation error. Use {field} to insert the offending field name.', - placeholder: 'Please check the {field} field and try again.' - }, - localized: true - }, - { - name: 'consent', - type: 'text', - admin: { - description: 'Shown when the GDPR consent checkbox is left unchecked.', - placeholder: 'Please accept the privacy policy to continue.' - }, - localized: true - }, - { - name: 'notFound', - type: 'text', - admin: { - placeholder: 'This form is no longer available.' - }, - localized: true - } - ], - label: 'Form messages' - } -]; - -//# sourceMappingURL=fields.js.map \ No newline at end of file diff --git a/dist/globals/Notifications/fields.js.map b/dist/globals/Notifications/fields.js.map deleted file mode 100644 index 32d8013..0000000 --- a/dist/globals/Notifications/fields.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/Notifications/fields.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Fields for the Notifications global — localized user-facing texts for action\n * results (form submission outcomes, and future contexts). Every text is\n * localized: true so each language has its own value. Empty fields fall back to\n * built-in English defaults (see modules/notifications/defaults).\n *\n * Grouped per context. `form` holds the outcomes of submitForm; more groups\n * (e.g. `newsletter`, `system`) can be added the same way without touching\n * consumers — getNotificationTexts resolves whatever exists, falling back\n * per field.\n */\nexport const notificationsFields: Field[] = [\n {\n name: 'form',\n type: 'group',\n admin: {\n description:\n 'Messages shown after a form is submitted. Leave a field empty to use the built-in default.',\n },\n fields: [\n {\n name: 'success',\n type: 'text',\n admin: { placeholder: 'Thank you — your message has been sent.' },\n localized: true,\n },\n {\n name: 'error',\n type: 'text',\n admin: { placeholder: 'Something went wrong. Please try again later.' },\n localized: true,\n },\n {\n name: 'rateLimited',\n type: 'text',\n admin: { placeholder: 'Too many attempts. Please wait a moment and try again.' },\n localized: true,\n },\n {\n name: 'turnstile',\n type: 'text',\n admin: { placeholder: 'Captcha verification failed. Please try again.' },\n localized: true,\n },\n {\n name: 'validation',\n type: 'text',\n admin: {\n description:\n 'Shown on a validation error. Use {field} to insert the offending field name.',\n placeholder: 'Please check the {field} field and try again.',\n },\n localized: true,\n },\n {\n name: 'consent',\n type: 'text',\n admin: {\n description: 'Shown when the GDPR consent checkbox is left unchecked.',\n placeholder: 'Please accept the privacy policy to continue.',\n },\n localized: true,\n },\n {\n name: 'notFound',\n type: 'text',\n admin: { placeholder: 'This form is no longer available.' },\n localized: true,\n },\n ],\n label: 'Form messages',\n },\n]\n"],"names":["notificationsFields","name","type","admin","description","fields","placeholder","localized","label"],"mappings":"AAEA;;;;;;;;;;CAUC,GACD,OAAO,MAAMA,sBAA+B;IAC1C;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,QAAQ;YACN;gBACEJ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAA0C;gBAChEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAgD;gBACtEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAyD;gBAC/EC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAiD;gBACvEC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aACE;oBACFE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBACLC,aAAa;oBACbE,aAAa;gBACf;gBACAC,WAAW;YACb;YACA;gBACEN,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEG,aAAa;gBAAoC;gBAC1DC,WAAW;YACb;SACD;QACDC,OAAO;IACT;CACD,CAAA"} \ No newline at end of file diff --git a/dist/globals/Notifications/index.d.ts b/dist/globals/Notifications/index.d.ts deleted file mode 100644 index 97d970e..0000000 --- a/dist/globals/Notifications/index.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { GlobalConfig } from 'payload'; -/** - * Builds the Notifications global — localized action-result texts. Readable by - * any authenticated panel user; server-side helpers read it with overrideAccess - * so the frontend can resolve texts without a session. - */ -export declare function buildNotifications(): GlobalConfig; diff --git a/dist/globals/Notifications/index.js b/dist/globals/Notifications/index.js deleted file mode 100644 index ad49331..0000000 --- a/dist/globals/Notifications/index.js +++ /dev/null @@ -1,20 +0,0 @@ -import { notificationsFields } from './fields.js'; -/** - * Builds the Notifications global — localized action-result texts. Readable by - * any authenticated panel user; server-side helpers read it with overrideAccess - * so the frontend can resolve texts without a session. - */ export function buildNotifications() { - return { - slug: 'notifications', - label: 'Notifications', - admin: { - group: 'Settings' - }, - access: { - read: ()=>true - }, - fields: notificationsFields - }; -} - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/globals/Notifications/index.js.map b/dist/globals/Notifications/index.js.map deleted file mode 100644 index 3bbf8d4..0000000 --- a/dist/globals/Notifications/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/Notifications/index.ts"],"sourcesContent":["import type { GlobalConfig } from 'payload'\nimport { notificationsFields } from './fields.js'\n\n/**\n * Builds the Notifications global — localized action-result texts. Readable by\n * any authenticated panel user; server-side helpers read it with overrideAccess\n * so the frontend can resolve texts without a session.\n */\nexport function buildNotifications(): GlobalConfig {\n return {\n slug: 'notifications',\n label: 'Notifications',\n admin: { group: 'Settings' },\n access: {\n read: () => true, // texts are public-facing (shown to end users)\n },\n fields: notificationsFields,\n }\n}\n"],"names":["notificationsFields","buildNotifications","slug","label","admin","group","access","read","fields"],"mappings":"AACA,SAASA,mBAAmB,QAAQ,cAAa;AAEjD;;;;CAIC,GACD,OAAO,SAASC;IACd,OAAO;QACLC,MAAM;QACNC,OAAO;QACPC,OAAO;YAAEC,OAAO;QAAW;QAC3BC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,QAAQR;IACV;AACF"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/components/MaskedField.d.ts b/dist/globals/SiteIntegrations/components/MaskedField.d.ts deleted file mode 100644 index 3dd3a74..0000000 --- a/dist/globals/SiteIntegrations/components/MaskedField.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { TextFieldClientComponent } from 'payload'; -/** - * Masked text input for sensitive values (SMTP password, R2 secret key, - * Turnstile secret key, etc.). - * - * Renders the value as a password field (••••) so secrets aren't shown in - * plaintext on screen — protecting against shoulder-surfing and accidental - * exposure when the panel is open. The value is still stored and returned - * normally (UI masking, NOT hashing or encryption), because the plugin must - * read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the - * value when an authorised editor genuinely needs to check it. - * - * Uses a raw driven by useField rather than @payloadcms/ui's TextInput, - * because TextInput doesn't expose inputProps, so there's no way to switch its - * inner input to type="password". - * - * Assigned via a field's admin.components.Field. Works on any `text` field. - */ -export declare const MaskedField: TextFieldClientComponent; -export default MaskedField; diff --git a/dist/globals/SiteIntegrations/components/MaskedField.js b/dist/globals/SiteIntegrations/components/MaskedField.js deleted file mode 100644 index d50c3fa..0000000 --- a/dist/globals/SiteIntegrations/components/MaskedField.js +++ /dev/null @@ -1,80 +0,0 @@ -'use client'; -import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; -import { useField, FieldLabel, FieldDescription } from '@payloadcms/ui'; -import { useState } from 'react'; -/** - * Masked text input for sensitive values (SMTP password, R2 secret key, - * Turnstile secret key, etc.). - * - * Renders the value as a password field (••••) so secrets aren't shown in - * plaintext on screen — protecting against shoulder-surfing and accidental - * exposure when the panel is open. The value is still stored and returned - * normally (UI masking, NOT hashing or encryption), because the plugin must - * read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the - * value when an authorised editor genuinely needs to check it. - * - * Uses a raw driven by useField rather than @payloadcms/ui's TextInput, - * because TextInput doesn't expose inputProps, so there's no way to switch its - * inner input to type="password". - * - * Assigned via a field's admin.components.Field. Works on any `text` field. - */ export const MaskedField = ({ field, path })=>{ - const { value, setValue } = useField({ - path - }); - const [revealed, setRevealed] = useState(false); - const label = typeof field?.label === 'string' ? field.label : field?.name ?? path; - const description = field?.admin?.description; - return /*#__PURE__*/ _jsxs("div", { - className: "field-type text masked-field", - children: [ - /*#__PURE__*/ _jsx(FieldLabel, { - label: label, - htmlFor: `field-${path}` - }), - /*#__PURE__*/ _jsxs("div", { - className: "field-type__wrap", - style: { - display: 'flex', - gap: '.5rem', - alignItems: 'center' - }, - children: [ - /*#__PURE__*/ _jsx("input", { - id: `field-${path}`, - type: revealed ? 'text' : 'password', - autoComplete: "off", - className: "field-type__input", - value: value ?? '', - onChange: (e)=>setValue(e.target.value), - style: { - flex: 1 - } - }), - /*#__PURE__*/ _jsx("button", { - type: "button", - onClick: ()=>setRevealed((r)=>!r), - style: { - background: 'none', - border: 'none', - padding: '.25rem .5rem', - cursor: 'pointer', - font: 'inherit', - textDecoration: 'underline', - opacity: 0.75, - whiteSpace: 'nowrap' - }, - children: revealed ? 'Hide' : 'Reveal' - }) - ] - }), - description && typeof description === 'string' ? /*#__PURE__*/ _jsx(FieldDescription, { - path: path, - description: description - }) : null - ] - }); -}; -export default MaskedField; - -//# sourceMappingURL=MaskedField.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/components/MaskedField.js.map b/dist/globals/SiteIntegrations/components/MaskedField.js.map deleted file mode 100644 index a8811a1..0000000 --- a/dist/globals/SiteIntegrations/components/MaskedField.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/MaskedField.tsx"],"sourcesContent":["'use client'\n\nimport { useField, FieldLabel, FieldDescription } from '@payloadcms/ui'\nimport { useState } from 'react'\nimport type { TextFieldClientComponent } from 'payload'\n\n/**\n * Masked text input for sensitive values (SMTP password, R2 secret key,\n * Turnstile secret key, etc.).\n *\n * Renders the value as a password field (••••) so secrets aren't shown in\n * plaintext on screen — protecting against shoulder-surfing and accidental\n * exposure when the panel is open. The value is still stored and returned\n * normally (UI masking, NOT hashing or encryption), because the plugin must\n * read it back to authenticate with SMTP/R2/Turnstile. A toggle reveals the\n * value when an authorised editor genuinely needs to check it.\n *\n * Uses a raw driven by useField rather than @payloadcms/ui's TextInput,\n * because TextInput doesn't expose inputProps, so there's no way to switch its\n * inner input to type=\"password\".\n *\n * Assigned via a field's admin.components.Field. Works on any `text` field.\n */\nexport const MaskedField: TextFieldClientComponent = ({ field, path }) => {\n const { value, setValue } = useField({ path })\n const [revealed, setRevealed] = useState(false)\n\n const label =\n typeof field?.label === 'string' ? field.label : (field?.name ?? path)\n const description = field?.admin?.description\n\n return (\n
\n \n\n
\n setValue(e.target.value)}\n style={{ flex: 1 }}\n />\n setRevealed((r) => !r)}\n style={{\n background: 'none',\n border: 'none',\n padding: '.25rem .5rem',\n cursor: 'pointer',\n font: 'inherit',\n textDecoration: 'underline',\n opacity: 0.75,\n whiteSpace: 'nowrap',\n }}\n >\n {revealed ? 'Hide' : 'Reveal'}\n \n
\n\n {description && typeof description === 'string' ? (\n \n ) : null}\n
\n )\n}\n\nexport default MaskedField\n"],"names":["useField","FieldLabel","FieldDescription","useState","MaskedField","field","path","value","setValue","revealed","setRevealed","label","name","description","admin","div","className","htmlFor","style","display","gap","alignItems","input","id","type","autoComplete","onChange","e","target","flex","button","onClick","r","background","border","padding","cursor","font","textDecoration","opacity","whiteSpace"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,iBAAgB;AACvE,SAASC,QAAQ,QAAQ,QAAO;AAGhC;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,MAAMC,cAAwC,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE;IACnE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGR,SAAiB;QAAEM;IAAK;IACpD,MAAM,CAACG,UAAUC,YAAY,GAAGP,SAAS;IAEzC,MAAMQ,QACJ,OAAON,OAAOM,UAAU,WAAWN,MAAMM,KAAK,GAAIN,OAAOO,QAAQN;IACnE,MAAMO,cAAcR,OAAOS,OAAOD;IAElC,qBACE,MAACE;QAAIC,WAAU;;0BACb,KAACf;gBAAWU,OAAOA;gBAAOM,SAAS,CAAC,MAAM,EAAEX,MAAM;;0BAElD,MAACS;gBAAIC,WAAU;gBAAmBE,OAAO;oBAAEC,SAAS;oBAAQC,KAAK;oBAASC,YAAY;gBAAS;;kCAC7F,KAACC;wBACCC,IAAI,CAAC,MAAM,EAAEjB,MAAM;wBACnBkB,MAAMf,WAAW,SAAS;wBAC1BgB,cAAa;wBACbT,WAAU;wBACVT,OAAOA,SAAS;wBAChBmB,UAAU,CAACC,IAAMnB,SAASmB,EAAEC,MAAM,CAACrB,KAAK;wBACxCW,OAAO;4BAAEW,MAAM;wBAAE;;kCAEnB,KAACC;wBACCN,MAAK;wBACLO,SAAS,IAAMrB,YAAY,CAACsB,IAAM,CAACA;wBACnCd,OAAO;4BACLe,YAAY;4BACZC,QAAQ;4BACRC,SAAS;4BACTC,QAAQ;4BACRC,MAAM;4BACNC,gBAAgB;4BAChBC,SAAS;4BACTC,YAAY;wBACd;kCAEC/B,WAAW,SAAS;;;;YAIxBI,eAAe,OAAOA,gBAAgB,yBACrC,KAACX;gBAAiBI,MAAMA;gBAAMO,aAAaA;iBACzC;;;AAGV,EAAC;AAED,eAAeT,YAAW"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/components/TestEmailButton.d.ts b/dist/globals/SiteIntegrations/components/TestEmailButton.d.ts deleted file mode 100644 index ceedc7e..0000000 --- a/dist/globals/SiteIntegrations/components/TestEmailButton.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Admin UI: a small "send test email" tool for the SiteIntegrations email tab. - * Enter an address, click Send, and it POSTs to /api/ipal/test-email, which - * sends through the currently-selected transport (SMTP or Graph). Shows the - * result inline so you can confirm delivery — or read the exact error — without - * leaving the panel. - * - * Assigned via a `ui` field's admin.components.Field. - */ -export declare const TestEmailButton: () => import("react/jsx-runtime").JSX.Element; -export default TestEmailButton; diff --git a/dist/globals/SiteIntegrations/components/TestEmailButton.js b/dist/globals/SiteIntegrations/components/TestEmailButton.js deleted file mode 100644 index 9890598..0000000 --- a/dist/globals/SiteIntegrations/components/TestEmailButton.js +++ /dev/null @@ -1,131 +0,0 @@ -'use client'; -import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; -import { useState } from 'react'; -/** - * Admin UI: a small "send test email" tool for the SiteIntegrations email tab. - * Enter an address, click Send, and it POSTs to /api/ipal/test-email, which - * sends through the currently-selected transport (SMTP or Graph). Shows the - * result inline so you can confirm delivery — or read the exact error — without - * leaving the panel. - * - * Assigned via a `ui` field's admin.components.Field. - */ export const TestEmailButton = ()=>{ - const [to, setTo] = useState(''); - const [status, setStatus] = useState({ - kind: 'idle' - }); - const send = async ()=>{ - if (!to.trim()) { - setStatus({ - kind: 'error', - msg: 'Enter a recipient address.' - }); - return; - } - setStatus({ - kind: 'sending' - }); - try { - const res = await fetch('/api/ipal/test-email', { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - credentials: 'include', - body: JSON.stringify({ - to: to.trim() - }) - }); - const data = await res.json(); - if (data.ok) { - setStatus({ - kind: 'ok', - msg: data.message ?? 'Test email sent.' - }); - } else { - setStatus({ - kind: 'error', - msg: data.error ?? 'Send failed.' - }); - } - } catch { - setStatus({ - kind: 'error', - msg: 'Request failed. Is the server running?' - }); - } - }; - return /*#__PURE__*/ _jsxs("div", { - className: "field-type", - style: { - marginTop: '1rem' - }, - children: [ - /*#__PURE__*/ _jsx("label", { - className: "field-label", - children: "Send a test email" - }), - /*#__PURE__*/ _jsx("p", { - style: { - opacity: 0.7, - fontSize: '.85rem', - marginTop: 0 - }, - children: "Sends through the transport selected above. Save your changes first." - }), - /*#__PURE__*/ _jsxs("div", { - style: { - display: 'flex', - gap: '.5rem', - alignItems: 'center', - flexWrap: 'wrap' - }, - children: [ - /*#__PURE__*/ _jsx("input", { - type: "email", - placeholder: "you@example.com", - value: to, - onChange: (e)=>setTo(e.target.value), - style: { - flex: 1, - minWidth: '220px' - } - }), - /*#__PURE__*/ _jsx("button", { - type: "button", - onClick: send, - disabled: status.kind === 'sending', - className: "btn btn--style-secondary", - style: { - whiteSpace: 'nowrap' - }, - children: status.kind === 'sending' ? 'Sending…' : 'Send test' - }) - ] - }), - status.kind === 'ok' && /*#__PURE__*/ _jsxs("p", { - style: { - color: 'var(--theme-success-500, green)', - marginTop: '.5rem' - }, - children: [ - "✓ ", - status.msg - ] - }), - status.kind === 'error' && /*#__PURE__*/ _jsxs("p", { - style: { - color: 'var(--theme-error-500, crimson)', - marginTop: '.5rem' - }, - children: [ - "✗ ", - status.msg - ] - }) - ] - }); -}; -export default TestEmailButton; - -//# sourceMappingURL=TestEmailButton.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/components/TestEmailButton.js.map b/dist/globals/SiteIntegrations/components/TestEmailButton.js.map deleted file mode 100644 index 6430388..0000000 --- a/dist/globals/SiteIntegrations/components/TestEmailButton.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/components/TestEmailButton.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\n/**\n * Admin UI: a small \"send test email\" tool for the SiteIntegrations email tab.\n * Enter an address, click Send, and it POSTs to /api/ipal/test-email, which\n * sends through the currently-selected transport (SMTP or Graph). Shows the\n * result inline so you can confirm delivery — or read the exact error — without\n * leaving the panel.\n *\n * Assigned via a `ui` field's admin.components.Field.\n */\nexport const TestEmailButton = () => {\n const [to, setTo] = useState('')\n const [status, setStatus] = useState<\n { kind: 'idle' } | { kind: 'sending' } | { kind: 'ok'; msg: string } | { kind: 'error'; msg: string }\n >({ kind: 'idle' })\n\n const send = async () => {\n if (!to.trim()) {\n setStatus({ kind: 'error', msg: 'Enter a recipient address.' })\n return\n }\n setStatus({ kind: 'sending' })\n try {\n const res = await fetch('/api/ipal/test-email', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n credentials: 'include',\n body: JSON.stringify({ to: to.trim() }),\n })\n const data = await res.json()\n if (data.ok) {\n setStatus({ kind: 'ok', msg: data.message ?? 'Test email sent.' })\n } else {\n setStatus({ kind: 'error', msg: data.error ?? 'Send failed.' })\n }\n } catch {\n setStatus({ kind: 'error', msg: 'Request failed. Is the server running?' })\n }\n }\n\n return (\n
\n \n

\n Sends through the transport selected above. Save your changes first.\n

\n
\n setTo(e.target.value)}\n style={{ flex: 1, minWidth: '220px' }}\n />\n \n {status.kind === 'sending' ? 'Sending…' : 'Send test'}\n \n
\n {status.kind === 'ok' && (\n

\n ✓ {status.msg}\n

\n )}\n {status.kind === 'error' && (\n

\n ✗ {status.msg}\n

\n )}\n
\n )\n}\n\nexport default TestEmailButton\n"],"names":["useState","TestEmailButton","to","setTo","status","setStatus","kind","send","trim","msg","res","fetch","method","headers","credentials","body","JSON","stringify","data","json","ok","message","error","div","className","style","marginTop","label","p","opacity","fontSize","display","gap","alignItems","flexWrap","input","type","placeholder","value","onChange","e","target","flex","minWidth","button","onClick","disabled","whiteSpace","color"],"mappings":"AAAA;;AAEA,SAASA,QAAQ,QAAQ,QAAO;AAEhC;;;;;;;;CAQC,GACD,OAAO,MAAMC,kBAAkB;IAC7B,MAAM,CAACC,IAAIC,MAAM,GAAGH,SAAS;IAC7B,MAAM,CAACI,QAAQC,UAAU,GAAGL,SAE1B;QAAEM,MAAM;IAAO;IAEjB,MAAMC,OAAO;QACX,IAAI,CAACL,GAAGM,IAAI,IAAI;YACdH,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAA6B;YAC7D;QACF;QACAJ,UAAU;YAAEC,MAAM;QAAU;QAC5B,IAAI;YACF,MAAMI,MAAM,MAAMC,MAAM,wBAAwB;gBAC9CC,QAAQ;gBACRC,SAAS;oBAAE,gBAAgB;gBAAmB;gBAC9CC,aAAa;gBACbC,MAAMC,KAAKC,SAAS,CAAC;oBAAEf,IAAIA,GAAGM,IAAI;gBAAG;YACvC;YACA,MAAMU,OAAO,MAAMR,IAAIS,IAAI;YAC3B,IAAID,KAAKE,EAAE,EAAE;gBACXf,UAAU;oBAAEC,MAAM;oBAAMG,KAAKS,KAAKG,OAAO,IAAI;gBAAmB;YAClE,OAAO;gBACLhB,UAAU;oBAAEC,MAAM;oBAASG,KAAKS,KAAKI,KAAK,IAAI;gBAAe;YAC/D;QACF,EAAE,OAAM;YACNjB,UAAU;gBAAEC,MAAM;gBAASG,KAAK;YAAyC;QAC3E;IACF;IAEA,qBACE,MAACc;QAAIC,WAAU;QAAaC,OAAO;YAAEC,WAAW;QAAO;;0BACrD,KAACC;gBAAMH,WAAU;0BAAc;;0BAC/B,KAACI;gBAAEH,OAAO;oBAAEI,SAAS;oBAAKC,UAAU;oBAAUJ,WAAW;gBAAE;0BAAG;;0BAG9D,MAACH;gBAAIE,OAAO;oBAAEM,SAAS;oBAAQC,KAAK;oBAASC,YAAY;oBAAUC,UAAU;gBAAO;;kCAClF,KAACC;wBACCC,MAAK;wBACLC,aAAY;wBACZC,OAAOpC;wBACPqC,UAAU,CAACC,IAAMrC,MAAMqC,EAAEC,MAAM,CAACH,KAAK;wBACrCb,OAAO;4BAAEiB,MAAM;4BAAGC,UAAU;wBAAQ;;kCAEtC,KAACC;wBACCR,MAAK;wBACLS,SAAStC;wBACTuC,UAAU1C,OAAOE,IAAI,KAAK;wBAC1BkB,WAAU;wBACVC,OAAO;4BAAEsB,YAAY;wBAAS;kCAE7B3C,OAAOE,IAAI,KAAK,YAAY,aAAa;;;;YAG7CF,OAAOE,IAAI,KAAK,sBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;YAGhBL,OAAOE,IAAI,KAAK,yBACf,MAACsB;gBAAEH,OAAO;oBAAEuB,OAAO;oBAAmCtB,WAAW;gBAAQ;;oBAAG;oBACvEtB,OAAOK,GAAG;;;;;AAKvB,EAAC;AAED,eAAeR,gBAAe"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/analytics.d.ts b/dist/globals/SiteIntegrations/fields/analytics.d.ts deleted file mode 100644 index 2a725e8..0000000 --- a/dist/globals/SiteIntegrations/fields/analytics.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Field } from 'payload'; -/** - * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no - * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only - * after the matching consent category is granted (see modules/analytics). - */ -export declare const analyticsFields: Field[]; diff --git a/dist/globals/SiteIntegrations/fields/analytics.js b/dist/globals/SiteIntegrations/fields/analytics.js deleted file mode 100644 index eb39a18..0000000 --- a/dist/globals/SiteIntegrations/fields/analytics.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no - * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only - * after the matching consent category is granted (see modules/analytics). - */ export const analyticsFields = [ - { - name: 'ga4MeasurementId', - type: 'text', - admin: { - description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)', - placeholder: 'G-XXXXXXXXXX' - } - }, - { - name: 'gtmContainerId', - type: 'text', - admin: { - description: 'Google Tag Manager container ID. (Google — Consent Mode)', - placeholder: 'GTM-XXXXXXX' - } - }, - { - name: 'metaPixelId', - type: 'text', - admin: { - description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.', - placeholder: '1234567890123456' - } - }, - { - name: 'clarityProjectId', - type: 'text', - admin: { - description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.', - placeholder: 'abcdefghij' - } - }, - { - name: 'linkedInPartnerId', - type: 'text', - admin: { - description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.', - placeholder: '1234567' - } - }, - { - name: 'tiktokPixelId', - type: 'text', - admin: { - description: 'TikTok Pixel ID. Loads only after MARKETING consent.', - placeholder: 'CXXXXXXXXXXXXXXXXXXX' - } - } -]; - -//# sourceMappingURL=analytics.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/analytics.js.map b/dist/globals/SiteIntegrations/fields/analytics.js.map deleted file mode 100644 index 291c1f1..0000000 --- a/dist/globals/SiteIntegrations/fields/analytics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/analytics.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Analytics / marketing tag IDs. All are PUBLIC (exposed client-side), so no\n * read restriction. Google tags (GA4/GTM) use Consent Mode; the rest load only\n * after the matching consent category is granted (see modules/analytics).\n */\nexport const analyticsFields: Field[] = [\n {\n name: 'ga4MeasurementId',\n type: 'text',\n admin: {\n description: 'Google Analytics 4 Measurement ID. (Google — Consent Mode)',\n placeholder: 'G-XXXXXXXXXX',\n },\n },\n {\n name: 'gtmContainerId',\n type: 'text',\n admin: {\n description: 'Google Tag Manager container ID. (Google — Consent Mode)',\n placeholder: 'GTM-XXXXXXX',\n },\n },\n {\n name: 'metaPixelId',\n type: 'text',\n admin: {\n description: 'Meta (Facebook) Pixel ID. Loads only after MARKETING consent.',\n placeholder: '1234567890123456',\n },\n },\n {\n name: 'clarityProjectId',\n type: 'text',\n admin: {\n description: 'Microsoft Clarity project ID (heatmaps). Loads only after ANALYTICS consent.',\n placeholder: 'abcdefghij',\n },\n },\n {\n name: 'linkedInPartnerId',\n type: 'text',\n admin: {\n description: 'LinkedIn Insight Tag partner ID. Loads only after MARKETING consent.',\n placeholder: '1234567',\n },\n },\n {\n name: 'tiktokPixelId',\n type: 'text',\n admin: {\n description: 'TikTok Pixel ID. Loads only after MARKETING consent.',\n placeholder: 'CXXXXXXXXXXXXXXXXXXX',\n },\n },\n]\n"],"names":["analyticsFields","name","type","admin","description","placeholder"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,kBAA2B;IACtC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACbC,aAAa;QACf;IACF;CACD,CAAA"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/smtp.d.ts b/dist/globals/SiteIntegrations/fields/smtp.d.ts deleted file mode 100644 index ed0419f..0000000 --- a/dist/globals/SiteIntegrations/fields/smtp.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Field } from 'payload'; -/** - * SMTP transport settings for outbound email. - * - * Protected at the global level (SiteIntegrations requires an authenticated - * user), so all fields — including the password — stay editable in the admin - * panel while remaining inaccessible to anonymous API requests. - */ -export declare const smtpFields: Field[]; diff --git a/dist/globals/SiteIntegrations/fields/smtp.js b/dist/globals/SiteIntegrations/fields/smtp.js deleted file mode 100644 index edc33cd..0000000 --- a/dist/globals/SiteIntegrations/fields/smtp.js +++ /dev/null @@ -1,98 +0,0 @@ -import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'; -/** - * SMTP transport settings for outbound email. - * - * Protected at the global level (SiteIntegrations requires an authenticated - * user), so all fields — including the password — stay editable in the admin - * panel while remaining inaccessible to anonymous API requests. - */ export const smtpFields = [ - // Status written by mailAdapter on every send (throttled) — banner on this tab. - buildIntegrationStatusBanner('emailStatus', 'Email'), - { - name: 'emailTransport', - type: 'select', - admin: { - description: 'How outbound email is sent. "Microsoft Graph" is only available when configured by the administrator (Intecion).' - }, - defaultValue: 'smtp', - options: [ - { - label: 'SMTP', - value: 'smtp' - }, - { - label: 'Microsoft Graph (Exchange)', - value: 'graph' - } - ] - }, - { - type: 'row', - admin: { - // Hide SMTP fields when Graph is selected — they're not used then. - condition: (_, siblingData)=>siblingData?.emailTransport !== 'graph' - }, - fields: [ - { - name: 'smtpHost', - type: 'text', - admin: { - placeholder: 'smtp.example.com', - width: '70%' - } - }, - { - name: 'smtpPort', - type: 'number', - admin: { - width: '30%' - }, - defaultValue: 587 - } - ] - }, - { - name: 'smtpUser', - type: 'text', - admin: { - description: 'SMTP account username.' - } - }, - { - name: 'smtpPassword', - type: 'text', - admin: { - description: 'SMTP account password.', - // Masked in the UI (••••) — stored plaintext, readable for SMTP auth. - components: { - Field: '@intecion/ipal-kit/client#MaskedField' - } - } - }, - { - name: 'smtpFromAddress', - type: 'email', - admin: { - description: 'Default "from" address for outgoing mail.' - } - }, - { - name: 'smtpFromName', - type: 'text', - admin: { - description: 'Default "from" display name.' - } - }, - { - name: 'emailTest', - type: 'ui', - admin: { - components: { - Field: '@intecion/ipal-kit/client#TestEmailButton' - } - } - }, - buildIntegrationStatusField('emailStatus') -]; - -//# sourceMappingURL=smtp.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/smtp.js.map b/dist/globals/SiteIntegrations/fields/smtp.js.map deleted file mode 100644 index e4720e5..0000000 --- a/dist/globals/SiteIntegrations/fields/smtp.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/smtp.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'\n\n/**\n * SMTP transport settings for outbound email.\n *\n * Protected at the global level (SiteIntegrations requires an authenticated\n * user), so all fields — including the password — stay editable in the admin\n * panel while remaining inaccessible to anonymous API requests.\n */\nexport const smtpFields: Field[] = [\n // Status written by mailAdapter on every send (throttled) — banner on this tab.\n buildIntegrationStatusBanner('emailStatus', 'Email'),\n {\n name: 'emailTransport',\n type: 'select',\n admin: {\n description:\n 'How outbound email is sent. \"Microsoft Graph\" is only available when configured by the administrator (Intecion).',\n // The Graph option only makes sense when agency credentials exist in env.\n // We can't read process.env in the admin UI directly, so a client project\n // that hasn't set up Graph should filter this option via integrationsFields\n // override, or simply leave it on 'smtp'. The adapter enforces the real\n // availability at send time regardless of what's selected here.\n },\n defaultValue: 'smtp',\n options: [\n { label: 'SMTP', value: 'smtp' },\n { label: 'Microsoft Graph (Exchange)', value: 'graph' },\n ],\n },\n {\n type: 'row',\n admin: {\n // Hide SMTP fields when Graph is selected — they're not used then.\n condition: (_, siblingData) => siblingData?.emailTransport !== 'graph',\n },\n fields: [\n {\n name: 'smtpHost',\n type: 'text',\n admin: { placeholder: 'smtp.example.com', width: '70%' },\n },\n {\n name: 'smtpPort',\n type: 'number',\n admin: { width: '30%' },\n defaultValue: 587,\n },\n ],\n },\n {\n name: 'smtpUser',\n type: 'text',\n admin: {\n description: 'SMTP account username.',\n },\n },\n {\n name: 'smtpPassword',\n type: 'text',\n admin: {\n description: 'SMTP account password.',\n // Masked in the UI (••••) — stored plaintext, readable for SMTP auth.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n {\n name: 'smtpFromAddress',\n type: 'email',\n admin: {\n description: 'Default \"from\" address for outgoing mail.',\n },\n },\n {\n name: 'smtpFromName',\n type: 'text',\n admin: {\n description: 'Default \"from\" display name.',\n },\n },\n {\n name: 'emailTest',\n type: 'ui',\n admin: {\n components: {\n Field: '@intecion/ipal-kit/client#TestEmailButton',\n },\n },\n },\n buildIntegrationStatusField('emailStatus'),\n]\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","smtpFields","name","type","admin","description","defaultValue","options","label","value","condition","_","siblingData","emailTransport","fields","placeholder","width","components","Field"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,2BAA2B,QAAQ,0CAAyC;AAEnH;;;;;;CAMC,GACD,OAAO,MAAMC,aAAsB;IACjC,gFAAgF;IAChFF,6BAA6B,eAAe;IAC5C;QACEG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QAMJ;QACAC,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAQC,OAAO;YAAO;YAC/B;gBAAED,OAAO;gBAA8BC,OAAO;YAAQ;SACvD;IACH;IACA;QACEN,MAAM;QACNC,OAAO;YACL,mEAAmE;YACnEM,WAAW,CAACC,GAAGC,cAAgBA,aAAaC,mBAAmB;QACjE;QACAC,QAAQ;YACN;gBACEZ,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEW,aAAa;oBAAoBC,OAAO;gBAAM;YACzD;YACA;gBACEd,MAAM;gBACNC,MAAM;gBACNC,OAAO;oBAAEY,OAAO;gBAAM;gBACtBV,cAAc;YAChB;SACD;IACH;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,sEAAsE;YACtEY,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACA;QACEhB,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLa,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACAlB,4BAA4B;CAC7B,CAAA"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/turnstile.d.ts b/dist/globals/SiteIntegrations/fields/turnstile.d.ts deleted file mode 100644 index 5963ee3..0000000 --- a/dist/globals/SiteIntegrations/fields/turnstile.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Field } from 'payload'; -/** - * Cloudflare Turnstile credentials. - * - * siteKey is public (rendered in the widget); secretKey is used for - * server-side verification. Both are protected at the global level - * (SiteIntegrations requires an authenticated user) rather than per-field, - * so they remain editable in the admin panel. - */ -export declare const turnstileFields: Field[]; diff --git a/dist/globals/SiteIntegrations/fields/turnstile.js b/dist/globals/SiteIntegrations/fields/turnstile.js deleted file mode 100644 index 598a5b6..0000000 --- a/dist/globals/SiteIntegrations/fields/turnstile.js +++ /dev/null @@ -1,33 +0,0 @@ -import { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'; -/** - * Cloudflare Turnstile credentials. - * - * siteKey is public (rendered in the widget); secretKey is used for - * server-side verification. Both are protected at the global level - * (SiteIntegrations requires an authenticated user) rather than per-field, - * so they remain editable in the admin panel. - */ export const turnstileFields = [ - // Status written by the server when it verifies a form (checkTurnstile) — banner on this tab. - buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'), - { - name: 'turnstileSiteKey', - type: 'text', - admin: { - description: 'Public site key rendered in the Turnstile widget.' - } - }, - { - name: 'turnstileSecretKey', - type: 'text', - admin: { - description: 'Secret key used for server-side verification.', - // Masked in the UI (••••) — stored plaintext, readable for verification. - components: { - Field: '@intecion/ipal-kit/client#MaskedField' - } - } - }, - buildIntegrationStatusField('turnstileStatus') -]; - -//# sourceMappingURL=turnstile.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/fields/turnstile.js.map b/dist/globals/SiteIntegrations/fields/turnstile.js.map deleted file mode 100644 index 98622c6..0000000 --- a/dist/globals/SiteIntegrations/fields/turnstile.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteIntegrations/fields/turnstile.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { buildIntegrationStatusBanner, buildIntegrationStatusField } from '../../../modules/integrations/status.js'\n\n/**\n * Cloudflare Turnstile credentials.\n *\n * siteKey is public (rendered in the widget); secretKey is used for\n * server-side verification. Both are protected at the global level\n * (SiteIntegrations requires an authenticated user) rather than per-field,\n * so they remain editable in the admin panel.\n */\nexport const turnstileFields: Field[] = [\n // Status written by the server when it verifies a form (checkTurnstile) — banner on this tab.\n buildIntegrationStatusBanner('turnstileStatus', 'Turnstile'),\n {\n name: 'turnstileSiteKey',\n type: 'text',\n admin: {\n description: 'Public site key rendered in the Turnstile widget.',\n },\n },\n {\n name: 'turnstileSecretKey',\n type: 'text',\n admin: {\n description: 'Secret key used for server-side verification.',\n // Masked in the UI (••••) — stored plaintext, readable for verification.\n components: {\n Field: '@intecion/ipal-kit/client#MaskedField',\n },\n },\n },\n buildIntegrationStatusField('turnstileStatus'),\n]\n"],"names":["buildIntegrationStatusBanner","buildIntegrationStatusField","turnstileFields","name","type","admin","description","components","Field"],"mappings":"AAEA,SAASA,4BAA4B,EAAEC,2BAA2B,QAAQ,0CAAyC;AAEnH;;;;;;;CAOC,GACD,OAAO,MAAMC,kBAA2B;IACtC,8FAA8F;IAC9FF,6BAA6B,mBAAmB;IAChD;QACEG,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;IACF;IACA;QACEH,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;YACb,yEAAyE;YACzEC,YAAY;gBACVC,OAAO;YACT;QACF;IACF;IACAP,4BAA4B;CAC7B,CAAA"} \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/index.d.ts b/dist/globals/SiteIntegrations/index.d.ts deleted file mode 100644 index 52e35d7..0000000 --- a/dist/globals/SiteIntegrations/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import type { Field, GlobalConfig } from 'payload'; -type BuildSiteIntegrationsArgs = { - /** Extra fields injected by the client project */ - additionalFields?: Field[]; -}; -/** - * Builds the SiteIntegrations global. - * - * Holds third-party service credentials. Access is enforced at the global - * level — the whole global requires an authenticated user — so secrets stay - * out of anonymous API responses while remaining editable in the admin panel - * and readable via the server-side Local API. (Field-level read:false was - * avoided because it also hides fields from the admin UI, making them - * impossible to enter.) - * - * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId). - */ -export declare function buildSiteIntegrations({ additionalFields, }?: BuildSiteIntegrationsArgs): GlobalConfig; -export {}; diff --git a/dist/globals/SiteIntegrations/index.js b/dist/globals/SiteIntegrations/index.js deleted file mode 100644 index 46236e7..0000000 --- a/dist/globals/SiteIntegrations/index.js +++ /dev/null @@ -1,83 +0,0 @@ -import { isAdmin } from '../../modules/access/index.js'; -import { analyticsFields } from './fields/analytics.js'; -import { smtpFields } from './fields/smtp.js'; -import { turnstileFields } from './fields/turnstile.js'; -/** - * Builds the SiteIntegrations global. - * - * Holds third-party service credentials. Access is enforced at the global - * level — the whole global requires an authenticated user — so secrets stay - * out of anonymous API responses while remaining editable in the admin panel - * and readable via the server-side Local API. (Field-level read:false was - * avoided because it also hides fields from the admin UI, making them - * impossible to enter.) - * - * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId). - */ export function buildSiteIntegrations({ additionalFields } = {}) { - return { - slug: 'site-integrations', - access: { - // Admin-only — secrets live here. Anonymous and non-admin users get - // nothing through the API; admins read/edit in the panel and via Local API. - read: ({ req: { user } })=>isAdmin(user), - update: ({ req: { user } })=>isAdmin(user) - }, - admin: { - group: 'Settings' - }, - fields: [ - { - type: 'tabs', - tabs: [ - { - fields: analyticsFields, - label: 'Analytics' - }, - { - fields: turnstileFields, - label: 'Turnstile' - }, - { - fields: smtpFields, - label: 'SMTP' - }, - ...additionalFields?.length ? [ - { - fields: additionalFields, - label: 'Custom' - } - ] : [] - ] - } - ], - hooks: { - beforeChange: [ - // Keys edited in the panel → clear that integration's old status, so a stale - // "not working" banner doesn't linger until the next form submission. - ({ context, data, originalDoc })=>{ - if (context?.ipalIntegrationStatus || !data) { - return data; - } - const changed = (k)=>k in data && data[k] !== originalDoc?.[k]; - const cleared = { - checkedAt: null, - code: null, - message: null, - since: null, - state: null - }; - if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) { - data.turnstileStatus = cleared; - } - if (Object.keys(data).some((k)=>(k === 'emailTransport' || k.startsWith('smtp')) && changed(k))) { - data.emailStatus = cleared; - } - return data; - } - ] - }, - label: 'Site Integrations' - }; -} - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/globals/SiteIntegrations/index.js.map b/dist/globals/SiteIntegrations/index.js.map deleted file mode 100644 index a72c7c5..0000000 --- a/dist/globals/SiteIntegrations/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/SiteIntegrations/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { isAdmin } from '../../modules/access/index.js'\nimport { analyticsFields } from './fields/analytics.js'\nimport { smtpFields } from './fields/smtp.js'\nimport { turnstileFields } from './fields/turnstile.js'\n\ntype BuildSiteIntegrationsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n}\n\n/**\n * Builds the SiteIntegrations global.\n *\n * Holds third-party service credentials. Access is enforced at the global\n * level — the whole global requires an authenticated user — so secrets stay\n * out of anonymous API responses while remaining editable in the admin panel\n * and readable via the server-side Local API. (Field-level read:false was\n * avoided because it also hides fields from the admin UI, making them\n * impossible to enter.)\n *\n * Unnamed tabs keep data flat (siteIntegrations.ga4MeasurementId).\n */\nexport function buildSiteIntegrations({\n additionalFields,\n}: BuildSiteIntegrationsArgs = {}): GlobalConfig {\n return {\n slug: 'site-integrations',\n access: {\n // Admin-only — secrets live here. Anonymous and non-admin users get\n // nothing through the API; admins read/edit in the panel and via Local API.\n read: ({ req: { user } }) => isAdmin(user),\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n { fields: analyticsFields, label: 'Analytics' },\n { fields: turnstileFields, label: 'Turnstile' },\n { fields: smtpFields, label: 'SMTP' },\n ...(additionalFields?.length\n ? [{ fields: additionalFields, label: 'Custom' }]\n : []),\n ],\n },\n ],\n hooks: {\n beforeChange: [\n // Keys edited in the panel → clear that integration's old status, so a stale\n // \"not working\" banner doesn't linger until the next form submission.\n ({ context, data, originalDoc }) => {\n if (context?.ipalIntegrationStatus || !data) {return data}\n const changed = (k: string) => k in data && data[k] !== originalDoc?.[k]\n const cleared = { checkedAt: null, code: null, message: null, since: null, state: null }\n if (changed('turnstileSecretKey') || changed('turnstileSiteKey')) {data.turnstileStatus = cleared}\n if (Object.keys(data).some((k) => (k === 'emailTransport' || k.startsWith('smtp')) && changed(k))) {\n data.emailStatus = cleared\n }\n return data\n },\n ],\n },\n label: 'Site Integrations',\n }\n}\n"],"names":["isAdmin","analyticsFields","smtpFields","turnstileFields","buildSiteIntegrations","additionalFields","slug","access","read","req","user","update","admin","group","fields","type","tabs","label","length","hooks","beforeChange","context","data","originalDoc","ipalIntegrationStatus","changed","k","cleared","checkedAt","code","message","since","state","turnstileStatus","Object","keys","some","startsWith","emailStatus"],"mappings":"AAEA,SAASA,OAAO,QAAQ,gCAA+B;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,UAAU,QAAQ,mBAAkB;AAC7C,SAASC,eAAe,QAAQ,wBAAuB;AAOvD;;;;;;;;;;;CAWC,GACD,OAAO,SAASC,sBAAsB,EACpCC,gBAAgB,EACU,GAAG,CAAC,CAAC;IAC/B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACN,oEAAoE;YACpE,4EAA4E;YAC5EC,MAAM,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;YACrCC,QAAQ,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKV,QAAQU;QACzC;QACAE,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBAAEF,QAAQb;wBAAiBgB,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQX;wBAAiBc,OAAO;oBAAY;oBAC9C;wBAAEH,QAAQZ;wBAAYe,OAAO;oBAAO;uBAChCZ,kBAAkBa,SAClB;wBAAC;4BAAEJ,QAAQT;4BAAkBY,OAAO;wBAAS;qBAAE,GAC/C,EAAE;iBACP;YACH;SACD;QACDE,OAAO;YACLC,cAAc;gBACZ,6EAA6E;gBAC7E,sEAAsE;gBACtE,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,WAAW,EAAE;oBAC7B,IAAIF,SAASG,yBAAyB,CAACF,MAAM;wBAAC,OAAOA;oBAAI;oBACzD,MAAMG,UAAU,CAACC,IAAcA,KAAKJ,QAAQA,IAAI,CAACI,EAAE,KAAKH,aAAa,CAACG,EAAE;oBACxE,MAAMC,UAAU;wBAAEC,WAAW;wBAAMC,MAAM;wBAAMC,SAAS;wBAAMC,OAAO;wBAAMC,OAAO;oBAAK;oBACvF,IAAIP,QAAQ,yBAAyBA,QAAQ,qBAAqB;wBAACH,KAAKW,eAAe,GAAGN;oBAAO;oBACjG,IAAIO,OAAOC,IAAI,CAACb,MAAMc,IAAI,CAAC,CAACV,IAAM,AAACA,CAAAA,MAAM,oBAAoBA,EAAEW,UAAU,CAAC,OAAM,KAAMZ,QAAQC,KAAK;wBACjGJ,KAAKgB,WAAW,GAAGX;oBACrB;oBACA,OAAOL;gBACT;aACD;QACH;QACAL,OAAO;IACT;AACF"} \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/general.d.ts b/dist/globals/SiteSettings/fields/general.d.ts deleted file mode 100644 index 0a7c294..0000000 --- a/dist/globals/SiteSettings/fields/general.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Field } from 'payload'; -/** - * General site identity fields. - * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo). - */ -export declare const generalFields: Field[]; diff --git a/dist/globals/SiteSettings/fields/general.js b/dist/globals/SiteSettings/fields/general.js deleted file mode 100644 index 6f6023a..0000000 --- a/dist/globals/SiteSettings/fields/general.js +++ /dev/null @@ -1,103 +0,0 @@ -import { validateFaviconField } from '../../../modules/seo/index.js'; -/** - * General site identity fields. - * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo). - */ export const generalFields = [ - { - name: 'siteName', - type: 'text', - admin: { - description: 'Used in page titles and Open Graph metadata.' - }, - localized: true, - required: true - }, - { - name: 'siteDescription', - type: 'textarea', - admin: { - description: 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.' - }, - localized: true - }, - { - name: 'titleOrder', - type: 'select', - admin: { - description: 'Which comes first in browser tabs.' - }, - defaultValue: 'page-first', - options: [ - { - label: 'Page first — About Us | Acme', - value: 'page-first' - }, - { - label: 'Site first — Acme | About Us', - value: 'site-first' - } - ] - }, - { - name: 'titleSeparator', - type: 'select', - admin: { - description: 'Separates the page title from the site name in browser tabs.' - }, - defaultValue: '|', - options: [ - { - label: 'Pipe — Page | Site', - value: '|' - }, - { - label: 'Dash — Page – Site', - value: '–' - }, - { - label: 'Hyphen — Page - Site', - value: '-' - }, - { - label: 'Bullet — Page · Site', - value: '·' - }, - { - label: 'Slash — Page / Site', - value: '/' - } - ] - }, - { - name: 'logo', - type: 'upload', - admin: { - description: 'Primary site logo.' - }, - relationTo: 'media' - }, - { - name: 'defaultShareImage', - type: 'upload', - admin: { - description: 'Fallback Open Graph image when a page has none.' - }, - relationTo: 'media' - }, - { - name: 'favicon', - type: 'upload', - admin: { - description: 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.' - }, - hooks: { - // Warn the editor if the favicon is too small / not square for Google. - beforeValidate: [ - validateFaviconField - ] - }, - relationTo: 'media' - } -]; - -//# sourceMappingURL=general.js.map \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/general.js.map b/dist/globals/SiteSettings/fields/general.js.map deleted file mode 100644 index 28b16a7..0000000 --- a/dist/globals/SiteSettings/fields/general.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/general.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport { validateFaviconField } from '../../../modules/seo/index.js'\n\n/**\n * General site identity fields.\n * Consumed by SEO/OG (siteName, defaultShareImage) and frontend (logo).\n */\nexport const generalFields: Field[] = [\n {\n name: 'siteName',\n type: 'text',\n admin: {\n description: 'Used in page titles and Open Graph metadata.',\n },\n localized: true,\n required: true,\n },\n {\n name: 'siteDescription',\n type: 'textarea',\n admin: {\n description:\n 'Fallback meta description when a page has none. Also used for llms.txt and Open Graph.',\n },\n localized: true,\n },\n {\n name: 'titleOrder',\n type: 'select',\n admin: {\n description: 'Which comes first in browser tabs.',\n },\n defaultValue: 'page-first',\n options: [\n { label: 'Page first — About Us | Acme', value: 'page-first' },\n { label: 'Site first — Acme | About Us', value: 'site-first' },\n ],\n },\n {\n name: 'titleSeparator',\n type: 'select',\n admin: {\n description: 'Separates the page title from the site name in browser tabs.',\n },\n defaultValue: '|',\n options: [\n { label: 'Pipe — Page | Site', value: '|' },\n { label: 'Dash — Page – Site', value: '–' },\n { label: 'Hyphen — Page - Site', value: '-' },\n { label: 'Bullet — Page · Site', value: '·' },\n { label: 'Slash — Page / Site', value: '/' },\n ],\n },\n {\n name: 'logo',\n type: 'upload',\n admin: {\n description: 'Primary site logo.',\n },\n relationTo: 'media',\n },\n {\n name: 'defaultShareImage',\n type: 'upload',\n admin: {\n description: 'Fallback Open Graph image when a page has none.',\n },\n relationTo: 'media',\n },\n {\n name: 'favicon',\n type: 'upload',\n admin: {\n description:\n 'Square icon, PNG or SVG, min. 48×48px (Google requires this to show it in search). Rendered via buildIconsMetadata.',\n },\n hooks: {\n // Warn the editor if the favicon is too small / not square for Google.\n beforeValidate: [validateFaviconField],\n },\n relationTo: 'media',\n },\n]\n"],"names":["validateFaviconField","generalFields","name","type","admin","description","localized","required","defaultValue","options","label","value","relationTo","hooks","beforeValidate"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ,gCAA+B;AAEpE;;;CAGC,GACD,OAAO,MAAMC,gBAAyB;IACpC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,WAAW;QACXC,UAAU;IACZ;IACA;QACEL,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAC,WAAW;IACb;IACA;QACEJ,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAkCC,OAAO;YAAa;YAC/D;gBAAED,OAAO;gBAAkCC,OAAO;YAAa;SAChE;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAG,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAAwBC,OAAO;YAAI;YAC5C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAA0BC,OAAO;YAAI;YAC9C;gBAAED,OAAO;gBAAyBC,OAAO;YAAI;SAC9C;IACH;IACA;QACET,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAO,YAAY;IACd;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aACE;QACJ;QACAQ,OAAO;YACL,uEAAuE;YACvEC,gBAAgB;gBAACd;aAAqB;QACxC;QACAY,YAAY;IACd;CACD,CAAA"} \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/navigation.d.ts b/dist/globals/SiteSettings/fields/navigation.d.ts deleted file mode 100644 index cb0ff5c..0000000 --- a/dist/globals/SiteSettings/fields/navigation.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/dist/globals/SiteSettings/fields/navigation.js b/dist/globals/SiteSettings/fields/navigation.js deleted file mode 100644 index 0dd88ba..0000000 --- a/dist/globals/SiteSettings/fields/navigation.js +++ /dev/null @@ -1,2 +0,0 @@ - -//# sourceMappingURL=navigation.js.map \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/navigation.js.map b/dist/globals/SiteSettings/fields/navigation.js.map deleted file mode 100644 index 93c4e97..0000000 --- a/dist/globals/SiteSettings/fields/navigation.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/navigation.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/theme.d.ts b/dist/globals/SiteSettings/fields/theme.d.ts deleted file mode 100644 index 8f527ed..0000000 --- a/dist/globals/SiteSettings/fields/theme.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Field } from 'payload'; -/** - * Theme behavior configuration. - * - * These are decisions, not visuals — the plugin stores them, the client - * template reads them and decides whether to render a toggle and which - * mode to start in. Appearance itself stays in the template. - */ -export declare const themeFields: Field[]; diff --git a/dist/globals/SiteSettings/fields/theme.js b/dist/globals/SiteSettings/fields/theme.js deleted file mode 100644 index f434b1e..0000000 --- a/dist/globals/SiteSettings/fields/theme.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Theme behavior configuration. - * - * These are decisions, not visuals — the plugin stores them, the client - * template reads them and decides whether to render a toggle and which - * mode to start in. Appearance itself stays in the template. - */ export const themeFields = [ - { - name: 'defaultTheme', - type: 'select', - admin: { - description: 'Theme applied on a visitor’s first visit.' - }, - defaultValue: 'light', - options: [ - { - label: 'Light', - value: 'light' - }, - { - label: 'Dark', - value: 'dark' - } - ], - required: true - }, - { - name: 'allowThemeToggle', - type: 'checkbox', - admin: { - description: 'Show a light/dark switch on the site.' - }, - defaultValue: true - } -]; - -//# sourceMappingURL=theme.js.map \ No newline at end of file diff --git a/dist/globals/SiteSettings/fields/theme.js.map b/dist/globals/SiteSettings/fields/theme.js.map deleted file mode 100644 index 506a34b..0000000 --- a/dist/globals/SiteSettings/fields/theme.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../../src/globals/SiteSettings/fields/theme.ts"],"sourcesContent":["import type { Field } from 'payload'\n\n/**\n * Theme behavior configuration.\n *\n * These are decisions, not visuals — the plugin stores them, the client\n * template reads them and decides whether to render a toggle and which\n * mode to start in. Appearance itself stays in the template.\n */\nexport const themeFields: Field[] = [\n {\n name: 'defaultTheme',\n type: 'select',\n admin: {\n description: 'Theme applied on a visitor’s first visit.',\n },\n defaultValue: 'light',\n options: [\n { label: 'Light', value: 'light' },\n { label: 'Dark', value: 'dark' },\n ],\n required: true,\n },\n {\n name: 'allowThemeToggle',\n type: 'checkbox',\n admin: {\n description: 'Show a light/dark switch on the site.',\n },\n defaultValue: true,\n },\n]\n"],"names":["themeFields","name","type","admin","description","defaultValue","options","label","value","required"],"mappings":"AAEA;;;;;;CAMC,GACD,OAAO,MAAMA,cAAuB;IAClC;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;QACdC,SAAS;YACP;gBAAEC,OAAO;gBAASC,OAAO;YAAQ;YACjC;gBAAED,OAAO;gBAAQC,OAAO;YAAO;SAChC;QACDC,UAAU;IACZ;IACA;QACER,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;IAChB;CACD,CAAA"} \ No newline at end of file diff --git a/dist/globals/SiteSettings/index.d.ts b/dist/globals/SiteSettings/index.d.ts deleted file mode 100644 index debf327..0000000 --- a/dist/globals/SiteSettings/index.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import type { Field, GlobalConfig } from 'payload'; -type BuildSiteSettingsArgs = { - /** Extra fields injected by the client project */ - additionalFields?: Field[]; - /** - * Fields for the "System Pages" tab — page assignments by role (homepage, - * privacy policy, collection archives). Assembled by the caller, which is the - * only place that knows which modules are enabled. The tab is omitted when - * this is empty. - */ - systemPageFields?: Field[]; -}; -/** - * Builds the SiteSettings global. - * - * Composes tabs out of field groups; it deliberately doesn't know where those - * groups come from. Earlier it imported the pages and content modules directly, - * which meant a global — a presentation-layer concern — had an opinion about - * blogs. Now the plugin's composition root passes fields in, and adding a new - * kind of page assignment needs no change here. - * - * Uses unnamed tabs — data stays flat (siteSettings.siteName, not - * siteSettings.general.siteName). Client-provided fields land in their own - * "Custom" tab so core data paths never shift. - */ -export declare function buildSiteSettings({ additionalFields, systemPageFields, }?: BuildSiteSettingsArgs): GlobalConfig; -export {}; diff --git a/dist/globals/SiteSettings/index.js b/dist/globals/SiteSettings/index.js deleted file mode 100644 index 613c0f2..0000000 --- a/dist/globals/SiteSettings/index.js +++ /dev/null @@ -1,55 +0,0 @@ -import { generalFields } from './fields/general.js'; -import { themeFields } from './fields/theme.js'; -/** - * Builds the SiteSettings global. - * - * Composes tabs out of field groups; it deliberately doesn't know where those - * groups come from. Earlier it imported the pages and content modules directly, - * which meant a global — a presentation-layer concern — had an opinion about - * blogs. Now the plugin's composition root passes fields in, and adding a new - * kind of page assignment needs no change here. - * - * Uses unnamed tabs — data stays flat (siteSettings.siteName, not - * siteSettings.general.siteName). Client-provided fields land in their own - * "Custom" tab so core data paths never shift. - */ export function buildSiteSettings({ additionalFields, systemPageFields } = {}) { - return { - slug: 'site-settings', - access: { - read: ()=>true - }, - admin: { - group: 'Settings' - }, - fields: [ - { - type: 'tabs', - tabs: [ - { - fields: generalFields, - label: 'General' - }, - { - fields: themeFields, - label: 'Theme' - }, - ...systemPageFields?.length ? [ - { - fields: systemPageFields, - label: 'System Pages' - } - ] : [], - ...additionalFields?.length ? [ - { - fields: additionalFields, - label: 'Custom' - } - ] : [] - ] - } - ], - label: 'Site Settings' - }; -} - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/globals/SiteSettings/index.js.map b/dist/globals/SiteSettings/index.js.map deleted file mode 100644 index 9e4d89f..0000000 --- a/dist/globals/SiteSettings/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/globals/SiteSettings/index.ts"],"sourcesContent":["import type { Field, GlobalConfig } from 'payload'\n\nimport { generalFields } from './fields/general.js'\nimport { themeFields } from './fields/theme.js'\n\ntype BuildSiteSettingsArgs = {\n /** Extra fields injected by the client project */\n additionalFields?: Field[]\n /**\n * Fields for the \"System Pages\" tab — page assignments by role (homepage,\n * privacy policy, collection archives). Assembled by the caller, which is the\n * only place that knows which modules are enabled. The tab is omitted when\n * this is empty.\n */\n systemPageFields?: Field[]\n}\n\n/**\n * Builds the SiteSettings global.\n *\n * Composes tabs out of field groups; it deliberately doesn't know where those\n * groups come from. Earlier it imported the pages and content modules directly,\n * which meant a global — a presentation-layer concern — had an opinion about\n * blogs. Now the plugin's composition root passes fields in, and adding a new\n * kind of page assignment needs no change here.\n *\n * Uses unnamed tabs — data stays flat (siteSettings.siteName, not\n * siteSettings.general.siteName). Client-provided fields land in their own\n * \"Custom\" tab so core data paths never shift.\n */\nexport function buildSiteSettings({\n additionalFields,\n systemPageFields,\n}: BuildSiteSettingsArgs = {}): GlobalConfig {\n return {\n slug: 'site-settings',\n access: {\n read: () => true,\n },\n admin: {\n group: 'Settings',\n },\n fields: [\n {\n type: 'tabs',\n tabs: [\n {\n fields: generalFields,\n label: 'General',\n },\n {\n fields: themeFields,\n label: 'Theme',\n },\n ...(systemPageFields?.length\n ? [{ fields: systemPageFields, label: 'System Pages' }]\n : []),\n ...(additionalFields?.length ? [{ fields: additionalFields, label: 'Custom' }] : []),\n ],\n },\n ],\n label: 'Site Settings',\n }\n}\n"],"names":["generalFields","themeFields","buildSiteSettings","additionalFields","systemPageFields","slug","access","read","admin","group","fields","type","tabs","label","length"],"mappings":"AAEA,SAASA,aAAa,QAAQ,sBAAqB;AACnD,SAASC,WAAW,QAAQ,oBAAmB;AAc/C;;;;;;;;;;;;CAYC,GACD,OAAO,SAASC,kBAAkB,EAChCC,gBAAgB,EAChBC,gBAAgB,EACM,GAAG,CAAC,CAAC;IAC3B,OAAO;QACLC,MAAM;QACNC,QAAQ;YACNC,MAAM,IAAM;QACd;QACAC,OAAO;YACLC,OAAO;QACT;QACAC,QAAQ;YACN;gBACEC,MAAM;gBACNC,MAAM;oBACJ;wBACEF,QAAQV;wBACRa,OAAO;oBACT;oBACA;wBACEH,QAAQT;wBACRY,OAAO;oBACT;uBACIT,kBAAkBU,SAClB;wBAAC;4BAAEJ,QAAQN;4BAAkBS,OAAO;wBAAe;qBAAE,GACrD,EAAE;uBACFV,kBAAkBW,SAAS;wBAAC;4BAAEJ,QAAQP;4BAAkBU,OAAO;wBAAS;qBAAE,GAAG,EAAE;iBACpF;YACH;SACD;QACDA,OAAO;IACT;AACF"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 32d7acd..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -export { ipalKit } from './plugin.js'; -export type { IpalOptions } from './types.js'; -export type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'; -export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath, } from './modules/i18n/index.js'; -export type { PagesOption, SystemPageRole } from './modules/pages/index.js'; -export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'; -export type { AccessOption, Role } from './modules/access/index.js'; -export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY, } from './modules/access/index.js'; -export type { GlobalQueryOptions } from './modules/payload/index.js'; -export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG, } from './modules/payload/index.js'; -export type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js'; -export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales, } from './modules/seo/index.js'; -export type { SiteMetaConfig } from './modules/seo/index.js'; -export type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js'; -export { createContentHelpers } from './modules/frontend/index.js'; -export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam, } from './modules/content/index.js'; -export type { ArchiveEntries } from './modules/content/index.js'; -export type { SearchResult } from './modules/content/index.js'; -export { lexicalToMarkdown } from './modules/richtext/index.js'; -export type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js'; -export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS, } from './modules/seo/index.js'; -export type { LocaleMiddlewareResult } from './modules/i18n/index.js'; -export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER, } from './modules/i18n/index.js'; -export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'; -export { resolveLocalized } from './modules/i18n/index.js'; -export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts, } from './modules/consent/index.js'; -export type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'; -export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'; -export { graphAdapter } from './modules/email/graphAdapter.js'; -export { mailAdapter } from './modules/email/mailAdapter.js'; -export type { MailAdapterArgs } from './modules/email/mailAdapter.js'; -export type { GraphAdapterArgs } from './modules/email/graphAdapter.js'; -export type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'; -export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'; -export type { FormsOption, FormsCollectionOverrides, FormsFieldsOverride, } from './modules/forms/types.js'; -export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom, } from './modules/forms/validators.js'; -export type { Rule } from './modules/forms/validators.js'; -export type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'; -export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'; -export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'; -export { createHealthRoute } from './modules/health/index.js'; -export { createMcpRoute } from './modules/mcp/index.js'; -export { assertEnv, ipalEnvRules } from './modules/env/index.js'; -export type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js'; -export type { AnalyticsConfig } from './modules/analytics/index.js'; -export { getAnalyticsConfig } from './modules/analytics/index.js'; -export { buildSlugField, toSlug } from './modules/slug/index.js'; -export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js'; -export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js'; -export { buildSecurityHeaders } from './modules/security/index.js'; -export { buildCsp } from './modules/security/index.js'; -export type { BuildCspArgs } from './modules/security/index.js'; -export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'; -export { buildNoindexField } from './modules/seo/index.js'; -export { recordIntegrationStatus, buildIntegrationStatusField, buildIntegrationStatusBanner } from './modules/integrations/index.js'; -export type { IntegrationStatus, IntegrationState } from './modules/integrations/index.js'; -export { rowLabel } from './modules/admin-ui/index.js'; -export type { RowLabelProps } from './modules/admin-ui/index.js'; -export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'; -export type { LinkAppearance, LinkValue, BuildLinkFieldOptions, BuildLinksFieldOptions, ResolveLinkHrefOptions, } from './modules/links/index.js'; -export { buildSpeakableJsonLd } from './modules/seo/index.js'; -export { buildSummaryField } from './modules/seo/index.js'; -export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js'; -export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js'; -export { buildArticleJsonLd } from './modules/seo/index.js'; -export { buildLlmsTxt } from './modules/seo/index.js'; -export { buildSitemapXml, buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './modules/seo/index.js'; -export type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js'; -export { buildR2Storage } from './modules/storage/index.js'; -export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js'; -export type { OptimizeUploadOptions } from './modules/media/index.js'; -export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js'; -export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'; -export type { A11yState } from './modules/accessibility/index.js'; -export type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js'; -export type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index dd1ab2a..0000000 --- a/dist/index.js +++ /dev/null @@ -1,60 +0,0 @@ -export { ipalKit } from './plugin.js'; -export { buildLocalizedPath, getDefaultLocale, getLocaleCodes, getLocaleDefinition, getLocalizedSlugs, isValidLocale, LOCALE_COOKIE_NAME, matchAcceptLanguage, negotiateLocale, switchLocalePath } from './modules/i18n/index.js'; -export { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'; -export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, hasMinimumRole, isAdmin, isEditor, requireRole, requireRoleField, ROLE_HIERARCHY } from './modules/access/index.js'; -export { getGlobal, getSiteSettings, getSiteIntegrations, SITE_SETTINGS_SLUG, SITE_INTEGRATIONS_SLUG } from './modules/payload/index.js'; -export { composeTitle, buildHreflangAlternates, buildMetadata, readSiteMetaConfig, slugsAcrossLocales } from './modules/seo/index.js'; -export { createContentHelpers } from './modules/frontend/index.js'; -export { resolveRoute, resolveRedirect, resolveNotFoundPage, blocksToMarkdown, createMarkdownRenderer, markdownResponse, prefersMarkdown, markdownHref, MARKDOWN_PREFIX, searchContent, createSearchRoute, archiveFieldName, getArchiveEntries, buildArchivePath, buildEntryPath, parsePageParam } from './modules/content/index.js'; -// Lexical → Markdown (pure, no React) — for AI-readable output. -export { lexicalToMarkdown } from './modules/richtext/index.js'; -export { buildAutoFillMetaHook, injectAutoFillMeta, createMetadataGenerator, createPageMetadata, buildSitemapEntries, buildRobots, AI_ASSISTANT_BOTS, AI_TRAINING_BOTS } from './modules/seo/index.js'; -export { createLocaleMiddleware, DEFAULT_MIDDLEWARE_MATCHER } from './modules/i18n/index.js'; -export { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'; -export { resolveLocalized } from './modules/i18n/index.js'; -export { CONSENT_CATEGORIES, DEFAULT_CONSENT, ACCEPT_ALL_CONSENT, REJECT_ALL_CONSENT, CONSENT_COOKIE, CONSENT_VERSION, CONSENT_MAX_AGE, serializeConsent, parseConsent, setDefaultConsent, updateConsent, getConsentTexts } from './modules/consent/index.js'; -// Imported straight from the file, NOT from ./modules/email/index.js — that -// barrel re-exports sendEmail, which imports 'server-only' and would crash when -// Payload loads the config (or runs generate:importmap) as a plain Node script. -export { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'; -export { graphAdapter } from './modules/email/graphAdapter.js'; -export { mailAdapter } from './modules/email/mailAdapter.js'; -export { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'; -// Validation rules are pure — exported server-side too, for re-validating a -// submission inside a server action. (useForm/useContactForm are client-only → -// '@intecion/ipal-kit/client'.) -export { buildValidator, isEmail, required, email, minLength, maxLength, checked, pattern, custom } from './modules/forms/validators.js'; -export { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'; -// Panel-managed form analytics (config-time field builder). -export { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'; -// Healthcheck route (Coolify/Docker liveness with a real DB round-trip). -export { createHealthRoute } from './modules/health/index.js'; -// Read-only MCP server (Claude/agents connect to the site and query it). -export { createMcpRoute } from './modules/mcp/index.js'; -// Boot-time environment validation (fail fast on misconfigured deploys). -export { assertEnv, ipalEnvRules } from './modules/env/index.js'; -export { getAnalyticsConfig } from './modules/analytics/index.js'; -export { buildSlugField, toSlug } from './modules/slug/index.js'; -export { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js'; -export { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js'; -export { buildSecurityHeaders } from './modules/security/index.js'; -export { buildCsp } from './modules/security/index.js'; -export { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'; -export { buildNoindexField } from './modules/seo/index.js'; -export { recordIntegrationStatus, buildIntegrationStatusField, buildIntegrationStatusBanner } from './modules/integrations/index.js'; -export { rowLabel } from './modules/admin-ui/index.js'; -export { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'; -export { buildSpeakableJsonLd } from './modules/seo/index.js'; -export { buildSummaryField } from './modules/seo/index.js'; -export { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js'; -// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage. -export { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js'; -export { buildArticleJsonLd } from './modules/seo/index.js'; -export { buildLlmsTxt } from './modules/seo/index.js'; -export { buildSitemapXml, buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './modules/seo/index.js'; -export { buildR2Storage } from './modules/storage/index.js'; -export { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js'; -export { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js'; -export { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index f717d15..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export { ipalKit } from './plugin.js'\nexport type { IpalOptions } from './types.js'\nexport type { I18nConfig, LocaleDefinition, LocalizedSlugs } from './modules/i18n/index.js'\nexport {\n buildLocalizedPath,\n getDefaultLocale,\n getLocaleCodes,\n getLocaleDefinition,\n getLocalizedSlugs,\n isValidLocale,\n LOCALE_COOKIE_NAME,\n matchAcceptLanguage,\n negotiateLocale,\n switchLocalePath,\n} from './modules/i18n/index.js'\nexport type { PagesOption, SystemPageRole } from './modules/pages/index.js'\nexport { ALL_SYSTEM_PAGE_ROLES, getSystemPagePath } from './modules/pages/index.js'\nexport type { AccessOption, Role } from './modules/access/index.js'\nexport {\n adminOnly,\n adminOnlyField,\n adminOrEditor,\n adminOrEditorField,\n adminOrSelf,\n authenticated,\n hasMinimumRole,\n isAdmin,\n isEditor,\n requireRole,\n requireRoleField,\n ROLE_HIERARCHY,\n} from './modules/access/index.js'\nexport type { GlobalQueryOptions } from './modules/payload/index.js'\nexport {\n getGlobal,\n getSiteSettings,\n getSiteIntegrations,\n SITE_SETTINGS_SLUG,\n SITE_INTEGRATIONS_SLUG,\n} from './modules/payload/index.js'\nexport type { SeoOption, SeoMeta, PageMetadata } from './modules/seo/index.js'\nexport {\n composeTitle,\n buildHreflangAlternates,\n buildMetadata,\n readSiteMetaConfig,\n slugsAcrossLocales,\n} from './modules/seo/index.js'\nexport type { SiteMetaConfig } from './modules/seo/index.js'\nexport type { ContentOption, ContentCollectionOption, ResolvedRoute } from './modules/content/index.js'\nexport { createContentHelpers } from './modules/frontend/index.js'\nexport {\n resolveRoute,\n resolveRedirect,\n resolveNotFoundPage,\n blocksToMarkdown,\n createMarkdownRenderer,\n markdownResponse,\n prefersMarkdown,\n markdownHref,\n MARKDOWN_PREFIX,\n searchContent,\n createSearchRoute,\n archiveFieldName,\n getArchiveEntries,\n buildArchivePath,\n buildEntryPath,\n parsePageParam,\n} from './modules/content/index.js'\nexport type { ArchiveEntries } from './modules/content/index.js'\nexport type { SearchResult } from './modules/content/index.js'\n// Lexical → Markdown (pure, no React) — for AI-readable output.\nexport { lexicalToMarkdown } from './modules/richtext/index.js'\nexport type { AutoFillMapping, SitemapEntry, RobotsRules, RobotsOptions } from './modules/seo/index.js'\nexport {\n buildAutoFillMetaHook,\n injectAutoFillMeta,\n createMetadataGenerator,\n createPageMetadata,\n buildSitemapEntries,\n buildRobots,\n AI_ASSISTANT_BOTS,\n AI_TRAINING_BOTS,\n} from './modules/seo/index.js'\nexport type { LocaleMiddlewareResult } from './modules/i18n/index.js'\nexport {\n createLocaleMiddleware,\n DEFAULT_MIDDLEWARE_MATCHER,\n} from './modules/i18n/index.js'\nexport { createProxy, DEFAULT_PROXY_MATCHER } from './modules/i18n/index.js'\nexport { resolveLocalized } from './modules/i18n/index.js'\nexport {\n CONSENT_CATEGORIES,\n DEFAULT_CONSENT,\n ACCEPT_ALL_CONSENT,\n REJECT_ALL_CONSENT,\n CONSENT_COOKIE,\n CONSENT_VERSION,\n CONSENT_MAX_AGE,\n serializeConsent,\n parseConsent,\n setDefaultConsent,\n updateConsent,\n getConsentTexts,\n} from './modules/consent/index.js'\nexport type { ConsentCategory, ConsentState, ConsentTexts } from './modules/consent/index.js'\n// Imported straight from the file, NOT from ./modules/email/index.js — that\n// barrel re-exports sendEmail, which imports 'server-only' and would crash when\n// Payload loads the config (or runs generate:importmap) as a plain Node script.\nexport { panelSmtpAdapter } from './modules/email/panelSmtpAdapter.js'\nexport { graphAdapter } from './modules/email/graphAdapter.js'\nexport { mailAdapter } from './modules/email/mailAdapter.js'\nexport type { MailAdapterArgs } from './modules/email/mailAdapter.js'\nexport type { GraphAdapterArgs } from './modules/email/graphAdapter.js'\nexport type { PanelSmtpAdapterArgs } from './modules/email/panelSmtpAdapter.js'\nexport { buildFormsPlugin } from './modules/forms/formsPluginConfig.js'\nexport type {\n FormsOption,\n FormsCollectionOverrides,\n FormsFieldsOverride,\n} from './modules/forms/types.js'\n// Validation rules are pure — exported server-side too, for re-validating a\n// submission inside a server action. (useForm/useContactForm are client-only →\n// '@intecion/ipal-kit/client'.)\nexport {\n buildValidator,\n isEmail,\n required,\n email,\n minLength,\n maxLength,\n checked,\n pattern,\n custom,\n} from './modules/forms/validators.js'\nexport type { Rule } from './modules/forms/validators.js'\nexport type { FormErrors, FormSubmitAction, Validator } from './modules/forms/useForm.js'\nexport { HONEYPOT_FIELD, honeypotInputProps, isHoneypotTripped } from './modules/forms/honeypot.js'\n// Panel-managed form analytics (config-time field builder).\nexport { buildFormAnalyticsFields } from './modules/forms/formAnalyticsFields.js'\n// Healthcheck route (Coolify/Docker liveness with a real DB round-trip).\nexport { createHealthRoute } from './modules/health/index.js'\n// Read-only MCP server (Claude/agents connect to the site and query it).\nexport { createMcpRoute } from './modules/mcp/index.js'\n// Boot-time environment validation (fail fast on misconfigured deploys).\nexport { assertEnv, ipalEnvRules } from './modules/env/index.js'\nexport type { EnvRule, EnvKind, AssertEnvOptions, IpalEnvFeatures } from './modules/env/index.js'\nexport type { AnalyticsConfig } from './modules/analytics/index.js'\nexport { getAnalyticsConfig } from './modules/analytics/index.js'\nexport { buildSlugField, toSlug } from './modules/slug/index.js'\nexport { createLlmsTxtRoute, createSitemapRouteHandler, createManifestHandler } from './modules/seo/index.js'\n\nexport { getNotificationTexts, resolveFormMessage, NOTIFICATION_FALLBACK } from './modules/notifications/index.js'\nexport { buildSecurityHeaders } from './modules/security/index.js'\nexport { buildCsp } from './modules/security/index.js'\nexport type { BuildCspArgs } from './modules/security/index.js'\nexport { buildIconsMetadata, buildOrganizationJsonLd, validateFaviconField } from './modules/seo/index.js'\nexport { buildNoindexField } from './modules/seo/index.js'\nexport { recordIntegrationStatus, buildIntegrationStatusField, buildIntegrationStatusBanner } from './modules/integrations/index.js'\nexport type { IntegrationStatus, IntegrationState } from './modules/integrations/index.js'\nexport { rowLabel } from './modules/admin-ui/index.js'\nexport type { RowLabelProps } from './modules/admin-ui/index.js'\nexport { buildLinkField, buildLinksField, resolveLinkHref } from './modules/links/index.js'\nexport type {\n LinkAppearance,\n LinkValue,\n BuildLinkFieldOptions,\n BuildLinksFieldOptions,\n ResolveLinkHrefOptions,\n} from './modules/links/index.js'\nexport { buildSpeakableJsonLd } from './modules/seo/index.js'\nexport { buildSummaryField } from './modules/seo/index.js'\nexport { buildWebSiteJsonLd, buildBreadcrumbJsonLd, buildSiteNavigationJsonLd } from './modules/seo/index.js'\n// Local SEO structured data — LocalBusiness (map pack), Service (offering), FAQPage.\nexport { buildLocalBusinessJsonLd, buildFaqJsonLd, buildServiceJsonLd } from './modules/seo/index.js'\nexport { buildArticleJsonLd } from './modules/seo/index.js'\nexport { buildLlmsTxt } from './modules/seo/index.js'\nexport { buildSitemapXml, buildSitemapCss, SITEMAP_STYLE_PARAM, DEFAULT_SITEMAP_CREDIT } from './modules/seo/index.js'\nexport type { SitemapRouteOptions, SitemapStyleOptions } from './modules/seo/index.js'\nexport { buildR2Storage } from './modules/storage/index.js'\nexport { normalizeFilename, normalizeFilenameHook, buildOptimizeUploadHook, buildOptimizeUploadField } from './modules/media/index.js'\nexport type { OptimizeUploadOptions } from './modules/media/index.js'\nexport { buildRevalidateHook, setPublishedAtHook, buildPreventDeleteSystemPage, buildValidateUniqueRole, trackSlugHistoryHook, buildCrossLocaleFieldSync } from './modules/hooks/index.js'\nexport { A11Y_COOKIE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './modules/accessibility/index.js'\nexport type { A11yState } from './modules/accessibility/index.js'\nexport type { SecurityHeader, BuildSecurityHeadersArgs } from './modules/security/index.js'\nexport type { NotificationTexts, FormNotificationTexts } from './modules/notifications/index.js'\n"],"names":["ipalKit","buildLocalizedPath","getDefaultLocale","getLocaleCodes","getLocaleDefinition","getLocalizedSlugs","isValidLocale","LOCALE_COOKIE_NAME","matchAcceptLanguage","negotiateLocale","switchLocalePath","ALL_SYSTEM_PAGE_ROLES","getSystemPagePath","adminOnly","adminOnlyField","adminOrEditor","adminOrEditorField","adminOrSelf","authenticated","hasMinimumRole","isAdmin","isEditor","requireRole","requireRoleField","ROLE_HIERARCHY","getGlobal","getSiteSettings","getSiteIntegrations","SITE_SETTINGS_SLUG","SITE_INTEGRATIONS_SLUG","composeTitle","buildHreflangAlternates","buildMetadata","readSiteMetaConfig","slugsAcrossLocales","createContentHelpers","resolveRoute","resolveRedirect","resolveNotFoundPage","blocksToMarkdown","createMarkdownRenderer","markdownResponse","prefersMarkdown","markdownHref","MARKDOWN_PREFIX","searchContent","createSearchRoute","archiveFieldName","getArchiveEntries","buildArchivePath","buildEntryPath","parsePageParam","lexicalToMarkdown","buildAutoFillMetaHook","injectAutoFillMeta","createMetadataGenerator","createPageMetadata","buildSitemapEntries","buildRobots","AI_ASSISTANT_BOTS","AI_TRAINING_BOTS","createLocaleMiddleware","DEFAULT_MIDDLEWARE_MATCHER","createProxy","DEFAULT_PROXY_MATCHER","resolveLocalized","CONSENT_CATEGORIES","DEFAULT_CONSENT","ACCEPT_ALL_CONSENT","REJECT_ALL_CONSENT","CONSENT_COOKIE","CONSENT_VERSION","CONSENT_MAX_AGE","serializeConsent","parseConsent","setDefaultConsent","updateConsent","getConsentTexts","panelSmtpAdapter","graphAdapter","mailAdapter","buildFormsPlugin","buildValidator","isEmail","required","email","minLength","maxLength","checked","pattern","custom","HONEYPOT_FIELD","honeypotInputProps","isHoneypotTripped","buildFormAnalyticsFields","createHealthRoute","createMcpRoute","assertEnv","ipalEnvRules","getAnalyticsConfig","buildSlugField","toSlug","createLlmsTxtRoute","createSitemapRouteHandler","createManifestHandler","getNotificationTexts","resolveFormMessage","NOTIFICATION_FALLBACK","buildSecurityHeaders","buildCsp","buildIconsMetadata","buildOrganizationJsonLd","validateFaviconField","buildNoindexField","recordIntegrationStatus","buildIntegrationStatusField","buildIntegrationStatusBanner","rowLabel","buildLinkField","buildLinksField","resolveLinkHref","buildSpeakableJsonLd","buildSummaryField","buildWebSiteJsonLd","buildBreadcrumbJsonLd","buildSiteNavigationJsonLd","buildLocalBusinessJsonLd","buildFaqJsonLd","buildServiceJsonLd","buildArticleJsonLd","buildLlmsTxt","buildSitemapXml","buildSitemapCss","SITEMAP_STYLE_PARAM","DEFAULT_SITEMAP_CREDIT","buildR2Storage","normalizeFilename","normalizeFilenameHook","buildOptimizeUploadHook","buildOptimizeUploadField","buildRevalidateHook","setPublishedAtHook","buildPreventDeleteSystemPage","buildValidateUniqueRole","trackSlugHistoryHook","buildCrossLocaleFieldSync","A11Y_COOKIE","A11Y_DEFAULT","a11yAttributes","parseA11y","serializeA11y"],"mappings":"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"} \ No newline at end of file diff --git a/dist/modules/access/access.d.ts b/dist/modules/access/access.d.ts deleted file mode 100644 index ec76b6a..0000000 --- a/dist/modules/access/access.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Access, FieldAccess } from 'payload'; -import type { Role } from './types.js'; -/** - * Collection-level access (returns boolean | Where). - * Use in collection `access.read/create/update/delete`. - */ -export declare const adminOnly: Access; -export declare const adminOrEditor: Access; -export declare const authenticated: Access; -/** Requires at least the given role. */ -export declare const requireRole: (minimum: Role) => Access; -/** Admins see all; others are constrained to their own document. */ -export declare const adminOrSelf: Access; -/** - * Field-level access (returns boolean only — no Where support). - * Use in field `access.read/update`. - */ -export declare const adminOnlyField: FieldAccess; -export declare const adminOrEditorField: FieldAccess; -/** Requires at least the given role, for field-level access. */ -export declare const requireRoleField: (minimum: Role) => FieldAccess; diff --git a/dist/modules/access/access.js b/dist/modules/access/access.js deleted file mode 100644 index 16e56d0..0000000 --- a/dist/modules/access/access.js +++ /dev/null @@ -1,29 +0,0 @@ -import { hasMinimumRole, isAdmin } from './predicates.js'; -/** - * Collection-level access (returns boolean | Where). - * Use in collection `access.read/create/update/delete`. - */ export const adminOnly = ({ req: { user } })=>isAdmin(user); -export const adminOrEditor = ({ req: { user } })=>hasMinimumRole(user, 'editor'); -export const authenticated = ({ req: { user } })=>Boolean(user); -/** Requires at least the given role. */ export const requireRole = (minimum)=>({ req: { user } })=>hasMinimumRole(user, minimum); -/** Admins see all; others are constrained to their own document. */ export const adminOrSelf = ({ req: { user } })=>{ - if (isAdmin(user)) { - return true; - } - if (!user) { - return false; - } - return { - id: { - equals: user.id - } - }; -}; -/** - * Field-level access (returns boolean only — no Where support). - * Use in field `access.read/update`. - */ export const adminOnlyField = ({ req: { user } })=>isAdmin(user); -export const adminOrEditorField = ({ req: { user } })=>hasMinimumRole(user, 'editor'); -/** Requires at least the given role, for field-level access. */ export const requireRoleField = (minimum)=>({ req: { user } })=>hasMinimumRole(user, minimum); - -//# sourceMappingURL=access.js.map \ No newline at end of file diff --git a/dist/modules/access/access.js.map b/dist/modules/access/access.js.map deleted file mode 100644 index 4fd68e0..0000000 --- a/dist/modules/access/access.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/access.ts"],"sourcesContent":["import type { Access, FieldAccess } from 'payload'\n\nimport type { Role } from './types.js'\n\nimport { hasMinimumRole, isAdmin } from './predicates.js'\n\n/**\n * Collection-level access (returns boolean | Where).\n * Use in collection `access.read/create/update/delete`.\n */\nexport const adminOnly: Access = ({ req: { user } }) => isAdmin(user)\n\nexport const adminOrEditor: Access = ({ req: { user } }) => hasMinimumRole(user, 'editor')\n\nexport const authenticated: Access = ({ req: { user } }) => Boolean(user)\n\n/** Requires at least the given role. */\nexport const requireRole =\n (minimum: Role): Access =>\n ({ req: { user } }) =>\n hasMinimumRole(user, minimum)\n\n/** Admins see all; others are constrained to their own document. */\nexport const adminOrSelf: Access = ({ req: { user } }) => {\n if (isAdmin(user)) {return true}\n if (!user) {return false}\n return { id: { equals: user.id } }\n}\n\n/**\n * Field-level access (returns boolean only — no Where support).\n * Use in field `access.read/update`.\n */\nexport const adminOnlyField: FieldAccess = ({ req: { user } }) => isAdmin(user)\n\nexport const adminOrEditorField: FieldAccess = ({ req: { user } }) => hasMinimumRole(user, 'editor')\n\n/** Requires at least the given role, for field-level access. */\nexport const requireRoleField =\n (minimum: Role): FieldAccess =>\n ({ req: { user } }) =>\n hasMinimumRole(user, minimum)\n"],"names":["hasMinimumRole","isAdmin","adminOnly","req","user","adminOrEditor","authenticated","Boolean","requireRole","minimum","adminOrSelf","id","equals","adminOnlyField","adminOrEditorField","requireRoleField"],"mappings":"AAIA,SAASA,cAAc,EAAEC,OAAO,QAAQ,kBAAiB;AAEzD;;;CAGC,GACD,OAAO,MAAMC,YAAoB,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKH,QAAQG,MAAK;AAErE,OAAO,MAAMC,gBAAwB,CAAC,EAAEF,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKJ,eAAeI,MAAM,UAAS;AAE1F,OAAO,MAAME,gBAAwB,CAAC,EAAEH,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKG,QAAQH,MAAK;AAEzE,sCAAsC,GACtC,OAAO,MAAMI,cACX,CAACC,UACD,CAAC,EAAEN,KAAK,EAAEC,IAAI,EAAE,EAAE,GAChBJ,eAAeI,MAAMK,SAAQ;AAEjC,kEAAkE,GAClE,OAAO,MAAMC,cAAsB,CAAC,EAAEP,KAAK,EAAEC,IAAI,EAAE,EAAE;IACnD,IAAIH,QAAQG,OAAO;QAAC,OAAO;IAAI;IAC/B,IAAI,CAACA,MAAM;QAAC,OAAO;IAAK;IACxB,OAAO;QAAEO,IAAI;YAAEC,QAAQR,KAAKO,EAAE;QAAC;IAAE;AACnC,EAAC;AAED;;;CAGC,GACD,OAAO,MAAME,iBAA8B,CAAC,EAAEV,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKH,QAAQG,MAAK;AAE/E,OAAO,MAAMU,qBAAkC,CAAC,EAAEX,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKJ,eAAeI,MAAM,UAAS;AAEpG,8DAA8D,GAC9D,OAAO,MAAMW,mBACX,CAACN,UACD,CAAC,EAAEN,KAAK,EAAEC,IAAI,EAAE,EAAE,GAChBJ,eAAeI,MAAMK,SAAQ"} \ No newline at end of file diff --git a/dist/modules/access/index.d.ts b/dist/modules/access/index.d.ts deleted file mode 100644 index e6a8d16..0000000 --- a/dist/modules/access/index.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField, } from './access.js'; -export { injectRoles } from './injectRoles.js'; -export { hasMinimumRole, isAdmin, isEditor } from './predicates.js'; -export { buildRolesField } from './rolesField.js'; -export type { AccessOption, Role } from './types.js'; -export { ROLE_HIERARCHY } from './types.js'; diff --git a/dist/modules/access/index.js b/dist/modules/access/index.js deleted file mode 100644 index f466bc5..0000000 --- a/dist/modules/access/index.js +++ /dev/null @@ -1,7 +0,0 @@ -export { adminOnly, adminOnlyField, adminOrEditor, adminOrEditorField, adminOrSelf, authenticated, requireRole, requireRoleField } from './access.js'; -export { injectRoles } from './injectRoles.js'; -export { hasMinimumRole, isAdmin, isEditor } from './predicates.js'; -export { buildRolesField } from './rolesField.js'; -export { ROLE_HIERARCHY } from './types.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/access/index.js.map b/dist/modules/access/index.js.map deleted file mode 100644 index 6a3b064..0000000 --- a/dist/modules/access/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/index.ts"],"sourcesContent":["export {\n adminOnly,\n adminOnlyField,\n adminOrEditor,\n adminOrEditorField,\n adminOrSelf,\n authenticated,\n requireRole,\n requireRoleField,\n} from './access.js'\nexport { injectRoles } from './injectRoles.js'\nexport { hasMinimumRole, isAdmin, isEditor } from './predicates.js'\nexport { buildRolesField } from './rolesField.js'\nexport type { AccessOption, Role } from './types.js'\nexport { ROLE_HIERARCHY } from './types.js'\n"],"names":["adminOnly","adminOnlyField","adminOrEditor","adminOrEditorField","adminOrSelf","authenticated","requireRole","requireRoleField","injectRoles","hasMinimumRole","isAdmin","isEditor","buildRolesField","ROLE_HIERARCHY"],"mappings":"AAAA,SACEA,SAAS,EACTC,cAAc,EACdC,aAAa,EACbC,kBAAkB,EAClBC,WAAW,EACXC,aAAa,EACbC,WAAW,EACXC,gBAAgB,QACX,cAAa;AACpB,SAASC,WAAW,QAAQ,mBAAkB;AAC9C,SAASC,cAAc,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,kBAAiB;AACnE,SAASC,eAAe,QAAQ,kBAAiB;AAEjD,SAASC,cAAc,QAAQ,aAAY"} \ No newline at end of file diff --git a/dist/modules/access/injectRoles.d.ts b/dist/modules/access/injectRoles.d.ts deleted file mode 100644 index 41d8a0d..0000000 --- a/dist/modules/access/injectRoles.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Config } from 'payload'; -import type { AccessOption } from './types.js'; -/** - * Injects the fixed `roles` field into the client's auth collection. - * - * The plugin owns the role definition; the client owns the collection. This - * finds the collection by slug and appends the field. We control the whole - * stack, so no conflict handling is needed — the field is simply added. - */ -export declare function injectRoles(config: Config, access: AccessOption): Config; diff --git a/dist/modules/access/injectRoles.js b/dist/modules/access/injectRoles.js deleted file mode 100644 index e43897b..0000000 --- a/dist/modules/access/injectRoles.js +++ /dev/null @@ -1,27 +0,0 @@ -import { buildRolesField } from './rolesField.js'; -/** - * Injects the fixed `roles` field into the client's auth collection. - * - * The plugin owns the role definition; the client owns the collection. This - * finds the collection by slug and appends the field. We control the whole - * stack, so no conflict handling is needed — the field is simply added. - */ export function injectRoles(config, access) { - const rolesField = buildRolesField(access.defaultRole); - return { - ...config, - collections: (config.collections ?? []).map((collection)=>{ - if (collection.slug !== access.authCollection) { - return collection; - } - return { - ...collection, - fields: [ - ...collection.fields, - rolesField - ] - }; - }) - }; -} - -//# sourceMappingURL=injectRoles.js.map \ No newline at end of file diff --git a/dist/modules/access/injectRoles.js.map b/dist/modules/access/injectRoles.js.map deleted file mode 100644 index 8e74bdf..0000000 --- a/dist/modules/access/injectRoles.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/injectRoles.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport type { AccessOption } from './types.js'\n\nimport { buildRolesField } from './rolesField.js'\n\n/**\n * Injects the fixed `roles` field into the client's auth collection.\n *\n * The plugin owns the role definition; the client owns the collection. This\n * finds the collection by slug and appends the field. We control the whole\n * stack, so no conflict handling is needed — the field is simply added.\n */\nexport function injectRoles(config: Config, access: AccessOption): Config {\n const rolesField = buildRolesField(access.defaultRole)\n\n return {\n ...config,\n collections: (config.collections ?? []).map((collection) => {\n if (collection.slug !== access.authCollection) {\n return collection\n }\n return {\n ...collection,\n fields: [...collection.fields, rolesField],\n }\n }),\n }\n}\n"],"names":["buildRolesField","injectRoles","config","access","rolesField","defaultRole","collections","map","collection","slug","authCollection","fields"],"mappings":"AAIA,SAASA,eAAe,QAAQ,kBAAiB;AAEjD;;;;;;CAMC,GACD,OAAO,SAASC,YAAYC,MAAc,EAAEC,MAAoB;IAC9D,MAAMC,aAAaJ,gBAAgBG,OAAOE,WAAW;IAErD,OAAO;QACL,GAAGH,MAAM;QACTI,aAAa,AAACJ,CAAAA,OAAOI,WAAW,IAAI,EAAE,AAAD,EAAGC,GAAG,CAAC,CAACC;YAC3C,IAAIA,WAAWC,IAAI,KAAKN,OAAOO,cAAc,EAAE;gBAC7C,OAAOF;YACT;YACA,OAAO;gBACL,GAAGA,UAAU;gBACbG,QAAQ;uBAAIH,WAAWG,MAAM;oBAAEP;iBAAW;YAC5C;QACF;IACF;AACF"} \ No newline at end of file diff --git a/dist/modules/access/predicates.d.ts b/dist/modules/access/predicates.d.ts deleted file mode 100644 index 50d0f3b..0000000 --- a/dist/modules/access/predicates.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { Role } from './types.js'; -/** - * The plugin can't know the client's generated User type, and Payload types - * `req.user` loosely (UntypedUser | null). Predicates therefore accept an - * unknown-ish user and read `roles` defensively — no assumptions about shape - * beyond an optional roles array. - */ -type MaybeUser = { - roles?: null | Role[]; -} | null | Record | undefined; -/** - * True if the user holds at least the given role in the hierarchy. - * admin satisfies 'editor' and 'user'; editor satisfies 'user'. - */ -export declare function hasMinimumRole(user: MaybeUser, minimum: Role): boolean; -/** True if the user is an admin. */ -export declare function isAdmin(user: MaybeUser): boolean; -/** True if the user is an editor or higher (editor, admin). */ -export declare function isEditor(user: MaybeUser): boolean; -export {}; diff --git a/dist/modules/access/predicates.js b/dist/modules/access/predicates.js deleted file mode 100644 index b68a956..0000000 --- a/dist/modules/access/predicates.js +++ /dev/null @@ -1,32 +0,0 @@ -import { ROLE_HIERARCHY } from './types.js'; -/** Safely extracts the roles array from a loosely-typed user. */ function getRoles(user) { - if (!user || typeof user !== 'object') { - return []; - } - const roles = user.roles; - if (!Array.isArray(roles)) { - return []; - } - return roles.filter((role)=>ROLE_HIERARCHY.includes(role)); -} -/** Highest-privilege role index the user holds, or -1 if none. */ function highestRoleIndex(user) { - const roles = getRoles(user); - if (!roles.length) { - return -1; - } - return Math.max(...roles.map((role)=>ROLE_HIERARCHY.indexOf(role))); -} -/** - * True if the user holds at least the given role in the hierarchy. - * admin satisfies 'editor' and 'user'; editor satisfies 'user'. - */ export function hasMinimumRole(user, minimum) { - return highestRoleIndex(user) >= ROLE_HIERARCHY.indexOf(minimum); -} -/** True if the user is an admin. */ export function isAdmin(user) { - return hasMinimumRole(user, 'admin'); -} -/** True if the user is an editor or higher (editor, admin). */ export function isEditor(user) { - return hasMinimumRole(user, 'editor'); -} - -//# sourceMappingURL=predicates.js.map \ No newline at end of file diff --git a/dist/modules/access/predicates.js.map b/dist/modules/access/predicates.js.map deleted file mode 100644 index cd6db80..0000000 --- a/dist/modules/access/predicates.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/predicates.ts"],"sourcesContent":["import type { Role } from './types.js'\n\nimport { ROLE_HIERARCHY } from './types.js'\n\n/**\n * The plugin can't know the client's generated User type, and Payload types\n * `req.user` loosely (UntypedUser | null). Predicates therefore accept an\n * unknown-ish user and read `roles` defensively — no assumptions about shape\n * beyond an optional roles array.\n */\ntype MaybeUser = { roles?: null | Role[] } | null | Record | undefined\n\n/** Safely extracts the roles array from a loosely-typed user. */\nfunction getRoles(user: MaybeUser): Role[] {\n if (!user || typeof user !== 'object') {return []}\n const roles = (user as { roles?: unknown }).roles\n if (!Array.isArray(roles)) {return []}\n return roles.filter((role): role is Role => ROLE_HIERARCHY.includes(role as Role))\n}\n\n/** Highest-privilege role index the user holds, or -1 if none. */\nfunction highestRoleIndex(user: MaybeUser): number {\n const roles = getRoles(user)\n if (!roles.length) {return -1}\n return Math.max(...roles.map((role) => ROLE_HIERARCHY.indexOf(role)))\n}\n\n/**\n * True if the user holds at least the given role in the hierarchy.\n * admin satisfies 'editor' and 'user'; editor satisfies 'user'.\n */\nexport function hasMinimumRole(user: MaybeUser, minimum: Role): boolean {\n return highestRoleIndex(user) >= ROLE_HIERARCHY.indexOf(minimum)\n}\n\n/** True if the user is an admin. */\nexport function isAdmin(user: MaybeUser): boolean {\n return hasMinimumRole(user, 'admin')\n}\n\n/** True if the user is an editor or higher (editor, admin). */\nexport function isEditor(user: MaybeUser): boolean {\n return hasMinimumRole(user, 'editor')\n}\n"],"names":["ROLE_HIERARCHY","getRoles","user","roles","Array","isArray","filter","role","includes","highestRoleIndex","length","Math","max","map","indexOf","hasMinimumRole","minimum","isAdmin","isEditor"],"mappings":"AAEA,SAASA,cAAc,QAAQ,aAAY;AAU3C,+DAA+D,GAC/D,SAASC,SAASC,IAAe;IAC/B,IAAI,CAACA,QAAQ,OAAOA,SAAS,UAAU;QAAC,OAAO,EAAE;IAAA;IACjD,MAAMC,QAAQ,AAACD,KAA6BC,KAAK;IACjD,IAAI,CAACC,MAAMC,OAAO,CAACF,QAAQ;QAAC,OAAO,EAAE;IAAA;IACrC,OAAOA,MAAMG,MAAM,CAAC,CAACC,OAAuBP,eAAeQ,QAAQ,CAACD;AACtE;AAEA,gEAAgE,GAChE,SAASE,iBAAiBP,IAAe;IACvC,MAAMC,QAAQF,SAASC;IACvB,IAAI,CAACC,MAAMO,MAAM,EAAE;QAAC,OAAO,CAAC;IAAC;IAC7B,OAAOC,KAAKC,GAAG,IAAIT,MAAMU,GAAG,CAAC,CAACN,OAASP,eAAec,OAAO,CAACP;AAChE;AAEA;;;CAGC,GACD,OAAO,SAASQ,eAAeb,IAAe,EAAEc,OAAa;IAC3D,OAAOP,iBAAiBP,SAASF,eAAec,OAAO,CAACE;AAC1D;AAEA,kCAAkC,GAClC,OAAO,SAASC,QAAQf,IAAe;IACrC,OAAOa,eAAeb,MAAM;AAC9B;AAEA,6DAA6D,GAC7D,OAAO,SAASgB,SAAShB,IAAe;IACtC,OAAOa,eAAeb,MAAM;AAC9B"} \ No newline at end of file diff --git a/dist/modules/access/rolesField.d.ts b/dist/modules/access/rolesField.d.ts deleted file mode 100644 index 7724f6d..0000000 --- a/dist/modules/access/rolesField.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Field } from 'payload'; -import type { Role } from './types.js'; -/** - * Builds the fixed `roles` field the plugin injects into the auth collection. - * - * Saved to the JWT so role checks avoid a database lookup. Only admins can - * change roles, preventing privilege escalation by lower-privilege users. - */ -export declare function buildRolesField(defaultRole?: Role): Field; diff --git a/dist/modules/access/rolesField.js b/dist/modules/access/rolesField.js deleted file mode 100644 index 73f474b..0000000 --- a/dist/modules/access/rolesField.js +++ /dev/null @@ -1,32 +0,0 @@ -import { isAdmin } from './predicates.js'; -import { ROLE_HIERARCHY } from './types.js'; -/** - * Builds the fixed `roles` field the plugin injects into the auth collection. - * - * Saved to the JWT so role checks avoid a database lookup. Only admins can - * change roles, preventing privilege escalation by lower-privilege users. - */ export function buildRolesField(defaultRole = 'user') { - return { - name: 'roles', - type: 'select', - access: { - // Only admins may assign or change roles - update: ({ req: { user } })=>isAdmin(user) - }, - admin: { - description: 'Role hierarchy: admin > editor > user.' - }, - defaultValue: [ - defaultRole - ], - hasMany: true, - options: ROLE_HIERARCHY.map((role)=>({ - label: role.charAt(0).toUpperCase() + role.slice(1), - value: role - })), - required: true, - saveToJWT: true - }; -} - -//# sourceMappingURL=rolesField.js.map \ No newline at end of file diff --git a/dist/modules/access/rolesField.js.map b/dist/modules/access/rolesField.js.map deleted file mode 100644 index ac8872c..0000000 --- a/dist/modules/access/rolesField.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/rolesField.ts"],"sourcesContent":["import type { Field } from 'payload'\n\nimport type { Role } from './types.js'\n\nimport { isAdmin } from './predicates.js'\nimport { ROLE_HIERARCHY } from './types.js'\n\n/**\n * Builds the fixed `roles` field the plugin injects into the auth collection.\n *\n * Saved to the JWT so role checks avoid a database lookup. Only admins can\n * change roles, preventing privilege escalation by lower-privilege users.\n */\nexport function buildRolesField(defaultRole: Role = 'user'): Field {\n return {\n name: 'roles',\n type: 'select',\n access: {\n // Only admins may assign or change roles\n update: ({ req: { user } }) => isAdmin(user),\n },\n admin: {\n description: 'Role hierarchy: admin > editor > user.',\n },\n defaultValue: [defaultRole],\n hasMany: true,\n options: ROLE_HIERARCHY.map((role) => ({\n label: role.charAt(0).toUpperCase() + role.slice(1),\n value: role,\n })),\n required: true,\n saveToJWT: true,\n }\n}\n"],"names":["isAdmin","ROLE_HIERARCHY","buildRolesField","defaultRole","name","type","access","update","req","user","admin","description","defaultValue","hasMany","options","map","role","label","charAt","toUpperCase","slice","value","required","saveToJWT"],"mappings":"AAIA,SAASA,OAAO,QAAQ,kBAAiB;AACzC,SAASC,cAAc,QAAQ,aAAY;AAE3C;;;;;CAKC,GACD,OAAO,SAASC,gBAAgBC,cAAoB,MAAM;IACxD,OAAO;QACLC,MAAM;QACNC,MAAM;QACNC,QAAQ;YACN,yCAAyC;YACzCC,QAAQ,CAAC,EAAEC,KAAK,EAAEC,IAAI,EAAE,EAAE,GAAKT,QAAQS;QACzC;QACAC,OAAO;YACLC,aAAa;QACf;QACAC,cAAc;YAACT;SAAY;QAC3BU,SAAS;QACTC,SAASb,eAAec,GAAG,CAAC,CAACC,OAAU,CAAA;gBACrCC,OAAOD,KAAKE,MAAM,CAAC,GAAGC,WAAW,KAAKH,KAAKI,KAAK,CAAC;gBACjDC,OAAOL;YACT,CAAA;QACAM,UAAU;QACVC,WAAW;IACb;AACF"} \ No newline at end of file diff --git a/dist/modules/access/types.d.ts b/dist/modules/access/types.d.ts deleted file mode 100644 index 851d4cd..0000000 --- a/dist/modules/access/types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Role hierarchy, lowest to highest privilege. - * A higher role satisfies any requirement met by a lower one. - */ -export declare const ROLE_HIERARCHY: readonly ["user", "editor", "admin"]; -export type Role = (typeof ROLE_HIERARCHY)[number]; -/** - * Access-control options. - * - * The plugin injects a fixed `roles` field into the client's auth collection - * — the collection itself belongs to the client (create-payload-app), the - * role definition belongs to the plugin. - */ -export type AccessOption = { - /** Slug of the client's auth collection, e.g. 'users'. */ - authCollection: string; - /** Role assigned to new users. Defaults to 'user'. */ - defaultRole?: Role; -}; diff --git a/dist/modules/access/types.js b/dist/modules/access/types.js deleted file mode 100644 index 3afbaa8..0000000 --- a/dist/modules/access/types.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Role hierarchy, lowest to highest privilege. - * A higher role satisfies any requirement met by a lower one. - */ export const ROLE_HIERARCHY = [ - 'user', - 'editor', - 'admin' -]; - -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/modules/access/types.js.map b/dist/modules/access/types.js.map deleted file mode 100644 index 795ba05..0000000 --- a/dist/modules/access/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/access/types.ts"],"sourcesContent":["/**\n * Role hierarchy, lowest to highest privilege.\n * A higher role satisfies any requirement met by a lower one.\n */\nexport const ROLE_HIERARCHY = ['user', 'editor', 'admin'] as const\n\nexport type Role = (typeof ROLE_HIERARCHY)[number]\n\n/**\n * Access-control options.\n *\n * The plugin injects a fixed `roles` field into the client's auth collection\n * — the collection itself belongs to the client (create-payload-app), the\n * role definition belongs to the plugin.\n */\nexport type AccessOption = {\n /** Slug of the client's auth collection, e.g. 'users'. */\n authCollection: string\n /** Role assigned to new users. Defaults to 'user'. */\n defaultRole?: Role\n}\n"],"names":["ROLE_HIERARCHY"],"mappings":"AAAA;;;CAGC,GACD,OAAO,MAAMA,iBAAiB;IAAC;IAAQ;IAAU;CAAQ,CAAS"} \ No newline at end of file diff --git a/dist/modules/accessibility/AccessibilityProvider.d.ts b/dist/modules/accessibility/AccessibilityProvider.d.ts deleted file mode 100644 index f235b69..0000000 --- a/dist/modules/accessibility/AccessibilityProvider.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { type A11yState } from './state.js'; -type A11yContextValue = { - reset: () => void; - set: (key: K, value: A11yState[K]) => void; - state: A11yState; -}; -/** - * Provides accessibility preferences, persists them in a cookie, and applies them - * as data-attributes on so the project's CSS can react. Like - * ConsentProvider for cookies — wrap the app once; the widget/button consume it. - * - * The plugin ships NO styles: it only sets attributes (data-a11y-*). The project - * writes CSS for those it supports (see docs/accessibility.md). This keeps the - * design in the project's hands. - * - * // layout.tsx - * import { AccessibilityProvider } from '@intecion/ipal-kit/client' - * {children} - * - * To avoid a flash, the project can read the a11y-prefs cookie server-side and - * set the attributes on during SSR (see docs). This provider re-applies - * on the client and keeps them in sync. - */ -export declare function AccessibilityProvider({ children }: { - children: React.ReactNode; -}): import("react/jsx-runtime").JSX.Element; -/** Access accessibility preferences + setters. Use inside AccessibilityProvider. */ -export declare function useAccessibility(): A11yContextValue; -export {}; diff --git a/dist/modules/accessibility/AccessibilityProvider.js b/dist/modules/accessibility/AccessibilityProvider.js deleted file mode 100644 index 81b0861..0000000 --- a/dist/modules/accessibility/AccessibilityProvider.js +++ /dev/null @@ -1,87 +0,0 @@ -'use client'; -import { jsx as _jsx } from "react/jsx-runtime"; -import { createContext, use, useCallback, useEffect, useState } from 'react'; -import { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './state.js'; -const A11yContext = /*#__PURE__*/ createContext(null); -function readCookie(name) { - if (typeof document === 'undefined') { - return undefined; - } - const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`)); - return match ? decodeURIComponent(match[1]) : undefined; -} -/** - * Provides accessibility preferences, persists them in a cookie, and applies them - * as data-attributes on so the project's CSS can react. Like - * ConsentProvider for cookies — wrap the app once; the widget/button consume it. - * - * The plugin ships NO styles: it only sets attributes (data-a11y-*). The project - * writes CSS for those it supports (see docs/accessibility.md). This keeps the - * design in the project's hands. - * - * // layout.tsx - * import { AccessibilityProvider } from '@intecion/ipal-kit/client' - * {children} - * - * To avoid a flash, the project can read the a11y-prefs cookie server-side and - * set the attributes on during SSR (see docs). This provider re-applies - * on the client and keeps them in sync. - */ export function AccessibilityProvider({ children }) { - const [state, setState] = useState(A11Y_DEFAULT); - // Hydrate from cookie on mount. - useEffect(()=>{ - setState(parseA11y(readCookie(A11Y_COOKIE))); - }, []); - // Apply attributes to whenever state changes. - useEffect(()=>{ - const el = document.documentElement; - const attrs = a11yAttributes(state); - for (const [attr, value] of Object.entries(attrs)){ - if (value === null) { - el.removeAttribute(attr); - } else { - el.setAttribute(attr, value); - } - } - }, [ - state - ]); - const persist = useCallback((next)=>{ - document.cookie = `${A11Y_COOKIE}=${encodeURIComponent(serializeA11y(next))}; path=/; max-age=${A11Y_COOKIE_MAX_AGE}; samesite=lax`; - }, []); - const set = useCallback((key, value)=>{ - setState((prev)=>{ - const next = { - ...prev, - [key]: value - }; - persist(next); - return next; - }); - }, [ - persist - ]); - const reset = useCallback(()=>{ - setState(A11Y_DEFAULT); - persist(A11Y_DEFAULT); - }, [ - persist - ]); - return /*#__PURE__*/ _jsx(A11yContext, { - value: { - reset, - set, - state - }, - children: children - }); -} -/** Access accessibility preferences + setters. Use inside AccessibilityProvider. */ export function useAccessibility() { - const ctx = use(A11yContext); - if (!ctx) { - throw new Error('useAccessibility must be used within '); - } - return ctx; -} - -//# sourceMappingURL=AccessibilityProvider.js.map \ No newline at end of file diff --git a/dist/modules/accessibility/AccessibilityProvider.js.map b/dist/modules/accessibility/AccessibilityProvider.js.map deleted file mode 100644 index d9e8e41..0000000 --- a/dist/modules/accessibility/AccessibilityProvider.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/accessibility/AccessibilityProvider.tsx"],"sourcesContent":["'use client'\n\nimport { createContext, use, useCallback, useEffect, useState } from 'react'\n\nimport {\n A11Y_COOKIE,\n A11Y_COOKIE_MAX_AGE,\n A11Y_DEFAULT,\n a11yAttributes,\n type A11yState,\n parseA11y,\n serializeA11y,\n} from './state.js'\n\ntype A11yContextValue = {\n reset: () => void\n set: (key: K, value: A11yState[K]) => void\n state: A11yState\n}\n\nconst A11yContext = createContext(null)\n\nfunction readCookie(name: string): string | undefined {\n if (typeof document === 'undefined') {return undefined}\n const match = document.cookie.match(new RegExp(`(?:^|; )${name}=([^;]*)`))\n return match ? decodeURIComponent(match[1]) : undefined\n}\n\n/**\n * Provides accessibility preferences, persists them in a cookie, and applies them\n * as data-attributes on so the project's CSS can react. Like\n * ConsentProvider for cookies — wrap the app once; the widget/button consume it.\n *\n * The plugin ships NO styles: it only sets attributes (data-a11y-*). The project\n * writes CSS for those it supports (see docs/accessibility.md). This keeps the\n * design in the project's hands.\n *\n * // layout.tsx\n * import { AccessibilityProvider } from '@intecion/ipal-kit/client'\n * {children}\n *\n * To avoid a flash, the project can read the a11y-prefs cookie server-side and\n * set the attributes on during SSR (see docs). This provider re-applies\n * on the client and keeps them in sync.\n */\nexport function AccessibilityProvider({ children }: { children: React.ReactNode }) {\n const [state, setState] = useState(A11Y_DEFAULT)\n\n // Hydrate from cookie on mount.\n useEffect(() => {\n setState(parseA11y(readCookie(A11Y_COOKIE)))\n }, [])\n\n // Apply attributes to whenever state changes.\n useEffect(() => {\n const el = document.documentElement\n const attrs = a11yAttributes(state)\n for (const [attr, value] of Object.entries(attrs)) {\n if (value === null) {el.removeAttribute(attr)}\n else {el.setAttribute(attr, value)}\n }\n }, [state])\n\n const persist = useCallback((next: A11yState) => {\n document.cookie = `${A11Y_COOKIE}=${encodeURIComponent(\n serializeA11y(next),\n )}; path=/; max-age=${A11Y_COOKIE_MAX_AGE}; samesite=lax`\n }, [])\n\n const set = useCallback(\n (key: K, value: A11yState[K]) => {\n setState((prev) => {\n const next = { ...prev, [key]: value }\n persist(next)\n return next\n })\n },\n [persist],\n )\n\n const reset = useCallback(() => {\n setState(A11Y_DEFAULT)\n persist(A11Y_DEFAULT)\n }, [persist])\n\n return {children}\n}\n\n/** Access accessibility preferences + setters. Use inside AccessibilityProvider. */\nexport function useAccessibility(): A11yContextValue {\n const ctx = use(A11yContext)\n if (!ctx) {throw new Error('useAccessibility must be used within ')}\n return ctx\n}\n"],"names":["createContext","use","useCallback","useEffect","useState","A11Y_COOKIE","A11Y_COOKIE_MAX_AGE","A11Y_DEFAULT","a11yAttributes","parseA11y","serializeA11y","A11yContext","readCookie","name","document","undefined","match","cookie","RegExp","decodeURIComponent","AccessibilityProvider","children","state","setState","el","documentElement","attrs","attr","value","Object","entries","removeAttribute","setAttribute","persist","next","encodeURIComponent","set","key","prev","reset","useAccessibility","ctx","Error"],"mappings":"AAAA;;AAEA,SAASA,aAAa,EAAEC,GAAG,EAAEC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE5E,SACEC,WAAW,EACXC,mBAAmB,EACnBC,YAAY,EACZC,cAAc,EAEdC,SAAS,EACTC,aAAa,QACR,aAAY;AAQnB,MAAMC,4BAAcX,cAAuC;AAE3D,SAASY,WAAWC,IAAY;IAC9B,IAAI,OAAOC,aAAa,aAAa;QAAC,OAAOC;IAAS;IACtD,MAAMC,QAAQF,SAASG,MAAM,CAACD,KAAK,CAAC,IAAIE,OAAO,CAAC,QAAQ,EAAEL,KAAK,QAAQ,CAAC;IACxE,OAAOG,QAAQG,mBAAmBH,KAAK,CAAC,EAAE,IAAID;AAChD;AAEA;;;;;;;;;;;;;;;;CAgBC,GACD,OAAO,SAASK,sBAAsB,EAAEC,QAAQ,EAAiC;IAC/E,MAAM,CAACC,OAAOC,SAAS,GAAGnB,SAAoBG;IAE9C,gCAAgC;IAChCJ,UAAU;QACRoB,SAASd,UAAUG,WAAWP;IAChC,GAAG,EAAE;IAEL,qDAAqD;IACrDF,UAAU;QACR,MAAMqB,KAAKV,SAASW,eAAe;QACnC,MAAMC,QAAQlB,eAAec;QAC7B,KAAK,MAAM,CAACK,MAAMC,MAAM,IAAIC,OAAOC,OAAO,CAACJ,OAAQ;YACjD,IAAIE,UAAU,MAAM;gBAACJ,GAAGO,eAAe,CAACJ;YAAK,OACxC;gBAACH,GAAGQ,YAAY,CAACL,MAAMC;YAAM;QACpC;IACF,GAAG;QAACN;KAAM;IAEV,MAAMW,UAAU/B,YAAY,CAACgC;QAC3BpB,SAASG,MAAM,GAAG,GAAGZ,YAAY,CAAC,EAAE8B,mBAClCzB,cAAcwB,OACd,kBAAkB,EAAE5B,oBAAoB,cAAc,CAAC;IAC3D,GAAG,EAAE;IAEL,MAAM8B,MAAMlC,YACV,CAA4BmC,KAAQT;QAClCL,SAAS,CAACe;YACR,MAAMJ,OAAO;gBAAE,GAAGI,IAAI;gBAAE,CAACD,IAAI,EAAET;YAAM;YACrCK,QAAQC;YACR,OAAOA;QACT;IACF,GACA;QAACD;KAAQ;IAGX,MAAMM,QAAQrC,YAAY;QACxBqB,SAAShB;QACT0B,QAAQ1B;IACV,GAAG;QAAC0B;KAAQ;IAEZ,qBAAO,KAACtB;QAAYiB,OAAO;YAAEW;YAAOH;YAAKd;QAAM;kBAAID;;AACrD;AAEA,kFAAkF,GAClF,OAAO,SAASmB;IACd,MAAMC,MAAMxC,IAAIU;IAChB,IAAI,CAAC8B,KAAK;QAAC,MAAM,IAAIC,MAAM;IAA+D;IAC1F,OAAOD;AACT"} \ No newline at end of file diff --git a/dist/modules/accessibility/AccessibilityWidget.d.ts b/dist/modules/accessibility/AccessibilityWidget.d.ts deleted file mode 100644 index 5668d42..0000000 --- a/dist/modules/accessibility/AccessibilityWidget.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export type A11yTexts = { - bigCursor?: string; - close?: string; - contrast?: string; - contrastHigh?: string; - contrastInverted?: string; - grayscale?: string; - lineHeight?: string; - open?: string; - readableFont?: string; - reduceMotion?: string; - reset?: string; - textSize?: string; - title?: string; - underlineLinks?: string; -}; -export type A11yClassNames = { - active?: string; - button?: string; - closeButton?: string; - control?: string; - label?: string; - panel?: string; - resetButton?: string; - row?: string; -}; -/** - * Accessibility toolbar: a floating button that opens a panel of options (text - * size, line height, contrast, grayscale, underline links, readable font, reduce - * motion, big cursor). Choices persist in a cookie and apply as data-attributes - * on (the project's CSS styles them). - * - * Unstyled by default — pass classNames to match the project's design (like - * CookieBanner). Wrap the app in first. - * - * - * - * Labels default to English; localize per locale by passing `texts` for the - * active language. Keep the translations in the project (or a localized global) - * and pass the active locale's set — the plugin stays content-agnostic: - * - * const A11Y: Record = { - * pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', … }, - * de: { title: 'Barrierefreiheit', … }, - * } - * - */ -export declare function AccessibilityWidget({ classNames, texts, }: { - classNames?: A11yClassNames; - texts?: A11yTexts; -}): import("react/jsx-runtime").JSX.Element; diff --git a/dist/modules/accessibility/AccessibilityWidget.js b/dist/modules/accessibility/AccessibilityWidget.js deleted file mode 100644 index e3d772b..0000000 --- a/dist/modules/accessibility/AccessibilityWidget.js +++ /dev/null @@ -1,202 +0,0 @@ -'use client'; -import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; -import { useState } from 'react'; -import { useAccessibility } from './AccessibilityProvider.js'; -/** - * English defaults. The widget is end-user facing and multilingual projects run - * in many locales, so the plugin ships a neutral English baseline — NOT Polish. - * Localize by passing `texts` for the active locale (see the component doc). - */ const DEFAULT_TEXTS = { - bigCursor: 'Large cursor', - close: 'Close', - contrast: 'Contrast', - contrastHigh: 'High', - contrastInverted: 'Inverted', - grayscale: 'Grayscale', - lineHeight: 'Line spacing', - open: 'Open accessibility panel', - readableFont: 'Readable font', - reduceMotion: 'Reduce motion', - reset: 'Reset', - textSize: 'Text size', - title: 'Accessibility', - underlineLinks: 'Underline links' -}; -/** - * Accessibility toolbar: a floating button that opens a panel of options (text - * size, line height, contrast, grayscale, underline links, readable font, reduce - * motion, big cursor). Choices persist in a cookie and apply as data-attributes - * on (the project's CSS styles them). - * - * Unstyled by default — pass classNames to match the project's design (like - * CookieBanner). Wrap the app in first. - * - * - * - * Labels default to English; localize per locale by passing `texts` for the - * active language. Keep the translations in the project (or a localized global) - * and pass the active locale's set — the plugin stays content-agnostic: - * - * const A11Y: Record = { - * pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', … }, - * de: { title: 'Barrierefreiheit', … }, - * } - * - */ export function AccessibilityWidget({ classNames, texts }) { - const { reset, set, state } = useAccessibility(); - const [open, setOpen] = useState(false); - const t = { - ...DEFAULT_TEXTS, - ...texts - }; - const cn = classNames ?? {}; - const toggle = (key)=>set(key, !state[key]); - const isActive = (on)=>on ? cn.active ?? '' : ''; - return /*#__PURE__*/ _jsxs(_Fragment, { - children: [ - /*#__PURE__*/ _jsx("button", { - "aria-expanded": open, - "aria-label": t.open, - className: cn.button, - onClick: ()=>setOpen((o)=>!o), - type: "button", - children: /*#__PURE__*/ _jsx("span", { - "aria-hidden": "true", - children: "♿" - }) - }), - open && /*#__PURE__*/ _jsxs("div", { - "aria-label": t.title, - className: cn.panel, - role: "dialog", - children: [ - /*#__PURE__*/ _jsxs("div", { - className: cn.row, - children: [ - /*#__PURE__*/ _jsx("span", { - className: cn.label, - children: t.textSize - }), - /*#__PURE__*/ _jsx("div", { - className: cn.control, - children: [ - 0, - 1, - 2, - 3 - ].map((n)=>/*#__PURE__*/ _jsxs("button", { - className: isActive(state.textSize === n), - onClick: ()=>set('textSize', n), - type: "button", - children: [ - "A", - n > 0 ? '+'.repeat(n) : '' - ] - }, n)) - }) - ] - }), - /*#__PURE__*/ _jsxs("div", { - className: cn.row, - children: [ - /*#__PURE__*/ _jsx("span", { - className: cn.label, - children: t.lineHeight - }), - /*#__PURE__*/ _jsx("div", { - className: cn.control, - children: [ - 0, - 1, - 2 - ].map((n)=>/*#__PURE__*/ _jsx("button", { - className: isActive(state.lineHeight === n), - onClick: ()=>set('lineHeight', n), - type: "button", - children: n === 0 ? '—' : '≡'.repeat(n) - }, n)) - }) - ] - }), - /*#__PURE__*/ _jsxs("div", { - className: cn.row, - children: [ - /*#__PURE__*/ _jsx("span", { - className: cn.label, - children: t.contrast - }), - /*#__PURE__*/ _jsxs("div", { - className: cn.control, - children: [ - /*#__PURE__*/ _jsx("button", { - className: isActive(state.contrast === 'high'), - onClick: ()=>set('contrast', state.contrast === 'high' ? 'default' : 'high'), - type: "button", - children: t.contrastHigh - }), - /*#__PURE__*/ _jsx("button", { - className: isActive(state.contrast === 'inverted'), - onClick: ()=>set('contrast', state.contrast === 'inverted' ? 'default' : 'inverted'), - type: "button", - children: t.contrastInverted - }) - ] - }) - ] - }), - [ - [ - 'grayscale', - t.grayscale - ], - [ - 'underlineLinks', - t.underlineLinks - ], - [ - 'readableFont', - t.readableFont - ], - [ - 'reduceMotion', - t.reduceMotion - ], - [ - 'bigCursor', - t.bigCursor - ] - ].map(([key, label])=>/*#__PURE__*/ _jsxs("div", { - className: cn.row, - children: [ - /*#__PURE__*/ _jsx("span", { - className: cn.label, - children: label - }), - /*#__PURE__*/ _jsx("button", { - "aria-pressed": Boolean(state[key]), - className: `${cn.control ?? ''} ${isActive(Boolean(state[key]))}`, - onClick: ()=>toggle(key), - type: "button", - children: state[key] ? 'ON' : 'OFF' - }) - ] - }, key)), - /*#__PURE__*/ _jsx("button", { - className: cn.resetButton, - onClick: reset, - type: "button", - children: t.reset - }), - /*#__PURE__*/ _jsx("button", { - className: cn.closeButton, - onClick: ()=>setOpen(false), - type: "button", - children: t.close - }) - ] - }) - ] - }); -} - -//# sourceMappingURL=AccessibilityWidget.js.map \ No newline at end of file diff --git a/dist/modules/accessibility/AccessibilityWidget.js.map b/dist/modules/accessibility/AccessibilityWidget.js.map deleted file mode 100644 index 5c5a008..0000000 --- a/dist/modules/accessibility/AccessibilityWidget.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/accessibility/AccessibilityWidget.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\n\nimport type { A11yState } from './state.js'\n\nimport { useAccessibility } from './AccessibilityProvider.js'\n\nexport type A11yTexts = {\n bigCursor?: string\n close?: string\n contrast?: string\n contrastHigh?: string\n contrastInverted?: string\n grayscale?: string\n lineHeight?: string\n open?: string\n readableFont?: string\n reduceMotion?: string\n reset?: string\n textSize?: string\n title?: string\n underlineLinks?: string\n}\n\n/**\n * English defaults. The widget is end-user facing and multilingual projects run\n * in many locales, so the plugin ships a neutral English baseline — NOT Polish.\n * Localize by passing `texts` for the active locale (see the component doc).\n */\nconst DEFAULT_TEXTS: Required = {\n bigCursor: 'Large cursor',\n close: 'Close',\n contrast: 'Contrast',\n contrastHigh: 'High',\n contrastInverted: 'Inverted',\n grayscale: 'Grayscale',\n lineHeight: 'Line spacing',\n open: 'Open accessibility panel',\n readableFont: 'Readable font',\n reduceMotion: 'Reduce motion',\n reset: 'Reset',\n textSize: 'Text size',\n title: 'Accessibility',\n underlineLinks: 'Underline links',\n}\n\nexport type A11yClassNames = {\n active?: string\n button?: string\n closeButton?: string\n control?: string\n label?: string\n panel?: string\n resetButton?: string\n row?: string\n}\n\n/**\n * Accessibility toolbar: a floating button that opens a panel of options (text\n * size, line height, contrast, grayscale, underline links, readable font, reduce\n * motion, big cursor). Choices persist in a cookie and apply as data-attributes\n * on (the project's CSS styles them).\n *\n * Unstyled by default — pass classNames to match the project's design (like\n * CookieBanner). Wrap the app in first.\n *\n * \n *\n * Labels default to English; localize per locale by passing `texts` for the\n * active language. Keep the translations in the project (or a localized global)\n * and pass the active locale's set — the plugin stays content-agnostic:\n *\n * const A11Y: Record = {\n * pl: { title: 'Dostępność', textSize: 'Rozmiar tekstu', … },\n * de: { title: 'Barrierefreiheit', … },\n * }\n * \n */\nexport function AccessibilityWidget({\n classNames,\n texts,\n}: {\n classNames?: A11yClassNames\n texts?: A11yTexts\n}) {\n const { reset, set, state } = useAccessibility()\n const [open, setOpen] = useState(false)\n const t = { ...DEFAULT_TEXTS, ...texts }\n const cn = classNames ?? {}\n\n const toggle = (key: K) => set(key, !state[key] as A11yState[K])\n\n const isActive = (on: boolean) => (on ? (cn.active ?? '') : '')\n\n return (\n <>\n setOpen((o) => !o)}\n type=\"button\"\n >\n {/* Project can style/replace via CSS; simple glyph fallback. */}\n ♿\n \n\n {open && (\n
\n
\n {t.textSize}\n
\n {[0, 1, 2, 3].map((n) => (\n set('textSize', n as A11yState['textSize'])}\n type=\"button\"\n >\n A{n > 0 ? '+'.repeat(n) : ''}\n \n ))}\n
\n
\n\n
\n {t.lineHeight}\n
\n {[0, 1, 2].map((n) => (\n set('lineHeight', n as A11yState['lineHeight'])}\n type=\"button\"\n >\n {n === 0 ? '—' : '≡'.repeat(n)}\n \n ))}\n
\n
\n\n
\n {t.contrast}\n
\n set('contrast', state.contrast === 'high' ? 'default' : 'high')}\n type=\"button\"\n >\n {t.contrastHigh}\n \n \n set('contrast', state.contrast === 'inverted' ? 'default' : 'inverted')\n }\n type=\"button\"\n >\n {t.contrastInverted}\n \n
\n
\n\n {(\n [\n ['grayscale', t.grayscale],\n ['underlineLinks', t.underlineLinks],\n ['readableFont', t.readableFont],\n ['reduceMotion', t.reduceMotion],\n ['bigCursor', t.bigCursor],\n ] as Array<[keyof A11yState, string]>\n ).map(([key, label]) => (\n
\n {label}\n toggle(key)}\n type=\"button\"\n >\n {state[key] ? 'ON' : 'OFF'}\n \n
\n ))}\n\n \n \n
\n )}\n \n )\n}\n"],"names":["useState","useAccessibility","DEFAULT_TEXTS","bigCursor","close","contrast","contrastHigh","contrastInverted","grayscale","lineHeight","open","readableFont","reduceMotion","reset","textSize","title","underlineLinks","AccessibilityWidget","classNames","texts","set","state","setOpen","t","cn","toggle","key","isActive","on","active","button","aria-expanded","aria-label","className","onClick","o","type","span","aria-hidden","div","panel","role","row","label","control","map","n","repeat","aria-pressed","Boolean","resetButton","closeButton"],"mappings":"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"} \ No newline at end of file diff --git a/dist/modules/accessibility/client.d.ts b/dist/modules/accessibility/client.d.ts deleted file mode 100644 index a71f0fd..0000000 --- a/dist/modules/accessibility/client.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'; -export { AccessibilityWidget } from './AccessibilityWidget.js'; -export type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'; -export type { A11yState } from './state.js'; -export { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js'; diff --git a/dist/modules/accessibility/client.js b/dist/modules/accessibility/client.js deleted file mode 100644 index 351adb7..0000000 --- a/dist/modules/accessibility/client.js +++ /dev/null @@ -1,6 +0,0 @@ -'use client'; -export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'; -export { AccessibilityWidget } from './AccessibilityWidget.js'; -export { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js'; - -//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/dist/modules/accessibility/client.js.map b/dist/modules/accessibility/client.js.map deleted file mode 100644 index 4ff5110..0000000 --- a/dist/modules/accessibility/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/accessibility/client.ts"],"sourcesContent":["'use client'\nexport { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'\nexport { AccessibilityWidget } from './AccessibilityWidget.js'\nexport type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'\nexport type { A11yState } from './state.js'\nexport { A11Y_COOKIE, a11yAttributes, parseA11y } from './state.js'\n"],"names":["AccessibilityProvider","useAccessibility","AccessibilityWidget","A11Y_COOKIE","a11yAttributes","parseA11y"],"mappings":"AAAA;AACA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,6BAA4B;AACpF,SAASC,mBAAmB,QAAQ,2BAA0B;AAG9D,SAASC,WAAW,EAAEC,cAAc,EAAEC,SAAS,QAAQ,aAAY"} \ No newline at end of file diff --git a/dist/modules/accessibility/index.d.ts b/dist/modules/accessibility/index.d.ts deleted file mode 100644 index f6fe13d..0000000 --- a/dist/modules/accessibility/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'; -export { AccessibilityWidget } from './AccessibilityWidget.js'; -export type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'; -export { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y, } from './state.js'; -export type { A11yState } from './state.js'; diff --git a/dist/modules/accessibility/index.js b/dist/modules/accessibility/index.js deleted file mode 100644 index 11c71ef..0000000 --- a/dist/modules/accessibility/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'; -export { AccessibilityWidget } from './AccessibilityWidget.js'; -export { A11Y_COOKIE, A11Y_COOKIE_MAX_AGE, A11Y_DEFAULT, a11yAttributes, parseA11y, serializeA11y } from './state.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/accessibility/index.js.map b/dist/modules/accessibility/index.js.map deleted file mode 100644 index 33aca75..0000000 --- a/dist/modules/accessibility/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/accessibility/index.ts"],"sourcesContent":["export { AccessibilityProvider, useAccessibility } from './AccessibilityProvider.js'\nexport { AccessibilityWidget } from './AccessibilityWidget.js'\nexport type { A11yClassNames, A11yTexts } from './AccessibilityWidget.js'\nexport {\n A11Y_COOKIE,\n A11Y_COOKIE_MAX_AGE,\n A11Y_DEFAULT,\n a11yAttributes,\n parseA11y,\n serializeA11y,\n} from './state.js'\nexport type { A11yState } from './state.js'\n"],"names":["AccessibilityProvider","useAccessibility","AccessibilityWidget","A11Y_COOKIE","A11Y_COOKIE_MAX_AGE","A11Y_DEFAULT","a11yAttributes","parseA11y","serializeA11y"],"mappings":"AAAA,SAASA,qBAAqB,EAAEC,gBAAgB,QAAQ,6BAA4B;AACpF,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,SACEC,WAAW,EACXC,mBAAmB,EACnBC,YAAY,EACZC,cAAc,EACdC,SAAS,EACTC,aAAa,QACR,aAAY"} \ No newline at end of file diff --git a/dist/modules/accessibility/state.d.ts b/dist/modules/accessibility/state.d.ts deleted file mode 100644 index 479300d..0000000 --- a/dist/modules/accessibility/state.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Accessibility preferences state. Each option maps to a data-attribute on - * (e.g. data-a11y-contrast="high"); the PROJECT's CSS reacts to those - * attributes. The plugin sets the attributes and persists the choice — it does - * NOT ship styles, so it never fights the project's design. - */ -export type A11yState = { - /** Larger cursor. */ - bigCursor: boolean; - /** 'default' | 'high' (high contrast) | 'inverted' (dark-on-light flip). */ - contrast: 'default' | 'high' | 'inverted'; - /** Grayscale filter on the whole page. */ - grayscale: boolean; - /** Line spacing: 0 = default, 1..2 = looser. */ - lineHeight: 0 | 1 | 2; - /** Readable font (project maps this to a dyslexia-friendly / simple font). */ - readableFont: boolean; - /** Stop animations / transitions (prefers-reduced-motion equivalent). */ - reduceMotion: boolean; - /** Text size step: 0 = default, 1..3 = larger. */ - textSize: 0 | 1 | 2 | 3; - /** Underline all links (WCAG: don't rely on color alone). */ - underlineLinks: boolean; -}; -export declare const A11Y_DEFAULT: A11yState; -export declare const A11Y_COOKIE = "a11y-prefs"; -export declare const A11Y_COOKIE_MAX_AGE: number; -/** Serialize for the cookie (compact). */ -export declare function serializeA11y(state: A11yState): string; -/** Parse from the cookie; falls back to defaults on any bad value. */ -export declare function parseA11y(raw: null | string | undefined): A11yState; -/** - * Maps state → data-attributes to set on . Returns { attr: value|null }; - * null means remove the attribute (option is at default). The project's CSS - * targets these, e.g. `[data-a11y-contrast="high"] { … }`. - */ -export declare function a11yAttributes(state: A11yState): Record; diff --git a/dist/modules/accessibility/state.js b/dist/modules/accessibility/state.js deleted file mode 100644 index 5bc45f4..0000000 --- a/dist/modules/accessibility/state.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Accessibility preferences state. Each option maps to a data-attribute on - * (e.g. data-a11y-contrast="high"); the PROJECT's CSS reacts to those - * attributes. The plugin sets the attributes and persists the choice — it does - * NOT ship styles, so it never fights the project's design. - */ export const A11Y_DEFAULT = { - bigCursor: false, - contrast: 'default', - grayscale: false, - lineHeight: 0, - readableFont: false, - reduceMotion: false, - textSize: 0, - underlineLinks: false -}; -export const A11Y_COOKIE = 'a11y-prefs'; -export const A11Y_COOKIE_MAX_AGE = 60 * 60 * 24 * 365 // 1 year -; -/** Serialize for the cookie (compact). */ export function serializeA11y(state) { - return JSON.stringify(state); -} -/** Parse from the cookie; falls back to defaults on any bad value. */ export function parseA11y(raw) { - if (!raw) { - return A11Y_DEFAULT; - } - try { - const parsed = JSON.parse(raw); - return { - ...A11Y_DEFAULT, - ...parsed - }; - } catch { - return A11Y_DEFAULT; - } -} -/** - * Maps state → data-attributes to set on . Returns { attr: value|null }; - * null means remove the attribute (option is at default). The project's CSS - * targets these, e.g. `[data-a11y-contrast="high"] { … }`. - */ export function a11yAttributes(state) { - return { - 'data-a11y-contrast': state.contrast !== 'default' ? state.contrast : null, - 'data-a11y-cursor': state.bigCursor ? 'big' : null, - 'data-a11y-font': state.readableFont ? 'readable' : null, - 'data-a11y-grayscale': state.grayscale ? 'on' : null, - 'data-a11y-line': state.lineHeight > 0 ? String(state.lineHeight) : null, - 'data-a11y-motion': state.reduceMotion ? 'reduce' : null, - 'data-a11y-text': state.textSize > 0 ? String(state.textSize) : null, - 'data-a11y-underline': state.underlineLinks ? 'on' : null - }; -} - -//# sourceMappingURL=state.js.map \ No newline at end of file diff --git a/dist/modules/accessibility/state.js.map b/dist/modules/accessibility/state.js.map deleted file mode 100644 index a8c7ea5..0000000 --- a/dist/modules/accessibility/state.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/accessibility/state.ts"],"sourcesContent":["/**\n * Accessibility preferences state. Each option maps to a data-attribute on\n * (e.g. data-a11y-contrast=\"high\"); the PROJECT's CSS reacts to those\n * attributes. The plugin sets the attributes and persists the choice — it does\n * NOT ship styles, so it never fights the project's design.\n */\nexport type A11yState = {\n /** Larger cursor. */\n bigCursor: boolean\n /** 'default' | 'high' (high contrast) | 'inverted' (dark-on-light flip). */\n contrast: 'default' | 'high' | 'inverted'\n /** Grayscale filter on the whole page. */\n grayscale: boolean\n /** Line spacing: 0 = default, 1..2 = looser. */\n lineHeight: 0 | 1 | 2\n /** Readable font (project maps this to a dyslexia-friendly / simple font). */\n readableFont: boolean\n /** Stop animations / transitions (prefers-reduced-motion equivalent). */\n reduceMotion: boolean\n /** Text size step: 0 = default, 1..3 = larger. */\n textSize: 0 | 1 | 2 | 3\n /** Underline all links (WCAG: don't rely on color alone). */\n underlineLinks: boolean\n}\n\nexport const A11Y_DEFAULT: A11yState = {\n bigCursor: false,\n contrast: 'default',\n grayscale: false,\n lineHeight: 0,\n readableFont: false,\n reduceMotion: false,\n textSize: 0,\n underlineLinks: false,\n}\n\nexport const A11Y_COOKIE = 'a11y-prefs'\nexport const A11Y_COOKIE_MAX_AGE = 60 * 60 * 24 * 365 // 1 year\n\n/** Serialize for the cookie (compact). */\nexport function serializeA11y(state: A11yState): string {\n return JSON.stringify(state)\n}\n\n/** Parse from the cookie; falls back to defaults on any bad value. */\nexport function parseA11y(raw: null | string | undefined): A11yState {\n if (!raw) {return A11Y_DEFAULT}\n try {\n const parsed = JSON.parse(raw) as Partial\n return { ...A11Y_DEFAULT, ...parsed }\n } catch {\n return A11Y_DEFAULT\n }\n}\n\n/**\n * Maps state → data-attributes to set on . Returns { attr: value|null };\n * null means remove the attribute (option is at default). The project's CSS\n * targets these, e.g. `[data-a11y-contrast=\"high\"] { … }`.\n */\nexport function a11yAttributes(state: A11yState): Record {\n return {\n 'data-a11y-contrast': state.contrast !== 'default' ? state.contrast : null,\n 'data-a11y-cursor': state.bigCursor ? 'big' : null,\n 'data-a11y-font': state.readableFont ? 'readable' : null,\n 'data-a11y-grayscale': state.grayscale ? 'on' : null,\n 'data-a11y-line': state.lineHeight > 0 ? String(state.lineHeight) : null,\n 'data-a11y-motion': state.reduceMotion ? 'reduce' : null,\n 'data-a11y-text': state.textSize > 0 ? String(state.textSize) : null,\n 'data-a11y-underline': state.underlineLinks ? 'on' : null,\n }\n}\n"],"names":["A11Y_DEFAULT","bigCursor","contrast","grayscale","lineHeight","readableFont","reduceMotion","textSize","underlineLinks","A11Y_COOKIE","A11Y_COOKIE_MAX_AGE","serializeA11y","state","JSON","stringify","parseA11y","raw","parsed","parse","a11yAttributes","String"],"mappings":"AAAA;;;;;CAKC,GAoBD,OAAO,MAAMA,eAA0B;IACrCC,WAAW;IACXC,UAAU;IACVC,WAAW;IACXC,YAAY;IACZC,cAAc;IACdC,cAAc;IACdC,UAAU;IACVC,gBAAgB;AAClB,EAAC;AAED,OAAO,MAAMC,cAAc,aAAY;AACvC,OAAO,MAAMC,sBAAsB,KAAK,KAAK,KAAK,IAAI,SAAS;CAAV;AAErD,wCAAwC,GACxC,OAAO,SAASC,cAAcC,KAAgB;IAC5C,OAAOC,KAAKC,SAAS,CAACF;AACxB;AAEA,oEAAoE,GACpE,OAAO,SAASG,UAAUC,GAA8B;IACtD,IAAI,CAACA,KAAK;QAAC,OAAOhB;IAAY;IAC9B,IAAI;QACF,MAAMiB,SAASJ,KAAKK,KAAK,CAACF;QAC1B,OAAO;YAAE,GAAGhB,YAAY;YAAE,GAAGiB,MAAM;QAAC;IACtC,EAAE,OAAM;QACN,OAAOjB;IACT;AACF;AAEA;;;;CAIC,GACD,OAAO,SAASmB,eAAeP,KAAgB;IAC7C,OAAO;QACL,sBAAsBA,MAAMV,QAAQ,KAAK,YAAYU,MAAMV,QAAQ,GAAG;QACtE,oBAAoBU,MAAMX,SAAS,GAAG,QAAQ;QAC9C,kBAAkBW,MAAMP,YAAY,GAAG,aAAa;QACpD,uBAAuBO,MAAMT,SAAS,GAAG,OAAO;QAChD,kBAAkBS,MAAMR,UAAU,GAAG,IAAIgB,OAAOR,MAAMR,UAAU,IAAI;QACpE,oBAAoBQ,MAAMN,YAAY,GAAG,WAAW;QACpD,kBAAkBM,MAAML,QAAQ,GAAG,IAAIa,OAAOR,MAAML,QAAQ,IAAI;QAChE,uBAAuBK,MAAMJ,cAAc,GAAG,OAAO;IACvD;AACF"} \ No newline at end of file diff --git a/dist/modules/admin-ui/RowLabelComponent.d.ts b/dist/modules/admin-ui/RowLabelComponent.d.ts deleted file mode 100644 index 0278733..0000000 --- a/dist/modules/admin-ui/RowLabelComponent.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type RowLabelProps = { - /** Shown with the row number when every path is empty, e.g. "Button" → "Button 02". */ - fallback?: string; - /** Dot paths inside the row, tried in order — the first non-empty text wins. */ - fields?: string[]; -}; -/** - * Array row title in the admin panel: shows the row's own content ("Contact us", - * "Fast delivery") instead of "Item 01", so an editor finds the right row - * without expanding every one. Wire it with `rowLabel()`. - */ -export declare function RowLabel({ fallback, fields }: RowLabelProps): import("react/jsx-runtime").JSX.Element; diff --git a/dist/modules/admin-ui/RowLabelComponent.js b/dist/modules/admin-ui/RowLabelComponent.js deleted file mode 100644 index 8e6f943..0000000 --- a/dist/modules/admin-ui/RowLabelComponent.js +++ /dev/null @@ -1,54 +0,0 @@ -'use client'; -import { jsx as _jsx } from "react/jsx-runtime"; -import { useRowLabel } from '@payloadcms/ui'; -const at = (obj, path)=>path.split('.').reduce((o, k)=>o && typeof o === 'object' ? o[k] : undefined, obj); -const toText = (v)=>{ - if (typeof v === 'string') { - return v.trim(); - } - if (typeof v === 'number') { - return String(v); - } - // populated relationship / upload → its title, name, filename or alt - if (v && typeof v === 'object') { - for (const k of [ - 'title', - 'name', - 'label', - 'alt', - 'filename' - ]){ - const t = v[k]; - if (typeof t === 'string' && t.trim()) { - return t.trim(); - } - } - } - return ''; -}; -/** - * Array row title in the admin panel: shows the row's own content ("Contact us", - * "Fast delivery") instead of "Item 01", so an editor finds the right row - * without expanding every one. Wire it with `rowLabel()`. - */ export function RowLabel({ fallback = 'Item', fields = [ - 'heading', - 'title', - 'label', - 'link.label', - 'name' -] }) { - const { data, rowNumber } = useRowLabel(); - for (const f of fields){ - const text = toText(at(data, f)); - if (text) { - return /*#__PURE__*/ _jsx("span", { - children: text.length > 60 ? `${text.slice(0, 57)}…` : text - }); - } - } - return /*#__PURE__*/ _jsx("span", { - children: `${fallback} ${String((rowNumber ?? 0) + 1).padStart(2, '0')}` - }); -} - -//# sourceMappingURL=RowLabelComponent.js.map \ No newline at end of file diff --git a/dist/modules/admin-ui/RowLabelComponent.js.map b/dist/modules/admin-ui/RowLabelComponent.js.map deleted file mode 100644 index 5fcfa9d..0000000 --- a/dist/modules/admin-ui/RowLabelComponent.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/admin-ui/RowLabelComponent.tsx"],"sourcesContent":["'use client'\nimport { useRowLabel } from '@payloadcms/ui'\n\nexport type RowLabelProps = {\n /** Shown with the row number when every path is empty, e.g. \"Button\" → \"Button 02\". */\n fallback?: string\n /** Dot paths inside the row, tried in order — the first non-empty text wins. */\n fields?: string[]\n}\n\nconst at = (obj: unknown, path: string): unknown =>\n path.split('.').reduce((o, k) => (o && typeof o === 'object' ? (o as Record)[k] : undefined), obj)\n\nconst toText = (v: unknown): string => {\n if (typeof v === 'string') {return v.trim()}\n if (typeof v === 'number') {return String(v)}\n // populated relationship / upload → its title, name, filename or alt\n if (v && typeof v === 'object') {\n for (const k of ['title', 'name', 'label', 'alt', 'filename']) {\n const t = (v as Record)[k]\n if (typeof t === 'string' && t.trim()) {return t.trim()}\n }\n }\n return ''\n}\n\n/**\n * Array row title in the admin panel: shows the row's own content (\"Contact us\",\n * \"Fast delivery\") instead of \"Item 01\", so an editor finds the right row\n * without expanding every one. Wire it with `rowLabel()`.\n */\nexport function RowLabel({ fallback = 'Item', fields = ['heading', 'title', 'label', 'link.label', 'name'] }: RowLabelProps) {\n const { data, rowNumber } = useRowLabel>()\n for (const f of fields) {\n const text = toText(at(data, f))\n if (text) {return {text.length > 60 ? `${text.slice(0, 57)}…` : text}}\n }\n return {`${fallback} ${String((rowNumber ?? 0) + 1).padStart(2, '0')}`}\n}\n"],"names":["useRowLabel","at","obj","path","split","reduce","o","k","undefined","toText","v","trim","String","t","RowLabel","fallback","fields","data","rowNumber","f","text","span","length","slice","padStart"],"mappings":"AAAA;;AACA,SAASA,WAAW,QAAQ,iBAAgB;AAS5C,MAAMC,KAAK,CAACC,KAAcC,OACxBA,KAAKC,KAAK,CAAC,KAAKC,MAAM,CAAU,CAACC,GAAGC,IAAOD,KAAK,OAAOA,MAAM,WAAW,AAACA,CAA6B,CAACC,EAAE,GAAGC,WAAYN;AAE1H,MAAMO,SAAS,CAACC;IACd,IAAI,OAAOA,MAAM,UAAU;QAAC,OAAOA,EAAEC,IAAI;IAAE;IAC3C,IAAI,OAAOD,MAAM,UAAU;QAAC,OAAOE,OAAOF;IAAE;IAC5C,qEAAqE;IACrE,IAAIA,KAAK,OAAOA,MAAM,UAAU;QAC9B,KAAK,MAAMH,KAAK;YAAC;YAAS;YAAQ;YAAS;YAAO;SAAW,CAAE;YAC7D,MAAMM,IAAI,AAACH,CAA6B,CAACH,EAAE;YAC3C,IAAI,OAAOM,MAAM,YAAYA,EAAEF,IAAI,IAAI;gBAAC,OAAOE,EAAEF,IAAI;YAAE;QACzD;IACF;IACA,OAAO;AACT;AAEA;;;;CAIC,GACD,OAAO,SAASG,SAAS,EAAEC,WAAW,MAAM,EAAEC,SAAS;IAAC;IAAW;IAAS;IAAS;IAAc;CAAO,EAAiB;IACzH,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAE,GAAGlB;IAC5B,KAAK,MAAMmB,KAAKH,OAAQ;QACtB,MAAMI,OAAOX,OAAOR,GAAGgB,MAAME;QAC7B,IAAIC,MAAM;YAAC,qBAAO,KAACC;0BAAMD,KAAKE,MAAM,GAAG,KAAK,GAAGF,KAAKG,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,GAAGH;;QAAY;IACpF;IACA,qBAAO,KAACC;kBAAM,GAAGN,SAAS,CAAC,EAAEH,OAAO,AAACM,CAAAA,aAAa,CAAA,IAAK,GAAGM,QAAQ,CAAC,GAAG,MAAM;;AAC9E"} \ No newline at end of file diff --git a/dist/modules/admin-ui/index.d.ts b/dist/modules/admin-ui/index.d.ts deleted file mode 100644 index 687c772..0000000 --- a/dist/modules/admin-ui/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { rowLabel } from './rowLabel.js'; -export type { RowLabelProps } from './RowLabelComponent.js'; diff --git a/dist/modules/admin-ui/index.js b/dist/modules/admin-ui/index.js deleted file mode 100644 index cca268a..0000000 --- a/dist/modules/admin-ui/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { rowLabel } from './rowLabel.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/admin-ui/index.js.map b/dist/modules/admin-ui/index.js.map deleted file mode 100644 index 7b3c0b1..0000000 --- a/dist/modules/admin-ui/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/admin-ui/index.ts"],"sourcesContent":["export { rowLabel } from './rowLabel.js'\nexport type { RowLabelProps } from './RowLabelComponent.js'\n"],"names":["rowLabel"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAe"} \ No newline at end of file diff --git a/dist/modules/admin-ui/rowLabel.d.ts b/dist/modules/admin-ui/rowLabel.d.ts deleted file mode 100644 index f927880..0000000 --- a/dist/modules/admin-ui/rowLabel.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { RowLabelProps } from './RowLabelComponent.js'; -/** - * Readable array rows in the panel. Spread into an array field's `admin.components`: - * - * { name: 'items', type: 'array', labels: { singular: 'Feature', plural: 'Features' }, - * admin: { initCollapsed: true, components: rowLabel(['heading'], 'Feature') }, fields: [...] } - * - * Rows then read "Fast delivery", "24/7 support"… instead of "Feature 01, Feature 02". - * After adding it to a project: `pnpm payload generate:importmap`. - */ -export declare function rowLabel(fields: string | string[], fallback?: string): { - RowLabel: { - path: string; - clientProps: RowLabelProps; - }; -}; diff --git a/dist/modules/admin-ui/rowLabel.js b/dist/modules/admin-ui/rowLabel.js deleted file mode 100644 index b516a08..0000000 --- a/dist/modules/admin-ui/rowLabel.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Readable array rows in the panel. Spread into an array field's `admin.components`: - * - * { name: 'items', type: 'array', labels: { singular: 'Feature', plural: 'Features' }, - * admin: { initCollapsed: true, components: rowLabel(['heading'], 'Feature') }, fields: [...] } - * - * Rows then read "Fast delivery", "24/7 support"… instead of "Feature 01, Feature 02". - * After adding it to a project: `pnpm payload generate:importmap`. - */ export function rowLabel(fields, fallback = 'Item') { - const clientProps = { - fields: Array.isArray(fields) ? fields : [ - fields - ], - fallback - }; - return { - RowLabel: { - path: '@intecion/ipal-kit/admin#RowLabel', - clientProps - } - }; -} - -//# sourceMappingURL=rowLabel.js.map \ No newline at end of file diff --git a/dist/modules/admin-ui/rowLabel.js.map b/dist/modules/admin-ui/rowLabel.js.map deleted file mode 100644 index 24b328d..0000000 --- a/dist/modules/admin-ui/rowLabel.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/admin-ui/rowLabel.ts"],"sourcesContent":["import type { RowLabelProps } from './RowLabelComponent.js'\n\n/**\n * Readable array rows in the panel. Spread into an array field's `admin.components`:\n *\n * { name: 'items', type: 'array', labels: { singular: 'Feature', plural: 'Features' },\n * admin: { initCollapsed: true, components: rowLabel(['heading'], 'Feature') }, fields: [...] }\n *\n * Rows then read \"Fast delivery\", \"24/7 support\"… instead of \"Feature 01, Feature 02\".\n * After adding it to a project: `pnpm payload generate:importmap`.\n */\nexport function rowLabel(fields: string | string[], fallback = 'Item') {\n const clientProps: RowLabelProps = { fields: Array.isArray(fields) ? fields : [fields], fallback }\n return { RowLabel: { path: '@intecion/ipal-kit/admin#RowLabel', clientProps } }\n}\n"],"names":["rowLabel","fields","fallback","clientProps","Array","isArray","RowLabel","path"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,SAASA,SAASC,MAAyB,EAAEC,WAAW,MAAM;IACnE,MAAMC,cAA6B;QAAEF,QAAQG,MAAMC,OAAO,CAACJ,UAAUA,SAAS;YAACA;SAAO;QAAEC;IAAS;IACjG,OAAO;QAAEI,UAAU;YAAEC,MAAM;YAAqCJ;QAAY;IAAE;AAChF"} \ No newline at end of file diff --git a/dist/modules/analytics/Analytics.d.ts b/dist/modules/analytics/Analytics.d.ts deleted file mode 100644 index 2ace238..0000000 --- a/dist/modules/analytics/Analytics.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import type { AnalyticsConfig } from './types.js'; -declare global { - interface Window { - dataLayer?: unknown[]; - } -} -export type AnalyticsProps = { - /** - * Core Web Vitals mode: hold back every tag's NETWORK load until the first - * user interaction (scroll, pointer, touch, key) or `deferTimeoutMs` after the - * window `load` event — whichever comes first. Keeps ~100+ KiB of third-party - * JS out of the FCP/LCP window. - * - * Consent is unaffected: the Consent Mode default is still pushed immediately - * (a synchronous dataLayer push, no network), and non-Google pixels still - * require their consent category. Defer changes WHEN a tag loads, never WHETHER. - * - * Trade-off: visitors who leave before interacting and before the timeout are - * not counted (slightly fewer sessions in GA). Default false. - */ - defer?: boolean; - /** Fallback delay after window `load`, in ms. Default 3500. */ - deferTimeoutMs?: number; -} & AnalyticsConfig; -/** - * Loads every configured analytics / marketing tag, each respecting consent: - * - * - **Google (GA4 / GTM)** — Consent Mode: the visitor's stored choice is set as - * the default BEFORE the tag loads (always immediately, even with `defer`), - * and useConsent pushes an update the moment they decide. GTM wins if both - * IDs are set. - * - **Non-Google (Meta Pixel, Clarity, LinkedIn, TikTok)** — no Consent Mode, so - * each loads ONLY after its category is granted (marketing for - * Pixel/LinkedIn/TikTok, analytics for Clarity). Reacts live to the banner. - * - **`defer`** (opt-in) — additionally waits for first interaction / idle - * after load, for better LCP/INP. See AnalyticsProps.defer. - * - * All IDs are public and come from SiteIntegrations (getAnalyticsConfig), passed - * in as props. Renders nothing. Mount once, high in the tree, INSIDE - * (required — it reads live consent state). - */ -export declare function Analytics(props: AnalyticsProps): null; diff --git a/dist/modules/analytics/Analytics.js b/dist/modules/analytics/Analytics.js deleted file mode 100644 index 4ac7d05..0000000 --- a/dist/modules/analytics/Analytics.js +++ /dev/null @@ -1,175 +0,0 @@ -'use client'; -import { useEffect, useRef, useState } from 'react'; -import { useConsentContext } from '../consent/client.js'; -import { gtag } from '../consent/googleConsent.js'; -import { CONSENT_COOKIE, DEFAULT_CONSENT, parseConsent, setDefaultConsent } from '../consent/index.js'; -import { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'; -const GTM_SCRIPT = (id)=>`https://www.googletagmanager.com/gtm.js?id=${id}`; -const GA4_SCRIPT = (id)=>`https://www.googletagmanager.com/gtag/js?id=${id}`; -/** Reads the current consent state from cookie, or defaults if none. */ function readConsent() { - if (typeof document === 'undefined') { - return DEFAULT_CONSENT; - } - const raw = document.cookie.split('; ').find((c)=>c.startsWith(`${CONSENT_COOKIE}=`))?.split('=')[1]; - return parseConsent(raw) ?? DEFAULT_CONSENT; -} -function injectScript(src) { - if (document.querySelector(`script[src="${src}"]`)) { - return; - } - const s = document.createElement('script'); - s.src = src; - s.async = true; - document.head.appendChild(s); -} -const INTERACTION_EVENTS = [ - 'scroll', - 'pointerdown', - 'touchstart', - 'keydown' -]; -/** True once third-party tags may load (immediately, or per `defer` rules). */ function useDeferredReady(defer, timeoutMs) { - const [ready, setReady] = useState(!defer); - useEffect(()=>{ - if (!defer || ready) { - return; - } - let timer; - const fire = ()=>setReady(true); - const onLoad = ()=>{ - timer = setTimeout(()=>{ - if ('requestIdleCallback' in window) { - window.requestIdleCallback(fire, { - timeout: 1000 - }); - } else { - fire(); - } - }, timeoutMs); - }; - for (const e of INTERACTION_EVENTS){ - window.addEventListener(e, fire, { - once: true, - passive: true - }); - } - if (document.readyState === 'complete') { - onLoad(); - } else { - window.addEventListener('load', onLoad, { - once: true - }); - } - return ()=>{ - for (const e of INTERACTION_EVENTS){ - window.removeEventListener(e, fire); - } - window.removeEventListener('load', onLoad); - if (timer) { - clearTimeout(timer); - } - }; - }, [ - defer, - ready, - timeoutMs - ]); - return ready; -} -/** - * Loads every configured analytics / marketing tag, each respecting consent: - * - * - **Google (GA4 / GTM)** — Consent Mode: the visitor's stored choice is set as - * the default BEFORE the tag loads (always immediately, even with `defer`), - * and useConsent pushes an update the moment they decide. GTM wins if both - * IDs are set. - * - **Non-Google (Meta Pixel, Clarity, LinkedIn, TikTok)** — no Consent Mode, so - * each loads ONLY after its category is granted (marketing for - * Pixel/LinkedIn/TikTok, analytics for Clarity). Reacts live to the banner. - * - **`defer`** (opt-in) — additionally waits for first interaction / idle - * after load, for better LCP/INP. See AnalyticsProps.defer. - * - * All IDs are public and come from SiteIntegrations (getAnalyticsConfig), passed - * in as props. Renders nothing. Mount once, high in the tree, INSIDE - * (required — it reads live consent state). - */ export function Analytics(props) { - const { clarityProjectId, defer = false, deferTimeoutMs = 3500, ga4MeasurementId, gtmContainerId, linkedInPartnerId, metaPixelId, tiktokPixelId } = props; - // Live consent state — drives the non-Google pixels. - const { state } = useConsentContext(); - const ready = useDeferredReady(defer, deferTimeoutMs); - const defaultConsentSet = useRef(false); - // --- Consent Mode default: immediately, once — never deferred --- - // No network cost, and it must precede any gtag('config') / GTM start, or - // Google assumes "granted". - useEffect(()=>{ - if (defaultConsentSet.current) { - return; - } - if (!ga4MeasurementId && !gtmContainerId) { - return; - } - setDefaultConsent(readConsent()); - defaultConsentSet.current = true; - }, [ - ga4MeasurementId, - gtmContainerId - ]); - // --- Google: load once `ready`; Consent Mode handles gating --- - useEffect(()=>{ - if (!ready) { - return; - } - if (!ga4MeasurementId && !gtmContainerId) { - return; - } - if (gtmContainerId) { - window.dataLayer = window.dataLayer || []; - window.dataLayer.push({ - event: 'gtm.js', - 'gtm.start': Date.now() - }); - injectScript(GTM_SCRIPT(gtmContainerId)); - } else if (ga4MeasurementId) { - injectScript(GA4_SCRIPT(ga4MeasurementId)); - gtag('js', new Date()); - gtag('config', ga4MeasurementId); - } - }, [ - ready, - ga4MeasurementId, - gtmContainerId - ]); - // --- Non-Google: each when `ready` AND its consent category is granted --- - // Loaders are idempotent, so re-running on state changes is safe; a tag loads - // the first time both conditions hold and never doubles up. - useEffect(()=>{ - if (!ready) { - return; - } - if (state.marketing) { - if (metaPixelId) { - loadMetaPixel(metaPixelId); - } - if (linkedInPartnerId) { - loadLinkedIn(linkedInPartnerId); - } - if (tiktokPixelId) { - loadTikTok(tiktokPixelId); - } - } - if (state.analytics && clarityProjectId) { - loadClarity(clarityProjectId); - } - }, [ - ready, - state.marketing, - state.analytics, - metaPixelId, - linkedInPartnerId, - tiktokPixelId, - clarityProjectId - ]); - return null; -} - -//# sourceMappingURL=Analytics.js.map \ No newline at end of file diff --git a/dist/modules/analytics/Analytics.js.map b/dist/modules/analytics/Analytics.js.map deleted file mode 100644 index de2bebe..0000000 --- a/dist/modules/analytics/Analytics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/Analytics.tsx"],"sourcesContent":["'use client'\nimport { useEffect, useRef, useState } from 'react'\n\nimport type { AnalyticsConfig } from './types.js'\n\nimport { useConsentContext } from '../consent/client.js'\nimport { gtag } from '../consent/googleConsent.js'\nimport { CONSENT_COOKIE, DEFAULT_CONSENT, parseConsent, setDefaultConsent } from '../consent/index.js'\nimport { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'\n\ndeclare global {\n interface Window {\n dataLayer?: unknown[]\n }\n}\n\nconst GTM_SCRIPT = (id: string) => `https://www.googletagmanager.com/gtm.js?id=${id}`\nconst GA4_SCRIPT = (id: string) => `https://www.googletagmanager.com/gtag/js?id=${id}`\n\n/** Reads the current consent state from cookie, or defaults if none. */\nfunction readConsent() {\n if (typeof document === 'undefined') {return DEFAULT_CONSENT}\n const raw = document.cookie\n .split('; ')\n .find((c) => c.startsWith(`${CONSENT_COOKIE}=`))\n ?.split('=')[1]\n return parseConsent(raw) ?? DEFAULT_CONSENT\n}\n\nfunction injectScript(src: string) {\n if (document.querySelector(`script[src=\"${src}\"]`)) {return}\n const s = document.createElement('script')\n s.src = src\n s.async = true\n document.head.appendChild(s)\n}\n\nexport type AnalyticsProps = {\n /**\n * Core Web Vitals mode: hold back every tag's NETWORK load until the first\n * user interaction (scroll, pointer, touch, key) or `deferTimeoutMs` after the\n * window `load` event — whichever comes first. Keeps ~100+ KiB of third-party\n * JS out of the FCP/LCP window.\n *\n * Consent is unaffected: the Consent Mode default is still pushed immediately\n * (a synchronous dataLayer push, no network), and non-Google pixels still\n * require their consent category. Defer changes WHEN a tag loads, never WHETHER.\n *\n * Trade-off: visitors who leave before interacting and before the timeout are\n * not counted (slightly fewer sessions in GA). Default false.\n */\n defer?: boolean\n /** Fallback delay after window `load`, in ms. Default 3500. */\n deferTimeoutMs?: number\n} & AnalyticsConfig\n\nconst INTERACTION_EVENTS = ['scroll', 'pointerdown', 'touchstart', 'keydown'] as const\n\n/** True once third-party tags may load (immediately, or per `defer` rules). */\nfunction useDeferredReady(defer: boolean, timeoutMs: number): boolean {\n const [ready, setReady] = useState(!defer)\n\n useEffect(() => {\n if (!defer || ready) {return}\n let timer: ReturnType | undefined\n\n const fire = () => setReady(true)\n const onLoad = () => {\n timer = setTimeout(() => {\n if ('requestIdleCallback' in window) {\n window.requestIdleCallback(fire, { timeout: 1000 })\n } else {\n fire()\n }\n }, timeoutMs)\n }\n\n for (const e of INTERACTION_EVENTS) {\n window.addEventListener(e, fire, { once: true, passive: true })\n }\n if (document.readyState === 'complete') {onLoad()}\n else {window.addEventListener('load', onLoad, { once: true })}\n\n return () => {\n for (const e of INTERACTION_EVENTS) {window.removeEventListener(e, fire)}\n window.removeEventListener('load', onLoad)\n if (timer) {clearTimeout(timer)}\n }\n }, [defer, ready, timeoutMs])\n\n return ready\n}\n\n/**\n * Loads every configured analytics / marketing tag, each respecting consent:\n *\n * - **Google (GA4 / GTM)** — Consent Mode: the visitor's stored choice is set as\n * the default BEFORE the tag loads (always immediately, even with `defer`),\n * and useConsent pushes an update the moment they decide. GTM wins if both\n * IDs are set.\n * - **Non-Google (Meta Pixel, Clarity, LinkedIn, TikTok)** — no Consent Mode, so\n * each loads ONLY after its category is granted (marketing for\n * Pixel/LinkedIn/TikTok, analytics for Clarity). Reacts live to the banner.\n * - **`defer`** (opt-in) — additionally waits for first interaction / idle\n * after load, for better LCP/INP. See AnalyticsProps.defer.\n *\n * All IDs are public and come from SiteIntegrations (getAnalyticsConfig), passed\n * in as props. Renders nothing. Mount once, high in the tree, INSIDE\n * (required — it reads live consent state).\n */\nexport function Analytics(props: AnalyticsProps) {\n const {\n clarityProjectId,\n defer = false,\n deferTimeoutMs = 3500,\n ga4MeasurementId,\n gtmContainerId,\n linkedInPartnerId,\n metaPixelId,\n tiktokPixelId,\n } = props\n\n // Live consent state — drives the non-Google pixels.\n const { state } = useConsentContext()\n const ready = useDeferredReady(defer, deferTimeoutMs)\n const defaultConsentSet = useRef(false)\n\n // --- Consent Mode default: immediately, once — never deferred ---\n // No network cost, and it must precede any gtag('config') / GTM start, or\n // Google assumes \"granted\".\n useEffect(() => {\n if (defaultConsentSet.current) {return}\n if (!ga4MeasurementId && !gtmContainerId) {return}\n setDefaultConsent(readConsent())\n defaultConsentSet.current = true\n }, [ga4MeasurementId, gtmContainerId])\n\n // --- Google: load once `ready`; Consent Mode handles gating ---\n useEffect(() => {\n if (!ready) {return}\n if (!ga4MeasurementId && !gtmContainerId) {return}\n if (gtmContainerId) {\n window.dataLayer = window.dataLayer || []\n window.dataLayer.push({ event: 'gtm.js', 'gtm.start': Date.now() })\n injectScript(GTM_SCRIPT(gtmContainerId))\n } else if (ga4MeasurementId) {\n injectScript(GA4_SCRIPT(ga4MeasurementId))\n gtag('js', new Date())\n gtag('config', ga4MeasurementId)\n }\n }, [ready, ga4MeasurementId, gtmContainerId])\n\n // --- Non-Google: each when `ready` AND its consent category is granted ---\n // Loaders are idempotent, so re-running on state changes is safe; a tag loads\n // the first time both conditions hold and never doubles up.\n useEffect(() => {\n if (!ready) {return}\n if (state.marketing) {\n if (metaPixelId) {loadMetaPixel(metaPixelId)}\n if (linkedInPartnerId) {loadLinkedIn(linkedInPartnerId)}\n if (tiktokPixelId) {loadTikTok(tiktokPixelId)}\n }\n if (state.analytics && clarityProjectId) {loadClarity(clarityProjectId)}\n }, [\n ready,\n state.marketing,\n state.analytics,\n metaPixelId,\n linkedInPartnerId,\n tiktokPixelId,\n clarityProjectId,\n ])\n\n return null\n}\n"],"names":["useEffect","useRef","useState","useConsentContext","gtag","CONSENT_COOKIE","DEFAULT_CONSENT","parseConsent","setDefaultConsent","loadClarity","loadLinkedIn","loadMetaPixel","loadTikTok","GTM_SCRIPT","id","GA4_SCRIPT","readConsent","document","raw","cookie","split","find","c","startsWith","injectScript","src","querySelector","s","createElement","async","head","appendChild","INTERACTION_EVENTS","useDeferredReady","defer","timeoutMs","ready","setReady","timer","fire","onLoad","setTimeout","window","requestIdleCallback","timeout","e","addEventListener","once","passive","readyState","removeEventListener","clearTimeout","Analytics","props","clarityProjectId","deferTimeoutMs","ga4MeasurementId","gtmContainerId","linkedInPartnerId","metaPixelId","tiktokPixelId","state","defaultConsentSet","current","dataLayer","push","event","Date","now","marketing","analytics"],"mappings":"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"} \ No newline at end of file diff --git a/dist/modules/analytics/client.d.ts b/dist/modules/analytics/client.d.ts deleted file mode 100644 index a1429e7..0000000 --- a/dist/modules/analytics/client.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { Analytics } from './Analytics.js'; -export type { AnalyticsProps } from './Analytics.js'; -export { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'; -export { pushDataLayer } from './pushDataLayer.js'; diff --git a/dist/modules/analytics/client.js b/dist/modules/analytics/client.js deleted file mode 100644 index af834e2..0000000 --- a/dist/modules/analytics/client.js +++ /dev/null @@ -1,8 +0,0 @@ -'use client'; -export { Analytics } from './Analytics.js'; -// Low-level pixel loaders — exported for manual conversion events if a project -// needs them (Analytics loads them automatically, consent-gated). -export { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'; -export { pushDataLayer } from './pushDataLayer.js'; - -//# sourceMappingURL=client.js.map \ No newline at end of file diff --git a/dist/modules/analytics/client.js.map b/dist/modules/analytics/client.js.map deleted file mode 100644 index ad6e353..0000000 --- a/dist/modules/analytics/client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/client.ts"],"sourcesContent":["'use client'\nexport { Analytics } from './Analytics.js'\nexport type { AnalyticsProps } from './Analytics.js'\n// Low-level pixel loaders — exported for manual conversion events if a project\n// needs them (Analytics loads them automatically, consent-gated).\nexport { loadClarity, loadLinkedIn, loadMetaPixel, loadTikTok } from './pixels.js'\nexport { pushDataLayer } from './pushDataLayer.js'\n"],"names":["Analytics","loadClarity","loadLinkedIn","loadMetaPixel","loadTikTok","pushDataLayer"],"mappings":"AAAA;AACA,SAASA,SAAS,QAAQ,iBAAgB;AAE1C,+EAA+E;AAC/E,kEAAkE;AAClE,SAASC,WAAW,EAAEC,YAAY,EAAEC,aAAa,EAAEC,UAAU,QAAQ,cAAa;AAClF,SAASC,aAAa,QAAQ,qBAAoB"} \ No newline at end of file diff --git a/dist/modules/analytics/getAnalyticsConfig.d.ts b/dist/modules/analytics/getAnalyticsConfig.d.ts deleted file mode 100644 index 54e4400..0000000 --- a/dist/modules/analytics/getAnalyticsConfig.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { BasePayload } from 'payload'; -import type { AnalyticsConfig } from './types.js'; -/** - * Reads the public analytics / marketing tag IDs from SiteIntegrations, - * server-side. All are public (exposed client-side), so safe to pass to the - * component. Does NOT expose any secret from SiteIntegrations. - */ -export declare function getAnalyticsConfig(payload: BasePayload): Promise; diff --git a/dist/modules/analytics/getAnalyticsConfig.js b/dist/modules/analytics/getAnalyticsConfig.js deleted file mode 100644 index 87f9b57..0000000 --- a/dist/modules/analytics/getAnalyticsConfig.js +++ /dev/null @@ -1,18 +0,0 @@ -import { getSiteIntegrations } from '../payload/index.js'; -/** - * Reads the public analytics / marketing tag IDs from SiteIntegrations, - * server-side. All are public (exposed client-side), so safe to pass to the - * component. Does NOT expose any secret from SiteIntegrations. - */ export async function getAnalyticsConfig(payload) { - const integrations = await getSiteIntegrations(payload); - return { - clarityProjectId: integrations.clarityProjectId ?? null, - ga4MeasurementId: integrations.ga4MeasurementId ?? null, - gtmContainerId: integrations.gtmContainerId ?? null, - linkedInPartnerId: integrations.linkedInPartnerId ?? null, - metaPixelId: integrations.metaPixelId ?? null, - tiktokPixelId: integrations.tiktokPixelId ?? null - }; -} - -//# sourceMappingURL=getAnalyticsConfig.js.map \ No newline at end of file diff --git a/dist/modules/analytics/getAnalyticsConfig.js.map b/dist/modules/analytics/getAnalyticsConfig.js.map deleted file mode 100644 index 633fca3..0000000 --- a/dist/modules/analytics/getAnalyticsConfig.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/getAnalyticsConfig.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\nimport type { AnalyticsConfig } from './types.js'\n\nimport { getSiteIntegrations } from '../payload/index.js'\n\n/**\n * Reads the public analytics / marketing tag IDs from SiteIntegrations,\n * server-side. All are public (exposed client-side), so safe to pass to the\n * component. Does NOT expose any secret from SiteIntegrations.\n */\nexport async function getAnalyticsConfig(payload: BasePayload): Promise {\n const integrations = await getSiteIntegrations(payload)\n return {\n clarityProjectId: integrations.clarityProjectId ?? null,\n ga4MeasurementId: integrations.ga4MeasurementId ?? null,\n gtmContainerId: integrations.gtmContainerId ?? null,\n linkedInPartnerId: integrations.linkedInPartnerId ?? null,\n metaPixelId: integrations.metaPixelId ?? null,\n tiktokPixelId: integrations.tiktokPixelId ?? null,\n }\n}\n"],"names":["getSiteIntegrations","getAnalyticsConfig","payload","integrations","clarityProjectId","ga4MeasurementId","gtmContainerId","linkedInPartnerId","metaPixelId","tiktokPixelId"],"mappings":"AAIA,SAASA,mBAAmB,QAAQ,sBAAqB;AAEzD;;;;CAIC,GACD,OAAO,eAAeC,mBAAmBC,OAAoB;IAC3D,MAAMC,eAAe,MAAMH,oBAAqCE;IAChE,OAAO;QACLE,kBAAkBD,aAAaC,gBAAgB,IAAI;QACnDC,kBAAkBF,aAAaE,gBAAgB,IAAI;QACnDC,gBAAgBH,aAAaG,cAAc,IAAI;QAC/CC,mBAAmBJ,aAAaI,iBAAiB,IAAI;QACrDC,aAAaL,aAAaK,WAAW,IAAI;QACzCC,eAAeN,aAAaM,aAAa,IAAI;IAC/C;AACF"} \ No newline at end of file diff --git a/dist/modules/analytics/index.d.ts b/dist/modules/analytics/index.d.ts deleted file mode 100644 index b37bdc1..0000000 --- a/dist/modules/analytics/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { getAnalyticsConfig } from './getAnalyticsConfig.js'; -export type { AnalyticsConfig } from './types.js'; diff --git a/dist/modules/analytics/index.js b/dist/modules/analytics/index.js deleted file mode 100644 index f943ce4..0000000 --- a/dist/modules/analytics/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { getAnalyticsConfig } from './getAnalyticsConfig.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/analytics/index.js.map b/dist/modules/analytics/index.js.map deleted file mode 100644 index e42ecb9..0000000 --- a/dist/modules/analytics/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/index.ts"],"sourcesContent":["export { getAnalyticsConfig } from './getAnalyticsConfig.js'\n// Server-safe: config type + the helper that reads IDs from SiteIntegrations.\n// The component is client-side — exported via ./client.\nexport type { AnalyticsConfig } from './types.js'\n"],"names":["getAnalyticsConfig"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,0BAAyB"} \ No newline at end of file diff --git a/dist/modules/analytics/pixels.d.ts b/dist/modules/analytics/pixels.d.ts deleted file mode 100644 index c12a0ac..0000000 --- a/dist/modules/analytics/pixels.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Loaders for non-Google marketing/analytics pixels. Each is idempotent (guards - * against double-init) and loads the vendor's own script + bootstrap. - * - * These are the one place `any` is unavoidable: vendor SDK bootstraps attach - * untyped globals (fbq, clarity, lintrk, ttq) to `window`. Casts are contained - * here; nothing else in the kit uses `any`. - * - * CONSENT: these vendors have no Google Consent Mode — the caller (Analytics) - * loads each ONLY after the matching consent category is granted: - * Meta Pixel / LinkedIn / TikTok → marketing - * Microsoft Clarity → analytics - */ -/** Meta (Facebook) Pixel — fires PageView on load. */ -export declare function loadMetaPixel(id: string): void; -/** Microsoft Clarity — heatmaps / session recordings (analytics category). */ -export declare function loadClarity(id: string): void; -/** LinkedIn Insight Tag (marketing). */ -export declare function loadLinkedIn(partnerId: string): void; -/** TikTok Pixel (marketing) — fires page view on load. */ -export declare function loadTikTok(id: string): void; diff --git a/dist/modules/analytics/pixels.js b/dist/modules/analytics/pixels.js deleted file mode 100644 index ab777ca..0000000 --- a/dist/modules/analytics/pixels.js +++ /dev/null @@ -1,134 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ /** - * Loaders for non-Google marketing/analytics pixels. Each is idempotent (guards - * against double-init) and loads the vendor's own script + bootstrap. - * - * These are the one place `any` is unavoidable: vendor SDK bootstraps attach - * untyped globals (fbq, clarity, lintrk, ttq) to `window`. Casts are contained - * here; nothing else in the kit uses `any`. - * - * CONSENT: these vendors have no Google Consent Mode — the caller (Analytics) - * loads each ONLY after the matching consent category is granted: - * Meta Pixel / LinkedIn / TikTok → marketing - * Microsoft Clarity → analytics - */ /** Meta (Facebook) Pixel — fires PageView on load. */ export function loadMetaPixel(id) { - if (typeof window === 'undefined') { - return; - } - const w = window; - if (w.fbq) { - return; - } - const n = w.fbq = function(...args) { - if (n.callMethod) { - n.callMethod.apply(n, args); - } else { - n.queue.push(args); - } - }; - if (!w._fbq) { - w._fbq = n; - } - n.push = n; - n.loaded = true; - n.version = '2.0'; - n.queue = []; - const s = document.createElement('script'); - s.async = true; - s.src = 'https://connect.facebook.net/en_US/fbevents.js'; - document.head.appendChild(s); - w.fbq('init', id); - w.fbq('track', 'PageView'); -} -/** Microsoft Clarity — heatmaps / session recordings (analytics category). */ export function loadClarity(id) { - if (typeof window === 'undefined') { - return; - } - const w = window; - if (w.clarity) { - return; - } - w.clarity = function(...a) { - ; - (w.clarity.q = w.clarity.q || []).push(a); - }; - const s = document.createElement('script'); - s.async = true; - s.src = `https://www.clarity.ms/tag/${id}`; - document.head.appendChild(s); -} -/** LinkedIn Insight Tag (marketing). */ export function loadLinkedIn(partnerId) { - if (typeof window === 'undefined') { - return; - } - const w = window; - w._linkedin_partner_id = partnerId; - w._linkedin_data_partner_ids = w._linkedin_data_partner_ids || []; - if (w._linkedin_data_partner_ids.includes(partnerId)) { - if (document.getElementById('ipal-linkedin-insight')) { - return; - } - } else { - w._linkedin_data_partner_ids.push(partnerId); - } - if (document.getElementById('ipal-linkedin-insight')) { - return; - } - const s = document.createElement('script'); - s.async = true; - s.id = 'ipal-linkedin-insight'; - s.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js'; - document.head.appendChild(s); -} -/** TikTok Pixel (marketing) — fires page view on load. */ export function loadTikTok(id) { - if (typeof window === 'undefined') { - return; - } - const w = window; - if (w.ttq) { - return; - } - w.TiktokAnalyticsObject = 'ttq'; - const ttq = w.ttq = []; - ttq.methods = [ - 'page', - 'track', - 'identify', - 'instances', - 'debug', - 'on', - 'off', - 'once', - 'ready', - 'alias', - 'group', - 'enableCookie', - 'disableCookie' - ]; - ttq.setAndDefer = function(t, e) { - t[e] = function(...args) { - t.push([ - e, - ...args - ]); - }; - }; - for (const m of ttq.methods){ - ttq.setAndDefer(ttq, m); - } - ttq.load = function(e) { - const url = 'https://analytics.tiktok.com/i18n/pixel/events.js'; - ttq._i = ttq._i || {}; - ttq._i[e] = []; - ttq._i[e]._u = url; - ttq._t = ttq._t || {}; - ttq._t[e] = Number(new Date()); - const s = document.createElement('script'); - s.async = true; - s.src = `${url}?sdkid=${e}&lib=ttq`; - document.head.appendChild(s); - }; - ttq.load(id); - ttq.page(); -} - -//# sourceMappingURL=pixels.js.map \ No newline at end of file diff --git a/dist/modules/analytics/pixels.js.map b/dist/modules/analytics/pixels.js.map deleted file mode 100644 index 436a9a9..0000000 --- a/dist/modules/analytics/pixels.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/pixels.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * Loaders for non-Google marketing/analytics pixels. Each is idempotent (guards\n * against double-init) and loads the vendor's own script + bootstrap.\n *\n * These are the one place `any` is unavoidable: vendor SDK bootstraps attach\n * untyped globals (fbq, clarity, lintrk, ttq) to `window`. Casts are contained\n * here; nothing else in the kit uses `any`.\n *\n * CONSENT: these vendors have no Google Consent Mode — the caller (Analytics)\n * loads each ONLY after the matching consent category is granted:\n * Meta Pixel / LinkedIn / TikTok → marketing\n * Microsoft Clarity → analytics\n */\n\ntype Win = Record & typeof window\n\n/** Meta (Facebook) Pixel — fires PageView on load. */\nexport function loadMetaPixel(id: string): void {\n if (typeof window === 'undefined') {return}\n const w = window as Win\n if (w.fbq) {return}\n const n: any = (w.fbq = function (...args: unknown[]) {\n if (n.callMethod) {\n n.callMethod.apply(n, args)\n } else {\n n.queue.push(args)\n }\n })\n if (!w._fbq) {w._fbq = n}\n n.push = n\n n.loaded = true\n n.version = '2.0'\n n.queue = []\n const s = document.createElement('script')\n s.async = true\n s.src = 'https://connect.facebook.net/en_US/fbevents.js'\n document.head.appendChild(s)\n w.fbq('init', id)\n w.fbq('track', 'PageView')\n}\n\n/** Microsoft Clarity — heatmaps / session recordings (analytics category). */\nexport function loadClarity(id: string): void {\n if (typeof window === 'undefined') {return}\n const w = window as Win\n if (w.clarity) {return}\n w.clarity = function (...a: unknown[]) {\n ;(w.clarity.q = w.clarity.q || []).push(a)\n }\n const s = document.createElement('script')\n s.async = true\n s.src = `https://www.clarity.ms/tag/${id}`\n document.head.appendChild(s)\n}\n\n/** LinkedIn Insight Tag (marketing). */\nexport function loadLinkedIn(partnerId: string): void {\n if (typeof window === 'undefined') {return}\n const w = window as Win\n w._linkedin_partner_id = partnerId\n w._linkedin_data_partner_ids = w._linkedin_data_partner_ids || []\n if (w._linkedin_data_partner_ids.includes(partnerId)) {\n if (document.getElementById('ipal-linkedin-insight')) {return}\n } else {\n w._linkedin_data_partner_ids.push(partnerId)\n }\n if (document.getElementById('ipal-linkedin-insight')) {return}\n const s = document.createElement('script')\n s.async = true\n s.id = 'ipal-linkedin-insight'\n s.src = 'https://snap.licdn.com/li.lms-analytics/insight.min.js'\n document.head.appendChild(s)\n}\n\n/** TikTok Pixel (marketing) — fires page view on load. */\nexport function loadTikTok(id: string): void {\n if (typeof window === 'undefined') {return}\n const w = window as Win\n if (w.ttq) {return}\n w.TiktokAnalyticsObject = 'ttq'\n const ttq: any = (w.ttq = [])\n ttq.methods = [\n 'page',\n 'track',\n 'identify',\n 'instances',\n 'debug',\n 'on',\n 'off',\n 'once',\n 'ready',\n 'alias',\n 'group',\n 'enableCookie',\n 'disableCookie',\n ]\n ttq.setAndDefer = function (t: any, e: string) {\n t[e] = function (...args: unknown[]) {\n t.push([e, ...args])\n }\n }\n for (const m of ttq.methods) {ttq.setAndDefer(ttq, m)}\n ttq.load = function (e: string) {\n const url = 'https://analytics.tiktok.com/i18n/pixel/events.js'\n ttq._i = ttq._i || {}\n ttq._i[e] = []\n ttq._i[e]._u = url\n ttq._t = ttq._t || {}\n ttq._t[e] = Number(new Date())\n const s = document.createElement('script')\n s.async = true\n s.src = `${url}?sdkid=${e}&lib=ttq`\n document.head.appendChild(s)\n }\n ttq.load(id)\n ttq.page()\n}\n"],"names":["loadMetaPixel","id","window","w","fbq","n","args","callMethod","apply","queue","push","_fbq","loaded","version","s","document","createElement","async","src","head","appendChild","loadClarity","clarity","a","q","loadLinkedIn","partnerId","_linkedin_partner_id","_linkedin_data_partner_ids","includes","getElementById","loadTikTok","ttq","TiktokAnalyticsObject","methods","setAndDefer","t","e","m","load","url","_i","_u","_t","Number","Date","page"],"mappings":"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"} \ No newline at end of file diff --git a/dist/modules/analytics/pushDataLayer.d.ts b/dist/modules/analytics/pushDataLayer.d.ts deleted file mode 100644 index 951deb6..0000000 --- a/dist/modules/analytics/pushDataLayer.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the - * server), and tolerant of GTM not being present yet — the array is created so - * the event is buffered and picked up once GTM loads. - * - * The bridge between the form engine and GTM: fire a `form_submit` event after - * a successful submit so a Meta Pixel / GA "Lead" tag can trigger on it. - * - * import { pushDataLayer } from '@intecion/ipal-kit/client' - * const f = useContactForm({ - * submitAction, - * onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }), - * }) - * - * The GTM "Lead" tag then reads `form_name` via a Data Layer Variable - * (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still - * gates the tag in GTM (ad_storage) — this only emits the event. - */ -export declare function pushDataLayer(event: string, params?: Record): void; diff --git a/dist/modules/analytics/pushDataLayer.js b/dist/modules/analytics/pushDataLayer.js deleted file mode 100644 index 9743d8c..0000000 --- a/dist/modules/analytics/pushDataLayer.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the - * server), and tolerant of GTM not being present yet — the array is created so - * the event is buffered and picked up once GTM loads. - * - * The bridge between the form engine and GTM: fire a `form_submit` event after - * a successful submit so a Meta Pixel / GA "Lead" tag can trigger on it. - * - * import { pushDataLayer } from '@intecion/ipal-kit/client' - * const f = useContactForm({ - * submitAction, - * onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }), - * }) - * - * The GTM "Lead" tag then reads `form_name` via a Data Layer Variable - * (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still - * gates the tag in GTM (ad_storage) — this only emits the event. - */ export function pushDataLayer(event, params = {}) { - if (typeof window === 'undefined') return; - const w = window; - w.dataLayer = w.dataLayer || []; - w.dataLayer.push({ - event, - ...params - }); -} - -//# sourceMappingURL=pushDataLayer.js.map \ No newline at end of file diff --git a/dist/modules/analytics/pushDataLayer.js.map b/dist/modules/analytics/pushDataLayer.js.map deleted file mode 100644 index bf8e2b2..0000000 --- a/dist/modules/analytics/pushDataLayer.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/pushDataLayer.ts"],"sourcesContent":["/**\n * Pushes an event onto the GTM `window.dataLayer`. SSR-safe (no-op on the\n * server), and tolerant of GTM not being present yet — the array is created so\n * the event is buffered and picked up once GTM loads.\n *\n * The bridge between the form engine and GTM: fire a `form_submit` event after\n * a successful submit so a Meta Pixel / GA \"Lead\" tag can trigger on it.\n *\n * import { pushDataLayer } from '@intecion/ipal-kit/client'\n * const f = useContactForm({\n * submitAction,\n * onSuccess: (_r, v) => pushDataLayer('form_submit', { form_name: v.topic || 'kontakt' }),\n * })\n *\n * The GTM \"Lead\" tag then reads `form_name` via a Data Layer Variable\n * (`DLV – form_name`) and fires on the custom event `form_submit`. Consent still\n * gates the tag in GTM (ad_storage) — this only emits the event.\n */\nexport function pushDataLayer(event: string, params: Record = {}): void {\n if (typeof window === 'undefined') return\n const w = window as unknown as { dataLayer?: unknown[] }\n w.dataLayer = w.dataLayer || []\n w.dataLayer.push({ event, ...params })\n}\n"],"names":["pushDataLayer","event","params","window","w","dataLayer","push"],"mappings":"AAAA;;;;;;;;;;;;;;;;;CAiBC,GACD,OAAO,SAASA,cAAcC,KAAa,EAAEC,SAAkC,CAAC,CAAC;IAC/E,IAAI,OAAOC,WAAW,aAAa;IACnC,MAAMC,IAAID;IACVC,EAAEC,SAAS,GAAGD,EAAEC,SAAS,IAAI,EAAE;IAC/BD,EAAEC,SAAS,CAACC,IAAI,CAAC;QAAEL;QAAO,GAAGC,MAAM;IAAC;AACtC"} \ No newline at end of file diff --git a/dist/modules/analytics/types.d.ts b/dist/modules/analytics/types.d.ts deleted file mode 100644 index 9d979dc..0000000 --- a/dist/modules/analytics/types.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe - * on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only - * after the matching consent category is granted (see Analytics). - */ -export type AnalyticsConfig = { - /** Microsoft Clarity project ID. (analytics consent) */ - clarityProjectId?: null | string; - /** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. (Google — Consent Mode) */ - ga4MeasurementId?: null | string; - /** GTM Container ID, e.g. 'GTM-XXXXXXX'. (Google — Consent Mode) */ - gtmContainerId?: null | string; - /** LinkedIn Insight Tag partner ID. (marketing consent) */ - linkedInPartnerId?: null | string; - /** Meta (Facebook) Pixel ID, ~15–16 digits. (marketing consent) */ - metaPixelId?: null | string; - /** TikTok Pixel ID. (marketing consent) */ - tiktokPixelId?: null | string; -}; diff --git a/dist/modules/analytics/types.js b/dist/modules/analytics/types.js deleted file mode 100644 index 9ed2828..0000000 --- a/dist/modules/analytics/types.js +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe - * on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only - * after the matching consent category is granted (see Analytics). - */ export { }; - -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/modules/analytics/types.js.map b/dist/modules/analytics/types.js.map deleted file mode 100644 index b5c9893..0000000 --- a/dist/modules/analytics/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/analytics/types.ts"],"sourcesContent":["/**\n * Analytics / marketing tag IDs, read from SiteIntegrations (all public — safe\n * on the client). Google tags (GA4/GTM) use Consent Mode; the rest load only\n * after the matching consent category is granted (see Analytics).\n */\nexport type AnalyticsConfig = {\n /** Microsoft Clarity project ID. (analytics consent) */\n clarityProjectId?: null | string\n /** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX'. (Google — Consent Mode) */\n ga4MeasurementId?: null | string\n /** GTM Container ID, e.g. 'GTM-XXXXXXX'. (Google — Consent Mode) */\n gtmContainerId?: null | string\n /** LinkedIn Insight Tag partner ID. (marketing consent) */\n linkedInPartnerId?: null | string\n /** Meta (Facebook) Pixel ID, ~15–16 digits. (marketing consent) */\n metaPixelId?: null | string\n /** TikTok Pixel ID. (marketing consent) */\n tiktokPixelId?: null | string\n}\n"],"names":[],"mappings":"AAAA;;;;CAIC,GACD,WAaC"} \ No newline at end of file diff --git a/dist/modules/blocks/RenderBlocks.d.ts b/dist/modules/blocks/RenderBlocks.d.ts deleted file mode 100644 index 11eb2f8..0000000 --- a/dist/modules/blocks/RenderBlocks.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type { BlockComponentMap, BlockData, EnhanceProps } from './types.js'; -export type RenderBlocksProps = { - /** Block data array from a Payload document (e.g. page.layout). */ - blocks: BlockData[] | null | undefined; - /** Client-provided map of blockType → component. */ - components: BlockComponentMap; - /** - * Optional client hook to inject block-specific props (nav anchors, etc.). - * Keeps the engine generic — the plugin knows no concrete block types. - */ - enhanceProps?: EnhanceProps; -}; -/** - * Generic, server-side block renderer. - * - * Iterates a document's blocks and renders each via the client's component - * map. Unknown blocks are skipped (null), never thrown. Block-specific logic is - * delegated to the client's optional `enhanceProps` — the plugin itself is - * block-agnostic. - * - * The client owns components and block schemas (they pass `components` and - * define blocks in their config); the plugin owns only the iteration and - * wiring. No wrapper markup is added — spacing/layout belong to the client's - * components. - * - * Nested blocks: a block that needs to render child blocks should render its - * own and import the registry itself, rather than receiving the - * component map as a prop. Passing the map as a prop breaks React Server - * Components — functions (client components) can't cross the server→client - * boundary via props. - */ -export declare function RenderBlocks({ blocks, components, enhanceProps }: RenderBlocksProps): import("react/jsx-runtime").JSX.Element | null; diff --git a/dist/modules/blocks/RenderBlocks.js b/dist/modules/blocks/RenderBlocks.js deleted file mode 100644 index 2cfb1ea..0000000 --- a/dist/modules/blocks/RenderBlocks.js +++ /dev/null @@ -1,44 +0,0 @@ -import { jsx as _jsx } from "react/jsx-runtime"; -import { Fragment } from 'react'; -/** - * Generic, server-side block renderer. - * - * Iterates a document's blocks and renders each via the client's component - * map. Unknown blocks are skipped (null), never thrown. Block-specific logic is - * delegated to the client's optional `enhanceProps` — the plugin itself is - * block-agnostic. - * - * The client owns components and block schemas (they pass `components` and - * define blocks in their config); the plugin owns only the iteration and - * wiring. No wrapper markup is added — spacing/layout belong to the client's - * components. - * - * Nested blocks: a block that needs to render child blocks should render its - * own and import the registry itself, rather than receiving the - * component map as a prop. Passing the map as a prop breaks React Server - * Components — functions (client components) can't cross the server→client - * boundary via props. - */ export function RenderBlocks({ blocks, components, enhanceProps }) { - if (!blocks || !Array.isArray(blocks) || blocks.length === 0) { - return null; - } - return /*#__PURE__*/ _jsx(Fragment, { - children: blocks.map((block, index)=>{ - const Component = components[block.blockType]; - if (!Component) { - return null; - } - const extra = enhanceProps ? enhanceProps({ - allBlocks: blocks, - block, - index - }) : {}; - return /*#__PURE__*/ _jsx(Component, { - ...block, - ...extra - }, index); - }) - }); -} - -//# sourceMappingURL=RenderBlocks.js.map \ No newline at end of file diff --git a/dist/modules/blocks/RenderBlocks.js.map b/dist/modules/blocks/RenderBlocks.js.map deleted file mode 100644 index a292dfe..0000000 --- a/dist/modules/blocks/RenderBlocks.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/blocks/RenderBlocks.tsx"],"sourcesContent":["import { Fragment } from 'react'\n\nimport type { BlockComponentMap, BlockData, EnhanceProps } from './types.js'\n\nexport type RenderBlocksProps = {\n /** Block data array from a Payload document (e.g. page.layout). */\n blocks: BlockData[] | null | undefined\n /** Client-provided map of blockType → component. */\n components: BlockComponentMap\n /**\n * Optional client hook to inject block-specific props (nav anchors, etc.).\n * Keeps the engine generic — the plugin knows no concrete block types.\n */\n enhanceProps?: EnhanceProps\n}\n\n/**\n * Generic, server-side block renderer.\n *\n * Iterates a document's blocks and renders each via the client's component\n * map. Unknown blocks are skipped (null), never thrown. Block-specific logic is\n * delegated to the client's optional `enhanceProps` — the plugin itself is\n * block-agnostic.\n *\n * The client owns components and block schemas (they pass `components` and\n * define blocks in their config); the plugin owns only the iteration and\n * wiring. No wrapper markup is added — spacing/layout belong to the client's\n * components.\n *\n * Nested blocks: a block that needs to render child blocks should render its\n * own and import the registry itself, rather than receiving the\n * component map as a prop. Passing the map as a prop breaks React Server\n * Components — functions (client components) can't cross the server→client\n * boundary via props.\n */\nexport function RenderBlocks({ blocks, components, enhanceProps }: RenderBlocksProps) {\n if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {\n return null\n }\n\n return (\n \n {blocks.map((block, index) => {\n const Component = components[block.blockType]\n if (!Component) {return null}\n\n const extra = enhanceProps ? enhanceProps({ allBlocks: blocks, block, index }) : {}\n\n return \n })}\n \n )\n}\n"],"names":["Fragment","RenderBlocks","blocks","components","enhanceProps","Array","isArray","length","map","block","index","Component","blockType","extra","allBlocks"],"mappings":";AAAA,SAASA,QAAQ,QAAQ,QAAO;AAgBhC;;;;;;;;;;;;;;;;;;CAkBC,GACD,OAAO,SAASC,aAAa,EAAEC,MAAM,EAAEC,UAAU,EAAEC,YAAY,EAAqB;IAClF,IAAI,CAACF,UAAU,CAACG,MAAMC,OAAO,CAACJ,WAAWA,OAAOK,MAAM,KAAK,GAAG;QAC5D,OAAO;IACT;IAEA,qBACE,KAACP;kBACEE,OAAOM,GAAG,CAAC,CAACC,OAAOC;YAClB,MAAMC,YAAYR,UAAU,CAACM,MAAMG,SAAS,CAAC;YAC7C,IAAI,CAACD,WAAW;gBAAC,OAAO;YAAI;YAE5B,MAAME,QAAQT,eAAeA,aAAa;gBAAEU,WAAWZ;gBAAQO;gBAAOC;YAAM,KAAK,CAAC;YAElF,qBAAO,KAACC;gBAAuB,GAAGF,KAAK;gBAAG,GAAGI,KAAK;eAA3BH;QACzB;;AAGN"} \ No newline at end of file diff --git a/dist/modules/blocks/index.d.ts b/dist/modules/blocks/index.d.ts deleted file mode 100644 index a1d1fa5..0000000 --- a/dist/modules/blocks/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { RenderBlocks } from './RenderBlocks.js'; -export type { RenderBlocksProps } from './RenderBlocks.js'; -export type { BlockComponentMap, BlockData, EnhanceProps } from './types.js'; diff --git a/dist/modules/blocks/index.js b/dist/modules/blocks/index.js deleted file mode 100644 index 4563f88..0000000 --- a/dist/modules/blocks/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { RenderBlocks } from './RenderBlocks.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/blocks/index.js.map b/dist/modules/blocks/index.js.map deleted file mode 100644 index b502360..0000000 --- a/dist/modules/blocks/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/blocks/index.ts"],"sourcesContent":["export { RenderBlocks } from './RenderBlocks.js'\nexport type { RenderBlocksProps } from './RenderBlocks.js'\nexport type { BlockComponentMap, BlockData, EnhanceProps } from './types.js'\n"],"names":["RenderBlocks"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAmB"} \ No newline at end of file diff --git a/dist/modules/blocks/types.d.ts b/dist/modules/blocks/types.d.ts deleted file mode 100644 index 22e8c8b..0000000 --- a/dist/modules/blocks/types.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { ComponentType } from 'react'; -/** - * A single block's data as stored by Payload — always has a blockType, plus - * arbitrary block-specific fields. The plugin stays generic over the shape. - */ -export type BlockData = { - [key: string]: unknown; - blockType: string; -}; -/** - * Maps a blockType to the client's component for it. - * The client owns the components; the plugin only receives this map. - */ -export type BlockComponentMap = Record>; -/** - * Optional per-block prop enhancer supplied by the client. - * - * Lets the client inject block-specific logic (e.g. collect anchors for a nav - * block) without the plugin knowing any concrete block types. Returns extra - * props merged into the rendered block. - */ -export type EnhanceProps = (args: { - allBlocks: BlockData[]; - block: BlockData; - index: number; -}) => Record; diff --git a/dist/modules/blocks/types.js b/dist/modules/blocks/types.js deleted file mode 100644 index f7a3e54..0000000 --- a/dist/modules/blocks/types.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Optional per-block prop enhancer supplied by the client. - * - * Lets the client inject block-specific logic (e.g. collect anchors for a nav - * block) without the plugin knowing any concrete block types. Returns extra - * props merged into the rendered block. - */ export { }; - -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/modules/blocks/types.js.map b/dist/modules/blocks/types.js.map deleted file mode 100644 index 9650f08..0000000 --- a/dist/modules/blocks/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/blocks/types.ts"],"sourcesContent":["import type { ComponentType } from 'react'\n\n/**\n * A single block's data as stored by Payload — always has a blockType, plus\n * arbitrary block-specific fields. The plugin stays generic over the shape.\n */\nexport type BlockData = {\n [key: string]: unknown\n blockType: string\n}\n\n/**\n * Maps a blockType to the client's component for it.\n * The client owns the components; the plugin only receives this map.\n */\nexport type BlockComponentMap = Record>\n\n/**\n * Optional per-block prop enhancer supplied by the client.\n *\n * Lets the client inject block-specific logic (e.g. collect anchors for a nav\n * block) without the plugin knowing any concrete block types. Returns extra\n * props merged into the rendered block.\n */\nexport type EnhanceProps = (args: {\n allBlocks: BlockData[]\n block: BlockData\n index: number\n}) => Record\n"],"names":[],"mappings":"AAiBA;;;;;;CAMC,GACD,WAI6B"} \ No newline at end of file diff --git a/dist/modules/branding/adminGraphics.d.ts b/dist/modules/branding/adminGraphics.d.ts deleted file mode 100644 index 5c97924..0000000 --- a/dist/modules/branding/adminGraphics.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -import type { Payload } from 'payload'; -/** - * White-label admin branding: the Payload admin panel's logo (login + nav) and - * icon, pulled from the project's SiteSettings so each client sees THEIR brand, - * set by the editor in the panel — not hardcoded per project. Wired - * automatically by `ipalKit({ whiteLabel: true })` (it injects - * admin.components.graphics.Logo/Icon pointing here). - * - * Server Components — they read the SiteSettings global at render, using the - * `payload` instance Payload itself passes to admin server components. NO - * `import('@payload-config')`: a variable-specifier import isn't traced by the - * Next bundler ("Cannot find module '@payload-config'") — same bug class as the - * old 2FA import. Everything is wrapped in try/catch: no payload prop, DB not - * ready, etc. → site name text, then null (Payload's own default) — never - * throws, never blocks the panel. - * - * A0: no client brand in code. The logo/name come from the panel; if nothing is - * set, nothing is forced. - */ -type BrandingProps = { - /** Upload field to render as the image. Default 'logo' (Logo) / 'favicon' (Icon). */ - imageField?: string; - /** Injected by Payload — current admin locale (object or code). */ - locale?: { - code?: string; - } | string; - /** Field holding the site name. Default 'siteName'. */ - nameField?: string; - /** Injected by Payload into admin server components. */ - payload?: Payload; - /** SiteSettings global slug. Default 'site-settings'. */ - settingsSlug?: string; -}; -/** - * Admin panel logo — this is the LARGE logo on the login / unauthorized screens - * (Payload uses `graphics.Icon` for the small nav glyph). SiteSettings `logo`, - * falls back to `siteName` text. Sized generously for the login screen. - */ -export declare function AdminLogo(props?: BrandingProps): Promise; -/** Admin panel icon (small nav glyph). SiteSettings `favicon`, falls back to initials. */ -export declare function AdminIcon(props?: BrandingProps): Promise; -/** - * Discreet vendor credit: "Technology supported by Intecion.com". This is the - * PLUGIN VENDOR's credit (Intecion ships ipal-kit, the framework), not client - * data — a sensible default here is fine and A0-safe. The client's own brand - * still owns the logo/name; this is a small line stating who supports the tech. - * Text/URL overridable; turn it off with `whiteLabel: { credit: false }`. - * - * Wired by ipalKit into admin.components.afterNavLinks (nav) AND afterLogin - * (login screen footer). `variant` adjusts placement: - * - 'nav' → left-aligned line under the nav links - * - 'login' → centered line below the login form - */ -export declare function IntecionCredit(props?: { - text?: string; - url?: string; - variant?: 'login' | 'nav'; -}): import("react/jsx-runtime").JSX.Element; -export {}; diff --git a/dist/modules/branding/adminGraphics.js b/dist/modules/branding/adminGraphics.js deleted file mode 100644 index 2b4149a..0000000 --- a/dist/modules/branding/adminGraphics.js +++ /dev/null @@ -1,144 +0,0 @@ -import { jsx as _jsx } from "react/jsx-runtime"; -/** A localized text field may arrive as a string or a { locale: value } map. */ function pickText(value, locale) { - if (typeof value === 'string') { - return value; - } - if (value && typeof value === 'object') { - const map = value; - const preferred = locale ? map[locale] : undefined; - if (typeof preferred === 'string') { - return preferred; - } - const first = Object.values(map).find((v)=>typeof v === 'string'); - return first ?? null; - } - return null; -} -async function loadBranding(props, settingsSlug, nameField, imageField) { - const { payload } = props; - if (!payload) { - return { - name: null, - url: null - }; - } - try { - const locale = typeof props.locale === 'string' ? props.locale : props.locale?.code; - const settings = await payload.findGlobal({ - slug: settingsSlug, - depth: 1, - ...locale ? { - locale: locale - } : {} - }); - const name = pickText(settings[nameField], locale); - const image = settings[imageField]; - const url = image && typeof image === 'object' && typeof image.url === 'string' ? image.url : null; - return { - name, - url - }; - } catch (error) { - console.warn('[ipal] admin branding: falling back to Payload default:', error); - return { - name: null, - url: null - }; - } -} -/** - * Admin panel logo — this is the LARGE logo on the login / unauthorized screens - * (Payload uses `graphics.Icon` for the small nav glyph). SiteSettings `logo`, - * falls back to `siteName` text. Sized generously for the login screen. - */ export async function AdminLogo(props = {}) { - const { imageField = 'logo', nameField = 'siteName', settingsSlug = 'site-settings' } = props; - const { name, url } = await loadBranding(props, settingsSlug, nameField, imageField); - if (url) { - return /*#__PURE__*/ _jsx("img", { - alt: name ?? '', - src: url, - style: { - height: 'auto', - maxHeight: 120, - maxWidth: 420, - width: 'auto' - } - }); - } - if (name) { - return /*#__PURE__*/ _jsx("div", { - style: { - fontSize: '2rem', - fontWeight: 600 - }, - children: name - }); - } - return null // nothing configured → Payload's default - ; -} -/** Admin panel icon (small nav glyph). SiteSettings `favicon`, falls back to initials. */ export async function AdminIcon(props = {}) { - const { imageField = 'favicon', nameField = 'siteName', settingsSlug = 'site-settings' } = props; - const { name, url } = await loadBranding(props, settingsSlug, nameField, imageField); - if (url) { - return /*#__PURE__*/ _jsx("img", { - alt: name ?? '', - src: url, - style: { - height: 'auto', - maxHeight: 28, - maxWidth: 28, - width: 'auto' - } - }); - } - if (name) { - return /*#__PURE__*/ _jsx("div", { - style: { - fontWeight: 700 - }, - children: name.slice(0, 2).toUpperCase() - }); - } - return null; -} -/** - * Discreet vendor credit: "Technology supported by Intecion.com". This is the - * PLUGIN VENDOR's credit (Intecion ships ipal-kit, the framework), not client - * data — a sensible default here is fine and A0-safe. The client's own brand - * still owns the logo/name; this is a small line stating who supports the tech. - * Text/URL overridable; turn it off with `whiteLabel: { credit: false }`. - * - * Wired by ipalKit into admin.components.afterNavLinks (nav) AND afterLogin - * (login screen footer). `variant` adjusts placement: - * - 'nav' → left-aligned line under the nav links - * - 'login' → centered line below the login form - */ export function IntecionCredit(props = {}) { - const { text = 'Technology supported by Intecion.com', url = 'https://intecion.com', variant = 'nav' } = props; - const style = variant === 'login' ? { - color: 'inherit', - display: 'block', - fontSize: '0.75rem', - marginTop: '2rem', - opacity: 0.6, - padding: '0.5rem', - textAlign: 'center', - textDecoration: 'none' - } : { - color: 'inherit', - display: 'block', - fontSize: '0.75rem', - opacity: 0.6, - padding: '0.75rem 1rem', - textDecoration: 'none' - }; - return /*#__PURE__*/ _jsx("a", { - href: url, - rel: "noopener noreferrer", - style: style, - target: "_blank", - children: text - }); -} - -//# sourceMappingURL=adminGraphics.js.map \ No newline at end of file diff --git a/dist/modules/branding/adminGraphics.js.map b/dist/modules/branding/adminGraphics.js.map deleted file mode 100644 index ae32ac1..0000000 --- a/dist/modules/branding/adminGraphics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/branding/adminGraphics.tsx"],"sourcesContent":["import type { Payload } from 'payload'\n\n/**\n * White-label admin branding: the Payload admin panel's logo (login + nav) and\n * icon, pulled from the project's SiteSettings so each client sees THEIR brand,\n * set by the editor in the panel — not hardcoded per project. Wired\n * automatically by `ipalKit({ whiteLabel: true })` (it injects\n * admin.components.graphics.Logo/Icon pointing here).\n *\n * Server Components — they read the SiteSettings global at render, using the\n * `payload` instance Payload itself passes to admin server components. NO\n * `import('@payload-config')`: a variable-specifier import isn't traced by the\n * Next bundler (\"Cannot find module '@payload-config'\") — same bug class as the\n * old 2FA import. Everything is wrapped in try/catch: no payload prop, DB not\n * ready, etc. → site name text, then null (Payload's own default) — never\n * throws, never blocks the panel.\n *\n * A0: no client brand in code. The logo/name come from the panel; if nothing is\n * set, nothing is forced.\n */\n\ntype BrandingProps = {\n /** Upload field to render as the image. Default 'logo' (Logo) / 'favicon' (Icon). */\n imageField?: string\n /** Injected by Payload — current admin locale (object or code). */\n locale?: { code?: string } | string\n /** Field holding the site name. Default 'siteName'. */\n nameField?: string\n /** Injected by Payload into admin server components. */\n payload?: Payload\n /** SiteSettings global slug. Default 'site-settings'. */\n settingsSlug?: string\n}\n\ntype MediaLike = { url?: null | string } | null | undefined\n\n/** A localized text field may arrive as a string or a { locale: value } map. */\nfunction pickText(value: unknown, locale: string | undefined): null | string {\n if (typeof value === 'string') {return value}\n if (value && typeof value === 'object') {\n const map = value as Record\n const preferred = locale ? map[locale] : undefined\n if (typeof preferred === 'string') {return preferred}\n const first = Object.values(map).find((v): v is string => typeof v === 'string')\n return first ?? null\n }\n return null\n}\n\nasync function loadBranding(\n props: BrandingProps,\n settingsSlug: string,\n nameField: string,\n imageField: string,\n): Promise<{ name: null | string; url: null | string }> {\n const { payload } = props\n if (!payload) {return { name: null, url: null }}\n try {\n const locale = typeof props.locale === 'string' ? props.locale : props.locale?.code\n const settings = (await payload.findGlobal({\n slug: settingsSlug as never,\n depth: 1,\n ...(locale ? { locale: locale as never } : {}),\n })) as Record\n\n const name = pickText(settings[nameField], locale)\n const image = settings[imageField] as MediaLike\n const url =\n image && typeof image === 'object' && typeof image.url === 'string' ? image.url : null\n return { name, url }\n } catch (error) {\n console.warn('[ipal] admin branding: falling back to Payload default:', error)\n return { name: null, url: null }\n }\n}\n\n/**\n * Admin panel logo — this is the LARGE logo on the login / unauthorized screens\n * (Payload uses `graphics.Icon` for the small nav glyph). SiteSettings `logo`,\n * falls back to `siteName` text. Sized generously for the login screen.\n */\nexport async function AdminLogo(props: BrandingProps = {}) {\n const { imageField = 'logo', nameField = 'siteName', settingsSlug = 'site-settings' } = props\n const { name, url } = await loadBranding(props, settingsSlug, nameField, imageField)\n if (url) {\n return (\n \n )\n }\n if (name) {return
{name}
}\n return null // nothing configured → Payload's default\n}\n\n/** Admin panel icon (small nav glyph). SiteSettings `favicon`, falls back to initials. */\nexport async function AdminIcon(props: BrandingProps = {}) {\n const { imageField = 'favicon', nameField = 'siteName', settingsSlug = 'site-settings' } = props\n const { name, url } = await loadBranding(props, settingsSlug, nameField, imageField)\n if (url) {\n return (\n \n )\n }\n if (name) {return
{name.slice(0, 2).toUpperCase()}
}\n return null\n}\n\n/**\n * Discreet vendor credit: \"Technology supported by Intecion.com\". This is the\n * PLUGIN VENDOR's credit (Intecion ships ipal-kit, the framework), not client\n * data — a sensible default here is fine and A0-safe. The client's own brand\n * still owns the logo/name; this is a small line stating who supports the tech.\n * Text/URL overridable; turn it off with `whiteLabel: { credit: false }`.\n *\n * Wired by ipalKit into admin.components.afterNavLinks (nav) AND afterLogin\n * (login screen footer). `variant` adjusts placement:\n * - 'nav' → left-aligned line under the nav links\n * - 'login' → centered line below the login form\n */\nexport function IntecionCredit(\n props: { text?: string; url?: string; variant?: 'login' | 'nav' } = {},\n) {\n const {\n text = 'Technology supported by Intecion.com',\n url = 'https://intecion.com',\n variant = 'nav',\n } = props\n const style =\n variant === 'login'\n ? {\n color: 'inherit' as const,\n display: 'block',\n fontSize: '0.75rem',\n marginTop: '2rem',\n opacity: 0.6,\n padding: '0.5rem',\n textAlign: 'center' as const,\n textDecoration: 'none',\n }\n : {\n color: 'inherit' as const,\n display: 'block',\n fontSize: '0.75rem',\n opacity: 0.6,\n padding: '0.75rem 1rem',\n textDecoration: 'none',\n }\n return (\n \n {text}\n \n )\n}\n"],"names":["pickText","value","locale","map","preferred","undefined","first","Object","values","find","v","loadBranding","props","settingsSlug","nameField","imageField","payload","name","url","code","settings","findGlobal","slug","depth","image","error","console","warn","AdminLogo","img","alt","src","style","height","maxHeight","maxWidth","width","div","fontSize","fontWeight","AdminIcon","slice","toUpperCase","IntecionCredit","text","variant","color","display","marginTop","opacity","padding","textAlign","textDecoration","a","href","rel","target"],"mappings":"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"} \ No newline at end of file diff --git a/dist/modules/branding/index.d.ts b/dist/modules/branding/index.d.ts deleted file mode 100644 index 28ffe03..0000000 --- a/dist/modules/branding/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js'; diff --git a/dist/modules/branding/index.js b/dist/modules/branding/index.js deleted file mode 100644 index 08d9f14..0000000 --- a/dist/modules/branding/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js'; - -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/modules/branding/index.js.map b/dist/modules/branding/index.js.map deleted file mode 100644 index 963df91..0000000 --- a/dist/modules/branding/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/branding/index.ts"],"sourcesContent":["export { AdminIcon, AdminLogo, IntecionCredit } from './adminGraphics.js'\n"],"names":["AdminIcon","AdminLogo","IntecionCredit"],"mappings":"AAAA,SAASA,SAAS,EAAEC,SAAS,EAAEC,cAAc,QAAQ,qBAAoB"} \ No newline at end of file diff --git a/dist/modules/consent/ConsentContext.d.ts b/dist/modules/consent/ConsentContext.d.ts deleted file mode 100644 index 27b3fb6..0000000 --- a/dist/modules/consent/ConsentContext.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { type ReactNode } from 'react'; -import type { ConsentTexts } from './texts.js'; -import { useConsent } from './useConsent.js'; -type ConsentContextValue = { - texts: ConsentTexts; -} & ReturnType; -export declare function ConsentProvider({ children, texts }: { - children: ReactNode; - texts: ConsentTexts; -}): import("react/jsx-runtime").JSX.Element; -export declare function useConsentContext(): ConsentContextValue; -export {}; diff --git a/dist/modules/consent/ConsentContext.js b/dist/modules/consent/ConsentContext.js deleted file mode 100644 index 77a88bc..0000000 --- a/dist/modules/consent/ConsentContext.js +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import { jsx as _jsx } from "react/jsx-runtime"; -import { createContext, use } from 'react'; -import { useConsent } from './useConsent.js'; -const ConsentContext = /*#__PURE__*/ createContext(null); -export function ConsentProvider({ children, texts }) { - const consent = useConsent(); - return /*#__PURE__*/ _jsx(ConsentContext, { - value: { - ...consent, - texts - }, - children: children - }); -} -export function useConsentContext() { - const ctx = use(ConsentContext); - if (!ctx) { - throw new Error('useConsentContext must be used within ConsentProvider'); - } - return ctx; -} - -//# sourceMappingURL=ConsentContext.js.map \ No newline at end of file diff --git a/dist/modules/consent/ConsentContext.js.map b/dist/modules/consent/ConsentContext.js.map deleted file mode 100644 index a5c7f2e..0000000 --- a/dist/modules/consent/ConsentContext.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../../../src/modules/consent/ConsentContext.tsx"],"sourcesContent":["'use client'\nimport { createContext, type ReactNode, use } from 'react'\n\nimport type { ConsentTexts } from './texts.js'\n\nimport { useConsent } from './useConsent.js'\n\ntype ConsentContextValue = { texts: ConsentTexts } & ReturnType\n\nconst ConsentContext = createContext(null)\n\nexport function ConsentProvider({ children, texts }: { children: ReactNode; texts: ConsentTexts }) {\n const consent = useConsent()\n return {children}\n}\n\nexport function useConsentContext(): ConsentContextValue {\n const ctx = use(ConsentContext)\n if (!ctx) {throw new Error('useConsentContext must be used within ConsentProvider')}\n return ctx\n}\n"],"names":["createContext","use","useConsent","ConsentContext","ConsentProvider","children","texts","consent","value","useConsentContext","ctx","Error"],"mappings":"AAAA;;AACA,SAASA,aAAa,EAAkBC,GAAG,QAAQ,QAAO;AAI1D,SAASC,UAAU,QAAQ,kBAAiB;AAI5C,MAAMC,+BAAiBH,cAA0C;AAEjE,OAAO,SAASI,gBAAgB,EAAEC,QAAQ,EAAEC,KAAK,EAAgD;IAC/F,MAAMC,UAAUL;IAChB,qBAAO,KAACC;QAAeK,OAAO;YAAE,GAAGD,OAAO;YAAED;QAAM;kBAAID;;AACxD;AAEA,OAAO,SAASI;IACd,MAAMC,MAAMT,IAAIE;IAChB,IAAI,CAACO,KAAK;QAAC,MAAM,IAAIC,MAAM;IAAwD;IACnF,OAAOD;AACT"} \ No newline at end of file diff --git a/dist/modules/consent/ConsentScript.d.ts b/dist/modules/consent/ConsentScript.d.ts deleted file mode 100644 index 9b05fc7..0000000 --- a/dist/modules/consent/ConsentScript.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import type { ConsentCategory } from './categories.js'; -type ConsentScriptProps = { - /** Default true. */ - async?: boolean; - /** Extra attributes on the