fansunited-widget-poll 2.20.1 → 2.22.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 +25 -1
- package/components/Management/Options/Option.d.ts +14 -0
- package/models/Features/Features.d.ts +2 -0
- package/models/Labels/LabelsModel.d.ts +8 -0
- package/package.json +1 -1
- package/poll-manager.es.js +24011 -22855
- package/poll-manager.umd.js +337 -327
- package/style.css +1 -1
package/README.md
CHANGED
|
@@ -217,6 +217,8 @@ const labels = {
|
|
|
217
217
|
managePollDescription: "Manage your Poll here",
|
|
218
218
|
addOption: "Add option",
|
|
219
219
|
removeOption: "Remove option",
|
|
220
|
+
dragToReorder: "Drag to reorder",
|
|
221
|
+
dragToReorderOptions: "Drag and drop the options to change their order",
|
|
220
222
|
urlCopiedToClipboardMessage: "URL copied to clipboard",
|
|
221
223
|
imageDeletedMessage: "Image deleted",
|
|
222
224
|
imageResetMessage: "The initial size of the image has been restored",
|
|
@@ -361,7 +363,13 @@ const labels = {
|
|
|
361
363
|
rulesDisplayUrlInfoMessage: 'URL to open when the rules UI element is clicked',
|
|
362
364
|
rulesDisplayTarget: 'Target',
|
|
363
365
|
brandingTemplateLabel: 'Select branding',
|
|
364
|
-
brandingTemplatePlaceholder: 'Choose existing branding'
|
|
366
|
+
brandingTemplatePlaceholder: 'Choose existing branding',
|
|
367
|
+
selectAdContent: 'Select ad content',
|
|
368
|
+
selectRules: 'Select rules',
|
|
369
|
+
format: 'Format',
|
|
370
|
+
minify: 'Minify',
|
|
371
|
+
invalidJsonFormat: 'Invalid JSON format',
|
|
372
|
+
cannotMinifyInvalidJson: 'Cannot minify invalid JSON'
|
|
365
373
|
};
|
|
366
374
|
|
|
367
375
|
const App = () => {
|
|
@@ -517,6 +525,8 @@ Here is all information about **`LabelsModel`**:
|
|
|
517
525
|
| `managePollDescription` | Description paragraph on management screen | Manage your Poll here |
|
|
518
526
|
| `addOption` | Label for add option button | Add option |
|
|
519
527
|
| `removeOption` | Label for remove option | Remove option |
|
|
528
|
+
| `dragToReorder` | Tooltip for the drag handle of an option | Drag to reorder |
|
|
529
|
+
| `dragToReorderOptions` | Hint next to the add option button when options can be reordered | Drag and drop the options to change their order |
|
|
520
530
|
| `urlCopiedToClipboardMessage` | Toast info message when image URL is copied | URL copied to clipboard |
|
|
521
531
|
| `imageDeletedMessage` | Toast info message when image is deleted | Image deleted |
|
|
522
532
|
| `imageResetMessage` | Toast info message when image size is restored | The initial size of the image has been restored |
|
|
@@ -662,9 +672,23 @@ Here is all information about **`LabelsModel`**:
|
|
|
662
672
|
| `rulesDisplayTarget` | Label for rules display target select | Target |
|
|
663
673
|
| `brandingTemplateLabel` | Label for branding menu selection | Select branding |
|
|
664
674
|
| `brandingTemplatePlaceholder` | Placeholder for branding menu selection | Choose existing branding |
|
|
675
|
+
| `selectAdContent` | Label for select ad content dropdown | Select ad content |
|
|
676
|
+
| `selectRules` | Label for select rules dropdown | Select rules |
|
|
677
|
+
| `format` | Label for format button in content editor | Format |
|
|
678
|
+
| `minify` | Label for minify button in content editor | Minify |
|
|
679
|
+
| `invalidJsonFormat` | Error message for invalid JSON format | Invalid JSON format |
|
|
680
|
+
| `cannotMinifyInvalidJson` | Error message when trying to minify invalid JSON | Cannot minify invalid JSON |
|
|
665
681
|
|
|
666
682
|
## Changelog
|
|
667
683
|
|
|
684
|
+
### 2.22.0 - 2026-09-03
|
|
685
|
+
- **Added**:
|
|
686
|
+
- Reordering of poll options by drag and drop, available as long as the poll has no votes
|
|
687
|
+
|
|
688
|
+
### 2.21.0 - 2026-02-17
|
|
689
|
+
- **Added**:
|
|
690
|
+
- Dropdown in Ad Content and Rules for selecting predefined content from info pages
|
|
691
|
+
|
|
668
692
|
### 2.20.0 - 2026-01-22
|
|
669
693
|
- **Improved**:
|
|
670
694
|
- Display category name for each question generated by AI in Football Post-Match Poll generation
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IPollOption } from '../../../models/RequestBody/RequestBody';
|
|
3
|
+
/**
|
|
4
|
+
* Everything the option needs in order to be dragged and dropped. Provided only when reordering is allowed.
|
|
5
|
+
* Only the drag handle is a drag source, otherwise selecting text inside the option's fields would start a
|
|
6
|
+
* drag. The whole option is a drop target.
|
|
7
|
+
*/
|
|
8
|
+
export type OptionDrag = {
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
dropPosition: 'above' | 'below' | null;
|
|
11
|
+
onDragStart: () => void;
|
|
12
|
+
onDragOver: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
13
|
+
onDrop: (event: React.DragEvent<HTMLDivElement>) => void;
|
|
14
|
+
onDragEnd: () => void;
|
|
15
|
+
};
|
|
3
16
|
type OptionProps = {
|
|
4
17
|
option: IPollOption;
|
|
5
18
|
optionNumber: number;
|
|
@@ -8,6 +21,7 @@ type OptionProps = {
|
|
|
8
21
|
additionalFields: string[];
|
|
9
22
|
disableDelete: boolean;
|
|
10
23
|
isPollProfilePreferencesEnabled: boolean;
|
|
24
|
+
drag?: OptionDrag;
|
|
11
25
|
onDelete: () => void;
|
|
12
26
|
onChange: (option: IPollOption) => void;
|
|
13
27
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InfoPageModel } from 'fansunited-management-components';
|
|
1
2
|
import { IProfilePreferences } from '../Preferences/ProfilePreferences';
|
|
2
3
|
export interface IType {
|
|
3
4
|
id: string;
|
|
@@ -18,4 +19,5 @@ export default class Features {
|
|
|
18
19
|
authRequirement: string;
|
|
19
20
|
preferences: IProfilePreferences;
|
|
20
21
|
fullCoverageCompetitions: string[];
|
|
22
|
+
infoPages: InfoPageModel[];
|
|
21
23
|
}
|
|
@@ -133,6 +133,8 @@ export default class LabelsModel {
|
|
|
133
133
|
managePollDescription: string;
|
|
134
134
|
addOption: string;
|
|
135
135
|
removeOption: string;
|
|
136
|
+
dragToReorder: string;
|
|
137
|
+
dragToReorderOptions: string;
|
|
136
138
|
urlCopiedToClipboardMessage: string;
|
|
137
139
|
imageDeletedMessage: string;
|
|
138
140
|
imageResetMessage: string;
|
|
@@ -279,5 +281,11 @@ export default class LabelsModel {
|
|
|
279
281
|
rulesDisplayTarget: string;
|
|
280
282
|
brandingTemplateLabel: string;
|
|
281
283
|
brandingTemplatePlaceholder: string;
|
|
284
|
+
selectAdContent: string;
|
|
285
|
+
selectRules: string;
|
|
286
|
+
format: string;
|
|
287
|
+
minify: string;
|
|
288
|
+
invalidJsonFormat: string;
|
|
289
|
+
cannotMinifyInvalidJson: string;
|
|
282
290
|
constructor(labels?: LabelsModel);
|
|
283
291
|
}
|