@codefluss/section-renderer 0.0.1-alpha.1

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,58 @@
1
+ /**
2
+ * Hero Section Stories
3
+ *
4
+ * Complete hero section examples using section-renderer with available plugins.
5
+ * Demonstrates building complex sections from basic plugin components.
6
+ */
7
+ import type { StoryObj } from '@storybook/react-vite';
8
+ import { SectionRenderer } from './section-renderer';
9
+ declare const meta: {
10
+ title: string;
11
+ component: typeof SectionRenderer;
12
+ parameters: {
13
+ layout: string;
14
+ docs: {
15
+ description: {
16
+ component: string;
17
+ };
18
+ };
19
+ };
20
+ argTypes: {
21
+ language: {
22
+ control: {
23
+ type: "select";
24
+ };
25
+ options: string[];
26
+ description: string;
27
+ table: {
28
+ category: string;
29
+ defaultValue: {
30
+ summary: string;
31
+ };
32
+ };
33
+ };
34
+ };
35
+ };
36
+ export default meta;
37
+ type Story = StoryObj<typeof meta>;
38
+ /**
39
+ * Muvico-Style Hero Section
40
+ *
41
+ * Replicates the Muvico hero section design using only available plugins.
42
+ * Features:
43
+ * - 2-column grid layout
44
+ * - Multi-line heading
45
+ * - Descriptive paragraph
46
+ * - Orange primary CTA button
47
+ * - Right-aligned hero image
48
+ *
49
+ * Note: TypeWriter animation and Floating Cards are not yet implemented as plugins.
50
+ */
51
+ export declare const MuvicoHero: Story;
52
+ /**
53
+ * Minimalist Hero Section
54
+ *
55
+ * Simplified hero with centered content and single CTA button.
56
+ */
57
+ export declare const MinimalistHero: Story;
58
+ //# sourceMappingURL=section-renderer-hero.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-renderer-hero.stories.d.ts","sourceRoot":"","sources":["../src/section-renderer-hero.stories.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAuB8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,UAAU,EAAE,KAqOxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KA0G5B,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Section Renderer Component
3
+ *
4
+ * Framework-agnostic SSR renderer for page sections
5
+ * Works with Next.js, Remix, TanStack Start, and any React framework
6
+ *
7
+ * ⚠️ IMPORTANT: This renderer produces LIVE SITE HTML!
8
+ * NO Tailwind classes allowed - only inline styles and semantic classes.
9
+ */
10
+ import React from "react";
11
+ import type { SectionRendererProps } from "./types";
12
+ /**
13
+ * Section Renderer
14
+ *
15
+ * Renders a page section with all its elements using SSR-capable plugin renderers
16
+ * Uses ONLY inline styles and semantic classes - NO Tailwind.
17
+ *
18
+ * @example
19
+ * ```tsx
20
+ * import { SectionRenderer } from '@codefluss/section-renderer';
21
+ *
22
+ * export default function Page() {
23
+ * return (
24
+ * <SectionRenderer
25
+ * section={sectionData}
26
+ * language="de"
27
+ * designSystem={myDesignSystem}
28
+ * />
29
+ * );
30
+ * }
31
+ * ```
32
+ */
33
+ export declare function SectionRenderer({ section, language, designSystem, className, }: SectionRendererProps): React.ReactElement;
34
+ export declare namespace SectionRenderer {
35
+ var displayName: string;
36
+ }
37
+ //# sourceMappingURL=section-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-renderer.d.ts","sourceRoot":"","sources":["../src/section-renderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAKpD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAAC,EAC/B,OAAO,EACP,QAAe,EACf,YAAkC,EAClC,SAAS,GACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,YAAY,CA+I3C;yBApJe,eAAe"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Section Renderer Stories
3
+ *
4
+ * Examples of rendering complete page sections with multiple plugins
5
+ */
6
+ import type { StoryObj } from "@storybook/react-vite";
7
+ import { SectionRenderer } from "./section-renderer";
8
+ declare const meta: {
9
+ title: string;
10
+ component: typeof SectionRenderer;
11
+ parameters: {
12
+ layout: string;
13
+ };
14
+ tags: string[];
15
+ };
16
+ export default meta;
17
+ type Story = StoryObj<typeof meta>;
18
+ /**
19
+ * Hero Section
20
+ * Heading + Text + Image composition
21
+ */
22
+ export declare const HeroSection: Story;
23
+ /**
24
+ * Feature Section with Gradient Background
25
+ */
26
+ export declare const FeatureSection: Story;
27
+ /**
28
+ * Content Section
29
+ * Text-heavy content with paragraph plugin
30
+ */
31
+ export declare const ContentSection: Story;
32
+ /**
33
+ * Full Width Section
34
+ */
35
+ export declare const FullWidthSection: Story;
36
+ /**
37
+ * Multi-Language Section
38
+ * Same section rendered in different languages
39
+ */
40
+ export declare const MultiLanguageDE: Story;
41
+ export declare const MultiLanguageEN: Story;
42
+ export declare const MultiLanguageFR: Story;
43
+ /**
44
+ * Simple Contact Form
45
+ * Basic contact form with email submission
46
+ */
47
+ export declare const SimpleContactForm: Story;
48
+ /**
49
+ * Contact Form with Webhook (n8n)
50
+ * Form configured to submit to n8n webhook
51
+ */
52
+ export declare const ContactFormWebhook: Story;
53
+ /**
54
+ * Comprehensive Contact Form
55
+ * Complete form with all field types and validation
56
+ */
57
+ export declare const ComprehensiveContactForm: Story;
58
+ /**
59
+ * Newsletter Subscription
60
+ * Simple newsletter signup form
61
+ */
62
+ export declare const NewsletterForm: Story;
63
+ //# sourceMappingURL=section-renderer.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section-renderer.stories.d.ts","sourceRoot":"","sources":["../src/section-renderer.stories.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGrD,QAAA,MAAM,IAAI;;;;;;;CAO8B,CAAC;AAEzC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,KA+DzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAyD5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAwC5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAiD9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,KA4C7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAK7B,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAgI/B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAoIhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAoNtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,KAiH5B,CAAC"}
@@ -0,0 +1,146 @@
1
+ /**
2
+ * Section Renderer Types
3
+ *
4
+ * Framework-agnostic types for rendering page sections
5
+ */
6
+ import type { PluginDesignSystem } from "@codefluss/base-types";
7
+ /**
8
+ * Section Element - A single component within a section
9
+ */
10
+ export interface SectionElement {
11
+ /**
12
+ * Unique element ID
13
+ */
14
+ id: string;
15
+ /**
16
+ * Plugin identifier (matches plugin package name)
17
+ * @example 'heading', 'text', 'paragraph', 'image', 'container'
18
+ */
19
+ pluginId: PluginId;
20
+ /**
21
+ * Plugin-specific data
22
+ * Each plugin has its own data structure
23
+ */
24
+ data: Record<string, unknown>;
25
+ /**
26
+ * Optional nested child elements
27
+ * Used for container plugins (e.g., form-container)
28
+ */
29
+ children?: SectionElement[];
30
+ }
31
+ /**
32
+ * Page Section - Container for multiple elements
33
+ */
34
+ export interface PageSection {
35
+ /**
36
+ * Unique section ID
37
+ */
38
+ id: string;
39
+ /**
40
+ * Section type identifier
41
+ */
42
+ type: "section";
43
+ /**
44
+ * Elements within the section
45
+ */
46
+ elements: SectionElement[];
47
+ /**
48
+ * Optional section-level layout configuration
49
+ */
50
+ layout?: {
51
+ /**
52
+ * Section background configuration
53
+ */
54
+ background?: {
55
+ type: "color" | "gradient" | "image" | "none";
56
+ color?: string;
57
+ gradient?: {
58
+ type: "linear" | "radial";
59
+ angle?: number;
60
+ stops: Array<{
61
+ color: string;
62
+ position: number;
63
+ }>;
64
+ };
65
+ image?: {
66
+ url: string;
67
+ size?: "cover" | "contain" | "auto";
68
+ position?: string;
69
+ };
70
+ };
71
+ /**
72
+ * Section spacing configuration
73
+ */
74
+ spacing?: {
75
+ padding?: {
76
+ top?: number;
77
+ right?: number;
78
+ bottom?: number;
79
+ left?: number;
80
+ };
81
+ margin?: {
82
+ top?: number;
83
+ right?: number;
84
+ bottom?: number;
85
+ left?: number;
86
+ };
87
+ };
88
+ /**
89
+ * Section width configuration
90
+ */
91
+ width?: {
92
+ mode?: "boxed" | "full-width";
93
+ maxWidth?: string;
94
+ };
95
+ };
96
+ }
97
+ /**
98
+ * Available Plugin IDs
99
+ */
100
+ export type PluginId = "heading" | "text" | "paragraph" | "image" | "button" | "container" | "canvas-2d" | "background-3d" | "configurator-3d" | "form-input" | "form-textarea" | "form-checkbox" | "form-radio" | "form-select" | "form-submit" | "form-container";
101
+ /**
102
+ * Extended Design System with utilities
103
+ */
104
+ export interface SectionRendererDesignSystem extends PluginDesignSystem {
105
+ /**
106
+ * Utility functions
107
+ */
108
+ utils: {
109
+ /**
110
+ * Class name utility (clsx + tailwind-merge)
111
+ */
112
+ cn: (...inputs: any[]) => string;
113
+ };
114
+ }
115
+ /**
116
+ * Section Renderer Props
117
+ */
118
+ export interface SectionRendererProps {
119
+ /**
120
+ * Section data to render
121
+ */
122
+ section: PageSection;
123
+ /**
124
+ * Current language code
125
+ * @default 'de'
126
+ */
127
+ language?: string;
128
+ /**
129
+ * Design system instance
130
+ * Provides fonts, colors, spacing, and utilities
131
+ */
132
+ designSystem?: SectionRendererDesignSystem;
133
+ /**
134
+ * Optional custom class name for the section container
135
+ */
136
+ className?: string;
137
+ }
138
+ /**
139
+ * Plugin Renderer Component Type
140
+ */
141
+ export type PluginRenderer = React.ComponentType<any>;
142
+ /**
143
+ * Plugin Renderer Map
144
+ */
145
+ export type PluginRendererMap = Record<PluginId, PluginRenderer>;
146
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAEnB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,SAAS,CAAC;IAEhB;;OAEG;IACH,QAAQ,EAAE,cAAc,EAAE,CAAC;IAE3B;;OAEG;IACH,MAAM,CAAC,EAAE;QACR;;WAEG;QACH,UAAU,CAAC,EAAE;YACZ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e,GACf,YAAY,GACZ,aAAa,GACb,aAAa,GACb,gBAAgB,CAAC;AAEpB;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,kBAAkB;IACtE;;OAEG;IACH,KAAK,EAAE;QACN;;WAEG;QACH,EAAE,EAAE,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC;KACjC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,YAAY,CAAC,EAAE,2BAA2B,CAAC;IAE3C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Design System Resolver
3
+ *
4
+ * Universal utilities for resolving design system tokens to CSS styles.
5
+ * Used by ALL plugins (text, paragraph, heading, form, container, etc).
6
+ *
7
+ * @package @codefluss/section-renderer
8
+ * @version 0.0.3
9
+ */
10
+ import type { PluginDesignSystem } from '@codefluss/base-types';
11
+ /**
12
+ * Create Design System from JSON export
13
+ *
14
+ * Converts the PostgreSQL export (design-system.json) into PluginDesignSystem interface
15
+ */
16
+ export declare function createDesignSystemFromJson(jsonData: any): PluginDesignSystem;
17
+ /**
18
+ * Resolve Typography Styles
19
+ *
20
+ * Get complete typography styles for an element
21
+ */
22
+ export declare function resolveTypographyStyles(fontKey: string, designSystem: PluginDesignSystem): React.CSSProperties;
23
+ /**
24
+ * Resolve Color Value
25
+ *
26
+ * Get hex value for a color key
27
+ */
28
+ export declare function resolveColorValue(colorKey: string, designSystem: PluginDesignSystem): string | undefined;
29
+ /**
30
+ * Resolve Spacing Styles
31
+ *
32
+ * Get spacing (padding/margin) as CSS properties
33
+ */
34
+ export declare function resolveSpacingStyles(presetId: string, type: 'padding' | 'margin', designSystem: PluginDesignSystem, _context?: string): React.CSSProperties;
35
+ /**
36
+ * Resolve Gap Styles
37
+ *
38
+ * Get gap values for flexbox/grid layouts
39
+ * NOTE: Gap is now part of the spacing preset's margin values
40
+ */
41
+ export declare function resolveGapStyles(presetId: string, designSystem: PluginDesignSystem, _context?: string): React.CSSProperties;
42
+ /**
43
+ * Resolve Box Model (Border, Border Radius, Shadow)
44
+ */
45
+ export interface BoxModelStyles {
46
+ border?: string;
47
+ borderRadius?: string;
48
+ boxShadow?: string;
49
+ }
50
+ export declare function resolveBoxModelStyles(borderColor?: string, borderWidth?: number, borderRadius?: number, shadowId?: string, designSystem?: PluginDesignSystem): BoxModelStyles;
51
+ /**
52
+ * Resolve Container Grid Styles
53
+ */
54
+ export declare function resolveContainerGridStyles(gridPresetId: string | undefined, designSystem: PluginDesignSystem, layoutMode?: 'flexbox' | 'grid'): React.CSSProperties;
55
+ /**
56
+ * Resolve Form Field Styles
57
+ *
58
+ * Specialized resolver for form input fields
59
+ */
60
+ export interface FormFieldStyles {
61
+ container: React.CSSProperties;
62
+ label: React.CSSProperties;
63
+ input: React.CSSProperties;
64
+ helpText: React.CSSProperties;
65
+ error: React.CSSProperties;
66
+ }
67
+ export declare function resolveFormFieldStyles(designSystem: PluginDesignSystem, options?: {
68
+ size?: 'sm' | 'md' | 'lg';
69
+ disabled?: boolean;
70
+ readOnly?: boolean;
71
+ hasError?: boolean;
72
+ }): FormFieldStyles;
73
+ /**
74
+ * Resolve Checkbox/Radio Styles
75
+ *
76
+ * Specialized resolver for checkbox and radio button fields
77
+ */
78
+ export interface CheckboxRadioStyles {
79
+ container: React.CSSProperties;
80
+ label: React.CSSProperties;
81
+ input: React.CSSProperties;
82
+ optionLabel: React.CSSProperties;
83
+ helpText: React.CSSProperties;
84
+ groupContainer: React.CSSProperties;
85
+ optionContainer: React.CSSProperties;
86
+ }
87
+ export declare function resolveCheckboxRadioStyles(designSystem: PluginDesignSystem, options?: {
88
+ size?: 'sm' | 'md' | 'lg';
89
+ disabled?: boolean;
90
+ groupLayout?: 'vertical' | 'horizontal' | 'grid';
91
+ gridColumns?: number;
92
+ }): CheckboxRadioStyles;
93
+ /**
94
+ * Resolve Button Styles
95
+ *
96
+ * Specialized resolver for button elements
97
+ */
98
+ export interface ButtonStyles {
99
+ button: React.CSSProperties;
100
+ }
101
+ export declare function resolveButtonStyles(designSystem: PluginDesignSystem, options?: {
102
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
103
+ size?: 'sm' | 'md' | 'lg';
104
+ fullWidth?: boolean;
105
+ disabled?: boolean;
106
+ }): ButtonStyles;
107
+ //# sourceMappingURL=design-system-resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-system-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/design-system-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,GAAG,GAAG,kBAAkB,CAiK5E;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,kBAAkB,GAC/B,KAAK,CAAC,aAAa,CASrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,kBAAkB,GAC/B,MAAM,GAAG,SAAS,CAEpB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,SAAS,GAAG,QAAQ,EAC1B,YAAY,EAAE,kBAAkB,EAChC,QAAQ,GAAE,MAAkB,GAC3B,KAAK,CAAC,aAAa,CAkBrB;AAED;;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CAAC,aAAa,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC;IAC3B,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC;IACjC,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC;IAC9B,cAAc,EAAE,KAAK,CAAC,aAAa,CAAC;IACpC,eAAe,EAAE,KAAK,CAAC,aAAa,CAAC;CACtC;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kBAAkB,EAChC,OAAO,GAAE;IACP,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAC;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;CACjB,GACL,mBAAmB,CAyFrB;AAED;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,kBAAkB,EAChC,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,GAAG,OAAO,CAAC;IACxD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACf,GACL,YAAY,CAgEd"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Design System Utilities
3
+ *
4
+ * Default design system and utility functions
5
+ */
6
+ import { type ClassValue } from "clsx";
7
+ import type { SectionRendererDesignSystem } from "../types";
8
+ /**
9
+ * Utility function for merging Tailwind CSS classes
10
+ * Uses clsx for conditional classes and tailwind-merge to resolve conflicts
11
+ *
12
+ * @param inputs - Class values to merge
13
+ * @returns Merged class string
14
+ */
15
+ export declare function cn(...inputs: ClassValue[]): string;
16
+ /**
17
+ * Default Design System
18
+ *
19
+ * Minimal design system for rendering without custom configuration
20
+ * Provides sensible defaults for all plugins
21
+ */
22
+ export declare const defaultDesignSystem: SectionRendererDesignSystem;
23
+ /**
24
+ * Create a custom design system by extending the default
25
+ *
26
+ * @param overrides - Partial design system to merge with defaults
27
+ * @returns Complete design system
28
+ */
29
+ export declare function createDesignSystem(overrides?: Partial<SectionRendererDesignSystem>): SectionRendererDesignSystem;
30
+ /**
31
+ * Story-ready dependencies object
32
+ *
33
+ * Pre-configured dependencies for Storybook stories.
34
+ * Provides the correct structure expected by RendererProps.
35
+ *
36
+ * NOTE: To use the real Design System from PostgreSQL export:
37
+ * 1. Import design-system.json
38
+ * 2. Use createDesignSystemFromJson to convert it to PluginDesignSystem
39
+ * 3. Use it in your stories
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * import designSystemJson from '../../../../design-system/design-system.json';
44
+ * import { createDesignSystemFromJson } from '@codefluss/section-renderer';
45
+ *
46
+ * const realDesignSystem = createDesignSystemFromJson(designSystemJson);
47
+ * const storyDependencies = {
48
+ * designSystem: realDesignSystem,
49
+ * utils: { cn }
50
+ * };
51
+ * ```
52
+ */
53
+ export declare const storyDependencies: {
54
+ designSystem: SectionRendererDesignSystem;
55
+ utils: {
56
+ cn: (...inputs: any[]) => string;
57
+ };
58
+ };
59
+ //# sourceMappingURL=design-system.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../src/utils/design-system.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAE7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,EAAE,2BA+QjC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,CAAC,EAAE,OAAO,CAAC,2BAA2B,CAAC,GAC9C,2BAA2B,CAS7B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,iBAAiB;;;aA3PpB,GAAG;;CA8PZ,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Plugin Loader Utilities
3
+ *
4
+ * Static plugin renderer registration for SSR compatibility
5
+ */
6
+ import type { PluginId, PluginRendererMap } from "../types";
7
+ /**
8
+ * Plugin Renderer Registry
9
+ *
10
+ * Static map of all available plugin renderers
11
+ * SSR-safe, no dynamic imports
12
+ */
13
+ export declare const PLUGIN_RENDERERS: PluginRendererMap;
14
+ /**
15
+ * Get plugin renderer by ID
16
+ *
17
+ * @param pluginId - Plugin identifier
18
+ * @returns Renderer component or null if not found
19
+ */
20
+ export declare function getPluginRenderer(pluginId: PluginId): import("..").PluginRenderer | null;
21
+ /**
22
+ * Check if plugin is supported
23
+ *
24
+ * @param pluginId - Plugin identifier to check
25
+ * @returns True if plugin renderer exists
26
+ */
27
+ export declare function isPluginSupported(pluginId: string): pluginId is PluginId;
28
+ /**
29
+ * Get all supported plugin IDs
30
+ *
31
+ * @returns Array of all registered plugin IDs
32
+ */
33
+ export declare function getSupportedPlugins(): PluginId[];
34
+ //# sourceMappingURL=plugin-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-loader.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-loader.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAwB5D;;;;;GAKG;AAGH,eAAO,MAAM,gBAAgB,EAgBxB,iBAAiB,CAAC;AAEvB;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,sCASnD;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,IAAI,QAAQ,CAExE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,QAAQ,EAAE,CAEhD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Storybook ArgTypes Generator
3
+ *
4
+ * Converts PropertyDefinition arrays into Storybook argTypes
5
+ * This ensures consistency between Context Panel controls and Storybook controls
6
+ *
7
+ * @package @codefluss/section-renderer
8
+ */
9
+ import type { PropertyDefinition } from '@codefluss/base-types';
10
+ import type { ArgTypes } from '@storybook/react';
11
+ /**
12
+ * Convert PropertyDefinition array to Storybook ArgTypes
13
+ *
14
+ * @param properties - Array of property definitions
15
+ * @param dataPrefix - Prefix for property keys (default: 'data')
16
+ * @returns Storybook ArgTypes object
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const argTypes = propertyDefinitionsToArgTypes(formInputProperties);
21
+ * ```
22
+ */
23
+ export declare function propertyDefinitionsToArgTypes(properties: PropertyDefinition[], dataPrefix?: string): ArgTypes;
24
+ /**
25
+ * Create argTypes for common form field properties
26
+ * that all form plugins share
27
+ */
28
+ export declare const commonFormFieldArgTypes: ArgTypes;
29
+ //# sourceMappingURL=storybook-argtypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storybook-argtypes.d.ts","sourceRoot":"","sources":["../../src/utils/storybook-argtypes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAwBjD;;;;;;;;;;;GAWG;AACH,wBAAgB,6BAA6B,CAC5C,UAAU,EAAE,kBAAkB,EAAE,EAChC,UAAU,GAAE,MAAe,GACzB,QAAQ,CAkDV;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAerC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@codefluss/section-renderer",
3
+ "version": "0.0.1-alpha.1",
4
+ "description": "Framework-agnostic SSR renderer for page sections",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "keywords": [
19
+ "section-renderer",
20
+ "ssr",
21
+ "page-builder",
22
+ "react",
23
+ "framework-agnostic"
24
+ ],
25
+ "author": "Codefluss",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "clsx": "^2.1.1",
29
+ "tailwind-merge": "^3.4.0",
30
+ "@codefluss/base-types": "0.0.1-alpha.1",
31
+ "@codefluss/form-container": "0.0.1-alpha.1",
32
+ "@codefluss/form-checkbox": "0.0.1-alpha.1",
33
+ "@codefluss/container": "0.0.1-alpha.1",
34
+ "@codefluss/form-radio": "0.0.1-alpha.1",
35
+ "@codefluss/form-submit": "0.0.1-alpha.1",
36
+ "@codefluss/form-select": "0.0.1-alpha.1",
37
+ "@codefluss/form-textarea": "0.0.1-alpha.1",
38
+ "@codefluss/heading": "0.0.1-alpha.1",
39
+ "@codefluss/image": "0.0.1-alpha.1",
40
+ "@codefluss/paragraph": "0.0.1-alpha.1",
41
+ "@codefluss/form-input": "0.0.1-alpha.1",
42
+ "@codefluss/plugin-background-3d": "0.0.1-alpha.1",
43
+ "@codefluss/text": "0.0.1-alpha.1",
44
+ "@codefluss/plugin-configurator-3d": "0.0.1-alpha.1"
45
+ },
46
+ "peerDependencies": {
47
+ "react": "^19.2.0",
48
+ "react-dom": "^19.2.0"
49
+ },
50
+ "devDependencies": {
51
+ "@storybook/react": "^10.1.8",
52
+ "@types/react": "19.2.4",
53
+ "@types/react-dom": "^19.2.3",
54
+ "@vitejs/plugin-react": "^5.1.2",
55
+ "typescript": "^5.9.3",
56
+ "vite": "^7.2.7",
57
+ "vite-plugin-dts": "^4.5.4",
58
+ "@codefluss/vite-config-lib": "0.0.1-alpha.1"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "scripts": {
64
+ "build": "vite build && tsc --emitDeclarationOnly",
65
+ "dev": "vite build --watch",
66
+ "typecheck": "tsc --noEmit"
67
+ }
68
+ }