fansunited-widget-poll 1.2.0 → 2.0.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.
Files changed (102) hide show
  1. package/README.md +122 -57
  2. package/components/Cards/PollsCard.d.ts +5 -2
  3. package/components/Cards/WidgetCard.d.ts +5 -2
  4. package/components/Filters/Filters.d.ts +3 -3
  5. package/components/Main.d.ts +2 -2
  6. package/components/MainLayout.d.ts +1 -1
  7. package/components/Management/Header.d.ts +6 -0
  8. package/components/Management/MainColumn.d.ts +5 -6
  9. package/components/Management/ManagePoll.d.ts +5 -5
  10. package/components/Management/Options/AdditionalOptionField.d.ts +9 -0
  11. package/components/Management/Options/Checkboxes.d.ts +13 -0
  12. package/components/Management/Options/Option.d.ts +14 -0
  13. package/components/Management/Options/Options.d.ts +5 -4
  14. package/components/Management/SideBar/Configuration/Configuration.d.ts +8 -0
  15. package/components/Management/SideBar/Configuration/PollStatus.d.ts +7 -0
  16. package/components/Management/{Type → SideBar/Configuration}/Type.d.ts +2 -2
  17. package/components/Management/SideBar/SideBar.d.ts +8 -0
  18. package/components/Modals/DeletePollModal.d.ts +10 -0
  19. package/components/Modals/PreviewModal.d.ts +3 -4
  20. package/components/Polls/ActionsMenu.d.ts +10 -0
  21. package/components/Polls/PollRow.d.ts +10 -0
  22. package/components/Polls/Polls.d.ts +1 -1
  23. package/components/Polls/PollsTable.d.ts +14 -0
  24. package/components/Polls/TablePagination.d.ts +10 -0
  25. package/constants/constants.d.ts +249 -4
  26. package/context/ConfigurationContext.d.ts +9 -0
  27. package/context/LabelsContext.d.ts +3 -2
  28. package/factories/PollFactory.d.ts +6 -8
  29. package/models/Features/Features.d.ts +11 -0
  30. package/models/Filters/PollFiltersModel.d.ts +3 -2
  31. package/models/Labels/LabelsModel.d.ts +58 -28
  32. package/models/RequestBody/RequestBody.d.ts +12 -3
  33. package/models/Select/SelectOption.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/poll-manager.es.d.ts +1 -0
  36. package/poll-manager.es.js +73406 -37593
  37. package/poll-manager.umd.js +544 -223
  38. package/style.css +2 -2
  39. package/validators/PollValidator.d.ts +2 -2
  40. package/components/Accordion/Accordion.d.ts +0 -6
  41. package/components/Buttons/ActionsButtons.d.ts +0 -10
  42. package/components/Buttons/AddButton.d.ts +0 -7
  43. package/components/Buttons/ClearButton.d.ts +0 -6
  44. package/components/Buttons/CopyToClipboard.d.ts +0 -8
  45. package/components/Buttons/HomeButtons.d.ts +0 -8
  46. package/components/Buttons/ManageButtons.d.ts +0 -8
  47. package/components/Buttons/RemoveButton.d.ts +0 -7
  48. package/components/Buttons/SignOutButton.d.ts +0 -6
  49. package/components/Buttons/Sportal365/Sportal365Button.d.ts +0 -8
  50. package/components/Cards/ImagesCard.d.ts +0 -6
  51. package/components/Login/Login.d.ts +0 -6
  52. package/components/Management/Branding/Branding.d.ts +0 -8
  53. package/components/Management/Branding/BrandingImages.d.ts +0 -8
  54. package/components/Management/Branding/BrandingTabs.d.ts +0 -7
  55. package/components/Management/Context/Context.d.ts +0 -9
  56. package/components/Management/Context/ContextTabs.d.ts +0 -7
  57. package/components/Management/DynamicFields/DynamicFields.d.ts +0 -8
  58. package/components/Management/Flags/Flags.d.ts +0 -16
  59. package/components/Management/IDInput/IDInput.d.ts +0 -6
  60. package/components/Management/Images/FileUploader.d.ts +0 -9
  61. package/components/Management/Images/Image.d.ts +0 -11
  62. package/components/Management/Images/Images.d.ts +0 -11
  63. package/components/Management/Images/Sportal365/Filters/Sportal365ImagesFromToFilter.d.ts +0 -7
  64. package/components/Management/Images/Sportal365/Sportal365Images.d.ts +0 -9
  65. package/components/Management/Images/Sportal365/Sportal365ImagesPagination.d.ts +0 -10
  66. package/components/Management/Images/Sportal365/Sportal365ImagesSearch.d.ts +0 -8
  67. package/components/Management/InformationInput/InformationInput.d.ts +0 -9
  68. package/components/Management/ManagementScreenHeader.d.ts +0 -8
  69. package/components/Management/NumberInput/NumberInput.d.ts +0 -8
  70. package/components/Management/Options/OptionImages.d.ts +0 -9
  71. package/components/Management/Options/OptionInput.d.ts +0 -9
  72. package/components/Management/RichText/RichText.d.ts +0 -8
  73. package/components/Management/SideBar.d.ts +0 -12
  74. package/components/Management/StatusSelect/StatusSelect.d.ts +0 -7
  75. package/components/Modals/ConfirmationModal.d.ts +0 -11
  76. package/components/Modals/ImageModal.d.ts +0 -8
  77. package/components/Pagination/Pagination.d.ts +0 -10
  78. package/components/Portals/Portal.d.ts +0 -6
  79. package/components/Select/ContextSelectFilter.d.ts +0 -14
  80. package/components/Select/ContextTagSelect.d.ts +0 -9
  81. package/components/Select/PollSelectFilter.d.ts +0 -12
  82. package/components/Spinner/ButtonSpinner.d.ts +0 -9
  83. package/components/Spinner/Spinner.d.ts +0 -3
  84. package/components/Table/TableBody.d.ts +0 -10
  85. package/components/Table/TableHeader.d.ts +0 -3
  86. package/constants/placeholders.d.ts +0 -1
  87. package/context/ApiContext.d.ts +0 -15
  88. package/context/AuthContext.d.ts +0 -8
  89. package/firebase/firebase.d.ts +0 -2
  90. package/firebase/getToken.d.ts +0 -1
  91. package/helpers/helpers.d.ts +0 -36
  92. package/models/PollById/PollById.d.ts +0 -28
  93. package/models/RequestBody/SignedInUrlRequestBody.d.ts +0 -6
  94. package/models/Select/GroupSelectOption.d.ts +0 -5
  95. package/models/Sportal365/Sportal365Config.d.ts +0 -4
  96. package/models/Sportal365/Sportal365ImagesContainer.d.ts +0 -5
  97. package/models/Sportal365/Sportal365SearchImages.d.ts +0 -21
  98. package/models/Sportal365/Sportal365SearchImagesFilters.d.ts +0 -4
  99. package/portals/ModalPortal.d.ts +0 -6
  100. package/services/HashService.d.ts +0 -4
  101. package/services/HttpsService.d.ts +0 -33
  102. package/types/types.d.ts +0 -6
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- type StatusSelectProps = {
3
- defaultValue: string;
4
- onChange: (arg: React.ChangeEvent<HTMLSelectElement>) => void;
5
- };
6
- declare const StatusSelect: React.FC<StatusSelectProps>;
7
- export default StatusSelect;
@@ -1,11 +0,0 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
2
- import PollBasicModel from 'fansunited-sdk-esm/Core/Namespaces/Voting/Models/Polls/PollBasicModel';
3
- import PollFiltersModel from '../../models/Filters/PollFiltersModel';
4
- type ConfirmationModalProps = {
5
- isOpen: boolean;
6
- poll: PollBasicModel;
7
- setFilters: Dispatch<SetStateAction<PollFiltersModel>>;
8
- handleClose: () => void;
9
- };
10
- declare const ConfirmationModal: React.FC<ConfirmationModalProps>;
11
- export default ConfirmationModal;
@@ -1,8 +0,0 @@
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;
@@ -1,10 +0,0 @@
1
- import PollBasicModel from 'fansunited-sdk-esm/Core/Namespaces/Voting/Models/Polls/PollBasicModel';
2
- import React from 'react';
3
- type PaginationProps = {
4
- pageCount: number;
5
- pagePolls: Map<number, PollBasicModel[]>;
6
- getPreviousPage: () => void;
7
- getNextPage: () => void;
8
- };
9
- declare const Pagination: React.FC<PaginationProps>;
10
- export default Pagination;
@@ -1,6 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- type PortalProps = {
3
- wrapperId?: string;
4
- };
5
- declare const Portal: React.FC<PropsWithChildren<PortalProps>>;
6
- export default Portal;
@@ -1,14 +0,0 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
2
- import PollFiltersModel from '../../models/Filters/PollFiltersModel';
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<PollFiltersModel>>;
11
- handleResetData: () => void;
12
- };
13
- declare const ContextSelectFilter: React.FC<ContextSelectFilterProps>;
14
- export default ContextSelectFilter;
@@ -1,9 +0,0 @@
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;
@@ -1,12 +0,0 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
2
- import PollFiltersModel from '../../models/Filters/PollFiltersModel';
3
- type PollSelectFilterProps = {
4
- filterType: 'status' | 'sort';
5
- defaultValue: string;
6
- filterValues: string[];
7
- showClearStatus?: boolean;
8
- setFilters: Dispatch<SetStateAction<PollFiltersModel>>;
9
- handleResetData: () => void;
10
- };
11
- declare const PollSelectFilter: React.FC<PollSelectFilterProps>;
12
- export default PollSelectFilter;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- type ButtonSpinnerProps = {
3
- height?: string;
4
- width?: string;
5
- color?: string;
6
- margin?: string;
7
- };
8
- declare const ButtonSpinner: React.FC<ButtonSpinnerProps>;
9
- export default ButtonSpinner;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const Spinner: React.FC;
3
- export default Spinner;
@@ -1,10 +0,0 @@
1
- import React, { Dispatch, SetStateAction } from 'react';
2
- import PollBasicModel from 'fansunited-sdk-esm/Core/Namespaces/Voting/Models/Polls/PollBasicModel';
3
- type TableBodyProps = {
4
- data: PollBasicModel[];
5
- fetchPollById: (pollId: string) => void;
6
- handleModal: () => void;
7
- setSelectedPoll: Dispatch<SetStateAction<PollBasicModel>>;
8
- };
9
- declare const TableBody: React.FC<TableBodyProps>;
10
- export default TableBody;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const TableHeader: React.FC;
3
- export default TableHeader;
@@ -1 +0,0 @@
1
- export declare const placeholders: any;
@@ -1,15 +0,0 @@
1
- import HttpsService from '../services/HttpsService';
2
- import FansUnitedSDKModel from 'fansunited-sdk-esm/Core/Global/Models/FansUnitedSDKModel';
3
- import React from 'react';
4
- import Sportal365Config from '../models/Sportal365/Sportal365Config';
5
- type APIProviderProps = {
6
- config: any;
7
- sportal365Config: Sportal365Config;
8
- };
9
- type APIContextValueType = {
10
- sdk: FansUnitedSDKModel;
11
- https: HttpsService;
12
- };
13
- declare const APIContext: React.Context<APIContextValueType>;
14
- declare const APIProvider: React.FC<APIProviderProps>;
15
- export { APIContext, APIProvider };
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import firebase from 'firebase/compat/app';
3
- type AuthProviderProps = {
4
- fansUnitedEnvironment: string;
5
- };
6
- declare const AuthContext: React.Context<firebase.User>;
7
- declare const AuthProvider: React.FC<AuthProviderProps>;
8
- export { AuthContext, AuthProvider };
@@ -1,2 +0,0 @@
1
- import firebase from 'firebase/compat/app';
2
- export declare const firebaseAuth: (fansUnitedEnvironment: string) => firebase.auth.Auth;
@@ -1 +0,0 @@
1
- export declare const getToken: () => Promise<string>;
@@ -1,36 +0,0 @@
1
- import { EnvironmentType, LangType } from 'fansunited-sdk-esm/Core/Configurator/Types/ConfiguratorTypes';
2
- import { FlagOption } from '../types/types';
3
- import Sportal365Config from '../models/Sportal365/Sportal365Config';
4
- import SelectOption from '../models/Select/SelectOption';
5
- export declare const initSdkConfig: (fansUnitedApiKey: string, fansUnitedClientId: string, fansUnitedLanguage?: LangType, fansUnitedEnvironment?: EnvironmentType) => {
6
- apiKey: string;
7
- clientId: string;
8
- lang: LangType;
9
- environment: EnvironmentType;
10
- idSchema: string;
11
- errorHandlingMode: string;
12
- authProvider: {
13
- getIdToken: () => string;
14
- logout: () => void;
15
- };
16
- };
17
- export declare const configureSportal365: (project: string, infrastructure?: 'shared' | 'betway') => Sportal365Config | null;
18
- export declare const extractValuesFlagOptions: (flags: FlagOption[]) => string[];
19
- /**
20
- * Transforms the number to e specific format. Example:
21
- * - 1323 -> 1.3k
22
- * - 1500000 -> 1.5m
23
- * - 100100000 -> 1.1b
24
- * @param value Number to be formatted
25
- * @returns Formatted number
26
- */
27
- export declare const formatNumber: (value: number) => string | number;
28
- export declare const scrollToComponent: (componentId: string) => void;
29
- export declare const selectStyles: {
30
- container: (provided: any) => any;
31
- control: (provided: any) => any;
32
- input: (provided: any) => any;
33
- option: (provided: any, state: any) => any;
34
- };
35
- export declare const formatOptions: (entity: any) => SelectOption;
36
- export declare const remapKeysToSpecificCase: (obj: any, type: 'camel' | 'snake') => any;
@@ -1,28 +0,0 @@
1
- import ImagesModel from 'fansunited-sdk-esm/Core/Global/Models/Images/ImagesModel';
2
- import ContextModel from 'fansunited-sdk-esm/Core/Namespaces/Activity/Models/RequestBody/Context/ContextModel';
3
- import { IBrandingRequestById } from '../RequestBody/RequestBody';
4
- export interface IPollOption {
5
- id?: string;
6
- title: string;
7
- description: string;
8
- images: ImagesModel;
9
- votes?: number;
10
- }
11
- export default class PollById {
12
- id: string;
13
- title: string;
14
- description: string;
15
- type: string;
16
- rules: string;
17
- total_votes: number;
18
- ad_content: string;
19
- labels: Object;
20
- custom_fields: Object;
21
- branding: IBrandingRequestById;
22
- embed_code: string;
23
- images: ImagesModel;
24
- status: string;
25
- flags: string[];
26
- options: IPollOption[];
27
- context: ContextModel;
28
- }
@@ -1,6 +0,0 @@
1
- export default class SignedInUrlRequestBody {
2
- image_file_name: string;
3
- image_type: string;
4
- image_size: number;
5
- base64_sum: string;
6
- }
@@ -1,5 +0,0 @@
1
- import SelectOption from './SelectOption';
2
- export default class GroupSelectOption {
3
- label: string;
4
- options: SelectOption[];
5
- }
@@ -1,4 +0,0 @@
1
- export default class Sportal365Config {
2
- project: string;
3
- authorization: string;
4
- }
@@ -1,5 +0,0 @@
1
- export default class Sportal365ImagesContainerToggleModel {
2
- mainImage: boolean;
3
- coverImage: boolean;
4
- mobileImage: boolean;
5
- }
@@ -1,21 +0,0 @@
1
- interface ISearchImagesMeta {
2
- pagination: {
3
- current_page: number;
4
- };
5
- }
6
- export interface ISearchImagesData {
7
- id: string;
8
- urls: {
9
- uploaded: {
10
- embed: string;
11
- gallery: string;
12
- original: string;
13
- thumbnail: string;
14
- };
15
- };
16
- }
17
- export default class Sportal365SearchImage {
18
- meta: ISearchImagesMeta;
19
- data: ISearchImagesData[];
20
- }
21
- export {};
@@ -1,4 +0,0 @@
1
- export default class Sportal365SearchImagesFilters {
2
- from: string;
3
- to: string;
4
- }
@@ -1,6 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- type ModalPortalProps = {
3
- wrapperId?: string;
4
- };
5
- declare const ModalPortal: React.FC<PropsWithChildren<ModalPortalProps>>;
6
- export default ModalPortal;
@@ -1,4 +0,0 @@
1
- export default class HashService {
2
- readFileAndHash: (file: File) => Promise<string>;
3
- generateHashFileName: (file: File) => Promise<string>;
4
- }
@@ -1,33 +0,0 @@
1
- import SDKConfigurationModel from 'fansunited-sdk-esm/Core/Configurator/Models/SDKConfiguraitonModel';
2
- import RequestBody from '../models/RequestBody/RequestBody';
3
- import { IType } from '../models/Features/Features';
4
- import SignedInUrlRequestBody from '../models/RequestBody/SignedInUrlRequestBody';
5
- import Sportal365Config from '../models/Sportal365/Sportal365Config';
6
- import Sportal365SearchImagesFilters from '../models/Sportal365/Sportal365SearchImagesFilters';
7
- import ExportUsersRequestBody from '../models/Export/ExportUsersRequestBody';
8
- export default class HttpsService {
9
- private votingApiBaseUrl;
10
- private clientApiBaseUrl;
11
- private reportingApiBaseUrl;
12
- private headers;
13
- private mainQueryParams;
14
- private apiKey;
15
- private clientId;
16
- private environment;
17
- sportal365Config: Sportal365Config | null;
18
- private sportal365Headers;
19
- private readonly sportal365ImagesSearchURL;
20
- constructor(config: SDKConfigurationModel, sportal365Config: Sportal365Config | null);
21
- createPoll: (requestBody: RequestBody) => Promise<Response>;
22
- updatePoll: (id: string, requestBody: RequestBody) => Promise<Response>;
23
- deletePoll: (pollId: string) => Promise<Response>;
24
- getPollById: (pollId: string) => Promise<Response>;
25
- getPollTypes: () => Promise<IType[]>;
26
- generateSignedInUrl: (requestBody: SignedInUrlRequestBody) => Promise<Response>;
27
- storeInBucket: (signedInUrl: string, file: File, headers: Record<string, string>) => Promise<string>;
28
- fetchImagesFromSportal365: (query: string, filters: Sportal365SearchImagesFilters, page: number) => Promise<Response>;
29
- exportUsers: (requestBody: ExportUsersRequestBody) => Promise<Response>;
30
- private getPollFeatures;
31
- private constructAssetsUrl;
32
- private throwErrorFromXmlResponse;
33
- }
package/types/types.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export type ImageCases = 'mainImage' | 'coverImage' | 'mobileImage';
2
- export type FlagOption = {
3
- label: string;
4
- value: string;
5
- };
6
- export type Entity = 'competition' | 'team' | 'player';