zuljaman-banner-components 1.0.23 → 1.0.24

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 (117) hide show
  1. package/README.md +228 -131
  2. package/dist/components/BannerRenderer/BannerRenderer.d.ts +8 -0
  3. package/dist/components/BannerRenderer/BannerRenderer.d.ts.map +1 -0
  4. package/dist/components/BannerRenderer/BannerRenderer.js +325 -0
  5. package/dist/components/BannerRenderer/components/CopyElement.d.ts +62 -0
  6. package/dist/components/BannerRenderer/components/CopyElement.d.ts.map +1 -0
  7. package/dist/components/BannerRenderer/components/CopyElement.js +220 -0
  8. package/dist/components/BannerRenderer/components/InteractiveLines.d.ts +26 -0
  9. package/dist/components/BannerRenderer/components/InteractiveLines.d.ts.map +1 -0
  10. package/dist/components/BannerRenderer/components/InteractiveLines.js +172 -0
  11. package/dist/components/BannerRenderer/components/LogoElement.d.ts +55 -0
  12. package/dist/components/BannerRenderer/components/LogoElement.d.ts.map +1 -0
  13. package/dist/components/BannerRenderer/components/LogoElement.js +53 -0
  14. package/dist/components/BannerRenderer/components/VisualGuides.d.ts +43 -0
  15. package/dist/components/BannerRenderer/components/VisualGuides.d.ts.map +1 -0
  16. package/dist/components/BannerRenderer/components/VisualGuides.js +110 -0
  17. package/dist/components/BannerRenderer/components/index.d.ts +12 -0
  18. package/dist/components/BannerRenderer/components/index.d.ts.map +1 -0
  19. package/dist/components/BannerRenderer/components/index.js +14 -0
  20. package/dist/components/BannerRenderer/constants.d.ts +15 -0
  21. package/dist/components/BannerRenderer/constants.d.ts.map +1 -0
  22. package/dist/components/BannerRenderer/constants.js +36 -0
  23. package/dist/components/BannerRenderer/hooks/index.d.ts +14 -0
  24. package/dist/components/BannerRenderer/hooks/index.d.ts.map +1 -0
  25. package/dist/components/BannerRenderer/hooks/index.js +16 -0
  26. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.d.ts +30 -0
  27. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.d.ts.map +1 -0
  28. package/dist/components/BannerRenderer/hooks/useAutoPositioning/debugPositions.js +87 -0
  29. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.d.ts +13 -0
  30. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.d.ts.map +1 -0
  31. package/dist/components/BannerRenderer/hooks/useAutoPositioning/index.js +21 -0
  32. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.d.ts +71 -0
  33. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.d.ts.map +1 -0
  34. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAnchorEdgeLocking.js +151 -0
  35. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.d.ts +66 -0
  36. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.d.ts.map +1 -0
  37. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useAutoPositioningMain.js +332 -0
  38. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.d.ts +61 -0
  39. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.d.ts.map +1 -0
  40. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useChainPositioning.js +180 -0
  41. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.d.ts +60 -0
  42. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.d.ts.map +1 -0
  43. package/dist/components/BannerRenderer/hooks/useAutoPositioning/useHeightCompensation.js +178 -0
  44. package/dist/components/BannerRenderer/hooks/useAutoPositioning.d.ts +8 -0
  45. package/dist/components/BannerRenderer/hooks/useAutoPositioning.d.ts.map +1 -0
  46. package/dist/components/BannerRenderer/hooks/useAutoPositioning.js +12 -0
  47. package/dist/components/BannerRenderer/hooks/useDragSnap.d.ts +30 -0
  48. package/dist/components/BannerRenderer/hooks/useDragSnap.d.ts.map +1 -0
  49. package/dist/components/BannerRenderer/hooks/useDragSnap.js +90 -0
  50. package/dist/components/BannerRenderer/hooks/useElementRefs.d.ts +22 -0
  51. package/dist/components/BannerRenderer/hooks/useElementRefs.d.ts.map +1 -0
  52. package/dist/components/BannerRenderer/hooks/useElementRefs.js +70 -0
  53. package/dist/components/BannerRenderer/hooks/useLineDrawing.d.ts +40 -0
  54. package/dist/components/BannerRenderer/hooks/useLineDrawing.d.ts.map +1 -0
  55. package/dist/components/BannerRenderer/hooks/useLineDrawing.js +198 -0
  56. package/dist/components/BannerRenderer/hooks/useProximityDetection.d.ts +43 -0
  57. package/dist/components/BannerRenderer/hooks/useProximityDetection.d.ts.map +1 -0
  58. package/dist/components/BannerRenderer/hooks/useProximityDetection.js +491 -0
  59. package/dist/components/BannerRenderer/index.d.ts +6 -0
  60. package/dist/components/BannerRenderer/index.d.ts.map +1 -0
  61. package/dist/components/BannerRenderer/index.js +8 -0
  62. package/dist/components/{BannerRenderer.d.ts → BannerRenderer/types.d.ts} +29 -8
  63. package/dist/components/BannerRenderer/types.d.ts.map +1 -0
  64. package/dist/components/BannerRenderer/types.js +5 -0
  65. package/dist/components/BannerRenderer/utils/alignmentUtils.d.ts +38 -0
  66. package/dist/components/BannerRenderer/utils/alignmentUtils.d.ts.map +1 -0
  67. package/dist/components/BannerRenderer/utils/alignmentUtils.js +138 -0
  68. package/dist/components/BannerRenderer/utils/elementCheckUtils.d.ts +22 -0
  69. package/dist/components/BannerRenderer/utils/elementCheckUtils.d.ts.map +1 -0
  70. package/dist/components/BannerRenderer/utils/elementCheckUtils.js +37 -0
  71. package/dist/components/BannerRenderer/utils/elementIdUtils.d.ts +25 -0
  72. package/dist/components/BannerRenderer/utils/elementIdUtils.d.ts.map +1 -0
  73. package/dist/components/BannerRenderer/utils/elementIdUtils.js +56 -0
  74. package/dist/components/BannerRenderer/utils/fontUtils.d.ts +12 -0
  75. package/dist/components/BannerRenderer/utils/fontUtils.d.ts.map +1 -0
  76. package/dist/components/BannerRenderer/utils/fontUtils.js +26 -0
  77. package/dist/components/BannerRenderer/utils/graphUtils.d.ts +54 -0
  78. package/dist/components/BannerRenderer/utils/graphUtils.d.ts.map +1 -0
  79. package/dist/components/BannerRenderer/utils/graphUtils.js +138 -0
  80. package/dist/components/BannerRenderer/utils/index.d.ts +12 -0
  81. package/dist/components/BannerRenderer/utils/index.d.ts.map +1 -0
  82. package/dist/components/BannerRenderer/utils/index.js +27 -0
  83. package/dist/components/BannerRenderer/utils/snapUtils.d.ts +38 -0
  84. package/dist/components/BannerRenderer/utils/snapUtils.d.ts.map +1 -0
  85. package/dist/components/BannerRenderer/utils/snapUtils.js +109 -0
  86. package/dist/components/BannerVisor.d.ts.map +1 -1
  87. package/dist/components/BannerVisor.js +8 -1
  88. package/dist/components/index.js +1 -1
  89. package/dist/components/shared/DraggableElement.d.ts +11 -0
  90. package/dist/components/shared/DraggableElement.d.ts.map +1 -1
  91. package/dist/components/shared/DraggableElement.js +47 -51
  92. package/dist/components/styles/Style1/substyleConfig.d.ts.map +1 -1
  93. package/dist/components/styles/Style1/substyleConfig.js +53 -54
  94. package/dist/components/styles/Style2/substyleConfig.js +78 -78
  95. package/dist/components/styles/Style3/substyleConfig.d.ts.map +1 -1
  96. package/dist/components/styles/Style3/substyleConfig.js +40 -37
  97. package/dist/components/styles/Style4/substyleConfig.js +57 -57
  98. package/dist/components/styles/types/substyleTypes.d.ts +32 -15
  99. package/dist/components/styles/types/substyleTypes.d.ts.map +1 -1
  100. package/dist/components/styles/utils/chainValidation.d.ts +41 -0
  101. package/dist/components/styles/utils/chainValidation.d.ts.map +1 -0
  102. package/dist/components/styles/utils/chainValidation.js +148 -0
  103. package/dist/components/styles/utils/positioningUtils.d.ts +207 -11
  104. package/dist/components/styles/utils/positioningUtils.d.ts.map +1 -1
  105. package/dist/components/styles/utils/positioningUtils.js +520 -19
  106. package/dist/constants/characterLimits.d.ts +4 -16
  107. package/dist/constants/characterLimits.d.ts.map +1 -1
  108. package/dist/constants/characterLimits.js +28 -26
  109. package/dist/constants/styleConfigs.js +6 -6
  110. package/dist/styleConfig.d.ts +4 -4
  111. package/dist/styleConfig.d.ts.map +1 -1
  112. package/dist/styleConfig.js +8 -16
  113. package/dist/types.d.ts +42 -0
  114. package/dist/types.d.ts.map +1 -1
  115. package/package.json +1 -1
  116. package/dist/components/BannerRenderer.d.ts.map +0 -1
  117. package/dist/components/BannerRenderer.js +0 -559
package/README.md CHANGED
@@ -4,14 +4,15 @@ Platform-agnostic banner components for Next.js and AWS Lambda platforms. This s
4
4
 
5
5
  ## Features
6
6
 
7
- - **Platform Agnostic**: Works with Next.js, AWS Lambda, and other React environments
8
- - **TypeScript Support**: Full TypeScript definitions with enhanced type safety
9
- - **Adapter Pattern**: Clean separation of platform-specific image handling
10
- - **Dynamic Font Sizing**: Automatic font size calculation based on content length
11
- - **Advanced Shadow Effects**: Gradient-based shadow system with randomization
12
- - **Multiple Styles**: Support for different banner styles and substyles
13
- - **Responsive Design**: Automatic scaling based on container dimensions
14
- - **Zero Dependencies**: Minimal external dependencies for maximum compatibility
7
+ - **4 Banner Styles**: Each with 3 substyles (12 total variations)
8
+ - **Flexible Copy System**: Array-based copies with per-copy styling (color, background, padding, etc.)
9
+ - **Platform Agnostic**: Works with Next.js, AWS Lambda, and other React environments
10
+ - **TypeScript Support**: Full TypeScript definitions with enhanced type safety
11
+ - **Adapter Pattern**: Clean separation of platform-specific image handling
12
+ - **Interactive Modes**: Drag, resize, rotate, and linking modes for visual editors
13
+ - **Auto-Positioning**: Chain-based element positioning system
14
+ - **Visual Effects**: Configurable text shadows, logo shadows, and noise overlays
15
+ - **Responsive Design**: Automatic scaling based on container dimensions
15
16
 
16
17
  ## Installation
17
18
 
@@ -24,19 +25,24 @@ npm install @zuljaman/banner-components
24
25
  ### Next.js Usage
25
26
 
26
27
  ```typescript
27
- import { BannerVisor } from '@zuljaman/banner-components';
28
- import { ImageComponent } from '@zuljaman/banner-components/adapters/NextJSAdapter';
28
+ import NextImage from 'next/image';
29
+ import { BannerVisor, createNextJSAdapter } from '@zuljaman/banner-components';
30
+
31
+ // Create platform adapter
32
+ const ImageComponent = createNextJSAdapter(NextImage);
29
33
 
30
- function MyBannerComponent() {
34
+ function MyBanner() {
31
35
  return (
32
36
  <BannerVisor
33
- bannerStyle={1}
34
- bannerSubstyle={1}
35
- postType="POST"
36
- copy1="Your primary text here"
37
- copy2="Your secondary text here"
38
- logoUrl="/path/to/logo.png"
39
- backgroundImageUrl="/path/to/background.jpg"
37
+ bannerStyle={1} // 1-4
38
+ bannerSubstyle={1} // 1-3
39
+ postType="POST" // "POST" or "STORY"
40
+ copies={[
41
+ { id: 'copy-1', text: 'Primary text', styleSlot: 0 },
42
+ { id: 'copy-2', text: 'Secondary text', styleSlot: 1 }
43
+ ]}
44
+ logoUrl="/logo.png"
45
+ backgroundImageUrl="/background.jpg"
40
46
  ImageComponent={ImageComponent}
41
47
  />
42
48
  );
@@ -46,98 +52,208 @@ function MyBannerComponent() {
46
52
  ### AWS Lambda / SSR Usage
47
53
 
48
54
  ```typescript
49
- import { BannerVisor } from '@zuljaman/banner-components';
50
- import { ImageComponent } from '@zuljaman/banner-components/adapters/SSRAdapter';
55
+ import { BannerVisor, SSRImageComponent } from '@zuljaman/banner-components';
51
56
 
52
- function MyBannerComponent() {
57
+ function LambdaBanner({ copies, logoUrl, backgroundImageUrl }) {
53
58
  return (
54
59
  <BannerVisor
55
60
  bannerStyle={1}
56
61
  bannerSubstyle={1}
57
62
  postType="POST"
58
- copy1="Your primary text here"
59
- copy2="Your secondary text here"
60
- logoUrl="/path/to/logo.png"
61
- backgroundImageUrl="/path/to/background.jpg"
62
- ImageComponent={ImageComponent}
63
+ copies={copies}
64
+ logoUrl={logoUrl}
65
+ backgroundImageUrl={backgroundImageUrl}
66
+ ImageComponent={SSRImageComponent}
67
+ sizeMultiplier={1} // Fixed size for server rendering
63
68
  />
64
69
  );
65
70
  }
66
71
  ```
67
72
 
68
- ## Components
73
+ ### Legacy Props (Backward Compatible)
69
74
 
70
- ### BannerVisor
71
-
72
- The main banner component that handles routing between different styles and substyles.
75
+ ```typescript
76
+ // Still supported for backward compatibility
77
+ <BannerVisor
78
+ bannerStyle={1}
79
+ bannerSubstyle={1}
80
+ postType="POST"
81
+ copy1="Primary text" // Legacy: use copies[] instead
82
+ copy2="Secondary text" // Legacy: use copies[] instead
83
+ logoUrl="/logo.png"
84
+ backgroundImageUrl="/background.jpg"
85
+ ImageComponent={ImageComponent}
86
+ />
87
+ ```
73
88
 
74
- **Props:**
75
- - `bannerStyle: number` - Style identifier (1-2)
76
- - `bannerSubstyle: number` - Substyle identifier (1-3)
77
- - `postType: PostType` - "POST" or "STORY" for different dimensions
78
- - `copy1?: string` - Primary text content
79
- - `copy2?: string` - Secondary text content
80
- - `logoUrl?: string` - URL for logo image
81
- - `backgroundImageUrl?: string` - URL for background image
82
- - `sizeMultiplier?: number` - Manual size scaling (optional)
83
- - `ImageComponent: React.ComponentType<ImageProps>` - Platform-specific image component
89
+ ## Architecture
84
90
 
85
- ### Style Components
91
+ ```
92
+ BannerVisor (Entry point)
93
+ └── BannerRenderer (Generic style-agnostic renderer)
94
+ ├── LogoElement → DraggableElement
95
+ ├── CopyElement → DraggableElement (one per copy)
96
+ ├── InteractiveLines (chain visualization)
97
+ └── VisualGuides (alignment guides)
98
+ ```
86
99
 
87
- #### BannerStyle1
88
- Enhanced banner style with sophisticated layout and shadow effects.
100
+ ### Key Components
89
101
 
90
- #### BannerStyle2
91
- Alternative banner style optimized for different content types.
102
+ | Component | Description |
103
+ |-----------|-------------|
104
+ | `BannerVisor` | Main entry point, handles legacy prop conversion |
105
+ | `BannerRenderer` | Generic renderer that works with all 4 styles |
106
+ | `CopyElement` | Renders individual text elements with styling |
107
+ | `LogoElement` | Renders logo with positioning |
108
+ | `DraggableElement` | Reusable drag/rotate/resize wrapper |
92
109
 
93
- ### Substyles
110
+ ## Props Reference
94
111
 
95
- Each style includes 3 substyles (BannerSubstyle1, BannerSubstyle2, BannerSubstyle3) with different layouts:
96
- - **Substyle 1**: Logo top-left, text bottom
97
- - **Substyle 2**: Logo top-left with side text, centered bottom text
98
- - **Substyle 3**: Logo and text side-by-side, bottom text
112
+ ### Core Props
99
113
 
100
- ## Platform Adapters
114
+ | Prop | Type | Default | Description |
115
+ |------|------|---------|-------------|
116
+ | `bannerStyle` | `number` | `1` | Style template (1-4) |
117
+ | `bannerSubstyle` | `number` | required | Substyle variation (1-3) |
118
+ | `postType` | `'POST' \| 'STORY'` | required | Banner dimensions |
119
+ | `ImageComponent` | `React.ComponentType` | required | Platform image adapter |
101
120
 
102
- ### NextJSAdapter
103
- Uses Next.js optimized Image component with automatic optimization.
121
+ ### Copy System
104
122
 
105
123
  ```typescript
106
- import { ImageComponent } from '@zuljaman/banner-components/adapters/NextJSAdapter';
124
+ interface CopyConfig {
125
+ id: string; // Unique identifier
126
+ styleSlot?: number; // 0 = copy1 position, 1 = copy2 position
127
+ text: string; // Text content
128
+ fontSize?: number; // Size multiplier (default 1.0)
129
+ align?: 'left' | 'center' | 'right';
130
+ fontWeight?: 'thin' | 'normal' | 'bold';
131
+ fontFamily?: string;
132
+ color?: string; // Text color
133
+ bgColor?: string; // Background color
134
+ hasBg?: boolean; // Show background
135
+ paddingX?: string; // Horizontal padding (e.g., '1rem')
136
+ paddingY?: string; // Vertical padding
137
+ borderRadius?: string; // Corner radius
138
+ translateX?: number; // X offset in pixels
139
+ translateY?: number; // Y offset in pixels
140
+ rotation?: number; // Rotation in degrees
141
+ width?: number; // Width in pixels
142
+ underline?: boolean;
143
+ italic?: boolean;
144
+ textBold?: boolean;
145
+ hidden?: boolean; // Hide this copy
146
+ }
107
147
  ```
108
148
 
109
- ### SSRAdapter
110
- Uses standard HTML img tags for server-side rendering environments.
149
+ ### Visual Effects
150
+
151
+ | Prop | Type | Default | Description |
152
+ |------|------|---------|-------------|
153
+ | `textShadowEnabled` | `boolean` | from style | Enable text shadows |
154
+ | `textShadowSize` | `number` | from style | Shadow blur size |
155
+ | `textShadowIntensity` | `number` | from style | Shadow opacity |
156
+ | `logoShadowEnabled` | `boolean` | from style | Enable logo shadow |
157
+ | `logoShadowSize` | `number` | from style | Logo shadow size |
158
+ | `logoShadowIntensity` | `number` | from style | Logo shadow opacity |
159
+ | `noiseEnabled` | `boolean` | from style | Enable noise overlay |
160
+ | `noiseIntensity` | `number` | from style | Noise opacity |
161
+
162
+ ### Interactive Modes
163
+
164
+ | Prop | Type | Description |
165
+ |------|------|-------------|
166
+ | `draggableMode` | `boolean` | Enable drag/rotate/resize on elements |
167
+ | `creationMode` | `boolean` | Show element borders, enable creation UI |
168
+ | `linkingModeActive` | `boolean` | Enable element linking via clicks |
169
+
170
+ ### Callbacks
111
171
 
112
172
  ```typescript
113
- import { ImageComponent } from '@zuljaman/banner-components/adapters/SSRAdapter';
173
+ // Indexed callbacks (new)
174
+ onCopyPositionChange?: (index: number, pos: { x: number; y: number }) => void;
175
+ onCopyRotationChange?: (index: number, rotation: number) => void;
176
+ onCopyWidthChange?: (index: number, width: number) => void;
177
+
178
+ // Logo callbacks
179
+ onLogoPositionChange?: (pos: { x: number; y: number }) => void;
180
+ onLogoRotationChange?: (rotation: number) => void;
181
+ onLogoWidthChange?: (width: number) => void;
182
+
183
+ // Auto-positioning callbacks
184
+ onApplyAutoPositioning?: (config) => void;
185
+ onConnectionsDeleted?: () => void;
186
+ onLineGapsChange?: (lineGaps: Record<string, number>) => void;
187
+
188
+ // Legacy callbacks (still supported)
189
+ onCopy1PositionChange?: (pos) => void;
190
+ onCopy2PositionChange?: (pos) => void;
114
191
  ```
115
192
 
116
- ## Utilities
193
+ ## Style Guide
117
194
 
118
- ### Font Size Calculation
195
+ ### Available Styles
196
+
197
+ | Style | Font | Recommended Copies | Noise | Description |
198
+ |-------|------|-------------------|-------|-------------|
199
+ | 1 | Roboto | 2 | No | Clean, modern sans-serif |
200
+ | 2 | Lato | 2 | No | Styled text with backgrounds |
201
+ | 3 | Cormorant Garamond | 1 | Yes | Elegant serif, single copy |
202
+ | 4 | Cormorant Garamond | 2 | No | Dual serif copies |
203
+
204
+ ### Substyle Layouts
205
+
206
+ Each style has 3 substyles (1-3) with different element arrangements:
207
+ - **Substyle 1**: Logo top-left, text bottom
208
+ - **Substyle 2**: Logo + side text, centered bottom
209
+ - **Substyle 3**: Logo and text side-by-side
210
+
211
+ ## Auto-Positioning System
212
+
213
+ The package includes a chain-based auto-positioning system for maintaining element relationships:
119
214
 
120
215
  ```typescript
121
- import { calculateStyleFontSizes } from '@zuljaman/banner-components';
122
-
123
- const fontSizes = calculateStyleFontSizes("Primary text", "Secondary text", {
124
- baseSizeRem1: 4.8,
125
- baseSizeRem2: 4.8,
126
- maxLengthThreshold: 40,
127
- reductionFactor: 0.15
128
- });
216
+ // Elements are linked in chains: copy-0 → copy-1 → copy-2
217
+ // When an anchor element moves, linked elements adjust automatically
218
+
219
+ <BannerVisor
220
+ autoPositioningOverride={{
221
+ enabled: true,
222
+ config: {
223
+ links: [
224
+ { fromElement: 'copy-0', toElement: 'copy-1', direction: 'down', gapRem: 1 }
225
+ ]
226
+ },
227
+ gapRem: 1
228
+ }}
229
+ // ...other props
230
+ />
129
231
  ```
130
232
 
131
- ### Shadow Effects
233
+ ### Element IDs
234
+
235
+ - Logo: `'logo'`
236
+ - Copies: `'copy-0'`, `'copy-1'`, `'copy-2'` (based on styleSlot)
237
+
238
+ ## Platform Adapters
239
+
240
+ ### NextJSAdapter
241
+
242
+ Uses Next.js optimized Image component with automatic optimization.
132
243
 
133
244
  ```typescript
134
- import { createAbstractShadowStyle } from '@zuljaman/banner-components/styles';
245
+ import NextImage from 'next/image';
246
+ import { createNextJSAdapter } from '@zuljaman/banner-components';
247
+
248
+ const ImageComponent = createNextJSAdapter(NextImage);
249
+ ```
250
+
251
+ ### SSRAdapter
252
+
253
+ Uses standard HTML img tags for server-side rendering environments.
135
254
 
136
- const shadowStyle = createAbstractShadowStyle({
137
- direction: "bottom",
138
- size: "70%",
139
- intensity: 0.8
140
- });
255
+ ```typescript
256
+ import { SSRImageComponent } from '@zuljaman/banner-components';
141
257
  ```
142
258
 
143
259
  ## TypeScript Support
@@ -145,59 +261,61 @@ const shadowStyle = createAbstractShadowStyle({
145
261
  Full TypeScript definitions are included:
146
262
 
147
263
  ```typescript
148
- import type {
264
+ import type {
149
265
  BannerVisorProps,
150
- BannerSubstyleProps,
266
+ CopyConfig,
151
267
  PostType,
152
268
  ImageProps,
153
- StyleFontConfig
269
+ CustomSubstyleConfig,
270
+ CustomStyle
154
271
  } from '@zuljaman/banner-components';
155
272
  ```
156
273
 
157
- ## Constants
274
+ ## Advanced Hooks
158
275
 
159
- ```typescript
160
- import {
161
- DEFAULT_BANNER_WIDTH,
162
- DEFAULT_BANNER_HEIGHT,
163
- DEFAULT_STORY_WIDTH,
164
- DEFAULT_STORY_HEIGHT,
165
- STYLE_FONT_CONFIGS
166
- } from '@zuljaman/banner-components/constants';
167
- ```
276
+ The package includes several hooks for advanced use cases:
168
277
 
169
- ## Migration Guide
278
+ | Hook | Purpose |
279
+ |------|---------|
280
+ | `useAutoPositioning` | Manages element positioning chains |
281
+ | `useDragSnap` | Provides rotation and position snapping |
282
+ | `useLineDrawing` | Handles chain drawing interactions |
283
+ | `useProximityDetection` | Detects element proximity for linking |
170
284
 
171
- ### From Next.js App
285
+ ## Migration Guide
172
286
 
173
- Replace existing imports:
287
+ ### From Legacy copy1/copy2 Props
174
288
 
175
289
  ```typescript
176
290
  // Before
177
- import { BannerVisor } from '@/components/BannerStyles';
178
-
179
- // After
180
- import { BannerVisor } from '@zuljaman/banner-components';
181
- import { ImageComponent } from '@zuljaman/banner-components/adapters/NextJSAdapter';
182
-
183
- // Pass ImageComponent as prop
184
- <BannerVisor {...props} ImageComponent={ImageComponent} />
291
+ <BannerVisor
292
+ copy1="Primary text"
293
+ copy2="Secondary text"
294
+ copy1FontSizeMultiplier={1.2}
295
+ copy2FontSizeMultiplier={1.0}
296
+ // ...
297
+ />
298
+
299
+ // After (recommended)
300
+ <BannerVisor
301
+ copies={[
302
+ { id: 'c1', text: 'Primary text', styleSlot: 0, fontSize: 1.2 },
303
+ { id: 'c2', text: 'Secondary text', styleSlot: 1, fontSize: 1.0 }
304
+ ]}
305
+ // ...
306
+ />
185
307
  ```
186
308
 
187
- ### From AWS Lambda
188
-
189
- Replace existing imports:
309
+ ### From Old Adapter Imports
190
310
 
191
311
  ```typescript
192
- // Before
193
- import { BannerVisor } from '../components/BannerStyles/BannerVisor';
194
-
195
- // After
196
- import { BannerVisor } from '@zuljaman/banner-components';
197
- import { ImageComponent } from '@zuljaman/banner-components/adapters/SSRAdapter';
312
+ // Before (incorrect)
313
+ import { ImageComponent } from '@zuljaman/banner-components/adapters/NextJSAdapter';
198
314
 
199
- // Pass ImageComponent as prop
200
- <BannerVisor {...props} ImageComponent={ImageComponent} />
315
+ // After (correct)
316
+ import NextImage from 'next/image';
317
+ import { createNextJSAdapter } from '@zuljaman/banner-components';
318
+ const ImageComponent = createNextJSAdapter(NextImage);
201
319
  ```
202
320
 
203
321
  ## Development
@@ -209,7 +327,7 @@ npm install
209
327
  # Build the package
210
328
  npm run build
211
329
 
212
- # Watch for changes during development
330
+ # Run playground (development)
213
331
  npm run dev
214
332
 
215
333
  # Clean build artifacts
@@ -219,24 +337,3 @@ npm run clean
219
337
  ## License
220
338
 
221
339
  MIT
222
-
223
- ## Contributing
224
-
225
- This package consolidates banner components from multiple Zuljaman projects. When contributing:
226
-
227
- 1. Ensure changes maintain backward compatibility
228
- 2. Update TypeScript definitions
229
- 3. Test with both Next.js and AWS Lambda adapters
230
- 4. Follow existing code patterns and styling
231
-
232
- ## Architecture
233
-
234
- The package uses an adapter pattern to handle platform-specific image components while maintaining shared logic for:
235
-
236
- - Font size calculations
237
- - Shadow effect generation
238
- - Layout and styling
239
- - Type definitions
240
- - Constants and configurations
241
-
242
- This approach ensures 100% code reuse while supporting platform-specific optimizations.
@@ -0,0 +1,8 @@
1
+ /**
2
+ * BannerRenderer component - Generic platform-agnostic banner renderer
3
+ * Unified component that handles all banner styles based on configuration
4
+ */
5
+ import React from "react";
6
+ import type { BannerRendererProps } from "./types";
7
+ export declare const BannerRenderer: React.FC<BannerRendererProps>;
8
+ //# sourceMappingURL=BannerRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/BannerRenderer/BannerRenderer.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAMnD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8gBxD,CAAC"}