fansunited-widget-poll 2.21.0 → 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 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",
@@ -523,6 +525,8 @@ Here is all information about **`LabelsModel`**:
523
525
  | `managePollDescription` | Description paragraph on management screen | Manage your Poll here |
524
526
  | `addOption` | Label for add option button | Add option |
525
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 |
526
530
  | `urlCopiedToClipboardMessage` | Toast info message when image URL is copied | URL copied to clipboard |
527
531
  | `imageDeletedMessage` | Toast info message when image is deleted | Image deleted |
528
532
  | `imageResetMessage` | Toast info message when image size is restored | The initial size of the image has been restored |
@@ -677,6 +681,10 @@ Here is all information about **`LabelsModel`**:
677
681
 
678
682
  ## Changelog
679
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
+
680
688
  ### 2.21.0 - 2026-02-17
681
689
  - **Added**:
682
690
  - Dropdown in Ad Content and Rules for selecting predefined content from info pages
@@ -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
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fansunited-widget-poll",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "main": "poll-manager.es.js",
5
5
  "author": "Fans United",
6
6
  "description": "",