fansunited-widget-client-configuration 1.3.0 → 1.5.0

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
@@ -48,6 +48,8 @@ type ConfigurationManagerProps = {
48
48
  fansUnitedEnvironment?: string;
49
49
  labels?: LabelsModel;
50
50
  hideSignOutButton?: boolean;
51
+ sportal365Project?: string;
52
+ sportal365Infrastructure?: 'shared' | 'betway';
51
53
  };
52
54
  ```
53
55
 
@@ -61,6 +63,10 @@ Fans United Classic Quiz Management Widget depends on [Fans United JS SDK](https
61
63
 
62
64
  - `hideSignOutButton` - By default on the top right corner of the widget will be displayed a sign out button. To hide that button set this prop to true.
63
65
 
66
+ - `sportal365Project` - The Sportal365 project. Used as a request header when communicating with Sportal365 APIs.
67
+
68
+ - `sportal365Infrastructure` - The Sportal365 infrastructure. Used to determine what authorization should be used when communicating with Sportal365 APIs. If no value given (when sportal365Project props is provided) it will be set to **shared** .
69
+
64
70
  ## Translation
65
71
 
66
72
  You can easily translate Fans United Configuration Management Widget in your language! You just need to pass an object to `labels` **prop** with concrete keys and values and that's it! Here's an example how you can do it:
@@ -71,6 +77,7 @@ import { ConfigurationManager } from 'fansunited-widget-client-configuration';
71
77
  const labels = {
72
78
  clientConfigErrorMessage: "There was a problem fetching client's configuration. Please try again",
73
79
  userNotFound: 'User not found. Please try again',
80
+ signOut: 'Sign Out',
74
81
  language: 'Language',
75
82
  profilePreferences: 'Profile Preferences',
76
83
  cacheTTL: 'Cache TTL',
@@ -79,6 +86,7 @@ const labels = {
79
86
  update: 'Update Configuration',
80
87
  configTitle: 'Configure Fans United',
81
88
  configDescription: 'Customize different features of Fans United',
89
+ configLanguageTitle: 'Language Configuration',
82
90
  defaultLanguage: 'Default language',
83
91
  defaultLanguageHelperText: 'What is the default language of your content? This field, if different from English, would be used in our translation tools.',
84
92
  availableLanguages: 'Available languages',
@@ -95,16 +103,41 @@ const labels = {
95
103
  id: 'ID',
96
104
  name: 'Name',
97
105
  addCategory: 'Add Category',
98
- preferences: preferences: 'Preferences',
106
+ preferences: 'Preferences',
99
107
  addPreference: 'Add Preference',
100
108
  selectCategories: 'Select categories for new preference',
101
109
  uniqueCategoriesIdErrorMessage: `Categories' IDs must be unique!`,
102
- uniquePreferencesIdErrorMessage: `Preferences' IDs must be unique!`
110
+ uniquePreferencesIdErrorMessage: `Preferences' IDs must be unique!`,
111
+ uploadImage: 'Upload Image',
112
+ sportal365Images: 'Sportal365 Images',
113
+ search: 'Search',
114
+ clearImage: 'Clear image',
115
+ copyUrl: 'Copy URL',
116
+ viewImage: 'View image',
117
+ cropImage: 'Crop image',
118
+ aspectRatio: 'Aspect ratio',
119
+ crop: 'Crop',
120
+ reset: 'Reset',
121
+ urlCopiedToClipboardMessage: 'URL copied to clipboard',
122
+ imageDeletedMessage: 'Image deleted',
123
+ imageResetMessage: 'The initial size of the image has been restored',
124
+ fromDate: 'From Date',
125
+ toDate: 'To Date',
126
+ uploadingImageMessage: 'You have successfully uploaded image',
127
+ uploadingImageErrorMessage: 'There was a problem with uploading image to bucket. Please try again',
128
+ generateSignedInUrlErrorMessage: 'There was a problem generating signed in URL to store the image in bucket. Please try again',
129
+ encryptingImageErrorMessage: 'There was a problem with encrypting image before uploading it to bucket. Please try again',
130
+ searchImage: 'Search image',
131
+ hideFilters: 'Hide filters',
132
+ showFilters: 'Show filters',
133
+ searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again',
134
+ previous: 'Previous',
135
+ next: 'Next'
103
136
  };
104
137
 
105
138
  const App = () => {
106
139
  return (
107
- <ClassicQuizManager
140
+ <ConfigurationManager
108
141
  fansUnitedApiKey={'your-api-key'}
109
142
  fansUnitedClientId={'your-client-id'}
110
143
  labels={labels}/>
@@ -118,6 +151,7 @@ Here is all information about **`LabelsModel`**:
118
151
  | :-------------: |:-------------:| :-----:|
119
152
  | `clientConfigErrorMessage` | Toast error message when fetching client configuration fails. | There was a problem fetching client's configuration. Please try again |
120
153
  | `userNotFound` | On login screen when client gives invalid information about email or password. | User not found. Please try again |
154
+ | `signOut` | Label for sign out button. | Sign Out |
121
155
  | `language` | Label for language tab. | Language |
122
156
  | `profilePreferences` | Label for profile preferences tab. | Profile Preferences |
123
157
  | `cacheTTL` | Label for cache TTL tab. | Cache TTL |
@@ -126,6 +160,7 @@ Here is all information about **`LabelsModel`**:
126
160
  | `update` | Label for management button. | Update Configuration |
127
161
  | `configTitle` | Title of the management screen. | Configure Fans United |
128
162
  | `configDescription` | Description of the management screen. | Customize different features of Fans United |
163
+ | `configLanguageTitle` | Title for language configuration section. | Language Configuration |
129
164
  | `defaultLanguage` | Label for default language select. | Default language |
130
165
  | `defaultLanguageHelperText` | Description for default language select. | What is the default language of your content? This field, if different from English, would be used in our translation tools. |
131
166
  | `availableLanguages` | Label for available languages group container. | Available languages |
@@ -146,4 +181,53 @@ Here is all information about **`LabelsModel`**:
146
181
  | `addPreference` | Add new preference button title | Add Preference |
147
182
  | `selectCategories` | Info text for selecting categories for new preference creation |Select categories for new preference |
148
183
  | `uniqueCategoriesIdErrorMessage` | Error validation message when new category added doesn't have unique ID | Categories' IDs must be unique! |
149
- | `uniquePreferencesIdErrorMessage` | Error validation message when new preference added doesn't have unique ID | Preferences' IDs must be unique! |
184
+ | `uniquePreferencesIdErrorMessage` | Error validation message when new preference added doesn't have unique ID | Preferences' IDs must be unique! |
185
+ | `uploadImage` | Label for upload image tab in image upload card | Upload Image |
186
+ | `sportal365Images` | Label for Sportal365 images tab in image upload card | Sportal365 Images |
187
+ | `search` | Label for search button | Search |
188
+ | `clearImage` | Label for clear image button | Clear image |
189
+ | `copyUrl` | Label for copy URL button | Copy URL |
190
+ | `viewImage` | Label for view image button | View image |
191
+ | `cropImage` | Label for crop image button | Crop image |
192
+ | `aspectRatio` | Label for aspect ratio input | Aspect ratio |
193
+ | `crop` | Label for crop button in crop modal | Crop |
194
+ | `reset` | Label for reset button in crop modal | Reset |
195
+ | `urlCopiedToClipboardMessage` | Toast success message when URL is copied to clipboard | URL copied to clipboard |
196
+ | `imageDeletedMessage` | Toast success message when image is deleted | Image deleted |
197
+ | `imageResetMessage` | Toast success message when image is reset to initial size | The initial size of the image has been restored |
198
+ | `fromDate` | Label for from date filter in Sportal365 images | From Date |
199
+ | `toDate` | Label for to date filter in Sportal365 images | To Date |
200
+ | `uploadingImageMessage` | Toast success message when image is uploaded | You have successfully uploaded image |
201
+ | `uploadingImageErrorMessage` | Toast error message when uploading image fails | There was a problem with uploading image to bucket. Please try again |
202
+ | `generateSignedInUrlErrorMessage` | Toast error message when generating signed URL fails | There was a problem generating signed in URL to store the image in bucket. Please try again |
203
+ | `encryptingImageErrorMessage` | Toast error message when encrypting image fails | There was a problem with encrypting image before uploading it to bucket. Please try again |
204
+ | `searchImage` | Placeholder for search image input | Search image |
205
+ | `hideFilters` | Label for hide filters button in Sportal365 images | Hide filters |
206
+ | `showFilters` | Label for show filters button in Sportal365 images | Show filters |
207
+ | `searchSportal365ImagesErrorMessage` | Toast error message when searching Sportal365 images fails | There was a problem with searching images from Sportal 365 API. Please try again |
208
+ | `previous` | Label for previous page button in Sportal365 images pagination | Previous |
209
+ | `next` | Label for next page button in Sportal365 images pagination | Next |
210
+
211
+ ## Changelog
212
+
213
+ ### 1.5.0 - 2025-12-23
214
+
215
+ - **Added:**
216
+ - New card container in miscellaneous configuration general settings for rules display
217
+ - Integration with Sportal365 Images API for image search and selection
218
+
219
+ - **Improved:**
220
+ - Default image configuration now supports multiple input methods (URL input or image upload)
221
+ - Clients can choose between legacy URL input behavior or new image upload functionality
222
+
223
+ ### 1.4.0 - 2025-11-29
224
+
225
+ - **Added:**
226
+ - User-Centric Widgets configuration management tab with full CRUD operations
227
+ - Multi-tab configuration form with 6 sections: General, Firebase, Theme Options, Leads, Miscellaneous, and Legacy
228
+ - Raw JSON mode toggle for advanced configuration editing
229
+ - Integrated color pickers for theme customization
230
+ - Support for light and dark mode color schemes
231
+ - Customizable spacing scales, typography, border sizes, and border radius values
232
+ - Lead form configuration with field management and country code selection
233
+ - Firebase integration settings configuration
@@ -7,6 +7,8 @@ type MainProps = {
7
7
  fansUnitedEnvironment?: string;
8
8
  labels?: LabelsModel;
9
9
  hideSignOutButton?: boolean;
10
+ sportal365Project?: string;
11
+ sportal365Infrastructure?: 'shared' | 'betway';
10
12
  };
11
13
  declare const Main: React.FC<MainProps>;
12
14
  export default Main;
@@ -0,0 +1,20 @@
1
+ import { default as React } from 'react';
2
+ interface ClientApiKey {
3
+ value: string;
4
+ label: string;
5
+ }
6
+ interface ConfigurationFormProps {
7
+ title: string;
8
+ description: string;
9
+ config: any;
10
+ clientApiKeys: ClientApiKey[];
11
+ onTitleChange: (value: string) => void;
12
+ onDescriptionChange: (value: string) => void;
13
+ onConfigChange: (config: any) => void;
14
+ onClose: () => void;
15
+ onSave: () => void;
16
+ isSubmitting: boolean;
17
+ isEditing: boolean;
18
+ }
19
+ declare const ConfigurationForm: React.FC<ConfigurationFormProps>;
20
+ export default ConfigurationForm;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface LeadsConfigurationProps {
3
+ config: any;
4
+ onConfigChange: (path: string[], value: any) => void;
5
+ getConfigValue: (path: string[], defaultValue?: any) => any;
6
+ }
7
+ declare const LeadsConfiguration: React.FC<LeadsConfigurationProps>;
8
+ export default LeadsConfiguration;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ interface LegacyConfigurationProps {
3
+ config: any;
4
+ onConfigChange: (path: string[], value: any) => void;
5
+ getConfigValue: (path: string[], defaultValue?: any) => any;
6
+ }
7
+ declare const LegacyConfiguration: React.FC<LegacyConfigurationProps>;
8
+ export default LegacyConfiguration;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface MiscConfigurationProps {
3
+ onConfigChange: (path: string[], value: any) => void;
4
+ getConfigValue: (path: string[], defaultValue?: any) => any;
5
+ }
6
+ declare const MiscConfiguration: React.FC<MiscConfigurationProps>;
7
+ export default MiscConfiguration;
@@ -0,0 +1,7 @@
1
+ import { default as React } from 'react';
2
+ interface ThemeOptionsConfigurationProps {
3
+ onConfigChange: (path: string[], value: any) => void;
4
+ getConfigValue: (path: string[], defaultValue?: any) => any;
5
+ }
6
+ declare const ThemeOptionsConfiguration: React.FC<ThemeOptionsConfigurationProps>;
7
+ export default ThemeOptionsConfiguration;
@@ -0,0 +1,3 @@
1
+ import { default as React } from 'react';
2
+ declare const UserCentricWidgets: React.FC;
3
+ export default UserCentricWidgets;
@@ -0,0 +1,182 @@
1
+ declare const defaultThemeOptions: {
2
+ mode: string;
3
+ spacingScale: {
4
+ '3xs': string;
5
+ '2xs': string;
6
+ xs: string;
7
+ sm: string;
8
+ md: string;
9
+ lg: string;
10
+ xl: string;
11
+ '2xl': string;
12
+ '3xl': string;
13
+ };
14
+ colorSchemes: {
15
+ light: {
16
+ palette: {
17
+ success: {
18
+ plainColor: string;
19
+ outlinedBorder: string;
20
+ };
21
+ danger: {
22
+ softBg: string;
23
+ plainColor: string;
24
+ outlinedBorder: string;
25
+ };
26
+ primary: {
27
+ plainColor: string;
28
+ outlinedBorder: string;
29
+ onPrimary: string;
30
+ primaryContainer: string;
31
+ };
32
+ warning: {
33
+ softBg: string;
34
+ plainColor: string;
35
+ };
36
+ neutral: {
37
+ softBg: string;
38
+ solidBg: string;
39
+ solidColor: string;
40
+ plainActiveBg: string;
41
+ outlinedBorder: string;
42
+ outlinedColor: string;
43
+ outlinedHoverBg: string;
44
+ plainHoverBg: string;
45
+ plainHoverColor: string;
46
+ plainColor: string;
47
+ solidHoverBg: string;
48
+ };
49
+ background: {
50
+ surface: string;
51
+ popup: string;
52
+ };
53
+ };
54
+ textPrimary: string;
55
+ textSecondary: string;
56
+ textColor: string;
57
+ textDisabled: string;
58
+ surface: string;
59
+ onSurface: string;
60
+ surfaceVariant: string;
61
+ surfaceTintDim: string;
62
+ surfaceInverse: string;
63
+ outlineEnabledBorder: string;
64
+ secondaryContainer: string;
65
+ };
66
+ dark: {
67
+ palette: {
68
+ primary: {
69
+ plainColor: string;
70
+ outlinedBorder: string;
71
+ onPrimary: string;
72
+ primaryContainer: string;
73
+ };
74
+ success: {
75
+ plainColor: string;
76
+ outlinedBorder: string;
77
+ };
78
+ danger: {
79
+ softBg: string;
80
+ plainColor: string;
81
+ outlinedBorder: string;
82
+ };
83
+ warning: {
84
+ softBg: string;
85
+ plainColor: string;
86
+ };
87
+ neutral: {
88
+ softBg: string;
89
+ solidBg: string;
90
+ solidColor: string;
91
+ plainActiveBg: string;
92
+ outlinedBorder: string;
93
+ outlinedColor: string;
94
+ outlinedHoverBg: string;
95
+ plainHoverBg: string;
96
+ plainHoverColor: string;
97
+ plainColor: string;
98
+ solidHoverBg: string;
99
+ };
100
+ background: {
101
+ surface: string;
102
+ popup: string;
103
+ };
104
+ };
105
+ textPrimary: string;
106
+ textSecondary: string;
107
+ textColor: string;
108
+ textDisabled: string;
109
+ surface: string;
110
+ onSurface: string;
111
+ surfaceVariant: string;
112
+ surfaceTintDim: string;
113
+ surfaceInverse: string;
114
+ outlineEnabledBorder: string;
115
+ secondaryContainer: string;
116
+ };
117
+ };
118
+ customFontFamily: {
119
+ light: {
120
+ primary: string;
121
+ secondary: string;
122
+ };
123
+ dark: {
124
+ primary: string;
125
+ secondary: string;
126
+ };
127
+ };
128
+ customRadius: {
129
+ light: {
130
+ none: string;
131
+ '2xs': string;
132
+ xs: string;
133
+ sm: string;
134
+ md: string;
135
+ lg: string;
136
+ xl: string;
137
+ '2xl': string;
138
+ full: string;
139
+ };
140
+ dark: {
141
+ none: string;
142
+ '2xs': string;
143
+ xs: string;
144
+ sm: string;
145
+ md: string;
146
+ lg: string;
147
+ xl: string;
148
+ '2xl': string;
149
+ full: string;
150
+ };
151
+ };
152
+ border: {
153
+ light: {
154
+ size: string;
155
+ };
156
+ dark: {
157
+ size: string;
158
+ };
159
+ };
160
+ imageBackgroundGradient: {
161
+ light: {
162
+ standard: string;
163
+ split: string;
164
+ };
165
+ dark: {
166
+ standard: string;
167
+ split: string;
168
+ overlay: string;
169
+ };
170
+ };
171
+ customBreakpoints: {
172
+ values: {
173
+ xs: number;
174
+ sm: number;
175
+ md: number;
176
+ lg: number;
177
+ xl: number;
178
+ xxl: number;
179
+ };
180
+ };
181
+ };
182
+ export default defaultThemeOptions;