tee3apps-cms-sdk-react 0.0.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.
Files changed (43) hide show
  1. package/.env +11 -0
  2. package/README.md +255 -0
  3. package/dist/index.d.ts +5 -0
  4. package/dist/index.js +13 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.mjs +13 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/package.json +33 -0
  9. package/rollup.config.js +43 -0
  10. package/src/Components/BoxRenderer.tsx +108 -0
  11. package/src/Components/ComponentRenderer.tsx +29 -0
  12. package/src/Components/ImageComponent.tsx +68 -0
  13. package/src/Components/RowComponent.tsx +66 -0
  14. package/src/Components/TextComponent.tsx +47 -0
  15. package/src/ErrorBoundary.tsx +35 -0
  16. package/src/Page.tsx +124 -0
  17. package/src/PageComponents/BoxComponent.tsx +397 -0
  18. package/src/PageComponents/RowComponent.tsx +113 -0
  19. package/src/PageComponents/Visual-Components/CarouselComponent.tsx +366 -0
  20. package/src/PageComponents/Visual-Components/GroupBrandComponent.tsx +391 -0
  21. package/src/PageComponents/Visual-Components/GroupCategoryComponent.tsx +425 -0
  22. package/src/PageComponents/Visual-Components/GroupImageList.tsx +669 -0
  23. package/src/PageComponents/Visual-Components/GroupProductComponent.tsx +671 -0
  24. package/src/PageComponents/Visual-Components/GroupVideoList.tsx +590 -0
  25. package/src/PageComponents/Visual-Components/ImageComponent.tsx +163 -0
  26. package/src/PageComponents/Visual-Components/LinkComponent.tsx +68 -0
  27. package/src/PageComponents/Visual-Components/LottieComponent.tsx +213 -0
  28. package/src/PageComponents/Visual-Components/NavigationComponent.tsx +178 -0
  29. package/src/PageComponents/Visual-Components/Styles/ProductListViewOne.tsx +102 -0
  30. package/src/PageComponents/Visual-Components/Styles/ProductListViewTwo.tsx +104 -0
  31. package/src/PageComponents/Visual-Components/Styles/product-list-view-one.css +166 -0
  32. package/src/PageComponents/Visual-Components/Styles/product-list-view-two.css +182 -0
  33. package/src/PageComponents/Visual-Components/TabComponent.tsx +1169 -0
  34. package/src/PageComponents/Visual-Components/TextComponent.tsx +114 -0
  35. package/src/PageComponents/Visual-Components/VideoComponent.tsx +191 -0
  36. package/src/PageComponents/Visual-Components/tab.css +697 -0
  37. package/src/common.interface.ts +216 -0
  38. package/src/const.ts +6 -0
  39. package/src/env.d.ts +15 -0
  40. package/src/index.css +82 -0
  41. package/src/index.ts +2 -0
  42. package/src/types.ts +234 -0
  43. package/tsconfig.json +20 -0
package/.env ADDED
@@ -0,0 +1,11 @@
1
+ VITE_API_BASEURL='http://172.235.15.58:8000/api/v1'
2
+ #VITE_API_BASEURL='http://localhost:8000/api/v1'
3
+ VITE_API_BASEURLJOB='http://localhost:9000/api/v1'
4
+ VITE_AUTH_PREFIX='PIM_TOKEN'
5
+ VITE_HASHKEY='tee3apps'
6
+ VITE_OWNERCODE='TEE3-0003'
7
+ VITE_FRONTEND_BASEURL='http://localhost:3000'
8
+ VITE_REGION='in-maa-1'
9
+ VITE_ENDPOINT='https://in-maa-1.linodeobjects.com'
10
+ VITE_ACCESS_KEY_ID='FQ6XNSMYNKNTPX5UPYZG'
11
+ VITE_SECRET_ACCESS_KEY='SCU0BwLkVJK6w6VyGUUNTfTRzTqXOe9hToRAy6Nq'
package/README.md ADDED
@@ -0,0 +1,255 @@
1
+ # Dynamic Page Renderer
2
+
3
+ A powerful and flexible React component library for dynamically rendering pages based on API data. Transform your JSON page structure into beautiful, interactive web pages with minimal setup.
4
+
5
+ ## 🚀 Features
6
+
7
+ - **Dynamic Page Rendering**: Convert JSON data into fully functional web pages
8
+ - **Flexible Element Support**: Support for various page elements (text, images, buttons, forms, etc.)
9
+ - **Easy Integration**: Simple drop-in component with minimal configuration
10
+ - **TypeScript Support**: Full TypeScript support with comprehensive type definitions
11
+ - **Customizable Styling**: Built-in themes with customization options
12
+ - **Responsive Design**: Mobile-first approach with responsive layouts
13
+ - **Performance Optimized**: Efficient rendering with minimal re-renders
14
+
15
+ ## 📦 Installation
16
+
17
+ ```bash
18
+ npm install page-render/react
19
+ ```
20
+
21
+ or with yarn:
22
+
23
+ ```bash
24
+ yarn add page-render/react
25
+ ```
26
+
27
+ ## 🔧 Basic Usage
28
+
29
+ Here's a simple example of how to use the Dynamic Page Renderer:
30
+
31
+ ```jsx
32
+ import React, { useState, useEffect } from 'react';
33
+ import { Page } from 'page-render/react';
34
+
35
+ function App() {
36
+ const [pageData, setPageData] = useState(null);
37
+ const [loading, setLoading] = useState(true);
38
+
39
+ useEffect(() => {
40
+ const fetchPageData = async () => {
41
+ try {
42
+ const response = await fetch('/api/page-data');
43
+ const data = await response.json();
44
+ const pageElements = data?.data?.pageElements;
45
+
46
+ console.log('Fetched pageElements:', pageElements);
47
+ setPageData(pageElements);
48
+ } catch (error) {
49
+ console.error('Error fetching page data:', error);
50
+ } finally {
51
+ setLoading(false);
52
+ }
53
+ };
54
+
55
+ fetchPageData();
56
+ }, []);
57
+
58
+ if (loading) return <div>Loading...</div>;
59
+
60
+ return (
61
+ <div className="app">
62
+ <Page data={pageData} />
63
+ </div>
64
+ );
65
+ }
66
+
67
+ export default App;
68
+ ```
69
+
70
+ ## 📊 Data Structure
71
+
72
+ The package expects your `pageElements` data to follow this structure:
73
+
74
+ ```json
75
+ [
76
+ {
77
+ "name": "Row",
78
+ "props": {
79
+ "minHeight": "280px",
80
+ "bgColor": "#ffffff",
81
+ "bgImage": "",
82
+ "align": "initial",
83
+ "justify": "flex-start",
84
+ "nowrap": false,
85
+ "bgsize": "cover",
86
+ "mode": {
87
+ "web": {
88
+ "isScroll": false,
89
+ "isVisible": true,
90
+ "top": "0px",
91
+ "bottom": "0px",
92
+ "flexView": true
93
+ },
94
+ "mobileweb": {
95
+ "isScroll": false,
96
+ "isVisible": true,
97
+ "top": "0px",
98
+ "bottom": "0px",
99
+ "flexView": true
100
+ },
101
+ "mobileapp": {
102
+ "isScroll": false,
103
+ "isVisible": true,
104
+ "top": "0px",
105
+ "bottom": "0px",
106
+ "flexView": true
107
+ },
108
+ "tablet": {
109
+ "isScroll": false,
110
+ "isVisible": true,
111
+ "top": "0px",
112
+ "bottom": "0px",
113
+ "flexView": true
114
+ }
115
+ }
116
+ },
117
+ "columns": [
118
+ {
119
+ "name": "Box",
120
+ "props": {
121
+ "bgColor": "#ffffff",
122
+ "bgImage": {},
123
+ "align": "initial",
124
+ "justify": "flex-start",
125
+ "compOrder": "1,2,3,4",
126
+ "bgsize": "cover",
127
+ "layout": "layout1",
128
+ "mode": {
129
+ "web": {
130
+ "colspan": 12,
131
+ "isVisible": true,
132
+ "height": "279px",
133
+ "top": "0px",
134
+ "bottom": "0px",
135
+ "left": "0px",
136
+ "right": "0px",
137
+ "radius": "0px"
138
+ },
139
+ "mobileweb": {
140
+ "colspan": 4,
141
+ "isVisible": true,
142
+ "height": "279px",
143
+ "top": "0px",
144
+ "bottom": "0px",
145
+ "left": "0px",
146
+ "right": "0px",
147
+ "radius": "0px"
148
+ },
149
+ "mobileapp": {
150
+ "colspan": 4,
151
+ "isVisible": true,
152
+ "height": "279px",
153
+ "top": "0px",
154
+ "bottom": "0px",
155
+ "left": "0px",
156
+ "right": "0px",
157
+ "radius": "0px"
158
+ },
159
+ "tablet": {
160
+ "colspan": 4,
161
+ "isVisible": true,
162
+ "height": "279px",
163
+ "top": "0px",
164
+ "bottom": "0px",
165
+ "left": "0px",
166
+ "right": "0px",
167
+ "radius": "0px"
168
+ }
169
+ }
170
+ },
171
+ "components": [
172
+ {
173
+ "name": "ImageComponent",
174
+ "props": {
175
+ "images": {
176
+ "all": {
177
+ "isDynamic": true,
178
+ "shape": "",
179
+ "url": "TEE3-0003/UPLOADS/GROUP/1758084156233.jpg",
180
+ "alt": "Text"
181
+ }
182
+ },
183
+ "mode": {
184
+ "web": {
185
+ "borderRadius": 0,
186
+ "width": "auto",
187
+ "height": "auto"
188
+ },
189
+ "mobileweb": {
190
+ "borderRadius": 0,
191
+ "width": "auto",
192
+ "height": "auto"
193
+ },
194
+ "mobileapp": {
195
+ "borderRadius": 0,
196
+ "width": "auto",
197
+ "height": "auto"
198
+ },
199
+ "tablet": {
200
+ "borderRadius": 0,
201
+ "width": "auto",
202
+ "height": "auto"
203
+ }
204
+ },
205
+ "linktype": "NONE",
206
+ "link": {
207
+ "url": "",
208
+ "target": "_blank"
209
+ },
210
+ "product": {
211
+ "_id": "",
212
+ "code": "",
213
+ "pd_type": "VARIANT"
214
+ },
215
+ "page": {
216
+ "_id": "",
217
+ "code": "",
218
+ "pg_type": "GENERAL",
219
+ "facet_params": [],
220
+ "track_params": []
221
+ },
222
+ "tag": {
223
+ "_id": "",
224
+ "code": "",
225
+ "tagtype": "PRODUCT"
226
+ },
227
+ "type": []
228
+ },
229
+ "type": [
230
+ {
231
+ "id": null
232
+ }
233
+ ]
234
+ }
235
+ ]
236
+ }
237
+ ]
238
+ }
239
+ ]
240
+ ```
241
+
242
+
243
+
244
+ ## 📄 License
245
+
246
+ This project is licensed under the MIT License.
247
+
248
+ ## 🐛 Issues and Support
249
+
250
+ If you encounter any issues or have questions, please create an issue on GitHub with detailed information about your problem.
251
+
252
+ ---
253
+
254
+ Built for developers who need dynamic page rendering capabilities.
255
+ =======
@@ -0,0 +1,5 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ declare const Page: ({ data }: any) => react_jsx_runtime.JSX.Element;
4
+
5
+ export { Page as default };