@se-studio/core-ui 0.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/CmsRendererConfig.ts","../src/components/CmsCollection.tsx","../src/components/CmsComponent.tsx","../src/components/CmsContent.tsx","../src/components/Visual.ts","../src/utils/UnsupportedWarning.tsx","../src/components/AnimationComponent.tsx","../src/components/PictureComponent.tsx","../src/components/SvgComponent.tsx","../src/components/SvgImageComponent.tsx","../src/components/ImageComponent.tsx","../src/components/VideoComponent.tsx","../src/components/VisualComponent.tsx","../src/utils/componentUtils.ts","../src/embeddable/BuildEmbed.tsx","../src/embeddable/EmbeddableMaps.ts","../src/rtf/rtf.tsx","../src/utils/UnusedChecker.tsx"],"names":["result","jsxs","jsx","Fragment","Image"],"mappings":";;;;;;;;AAyLO,SAAS,wBACd,MAAA,EAC4B;AAC5B,EAAA,OAAO,MAAA;AACT;AA2DO,SAAS,sBAAA,CACd,MACA,SAAA,EAC4B;AAC5B,EAAA,OAAO;AAAA,IACL,YAAA,EAAc,SAAA,CAAU,YAAA,IAAgB,IAAA,CAAK,YAAA;AAAA,IAC7C,aAAA,EAAe,SAAA,CAAU,aAAA,IAAiB,IAAA,CAAK,aAAA;AAAA,IAC/C,oBAAA,EAAsB,SAAA,CAAU,oBAAA,IAAwB,IAAA,CAAK,oBAAA;AAAA,IAC7D,uBAAA,EAAyB,SAAA,CAAU,uBAAA,IAA2B,IAAA,CAAK,uBAAA;AAAA,IACnE,oBAAA,EAAsB,SAAA,CAAU,oBAAA,IAAwB,IAAA,CAAK,oBAAA;AAAA,IAC7D,qBAAA,EAAuB,SAAA,CAAU,qBAAA,IAAyB,IAAA,CAAK,qBAAA;AAAA,IAC/D,gBAAA,EAAkB,SAAA,CAAU,gBAAA,IAAoB,IAAA,CAAK,gBAAA;AAAA,IACrD,wBAAA,EAA0B,SAAA,CAAU,wBAAA,IAA4B,IAAA,CAA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BACoB;AAAA;AAAA;AAAA,aACrB;AAAA,4BACAA,IAAAA,CAAC,GAAA,EAAA,EAAE,KAAA,EAAO,EAAE,QAAA,EAAU,QAAA,EAAU,KAAA,EAAO,OAAA,EAAS,MAAA,EAAQ,CAAA,EAAE,EAAG,QAAA,EAAA;AAAA,cAAA,iBAAA;AAAA,cAC3C,MAAA,CAAO,KAAK,IAAI;AAAA,aAAA,EAClC;AAAA;AAAA;AAAA,OACF;AAAA,MACC;AAAA,KAAA,EACH,CAAA;AAAA,EAEJ;AAEA,EAAA,uBAAOC,GAAAA,CAAAC,QAAAA,EAAA,EAAG,QAAA,EAAS,CAAA;AACrB","file":"index.js","sourcesContent":["import type { BaseCmsConfig, IContentContext } from '@se-studio/core-data-types';\nimport type { React } from 'next/dist/server/route-modules/app-page/vendored/rsc/entrypoints';\nimport type { PropsWithChildren } from 'react';\nimport type { CollectionMap } from './components/CmsCollection';\nimport type { ComponentMap } from './components/CmsComponent';\nimport type {\n ExternalComponentMap,\n InternalLinkRenderer,\n VisualComponentRenderer,\n} from './components/CmsContent';\n\n/**\n * Configuration object that bundles all CMS renderer maps and display options.\n * Create this once at the project level and pass it to CmsContent.\n *\n * This provides a clean, extensible API for configuring how CMS content is rendered,\n * making it easy to add new renderer types without breaking existing code.\n *\n * @example Basic configuration\n * ```tsx\n * const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: {\n * \"Hero\": HeroComponent,\n * \"CTA\": CTAComponent,\n * \"Content Block\": ContentBlock,\n * },\n * collectionMap: {\n * \"FAQs\": FAQCollection,\n * \"Related Articles\": RelatedArticles,\n * },\n * showUnknownTypeErrors: process.env.NODE_ENV === 'development',\n * });\n * ```\n *\n * @example With all renderer types\n * ```tsx\n * const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: { ... },\n * collectionMap: { ... },\n * externalComponentMap: {\n * \"Contact Form\": ContactFormRenderer,\n * \"Newsletter\": NewsletterRenderer,\n * },\n * visualComponentRenderer: VisualRenderer,\n * internalLinkRenderer: InternalLinkRenderer,\n * showUnknownTypeErrors: true,\n * showRenderErrors: true,\n * });\n * ```\n */\nexport interface CmsRendererConfig<TConfig extends BaseCmsConfig> {\n /**\n * Map of component types to their renderers.\n * Each key should match a ComponentType from your CMS configuration.\n *\n * @example\n * ```tsx\n * componentMap: {\n * \"Hero\": HeroComponent,\n * \"CTA\": CTAComponent,\n * }\n * ```\n */\n componentMap: ComponentMap<TConfig>;\n\n /**\n * Map of collection types to their renderers.\n * Each key should match a CollectionType from your CMS configuration.\n *\n * @example\n * ```tsx\n * collectionMap: {\n * \"FAQs\": FAQCollection,\n * \"Related Articles\": RelatedArticles,\n * }\n * ```\n */\n collectionMap: CollectionMap<TConfig>;\n\n /**\n * Map of external component types to their renderers (optional).\n * Use this for third-party integrations, forms, widgets, etc.\n *\n * @example\n * ```tsx\n * externalComponentMap: {\n * \"Contact Form\": ContactFormRenderer,\n * \"Newsletter\": NewsletterRenderer,\n * }\n * ```\n */\n externalComponentMap: ExternalComponentMap<TConfig>;\n\n /**\n * Renderer for Visual content types (optional).\n * Use this to define how images, videos, and other visual assets are rendered.\n *\n * @example\n * ```tsx\n * visualComponentRenderer: ({ information, contentContext }) => (\n * <VisualComponent visual={information} />\n * )\n * ```\n */\n visualComponentRenderer: VisualComponentRenderer<TConfig>;\n\n /**\n * Renderer for Internal Link content types (optional).\n * Use this to define how internal navigation links are rendered.\n *\n * @example\n * ```tsx\n * internalLinkRenderer: ({ information }) => (\n * <Link href={information.href}>{information.text}</Link>\n * )\n * ```\n */\n internalLinkRenderer: InternalLinkRenderer<TConfig>;\n\n /**\n * Show error panels for unknown content types in development mode (default: false).\n * When true, displays a visual warning when a component/collection type is not mapped.\n *\n * Recommended: Set to `process.env.NODE_ENV === 'development'`\n */\n showUnknownTypeErrors: boolean;\n\n /**\n * Show error panels for rendering errors (default: false).\n * When true, displays error details when a component throws during rendering.\n *\n * Recommended: Set to `process.env.NODE_ENV === 'development'`\n */\n showRenderErrors: boolean;\n\n defaultComponentRenderer: React.FC<{\n information: TConfig['Component'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>;\n defaultCollectionRenderer: React.FC<{\n information: TConfig['Collection'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>;\n basicLinkRenderer: React.FC<PropsWithChildren<{ href?: string }>>;\n embeddedContentRenderer: React.FC<{\n information: TConfig['PageContent'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>;\n}\n\n/**\n * Factory function to create a CMS renderer configuration with better type inference.\n * This is an identity function that helps TypeScript infer the correct types and\n * provides a consistent API for creating configurations.\n *\n * @param config - The renderer configuration object\n * @returns The same configuration object with proper typing\n *\n * @example Basic usage\n * ```tsx\n * export const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: {\n * \"Hero\": HeroComponent,\n * },\n * collectionMap: {\n * \"FAQs\": FAQCollection,\n * },\n * });\n * ```\n *\n * @example Environment-specific config\n * ```tsx\n * const isDevelopment = process.env.NODE_ENV === 'development';\n *\n * export const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: { ... },\n * collectionMap: { ... },\n * showUnknownTypeErrors: isDevelopment,\n * showRenderErrors: isDevelopment,\n * });\n * ```\n */\nexport function createCmsRendererConfig<TConfig extends BaseCmsConfig>(\n config: CmsRendererConfig<TConfig>,\n): CmsRendererConfig<TConfig> {\n return config;\n}\n\n/**\n * Partial configuration for extending or overriding a renderer config.\n * All fields are optional, making it useful for creating variants of a base configuration.\n */\nexport type PartialCmsRendererConfig<TConfig extends BaseCmsConfig> = {\n [K in keyof CmsRendererConfig<TConfig>]?: CmsRendererConfig<TConfig>[K];\n};\n\n/**\n * Merges a base renderer config with partial overrides to create a new configuration.\n * Useful for creating specialized configs from a common base (e.g., preview mode, embedded mode).\n *\n * Maps (componentMap, collectionMap, externalComponentMap) are shallow-merged,\n * so you can override individual renderer mappings while keeping others from the base.\n *\n * @param base - The base configuration to extend\n * @param overrides - Partial configuration with values to override\n * @returns A new merged configuration\n *\n * @example Create preview config with error display enabled\n * ```tsx\n * const baseConfig = createCmsRendererConfig({ ... });\n *\n * const previewConfig = mergeCmsRendererConfig(baseConfig, {\n * showUnknownTypeErrors: true,\n * showRenderErrors: true,\n * });\n * ```\n *\n * @example Create embedded config with different component map\n * ```tsx\n * const embeddedConfig = mergeCmsRendererConfig(baseConfig, {\n * componentMap: {\n * ...baseConfig.componentMap,\n * \"Hero\": EmbeddedHeroComponent, // Override specific component\n * },\n * });\n * ```\n *\n * @example Create environment-specific configs\n * ```tsx\n * const productionConfig = mergeCmsRendererConfig(baseConfig, {\n * showUnknownTypeErrors: false,\n * showRenderErrors: false,\n * });\n *\n * const developmentConfig = mergeCmsRendererConfig(baseConfig, {\n * showUnknownTypeErrors: true,\n * showRenderErrors: true,\n * });\n *\n * export const rendererConfig =\n * process.env.NODE_ENV === 'production'\n * ? productionConfig\n * : developmentConfig;\n * ```\n */\nexport function mergeCmsRendererConfig<TConfig extends BaseCmsConfig>(\n base: CmsRendererConfig<TConfig>,\n overrides: PartialCmsRendererConfig<TConfig>,\n): CmsRendererConfig<TConfig> {\n return {\n componentMap: overrides.componentMap ?? base.componentMap,\n collectionMap: overrides.collectionMap ?? base.collectionMap,\n externalComponentMap: overrides.externalComponentMap ?? base.externalComponentMap,\n visualComponentRenderer: overrides.visualComponentRenderer ?? base.visualComponentRenderer,\n internalLinkRenderer: overrides.internalLinkRenderer ?? base.internalLinkRenderer,\n showUnknownTypeErrors: overrides.showUnknownTypeErrors ?? base.showUnknownTypeErrors,\n showRenderErrors: overrides.showRenderErrors ?? base.showRenderErrors,\n defaultComponentRenderer: overrides.defaultComponentRenderer ?? base.defaultComponentRenderer,\n defaultCollectionRenderer:\n overrides.defaultCollectionRenderer ?? base.defaultCollectionRenderer,\n basicLinkRenderer: overrides.basicLinkRenderer ?? base.basicLinkRenderer,\n embeddedContentRenderer: overrides.embeddedContentRenderer ?? base.embeddedContentRenderer,\n };\n}\n","import type { BaseCmsConfig, IContentContext } from '@se-studio/core-data-types';\nimport type React from 'react';\nimport type { CmsRendererConfig } from '../CmsRendererConfig';\n\n/**\n * Collection type mapper for rendering collections.\n * Maps collection type strings to React components that can render them.\n *\n * Projects should provide their own CollectionMap when calling CmsCollection.\n */\nexport type CollectionMap<TConfig extends BaseCmsConfig> = Record<\n TConfig['CollectionType'],\n React.FC<{\n information: TConfig['Collection'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>\n>;\n\n/**\n * Error component displayed in development/preview mode when an unknown collection type is encountered\n */\nconst CollectionTypeError = <TConfig extends BaseCmsConfig>({\n information,\n availableTypes,\n showInProduction = false,\n}: {\n information: TConfig['Collection'];\n availableTypes: string[];\n showInProduction?: boolean;\n}) => {\n if (!showInProduction && typeof process !== 'undefined' && process.env?.NODE_ENV === 'production')\n return null;\n\n return (\n <div\n style={{\n border: '2px solid orange',\n background: '#fff3cd',\n padding: '1rem',\n margin: '1rem',\n borderRadius: '4px',\n }}\n >\n <h3 style={{ color: '#856404', marginBottom: '0.5rem' }}>Unknown Collection Type</h3>\n <div style={{ fontSize: '0.875rem' }}>\n <p>\n <strong>Collection Type:</strong> {String(information.collectionType)}\n </p>\n <p>\n <strong>Collection ID:</strong> {information.id}\n </p>\n <p>\n <strong>Available Types:</strong> {availableTypes.join(', ')}\n </p>\n <p style={{ color: '#856404', marginTop: '0.5rem' }}>\n This collection type is not registered in CollectionMap. Using Generic fallback.\n </p>\n </div>\n </div>\n );\n};\n\n/**\n * Main collection router that maps collection types to their renderers.\n *\n * Usage:\n * ```tsx\n * const collectionMap: CollectionMap<MyConfig> = {\n * \"FAQs\": FAQCollection,\n * \"Related articles\": RelatedArticlesCollection,\n * };\n *\n * <CmsCollection\n * information={collectionData}\n * contentContext={context}\n * collectionMap={collectionMap}\n * />\n * ```\n */\nexport function CmsCollection<TConfig extends BaseCmsConfig>({\n information,\n contentContext,\n rendererConfig,\n}: {\n information: TConfig['Collection'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n}) {\n const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n const isDebugTiming = typeof process !== 'undefined' && process.env?.DEBUG_TIMING === 'true';\n const shouldTrack = isDevelopment || isDebugTiming;\n\n const startTime = shouldTrack ? performance.now() : 0;\n const startMemory =\n shouldTrack && typeof process !== 'undefined' && process.memoryUsage\n ? process.memoryUsage()\n : null;\n\n const {\n collectionMap,\n showUnknownTypeErrors,\n defaultCollectionRenderer: DefaultRenderer,\n } = rendererConfig;\n\n const Element = collectionMap[information.collectionType as TConfig['CollectionType']] as\n | React.FC<{\n information: TConfig['Collection'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>\n | undefined;\n\n if (Element) {\n const result = (\n <Element\n information={information}\n contentContext={contentContext}\n rendererConfig={rendererConfig}\n />\n );\n\n if (shouldTrack && startMemory) {\n const totalDuration = performance.now() - startTime;\n if (totalDuration > 10) {\n const endMemory = process.memoryUsage();\n const heapDelta = (endMemory.heapUsed - startMemory.heapUsed) / 1024 / 1024;\n const rssDelta = (endMemory.rss - startMemory.rss) / 1024 / 1024;\n\n let output = `[CmsCollection] ${String(information.collectionType)}: ${totalDuration.toFixed(2)}ms`;\n\n if (Math.abs(heapDelta) > 0.01 || Math.abs(rssDelta) > 0.01) {\n output += ` [heap: ${heapDelta >= 0 ? '+' : ''}${heapDelta.toFixed(2)}MB`;\n output += `, rss: ${rssDelta >= 0 ? '+' : ''}${rssDelta.toFixed(2)}MB]`;\n }\n\n console.log(output);\n }\n } else if (shouldTrack) {\n const totalDuration = performance.now() - startTime;\n if (totalDuration > 10) {\n console.log(\n `[CmsCollection] ${String(information.collectionType)}: ${totalDuration.toFixed(2)}ms`,\n );\n }\n }\n\n return result;\n }\n\n // Log unknown collection type for monitoring\n console.log(\n `Unknown collection type: ${String(information.collectionType)} (ID: ${information.id}). Available types:`,\n Object.keys(collectionMap).join(','),\n );\n\n // Show warning in development/preview mode, use Generic fallback\n const shouldShowError =\n showUnknownTypeErrors ||\n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development');\n\n const result = (\n <>\n {shouldShowError && (\n <CollectionTypeError\n information={information}\n availableTypes={Object.keys(collectionMap)}\n showInProduction={showUnknownTypeErrors}\n />\n )}\n {DefaultRenderer && (\n <DefaultRenderer\n information={information}\n contentContext={contentContext}\n rendererConfig={rendererConfig}\n />\n )}\n </>\n );\n\n if (shouldTrack && startMemory) {\n const totalDuration = performance.now() - startTime;\n const endMemory = process.memoryUsage();\n const heapDelta = (endMemory.heapUsed - startMemory.heapUsed) / 1024 / 1024;\n const rssDelta = (endMemory.rss - startMemory.rss) / 1024 / 1024;\n\n let output = `[CmsCollection] ${String(information.collectionType)} (unknown): ${totalDuration.toFixed(2)}ms`;\n\n if (Math.abs(heapDelta) > 0.01 || Math.abs(rssDelta) > 0.01) {\n output += ` [heap: ${heapDelta >= 0 ? '+' : ''}${heapDelta.toFixed(2)}MB`;\n output += `, rss: ${rssDelta >= 0 ? '+' : ''}${rssDelta.toFixed(2)}MB]`;\n }\n\n console.log(output);\n } else if (shouldTrack) {\n const totalDuration = performance.now() - startTime;\n console.log(\n `[CmsCollection] ${String(information.collectionType)} (unknown): ${totalDuration.toFixed(2)}ms`,\n );\n }\n\n return result;\n}\n","import type { BaseCmsConfig, IContentContext } from '@se-studio/core-data-types';\nimport type React from 'react';\nimport type { CmsRendererConfig } from '../CmsRendererConfig';\n\n/**\n * Component type mapper for rendering components.\n * Maps component type strings to React components that can render them.\n *\n * Projects should provide their own ComponentMap when calling CmsComponent.\n */\nexport type ComponentMap<TConfig extends BaseCmsConfig> = Record<\n TConfig['ComponentType'],\n React.FC<{\n information: TConfig['Component'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>\n>;\n\n/**\n * Error component displayed in development/preview mode when an unknown component type is encountered\n */\nconst ComponentTypeError = <TConfig extends BaseCmsConfig>({\n information,\n availableTypes,\n showInProduction = false,\n}: {\n information: TConfig['Component'];\n availableTypes: string[];\n showInProduction?: boolean;\n}) => {\n if (!showInProduction && typeof process !== 'undefined' && process.env?.NODE_ENV === 'production')\n return null;\n\n return (\n <div\n style={{\n border: '2px solid orange',\n background: '#fff3cd',\n padding: '1rem',\n margin: '1rem',\n borderRadius: '4px',\n }}\n >\n <h3 style={{ color: '#856404', marginBottom: '0.5rem' }}>Unknown Component Type</h3>\n <div style={{ fontSize: '0.875rem' }}>\n <p>\n <strong>Component Type:</strong> {String(information.componentType)}\n </p>\n <p>\n <strong>Component ID:</strong> {information.id}\n </p>\n <p>\n <strong>Available Types:</strong> {availableTypes.join(', ')}\n </p>\n <p style={{ color: '#856404', marginTop: '0.5rem' }}>\n This component type is not registered in ComponentMap. Using Generic fallback.\n </p>\n </div>\n </div>\n );\n};\n\n/**\n * Main component router that maps component types to their renderers.\n *\n * Usage:\n * ```tsx\n * const componentMap: ComponentMap<MyConfig> = {\n * \"Hero\": HeroComponent,\n * \"CTA\": CTAComponent,\n * };\n *\n * <CmsComponent\n * information={componentData}\n * contentContext={context}\n * componentMap={componentMap}\n * />\n * ```\n */\nexport function CmsComponent<TConfig extends BaseCmsConfig>({\n information,\n contentContext,\n rendererConfig,\n}: {\n information: TConfig['Component'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n}) {\n const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n const isDebugTiming = typeof process !== 'undefined' && process.env?.DEBUG_TIMING === 'true';\n const shouldTrack = isDevelopment || isDebugTiming;\n\n const startTime = shouldTrack ? performance.now() : 0;\n const startMemory =\n shouldTrack && typeof process !== 'undefined' && process.memoryUsage\n ? process.memoryUsage()\n : null;\n\n const {\n componentMap,\n showUnknownTypeErrors,\n defaultComponentRenderer: DefaultRenderer,\n } = rendererConfig;\n\n const Element = componentMap[information.componentType as TConfig['ComponentType']] as\n | React.FC<{\n information: TConfig['Component'];\n contentContext: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n }>\n | undefined;\n\n if (Element) {\n const result = (\n <Element\n information={information}\n contentContext={contentContext}\n rendererConfig={rendererConfig}\n />\n );\n\n if (shouldTrack && startMemory) {\n const totalDuration = performance.now() - startTime;\n if (totalDuration > 10) {\n const endMemory = process.memoryUsage();\n const heapDelta = (endMemory.heapUsed - startMemory.heapUsed) / 1024 / 1024;\n const rssDelta = (endMemory.rss - startMemory.rss) / 1024 / 1024;\n\n let output = `[CmsComponent] ${String(information.componentType)}: ${totalDuration.toFixed(2)}ms`;\n\n if (Math.abs(heapDelta) > 0.01 || Math.abs(rssDelta) > 0.01) {\n output += ` [heap: ${heapDelta >= 0 ? '+' : ''}${heapDelta.toFixed(2)}MB`;\n output += `, rss: ${rssDelta >= 0 ? '+' : ''}${rssDelta.toFixed(2)}MB]`;\n }\n\n console.log(output);\n }\n } else if (shouldTrack) {\n const totalDuration = performance.now() - startTime;\n if (totalDuration > 10) {\n console.log(\n `[CmsComponent] ${String(information.componentType)}: ${totalDuration.toFixed(2)}ms`,\n );\n }\n }\n\n return result;\n }\n\n // Log unknown component type for monitoring\n console.log(\n `Unknown component type: ${String(information.componentType)} (ID: ${information.id}). Available types:`,\n Object.keys(componentMap).join(','),\n );\n\n // Show warning in development/preview mode, use Generic fallback\n const shouldShowError =\n showUnknownTypeErrors ||\n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development');\n\n const result = (\n <>\n {shouldShowError && (\n <ComponentTypeError\n information={information}\n availableTypes={Object.keys(componentMap)}\n showInProduction={showUnknownTypeErrors}\n />\n )}\n {DefaultRenderer && (\n <DefaultRenderer\n information={information}\n contentContext={contentContext}\n rendererConfig={rendererConfig}\n />\n )}\n </>\n );\n\n if (shouldTrack && startMemory) {\n const totalDuration = performance.now() - startTime;\n const endMemory = process.memoryUsage();\n const heapDelta = (endMemory.heapUsed - startMemory.heapUsed) / 1024 / 1024;\n const rssDelta = (endMemory.rss - startMemory.rss) / 1024 / 1024;\n\n let output = `[CmsComponent] ${String(information.componentType)} (unknown): ${totalDuration.toFixed(2)}ms`;\n\n if (Math.abs(heapDelta) > 0.01 || Math.abs(rssDelta) > 0.01) {\n output += ` [heap: ${heapDelta >= 0 ? '+' : ''}${heapDelta.toFixed(2)}MB`;\n output += `, rss: ${rssDelta >= 0 ? '+' : ''}${rssDelta.toFixed(2)}MB]`;\n }\n\n console.log(output);\n } else if (shouldTrack) {\n const totalDuration = performance.now() - startTime;\n console.log(\n `[CmsComponent] ${String(information.componentType)} (unknown): ${totalDuration.toFixed(2)}ms`,\n );\n }\n\n return result;\n}\n","import type {\n BaseCmsConfig,\n IContentContext,\n IPageContext,\n IVisual,\n PageContent,\n} from '@se-studio/core-data-types';\nimport type React from 'react';\nimport { Suspense } from 'react';\nimport type { CmsRendererConfig } from '../CmsRendererConfig';\nimport { CmsCollection } from './CmsCollection';\nimport { CmsComponent } from './CmsComponent';\n\n/**\n * Creates a content context for a specific component with lazy evaluation\n */\nfunction createContentContext<CmsConfig extends BaseCmsConfig>(\n pageContext: IPageContext<CmsConfig>,\n components: ReadonlyArray<PageContent<CmsConfig>>,\n currentIndex: number,\n): IContentContext<CmsConfig> {\n const current = components[currentIndex];\n if (!current) {\n throw new Error(`Invalid component index: ${currentIndex}`);\n }\n const previousContent = currentIndex === 0 ? undefined : components[currentIndex - 1];\n const nextContent =\n currentIndex === components.length - 1 ? undefined : components[currentIndex + 1];\n\n return { pageContext, previousContent, current, nextContent };\n}\n\n/**\n * External component renderer type\n */\nexport type ExternalComponentRenderer<TConfig extends BaseCmsConfig> = React.FC<{\n information: TConfig['ExternalComponent'];\n contentContext: IContentContext<TConfig>;\n}>;\n\n/**\n * Map of external component types to their renderers\n */\nexport type ExternalComponentMap<TConfig extends BaseCmsConfig> = Partial<\n Record<TConfig['ExternalComponentType'], ExternalComponentRenderer<TConfig>>\n>;\n\n/**\n * Visual component renderer type\n */\nexport type VisualComponentRenderer<TConfig extends BaseCmsConfig> = React.FC<{\n information: IVisual;\n contentContext: IContentContext<TConfig>;\n}>;\n\n/**\n * Internal link renderer type\n */\nexport type InternalLinkRenderer<TConfig extends BaseCmsConfig> = React.FC<{\n information: Extract<PageContent<TConfig>, { type: 'Internal link' }>;\n contentContext: IContentContext<TConfig>;\n}>;\n\n/**\n * Error display component for rendering errors in development mode\n */\nconst ContentError = ({\n error,\n content,\n showInProduction = false,\n}: {\n error: Error;\n content: { type: string; id: string };\n showInProduction?: boolean;\n}) => {\n if (!showInProduction && typeof process !== 'undefined' && process.env?.NODE_ENV === 'production')\n return null;\n\n return (\n <div\n style={{\n margin: '1rem',\n borderRadius: '4px',\n border: '2px solid red',\n background: '#fee',\n padding: '1rem',\n }}\n >\n <h3 style={{ marginBottom: '0.5rem', fontSize: '1.125rem', color: 'red' }}>\n Content Render Error\n </h3>\n <div style={{ fontSize: '0.875rem' }}>\n <p>\n <strong>Content Type:</strong> {content.type}\n </p>\n <p>\n <strong>Content ID:</strong> {content.id}\n </p>\n <div style={{ marginTop: '0.75rem' }}>\n <p style={{ color: 'red', fontWeight: '600' }}>Error:</p>\n <pre\n style={{\n overflowX: 'auto',\n borderRadius: '4px',\n border: '1px solid #fcc',\n background: 'white',\n padding: '0.5rem',\n fontSize: '0.75rem',\n }}\n >\n {error.message}\n </pre>\n </div>\n </div>\n </div>\n );\n};\n\n/**\n * Loading fallback for suspended content\n */\nconst ContentLoadingFallback = ({ content }: { content: { type: string; id: string } }) => {\n const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n\n if (!isDevelopment) {\n return null; // Don't show loading states in production\n }\n\n return (\n <div\n style={{\n margin: '1rem',\n borderRadius: '4px',\n border: '2px solid #ccc',\n background: '#f9f9f9',\n padding: '1rem',\n minHeight: '2rem',\n display: 'flex',\n alignItems: 'center',\n }}\n >\n <span style={{ color: '#666', fontSize: '0.875rem' }}>\n Loading {content.type} ({content.id})...\n </span>\n </div>\n );\n};\n\n/**\n * Single content item renderer that routes to the appropriate renderer based on type\n */\nconst SingleContent = <TConfig extends BaseCmsConfig>({\n context,\n rendererConfig,\n}: {\n context: IContentContext<TConfig>;\n rendererConfig: CmsRendererConfig<TConfig>;\n}) => {\n const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n const startTime = isDevelopment ? performance.now() : 0;\n\n try {\n const { current } = context;\n\n let result: React.ReactNode;\n switch (current.type) {\n case 'Component':\n result = (\n <CmsComponent\n information={current as TConfig['Component']}\n contentContext={context}\n rendererConfig={rendererConfig}\n />\n );\n break;\n\n case 'Collection':\n result = (\n <CmsCollection\n information={current as TConfig['Collection']}\n contentContext={context}\n rendererConfig={rendererConfig}\n />\n );\n break;\n\n case 'External component': {\n const externalComp = current as TConfig['ExternalComponent'];\n const ExternalRenderer = rendererConfig.externalComponentMap?.[\n externalComp.externalType as TConfig['ExternalComponentType']\n ] as\n | React.FC<{\n information: TConfig['ExternalComponent'];\n contentContext: IContentContext<TConfig>;\n }>\n | undefined;\n\n if (ExternalRenderer) {\n result = <ExternalRenderer information={externalComp} contentContext={context} />;\n } else {\n console.warn(\n `No renderer found for external component type: ${String(externalComp.externalType)}`,\n );\n result = rendererConfig.showUnknownTypeErrors ? (\n <div>External component renderer not implemented</div>\n ) : null;\n }\n break;\n }\n\n case 'Visual':\n if (rendererConfig.visualComponentRenderer) {\n result = rendererConfig.visualComponentRenderer({\n information: current as Extract<PageContent<TConfig>, { type: 'Visual' }>,\n contentContext: context,\n }) as React.ReactNode;\n } else {\n console.warn('No Visual renderer provided');\n result = rendererConfig.showUnknownTypeErrors ? (\n <div>Visual renderer not implemented</div>\n ) : null;\n }\n break;\n\n case 'Internal link':\n if (rendererConfig.internalLinkRenderer) {\n result = rendererConfig.internalLinkRenderer({\n information: current as Extract<PageContent<TConfig>, { type: 'Internal link' }>,\n contentContext: context,\n }) as React.ReactNode;\n } else {\n console.warn('No Internal link renderer provided');\n result = rendererConfig.showUnknownTypeErrors ? (\n <div>Internal link renderer not implemented</div>\n ) : null;\n }\n break;\n\n default: {\n const unknownContent = current as { type: string; id: string };\n const error = new Error(\n `Unknown content type: ${unknownContent.type} (ID: ${unknownContent.id})`,\n );\n console.error(error);\n\n if (\n rendererConfig.showRenderErrors ||\n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development')\n ) {\n result = (\n <ContentError\n error={error}\n content={unknownContent}\n showInProduction={rendererConfig.showRenderErrors}\n />\n );\n } else {\n result = null;\n }\n break;\n }\n }\n\n if (isDevelopment) {\n const duration = performance.now() - startTime;\n if (duration > 10) {\n // Only log if > 10ms\n const contentType =\n current.type === 'Component'\n ? current.componentType\n : current.type === 'Collection'\n ? current.collectionType\n : current.type;\n console.log(`[SingleContent] ${contentType} (${current.id}): ${duration.toFixed(2)}ms`);\n }\n }\n\n return result;\n } catch (error) {\n console.error('Error rendering content:', error);\n\n if (\n rendererConfig.showRenderErrors ||\n (typeof process !== 'undefined' && process.env?.NODE_ENV === 'development')\n ) {\n return (\n <ContentError\n error={error as Error}\n content={context.current}\n showInProduction={rendererConfig.showRenderErrors}\n />\n );\n }\n\n return null;\n }\n};\n\n/**\n * Main content renderer that renders an array of page content items.\n *\n * @example Basic usage\n * ```tsx\n * import { createCmsRendererConfig } from \"@se-studio/core-ui\";\n *\n * const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: {\n * \"Hero\": HeroComponent,\n * \"CTA\": CTAComponent,\n * },\n * collectionMap: {\n * \"FAQs\": FAQCollection,\n * },\n * showUnknownTypeErrors: process.env.NODE_ENV === 'development',\n * });\n *\n * <CmsContent\n * rendererConfig={rendererConfig}\n * pageContext={pageContext}\n * contents={page.contents}\n * />\n * ```\n *\n * @example With all renderer types\n * ```tsx\n * const rendererConfig = createCmsRendererConfig<MyProjectConfig>({\n * componentMap: { ... },\n * collectionMap: { ... },\n * externalComponentMap: { ... },\n * visualComponentRenderer: VisualRenderer,\n * internalLinkRenderer: InternalLinkRenderer,\n * });\n *\n * <CmsContent\n * rendererConfig={rendererConfig}\n * pageContext={pageContext}\n * contents={page.contents}\n * />\n * ```\n */\nexport function CmsContent<TConfig extends BaseCmsConfig>({\n pageContext,\n contents,\n rendererConfig,\n}: {\n pageContext: IPageContext<TConfig>;\n contents?: ReadonlyArray<PageContent<TConfig>>;\n rendererConfig: CmsRendererConfig<TConfig>;\n}) {\n const isDevelopment = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n const isDebugTiming = typeof process !== 'undefined' && process.env?.DEBUG_TIMING === 'true';\n const shouldTrack = isDevelopment || isDebugTiming;\n\n const startTime = shouldTrack ? performance.now() : 0;\n const startMemory =\n shouldTrack && typeof process !== 'undefined' && process.memoryUsage\n ? process.memoryUsage()\n : null;\n\n if (!contents || contents.length === 0) {\n return null;\n }\n\n if (shouldTrack) {\n console.log(`[CmsContent] Rendering ${contents.length} content items`);\n }\n\n const result = (\n <>\n {contents.map((content, index) => {\n const context = createContentContext(pageContext, contents, index);\n return (\n <Suspense\n key={`${content.id}-${index}`}\n fallback={<ContentLoadingFallback content={content} />}\n >\n <SingleContent context={context} rendererConfig={rendererConfig} />\n </Suspense>\n );\n })}\n </>\n );\n\n if (shouldTrack && startMemory) {\n const duration = performance.now() - startTime;\n const endMemory = process.memoryUsage();\n const heapDelta = (endMemory.heapUsed - startMemory.heapUsed) / 1024 / 1024;\n const rssDelta = (endMemory.rss - startMemory.rss) / 1024 / 1024;\n\n let output = `[CmsContent] Rendered ${contents.length} items in ${duration.toFixed(2)}ms`;\n\n if (Math.abs(heapDelta) > 0.01 || Math.abs(rssDelta) > 0.01) {\n output += ` [heap: ${heapDelta >= 0 ? '+' : ''}${heapDelta.toFixed(2)}MB`;\n output += `, rss: ${rssDelta >= 0 ? '+' : ''}${rssDelta.toFixed(2)}MB]`;\n }\n\n console.log(output);\n } else if (shouldTrack) {\n const duration = performance.now() - startTime;\n console.log(`[CmsContent] Rendered ${contents.length} items in ${duration.toFixed(2)}ms`);\n }\n\n return result;\n}\n","import type {\n Horizontal,\n IAnalyticsContext,\n IVisual,\n IVisualCommon,\n IVisualSizes,\n Vertical,\n} from '@se-studio/core-data-types';\nimport type { PlaceholderValue } from 'next/dist/shared/lib/get-img-props';\nimport type { CSSProperties } from 'react';\n\nexport type IVisualProps = {\n className?: string;\n style?: Omit<CSSProperties, 'objectFit' | 'objectPosition'>;\n autoPlay?: boolean;\n loop?: boolean;\n loopDelay?: number;\n muted?: boolean;\n controls?: boolean;\n loading?: 'eager' | 'lazy' | undefined;\n priority?: boolean;\n fetchPriority?: 'high' | 'low' | undefined;\n visualSizes?: IVisualSizes;\n fullPlayer?: boolean;\n analyticsContext?: IAnalyticsContext;\n componentLabel?: string | null;\n};\n\nexport type IImageProps = IVisualProps & {\n placeholder?: PlaceholderValue;\n priority?: boolean;\n};\n\nfunction calculateVertical(position?: Vertical | null): 'bottom' | 'center' | 'top' {\n switch (position) {\n case 'Bottom':\n return 'bottom';\n case 'Top':\n return 'top';\n default:\n return 'center';\n }\n}\n\nfunction calculateHorizontal(position?: Horizontal | null): 'left' | 'right' | 'center' {\n switch (position) {\n case 'Left':\n return 'left';\n case 'Right':\n return 'right';\n default:\n return 'center';\n }\n}\n\nexport function calculateCropDetails(\n details: Omit<IVisualCommon, 'id' | 'type' | 'name' | 'nameAsCaption'>,\n): Pick<CSSProperties, 'objectFit' | 'objectPosition'> {\n const { verticalCropPosition, horizontalCropPosition, dontCrop } = details;\n\n if (dontCrop) {\n return { objectFit: 'contain' };\n }\n\n return {\n objectFit: 'cover',\n objectPosition: `${calculateHorizontal(\n horizontalCropPosition,\n )} ${calculateVertical(verticalCropPosition)}`,\n };\n}\n\nexport function calculateImagePriority(\n index: number,\n): { priority: boolean; fetchPriority: 'high' | 'low' | undefined } | undefined {\n if (index === 0) {\n return { priority: true, fetchPriority: 'high' };\n }\n return undefined;\n}\n\nfunction calculateRealWidthPercent(visual?: IVisual, baseWidth?: number | null) {\n const widthPercent =\n visual?.image?.widthPercent ?? visual?.animation?.widthPercent ?? visual?.video?.widthPercent;\n\n if (!widthPercent) {\n if (baseWidth) {\n return baseWidth;\n }\n return undefined;\n }\n if (baseWidth) {\n return (widthPercent / 100) * (baseWidth / 100) * 100;\n }\n return widthPercent;\n}\n\nexport function calculateImageWidthStyleVariable(\n visual?: IVisual,\n baseWidth?: number | null,\n): CSSProperties | undefined {\n const widthPercent = calculateRealWidthPercent(visual, baseWidth);\n if (widthPercent === undefined) {\n return undefined;\n }\n\n return { '--image-width': `${widthPercent}%` } as CSSProperties;\n}\n","import type { CSSProperties, PropsWithChildren } from 'react';\n\n/**\n * Development utility component that displays a warning message for unsupported features or configurations.\n *\n * This helps identify areas where content or features are not yet supported,\n * making it easier to spot missing functionality during development.\n *\n * Only shows warnings in development mode (NODE_ENV !== 'production').\n *\n * @example\n * ```tsx\n * const MyComponent = ({ data }) => {\n * if (data.type === 'unsupported') {\n * return (\n * <UnsupportedWarning className=\"my-warning\">\n * This content type is not yet supported\n * </UnsupportedWarning>\n * );\n * }\n *\n * return <div>{data.content}</div>;\n * };\n * ```\n */\nexport const UnsupportedWarning: React.FC<\n PropsWithChildren<{\n className?: string;\n style?: CSSProperties;\n showWarnings?: boolean;\n }>\n> = ({ children, className, style, showWarnings = true }) => {\n // Only show in development mode\n if ((typeof process !== 'undefined' && process.env?.NODE_ENV === 'production') || !showWarnings) {\n return null;\n }\n\n const defaultStyle: CSSProperties = {\n backgroundColor: '#fff3cd',\n border: '2px solid #ff6b6b',\n borderRadius: '4px',\n padding: '0.75rem 1rem',\n margin: '0.5rem 0',\n color: '#721c24',\n fontWeight: 'bold',\n fontSize: '0.9rem',\n display: 'inline-block',\n };\n\n const mergedStyle = { ...defaultStyle, ...style };\n\n return (\n <div className={className} style={mergedStyle}>\n {children}\n </div>\n );\n};\n","import type { IAnimation } from '@se-studio/core-data-types';\nimport type { IVisualProps } from './Visual';\n\ninterface IAnimationProps extends IVisualProps {\n direction?: number;\n controls?: boolean;\n count?: number;\n hover?: boolean;\n}\n\nfunction Animation({\n className,\n style,\n}: {\n animation: IAnimation;\n} & Omit<IAnimationProps, 'analyticsContext' | 'componentLabel'>) {\n return (\n <div className={className} style={style}>\n Animation Component\n </div>\n );\n}\n\nexport default Animation;\n","import { type IPicture, type IVisualSizes, processSizes } from '@se-studio/core-data-types';\nimport Image from 'next/image';\nimport { calculateCropDetails, type IImageProps } from './Visual';\n\nfunction calculateSizes(visualSizes?: IVisualSizes) {\n if (!visualSizes) {\n return '100vw';\n }\n\n const result =\n processSizes(visualSizes)\n ?.breakpoints?.sort((a, b) => a.maxWidth - b.maxWidth)\n .map(({ maxWidth, size }) => `(max-width: ${maxWidth}px) ${size}`) ?? [];\n if (visualSizes.defaultSize) {\n result.push(visualSizes.defaultSize);\n } else if (visualSizes.defaultPixels) {\n result.push(`${visualSizes.defaultPixels}px`);\n } else {\n result.push('100vw');\n }\n\n return result.join(',');\n}\n\nfunction PictureComponent({\n image,\n style,\n visualSizes,\n ...props\n}: { image: IPicture } & Omit<IImageProps, 'analytics' | 'componentLabel'>) {\n const cropProperties = calculateCropDetails(image);\n return (\n <Image\n src={image.src}\n width={image.width}\n height={image.height}\n style={{ ...style, ...cropProperties }}\n alt={image.description ?? image.name}\n sizes={calculateSizes(visualSizes)}\n {...props}\n />\n );\n}\nexport default PictureComponent;\n","import type { ISvgData } from '@se-studio/core-data-types';\nimport { calculateCropDetails, type IImageProps } from './Visual';\n\nfunction SvgComponent({\n image,\n className,\n style,\n ...other\n}: { image: ISvgData } & Omit<IImageProps, 'analytics' | 'componentLabel'>) {\n const cropProperties = calculateCropDetails(image);\n return (\n <div\n className={className}\n style={{ ...style, ...cropProperties }}\n // biome-ignore lint/security/noDangerouslySetInnerHtml: Ok to set SVG inner HTML\n dangerouslySetInnerHTML={{ __html: image.data }}\n {...other}\n />\n );\n}\n\nexport default SvgComponent;\n","import type { ISvgImage } from '@se-studio/core-data-types';\nimport Image from 'next/image';\nimport { calculateCropDetails, type IImageProps } from './Visual';\n\nfunction SvgImageComponent({\n image,\n loading,\n priority,\n className,\n style,\n}: { image: ISvgImage } & Omit<IImageProps, 'analytics' | 'componentLabel'>) {\n const { svgSrc, name, width, height, description } = image;\n const cropProperties = calculateCropDetails(image);\n\n return (\n <Image\n src={svgSrc}\n alt={description ?? name}\n width={width}\n height={height}\n style={{ ...style, ...cropProperties }}\n loading={loading}\n className={className}\n unoptimized={true}\n priority={priority}\n />\n );\n}\n\nexport default SvgImageComponent;\n","import { type IImage, isSvgData, isSvgImage } from '@se-studio/core-data-types';\nimport PictureComponent from './PictureComponent';\nimport SvgComponent from './SvgComponent';\nimport SvgImageComponent from './SvgImageComponent';\nimport type { IImageProps } from './Visual';\n\nfunction ImageComponent({\n image,\n visualSizes,\n priority,\n ...props\n}: { image: IImage } & Omit<IImageProps, 'analytics' | 'componentLabel'>) {\n if (isSvgData(image)) return <SvgComponent image={image} {...props} />;\n if (isSvgImage(image)) return <SvgImageComponent image={image} priority={priority} {...props} />;\n return (\n <PictureComponent image={image} visualSizes={visualSizes} priority={priority} {...props} />\n );\n}\n\nexport default ImageComponent;\n","import type {\n IAnalyticsContext,\n IExternalVideo,\n IFullVideo,\n ILocalVideo,\n} from '@se-studio/core-data-types';\nimport type { IVideoProps } from './Video';\n\nfunction VideoComponent({\n className,\n style,\n}: {\n video: ILocalVideo | IExternalVideo | IFullVideo;\n analyticsContext: IAnalyticsContext | null | undefined;\n componentLabel: string | null | undefined;\n} & IVideoProps) {\n return (\n <div className={className} style={style}>\n Video Component\n </div>\n );\n}\n\nexport default VideoComponent;\n","import type { IVisual } from '@se-studio/core-data-types';\nimport type React from 'react';\nimport { UnsupportedWarning } from '../utils/UnsupportedWarning';\nimport Animation from './AnimationComponent';\nimport ImageComponent from './ImageComponent';\nimport VideoComponent from './VideoComponent';\nimport type { IVisualProps } from './Visual';\n\nexport const Visual: React.FC<{ visual: IVisual } & IVisualProps> = ({\n visual,\n muted,\n controls,\n autoPlay,\n visualSizes,\n fullPlayer,\n loop,\n loopDelay,\n analyticsContext,\n componentLabel,\n ...props\n}) => {\n const { animation, image, video } = visual;\n if (animation) {\n return (\n <Animation\n animation={animation}\n autoPlay={autoPlay}\n loop={loop}\n loopDelay={loopDelay}\n {...props}\n />\n );\n }\n\n if (video) {\n return (\n <VideoComponent\n video={video}\n autoPlay={autoPlay}\n muted={muted}\n controls={controls}\n visualSizes={visualSizes}\n fullPlayer={fullPlayer}\n loop={loop}\n analyticsContext={analyticsContext}\n componentLabel={componentLabel}\n {...props}\n />\n );\n }\n if (image) {\n return <ImageComponent image={image} visualSizes={visualSizes} {...props} />;\n }\n\n return (\n <UnsupportedWarning className={props.className} style={props.style}>\n Not supporting non images yet\n </UnsupportedWarning>\n );\n};\n","import type { BaseCmsConfig, IPageContext } from '@se-studio/core-data-types';\n\n// Type utilities for generating prop types from component configurations\nexport type ArrayToUnion<T extends ReadonlyArray<unknown>> = T[number];\n\n// Base interface for component prop requirements\nexport interface ComponentConfig<\n TConfig extends BaseCmsConfig = BaseCmsConfig,\n TAdditional = Record<string, unknown>,\n> {\n // Properties from IComponent that the component needs\n componentProps: ReadonlyArray<keyof TConfig['Component']>;\n // Properties from IPageContext that the component needs\n contextProps: ReadonlyArray<keyof IPageContext<TConfig>>;\n // Additional props specific to the component\n additionalProps?: TAdditional;\n}\n\n// Base interface for collection prop requirements\nexport interface CollectionConfig<\n TConfig extends BaseCmsConfig = BaseCmsConfig,\n TAdditional = Record<string, unknown>,\n> {\n // Properties from ICollection that the collection needs\n collectionProps: ReadonlyArray<keyof TConfig['Collection']>;\n // Properties from IPageContext that the collection needs\n contextProps: ReadonlyArray<keyof IPageContext<TConfig>>;\n // Additional props specific to the collection\n additionalProps?: TAdditional;\n}\n\n// Generate Pick type from component prop requirements\nexport type ComponentPropsFromConfig<\n TConfig extends BaseCmsConfig,\n T extends ComponentConfig<TConfig>,\n> = T['componentProps'] extends ReadonlyArray<keyof TConfig['Component']>\n ? Pick<TConfig['Component'], ArrayToUnion<T['componentProps']>>\n : never;\n\n// Generate Pick type from collection prop requirements\nexport type CollectionPropsFromConfig<\n TConfig extends BaseCmsConfig,\n T extends CollectionConfig<TConfig>,\n> = T['collectionProps'] extends ReadonlyArray<keyof TConfig['Collection']>\n ? Pick<TConfig['Collection'], ArrayToUnion<T['collectionProps']>>\n : never;\n\n// Generate context props type\nexport type ContextPropsFromConfig<\n TConfig extends BaseCmsConfig,\n T extends ComponentConfig<TConfig> | CollectionConfig<TConfig>,\n> = Pick<IPageContext<TConfig>, ArrayToUnion<T['contextProps']>>;\n\n// Generate full component props type combining component props, context props, and additional props\nexport type GeneratePropsFromComponentConfig<\n TConfig extends BaseCmsConfig,\n T extends ComponentConfig<TConfig>,\n> = ComponentPropsFromConfig<TConfig, T> &\n ContextPropsFromConfig<TConfig, T> &\n (T['additionalProps'] extends Record<string, unknown>\n ? T['additionalProps']\n : Record<string, never>);\n\n// Generate full collection props type combining collection props, context props, and additional props\nexport type GeneratePropsFromCollectionConfig<\n TConfig extends BaseCmsConfig,\n T extends CollectionConfig<TConfig>,\n> = CollectionPropsFromConfig<TConfig, T> &\n ContextPropsFromConfig<TConfig, T> &\n (T['additionalProps'] extends Record<string, unknown>\n ? T['additionalProps']\n : Record<string, never>);\n\n// Development mode flag\nconst developmentMode = typeof process !== 'undefined' && process.env?.NODE_ENV === 'development';\n\n// Generic prop extraction function that works with any component config\nexport function extractPropsFromComponentConfig<\n TConfig extends BaseCmsConfig,\n T extends ComponentConfig<TConfig>,\n>(\n config: T,\n component: TConfig['Component'],\n context?: IPageContext<TConfig>,\n): GeneratePropsFromComponentConfig<TConfig, T> {\n const props: Record<string, unknown> = {};\n\n // Extract component properties\n for (const key of config.componentProps) {\n if (key in component) {\n props[key as string] = component[key];\n }\n }\n\n // Extract context properties\n if ('contextProps' in config && config.contextProps && context) {\n for (const key of config.contextProps) {\n if (key in context) {\n props[key as string] = context[key];\n }\n }\n }\n\n // Add additional props\n if ('additionalProps' in config && config.additionalProps) {\n Object.assign(props, config.additionalProps);\n }\n\n // Development warnings for unused properties\n if (developmentMode) {\n const availableComponentKeys: Array<keyof TConfig['Component']> = [\n 'id',\n 'index',\n 'componentType',\n 'cmsLabel',\n 'backgroundColour',\n 'textColour',\n 'heading',\n 'preHeading',\n 'postHeading',\n 'body',\n 'visual',\n 'icon',\n 'links',\n 'additionalCopy',\n 'anchor',\n 'name',\n 'parentId',\n 'parentFieldId',\n 'backgroundVisual',\n 'backgroundOverlayOpacity',\n 'isFirst',\n 'isLast',\n 'indexOfType',\n 'type',\n ];\n\n const usedKeys = new Set(config.componentProps as ReadonlyArray<string>);\n if ('contextProps' in config && config.contextProps) {\n for (const key of config.contextProps) {\n usedKeys.add(key as string);\n }\n }\n\n const unusedKeys = availableComponentKeys.filter(\n (key) =>\n !usedKeys.has(key as string) &&\n component[key] !== undefined &&\n component[key] !== null &&\n // Skip commonly unused base properties\n ![\n 'type',\n 'name',\n 'parentId',\n 'parentFieldId',\n 'anchor',\n 'backgroundVisual',\n 'backgroundOverlayOpacity',\n 'isFirst',\n 'isLast',\n 'indexOfType',\n ].includes(key as string),\n );\n\n if (unusedKeys.length > 0) {\n console.warn(\n `Component with config has unused properties:`,\n unusedKeys,\n '\\nConsider adding these to the component prop requirements or marking them as intentionally unused.',\n );\n }\n }\n\n return props as GeneratePropsFromComponentConfig<TConfig, T>;\n}\n\n// Generic prop extraction function that works with any collection config\nexport function extractPropsFromCollectionConfig<\n TConfig extends BaseCmsConfig,\n T extends CollectionConfig<TConfig>,\n>(\n config: T,\n collection: TConfig['Collection'],\n context?: IPageContext<TConfig>,\n): GeneratePropsFromCollectionConfig<TConfig, T> {\n const props: Record<string, unknown> = {};\n\n // Extract collection properties\n for (const key of config.collectionProps) {\n if (key in collection) {\n props[key as string] = collection[key];\n }\n }\n\n // Extract context properties\n if ('contextProps' in config && config.contextProps && context) {\n for (const key of config.contextProps) {\n if (key in context) {\n props[key as string] = context[key];\n }\n }\n }\n\n // Add additional props\n if ('additionalProps' in config && config.additionalProps) {\n Object.assign(props, config.additionalProps);\n }\n\n // Development warnings for unused properties\n if (developmentMode) {\n const availableCollectionKeys: Array<keyof TConfig['Collection']> = [\n 'id',\n 'index',\n 'collectionType',\n 'cmsLabel',\n 'backgroundColour',\n 'textColour',\n 'heading',\n 'preHeading',\n 'postHeading',\n 'body',\n 'visual',\n 'icon',\n 'links',\n 'additionalCopy',\n 'anchor',\n 'name',\n 'parentId',\n 'parentFieldId',\n 'backgroundVisual',\n 'backgroundOverlayOpacity',\n 'isFirst',\n 'isLast',\n 'indexOfType',\n 'type',\n 'contents',\n ];\n\n const usedKeys = new Set(config.collectionProps as ReadonlyArray<string>);\n if ('contextProps' in config && config.contextProps) {\n for (const key of config.contextProps) {\n usedKeys.add(key as string);\n }\n }\n\n const unusedKeys = availableCollectionKeys.filter(\n (key) =>\n !usedKeys.has(key as string) &&\n collection[key] !== undefined &&\n collection[key] !== null &&\n // Skip commonly unused base properties\n ![\n 'type',\n 'name',\n 'parentId',\n 'parentFieldId',\n 'anchor',\n 'backgroundVisual',\n 'backgroundOverlayOpacity',\n 'isFirst',\n 'isLast',\n 'indexOfType',\n ].includes(key as string),\n );\n\n if (unusedKeys.length > 0) {\n console.warn(\n `Collection with config has unused properties:`,\n unusedKeys,\n '\\nConsider adding these to the collection prop requirements or marking them as intentionally unused.',\n );\n }\n }\n\n return props as GeneratePropsFromCollectionConfig<TConfig, T>;\n}\n","import type { BaseCmsConfig } from '@se-studio/core-data-types';\nimport type React from 'react';\nimport type { CollectionConfig, ComponentConfig } from '../utils/componentUtils';\nimport {\n extractPropsFromCollectionConfig,\n extractPropsFromComponentConfig,\n} from '../utils/componentUtils';\nimport type {\n IEmbeddableCollectionContext,\n IEmbeddableComponentContext,\n} from './EmbeddableContext';\n\n/**\n * Factory function to create an embeddable component from a ComponentConfig.\n * This allows full-featured components to be rendered in embedded contexts (like rich text)\n * by extracting only the props needed from the component information.\n *\n * @param Component - The component to render\n * @param componentConfig - Configuration defining which props to extract\n * @returns A React component that can be used in embedded contexts\n *\n * @example\n * ```tsx\n * const QUOTE_CONFIG = {\n * componentProps: [\"id\", \"body\", \"preHeading\"] as const,\n * contextProps: [\"pageContext\"] as const,\n * } as const satisfies ComponentConfig;\n *\n * export const EmbeddableQuote = BuildEmbedFromComponentConfig(\n * QuoteComponent,\n * QUOTE_CONFIG\n * );\n * ```\n */\nexport function BuildEmbedFromComponentConfig<\n TConfig extends BaseCmsConfig,\n TProps extends Record<string, unknown>,\n TComponentConfig extends ComponentConfig<TConfig>,\n>(\n Component: React.FC<TProps>,\n componentConfig: TComponentConfig,\n): React.FC<IEmbeddableComponentContext<TConfig>> {\n return ({ information, pageContext }) => {\n const props = extractPropsFromComponentConfig(componentConfig, information, pageContext);\n return <Component {...(props as unknown as TProps)} />;\n };\n}\n\n/**\n * Factory function to create an embeddable collection from a CollectionConfig.\n * This allows full-featured collections to be rendered in embedded contexts (like rich text)\n * by extracting only the props needed from the collection information.\n *\n * @param Collection - The collection component to render\n * @param collectionConfig - Configuration defining which props to extract\n * @returns A React component that can be used in embedded contexts\n *\n * @example\n * ```tsx\n * const RELATED_ARTICLES_CONFIG = {\n * collectionProps: [\"id\", \"contents\", \"heading\"] as const,\n * contextProps: [\"pageContext\"] as const,\n * } as const satisfies CollectionConfig;\n *\n * export const EmbeddableRelatedArticles = BuildEmbedFromCollectionConfig(\n * RelatedArticlesCollection,\n * RELATED_ARTICLES_CONFIG\n * );\n * ```\n */\nexport function BuildEmbedFromCollectionConfig<\n TConfig extends BaseCmsConfig,\n TProps extends Record<string, unknown>,\n TCollectionConfig extends CollectionConfig<TConfig>,\n>(\n Collection: React.FC<TProps>,\n collectionConfig: TCollectionConfig,\n): React.FC<IEmbeddableCollectionContext<TConfig>> {\n return ({ information, pageContext }) => {\n const props = extractPropsFromCollectionConfig(collectionConfig, information, pageContext);\n return <Collection {...(props as unknown as TProps)} />;\n };\n}\n","import type { BaseCmsConfig } from '@se-studio/core-data-types';\nimport type React from 'react';\nimport type {\n IEmbeddableCollectionContext,\n IEmbeddableComponentContext,\n} from './EmbeddableContext';\n\n/**\n * Map of component types that can be embedded in rich text or other contexts.\n * These components are rendered without full Section wrappers.\n *\n * Projects should populate this with their embeddable components using BuildEmbedFromComponentConfig.\n *\n * @example\n * ```tsx\n * const embeddableComponentMap: EmbeddableComponentMap<MyConfig> = {\n * \"Pull quote\": BuildEmbedFromComponentConfig(PullQuote, PULL_QUOTE_CONFIG),\n * \"CTA card\": BuildEmbedFromComponentConfig(CTACard, CTA_CARD_CONFIG),\n * };\n * ```\n */\nexport type EmbeddableComponentMap<TConfig extends BaseCmsConfig> = Partial<\n Record<TConfig['ComponentType'], React.FC<IEmbeddableComponentContext<TConfig>>>\n>;\n\n/**\n * Map of collection types that can be embedded in rich text or other contexts.\n * These collections are rendered without full Section wrappers.\n *\n * Projects should populate this with their embeddable collections using BuildEmbedFromCollectionConfig.\n *\n * @example\n * ```tsx\n * const embeddableCollectionMap: EmbeddableCollectionMap<MyConfig> = {\n * \"Related articles\": BuildEmbedFromCollectionConfig(\n * RelatedArticles,\n * RELATED_ARTICLES_CONFIG\n * ),\n * };\n * ```\n */\nexport type EmbeddableCollectionMap<TConfig extends BaseCmsConfig> = Partial<\n Record<TConfig['CollectionType'], React.FC<IEmbeddableCollectionContext<TConfig>>>\n>;\n\n/**\n * Helper function to check if a component type is embeddable\n */\nexport function isComponentEmbeddable<TConfig extends BaseCmsConfig>(\n componentType: TConfig['ComponentType'],\n embeddableMap: EmbeddableComponentMap<TConfig>,\n): boolean {\n return componentType in embeddableMap;\n}\n\n/**\n * Helper function to check if a collection type is embeddable\n */\nexport function isCollectionEmbeddable<TConfig extends BaseCmsConfig>(\n collectionType: TConfig['CollectionType'],\n embeddableMap: EmbeddableCollectionMap<TConfig>,\n): boolean {\n return collectionType in embeddableMap;\n}\n","import {\n documentToReactComponents,\n type Options,\n type RenderNode,\n} from '@contentful/rich-text-react-renderer';\nimport {\n BLOCKS,\n type Block,\n type Document,\n INLINES,\n type Inline,\n} from '@contentful/rich-text-types';\nimport type {\n BaseCmsConfig,\n IContentContext,\n IInternalLink,\n IVisual,\n PageContent,\n} from '@se-studio/core-data-types';\nimport type { HTMLAttributes } from 'react';\nimport type { CmsRendererConfig } from '../CmsRendererConfig';\n\nfunction createComplexLinksRenderer<TConfig extends BaseCmsConfig>(\n rendererConfig: CmsRendererConfig<TConfig>,\n contentContext: IContentContext<TConfig>,\n): RenderNode {\n return {\n [INLINES.EMBEDDED_ENTRY]: (node: Inline | Block) => {\n const target = node.data.target as IInternalLink<TConfig>;\n if (target) {\n const Renderer = rendererConfig.internalLinkRenderer;\n return <Renderer information={target} contentContext={contentContext} />;\n }\n\n return <pre>{`Failed to find inline embedded entry`}</pre>;\n },\n [INLINES.HYPERLINK]: (node: Inline | Block, children) => {\n const href = node.data.uri as string;\n const Renderer = rendererConfig.basicLinkRenderer;\n return <Renderer href={href}>{children}</Renderer>;\n },\n [INLINES.ENTRY_HYPERLINK]: (node: Inline | Block) => {\n const target = node.data.target as IInternalLink<TConfig>;\n if (target) {\n const Renderer = rendererConfig.internalLinkRenderer;\n return <Renderer information={target} contentContext={contentContext} />;\n }\n\n return <pre>{`Failed to find inline embedded entry`}</pre>;\n },\n [BLOCKS.EMBEDDED_ENTRY]: (node: Block | Inline) => {\n const target = node.data.target as PageContent<TConfig>;\n if (target) {\n const Renderer = rendererConfig.embeddedContentRenderer;\n return (\n <Renderer\n information={target}\n contentContext={contentContext}\n rendererConfig={rendererConfig}\n />\n );\n }\n return <pre>{`Failed to find block embedded entry`}</pre>;\n },\n [BLOCKS.EMBEDDED_ASSET]: (node: Block | Inline) => {\n const target = node.data.target as IVisual;\n if (target) {\n const Renderer = rendererConfig.visualComponentRenderer;\n return <Renderer information={target} contentContext={contentContext} />;\n }\n return <pre>{`Failed to find block embedded asset`}</pre>;\n },\n };\n}\n\nfunction buildOptions<TConfig extends BaseCmsConfig>(\n rendererConfig: CmsRendererConfig<TConfig>,\n contentContext: IContentContext<TConfig>,\n): Options {\n const complexLinksRenderer = createComplexLinksRenderer(rendererConfig, contentContext);\n\n return {\n renderNode: {\n ...complexLinksRenderer,\n },\n };\n}\n\nexport type RTFProps<TConfig extends BaseCmsConfig> = {\n content: Document;\n rendererConfig: CmsRendererConfig<TConfig>;\n contentContext: IContentContext<TConfig>;\n} & Omit<HTMLAttributes<HTMLElement>, 'content'>;\n\nexport function RTF<TConfig extends BaseCmsConfig>({\n content,\n className,\n style,\n rendererConfig,\n contentContext,\n ...other\n}: RTFProps<TConfig>) {\n const options = buildOptions(rendererConfig, contentContext);\n return (\n <div className={className} style={style} {...other}>\n {documentToReactComponents(content, options)}\n </div>\n );\n}\n","import type { PropsWithChildren } from 'react';\n\n/**\n * Set of property names that are commonly unused and should not trigger warnings.\n * Projects can extend this list by wrapping UnusedChecker or using their own implementation.\n */\nconst DEFAULT_ALLOWED_UNUSED = new Set([\n 'componentType',\n 'CollectionType',\n 'id',\n 'type',\n 'name',\n 'index',\n 'indexOfType',\n 'isFirst',\n 'isLast',\n 'anchor',\n 'parentId',\n 'parentFieldId',\n 'backgroundColour',\n 'textColour',\n 'priority',\n '__typename',\n 'cmsLabel',\n 'backgroundVisual',\n 'backgroundOverlayOpacity',\n]);\n\ntype UnusedType = Record<string, unknown>;\n\n/**\n * Get fields that have values but are not in the allowed set\n */\nfunction getUnusedFields(\n unused: UnusedType,\n allowedToBeUnused: Set<string> = DEFAULT_ALLOWED_UNUSED,\n): string[] | undefined {\n const fieldsWithValues = Object.entries(unused)\n .filter(([name]) => !allowedToBeUnused.has(name))\n .filter(([, value]) => typeof value !== 'undefined' && value !== null)\n .map(([name]) => name);\n\n if (fieldsWithValues.length > 0) return fieldsWithValues;\n return undefined;\n}\n\n/**\n * Development utility component that warns about unused component/collection properties.\n *\n * This helps catch cases where CMS content includes fields that aren't being rendered,\n * which could indicate missing functionality or unnecessary data fetching.\n *\n * Only shows warnings in development mode (NODE_ENV !== 'production').\n *\n * @example\n * ```tsx\n * const MyComponent = ({ information }) => {\n * const { heading, body, ...unused } = information;\n *\n * return (\n * <UnusedChecker\n * componentName=\"MyComponent\"\n * unused={unused}\n * showWarnings={true}\n * >\n * <div>\n * <h2>{heading}</h2>\n * <p>{body}</p>\n * </div>\n * </UnusedChecker>\n * );\n * };\n * ```\n */\nexport const UnusedChecker: React.FC<\n PropsWithChildren<{\n componentName: string;\n unused: UnusedType;\n allowedToBeUnused?: Set<string>;\n showWarnings?: boolean;\n }>\n> = ({\n children,\n componentName,\n unused,\n allowedToBeUnused = DEFAULT_ALLOWED_UNUSED,\n showWarnings = true,\n}) => {\n // Only check in development mode\n if ((typeof process !== 'undefined' && process.env?.NODE_ENV === 'production') || !showWarnings) {\n return <>{children}</>;\n }\n\n const fields = getUnusedFields(unused, allowedToBeUnused);\n\n if (fields) {\n return (\n <>\n <div\n style={{\n backgroundColor: 'yellow',\n padding: '2rem',\n margin: '1rem 0',\n }}\n >\n <p\n style={{\n fontSize: '3rem',\n color: 'black',\n margin: '0 0 1rem 0',\n }}\n >\n Unused fields in: {componentName}\n </p>\n <p style={{ fontSize: '1.5rem', color: 'black', margin: 0 }}>\n Unused fields: {fields.join(', ')}\n </p>\n </div>\n {children}\n </>\n );\n }\n\n return <>{children}</>;\n};\n\n/**\n * Export the default allowed unused set so projects can extend it\n */\nexport { DEFAULT_ALLOWED_UNUSED };\n"]}
package/package.json ADDED
@@ -0,0 +1,70 @@
1
+ {
2
+ "name": "@se-studio/core-ui",
3
+ "version": "0.1.0",
4
+ "description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Something-Else-Studio/se-core-product",
8
+ "directory": "packages/core-ui"
9
+ },
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "exports": {
15
+ ".": {
16
+ "types": "./dist/index.d.ts",
17
+ "import": "./dist/index.js"
18
+ },
19
+ "./client": {
20
+ "types": "./dist/client.d.ts",
21
+ "import": "./dist/client.js"
22
+ }
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "keywords": [
28
+ "react",
29
+ "components",
30
+ "ui",
31
+ "tailwind",
32
+ "design-system",
33
+ "typescript"
34
+ ],
35
+ "peerDependencies": {
36
+ "next": "^15.5.0",
37
+ "react": "^19.0.0",
38
+ "react-dom": "^19.0.0"
39
+ },
40
+ "dependencies": {
41
+ "@contentful/live-preview": "^4.6.54",
42
+ "@contentful/rich-text-react-renderer": "^16.1.5",
43
+ "@contentful/rich-text-types": "^17.2.4",
44
+ "change-case": "^5.4.4",
45
+ "@se-studio/core-data-types": "0.1.0"
46
+ },
47
+ "devDependencies": {
48
+ "@biomejs/biome": "^2.3.3",
49
+ "@testing-library/jest-dom": "^6.9.1",
50
+ "@testing-library/react": "^16.3.0",
51
+ "@types/node": "^24.10.0",
52
+ "@types/react": "^19.2.2",
53
+ "@types/react-dom": "^19.2.2",
54
+ "@vitejs/plugin-react": "^5.1.0",
55
+ "jsdom": "^27.1.0",
56
+ "next": "^15.5.0",
57
+ "tsup": "^8.5.0",
58
+ "typescript": "^5.9.3",
59
+ "vitest": "^4.0.6"
60
+ },
61
+ "scripts": {
62
+ "build": "tsup",
63
+ "dev": "tsup --watch --no-clean",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest",
66
+ "type-check": "tsc --noEmit",
67
+ "lint": "biome lint .",
68
+ "clean": "rm -rf dist .turbo"
69
+ }
70
+ }