@kilivi/payloadcms-theme-management 0.1.6 → 0.1.8

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.
Files changed (89) hide show
  1. package/dist/components/ServerThemeInjector.d.ts +1 -1
  2. package/dist/components/ServerThemeInjector.d.ts.map +1 -1
  3. package/dist/components/{ServerThemeInjector.jsx → ServerThemeInjector.js} +47 -34
  4. package/dist/components/ServerThemeInjector.js.map +1 -0
  5. package/dist/components/ThemePreview.js +318 -0
  6. package/dist/components/ThemePreview.js.map +1 -0
  7. package/dist/components/typographyPreviewUtils.js +12 -17
  8. package/dist/components/typographyPreviewUtils.js.map +1 -1
  9. package/dist/constants/themeFonts.js +94 -24
  10. package/dist/constants/themeFonts.js.map +1 -1
  11. package/dist/fields/ColorPickerField.js +332 -0
  12. package/dist/fields/ColorPickerField.js.map +1 -0
  13. package/dist/fields/RadiusField.js +174 -0
  14. package/dist/fields/RadiusField.js.map +1 -0
  15. package/dist/fields/ThemeColorPickerField.js +163 -0
  16. package/dist/fields/ThemeColorPickerField.js.map +1 -0
  17. package/dist/fields/ThemePreviewField.js +558 -0
  18. package/dist/fields/ThemePreviewField.js.map +1 -0
  19. package/dist/fields/ThemeTokenSelectField.js +209 -0
  20. package/dist/fields/ThemeTokenSelectField.js.map +1 -0
  21. package/dist/fields/colorModeFields.js +167 -73
  22. package/dist/fields/colorModeFields.js.map +1 -1
  23. package/dist/fields/themeConfigurationField.d.ts +1 -1
  24. package/dist/fields/themeConfigurationField.d.ts.map +1 -1
  25. package/dist/fields/themeConfigurationField.js +224 -131
  26. package/dist/fields/themeConfigurationField.js.map +1 -1
  27. package/dist/index.d.ts +17 -16
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +52 -52
  30. package/dist/index.js.map +1 -1
  31. package/dist/payload-types.js +2 -2
  32. package/dist/payload-types.js.map +1 -1
  33. package/dist/plugin.d.ts +1 -2
  34. package/dist/plugin.d.ts.map +1 -1
  35. package/dist/plugin.js +2 -1
  36. package/dist/plugin.js.map +1 -1
  37. package/dist/presets.js +66 -65
  38. package/dist/presets.js.map +1 -1
  39. package/dist/providers/Theme/index.d.ts +1 -1
  40. package/dist/providers/Theme/index.d.ts.map +1 -1
  41. package/dist/providers/Theme/{index.jsx → index.js} +61 -31
  42. package/dist/providers/Theme/index.js.map +1 -0
  43. package/dist/providers/Theme/shared.d.ts +1 -1
  44. package/dist/providers/Theme/shared.d.ts.map +1 -1
  45. package/dist/providers/Theme/shared.js +34 -9
  46. package/dist/providers/Theme/shared.js.map +1 -1
  47. package/dist/providers/Theme/themeConfig.d.ts +1 -1
  48. package/dist/providers/Theme/themeConfig.d.ts.map +1 -1
  49. package/dist/providers/Theme/themeConfig.js +37 -36
  50. package/dist/providers/Theme/themeConfig.js.map +1 -1
  51. package/dist/providers/Theme/types.js +15 -13
  52. package/dist/providers/Theme/types.js.map +1 -1
  53. package/dist/server.d.ts +2 -2
  54. package/dist/server.d.ts.map +1 -1
  55. package/dist/server.js +3 -2
  56. package/dist/server.js.map +1 -1
  57. package/dist/types.d.ts +2 -2
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/types.js +2 -1
  60. package/dist/types.js.map +1 -1
  61. package/dist/utils/resolveThemeConfiguration.d.ts +3 -3
  62. package/dist/utils/resolveThemeConfiguration.d.ts.map +1 -1
  63. package/dist/utils/resolveThemeConfiguration.js +53 -34
  64. package/dist/utils/resolveThemeConfiguration.js.map +1 -1
  65. package/dist/utils/themeAssets.d.ts +1 -1
  66. package/dist/utils/themeAssets.d.ts.map +1 -1
  67. package/dist/utils/themeAssets.js +4 -4
  68. package/dist/utils/themeAssets.js.map +1 -1
  69. package/dist/utils/themeColors.js +95 -41
  70. package/dist/utils/themeColors.js.map +1 -1
  71. package/dist/utils/themeUtils.d.ts +2 -2
  72. package/dist/utils/themeUtils.d.ts.map +1 -1
  73. package/dist/utils/themeUtils.js +32 -47
  74. package/dist/utils/themeUtils.js.map +1 -1
  75. package/package.json +13 -5
  76. package/dist/components/ServerThemeInjector.jsx.map +0 -1
  77. package/dist/components/ThemePreview.jsx +0 -231
  78. package/dist/components/ThemePreview.jsx.map +0 -1
  79. package/dist/fields/ColorPickerField.jsx +0 -205
  80. package/dist/fields/ColorPickerField.jsx.map +0 -1
  81. package/dist/fields/RadiusField.jsx +0 -123
  82. package/dist/fields/RadiusField.jsx.map +0 -1
  83. package/dist/fields/ThemeColorPickerField.jsx +0 -110
  84. package/dist/fields/ThemeColorPickerField.jsx.map +0 -1
  85. package/dist/fields/ThemePreviewField.jsx +0 -420
  86. package/dist/fields/ThemePreviewField.jsx.map +0 -1
  87. package/dist/fields/ThemeTokenSelectField.jsx +0 -151
  88. package/dist/fields/ThemeTokenSelectField.jsx.map +0 -1
  89. package/dist/providers/Theme/index.jsx.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,22 +1,23 @@
1
1
  import type { Plugin } from 'payload';
2
- import type { SiteThemeConfiguration } from './payload-types';
3
- import type { ThemePreset } from './presets';
4
- import type { FetchThemeConfigurationOptions, ThemeConfigurationPluginOptions } from './types';
5
- export declare const themeConfigurationPlugin: (options?: ThemeConfigurationPluginOptions) => Plugin;
2
+ import type { SiteThemeConfiguration } from './payload-types.js';
3
+ import type { ThemePreset } from './presets.js';
4
+ import type { FetchThemeConfigurationOptions, ThemeManagementPluginOptions } from './types.js';
5
+ export declare const themeManagementPlugin: (options?: ThemeManagementPluginOptions) => Plugin;
6
6
  type FetchOptionsInput = string | FetchThemeConfigurationOptions;
7
7
  export declare const fetchThemeConfiguration: (options?: FetchOptionsInput) => Promise<SiteThemeConfiguration | null>;
8
8
  export declare const getThemePreset: (themeName: string) => ThemePreset | null;
9
9
  export declare const getAvailableThemePresets: () => ThemePreset[];
10
- export declare const ThemeConfigurationPlugin: (options?: ThemeConfigurationPluginOptions) => Plugin;
11
- export declare const themeManagementPlugin: (options?: ThemeConfigurationPluginOptions) => Plugin;
12
- export default themeConfigurationPlugin;
13
- export { defaultThemePresets } from './presets';
14
- export type { ThemePreset, ThemeTypographyPreset } from './presets';
15
- export type { ThemeConfigurationPluginOptions, FetchThemeConfigurationOptions } from './types';
16
- export { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration, } from './utils/resolveThemeConfiguration';
17
- export { generateThemeColorsCss, hexToHsl } from './utils/themeColors';
18
- export { generateThemeCSS, getThemeStyles } from './utils/themeUtils';
19
- export { ServerThemeInjector } from './components/ServerThemeInjector';
20
- export type { Mode, ThemeDefaults } from './providers/Theme/types';
21
- export { ThemeProvider } from './providers/Theme';
10
+ export { defaultThemePresets } from './presets.js';
11
+ export type { ThemePreset, ThemeTypographyPreset } from './presets.js';
12
+ export type { ThemeManagementPluginOptions, FetchThemeConfigurationOptions } from './types.js';
13
+ export { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration, } from './utils/resolveThemeConfiguration.js';
14
+ export { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js';
15
+ export { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js';
16
+ export { ServerThemeInjector } from './components/ServerThemeInjector.js';
17
+ export type { Mode, ThemeDefaults } from './providers/Theme/types.js';
18
+ export { ThemeProvider } from './providers/Theme/index.js';
19
+ export declare const ThemeManagementPlugin: (options?: ThemeManagementPluginOptions) => Plugin;
20
+ /** @deprecated use {@link themeManagementPlugin} */
21
+ export declare const themeConfigurationPlugin: (options?: ThemeManagementPluginOptions) => Plugin;
22
+ export default themeManagementPlugin;
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmC,MAAM,EAAE,MAAM,SAAS,CAAA;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EACV,8BAA8B,EAC9B,+BAA+B,EACh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 -1,24 +1,27 @@
1
- import { createThemeConfigurationField } from './fields/themeConfigurationField';
2
- import { defaultThemePresets } from './presets';
1
+ import { createThemeConfigurationField } from './fields/themeConfigurationField.js';
2
+ import { defaultThemePresets } from './presets.js';
3
3
  const THEME_FIELD_NAME = 'themeConfiguration';
4
- const removeExistingThemeField = (fields = []) => fields.filter((field) => {
5
- const candidate = field;
6
- return candidate?.name !== THEME_FIELD_NAME;
7
- });
8
- const upsertThemeField = (fields, themeField, enableLogging) => {
4
+ const removeExistingThemeField = (fields = [])=>fields.filter((field)=>{
5
+ const candidate = field;
6
+ return candidate?.name !== THEME_FIELD_NAME;
7
+ });
8
+ const upsertThemeField = (fields, themeField, enableLogging)=>{
9
9
  const sanitized = removeExistingThemeField(fields ?? []);
10
10
  if (enableLogging) {
11
- console.log('🎨 Theme Configuration Plugin: injecting theme configuration field');
11
+ console.log('🎨 Theme Management Plugin: injecting theme configuration field');
12
12
  }
13
- return [...sanitized, themeField];
13
+ return [
14
+ ...sanitized,
15
+ themeField
16
+ ];
14
17
  };
15
- const ensureCollectionsArray = (collections) => Array.isArray(collections) ? collections : [];
16
- export const themeConfigurationPlugin = (options = {}) => {
17
- return (config) => {
18
- const { enabled = true, targetCollection = 'site-settings', themePresets = defaultThemePresets, defaultTheme = 'cool', includeColorModeToggle = true, includeCustomCSS = true, includeBrandIdentity = false, enableAdvancedFeatures = true, enableLogging = false, } = options;
18
+ const ensureCollectionsArray = (collections)=>Array.isArray(collections) ? collections : [];
19
+ export const themeManagementPlugin = (options = {})=>{
20
+ return (config)=>{
21
+ const { enabled = true, targetCollection = 'site-settings', themePresets = defaultThemePresets, defaultTheme = 'cool', includeColorModeToggle = true, includeCustomCSS = true, includeBrandIdentity = false, enableAdvancedFeatures = true, enableLogging = false } = options;
19
22
  if (!enabled) {
20
23
  if (enableLogging) {
21
- console.log('🎨 Theme Configuration Plugin: disabled via options, skipping.');
24
+ console.log('🎨 Theme Management Plugin: disabled via options, skipping.');
22
25
  }
23
26
  return config;
24
27
  }
@@ -28,53 +31,50 @@ export const themeConfigurationPlugin = (options = {}) => {
28
31
  includeColorModeToggle,
29
32
  includeCustomCSS,
30
33
  includeBrandIdentity: includeBrandIdentity ?? false,
31
- enableAdvancedFeatures,
34
+ enableAdvancedFeatures
32
35
  });
33
36
  let collectionTouched = false;
34
- const collections = ensureCollectionsArray(config.collections).map((collection) => {
37
+ const collections = ensureCollectionsArray(config.collections).map((collection)=>{
35
38
  if (collection.slug !== targetCollection) {
36
39
  return collection;
37
40
  }
38
41
  collectionTouched = true;
39
42
  if (enableLogging) {
40
- console.log(`🎨 Theme Configuration Plugin: enhancing collection "${collection.slug}"`);
43
+ console.log(`🎨 Theme Management Plugin: enhancing collection "${collection.slug}"`);
41
44
  }
42
45
  const existingFields = Array.isArray(collection.fields) ? collection.fields : [];
43
46
  const fields = upsertThemeField(existingFields, themeField, enableLogging);
44
47
  return {
45
48
  ...collection,
46
- fields,
49
+ fields
47
50
  };
48
51
  });
49
52
  if (!collectionTouched) {
50
53
  if (enableLogging) {
51
- console.warn(`🎨 Theme Configuration Plugin: collection "${targetCollection}" was not found, leaving config untouched.`);
54
+ console.warn(`🎨 Theme Management Plugin: collection "${targetCollection}" was not found, leaving config untouched.`);
52
55
  }
53
56
  return config;
54
57
  }
55
58
  return {
56
59
  ...config,
57
- collections,
60
+ collections
58
61
  };
59
62
  };
60
63
  };
61
- export const fetchThemeConfiguration = async (options) => {
62
- const normalizedOptions = typeof options === 'string'
63
- ? { tenantSlug: options }
64
- : options ?? {};
65
- const { tenantSlug, collectionSlug = 'site-settings', depth, locale, draft, queryParams = {}, } = normalizedOptions;
66
- const params = new URLSearchParams({ limit: '1' });
67
- if (typeof depth === 'number')
68
- params.set('depth', String(depth));
69
- if (tenantSlug)
70
- params.set('tenant', tenantSlug);
71
- if (locale)
72
- params.set('locale', locale);
73
- if (draft)
74
- params.set('draft', 'true');
75
- Object.entries(queryParams).forEach(([key, value]) => {
76
- if (value === undefined)
77
- return;
64
+ export const fetchThemeConfiguration = async (options)=>{
65
+ const normalizedOptions = typeof options === 'string' ? {
66
+ tenantSlug: options
67
+ } : options ?? {};
68
+ const { tenantSlug, collectionSlug = 'site-settings', depth, locale, draft, queryParams = {} } = normalizedOptions;
69
+ const params = new URLSearchParams({
70
+ limit: '1'
71
+ });
72
+ if (typeof depth === 'number') params.set('depth', String(depth));
73
+ if (tenantSlug) params.set('tenant', tenantSlug);
74
+ if (locale) params.set('locale', locale);
75
+ if (draft) params.set('draft', 'true');
76
+ Object.entries(queryParams).forEach(([key, value])=>{
77
+ if (value === undefined) return;
78
78
  params.set(key, String(value));
79
79
  });
80
80
  const url = `/api/${collectionSlug}?${params.toString()}`;
@@ -83,28 +83,28 @@ export const fetchThemeConfiguration = async (options) => {
83
83
  if (!response.ok) {
84
84
  throw new Error(`Failed to fetch theme configuration (status ${response.status})`);
85
85
  }
86
- const data = (await response.json());
86
+ const data = await response.json();
87
87
  const doc = data.docs?.[0];
88
88
  return doc?.themeConfiguration ?? null;
89
- }
90
- catch (error) {
89
+ } catch (error) {
91
90
  console.warn('Failed to fetch theme configuration:', error);
92
91
  return null;
93
92
  }
94
93
  };
95
- export const getThemePreset = (themeName) => {
96
- return defaultThemePresets.find((preset) => preset.name === themeName) || null;
94
+ export const getThemePreset = (themeName)=>{
95
+ return defaultThemePresets.find((preset)=>preset.name === themeName) || null;
97
96
  };
98
- export const getAvailableThemePresets = () => {
97
+ export const getAvailableThemePresets = ()=>{
99
98
  return defaultThemePresets;
100
99
  };
101
- export const ThemeConfigurationPlugin = themeConfigurationPlugin;
102
- export const themeManagementPlugin = themeConfigurationPlugin;
103
- export default themeConfigurationPlugin;
104
- export { defaultThemePresets } from './presets';
105
- export { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration, } from './utils/resolveThemeConfiguration';
106
- export { generateThemeColorsCss, hexToHsl } from './utils/themeColors';
107
- export { generateThemeCSS, getThemeStyles } from './utils/themeUtils';
108
- export { ServerThemeInjector } from './components/ServerThemeInjector';
109
- export { ThemeProvider } from './providers/Theme';
100
+ export { defaultThemePresets } from './presets.js';
101
+ export { DEFAULT_THEME_CONFIGURATION, resolveThemeConfiguration } from './utils/resolveThemeConfiguration.js';
102
+ export { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js';
103
+ export { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js';
104
+ export { ServerThemeInjector } from './components/ServerThemeInjector.js';
105
+ export { ThemeProvider } from './providers/Theme/index.js';
106
+ export const ThemeManagementPlugin = themeManagementPlugin;
107
+ /** @deprecated use {@link themeManagementPlugin} */ export const themeConfigurationPlugin = themeManagementPlugin;
108
+ export default themeManagementPlugin;
109
+
110
110
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAA;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAM/C,MAAM,gBAAgB,GAAG,oBAAoB,CAAA;AAE7C,MAAM,wBAAwB,GAAG,CAAC,SAAkB,EAAE,EAAW,EAAE,CACjE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;IACtB,MAAM,SAAS,GAAG,KAA2B,CAAA;IAC7C,OAAO,SAAS,EAAE,IAAI,KAAK,gBAAgB,CAAA;AAC7C,CAAC,CAAC,CAAA;AAEJ,MAAM,gBAAgB,GAAG,CACvB,MAA2B,EAC3B,UAAiB,EACjB,aAAsB,EACb,EAAE;IACX,MAAM,SAAS,GAAG,wBAAwB,CAAC,MAAM,IAAI,EAAE,CAAC,CAAA;IAExD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAA;IACnF,CAAC;IAED,OAAO,CAAC,GAAG,SAAS,EAAE,UAAU,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAA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AAM,wBAAwB,GAAG,GAAkB,EAAE;IAC1D,OAAO,mBAAmB,CAAA;AAC5B,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,wBAAwB,GAAG,wBAAwB,CAAA;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,wBAAwB,CAAA;AAE7D,eAAe,wBAAwB,CAAA;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAG/C,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AAGtE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { CollectionConfig, Config, Field, Plugin } from 'payload'\nimport { createThemeConfigurationField } from './fields/themeConfigurationField.js'\nimport type { SiteThemeConfiguration } from './payload-types.js'\nimport type { ThemePreset } from './presets.js'\nimport { defaultThemePresets } from './presets.js'\nimport type {\n FetchThemeConfigurationOptions,\n ThemeManagementPluginOptions,\n} from './types.js'\n\nconst THEME_FIELD_NAME = 'themeConfiguration'\n\nconst removeExistingThemeField = (fields: Field[] = []): Field[] =>\n fields.filter((field) => {\n const candidate = field as { name?: unknown }\n return candidate?.name !== THEME_FIELD_NAME\n })\n\nconst upsertThemeField = (\n fields: Field[] | undefined,\n themeField: Field,\n enableLogging: boolean,\n): Field[] => {\n const sanitized = removeExistingThemeField(fields ?? [])\n\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: injecting theme configuration field')\n }\n\n return [...sanitized, themeField]\n}\n\nconst ensureCollectionsArray = (collections: Config['collections']): CollectionConfig[] =>\n Array.isArray(collections) ? collections : []\n\nexport const themeManagementPlugin = (options: ThemeManagementPluginOptions = {}): Plugin => {\n return (config: Config): Config => {\n const {\n enabled = true,\n targetCollection = 'site-settings',\n themePresets = defaultThemePresets,\n defaultTheme = 'cool',\n includeColorModeToggle = true,\n includeCustomCSS = true,\n includeBrandIdentity = false,\n enableAdvancedFeatures = true,\n enableLogging = false,\n } = options\n\n if (!enabled) {\n if (enableLogging) {\n console.log('🎨 Theme Management Plugin: disabled via options, skipping.')\n }\n return config\n }\n\n const themeField = createThemeConfigurationField({\n themePresets,\n defaultTheme,\n includeColorModeToggle,\n includeCustomCSS,\n includeBrandIdentity: includeBrandIdentity ?? false,\n enableAdvancedFeatures,\n })\n\n let collectionTouched = false\n\n const collections = ensureCollectionsArray(config.collections).map((collection) => {\n if (collection.slug !== targetCollection) {\n return collection\n }\n\n collectionTouched = true\n\n if (enableLogging) {\n console.log(\n `🎨 Theme Management Plugin: enhancing collection \"${collection.slug}\"`,\n )\n }\n\n const existingFields = Array.isArray(collection.fields) ? collection.fields : []\n\n const fields = upsertThemeField(existingFields, themeField, enableLogging)\n\n return {\n ...collection,\n fields,\n }\n })\n\n if (!collectionTouched) {\n if (enableLogging) {\n console.warn(\n `🎨 Theme Management Plugin: collection \"${targetCollection}\" was not found, leaving config untouched.`,\n )\n }\n return config\n }\n\n return {\n ...config,\n collections,\n }\n }\n}\n\ntype FetchOptionsInput = string | FetchThemeConfigurationOptions\n\nexport const fetchThemeConfiguration = async (\n options?: FetchOptionsInput,\n): Promise<SiteThemeConfiguration | null> => {\n const normalizedOptions =\n typeof options === 'string'\n ? { tenantSlug: options }\n : options ?? {}\n\n const {\n tenantSlug,\n collectionSlug = 'site-settings',\n depth,\n locale,\n draft,\n queryParams = {},\n } = normalizedOptions\n\n const params = new URLSearchParams({ limit: '1' })\n\n if (typeof depth === 'number') params.set('depth', String(depth))\n if (tenantSlug) params.set('tenant', tenantSlug)\n if (locale) params.set('locale', locale)\n if (draft) params.set('draft', 'true')\n\n Object.entries(queryParams).forEach(([key, value]) => {\n if (value === undefined) return\n params.set(key, String(value))\n })\n\n const url = `/api/${collectionSlug}?${params.toString()}`\n\n try {\n const response = await fetch(url)\n if (!response.ok) {\n throw new Error(`Failed to fetch theme configuration (status ${response.status})`)\n }\n\n const data = (await response.json()) as {\n docs?: Array<{ themeConfiguration?: SiteThemeConfiguration }>\n }\n\n const doc = data.docs?.[0]\n\n return doc?.themeConfiguration ?? null\n } catch (error) {\n console.warn('Failed to fetch theme configuration:', error)\n return null\n }\n}\n\nexport const getThemePreset = (themeName: string): ThemePreset | null => {\n return defaultThemePresets.find((preset) => preset.name === themeName) || null\n}\n\nexport const getAvailableThemePresets = (): ThemePreset[] => {\n return defaultThemePresets\n}\n\n\n\nexport { defaultThemePresets } from './presets.js'\nexport type { ThemePreset, ThemeTypographyPreset } from './presets.js'\nexport type { ThemeManagementPluginOptions, FetchThemeConfigurationOptions } from './types.js'\nexport {\n DEFAULT_THEME_CONFIGURATION,\n resolveThemeConfiguration,\n} from './utils/resolveThemeConfiguration.js'\nexport { generateThemeColorsCss, hexToHsl } from './utils/themeColors.js'\nexport { generateThemeCSS, getThemeStyles } from './utils/themeUtils.js'\nexport { ServerThemeInjector } from './components/ServerThemeInjector.js'\n\nexport type { Mode, ThemeDefaults } from './providers/Theme/types.js'\nexport { ThemeProvider } from './providers/Theme/index.js'\n\nexport const ThemeManagementPlugin = themeManagementPlugin\n/** @deprecated use {@link themeManagementPlugin} */\nexport const themeConfigurationPlugin = themeManagementPlugin\n\nexport default themeManagementPlugin"],"names":["createThemeConfigurationField","defaultThemePresets","THEME_FIELD_NAME","removeExistingThemeField","fields","filter","field","candidate","name","upsertThemeField","themeField","enableLogging","sanitized","console","log","ensureCollectionsArray","collections","Array","isArray","themeManagementPlugin","options","config","enabled","targetCollection","themePresets","defaultTheme","includeColorModeToggle","includeCustomCSS","includeBrandIdentity","enableAdvancedFeatures","collectionTouched","map","collection","slug","existingFields","warn","fetchThemeConfiguration","normalizedOptions","tenantSlug","collectionSlug","depth","locale","draft","queryParams","params","URLSearchParams","limit","set","String","Object","entries","forEach","key","value","undefined","url","toString","response","fetch","ok","Error","status","data","json","doc","docs","themeConfiguration","error","getThemePreset","themeName","find","preset","getAvailableThemePresets","DEFAULT_THEME_CONFIGURATION","resolveThemeConfiguration","generateThemeColorsCss","hexToHsl","generateThemeCSS","getThemeStyles","ServerThemeInjector","ThemeProvider","ThemeManagementPlugin","themeConfigurationPlugin"],"mappings":"AACA,SAASA,6BAA6B,QAAQ,sCAAqC;AAGnF,SAASC,mBAAmB,QAAQ,eAAc;AAMlD,MAAMC,mBAAmB;AAEzB,MAAMC,2BAA2B,CAACC,SAAkB,EAAE,GACpDA,OAAOC,MAAM,CAAC,CAACC;QACb,MAAMC,YAAYD;QAClB,OAAOC,WAAWC,SAASN;IAC7B;AAEF,MAAMO,mBAAmB,CACvBL,QACAM,YACAC;IAEA,MAAMC,YAAYT,yBAAyBC,UAAU,EAAE;IAEvD,IAAIO,eAAe;QACnBE,QAAQC,GAAG,CAAC;IACZ;IAEA,OAAO;WAAIF;QAAWF;KAAW;AACnC;AAEA,MAAMK,yBAAyB,CAACC,cAC9BC,MAAMC,OAAO,CAACF,eAAeA,cAAc,EAAE;AAE/C,OAAO,MAAMG,wBAAwB,CAACC,UAAwC,CAAC,CAAC;IAC9E,OAAO,CAACC;QACN,MAAM,EACJC,UAAU,IAAI,EACdC,mBAAmB,eAAe,EAClCC,eAAevB,mBAAmB,EAClCwB,eAAe,MAAM,EACrBC,yBAAyB,IAAI,EAC7BC,mBAAmB,IAAI,EACvBC,uBAAuB,KAAK,EAC5BC,yBAAyB,IAAI,EAC7BlB,gBAAgB,KAAK,EACtB,GAAGS;QAEJ,IAAI,CAACE,SAAS;YACZ,IAAIX,eAAe;gBACvBE,QAAQC,GAAG,CAAC;YACR;YACA,OAAOO;QACT;QAEA,MAAMX,aAAaV,8BAA8B;YAC/CwB;YACAC;YACAC;YACAC;YACAC,sBAAsBA,wBAAwB;YAC9CC;QACF;QAEA,IAAIC,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AC/C,IAAIA,UAAUC,WAAW;QACzBV,OAAOG,GAAG,CAACK,KAAKJ,OAAOK;IACzB;IAEA,MAAME,MAAM,CAAC,KAAK,EAAEhB,eAAe,CAAC,EAAEK,OAAOY,QAAQ,IAAI;IAEzD,IAAI;QACF,MAAMC,WAAW,MAAMC,MAAMH;QAC7B,IAAI,CAACE,SAASE,EAAE,EAAE;YAChB,MAAM,IAAIC,MAAM,CAAC,4CAA4C,EAAEH,SAASI,MAAM,CAAC,CAAC,CAAC;QACnF;QAEA,MAAMC,OAAQ,MAAML,SAASM,IAAI;QAIjC,MAAMC,MAAMF,KAAKG,IAAI,EAAE,CAAC,EAAE;QAE1B,OAAOD,KAAKE,sBAAsB;IACpC,EAAE,OAAOC,OAAO;QACdtD,QAAQsB,IAAI,CAAC,wCAAwCgC;QACrD,OAAO;IACT;AACF,EAAC;AAED,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,OAAOpE,oBAAoBqE,IAAI,CAAC,CAACC,SAAWA,OAAO/D,IAAI,KAAK6D,cAAc;AAC5E,EAAC;AAED,OAAO,MAAMG,2BAA2B;IACtC,OAAOvE;AACT,EAAC;AAID,SAASA,mBAAmB,QAAQ,eAAc;AAGlD,SACEwE,2BAA2B,EAC3BC,yBAAyB,QACpB,uCAAsC;AAC7C,SAASC,sBAAsB,EAAEC,QAAQ,QAAQ,yBAAwB;AACzE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,wBAAuB;AACxE,SAASC,mBAAmB,QAAQ,sCAAqC;AAGzE,SAASC,aAAa,QAAQ,6BAA4B;AAE1D,OAAO,MAAMC,wBAAwB9D,sBAAqB;AAC1D,kDAAkD,GAClD,OAAO,MAAM+D,2BAA2B/D,sBAAqB;AAE7D,eAAeA,sBAAqB"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Payload types for theme configuration
3
3
  * These are placeholder types that will be extended in the consuming application
4
- */
5
- export {};
4
+ */ export { };
5
+
6
6
  //# sourceMappingURL=payload-types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload-types.js","sourceRoot":"","sources":["../src/payload-types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
1
+ {"version":3,"sources":["../src/payload-types.ts"],"sourcesContent":["/**\n * Payload types for theme configuration\n * These are placeholder types that will be extended in the consuming application\n */\n\nexport interface ThemeColorOverride {\n [token: string]: string | null | undefined;\n primary?: string | null;\n secondary?: string | null;\n accent?: string | null;\n background?: string | null;\n surface?: string | null;\n surfaceVariant?: string | null;\n text?: string | null;\n textSecondary?: string | null;\n border?: string | null;\n success?: string | null;\n warning?: string | null;\n error?: string | null;\n info?: string | null;\n foreground?: string | null;\n card?: string | null;\n cardForeground?: string | null;\n popover?: string | null;\n popoverForeground?: string | null;\n primaryForeground?: string | null;\n secondaryForeground?: string | null;\n muted?: string | null;\n mutedForeground?: string | null;\n accentForeground?: string | null;\n destructive?: string | null;\n destructiveForeground?: string | null;\n input?: string | null;\n ring?: string | null;\n}\n\nexport interface ThemeTypographyOverride {\n bodyFont?:\n | (\n | 'preset'\n | 'system'\n | 'geist-sans'\n | 'inter'\n | 'manrope'\n | 'urbanist'\n | 'outfit'\n | 'lora'\n | 'custom'\n )\n | null;\n headingFont?:\n | (\n | 'preset'\n | 'geist-sans'\n | 'geist-mono'\n | 'outfit'\n | 'playfair'\n | 'lora'\n | 'serif-classic'\n | 'custom'\n )\n | null;\n bodyFontCustom?: string | null;\n headingFontCustom?: string | null;\n baseFontSize?: ('preset' | '14px' | '16px' | '18px' | '20px') | null;\n lineHeight?: ('preset' | '1.4' | '1.5' | '1.6' | '1.75' | '1.9') | null;\n fontWeights?: Partial<\n Record<'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'black', string | null>\n > | null;\n letterSpacing?: Partial<Record<'tight' | 'normal' | 'wide' | 'wider', string | null>> | null;\n}\n\nexport interface ThemeCustomization {\n primaryColor?: string | null;\n accentColor?: string | null;\n backgroundColor?: string | null;\n textColor?: string | null;\n customCSS?: string | null;\n}\n\nexport interface SiteThemeConfiguration {\n theme?: string | null;\n preset?: string | null;\n colorMode?: 'auto' | 'light' | 'dark' | null;\n allowColorModeToggle?: boolean | null;\n lightMode?: ThemeColorOverride | null;\n darkMode?: ThemeColorOverride | null;\n colors?: ThemeColorOverride | null;\n typography?: ThemeTypographyOverride | null;\n borderRadius?: 'none' | 'small' | 'medium' | 'large' | 'xl' | null;\n fontScale?: 'small' | 'medium' | 'large' | 'xl' | null;\n spacing?: 'compact' | 'medium' | 'spacious' | null;\n animationLevel?: 'none' | 'reduced' | 'medium' | 'high' | null;\n customCSS?: string | null;\n customization?: ThemeCustomization | null;\n radius?: string | null;\n}\n\nexport interface SiteSetting {\n id: string;\n title?: string | null;\n slug?: string | null;\n themeConfiguration: SiteThemeConfiguration | null;\n updatedAt: string;\n createdAt: string;\n}\n\nexport interface Config {\n collections: {\n 'site-settings': SiteSetting;\n };\n globals: Record<string, unknown>;\n}\n"],"names":[],"mappings":"AAAA;;;CAGC,GAwGD,WAKC"}
package/dist/plugin.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- export { ThemeConfigurationPlugin, themeConfigurationPlugin, themeConfigurationPlugin as default, } from './index';
2
- export type { ThemeConfigurationPluginOptions } from './types';
1
+ export type { ThemeManagementPluginOptions } from './types.js';
3
2
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,IAAI,OAAO,GACpC,MAAM,SAAS,CAAA;AAEhB,YAAY,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC"}
package/dist/plugin.js CHANGED
@@ -1,2 +1,3 @@
1
- export { ThemeConfigurationPlugin, themeConfigurationPlugin, themeConfigurationPlugin as default, } from './index';
1
+ export { };
2
+
2
3
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,IAAI,OAAO,GACpC,MAAM,SAAS,CAAA"}
1
+ {"version":3,"sources":["../src/plugin.ts"],"sourcesContent":["export type { ThemeManagementPluginOptions } from './types.js';\n"],"names":[],"mappings":"AAAA,WAA+D"}