rasp-feedback 1.0.2 → 1.0.4

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 (32) hide show
  1. package/dist/nextjs/components/MainViewHandler.d.ts +10 -0
  2. package/dist/nextjs/components/MainViewHandler.d.ts.map +1 -0
  3. package/dist/nextjs/components/MainViewHandler.js +17 -0
  4. package/dist/nextjs/components/PostItem.d.ts +7 -0
  5. package/dist/nextjs/components/PostItem.d.ts.map +1 -0
  6. package/dist/nextjs/components/PostItem.js +56 -0
  7. package/dist/nextjs/components/Posttem.d.ts +7 -0
  8. package/dist/nextjs/components/Posttem.d.ts.map +1 -0
  9. package/dist/nextjs/components/Posttem.js +14 -0
  10. package/dist/nextjs/components/RaspForm.d.ts.map +1 -1
  11. package/dist/nextjs/components/RaspForm.js +35 -12
  12. package/dist/nextjs/components/RaspProvider.d.ts.map +1 -1
  13. package/dist/nextjs/components/RaspProvider.js +346 -100
  14. package/dist/nextjs/components/StaticFormComponent.d.ts.map +1 -1
  15. package/dist/nextjs/components/StaticFormComponent.js +73 -24
  16. package/dist/nextjs/functions/functionsexp.d.ts +3 -0
  17. package/dist/nextjs/functions/functionsexp.d.ts.map +1 -1
  18. package/dist/nextjs/functions/functionsexp.js +71 -0
  19. package/dist/vue/components/PostItem.vue.d.ts +13 -0
  20. package/dist/vue/components/PostItem.vue.d.ts.map +1 -0
  21. package/dist/vue/components/RaspForm.vue.d.ts.map +1 -1
  22. package/dist/vue/components/RaspProvider.vue.d.ts.map +1 -1
  23. package/dist/vue/components/Skeleton.vue.d.ts.map +1 -1
  24. package/dist/vue/components/StaticFormComponent.vue.d.ts +3 -3
  25. package/dist/vue/components/StaticFormComponent.vue.d.ts.map +1 -1
  26. package/dist/vue/functions/functionsexp.d.ts +3 -0
  27. package/dist/vue/functions/functionsexp.d.ts.map +1 -1
  28. package/dist/vue/index.css +1 -1
  29. package/dist/vue/index.js +978 -440
  30. package/dist/vue/index.umd.cjs +1 -1
  31. package/dist/vue/rasp-feedback.css +1 -0
  32. package/package.json +97 -97
@@ -1,48 +1,63 @@
1
1
  'use client'; // Important for Next.js App Router
2
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useEffect, useState } from 'react';
4
4
  { /*@ts-ignore*/ }
5
- import { getFormByDomainOrCompany, getBrandTheme, getFormTheme } from '../functions/functionsexp';
5
+ import { getFormByDomainOrCompany, getBrandTheme, getFormTheme, getBoardPosts, upvoteBoardPost, downvoteBoardPost } from '../functions/functionsexp';
6
6
  import { MessageSquare } from 'lucide-react';
7
7
  import "../index.css";
8
8
  import StaticFormComponent from './StaticFormComponent';
9
9
  import Skeleton from './Skeleton';
10
10
  import { fontMap } from '../constants/fontexp';
11
11
  import { RASP_LOGO_BASE64 } from '../constants/baserasplogo';
12
+ import { CircleArrowUp, CircleArrowDown, MessageCircle } from 'lucide-react';
13
+ import PostItem from './PostItem';
12
14
  export const RaspProvider = ({ children, launcherPosition }) => {
13
15
  const [companyId, setCompanyId] = useState(null);
14
16
  const [currentUrl, setCurrentUrl] = useState('');
15
17
  const [form, setForm] = useState(null);
16
18
  const [fields, setFields] = useState(null);
17
19
  const [mainTheme, setMainTheme] = useState(null);
18
- const [showForm, setShowForm] = useState(false);
19
- const [isLoading, setIsLoading] = useState(true);
20
- const [showFormSkeleton, setShowFormSkeleton] = useState(false);
21
- useEffect(() => {
22
- if (typeof window === 'undefined')
23
- return;
24
- if (!document.getElementById('rasp-google-fonts')) {
25
- const link = document.createElement('link');
26
- link.id = 'rasp-google-fonts';
27
- link.rel = 'stylesheet';
28
- link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@600&family=Roboto:wght@600&family=Poppins:wght@800&family=Wix+Madefor+Text:wght@400&family=Montserrat:wght@600&family=Nunito:wght@600&family=Open+Sans:wght@600&family=Lato:wght@700&family=Work+Sans:wght@600&family=Source+Sans+3:wght@600&family=Rubik:wght@600&family=Playfair+Display:wght@700&family=Raleway:wght@700&family=DM+Serif+Display&family=Oswald:wght@600&family=Bebas+Neue&family=Merriweather:wght@700&family=Libre+Baskerville:wght@700&family=Cormorant+Garamond:wght@600&family=JetBrains+Mono:wght@600&family=Fira+Code:wght@600&display=swap';
29
- document.head.appendChild(link);
30
- }
31
- }, []);
20
+ const [showController, setShowController] = useState(false);
21
+ const [showFeedbackModal, setShowFeedbackModal] = useState(false);
22
+ const [showBoardModal, setShowBoardModal] = useState(false);
23
+ const [isLoadingFeedbackModal, setIsLoadingFeedbackModal] = useState(false);
24
+ const [isLoadingBoardModal, setIsLoadingBoardModal] = useState(false);
25
+ const [showFeedbackModalSkeleton, setShowFeedbackModalSkeleton] = useState(false);
26
+ const [showBoardModalSkeleton, setShowBoardModalSkeleton] = useState(false);
27
+ const [posts, setPosts] = useState(null);
28
+ const [showVoteUI, setShowVoteUI] = useState(false);
29
+ const [currentPost, setCurrentPost] = useState(null);
30
+ const [isMobile, setIsMobile] = useState(false);
32
31
  const getForm = async () => {
33
- setIsLoading(true);
32
+ setIsLoadingFeedbackModal(true);
34
33
  const f = await getFormByDomainOrCompany(companyId, currentUrl);
35
34
  if (!f) {
36
35
  setForm(f);
37
- setIsLoading(false);
36
+ setIsLoadingFeedbackModal(false);
38
37
  return;
39
38
  }
40
39
  setForm(f[0]);
41
40
  };
41
+ const getPosts = async () => {
42
+ setIsLoadingBoardModal(true);
43
+ const p = await getBoardPosts(companyId);
44
+ if (p) {
45
+ setPosts(p);
46
+ setIsLoadingBoardModal(false);
47
+ return;
48
+ }
49
+ };
42
50
  useEffect(() => {
43
51
  if (typeof window !== 'undefined') {
44
52
  setCompanyId(process.env.NEXT_PUBLIC_RASP_COMPANY_ID);
45
53
  setCurrentUrl(window.location.href);
54
+ // Check if mobile
55
+ const checkMobile = () => {
56
+ setIsMobile(window.innerWidth <= 768);
57
+ };
58
+ checkMobile();
59
+ window.addEventListener('resize', checkMobile);
60
+ return () => window.removeEventListener('resize', checkMobile);
46
61
  }
47
62
  }, []);
48
63
  useEffect(() => {
@@ -52,110 +67,341 @@ export const RaspProvider = ({ children, launcherPosition }) => {
52
67
  if (form.usebrandtheme === true) {
53
68
  getBrandTheme(companyId).then((brandTheme) => {
54
69
  setMainTheme(brandTheme);
70
+ setShowFeedbackModalSkeleton(false);
55
71
  });
56
72
  }
57
73
  if (form.usebrandtheme === false) {
58
74
  getFormTheme(form.formId).then((formTheme) => {
59
75
  setMainTheme(formTheme);
76
+ setShowFeedbackModalSkeleton(false);
60
77
  });
61
78
  }
62
79
  }
63
80
  }
64
81
  }, [form]);
65
- return (_jsxs("div", { children: [children, form && _jsx(_Fragment, { children: showForm && form.active && mainTheme && fields && _jsx("div", { id: "rasp-form-div", style: {
66
- position: "fixed",
67
- top: "15%",
68
- left: "60%",
69
- zIndex: 1000000000000000,
70
- padding: 0,
71
- margin: 0,
72
- border: 0,
73
- background: "transparent",
74
- width: "auto",
75
- height: "auto",
76
- display: "inline-block",
77
- transform: "translate(-50%, -25%)",
78
- overflow: "visible"
79
- }, children: _jsx(StaticFormComponent, { form: form, mainTheme: mainTheme, fields: fields }) }) }), !isLoading && !form && _jsxs("div", { style: {
80
- position: "fixed",
81
- top: "19%",
82
- left: "60%",
83
- zIndex: 1000000000000000,
82
+ useEffect(() => {
83
+ if (typeof window === 'undefined')
84
+ return;
85
+ if (!document.getElementById('rasp-google-fonts')) {
86
+ const link = document.createElement('link');
87
+ link.id = 'rasp-google-fonts';
88
+ link.rel = 'stylesheet';
89
+ link.href = 'https://fonts.googleapis.com/css2?family=Inter:wght@600&family=Roboto:wght@600&family=Poppins:wght@800&family=Wix+Madefor+Text:wght@400&family=Montserrat:wght@600&family=Nunito:wght@600&family=Open+Sans:wght@600&family=Lato:wght@700&family=Work+Sans:wght@600&family=Source+Sans+3:wght@600&family=Rubik:wght@600&family=Playfair+Display:wght@700&family=Raleway:wght@700&family=DM+Serif+Display&family=Oswald:wght@600&family=Bebas+Neue&family=Merriweather:wght@700&family=Libre+Baskerville:wght@700&family=Cormorant+Garamond:wght@600&family=JetBrains+Mono:wght@600&family=Fira+Code:wght@600&display=swap';
90
+ document.head.appendChild(link);
91
+ }
92
+ }, []);
93
+ async function VoteFor(boardPostConvexId, vote) {
94
+ try {
95
+ const voteKey = `voted_${boardPostConvexId}`;
96
+ if (localStorage.getItem(voteKey)) {
97
+ alert("You already voted. Please view other features");
98
+ setShowVoteUI(false);
99
+ setCurrentPost(null);
100
+ return;
101
+ }
102
+ let result;
103
+ if (vote === true) {
104
+ result = await upvoteBoardPost(boardPostConvexId);
105
+ }
106
+ else if (vote === false) {
107
+ result = await downvoteBoardPost(boardPostConvexId);
108
+ }
109
+ // Only mark as voted if the API call succeeded
110
+ if (result) {
111
+ localStorage.setItem(voteKey, vote ? 'up' : 'down');
112
+ }
113
+ setShowVoteUI(false);
114
+ setCurrentPost(null);
115
+ await getPosts();
116
+ }
117
+ catch (error) {
118
+ console.error("Error in VoteFor:", error);
119
+ // If vote fails, localStorage won't be set, so user can retry
120
+ }
121
+ }
122
+ // Responsive positioning helpers
123
+ const getModalPosition = () => {
124
+ if (isMobile) {
125
+ return {
126
+ position: "fixed",
127
+ top: "50%",
128
+ left: "50%",
129
+ transform: "translate(-50%, -50%)",
130
+ zIndex: 1000000000000000,
131
+ padding: 0,
132
+ margin: 0,
133
+ border: 0,
134
+ background: "transparent",
135
+ width: "auto",
136
+ height: "auto",
137
+ display: "inline-block",
138
+ overflow: "visible"
139
+ };
140
+ }
141
+ return {
142
+ position: "fixed",
143
+ bottom: "8%",
144
+ right: "3%",
145
+ zIndex: 1000000000000000,
146
+ padding: 0,
147
+ margin: 0,
148
+ border: 0,
149
+ background: "transparent",
150
+ width: "auto",
151
+ height: "auto",
152
+ display: "inline-block",
153
+ transform: "translate(-50%, -25%)",
154
+ overflow: "visible"
155
+ };
156
+ };
157
+ const getBoardModalPosition = () => {
158
+ if (isMobile) {
159
+ return {
160
+ width: "90vw",
161
+ maxWidth: "470px",
162
+ height: "70vh",
163
+ maxHeight: "500px",
164
+ position: "fixed",
165
+ border: "2px solid black",
166
+ borderRadius: "20px",
167
+ alignItems: "center",
168
+ top: "50%",
169
+ left: "50%",
170
+ transform: "translate(-50%, -50%)",
171
+ zIndex: 1000000000000000,
172
+ backgroundColor: "white",
173
+ boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
174
+ overflow: "hidden"
175
+ };
176
+ }
177
+ return {
178
+ width: "470px",
179
+ height: "400px",
180
+ position: "fixed",
181
+ border: "2px solid black",
182
+ borderRadius: "20px",
183
+ alignItems: "center",
184
+ top: "22%",
185
+ left: "61%",
186
+ zIndex: 1000000000000000,
187
+ backgroundColor: "white",
188
+ boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)',
189
+ overflow: "hidden"
190
+ };
191
+ };
192
+ const getControllerPosition = () => {
193
+ if (isMobile) {
194
+ return {
195
+ border: "2px solid black",
196
+ borderWidth: "1px",
197
+ borderRadius: "30px",
198
+ width: "220px",
199
+ height: "40px",
200
+ zIndex: 100000000000000,
201
+ padding: "10px",
202
+ display: "flex",
203
+ flexDirection: "row",
204
+ backgroundColor: "white",
205
+ position: "fixed",
206
+ gap: "10px",
207
+ bottom: "80px",
208
+ left: "50%",
209
+ transform: "translateX(-50%)"
210
+ };
211
+ }
212
+ return {
213
+ border: "2px solid black",
214
+ borderWidth: "1px",
215
+ borderRadius: "30px",
216
+ width: "240px",
217
+ height: "40px",
218
+ zIndex: 100000000000000,
219
+ padding: "10px",
220
+ display: "flex",
221
+ flexDirection: "row",
222
+ backgroundColor: "white",
223
+ position: "fixed",
224
+ gap: "10px",
225
+ top: "84%",
226
+ left: "77%"
227
+ };
228
+ };
229
+ const getLauncherPosition = () => {
230
+ if (isMobile) {
231
+ return {
232
+ backgroundColor: "white",
233
+ padding: 15,
234
+ borderWidth: 1,
235
+ borderColor: "black",
236
+ borderRadius: "100%",
237
+ width: "50px",
238
+ height: "50px",
239
+ position: "fixed",
240
+ zIndex: 1000000000000000,
241
+ cursor: "pointer",
242
+ bottom: "20px",
243
+ right: "20px"
244
+ };
245
+ }
246
+ return {
247
+ backgroundColor: "white",
248
+ padding: 15,
249
+ borderWidth: 1,
250
+ borderColor: "black",
251
+ borderRadius: "100%",
252
+ width: "50px",
253
+ height: "50px",
254
+ position: "fixed",
255
+ zIndex: 1000000000000000,
256
+ cursor: "pointer",
257
+ top: launcherPosition ? launcherPosition.top : "89%",
258
+ left: launcherPosition ? launcherPosition.left : "95%"
259
+ };
260
+ };
261
+ return (_jsxs("div", { children: [children, showFeedbackModal && form && !isLoadingFeedbackModal && form.active && mainTheme && fields &&
262
+ _jsx("div", { id: "rasp-form-div", style: getModalPosition(), children: _jsx(StaticFormComponent, { form: form, mainTheme: mainTheme, fields: fields }) }), !isLoadingFeedbackModal && showFeedbackModal && !form && _jsxs("div", { style: {
263
+ ...getModalPosition(),
84
264
  display: 'flex',
85
265
  flexDirection: 'column',
86
266
  alignItems: 'center',
87
267
  borderRadius: '0.75rem',
88
268
  backgroundColor: 'white',
89
- margin: '1.25rem',
90
- width: '470px',
91
- minHeight: '400px',
269
+ margin: isMobile ? '1rem' : '1.25rem',
270
+ width: isMobile ? '90vw' : '470px',
271
+ maxWidth: '470px',
272
+ minHeight: isMobile ? '300px' : '300px',
92
273
  border: '1px solid black',
93
274
  padding: '1rem',
94
275
  boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)'
95
- }, children: [_jsx("br", {}), _jsx("br", {}), _jsx("img", { src: RASP_LOGO_BASE64, width: "150px", height: "150px", alt: "rasp logo" }), _jsx("h1", { className: `${fontMap.poppins.className}`, children: "404" }), _jsx("h2", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: !companyId ? "CompanyId is not provided. Please provide companyId in your env file." : "No forms found for this URL." }), !companyId && _jsxs("p", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: [" Refer to Rasp docs for help: ", _jsx("a", { href: 'https://tryrasp.online/docs', style: { textDecoration: "underline" }, children: "https://tryrasp.online/docs" })] }), companyId && _jsxs("p", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: [" Set this as your form domain url: ", currentUrl] })] }), isLoading && showFormSkeleton && !form && !mainTheme &&
96
- _jsx("div", { id: "rasp-form-div", style: {
97
- position: "fixed",
98
- top: "18%",
99
- left: "60%",
100
- zIndex: 1000000000000000,
101
- padding: 0,
102
- margin: 0,
103
- border: 0,
104
- background: "transparent",
105
- width: "auto",
106
- height: "auto",
107
- display: "inline-block",
108
- transform: "translate(-50%, -25%)",
109
- overflow: "visible"
110
- }, children: _jsx("div", { style: {
276
+ }, children: [_jsx("br", {}), _jsx("br", {}), _jsx("img", { src: RASP_LOGO_BASE64, width: "150px", height: "150px", alt: "rasp logo" }), _jsx("h1", { className: `${fontMap.poppins.className}`, children: "404" }), _jsx("h2", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: !companyId ? "CompanyId is not provided. Please provide companyId in your env file." : "No forms found for this URL." }), !companyId && _jsxs("p", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: [" Refer to Rasp docs for help: ", _jsx("a", { href: 'https://www.tryrasp.online/docs', style: { textDecoration: "underline" }, children: "https://www.tryrasp.online/docs" })] }), companyId && _jsxs("p", { className: `${fontMap.wixmadefor.className}`, style: { textAlign: 'center' }, children: [" Set this as your form domain url: ", currentUrl] })] }), isLoadingFeedbackModal && showFeedbackModalSkeleton && !form && !mainTheme &&
277
+ _jsx("div", { id: "rasp-form-div", style: getModalPosition(), children: _jsx("div", { style: {
111
278
  display: 'flex',
112
279
  flexDirection: "column",
113
280
  justifyContent: 'center',
114
- borderRadius: '0.75rem',
115
281
  backgroundColor: "white",
116
- margin: '1.25rem',
117
- width: '470px',
118
- minHeight: '400px',
119
- border: '1px solid whitesmoke',
282
+ margin: isMobile ? '1rem' : '1.25rem',
283
+ width: isMobile ? '90vw' : '470px',
284
+ maxWidth: '470px',
285
+ height: 'auto',
286
+ border: "2px solid black",
287
+ borderRadius: "20px",
120
288
  padding: '2rem',
121
289
  paddingTop: "0px"
122
- }, children: _jsxs("div", { style: { marginTop: "-30px" }, children: [_jsx(Skeleton, { width: 400, height: 40 }), _jsx(Skeleton, { width: 400, height: 30 }), _jsx("br", {}), _jsx(Skeleton, { width: 400, height: 70 }), _jsx(Skeleton, { width: 400, height: 100 })] }) }) }), _jsx("div", { id: "rasp-launcher", onClick: () => {
123
- if (!currentUrl.trim() || !companyId)
124
- return;
125
- // If the form is visible, play exit animation then hide
126
- if (showForm) {
127
- const el = document.getElementById('rasp-form-div');
128
- if (el) {
129
- el.classList.add('rasp-exit');
130
- // match animation duration (250ms) + small buffer
131
- setTimeout(() => {
132
- setShowForm(false);
133
- el.classList.remove('rasp-exit');
134
- }, 300);
135
- return;
136
- }
137
- // fallback: just hide
138
- setShowForm(false);
139
- return;
140
- }
141
- setIsLoading(true);
142
- setShowFormSkeleton(true);
143
- // If the form is not visible, fetch then show it
144
- getForm().then(() => {
145
- setShowForm(true);
146
- setIsLoading(false);
147
- setShowFormSkeleton(false);
148
- });
149
- }, style: {
150
- backgroundColor: "white",
151
- padding: 15,
152
- borderWidth: 1,
153
- borderColor: "black",
154
- borderRadius: "100%",
155
- position: "fixed",
156
- zIndex: 1000000000000000,
157
- cursor: "pointer",
158
- top: launcherPosition ? launcherPosition.top : "90%",
159
- left: launcherPosition ? launcherPosition.left : "95%"
160
- }, children: _jsx(MessageSquare, { color: 'black', size: 20 }) })] }));
290
+ }, children: _jsxs("div", { children: [_jsx("br", {}), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 400) : 400, height: 40 }), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 400) : 400, height: 30 }), _jsx("br", {}), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 400) : 400, height: 70 }), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 400) : 400, height: 100 })] }) }) }), showBoardModalSkeleton && showBoardModal &&
291
+ _jsxs("div", { style: {
292
+ display: "flex",
293
+ flexDirection: "column",
294
+ gap: "5px",
295
+ width: isMobile ? "90vw" : "470px",
296
+ maxWidth: "470px",
297
+ height: isMobile ? "70vh" : "400px",
298
+ maxHeight: "500px",
299
+ position: "fixed",
300
+ border: "2px solid black",
301
+ borderRadius: "20px",
302
+ alignItems: 'center',
303
+ top: isMobile ? "50%" : "22%",
304
+ left: isMobile ? "50%" : "61%",
305
+ transform: isMobile ? "translate(-50%, -50%)" : "none",
306
+ zIndex: 1000000000000000,
307
+ backgroundColor: "white"
308
+ }, children: [_jsx("br", {}), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 440) : 440, height: 70 }), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 440) : 440, height: 70 }), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 440) : 440, height: 70 }), _jsx(Skeleton, { width: isMobile ? Math.min(window.innerWidth * 0.8, 440) : 440, height: 70 })] }), showBoardModal && !isLoadingBoardModal &&
309
+ _jsxs("div", { style: getBoardModalPosition(), children: [_jsx("div", { style: {
310
+ display: "flex",
311
+ flexDirection: "column",
312
+ alignItems: "center",
313
+ justifyContent: "center",
314
+ borderBottom: "2px solid black",
315
+ height: "50px",
316
+ backgroundColor: "#9e54df",
317
+ }, children: _jsx("h1", { className: fontMap.poppins.className, style: {
318
+ color: "white",
319
+ fontSize: isMobile ? "13px" : "15px",
320
+ textAlign: "center",
321
+ padding: "0 10px"
322
+ }, children: "Vote for New Potential Features" }) }), _jsxs("div", { style: {
323
+ display: "flex",
324
+ flexDirection: "column",
325
+ gap: "5px",
326
+ margin: "10px",
327
+ height: isMobile ? "calc(70vh - 120px)" : "260px",
328
+ overflowY: "auto"
329
+ }, children: [posts && posts.length === 0 && _jsx(CircleArrowUp, { size: isMobile ? 80 : 100, color: "black", style: {
330
+ marginTop: '40px',
331
+ marginLeft: isMobile ? '30%' : '40%'
332
+ } }), posts && posts.length === 0 && _jsx("h1", { className: fontMap.poppins.className, style: {
333
+ color: 'black',
334
+ textAlign: 'center',
335
+ fontSize: isMobile ? '14px' : '16px',
336
+ marginTop: '40px',
337
+ padding: '0 10px'
338
+ }, children: "No New Features in the works at the moment. Please Check in later..." }), !showVoteUI && posts && posts.map((post, index) => (_jsx(PostItem, { post: post, setShowVoteUI: setShowVoteUI, setCurrentPost: setCurrentPost }, index))), showVoteUI && currentPost && _jsxs("div", { style: {
339
+ margin: "10px"
340
+ }, children: [_jsx("h1", { className: fontMap.poppins.className, style: {
341
+ fontSize: isMobile ? "18px" : "20px"
342
+ }, children: currentPost.title }), _jsx("h2", { className: fontMap.wixmadefor.className, style: {
343
+ fontSize: isMobile ? "13px" : "15px",
344
+ color: "gray"
345
+ }, children: currentPost.subtitle }), _jsx("p", { className: fontMap.wixmadefor.className, style: {
346
+ fontSize: isMobile ? "10px" : "11px",
347
+ marginTop: "10px"
348
+ }, children: currentPost.description })] })] }), showVoteUI && currentPost &&
349
+ _jsx("div", { style: {
350
+ height: "70px",
351
+ borderTop: "2px solid black",
352
+ display: "flex",
353
+ flexDirection: "column",
354
+ alignItems: "center",
355
+ justifyContent: "center"
356
+ }, children: _jsxs("div", { style: {
357
+ display: "flex",
358
+ flexDirection: "row",
359
+ alignItems: "center",
360
+ gap: "20px"
361
+ }, children: [_jsx("div", { title: "Upvote this feature", style: {
362
+ cursor: "pointer"
363
+ }, onClick: () => VoteFor(currentPost._id, true), children: _jsx(CircleArrowUp, { color: "#52f052", size: 30 }) }), _jsx("div", { title: "Downvote this feature", style: {
364
+ cursor: "pointer"
365
+ }, onClick: () => VoteFor(currentPost._id, false), children: _jsx(CircleArrowDown, { color: "red", size: 30 }) })] }) })] }), showController && _jsxs("div", { style: getControllerPosition(), children: [_jsxs("div", { style: {
366
+ display: "flex",
367
+ alignItems: "center",
368
+ gap: isMobile ? "5px" : "10px",
369
+ flex: 0.8,
370
+ cursor: "pointer",
371
+ }, onClick: () => {
372
+ if (!currentUrl.trim() || !companyId)
373
+ return;
374
+ setShowController(false);
375
+ setShowFeedbackModalSkeleton(true);
376
+ // If the form is not visible, fetch then show it
377
+ getForm().then(() => {
378
+ setIsLoadingFeedbackModal(false);
379
+ setShowFeedbackModal(true);
380
+ });
381
+ }, children: [_jsx(MessageCircle, { size: 15 }), _jsx("b", { className: fontMap.poppins.className, style: {
382
+ fontSize: isMobile ? "9px" : "10px"
383
+ }, children: "Feedback" })] }), _jsx("div", { style: {
384
+ width: "1px",
385
+ height: "100%",
386
+ backgroundColor: "black",
387
+ } }), _jsxs("div", { onClick: () => {
388
+ setShowController(false);
389
+ setShowBoardModalSkeleton(true);
390
+ getPosts().then(() => {
391
+ setShowBoardModalSkeleton(false);
392
+ setShowBoardModal(true);
393
+ });
394
+ }, style: {
395
+ display: "flex",
396
+ alignItems: "center",
397
+ gap: isMobile ? "5px" : "10px",
398
+ flex: 1,
399
+ cursor: "pointer",
400
+ }, children: [_jsx(CircleArrowUp, { size: 15 }), _jsx("b", { className: fontMap.poppins.className, style: {
401
+ fontSize: isMobile ? "9px" : "10px"
402
+ }, children: "Feature Vote" })] })] }), _jsx("div", { id: "rasp-launcher", onClick: () => {
403
+ setShowController(!showController);
404
+ setShowFeedbackModal(false);
405
+ setShowBoardModal(false);
406
+ }, style: getLauncherPosition(), children: _jsx(MessageSquare, { color: 'black', size: 20 }) })] }));
161
407
  };
@@ -1 +1 @@
1
- {"version":3,"file":"StaticFormComponent.d.ts","sourceRoot":"","sources":["../../../src/nextjs/components/StaticFormComponent.tsx"],"names":[],"mappings":"AAMA,iBAAS,mBAAmB,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAC,EAAC;IAAG,IAAI,EAAE,GAAG,CAAC;IAClE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;CAAC,2CAoMhB;AAED,eAAe,mBAAmB,CAAA"}
1
+ {"version":3,"file":"StaticFormComponent.d.ts","sourceRoot":"","sources":["../../../src/nextjs/components/StaticFormComponent.tsx"],"names":[],"mappings":"AAMA,iBAAS,mBAAmB,CAAC,EAAC,IAAI,EAAE,SAAS,EAAE,MAAM,EAAC,EAAC;IAAG,IAAI,EAAE,GAAG,CAAC;IAClE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;CAAC,2CAwPhB;AAED,eAAe,mBAAmB,CAAA"}