@voxket-ai/events-sdk 1.0.1 → 1.0.3
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 +235 -55
- package/dist/api/ApiClient.d.ts +18 -1
- package/dist/components/AttendeePortal.d.ts +4 -0
- package/dist/components/DynamicForm.d.ts +1 -1
- package/dist/components/EventWidgetReact.d.ts +60 -1
- package/dist/events-sdk.js +3250 -912
- package/dist/events-sdk.umd.cjs +8 -5
- package/dist/index.d.ts +1 -1
- package/dist/types.d.ts +31 -1
- package/dist/utils/Logger.d.ts +1 -0
- package/dist/utils/formUtils.d.ts +18 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type WidgetConfig } from './types';
|
|
3
|
-
export { type WidgetConfig } from './types';
|
|
3
|
+
export { type WidgetConfig, type WidgetPosition, type ThemeMode, type RegistrationSuccessPayload, type WidgetErrorPayload } from './types';
|
|
4
4
|
export declare const EventWidget: React.FC<{
|
|
5
5
|
config: WidgetConfig;
|
|
6
6
|
}>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,14 +1,44 @@
|
|
|
1
|
+
export type WidgetPosition = 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'right-bottom' | 'left-bottom' | 'right-top' | 'left-top';
|
|
2
|
+
export type ThemeMode = 'light' | 'dark';
|
|
3
|
+
export interface RegistrationSuccessPayload {
|
|
4
|
+
registrationType: string | number;
|
|
5
|
+
payload: Record<string, any>;
|
|
6
|
+
response?: any;
|
|
7
|
+
paymentUrl?: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface WidgetErrorPayload {
|
|
10
|
+
type: 'submit_error' | 'schema_load' | 'login_error' | 'profile_update_error' | 'file_upload_error' | 'file_delete_error' | 'network_error' | string;
|
|
11
|
+
message: string;
|
|
12
|
+
error?: any;
|
|
13
|
+
}
|
|
1
14
|
export interface WidgetConfig {
|
|
2
15
|
eventSlug: string;
|
|
3
16
|
baseUrl: string;
|
|
4
17
|
displayMode?: 'popup' | 'widget' | 'fullscreen';
|
|
18
|
+
position?: WidgetPosition;
|
|
19
|
+
themeMode?: ThemeMode;
|
|
5
20
|
width?: string;
|
|
6
21
|
height?: string;
|
|
22
|
+
/** Background image URL for forms with a subtle dull look */
|
|
23
|
+
backgroundImage?: string;
|
|
7
24
|
theme?: {
|
|
8
|
-
mode?: 'blue' | 'white' | 'custom';
|
|
25
|
+
mode?: 'light' | 'dark' | 'blue' | 'white' | 'custom';
|
|
9
26
|
primaryColor?: string;
|
|
10
27
|
fontFamily?: string;
|
|
28
|
+
/** Background image URL for forms with a subtle dull look */
|
|
29
|
+
backgroundImage?: string;
|
|
11
30
|
};
|
|
12
31
|
debug?: boolean;
|
|
32
|
+
/** Abstract submission mode: shows only the form types (including is_review fields), no attendee login */
|
|
33
|
+
isAbstract?: boolean;
|
|
34
|
+
/** Request timeout in milliseconds. Defaults to 120000 (2 minutes). */
|
|
35
|
+
timeoutMs?: number;
|
|
36
|
+
/** Generic event listener for all internal events */
|
|
13
37
|
onEvent?: (eventName: string, payload: any) => void;
|
|
38
|
+
/** Fired when registration is successfully completed */
|
|
39
|
+
onRegister?: (data: RegistrationSuccessPayload) => void;
|
|
40
|
+
/** Alias for onRegister */
|
|
41
|
+
onRegistered?: (data: RegistrationSuccessPayload) => void;
|
|
42
|
+
/** Fired when an error occurs (e.g. submit error, schema load error, network failure) */
|
|
43
|
+
onError?: (error: WidgetErrorPayload) => void;
|
|
14
44
|
}
|
package/dist/utils/Logger.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for form schema and field key normalization.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Normalizes field keys when schema field IDs are auto-generated timestamps
|
|
6
|
+
* (e.g. `field_1785493567167`). Converts the field label to lowercase snake_case.
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* - id: "field_1785493567167", label: "College Name" -> "college_name"
|
|
10
|
+
* - id: "field_1785493567167", label: "State" -> "state"
|
|
11
|
+
* - id: "email", label: "Email Address" -> "email" (unchanged because id is already a standard key)
|
|
12
|
+
*/
|
|
13
|
+
export declare function normalizeFieldKey(id: string, label?: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Converts a field label to snake_case key (e.g. "File Abstract" -> "file_abstract").
|
|
16
|
+
* Falls back to normalized id or fallbackId if label is not provided.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getFieldLabelKey(label?: string, fallbackId?: string): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voxket-ai/events-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Event registration and ticketing widget SDK",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -71,4 +71,4 @@
|
|
|
71
71
|
"typescript-eslint": "^8.69.0",
|
|
72
72
|
"vite": "^8.3.0"
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|