@voxket-ai/events-sdk 1.0.3 → 1.0.5

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.
package/README.md CHANGED
@@ -126,6 +126,51 @@ Use `EventWidgetClient` to mount and manage the widget programmatically:
126
126
 
127
127
  ---
128
128
 
129
+ ### 3. Abstract Submission Page
130
+
131
+ Set `isAbstract: true` to render a dedicated abstract page. It uses the same form types and form UI as registration.
132
+
133
+ - **No Attendee Login tab.** The page shows only the form types.
134
+ - **Review fields are shown.** Fields with `is_review: true` or `false` both appear. Review fields get a card that takes either a file or text, one at a time (**Send text only** / **Send file** toggle).
135
+ - **Review uploads authenticate by email.** They go to `POST /api/portal/{slug}/me/submissions/` with the email entered in the form; no bearer token is sent.
136
+ - **The submit call carries a flag.** The form posts to the registration submit API with `accept_review_file: true`, and draft saves send the same flag.
137
+ - **After submitting:** a "Submitted" screen with a **Submit Again** button. There is no payment step.
138
+
139
+ **React**
140
+
141
+ ```tsx
142
+ <EventWidget
143
+ config={{
144
+ eventSlug: 'fogsi-yuva_2026',
145
+ baseUrl: 'https://api.voxket.com',
146
+ displayMode: 'widget', // full-page
147
+ isAbstract: true,
148
+ theme: { primaryColor: '#c026d3' },
149
+ onEvent: (name, payload) => console.log(name, payload),
150
+ onError: (err) => console.error(err.message),
151
+ }}
152
+ />
153
+ ```
154
+
155
+ **Vanilla JS**
156
+
157
+ ```js
158
+ const client = new EventWidgetClient({
159
+ eventSlug: 'fogsi-yuva_2026',
160
+ baseUrl: 'https://api.voxket.com',
161
+ displayMode: 'fullscreen',
162
+ isAbstract: true,
163
+ });
164
+ client.mount('voxket-widget-container');
165
+
166
+ // Switch an existing widget between registration and abstract
167
+ // client.updateConfig({ isAbstract: false });
168
+ ```
169
+
170
+ To host both pages, render one widget per page (or route) and set `isAbstract` on the abstract one only.
171
+
172
+ ---
173
+
129
174
  ## Configuration Reference (`WidgetConfig`)
130
175
 
131
176
  All available options for the `WidgetConfig` object:
@@ -141,6 +186,9 @@ All available options for the `WidgetConfig` object:
141
186
  | `theme.primaryColor` | `string` | `'#2563eb'` | Brand color used for primary buttons, tabs, highlights, and headers. |
142
187
  | `theme.fontFamily` | `string` | System font | Custom font family CSS string (e.g. `'Inter, sans-serif'`). |
143
188
  | `theme.mode` | `'light' \| 'dark' \| 'blue' \| 'white' \| 'custom'` | `'light'` | Preset theme mode alias. |
189
+ | `isAbstract` | `boolean` | `false` | Abstract submission page: no attendee login, shows `is_review` fields, adds `accept_review_file: true` on submit. See [Abstract Submission Page](#3-abstract-submission-page). |
190
+ | `headerBannerImage` | `string` | `undefined` | Banner image on the right of the top header, scaled to the header's height; its left edge fades into the header's theme-color gradient. See [Banner & Background Images](#banner--background-images). |
191
+ | `backgroundImage` | `string` | `undefined` | Faded background image behind the form-types list, the form page and the attendee login/portal. It stays still while content scrolls. See [Banner & Background Images](#banner--background-images). |
144
192
  | `width` | `string` | `undefined` | Custom width override (e.g. `'500px'`, `'100%'`). |
145
193
  | `height` | `string` | `undefined` | Custom height override (e.g. `'700px'`, `'650px'`). |
146
194
  | `timeoutMs` | `number` | `120000` *(2 min)* | Network request timeout in milliseconds before triggering `onError`. |
@@ -150,6 +198,18 @@ All available options for the `WidgetConfig` object:
150
198
  | `onError` | `(error: WidgetErrorPayload) => void` | `undefined` | Callback fired on validation, submission, network, or schema load errors. |
151
199
  | `onEvent` | `(eventName: string, payload: any) => void` | `undefined` | Optional generic event bus for internal widget lifecycle events. |
152
200
 
201
+ **Common `onEvent` names:**
202
+
203
+ | Event | When it fires |
204
+ | :--- | :--- |
205
+ | `form_loaded` | The form schema has loaded. |
206
+ | `draft_saved` | Form progress was auto-saved. |
207
+ | `submitted` | The form was submitted (registration or abstract). |
208
+ | `review_submission_uploaded` | A review field was submitted from the abstract page. |
209
+ | `portal_submission_uploaded` | A review field was submitted from the attendee portal. |
210
+ | `portal_file_deleted` | The attendee deleted an uploaded file in the portal. |
211
+ | `attendee_profile_loaded` | The attendee portal profile has loaded. |
212
+
153
213
  ---
154
214
 
155
215
  ## Event Callbacks & Toast Notifications
@@ -252,6 +312,29 @@ const config: WidgetConfig = {
252
312
 
253
313
  ---
254
314
 
315
+ ## Banner & Background Images
316
+
317
+ ```typescript
318
+ const config: WidgetConfig = {
319
+ eventSlug: 'fogsi-yuva_2026',
320
+ baseUrl: 'https://api.voxket.com',
321
+ theme: { primaryColor: '#c026d3' },
322
+ headerBannerImage: 'https://i.postimg.cc/Hk02BDTh/image.png',
323
+ backgroundImage: 'https://i.postimg.cc/DZmb4dtH/Screenshot-2026-09-24-200659.png',
324
+ };
325
+ ```
326
+
327
+ | Prop | Where it shows | Behaviour |
328
+ | :--- | :--- | :--- |
329
+ | `headerBannerImage` | Right side of the top header, on every view (registration, attendee login, abstract) | Scaled to the header's height and never makes the header taller. Its left edge fades into the header gradient. Uses at most 65% of the header width; on narrow screens the image is cropped from the left. |
330
+ | `backgroundImage` | Behind the form-types list, the form page and the attendee login/portal | Covered by a page-colored overlay so content stays readable; the overlay follows `themeMode` (light or dark). Stays still while content scrolls. Cards and form inputs keep their normal colors. |
331
+
332
+ - The header always uses a theme-color gradient, whether or not a banner is set.
333
+ - The tabs row is not affected by either image; it keeps the light/dark theme color.
334
+ - Both images are optional. Leave them out for a plain gradient header and a solid page background.
335
+
336
+ ---
337
+
255
338
  ## Client API Methods (`EventWidgetClient`)
256
339
 
257
340
  When using the vanilla JavaScript / non-React API:
@@ -8,7 +8,6 @@ interface AttendeePortalProps {
8
8
  logger: Logger;
9
9
  primaryColor: string;
10
10
  isDark?: boolean;
11
- backgroundImage?: string;
12
11
  isWidgetPage?: boolean;
13
12
  onEvent?: (eventName: string, payload: any) => void;
14
13
  onError?: (error: any) => void;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare const DynamicForm: ({ schema, onSubmit, onBack, theme, displayMode, isExpanded, onToggleExpand, onClose, onChange, initialValues, isDark, apiClient, storage, onError, onEvent, backgroundImage, ticketType, showReviewFields, }: any) => React.JSX.Element;
2
+ export declare const DynamicForm: ({ schema, onSubmit, onBack, theme, displayMode, isExpanded, onToggleExpand, onClose, onChange, initialValues, isDark, apiClient, storage, onError, onEvent, backgroundStyle, ticketType, showReviewFields, }: any) => React.JSX.Element;
@@ -1,60 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type WidgetConfig, type WidgetPosition } from '../types';
3
- export declare const FALLBACK_FORM_TYPES: {
4
- id: number;
5
- type: string;
6
- name: string;
7
- category: string;
8
- price: number;
9
- currency: string;
10
- tax_info: string;
11
- description: string;
12
- perks: string[];
13
- seats_left: string;
14
- valid_till: string;
15
- form_schema: {
16
- title: string;
17
- review_fields: {
18
- id: string;
19
- submission: {
20
- reviewer: string;
21
- };
22
- }[];
23
- fields: ({
24
- id: string;
25
- label: string;
26
- type: string;
27
- options: string[];
28
- required: boolean;
29
- placeholder?: undefined;
30
- description?: undefined;
31
- } | {
32
- id: string;
33
- label: string;
34
- type: string;
35
- required: boolean;
36
- placeholder: string;
37
- options?: undefined;
38
- description?: undefined;
39
- } | {
40
- id: string;
41
- label: string;
42
- type: string;
43
- required: boolean;
44
- placeholder: string;
45
- description: string;
46
- options?: undefined;
47
- } | {
48
- id: string;
49
- label: string;
50
- type: string;
51
- required: boolean;
52
- description: string;
53
- options?: undefined;
54
- placeholder?: undefined;
55
- })[];
56
- };
57
- }[];
58
3
  export type Corner = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
59
4
  export declare function normalizePosition(pos?: WidgetPosition): Corner;
60
5
  export declare const getCornerStyle: (corner: Corner) => React.CSSProperties;