fansunited-widget-either-or 1.0.1 → 1.1.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 (40) hide show
  1. package/README.md +35 -8
  2. package/components/Accordion/Accordion.d.ts +6 -0
  3. package/components/Buttons/CopyToClipboard.d.ts +8 -0
  4. package/components/Buttons/HomeButtons.d.ts +1 -0
  5. package/components/Buttons/Sportal365/Sportal365Button.d.ts +4 -3
  6. package/components/Checkbox/CheckboxFilter.d.ts +9 -0
  7. package/components/EitherOrs/EitherOrs.d.ts +1 -0
  8. package/components/Filters/Filters.d.ts +12 -0
  9. package/components/Main.d.ts +1 -0
  10. package/components/MainLayout.d.ts +1 -0
  11. package/components/Management/Context/ContextTabs.d.ts +7 -0
  12. package/components/Management/Flags/Flags.d.ts +9 -1
  13. package/components/Management/Images/Image.d.ts +11 -0
  14. package/components/Management/Images/Images.d.ts +3 -1
  15. package/components/Management/Images/Sportal365/Sportal365Images.d.ts +3 -7
  16. package/components/Management/InformationInput/InformationInput.d.ts +0 -2
  17. package/components/Management/MainColumn.d.ts +10 -0
  18. package/components/Management/ManageEitherOr.d.ts +3 -4
  19. package/components/Management/NumberInput/NumberInput.d.ts +1 -0
  20. package/components/Management/SideBar.d.ts +12 -0
  21. package/components/Modals/ConfirmationModal.d.ts +3 -4
  22. package/components/Modals/ImageModal.d.ts +8 -0
  23. package/components/Select/ContextSelectFilter.d.ts +14 -0
  24. package/components/Select/ContextTagSelect.d.ts +9 -0
  25. package/components/Select/EitherOrSelectFilter.d.ts +12 -0
  26. package/constants/constants.d.ts +1 -1
  27. package/either-or-manager.es.js +28623 -28114
  28. package/either-or-manager.umd.js +199 -199
  29. package/factories/EitherOrFactory.d.ts +1 -1
  30. package/helpers/helpers.d.ts +8 -0
  31. package/models/Filters/EitherOrFiltersModel.d.ts +14 -0
  32. package/models/Labels/LabelsModel.d.ts +16 -4
  33. package/models/Select/GroupSelectOption.d.ts +5 -0
  34. package/models/Sportal365/Sportal365ImagesContainer.d.ts +5 -0
  35. package/package.json +1 -1
  36. package/style.css +1 -1
  37. package/components/Buttons/Sportal365/Sportal365QuestionAndOptionButton.d.ts +0 -11
  38. package/components/Management/Context/FootballEntitySelect/FootballEntitySelect.d.ts +0 -10
  39. package/components/Management/Context/SelectTagType/SelectTagType.d.ts +0 -14
  40. /package/components/{Buttons → Cards}/EitherOrsCard.d.ts +0 -0
package/README.md CHANGED
@@ -56,6 +56,7 @@ type EitherOrManagerProps = {
56
56
  sportal365Project?: string;
57
57
  sportal365Infrastructure?: 'shared' | 'betway';
58
58
  labels?: LabelsModel;
59
+ hideSignOutButton?: boolean;
59
60
  };
60
61
  ```
61
62
 
@@ -71,6 +72,8 @@ Fans United Either/Or Management Widget depends on [Fans United JS SDK](https://
71
72
 
72
73
  - `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** .
73
74
 
75
+ - `hideSignOutButton` - By default on the top left corner of the widget will be displayed a sign out button. To hide that button set this prop to **true**.
76
+
74
77
  ## Translation
75
78
 
76
79
  You can easily translate Fans United Either/Or 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:
@@ -94,6 +97,19 @@ const labels = {
94
97
  save: 'Save',
95
98
  preview: 'Preview',
96
99
  close: 'Close',
100
+ filterBy: 'Filter by:',
101
+ sortBy: 'Sort by:',
102
+ clearStatus: 'Clear status',
103
+ contextEntityTag: 'Context entity tag',
104
+ typeContextTagNamePlaceholder: 'Type context tag name...',
105
+ showMoreImages: 'Show more images',
106
+ hideMoreImages: 'Hide more images',
107
+ uploadImage: 'Upload image',
108
+ groupByStatus: 'Group by status',
109
+ copyUrl: 'Copy URL',
110
+ copied: 'Copied',
111
+ add: 'Add',
112
+ configuration: 'Configuration',
97
113
  titlePlaceholder: 'Provide a title for your Either/Or',
98
114
  description: 'Description',
99
115
  descriptionPlaceholder: 'Describe your Either/Or',
@@ -115,9 +131,9 @@ const labels = {
115
131
  more: 'More',
116
132
  less: 'Less',
117
133
  time: 'Time',
118
- timePlaceholder: 'Enter the time limit for answering questions by users. Time is in seconds',
134
+ timeDescription: 'Enter the time limit for answering questions by users. Time is in seconds',
119
135
  lives: 'Lives',
120
- livesPlaceholder: 'Enter how many lives the user will have during a game',
136
+ livesDescription: 'Enter how many lives the user will have during a game',
121
137
  points: 'Points',
122
138
  pointsDescription: 'Set the threshold of consecutive correct answers after which points are awarded and define the amount of points received from this step onwards.Valid value for correct steps is between 0-50 and for score 1-100',
123
139
  pointNumber: 'Point number',
@@ -143,7 +159,6 @@ const labels = {
143
159
  tags: 'Tags',
144
160
  entity: 'Entity',
145
161
  campaign: 'Campaign',
146
- tagNumber: 'Tag number',
147
162
  id: 'ID',
148
163
  idContentPlaceholder: 'Type the ID of your content',
149
164
  idCampaignPlaceholder: 'Type the ID of your campaign',
@@ -178,7 +193,7 @@ const labels = {
178
193
  encryptingImageErrorMessage: 'There was a problem with encrypting image before uploading it to bucket. Please try again',
179
194
  clear: 'Clear'
180
195
  searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again'
181
- searchImage: 'Search image',
196
+ searchImages: 'Search images',
182
197
  clearFromToFilterSportal365ImagesMessage: 'You have cleared from/to filter for Sportal365 search images',
183
198
  hideFilters: 'Hide filters',
184
199
  showFilters: 'Show filters',
@@ -214,6 +229,19 @@ Here is all information about **`LabelsModel`**:
214
229
  | `save` | Label for save button | Save |
215
230
  | `preview` | Label for preview button | Preview |
216
231
  | `close` | Label for close button | Close |
232
+ | `filterBy` | Label for filters container on main screen | Filter by: |
233
+ | `sortBy` | Label for sort container on main screen | Sort by: |
234
+ | `clearStatus` | Label for clear status hyperlink for status filter | Clear status |
235
+ | `contextEntityTag` | Label for input search for context entity tag in filters container | Context entity tag |
236
+ | `typeContextTagNamePlaceholder` | Placeholder for input search for context entity tag in filters container and in context side bar | Type context tag name... |
237
+ | `showMoreImages` | Label for hyperlink in images container | Show more images |
238
+ | `hideMoreImages` | Label for hyperlink in images container | Hide more images |
239
+ | `uploadImage` | Label next to upload button | Upload image |
240
+ | `groupByStatus` | Label for checkbox in sort container | Group by status |
241
+ | `copyUrl` | Label for copy url button | Copy URL |
242
+ | `copied` | Label for copy url button | Copied |
243
+ | `add` | Label for add button | Add |
244
+ | `configuration` | Label for configuration accordion | Configuration |
217
245
  | `titlePlaceholder` | Placeholder/desciption about title input field name on management screen. | Provide a title for your Either/Or |
218
246
  | `timeFormat` | Timeformat for displaying dates. Widgets uses [dayjs](https://www.npmjs.com/package/dayjs) as a date dependency. | DD.MM.YYYY, HH:mm |
219
247
  | `previous` | Label for pagination button. | Previous |
@@ -239,9 +267,9 @@ Here is all information about **`LabelsModel`**:
239
267
  | `more` | Label for more option. | More |
240
268
  | `less` | Label for less option. | Less |
241
269
  | `time` | Label for time input. | Time |
242
- | `timePlaceholder` | Placeholder for time input. | Enter the time limit for answering questions by users. Time is in seconds |
270
+ | `timeDescription` | Placeholder for time input. | Enter the time limit for answering questions by users. Time is in seconds |
243
271
  | `lives` | Label for lives input. | Lives |
244
- | `livesPlaceholder` | Placeholder for lives input. | Enter how many lives the user will have during a game |
272
+ | `livesDescription` | Placeholder for lives input. | Enter how many lives the user will have during a game |
245
273
  | `points` | Label for points. | Points |
246
274
  | `pointsDescription` | Description for points. | Set the threshold of consecutive correct answers after which points are awarded and define the amount of points received from this step onwards.Valid value for correct steps is between 0-50 and for score 1-100 |
247
275
  | `pointNumber` | Label for point container. | Point number |
@@ -268,7 +296,6 @@ Here is all information about **`LabelsModel`**:
268
296
  | `tags` | Label for context tags container. | Tags |
269
297
  | `entity` | Label for entity search in tag. | Entity |
270
298
  | `campaign` | Label for context campaign container. | Campaign |
271
- | `tagNumber` | Label for context tag container's header. | Tag number |
272
299
  | `id` | Label for ID. | ID |
273
300
  | `idContentPlaceholder` | Placeholder for ID content in context. | Type the ID of your content |
274
301
  | `idCampaignPlaceholder` | Placeholder for ID content in campaign. | Type the ID of your campaign |
@@ -284,7 +311,7 @@ Here is all information about **`LabelsModel`**:
284
311
  | `typeContentPlaceholder` | Placeholder for type content in context. | Type the content's type |
285
312
  | `previewEitherOr` | Title in preview modal. | Preview Either/Or |
286
313
  | `clear` | Label tippy clear button | Clear |
287
- | `searchImage` | Label for search image input | Search image |
314
+ | `searchImages` | Label for search image input | Search images |
288
315
  | `hideFilters` | Label for hyperlink to hide filters for image search | Hide filters |
289
316
  | `showFilters` | Label for hyperlink to show filters for image search | Show filters |
290
317
  | `dateFromTo` | Label for date from/to filter for image search | Date from/to |
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ type AccordionProps = {
3
+ title: string;
4
+ };
5
+ declare const Accordion: React.FC<AccordionProps>;
6
+ export default Accordion;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type CopyToClipboardButtonProps = {
3
+ isUrlCopied: boolean;
4
+ isDisabled: boolean;
5
+ onClick: () => void;
6
+ };
7
+ declare const CopyToClipboardButton: React.FC<CopyToClipboardButtonProps>;
8
+ export default CopyToClipboardButton;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type HomeButtonsProps = {
3
+ hideSignOutButton: boolean;
3
4
  toggleScreen: () => void;
4
5
  fansUnitedEnvironment: string;
5
6
  };
@@ -1,7 +1,8 @@
1
- import React from 'react';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import Sportal365ImagesContainerToggleModel from '../../../models/Sportal365/Sportal365ImagesContainer';
2
3
  type Sportal365ButtonProps = {
3
- toggleShowImagesContainer: () => void;
4
- isQuestionsAndOptions?: boolean;
4
+ imageNode: string;
5
+ setShowImagesContainer: Dispatch<SetStateAction<Sportal365ImagesContainerToggleModel>>;
5
6
  };
6
7
  declare const Sportal365Button: React.FC<Sportal365ButtonProps>;
7
8
  export default Sportal365Button;
@@ -0,0 +1,9 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
+ type CheckboxFilterProps = {
4
+ value: boolean;
5
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
6
+ handleResetData: () => void;
7
+ };
8
+ declare const CheckboxFilter: React.FC<CheckboxFilterProps>;
9
+ export default CheckboxFilter;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type EitherOrsProps = {
3
+ hideSignOutButton: boolean;
3
4
  fansUnitedEnvironment: string;
4
5
  };
5
6
  declare const EitherOrs: React.FC<EitherOrsProps>;
@@ -0,0 +1,12 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
+ import SelectOption from '../../models/Select/SelectOption';
4
+ type FiltersProps = {
5
+ filters: EitherOrFiltersModel;
6
+ options: SelectOption[];
7
+ setOptions: Dispatch<SetStateAction<SelectOption[]>>;
8
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
9
+ handleResetData: () => void;
10
+ };
11
+ declare const Filters: React.FC<FiltersProps>;
12
+ export default Filters;
@@ -8,6 +8,7 @@ type MainProps = {
8
8
  sportal365Project?: string;
9
9
  sportal365Infrastructure?: 'shared' | 'betway';
10
10
  labels?: LabelsModel;
11
+ hideSignOutButton?: boolean;
11
12
  };
12
13
  declare const Main: React.FC<MainProps>;
13
14
  export default Main;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  type MainLayoutProps = {
3
+ hideSignOutButton: boolean;
3
4
  fansUnitedEnvironment: string;
4
5
  };
5
6
  declare const MainLayout: React.FC<MainLayoutProps>;
@@ -0,0 +1,7 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ type ContextTabsProps = {
3
+ tabValue: string;
4
+ setTabValue: Dispatch<SetStateAction<string>>;
5
+ };
6
+ declare const ContextTabs: React.FC<ContextTabsProps>;
7
+ export default ContextTabs;
@@ -1,8 +1,16 @@
1
1
  import React, { Dispatch, SetStateAction } from 'react';
2
2
  import RequestBody from '../../../models/RequestBody/RequestBody';
3
+ import EitherOrFiltersModel from '../../../models/Filters/EitherOrFiltersModel';
4
+ export declare const flagsSelectStyles: {
5
+ control: (provided: any) => any;
6
+ clearIndicator: (provided: any) => any;
7
+ input: (provided: any) => any;
8
+ };
3
9
  type FlagsProps = {
4
10
  defaultValue: string[];
5
- setRequestBody: Dispatch<SetStateAction<RequestBody>>;
11
+ showLabel?: boolean;
12
+ setObject: Dispatch<SetStateAction<RequestBody>> | Dispatch<SetStateAction<EitherOrFiltersModel>>;
13
+ handleResetData?: () => void;
6
14
  };
7
15
  declare const Flags: React.FC<FlagsProps>;
8
16
  export default Flags;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ type ImagesProps = {
3
+ id: number;
4
+ type: 'game' | 'option';
5
+ label: string;
6
+ imageUrl: string;
7
+ imageNode: string;
8
+ onChange: (value: string, imageNode: string) => void;
9
+ };
10
+ declare const Image: React.FC<ImagesProps>;
11
+ export default Image;
@@ -2,8 +2,10 @@ import React from 'react';
2
2
  import ImagesModel from 'fansunited-sdk-esm/Core/Global/Models/Images/ImagesModel';
3
3
  import MiniGameImages from 'fansunited-sdk-esm/Core/Namespaces/MiniGames/Models/MiniGameImages';
4
4
  type ImagesProps = {
5
+ id: number;
6
+ type: 'game' | 'option';
7
+ loadedImages: ImagesModel | MiniGameImages;
5
8
  onChange: (value: string, imageCases: string) => void;
6
- loadedImages?: ImagesModel | MiniGameImages;
7
9
  };
8
10
  declare const Images: React.FC<ImagesProps>;
9
11
  export default Images;
@@ -1,13 +1,9 @@
1
1
  import React, { Dispatch, SetStateAction } from 'react';
2
+ import Sportal365ImagesContainerToggleModel from '../../../../models/Sportal365/Sportal365ImagesContainer';
2
3
  type Sportal365ImagesProps = {
3
4
  onChangeImages: (url: string) => void;
4
- type?: 'option';
5
- imageNode?: string;
6
- toggleShowImagesContainer?: () => void;
7
- setShowImagesContainer?: Dispatch<SetStateAction<{
8
- mainImage: boolean;
9
- mobileImage: boolean;
10
- }>>;
5
+ imageNode: string;
6
+ setShowImagesContainer: Dispatch<SetStateAction<Sportal365ImagesContainerToggleModel>>;
11
7
  };
12
8
  declare const Sportal365Images: React.FC<Sportal365ImagesProps>;
13
9
  export default Sportal365Images;
@@ -3,9 +3,7 @@ type InformationInputProps = {
3
3
  title: string;
4
4
  placeholder: string;
5
5
  defaultValue: string;
6
- imageNode?: string;
7
6
  onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
8
- onChangeImages?: (value: string, imageNode: string) => void;
9
7
  };
10
8
  declare const InformationInput: React.FC<InformationInputProps>;
11
9
  export default InformationInput;
@@ -0,0 +1,10 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrById from '../../models/EitherOr/EitherOrById';
3
+ type MainColumnProps = {
4
+ requestBody: EitherOrById;
5
+ setRequestBody: Dispatch<SetStateAction<EitherOrById>>;
6
+ description: string;
7
+ setDescription: Dispatch<SetStateAction<string>>;
8
+ };
9
+ declare const MainColumn: React.FC<MainColumnProps>;
10
+ export default MainColumn;
@@ -1,10 +1,9 @@
1
- import React from 'react';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
2
  import EitherOrById from '../../models/EitherOr/EitherOrById';
3
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
4
  type ManageEitherOrProps = {
4
- refetchEitherOrs: {
5
- current: boolean;
6
- };
7
5
  eitherOrById: EitherOrById | null;
6
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
8
7
  toggleScreen: () => void;
9
8
  clearEitherOrById: () => void;
10
9
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  type NumberInputProps = {
3
3
  type: 'time' | 'lives' | 'points_correct_steps' | 'points_score' | 'options_value';
4
4
  defaultValue: number;
5
+ showDescription?: boolean;
5
6
  onChange: (value: number) => void;
6
7
  };
7
8
  declare const NumberInput: React.FC<NumberInputProps>;
@@ -0,0 +1,12 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrById from '../../models/EitherOr/EitherOrById';
3
+ type SideBarProps = {
4
+ requestBody: EitherOrById;
5
+ rules: string;
6
+ adContent: string;
7
+ setRules: Dispatch<SetStateAction<string>>;
8
+ setAdContent: Dispatch<SetStateAction<string>>;
9
+ setRequestBody: Dispatch<SetStateAction<EitherOrById>>;
10
+ };
11
+ declare const SideBar: React.FC<SideBarProps>;
12
+ export default SideBar;
@@ -1,11 +1,10 @@
1
- import React from 'react';
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
2
  import EitherOrBasicModel from 'fansunited-sdk-esm/Core/Namespaces/MiniGames/Models/EitherOr/EitherOrBasicModel';
3
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
4
  type ConfirmationModalProps = {
4
5
  isOpen: boolean;
5
6
  eitherOr: EitherOrBasicModel;
6
- refetchEitherOrs: {
7
- current: boolean;
8
- };
7
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
9
8
  handleClose: () => void;
10
9
  };
11
10
  declare const ConfirmationModal: React.FC<ConfirmationModalProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ type ImageModalProps = {
3
+ imageUrl: string;
4
+ isOpen: boolean;
5
+ closeModal: () => void;
6
+ };
7
+ declare const ImageModal: React.FC<ImageModalProps>;
8
+ export default ImageModal;
@@ -0,0 +1,14 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
+ import SearchModel from 'fansunited-sdk-esm/Core/Namespaces/Football/Models/Search/SearchModel';
4
+ import GroupSelectOption from '../../models/Select/GroupSelectOption';
5
+ import SelectOption from '../../models/Select/SelectOption';
6
+ export declare const formatGroupOptions: (result: SearchModel) => GroupSelectOption[];
7
+ type ContextSelectFilterProps = {
8
+ options: SelectOption[];
9
+ setOptions: Dispatch<SetStateAction<SelectOption[]>>;
10
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
11
+ handleResetData: () => void;
12
+ };
13
+ declare const ContextSelectFilter: React.FC<ContextSelectFilterProps>;
14
+ export default ContextSelectFilter;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import SelectOption from '../../models/Select/SelectOption';
3
+ import TagsModel from 'fansunited-sdk-esm/Core/Namespaces/Activity/Models/RequestBody/Context/TagsModel';
4
+ type ContextTagSelectProps = {
5
+ tags: TagsModel[];
6
+ onChangeTags: (entities: SelectOption[]) => void;
7
+ };
8
+ declare const ContextTagSelect: React.FC<ContextTagSelectProps>;
9
+ export default ContextTagSelect;
@@ -0,0 +1,12 @@
1
+ import React, { Dispatch, SetStateAction } from 'react';
2
+ import EitherOrFiltersModel from '../../models/Filters/EitherOrFiltersModel';
3
+ type EitherOrSelectFilterProps = {
4
+ filterType: 'status' | 'sort';
5
+ defaultValue: string;
6
+ filterValues: string[];
7
+ showClearStatus?: boolean;
8
+ setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
9
+ handleResetData: () => void;
10
+ };
11
+ declare const EitherOrSelectFilter: React.FC<EitherOrSelectFilterProps>;
12
+ export default EitherOrSelectFilter;
@@ -1,4 +1,4 @@
1
1
  export declare const inputLabelStyle = "eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase eow-font-extrabold";
2
2
  export declare const inputStyle = "eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2";
3
3
  export declare const imagesMap: Map<string, string>;
4
- export declare const questionAndOptionImagesMap: Map<string, string>;
4
+ export declare const optionImagesMap: Map<string, string>;