@kilivi/payloadcms-theme-management 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -31
- package/dist/components/ThemeLivePreviewSync.d.ts +11 -0
- package/dist/components/ThemeLivePreviewSync.d.ts.map +1 -0
- package/dist/components/ThemeLivePreviewSync.js +40 -0
- package/dist/components/ThemeLivePreviewSync.js.map +1 -0
- package/dist/fields/ThemeColorPickerField.d.ts.map +1 -1
- package/dist/fields/ThemeColorPickerField.js +26 -9
- package/dist/fields/ThemeColorPickerField.js.map +1 -1
- package/dist/fields/ThemePreviewField.d.ts.map +1 -1
- package/dist/fields/ThemePreviewField.js +2 -1
- package/dist/fields/ThemePreviewField.js.map +1 -1
- package/dist/fields/ThemeTokenSelectField.js +2 -2
- package/dist/fields/ThemeTokenSelectField.js.map +1 -1
- package/dist/fields/themeConfigurationField.d.ts +1 -0
- package/dist/fields/themeConfigurationField.d.ts.map +1 -1
- package/dist/fields/themeConfigurationField.js +3 -2
- package/dist/fields/themeConfigurationField.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +337 -16
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +30 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -0
- package/dist/server.js.map +1 -1
- package/dist/types/color.d.js +2 -0
- package/dist/types/color.d.js.map +1 -0
- package/dist/types.d.ts +69 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/livePreviewRefresh.d.ts +17 -0
- package/dist/utils/livePreviewRefresh.d.ts.map +1 -0
- package/dist/utils/livePreviewRefresh.js +20 -0
- package/dist/utils/livePreviewRefresh.js.map +1 -0
- package/dist/utils/livePreviewThemeRuntime.d.ts +7 -0
- package/dist/utils/livePreviewThemeRuntime.d.ts.map +1 -0
- package/dist/utils/livePreviewThemeRuntime.js +58 -0
- package/dist/utils/livePreviewThemeRuntime.js.map +1 -0
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
import 'server-only';
|
|
2
|
+
import { revalidatePath, revalidateTag, unstable_cache } from 'next/cache';
|
|
3
|
+
import { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration } from './utils/resolveThemeConfiguration.js';
|
|
2
4
|
export { ServerThemeInjector } from './components/ServerThemeInjector.js';
|
|
3
5
|
export { createFallbackCriticalCSS, getThemeCriticalCSS, getThemeCSS, generateThemePreloadLinks, getThemeCSSPath } from './utils/themeAssets.js';
|
|
6
|
+
export const getThemeCacheTag = (globalSlug = 'appearance-settings')=>`global_${globalSlug}`;
|
|
7
|
+
export const createCachedThemeFetcher = (options)=>{
|
|
8
|
+
const { loadAppearanceSettings, globalSlug = 'appearance-settings', cacheKeyParts = [], tags = [], revalidate = 3600 } = options;
|
|
9
|
+
const defaultTag = getThemeCacheTag(globalSlug);
|
|
10
|
+
const cacheKey = [
|
|
11
|
+
`${globalSlug}-theme`,
|
|
12
|
+
...cacheKeyParts
|
|
13
|
+
];
|
|
14
|
+
const cacheTags = [
|
|
15
|
+
...new Set([
|
|
16
|
+
defaultTag,
|
|
17
|
+
...tags
|
|
18
|
+
].filter(Boolean))
|
|
19
|
+
];
|
|
20
|
+
return unstable_cache(async ()=>{
|
|
21
|
+
const appearanceSettings = await loadAppearanceSettings();
|
|
22
|
+
return resolveThemeConfiguration(appearanceSettings?.themeConfiguration ?? DEFAULT_THEME_CONFIGURATION);
|
|
23
|
+
}, cacheKey, {
|
|
24
|
+
tags: cacheTags,
|
|
25
|
+
revalidate
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export const revalidateThemeCache = async (options = {})=>{
|
|
29
|
+
const { globalSlug = 'appearance-settings', tags = [], paths = [] } = options;
|
|
30
|
+
const resolvedTags = [
|
|
31
|
+
...new Set([
|
|
32
|
+
getThemeCacheTag(globalSlug),
|
|
33
|
+
...tags
|
|
34
|
+
].filter(Boolean))
|
|
35
|
+
];
|
|
36
|
+
const resolvedPaths = [
|
|
37
|
+
...new Set(paths.filter((value)=>typeof value === 'string' && value))
|
|
38
|
+
];
|
|
39
|
+
resolvedTags.forEach((tag)=>revalidateTag(tag));
|
|
40
|
+
resolvedPaths.forEach((path)=>revalidatePath(path));
|
|
41
|
+
return {
|
|
42
|
+
tags: resolvedTags,
|
|
43
|
+
paths: resolvedPaths
|
|
44
|
+
};
|
|
45
|
+
};
|
|
4
46
|
|
|
5
47
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only'\n\nexport { ServerThemeInjector } from './components/ServerThemeInjector.js'\n\nexport {\n createFallbackCriticalCSS,\n getThemeCriticalCSS,\n getThemeCSS,\n generateThemePreloadLinks,\n getThemeCSSPath,\n} from './utils/themeAssets.js'\n"],"names":["ServerThemeInjector","createFallbackCriticalCSS","getThemeCriticalCSS","getThemeCSS","generateThemePreloadLinks","getThemeCSSPath"],"mappings":"AAAA,OAAO,cAAa;
|
|
1
|
+
{"version":3,"sources":["../src/server.ts"],"sourcesContent":["import 'server-only'\nimport { revalidatePath, revalidateTag, unstable_cache } from 'next/cache'\nimport type { SiteThemeConfiguration } from './payload-types.js'\nimport {\n DEFAULT_THEME_CONFIGURATION,\n resolveThemeConfiguration,\n} from './utils/resolveThemeConfiguration.js'\n\nexport { ServerThemeInjector } from './components/ServerThemeInjector.js'\n\nexport {\n createFallbackCriticalCSS,\n getThemeCriticalCSS,\n getThemeCSS,\n generateThemePreloadLinks,\n getThemeCSSPath,\n} from './utils/themeAssets.js'\n\nexport const getThemeCacheTag = (globalSlug = 'appearance-settings'): string =>\n `global_${globalSlug}`\n\ninterface ThemeGlobalLike {\n themeConfiguration?: SiteThemeConfiguration | null\n}\n\ninterface CreateCachedThemeFetcherOptions {\n /** Function that loads the appearance global document. */\n loadAppearanceSettings: () => Promise<ThemeGlobalLike | null | undefined>\n /** Optional global slug used for default cache tag and key (default: 'appearance-settings'). */\n globalSlug?: string\n /** Additional cache key parts passed to unstable_cache. */\n cacheKeyParts?: string[]\n /** Additional tags to include besides the default `global_{slug}` tag. */\n tags?: string[]\n /** Next.js revalidate interval in seconds (default: 3600). */\n revalidate?: number | false\n}\n\nexport const createCachedThemeFetcher = (options: CreateCachedThemeFetcherOptions) => {\n const {\n loadAppearanceSettings,\n globalSlug = 'appearance-settings',\n cacheKeyParts = [],\n tags = [],\n revalidate = 3600,\n } = options\n\n const defaultTag = getThemeCacheTag(globalSlug)\n const cacheKey = [`${globalSlug}-theme`, ...cacheKeyParts]\n const cacheTags = [...new Set([defaultTag, ...tags].filter(Boolean))]\n\n return unstable_cache(\n async () => {\n const appearanceSettings = await loadAppearanceSettings()\n return resolveThemeConfiguration(\n appearanceSettings?.themeConfiguration ?? DEFAULT_THEME_CONFIGURATION,\n )\n },\n cacheKey,\n {\n tags: cacheTags,\n revalidate,\n },\n )\n}\n\ninterface RevalidateThemeCacheOptions {\n /** Optional global slug for default tag (default: 'appearance-settings'). */\n globalSlug?: string\n /** Extra cache tags to invalidate. */\n tags?: string[]\n /** Optional paths to invalidate with revalidatePath. */\n paths?: string[]\n}\n\nexport const revalidateThemeCache = async (\n options: RevalidateThemeCacheOptions = {},\n): Promise<{ tags: string[]; paths: string[] }> => {\n const { globalSlug = 'appearance-settings', tags = [], paths = [] } = options\n\n const resolvedTags = [...new Set([getThemeCacheTag(globalSlug), ...tags].filter(Boolean))]\n const resolvedPaths = [...new Set(paths.filter((value) => typeof value === 'string' && value))]\n\n resolvedTags.forEach((tag) => revalidateTag(tag))\n resolvedPaths.forEach((path) => revalidatePath(path))\n\n return {\n tags: resolvedTags,\n paths: resolvedPaths,\n }\n}\n"],"names":["revalidatePath","revalidateTag","unstable_cache","DEFAULT_THEME_CONFIGURATION","resolveThemeConfiguration","ServerThemeInjector","createFallbackCriticalCSS","getThemeCriticalCSS","getThemeCSS","generateThemePreloadLinks","getThemeCSSPath","getThemeCacheTag","globalSlug","createCachedThemeFetcher","options","loadAppearanceSettings","cacheKeyParts","tags","revalidate","defaultTag","cacheKey","cacheTags","Set","filter","Boolean","appearanceSettings","themeConfiguration","revalidateThemeCache","paths","resolvedTags","resolvedPaths","value","forEach","tag","path"],"mappings":"AAAA,OAAO,cAAa;AACpB,SAASA,cAAc,EAAEC,aAAa,EAAEC,cAAc,QAAQ,aAAY;AAE1E,SACEC,2BAA2B,EAC3BC,yBAAyB,QACpB,uCAAsC;AAE7C,SAASC,mBAAmB,QAAQ,sCAAqC;AAEzE,SACEC,yBAAyB,EACzBC,mBAAmB,EACnBC,WAAW,EACXC,yBAAyB,EACzBC,eAAe,QACV,yBAAwB;AAE/B,OAAO,MAAMC,mBAAmB,CAACC,aAAa,qBAAqB,GACjE,CAAC,OAAO,EAAEA,YAAY,CAAA;AAmBxB,OAAO,MAAMC,2BAA2B,CAACC;IACvC,MAAM,EACJC,sBAAsB,EACtBH,aAAa,qBAAqB,EAClCI,gBAAgB,EAAE,EAClBC,OAAO,EAAE,EACTC,aAAa,IAAI,EAClB,GAAGJ;IAEJ,MAAMK,aAAaR,iBAAiBC;IACpC,MAAMQ,WAAW;QAAC,GAAGR,WAAW,MAAM,CAAC;WAAKI;KAAc;IAC1D,MAAMK,YAAY;WAAI,IAAIC,IAAI;YAACH;eAAeF;SAAK,CAACM,MAAM,CAACC;KAAU;IAErE,OAAOtB,eACL;QACE,MAAMuB,qBAAqB,MAAMV;QACjC,OAAOX,0BACLqB,oBAAoBC,sBAAsBvB;IAE9C,GACAiB,UACA;QACEH,MAAMI;QACNH;IACF;AAEJ,EAAC;AAWD,OAAO,MAAMS,uBAAuB,OAClCb,UAAuC,CAAC,CAAC;IAEzC,MAAM,EAAEF,aAAa,qBAAqB,EAAEK,OAAO,EAAE,EAAEW,QAAQ,EAAE,EAAE,GAAGd;IAEtE,MAAMe,eAAe;WAAI,IAAIP,IAAI;YAACX,iBAAiBC;eAAgBK;SAAK,CAACM,MAAM,CAACC;KAAU;IAC1F,MAAMM,gBAAgB;WAAI,IAAIR,IAAIM,MAAML,MAAM,CAAC,CAACQ,QAAU,OAAOA,UAAU,YAAYA;KAAQ;IAE/FF,aAAaG,OAAO,CAAC,CAACC,MAAQhC,cAAcgC;IAC5CH,cAAcE,OAAO,CAAC,CAACE,OAASlC,eAAekC;IAE/C,OAAO;QACLjB,MAAMY;QACND,OAAOE;IACT;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/color.d.ts"],"names":[],"mappings":""}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,69 @@
|
|
|
1
1
|
import type { ThemePreset } from './presets.js';
|
|
2
|
+
export interface ThemeManagementLivePreviewUrlArgs {
|
|
3
|
+
/** Resolved preview page document (if found) */
|
|
4
|
+
page?: Record<string, unknown>;
|
|
5
|
+
/** Resolved preview page slug */
|
|
6
|
+
pageSlug: string;
|
|
7
|
+
/** Inferred tenant identifier (if available) */
|
|
8
|
+
tenantSlug?: string;
|
|
9
|
+
/** Current Payload request */
|
|
10
|
+
req: {
|
|
11
|
+
payload: {
|
|
12
|
+
find: (args: Record<string, unknown>) => Promise<{
|
|
13
|
+
docs?: Array<Record<string, unknown>>;
|
|
14
|
+
}>;
|
|
15
|
+
logger?: {
|
|
16
|
+
warn?: (...args: unknown[]) => void;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
query?: unknown;
|
|
20
|
+
headers?: unknown;
|
|
21
|
+
user?: unknown;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export interface ThemeManagementLivePreviewOptions {
|
|
25
|
+
/** Enable Payload admin live preview for the target config (default: true) */
|
|
26
|
+
enabled?: boolean;
|
|
27
|
+
/** Collection slug containing preview pages (default: 'pages') */
|
|
28
|
+
pageCollection?: string;
|
|
29
|
+
/** Preferred page slug for preview (default: 'home') */
|
|
30
|
+
pageSlug?: string;
|
|
31
|
+
/** Fallback to first page if preferred slug does not exist (default: true) */
|
|
32
|
+
fallbackToFirstPage?: boolean;
|
|
33
|
+
/** Tenant field name used for filtering in multi-tenant setups (default: 'tenant') */
|
|
34
|
+
tenantField?: string;
|
|
35
|
+
/** Query param name appended to default URL when tenant is resolved (default: 'tenant') */
|
|
36
|
+
tenantQueryParam?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Device breakpoints shown in Payload's Live Preview toolbar (iframe size presets).
|
|
39
|
+
* Use this to make preview sizing more practical for your editors.
|
|
40
|
+
*/
|
|
41
|
+
breakpoints?: Array<{
|
|
42
|
+
name: string;
|
|
43
|
+
label: string;
|
|
44
|
+
width: number | string;
|
|
45
|
+
height: number | string;
|
|
46
|
+
}>;
|
|
47
|
+
/**
|
|
48
|
+
* Custom URL resolver for Payload live preview.
|
|
49
|
+
* Defaults to `/${slug}` (or `/` for `home`) with optional tenant query param.
|
|
50
|
+
*/
|
|
51
|
+
url?: (args: ThemeManagementLivePreviewUrlArgs) => string | Promise<string>;
|
|
52
|
+
}
|
|
53
|
+
export interface ThemeManagementCacheRevalidationOptions {
|
|
54
|
+
/** Enable cache revalidation support (default: true for standalone mode, false for tab mode) */
|
|
55
|
+
enabled?: boolean;
|
|
56
|
+
/** Inject a Payload endpoint for manual/external revalidation triggers (default: true) */
|
|
57
|
+
injectRoute?: boolean;
|
|
58
|
+
/** Endpoint path under Payload API (default: '/theme/revalidate') */
|
|
59
|
+
routePath?: string;
|
|
60
|
+
/** Optional shared secret checked against header/body/query before revalidation */
|
|
61
|
+
secret?: string;
|
|
62
|
+
/** Additional tags to revalidate together with the default global tag */
|
|
63
|
+
tags?: string[];
|
|
64
|
+
/** Optional paths to revalidate together with tags */
|
|
65
|
+
paths?: string[];
|
|
66
|
+
}
|
|
2
67
|
export interface ThemeManagementPluginOptions {
|
|
3
68
|
/** Whether the plugin should register itself */
|
|
4
69
|
enabled?: boolean;
|
|
@@ -24,6 +89,10 @@ export interface ThemeManagementPluginOptions {
|
|
|
24
89
|
enableAdvancedFeatures?: boolean;
|
|
25
90
|
/** Log helpful messages during config mutation */
|
|
26
91
|
enableLogging?: boolean;
|
|
92
|
+
/** Configure Payload admin live preview URL generation */
|
|
93
|
+
livePreview?: boolean | ThemeManagementLivePreviewOptions;
|
|
94
|
+
/** Configure cache revalidation route and tags for Next.js `unstable_cache` usage */
|
|
95
|
+
cacheRevalidation?: boolean | ThemeManagementCacheRevalidationOptions;
|
|
27
96
|
}
|
|
28
97
|
export interface FetchThemeConfigurationOptions {
|
|
29
98
|
/** Optional tenant identifier if your project is multi-tenant */
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,4BAA4B;IAC3C,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iFAAiF;IACjF,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,yEAAyE;IACzE,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,2EAA2E;IAC3E,yBAAyB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC3D,yCAAyC;IACzC,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;IAC5B,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,gEAAgE;IAChE,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,+BAA+B;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,gDAAgD;IAChD,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kDAAkD;IAClD,aA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AA;IAC9B,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,GAAG,iCAAiC,CAAA;IACzD,qFAAqF;IACrF,iBAAiB,CAAC,EAAE,OAAO,GAAG,uCAAuC,CAAA;CACtE;AAED,MAAM,WAAW,8BAA8B;IAC7C,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,8BAA8B;IAC9B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAA;IACvD,oFAAoF;IACpF,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { ThemePreset } from './presets.js'\n\nexport interface ThemeManagementPluginOptions {\n /** Whether the plugin should register itself */\n enabled?: boolean\n /** Collection slug that stores site-level settings (default: `site-settings`) */\n targetCollection?: string\n /** Create a standalone collection instead of adding as a tab (default: false) */\n useStandaloneCollection?: boolean\n /** Name of the standalone collection (default: 'appearance-settings') */\n standaloneCollectionSlug?: string\n /** Label for the standalone collection (default: 'Appearance Settings') */\n standaloneCollectionLabel?: string | Record<string, string>\n /** Theme presets available to editors */\n themePresets?: ThemePreset[]\n /** Default preset name when no value is stored */\n defaultTheme?: string\n /** Allow editors to toggle between light / dark / auto modes */\n includeColorModeToggle?: boolean\n /** Expose custom CSS editor */\n includeCustomCSS?: boolean\n /** Reserved for future use, keeps API parity */\n includeBrandIdentity?: boolean\n /** Enable advanced controls such as animation level */\n enableAdvancedFeatures?: boolean\n /** Log helpful messages during config mutation */\n enableLogging?: boolean\n}\n\nexport interface FetchThemeConfigurationOptions {\n /** Optional tenant identifier if your project is multi-tenant */\n tenantSlug?: string\n /** Collection/Global slug override (default: `site-settings`) */\n collectionSlug?: string\n /** Depth parameter passed to Payload REST API */\n depth?: number\n /** Locale parameter passed to Payload REST API */\n locale?: string\n /** Include draft documents */\n draft?: boolean\n /** Extra query parameters to append to the request */\n queryParams?: Record<string, string | number | boolean>\n /** Set to true if using standalone global instead of collection (default: false) */\n useGlobal?: boolean\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { ThemePreset } from './presets.js'\n\nexport interface ThemeManagementLivePreviewUrlArgs {\n /** Resolved preview page document (if found) */\n page?: Record<string, unknown>\n /** Resolved preview page slug */\n pageSlug: string\n /** Inferred tenant identifier (if available) */\n tenantSlug?: string\n /** Current Payload request */\n req: {\n payload: {\n find: (args: Record<string, unknown>) => Promise<{ docs?: Array<Record<string, unknown>> }>\n logger?: {\n warn?: (...args: unknown[]) => void\n }\n }\n query?: unknown\n headers?: unknown\n user?: unknown\n }\n}\n\nexport interface ThemeManagementLivePreviewOptions {\n /** Enable Payload admin live preview for the target config (default: true) */\n enabled?: boolean\n /** Collection slug containing preview pages (default: 'pages') */\n pageCollection?: string\n /** Preferred page slug for preview (default: 'home') */\n pageSlug?: string\n /** Fallback to first page if preferred slug does not exist (default: true) */\n fallbackToFirstPage?: boolean\n /** Tenant field name used for filtering in multi-tenant setups (default: 'tenant') */\n tenantField?: string\n /** Query param name appended to default URL when tenant is resolved (default: 'tenant') */\n tenantQueryParam?: string\n /**\n * Device breakpoints shown in Payload's Live Preview toolbar (iframe size presets).\n * Use this to make preview sizing more practical for your editors.\n */\n breakpoints?: Array<{\n name: string\n label: string\n width: number | string\n height: number | string\n }>\n /**\n * Custom URL resolver for Payload live preview.\n * Defaults to `/${slug}` (or `/` for `home`) with optional tenant query param.\n */\n url?: (args: ThemeManagementLivePreviewUrlArgs) => string | Promise<string>\n}\n\nexport interface ThemeManagementCacheRevalidationOptions {\n /** Enable cache revalidation support (default: true for standalone mode, false for tab mode) */\n enabled?: boolean\n /** Inject a Payload endpoint for manual/external revalidation triggers (default: true) */\n injectRoute?: boolean\n /** Endpoint path under Payload API (default: '/theme/revalidate') */\n routePath?: string\n /** Optional shared secret checked against header/body/query before revalidation */\n secret?: string\n /** Additional tags to revalidate together with the default global tag */\n tags?: string[]\n /** Optional paths to revalidate together with tags */\n paths?: string[]\n}\n\nexport interface ThemeManagementPluginOptions {\n /** Whether the plugin should register itself */\n enabled?: boolean\n /** Collection slug that stores site-level settings (default: `site-settings`) */\n targetCollection?: string\n /** Create a standalone collection instead of adding as a tab (default: false) */\n useStandaloneCollection?: boolean\n /** Name of the standalone collection (default: 'appearance-settings') */\n standaloneCollectionSlug?: string\n /** Label for the standalone collection (default: 'Appearance Settings') */\n standaloneCollectionLabel?: string | Record<string, string>\n /** Theme presets available to editors */\n themePresets?: ThemePreset[]\n /** Default preset name when no value is stored */\n defaultTheme?: string\n /** Allow editors to toggle between light / dark / auto modes */\n includeColorModeToggle?: boolean\n /** Expose custom CSS editor */\n includeCustomCSS?: boolean\n /** Reserved for future use, keeps API parity */\n includeBrandIdentity?: boolean\n /** Enable advanced controls such as animation level */\n enableAdvancedFeatures?: boolean\n /** Log helpful messages during config mutation */\n enableLogging?: boolean\n /** Configure Payload admin live preview URL generation */\n livePreview?: boolean | ThemeManagementLivePreviewOptions\n /** Configure cache revalidation route and tags for Next.js `unstable_cache` usage */\n cacheRevalidation?: boolean | ThemeManagementCacheRevalidationOptions\n}\n\nexport interface FetchThemeConfigurationOptions {\n /** Optional tenant identifier if your project is multi-tenant */\n tenantSlug?: string\n /** Collection/Global slug override (default: `site-settings`) */\n collectionSlug?: string\n /** Depth parameter passed to Payload REST API */\n depth?: number\n /** Locale parameter passed to Payload REST API */\n locale?: string\n /** Include draft documents */\n draft?: boolean\n /** Extra query parameters to append to the request */\n queryParams?: Record<string, string | number | boolean>\n /** Set to true if using standalone global instead of collection (default: false) */\n useGlobal?: boolean\n}\n"],"names":[],"mappings":"AAmGA,WAeC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CreateThemeLivePreviewRefreshOptions {
|
|
2
|
+
/** Endpoint exposed by theme-management plugin for cache revalidation. */
|
|
3
|
+
endpoint?: string;
|
|
4
|
+
/** Optional secret sent as x-theme-revalidate-secret header. */
|
|
5
|
+
secret?: string;
|
|
6
|
+
/** Request credentials mode (default: include). */
|
|
7
|
+
credentials?: RequestCredentials;
|
|
8
|
+
/** Optional callback triggered when revalidation request fails. */
|
|
9
|
+
onError?: (error: unknown) => void;
|
|
10
|
+
/** Optional callback executed after revalidation attempt (typically router.refresh). */
|
|
11
|
+
onAfterRevalidate?: () => void | Promise<void>;
|
|
12
|
+
/** Test hook to override fetch implementation. */
|
|
13
|
+
fetchImpl?: typeof fetch;
|
|
14
|
+
}
|
|
15
|
+
export declare const DEFAULT_THEME_REVALIDATE_ENDPOINT = "/api/theme/revalidate";
|
|
16
|
+
export declare const createThemeLivePreviewRefresh: (options?: CreateThemeLivePreviewRefreshOptions) => (() => Promise<void>);
|
|
17
|
+
//# sourceMappingURL=livePreviewRefresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePreviewRefresh.d.ts","sourceRoot":"","sources":["../../src/utils/livePreviewRefresh.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oCAAoC;IACnD,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,WAAW,CAAC,EAAE,kBAAkB,CAAA;IAChC,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;IAClC,wFAAwF;IACxF,iBAAiB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9C,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB;AAED,eAAO,MAAM,iCAAiC,0BAA0B,CAAA;AAExE,eAAO,MAAM,6BAA6B,GACxC,UAAS,oCAAyC,KACjD,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CA4BtB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const DEFAULT_THEME_REVALIDATE_ENDPOINT = '/api/theme/revalidate';
|
|
2
|
+
export const createThemeLivePreviewRefresh = (options = {})=>{
|
|
3
|
+
const { endpoint = process.env.NEXT_PUBLIC_THEME_REVALIDATE_ENDPOINT || DEFAULT_THEME_REVALIDATE_ENDPOINT, secret = process.env.NEXT_PUBLIC_THEME_REVALIDATE_SECRET, credentials = 'include', onError, onAfterRevalidate, fetchImpl = fetch } = options;
|
|
4
|
+
return async ()=>{
|
|
5
|
+
try {
|
|
6
|
+
await fetchImpl(endpoint, {
|
|
7
|
+
method: 'POST',
|
|
8
|
+
credentials,
|
|
9
|
+
headers: secret ? {
|
|
10
|
+
'x-theme-revalidate-secret': secret
|
|
11
|
+
} : undefined
|
|
12
|
+
});
|
|
13
|
+
} catch (error) {
|
|
14
|
+
onError?.(error);
|
|
15
|
+
}
|
|
16
|
+
await onAfterRevalidate?.();
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=livePreviewRefresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/livePreviewRefresh.ts"],"sourcesContent":["export interface CreateThemeLivePreviewRefreshOptions {\n /** Endpoint exposed by theme-management plugin for cache revalidation. */\n endpoint?: string\n /** Optional secret sent as x-theme-revalidate-secret header. */\n secret?: string\n /** Request credentials mode (default: include). */\n credentials?: RequestCredentials\n /** Optional callback triggered when revalidation request fails. */\n onError?: (error: unknown) => void\n /** Optional callback executed after revalidation attempt (typically router.refresh). */\n onAfterRevalidate?: () => void | Promise<void>\n /** Test hook to override fetch implementation. */\n fetchImpl?: typeof fetch\n}\n\nexport const DEFAULT_THEME_REVALIDATE_ENDPOINT = '/api/theme/revalidate'\n\nexport const createThemeLivePreviewRefresh = (\n options: CreateThemeLivePreviewRefreshOptions = {},\n): (() => Promise<void>) => {\n const {\n endpoint = process.env.NEXT_PUBLIC_THEME_REVALIDATE_ENDPOINT ||\n DEFAULT_THEME_REVALIDATE_ENDPOINT,\n secret = process.env.NEXT_PUBLIC_THEME_REVALIDATE_SECRET,\n credentials = 'include',\n onError,\n onAfterRevalidate,\n fetchImpl = fetch,\n } = options\n\n return async () => {\n try {\n await fetchImpl(endpoint, {\n method: 'POST',\n credentials,\n headers: secret\n ? {\n 'x-theme-revalidate-secret': secret,\n }\n : undefined,\n })\n } catch (error) {\n onError?.(error)\n }\n\n await onAfterRevalidate?.()\n }\n}\n"],"names":["DEFAULT_THEME_REVALIDATE_ENDPOINT","createThemeLivePreviewRefresh","options","endpoint","process","env","NEXT_PUBLIC_THEME_REVALIDATE_ENDPOINT","secret","NEXT_PUBLIC_THEME_REVALIDATE_SECRET","credentials","onError","onAfterRevalidate","fetchImpl","fetch","method","headers","undefined","error"],"mappings":"AAeA,OAAO,MAAMA,oCAAoC,wBAAuB;AAExE,OAAO,MAAMC,gCAAgC,CAC3CC,UAAgD,CAAC,CAAC;IAElD,MAAM,EACJC,WAAWC,QAAQC,GAAG,CAACC,qCAAqC,IAC1DN,iCAAiC,EACnCO,SAASH,QAAQC,GAAG,CAACG,mCAAmC,EACxDC,cAAc,SAAS,EACvBC,OAAO,EACPC,iBAAiB,EACjBC,YAAYC,KAAK,EAClB,GAAGX;IAEJ,OAAO;QACL,IAAI;YACF,MAAMU,UAAUT,UAAU;gBACxBW,QAAQ;gBACRL;gBACAM,SAASR,SACL;oBACE,6BAA6BA;gBAC/B,IACAS;YACN;QACF,EAAE,OAAOC,OAAO;YACdP,UAAUO;QACZ;QAEA,MAAMN;IACR;AACF,EAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const extractThemeConfigurationFromLiveData: (liveData: Record<string, unknown>, themeConfigurationKey?: string) => unknown;
|
|
2
|
+
export declare const buildLivePreviewThemeRuntime: (themeConfiguration: unknown) => {
|
|
3
|
+
theme: "cyberpunk" | "minimal" | "retro" | "brutal" | "pastel" | "ocean" | "forest" | "sunset" | "lavender" | "neutral" | "blue" | "green" | "red" | "orange" | "rose" | "violet" | "zinc" | "slate" | "stone" | "gray" | "cool" | "neon" | "solar" | "dealership" | "real-estate" | "real-estate-gold" | "real-estate-neutral";
|
|
4
|
+
mode: "light" | "dark";
|
|
5
|
+
css: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=livePreviewThemeRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePreviewThemeRuntime.d.ts","sourceRoot":"","sources":["../../src/utils/livePreviewThemeRuntime.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,qCAAqC,GAChD,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,8BAA4C,KAC3C,OAOF,CAAA;AAkBD,eAAO,MAAM,4BAA4B,GAAI,oBAAoB,OAAO;;;;CA0CvE,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getBorderRadiusConfig } from '../providers/Theme/themeConfig.js';
|
|
2
|
+
import { resolveThemeConfiguration } from './resolveThemeConfiguration.js';
|
|
3
|
+
import { generateThemeColorsCss } from './themeColors.js';
|
|
4
|
+
import { generateThemeCSS } from './themeUtils.js';
|
|
5
|
+
export const extractThemeConfigurationFromLiveData = (liveData, themeConfigurationKey = 'themeConfiguration')=>{
|
|
6
|
+
const candidate = liveData?.[themeConfigurationKey];
|
|
7
|
+
if (candidate && typeof candidate === 'object') {
|
|
8
|
+
return candidate;
|
|
9
|
+
}
|
|
10
|
+
return liveData;
|
|
11
|
+
};
|
|
12
|
+
const resolveColorMode = (mode)=>{
|
|
13
|
+
if (mode === 'dark') {
|
|
14
|
+
return 'dark';
|
|
15
|
+
}
|
|
16
|
+
if (mode === 'auto' && globalThis.window !== undefined && typeof globalThis.window.matchMedia === 'function') {
|
|
17
|
+
return globalThis.window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
18
|
+
}
|
|
19
|
+
return 'light';
|
|
20
|
+
};
|
|
21
|
+
export const buildLivePreviewThemeRuntime = (themeConfiguration)=>{
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const resolved = resolveThemeConfiguration(themeConfiguration);
|
|
24
|
+
const borderRadiusMap = {
|
|
25
|
+
none: 'none',
|
|
26
|
+
small: 'small',
|
|
27
|
+
medium: 'medium',
|
|
28
|
+
large: 'large',
|
|
29
|
+
xl: 'xl',
|
|
30
|
+
full: 'xl'
|
|
31
|
+
};
|
|
32
|
+
const mappedBorderRadius = borderRadiusMap[resolved.borderRadius ?? 'medium'] ?? 'medium';
|
|
33
|
+
const borderRadiusConfig = getBorderRadiusConfig(mappedBorderRadius);
|
|
34
|
+
const cssRecord = typeof borderRadiusConfig?.css === 'string' ? {
|
|
35
|
+
'--radius-default': borderRadiusConfig.css
|
|
36
|
+
} : borderRadiusConfig?.css ?? {};
|
|
37
|
+
const borderRadiusCSS = Object.entries(cssRecord).map(([property, value])=>` ${property}: ${value};`).join('\n');
|
|
38
|
+
const borderRadiusBlock = borderRadiusCSS ? `:root {\n${borderRadiusCSS}\n}` : '';
|
|
39
|
+
const themeConfigurationCSS = generateThemeCSS(resolved);
|
|
40
|
+
const colorModesCSS = generateThemeColorsCss({
|
|
41
|
+
themeName: resolved.theme,
|
|
42
|
+
lightMode: resolved.lightMode,
|
|
43
|
+
darkMode: resolved.darkMode
|
|
44
|
+
});
|
|
45
|
+
const customCSSBlock = typeof resolved.customCSS === 'string' ? resolved.customCSS.trim() : '';
|
|
46
|
+
return {
|
|
47
|
+
theme: resolved.theme,
|
|
48
|
+
mode: resolveColorMode(resolved.colorMode),
|
|
49
|
+
css: [
|
|
50
|
+
borderRadiusBlock,
|
|
51
|
+
themeConfigurationCSS,
|
|
52
|
+
colorModesCSS,
|
|
53
|
+
customCSSBlock
|
|
54
|
+
].filter((block)=>Boolean(block?.trim?.().length)).join('\n\n')
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=livePreviewThemeRuntime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/utils/livePreviewThemeRuntime.ts"],"sourcesContent":["import { getBorderRadiusConfig } from '../providers/Theme/themeConfig.js'\nimport { resolveThemeConfiguration } from './resolveThemeConfiguration.js'\nimport { generateThemeColorsCss } from './themeColors.js'\nimport { generateThemeCSS } from './themeUtils.js'\n\nexport const extractThemeConfigurationFromLiveData = (\n liveData: Record<string, unknown>,\n themeConfigurationKey = 'themeConfiguration',\n): unknown => {\n const candidate = liveData?.[themeConfigurationKey]\n if (candidate && typeof candidate === 'object') {\n return candidate\n }\n\n return liveData\n}\n\nconst resolveColorMode = (mode: string): 'light' | 'dark' => {\n if (mode === 'dark') {\n return 'dark'\n }\n\n if (\n mode === 'auto' &&\n globalThis.window !== undefined &&\n typeof globalThis.window.matchMedia === 'function'\n ) {\n return globalThis.window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n }\n\n return 'light'\n}\n\nexport const buildLivePreviewThemeRuntime = (themeConfiguration: unknown) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const resolved = resolveThemeConfiguration(themeConfiguration as any)\n\n const borderRadiusMap: Record<string, 'none' | 'small' | 'medium' | 'large' | 'xl'> = {\n none: 'none',\n small: 'small',\n medium: 'medium',\n large: 'large',\n xl: 'xl',\n full: 'xl',\n }\n\n const mappedBorderRadius = borderRadiusMap[resolved.borderRadius ?? 'medium'] ?? 'medium'\n const borderRadiusConfig = getBorderRadiusConfig(mappedBorderRadius)\n const cssRecord =\n typeof borderRadiusConfig?.css === 'string'\n ? { '--radius-default': borderRadiusConfig.css }\n : (borderRadiusConfig?.css ?? {})\n\n const borderRadiusCSS = Object.entries(cssRecord)\n .map(([property, value]) => ` ${property}: ${value};`)\n .join('\\n')\n\n const borderRadiusBlock = borderRadiusCSS ? `:root {\\n${borderRadiusCSS}\\n}` : ''\n\n const themeConfigurationCSS = generateThemeCSS(resolved)\n const colorModesCSS = generateThemeColorsCss({\n themeName: resolved.theme,\n lightMode: resolved.lightMode,\n darkMode: resolved.darkMode,\n })\n\n const customCSSBlock = typeof resolved.customCSS === 'string' ? resolved.customCSS.trim() : ''\n\n return {\n theme: resolved.theme,\n mode: resolveColorMode(resolved.colorMode),\n css: [borderRadiusBlock, themeConfigurationCSS, colorModesCSS, customCSSBlock]\n .filter((block) => Boolean(block?.trim?.().length))\n .join('\\n\\n'),\n }\n}\n"],"names":["getBorderRadiusConfig","resolveThemeConfiguration","generateThemeColorsCss","generateThemeCSS","extractThemeConfigurationFromLiveData","liveData","themeConfigurationKey","candidate","resolveColorMode","mode","globalThis","window","undefined","matchMedia","matches","buildLivePreviewThemeRuntime","themeConfiguration","resolved","borderRadiusMap","none","small","medium","large","xl","full","mappedBorderRadius","borderRadius","borderRadiusConfig","cssRecord","css","borderRadiusCSS","Object","entries","map","property","value","join","borderRadiusBlock","themeConfigurationCSS","colorModesCSS","themeName","theme","lightMode","darkMode","customCSSBlock","customCSS","trim","colorMode","filter","block","Boolean","length"],"mappings":"AAAA,SAASA,qBAAqB,QAAQ,oCAAmC;AACzE,SAASC,yBAAyB,QAAQ,iCAAgC;AAC1E,SAASC,sBAAsB,QAAQ,mBAAkB;AACzD,SAASC,gBAAgB,QAAQ,kBAAiB;AAElD,OAAO,MAAMC,wCAAwC,CACnDC,UACAC,wBAAwB,oBAAoB;IAE5C,MAAMC,YAAYF,UAAU,CAACC,sBAA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,CAACC,IAAI,KAAK;IAE5F,OAAO;QACLL,OAAOxB,SAASwB,KAAK;QACrBhC,MAAMD,iBAAiBS,SAAS8B,SAAS;QACzClB,KAAK;YAACQ;YAAmBC;YAAuBC;YAAeK;SAAe,CAC3EI,MAAM,CAAC,CAACC,QAAUC,QAAQD,OAAOH,SAASK,SAC1Cf,IAAI,CAAC;IACV;AACF,EAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kilivi/payloadcms-theme-management",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Theme configuration plugin for Payload CMS v3 with 60+ professional themes and standalone collection support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|