fansunited-widget-either-or 2.8.1 → 2.10.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
@@ -194,7 +194,7 @@ const labels = {
194
194
  generateSignedInUrlErrorMessage: 'There was a problem generating signed in URL to store the image in bucket. Please try again',
195
195
  uploadingImageErrorMessage: 'There was a problem with uploading image to bucket. Please try again',
196
196
  encryptingImageErrorMessage: 'There was a problem with encrypting image before uploading it to bucket. Please try again',
197
- searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again'
197
+ searchSportal365ImagesErrorMessage: 'There was a problem with searching images from Sportal 365 API. Please try again',
198
198
  hideFilters: 'Hide filters',
199
199
  showFilters: 'Show filters',
200
200
  branding: 'Branding',
@@ -258,6 +258,7 @@ const labels = {
258
258
  free: 'Free',
259
259
  lead: 'Lead',
260
260
  registered: 'Registered',
261
+ paid: 'Paid',
261
262
  language: 'Language',
262
263
  languageDescription: 'Select the language for your game. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use.',
263
264
  urlCopiedToClipboardMessage: 'URL copied to clipboard',
@@ -310,7 +311,19 @@ const labels = {
310
311
  campaignNameInfoMessage: 'A label for your campaign that will appear in the reports. You can use anything here. Example: "Adidas (December 2025)"',
311
312
  copyToClipboard: 'Copy to clipboard',
312
313
  divElementTextInfo: "The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: ",
313
- widgetEmbedCodeNotAvailable: 'To configure embed code you need to first create your Either/Or game.'
314
+ widgetEmbedCodeNotAvailable: 'To configure embed code you need to first create your Either/Or game.',
315
+ signInLabel: 'Label',
316
+ signInLabelInfoMessage: `Custom text displayed on the sign-in button. If empty, defaults to "Sign in to vote".`,
317
+ authenticationHandler: 'Authentication handler',
318
+ authenticationHandlerInfoMessage: 'JavaScript function code that executes when users click the sign-in button. To evaluate the function, provide only the function name. Example: showLoginModal() or window.openAuth(). The function is required otherwise the sign-in button will just log dummy message in the console.',
319
+ configureSignIn: 'Configure sign-in options',
320
+ configureSignInDisabledMessage: `Configure sign-in options is enabled only when the authentication requirement is set to “Registered”.`,
321
+ translationOptions: 'Translate to:',
322
+ cloneMiniGameTitle: 'Clone Either/Or',
323
+ clone: 'Clone',
324
+ cloneEitherOrMessage: 'You have successfully cloned Either/Or',
325
+ cloneEitherOrErrorMessage: 'There was a problem cloning Either/Or. Please try again',
326
+ translationErrorMessage: 'An error occurred while translating.'
314
327
  };
315
328
 
316
329
  const App = () => {
@@ -508,6 +521,7 @@ Here is all information about **`LabelsModel`**:
508
521
  | `free` | Label for auth requirement option. | Free |
509
522
  | `lead` | Label for auth requirement option. | Lead |
510
523
  | `registered` | Label for auth requirement option. | Registered |
524
+ | `paid` | Label for auth requirement option. | Paid |
511
525
  | `language` | Label for language selection in configuration panel. | Language |
512
526
  | `languageDescription` | Description paragraph for language select. | Select the language for your game. You can manage language selection by configuring available languages in language configuration. It cannot be changed if multilingual feature is in use. |
513
527
  | `urlCopiedToClipboardMessage` | Toast info message when image URL is copied | URL copied to clipboard |
@@ -560,4 +574,31 @@ Here is all information about **`LabelsModel`**:
560
574
  | `campaignNameInfoMessage` | Tooltip info text for campaign name input field | A label for your campaign that will appear in the reports. You can use anything here. Example: "Adidas (December 2025)" |
561
575
  | `copyToClipboard` | Div text button tooltip text in embed code acordion | Copy to clipboard |
562
576
  | `divElementTextInfo` | Helper text for div content in embed code acordion | The generated embed code can be copied directly into your website's HTML. For comprehensive implementation details, visit our documentation: |
563
- | `widgetEmbedCodeNotAvailable` | Paragraph when trying to configure widget embed code for not created Either/Or | To configure embed code you need to first create your Either/Or game. |
577
+ | `widgetEmbedCodeNotAvailable` | Paragraph when trying to configure widget embed code for not created Either/Or | To configure embed code you need to first create your Either/Or game. |
578
+ | `signInLabel` | Label for sign in label input | Label |
579
+ | `signInLabelInfoMessage` | Info tooltip message for sign in label input | Custom text displayed on the sign-in button. If empty, defaults to "Sign in to vote". |
580
+ | `authenticationHandler` | Label for authentication handler | Authentication handler |
581
+ | `authenticationHandlerInfoMessage` | Info tooltip message for authentication handler | JavaScript function code that executes when users click the sign-in button. To evaluate the function, provide only the function name. Example: showLoginModal() or window.openAuth(). The function is required otherwise the sign-in button will just log dummy message in the console. |
582
+ | `configureSignIn` | Label for configure sign in switch | Configure sign-in options |
583
+ | `configureSignInDisabledMessage` | Info tooltiup message when configure sign in is disabled | Configure sign-in options is enabled only when the authentication requirement is set to “Registered”. |
584
+ | `translationOptions` | Label for translation options section in clone modal | Translate to: |
585
+ | `cloneMiniGameTitle` | Title for clone Either/Or modal | Clone Either/Or |
586
+ | `clone` | Label for clone button | Clone |
587
+ | `cloneEitherOrMessage` | Toast successful message when cloning Either/Or | You have successfully cloned Either/Or |
588
+ | `cloneEitherOrErrorMessage` | Toast error message when cloning Either/Or fails | There was a problem cloning Either/Or. Please try again |
589
+ | `translationErrorMessage` | Toast error message when translation fails during cloning | An error occurred while translating. |
590
+
591
+ ## Changelog
592
+
593
+ ### 2.10.0 - 2025-01-01
594
+
595
+ - **Added:**
596
+ - Clone functionality for Either/Or games
597
+ - Translation support during cloning process - users can clone games and translate them to multiple languages simultaneously
598
+ - New clone action in the actions menu for existing games
599
+ - New labels for clone functionality: `translationOptions`, `cloneMiniGameTitle`, `clone`, `cloneEitherOrMessage`, `cloneEitherOrErrorMessage`, `translationErrorMessage`
600
+ - Enhanced user experience with loading states and toast notifications during cloning operations
601
+
602
+ - **Changed:**
603
+ - Updated LabelsModel to include new clone-related labels with default values
604
+ - Enhanced ActionsMenu component to include clone option alongside edit and delete actions
@@ -3,7 +3,7 @@ import { EitherOrBasicModel } from 'fansunited-sdk-esm';
3
3
  type ActionsMenuProps = {
4
4
  eitherOr: EitherOrBasicModel;
5
5
  onClickEdit: () => void;
6
- onDelete: () => void;
6
+ reloadGames: () => void;
7
7
  };
8
8
  declare const ActionsMenu: React.FC<ActionsMenuProps>;
9
9
  export default ActionsMenu;
@@ -1,11 +1,11 @@
1
1
  import { default as React, Dispatch, SetStateAction } from 'react';
2
- import { default as SelectOption } from '../../models/Select/SelectOption';
3
2
  import { default as EitherOrFiltersModel } from '../../models/Filters/EitherOrFiltersModel';
3
+ import { default as GroupSelectOption } from 'fansunited-management-components/src/models/select/GroupSelectOption';
4
4
  type FiltersProps = {
5
5
  filters: EitherOrFiltersModel;
6
- options: SelectOption[];
6
+ options: GroupSelectOption[];
7
7
  showStatusFilter?: boolean;
8
- setOptions: Dispatch<SetStateAction<SelectOption[]>>;
8
+ setOptions: Dispatch<SetStateAction<GroupSelectOption[]>>;
9
9
  setFilters: Dispatch<SetStateAction<EitherOrFiltersModel>>;
10
10
  handleResetData: () => void;
11
11
  };
@@ -0,0 +1,10 @@
1
+ import { default as React } from 'react';
2
+ import { EitherOrBasicModel } from 'fansunited-sdk-esm';
3
+ type CloneMiniGameModalProps = {
4
+ isOpen: boolean;
5
+ eitherOr: EitherOrBasicModel;
6
+ getMiniGames: () => void;
7
+ onClose: () => void;
8
+ };
9
+ declare const CloneMiniGameModal: React.FC<CloneMiniGameModalProps>;
10
+ export default CloneMiniGameModal;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  type ImportTemplateModalProps = {
3
- fansUnitedEnvironment: string;
4
3
  isOpen: boolean;
5
4
  onImport: () => void;
6
5
  onClose: () => void;