bm-core-ui 2.11.9-beta.2 → 2.12.0-beta.12

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 (62) hide show
  1. package/README.md +1 -1
  2. package/build/@types/index.d.ts +2268 -71
  3. package/build/BMCollectionView/BMCollectionView.js +1070 -235
  4. package/build/BMCollectionView/BMCollectionViewFlowLayout.js +11 -4
  5. package/build/BMCollectionView/BMCollectionViewLayout.js +19 -0
  6. package/build/BMCoreUI.css +213 -44
  7. package/build/BMView/BMDragSession.js +1243 -0
  8. package/build/BMView/BMDragSessionActions.js +121 -0
  9. package/build/BMView/BMDragSessionPreview.js +1650 -0
  10. package/build/BMView/BMLayoutConstraint_v2.5.js +14 -59
  11. package/build/BMView/BMMenu.js +50 -20
  12. package/build/BMView/BMView_v2.5.js +34 -3
  13. package/build/BMWindow/BMPopover/BMPopover.js +35 -20
  14. package/build/BMWindow/BMToolWindow.js +29 -1
  15. package/build/BMWindow/BMWindow.js +128 -65
  16. package/build/images/AlignBottom.png +0 -0
  17. package/build/images/AlignCenterX.png +0 -0
  18. package/build/images/AlignCenterY.png +0 -0
  19. package/build/images/AlignLeading.png +0 -0
  20. package/build/images/AlignTop.png +0 -0
  21. package/build/images/AlignTrailing.png +0 -0
  22. package/build/images/AllConstraints.png +0 -0
  23. package/build/images/BottomConstraint.png +0 -0
  24. package/build/images/CenterXConstraint.png +0 -0
  25. package/build/images/CenterYConstraint.png +0 -0
  26. package/build/images/CoreUI2.png +0 -0
  27. package/build/images/CoreUI2@2x.png +0 -0
  28. package/build/images/Desktop.png +0 -0
  29. package/build/images/DesktopMini.png +0 -0
  30. package/build/images/EqualHeight.png +0 -0
  31. package/build/images/EqualHorizontalSpacing.png +0 -0
  32. package/build/images/EqualHorizontalSpacingInSuperview.png +0 -0
  33. package/build/images/EqualVerticalSpacing.png +0 -0
  34. package/build/images/EqualVerticalSpacingInSuperview.png +0 -0
  35. package/build/images/EqualWidth.png +0 -0
  36. package/build/images/HeightConstraint.png +0 -0
  37. package/build/images/InactiveConstraints.png +0 -0
  38. package/build/images/Layout.png +0 -0
  39. package/build/images/LayoutVariables.png +0 -0
  40. package/build/images/LeftConstraint.png +0 -0
  41. package/build/images/OwnConstraints.png +0 -0
  42. package/build/images/Phone.png +0 -0
  43. package/build/images/PhoneLandscape.png +0 -0
  44. package/build/images/PhoneLandscapeMini.png +0 -0
  45. package/build/images/PhoneMini.png +0 -0
  46. package/build/images/PhonePortrait.png +0 -0
  47. package/build/images/PhonePortraitMini.png +0 -0
  48. package/build/images/Properties.png +0 -0
  49. package/build/images/RightConstraint.png +0 -0
  50. package/build/images/SubviewConstraints.png +0 -0
  51. package/build/images/Tablet.png +0 -0
  52. package/build/images/TabletLandscape.png +0 -0
  53. package/build/images/TabletLandscapeMini.png +0 -0
  54. package/build/images/TabletMini.png +0 -0
  55. package/build/images/TabletPortrait.png +0 -0
  56. package/build/images/TabletPortraitMini.png +0 -0
  57. package/build/images/TopConstraint.png +0 -0
  58. package/build/images/WidthConstraint.png +0 -0
  59. package/build/index.js +4 -0
  60. package/lib/@types/BMCoreUI.min.d.ts +2268 -71
  61. package/lib/BMCoreUI.min.js +1 -1
  62. package/package.json +3 -3
@@ -4585,9 +4585,10 @@ export class BMView {
4585
4585
  * and handle key presses. Subclasses that override this method should invoke the base implementation to allow
4586
4586
  * keyboard shortcuts to be handled correctly.
4587
4587
  * @param event The event that triggered this action.
4588
+ * @return `YES` if a keyboard shortcut was handled, `NO` or `undefined` otherwise.
4588
4589
  *
4589
4590
  */
4590
- keyPressedWithEvent(event: KeyboardEvent): void;
4591
+ keyPressedWithEvent(event: KeyboardEvent): boolean | null | undefined;
4591
4592
 
4592
4593
 
4593
4594
  /**
@@ -4612,6 +4613,20 @@ export class BMView {
4612
4613
  private _disableKeyboardShortcuts(): void;
4613
4614
 
4614
4615
 
4616
+ /**
4617
+ * Initiates a drag session with the specified drag delegate from a touch or mouse event.
4618
+ * @param event The event that triggered the drag gesture.
4619
+ * @param delegate The drag session delegate supplying items and
4620
+ * handling events for the session.
4621
+ * @param touchIdentifier If the event is a touch event and this is specified,
4622
+ * it represents the identifier of the touch point that
4623
+ * will be tracked throughout the drag session. If not
4624
+ * specified, the first changed touch will be used.
4625
+ *
4626
+ */
4627
+ performDragWithEvent(event: MouseEvent | TouchEvent, {delegate, touchIdentifier}: {delegate: BMDragDelegate, touchIdentifier?: number | null | undefined}): void;
4628
+
4629
+
4615
4630
  /**
4616
4631
  * An internal list of layout constraints that affect this view. This array will contain both constraints having
4617
4632
  * this view as the source view and constraints having this view as the target view. It also contains constraints
@@ -5468,41 +5483,1752 @@ export class BMTextField extends BMView {
5468
5483
 
5469
5484
 
5470
5485
  /**
5471
- * Constructs and returns a DOM node for a menu item with the given label.
5472
- * @param label The text to display in the menu item.
5473
- * @param action An action that occurs when the menu item is selected.
5474
- * @return A DOM node to be added to a menu.
5486
+ * Constructs and returns a DOM node for a menu item with the given label.
5487
+ * @param label The text to display in the menu item.
5488
+ * @param action An action that occurs when the menu item is selected.
5489
+ * @return A DOM node to be added to a menu.
5490
+ *
5491
+ */
5492
+ private _menuItemWithLabel(label: string, {action}: {action: (($0: Event) => void)}): DOMNode;
5493
+
5494
+
5495
+ /**
5496
+ * Creates and brings up a context menu at the given coordinates, relative to the viewport.
5497
+ * @param point The point at which to show the menu.
5498
+ * @param withOptions The options that the menu should display.
5499
+ * @param kind Defaults to .Menu. The kind of menu to show.
5500
+ * @return The menu element.
5501
+ *
5502
+ */
5503
+ private _showMenuAtPoint(point: BMPoint, {withOptions, kind}: {withOptions: DOMNode[], kind?: BMMenuKind | null | undefined}): DOMNode;
5504
+
5505
+
5506
+ /**
5507
+ * Constructs and returns a text field with a new DOM node.
5508
+ * @return A text field.
5509
+ *
5510
+ */
5511
+ static textField (): BMTextField;
5512
+
5513
+
5514
+ /**
5515
+ * Constructs and returns a text field for the given input DOM node.
5516
+ * @param node An input DOM node.
5517
+ * @return A text field.
5518
+ *
5519
+ */
5520
+ static textFieldForInputNode (node: DOMNode): BMTextField;
5521
+
5522
+ }
5523
+
5524
+
5525
+ /**
5526
+ * A list of constants describing what happens to source objects when they are transferred
5527
+ * as part of drag session a different target than the one they were dragged from.
5528
+ *
5529
+ */
5530
+ export class BMDragTransferKind {
5531
+ /**
5532
+ * Indicates that the items should be moved from the source to the target. This must
5533
+ * be specified by both the source and the target for the movement to take place.
5534
+ *
5535
+ */
5536
+ static Move: BMDragTransferKind;
5537
+
5538
+ /**
5539
+ * Indicates that a copy of the items will be transferred to the target. If either the
5540
+ * target or the source of the transfer specifies this transfer kind, a copy is performed
5541
+ * regardless of the transfer kind specified by the other.
5542
+ *
5543
+ */
5544
+ static Copy: BMDragTransferKind;
5545
+
5546
+ private constructor();
5547
+ }
5548
+
5549
+ /**
5550
+ * An object that describes the action that should be performed for a drag session when it ends.
5551
+ *
5552
+ */
5553
+ export class BMDragSessionAction {
5554
+
5555
+ /**
5556
+ * The action to perform at the end of the drag session.
5557
+ *
5558
+ */
5559
+ readonly action: BMDragSessionActionKind;
5560
+
5561
+ /**
5562
+ * The message to display on the drag indicator describing the action.
5563
+ *
5564
+ */
5565
+ readonly message: any;
5566
+
5567
+ /**
5568
+ * The HTML message to display on the drag indicator describing the action.
5569
+ *
5570
+ */
5571
+ readonly messageHTML: any;
5572
+
5573
+ /**
5574
+ * Initializes this drag action with the specified drop action kind. Optionally,
5575
+ * a message and an item count override may be provided.
5576
+ * @param action The action to perform at the end of the drag session.
5577
+ * @param message If specified, an optional message to display on the
5578
+ * drag indicator describing the drop action.
5579
+ * @param messageHTML If specified, an optional HTML message to display on the
5580
+ * drag indicator describing the drop action. If `message` is
5581
+ * also specified, this parameter is not used.
5582
+ * @return This drag action.
5583
+ *
5584
+ */
5585
+ initWithAction(action: BMDragSessionActionKind, {message, messageHTML}?: {message?: string | null | undefined, messageHTML?: string | null | undefined}): BMDragAction;
5586
+
5587
+
5588
+ /**
5589
+ * Creates and initializes a drag action with the specified drag action kind. Optionally,
5590
+ * a message and an item override may be provided.
5591
+ * @param action The action to perform at the end of the drag session.
5592
+ * @param message If specified, an optional message to display on the
5593
+ * drag indicator describing the drop action.
5594
+ * @param messageHTML If specified, an optional HTML message to display on the
5595
+ * drag indicator describing the drop action. If `message` is
5596
+ * also specified, this parameter is not used.
5597
+ * @return A drag action.
5598
+ *
5599
+ */
5600
+ static actionWithKind (action: BMDragSessionDropActionKind, {message, messageHTML}?: {message?: string | null | undefined, messageHTML?: string | null | undefined}): BMDragSessionAction;
5601
+
5602
+ }
5603
+
5604
+
5605
+ /**
5606
+ * An object that describes the action that should be performed for a drop session when it ends.
5607
+ *
5608
+ */
5609
+ export class BMDropSessionAction {
5610
+
5611
+ /**
5612
+ * The action to perform at the end of the drag session.
5613
+ *
5614
+ */
5615
+ readonly action: BMDragSessionActionKind;
5616
+
5617
+ /**
5618
+ * The message to display on the drag indicator describing the action.
5619
+ *
5620
+ */
5621
+ readonly message: any;
5622
+
5623
+ /**
5624
+ * The HTML message to display on the drag indicator describing the action.
5625
+ *
5626
+ */
5627
+ readonly messageHTML: any;
5628
+
5629
+ /**
5630
+ * If specified when the action is `.AcceptPartially`, the drag items that are actually acceptable.
5631
+ *
5632
+ */
5633
+ readonly acceptableItems: any;
5634
+
5635
+ /**
5636
+ * Initializes this drop action with the specified drop action kind. Optionally,
5637
+ * a message and an item count override may be provided.
5638
+ * @param action The action to perform at the end of the drop session.
5639
+ * @param message If specified, an optional message to display on the
5640
+ * drag indicator describing the drop action.
5641
+ * @param messageHTML If specified, an optional HTML message to display on the
5642
+ * drag indicator describing the drop action. If `message` is
5643
+ * also specified, this parameter is not used.
5644
+ * @param items If specified, the items that are acceptable for the current drop target.
5645
+ * Requires the `action` to be set to `.AcceptPartially` to take effect.
5646
+ * These items must be part of the drag or drop session.
5647
+ * @return This drop action.
5648
+ *
5649
+ */
5650
+ initWithAction(action: BMDropSessionActionKind, {message, messageHTML, items}?: {message?: string | null | undefined, messageHTML?: string | null | undefined, items?: BMDragItem[] | null | undefined}): BMDragAction;
5651
+
5652
+
5653
+ /**
5654
+ * Creates and initializes a drop action with the specified drop action kind. Optionally,
5655
+ * a message and an item override may be provided.
5656
+ * @param action The action to perform at the end of the drop session.
5657
+ * @param message If specified, an optional message to display on the
5658
+ * drag indicator describing the drop action.
5659
+ * @param messageHTML If specified, an optional HTML message to display on the
5660
+ * drag indicator describing the drop action. If `message` is
5661
+ * also specified, this parameter is not used.
5662
+ * @param items If specified, the items that are acceptable for the current drop target.
5663
+ * Requires the `action` to be set to `.AcceptPartially` to take effect.
5664
+ * These items must be part of the drop session.
5665
+ * @return A drop action.
5666
+ *
5667
+ */
5668
+ static actionWithKind (action: BMDragSessionDropActionKind, {message, messageHTML, items}?: {message?: string | null | undefined, messageHTML?: string | null | undefined, items?: BMDragItem[] | null | undefined}): BMDropSessionAction;
5669
+
5670
+ }
5671
+
5672
+
5673
+ /**
5674
+ * An object that describes an in-progress drag session. Drag sessions are automatically created by
5675
+ * views that begin drag operations and supplied to potential drop targets when the drag gesture
5676
+ * intersects their frame.
5677
+ *
5678
+ * To start a drag session, use the static `beginDragWithEvent` method, passing in the starting
5679
+ * event and a delegate object providing the contents of the drag session.
5680
+ *
5681
+ * The session can be used to obtain the items that participate in the drag gesture and to update
5682
+ * the state and messaging presented to the user.
5683
+ *
5684
+ */
5685
+ export class BMDragSession implements EventHandlerObject {
5686
+
5687
+ /**
5688
+ * The drag delegate of hte object that initiated this drag session.
5689
+ *
5690
+ */
5691
+ private _dragDelegate: BMDragDelegate;
5692
+
5693
+ /**
5694
+ * The view that initiated this drag session.
5695
+ *
5696
+ */
5697
+ private _sourceView: BMView;
5698
+
5699
+ /**
5700
+ * The items participating in this drag session.
5701
+ *
5702
+ */
5703
+ private readonly _items: any;
5704
+
5705
+ /**
5706
+ * An array of nodes corresponding to the previews of the items being dragged.
5707
+ * There may be fewer previews than items, and the preview positions in this array
5708
+ * correspond
5709
+ *
5710
+ */
5711
+ private readonly _itemPreviews: any;
5712
+
5713
+ /**
5714
+ * The node displaying the items in this drag session.
5715
+ *
5716
+ */
5717
+ private _itemCountNode: DOMNode;
5718
+
5719
+ /**
5720
+ * The current drop action as specified by the source view.
5721
+ *
5722
+ */
5723
+ private _sourceDropAction: BMDragSessionAction;
5724
+
5725
+ /**
5726
+ * The current drop action as specified by the target view.
5727
+ *
5728
+ */
5729
+ private _targetDropAction?: BMDropSessionAction | null | undefined;
5730
+
5731
+ /**
5732
+ * The outcome of ending the drag session at the current position.
5733
+ *
5734
+ */
5735
+ private _dropAction: _BMDragDropSessionAction;
5736
+
5737
+ /**
5738
+ * The final drop action at the end of the session. This property is only accessible since the
5739
+ * `dragSessionWillFinish` delegate method is invoked.
5740
+ *
5741
+ */
5742
+ readonly action: BMDragSessionAction | BMDropSessionAction | undefined;
5743
+
5744
+ /**
5745
+ * The event that started this drag session.
5746
+ *
5747
+ */
5748
+ private _startEvent: MouseEvent | TouchEvent;
5749
+
5750
+ /**
5751
+ * The touch identifier tracked for this drag session if the session
5752
+ * was started via a touch event.
5753
+ *
5754
+ */
5755
+ private _touchIdentifier?: number | null | undefined;
5756
+
5757
+ /**
5758
+ * The drag delegate object.
5759
+ *
5760
+ */
5761
+ private _delegate: BMDragDelegate;
5762
+
5763
+ /**
5764
+ * Initializes this drag session with the specified initial mouse or touch event
5765
+ * and drag delegate object.
5766
+ * @param event The initial event that starts this drag session.
5767
+ * @param dragDelegate The drag delegate object providing information about
5768
+ * the items in this drag session.
5769
+ * @param view The view initiating this drag session.
5770
+ * @param touchIdentifier If the event is a touch event, the identifier of the
5771
+ * touch that should be tracked for the drag session.
5772
+ * If not specified, the first touch will be used instead.
5773
+ * @return This drag session.
5774
+ *
5775
+ */
5776
+ private _initWithEvent(event: MouseEvent | TouchEvent, {dragDelegate, view, touchIdentifier}: {dragDelegate: BMDragDelegate, view: BMView, touchIdentifier?: number | null | undefined}): BMDragSession;
5777
+
5778
+
5779
+ /**
5780
+ * The current position of the drag session, relative to the viewport.
5781
+ *
5782
+ */
5783
+ readonly position: BMPoint;
5784
+
5785
+ /**
5786
+ * The drag indicator displaying information about the drag and drop session.
5787
+ *
5788
+ */
5789
+ private _dragIndicator?: _BMDragIndicator | null | undefined;
5790
+
5791
+ /**
5792
+ * The current drop target view, if any.
5793
+ *
5794
+ */
5795
+ private _dropTarget?: BMView | null | undefined;
5796
+
5797
+ /**
5798
+ * A map containing the views that represent valid drop targets for this session as keys
5799
+ * and the drop sessions that were created for each as the associated values.
5800
+ *
5801
+ */
5802
+ private _dropSessions: Map<BMView, BMDropSession | BMDragSession>;
5803
+
5804
+ /**
5805
+ * For touch drag sessions, an event handler used to determine when a new drop target
5806
+ * has been reached as the touch pointer moves over a new drop target.
5807
+ *
5808
+ */
5809
+ private _touchDropTargetHandler?: (($0: TouchEvent) => void) | null | undefined;
5810
+
5811
+ /**
5812
+ * A dictionary of event handlers that have been attached to the source view for which this
5813
+ * drag session was created.
5814
+ *
5815
+ */
5816
+ private _eventHandlers: Dictionary<unknown>;
5817
+
5818
+ /**
5819
+ * The preview set managing the drag previews.
5820
+ *
5821
+ */
5822
+ private _previewSet: _BMDragPreviewSet;
5823
+
5824
+ /**
5825
+ * An array of drop previews that can be used to customize the drop animation. This property is only
5826
+ * initialized at the end of the drag session if the delegate object implemented the
5827
+ * `dragSessionRequiresCustomDropAnimationForItems` method and returned `YES` from it when it was
5828
+ * invoked.
5829
+ *
5830
+ */
5831
+ readonly dropPreviews?: BMDropPreview[] | null | undefined;
5832
+
5833
+ /**
5834
+ * The kind of transfer that will be performed. Only set after the `dragSessionWillFinish` delegate
5835
+ * method returns if the outcome of the drag and drop gesture is transfer to a different view.
5836
+ * `undefined` in all other cases.
5837
+ *
5838
+ */
5839
+ readonly transferKind?: BMDragTransferKind | null | undefined;
5840
+
5841
+ /**
5842
+ * Set to `YES` after this drag session finishes.
5843
+ *
5844
+ */
5845
+ private _finished: boolean;
5846
+
5847
+ /**
5848
+ * Sets up the drag previews and indicator and appropriate event handlers and starts tracking
5849
+ * a drag originating from the event with which this drag session was initialized.
5850
+ *
5851
+ */
5852
+ private _beginDrag(): void;
5853
+
5854
+
5855
+ /**
5856
+ * Invoked when a key is pressed while this drag session is in progress.
5857
+ * @param event The event.
5858
+ *
5859
+ */
5860
+ private _keyPressedWithEvent(event: KeyboardEvent): void;
5861
+
5862
+
5863
+ /**
5864
+ * Invoked whenever the pointer moves while this drag session is in progress.
5865
+ * @param event The event.
5866
+ *
5867
+ */
5868
+ private _dragDidMoveWithEvent(event: MouseEvent | TouchEvent): void;
5869
+
5870
+
5871
+ /**
5872
+ * Invoked when the pointer is released or cancelled while this drag session is in progress.
5873
+ * @param event The event.
5874
+ * @return A promise that resolves when all associated animations finish.
5875
+ *
5876
+ */
5877
+ private _dragDidFinishWithEvent(event: MouseEvent | TouchEvent | KeyboardEvent): Promise<void>;
5878
+
5879
+
5880
+ /**
5881
+ * Sets up the event handlers that are used to determine when the drag moves over one
5882
+ * of the valid drop targets.
5883
+ *
5884
+ */
5885
+ private _initDropTargetHandlers(): void;
5886
+
5887
+
5888
+ /**
5889
+ * Removes the event handlers used to determine the drop target that have been set up for this drag session.
5890
+ *
5891
+ */
5892
+ private _releaseDropTargetHandlers(): void;
5893
+
5894
+
5895
+ /**
5896
+ * An identifier for the timeout registered to update the item previews after the
5897
+ * drag gesture moves over a new drop target.
5898
+ *
5899
+ */
5900
+ private _itemPreviewsUpdateIdentifier?: number | null | undefined;
5901
+
5902
+ /**
5903
+ * Updates the drop target, invoking the appropriate method on the delegate objects.
5904
+ * @param target The current drop target, or `undefined` if the drag gesture
5905
+ * is not currently over any drop target.
5906
+ *
5907
+ */
5908
+ private _setDropTarget(target?: BMView | null | undefined): void;
5909
+
5910
+
5911
+ /**
5912
+ * Causes this drag session to request a new drop action from its delegate if no
5913
+ * drop session is currently active, then set it as the current drop action.
5914
+ *
5915
+ */
5916
+ invalidateDropAction(): void;
5917
+
5918
+
5919
+ /**
5920
+ * Causes this drag session to request a new drop action from its delegate if the specified drop session
5921
+ * is the currently active one, then set it as the current action for the this session.
5922
+ *
5923
+ */
5924
+ private _invalidateDropActionForDropSession(): void;
5925
+
5926
+
5927
+ /**
5928
+ * Updates the drop action displayed by this drag session, based on the current
5929
+ * source and target drop actions.
5930
+ *
5931
+ */
5932
+ private _updateDropAction(): void;
5933
+
5934
+
5935
+ /**
5936
+ * Starts a drag and drop session from the specified mouse or touch event.
5937
+ * using a delegate to supply information about the items that are being transferred.
5938
+ * @param event The event starting the drag.
5939
+ * @param dragDelegate The delegate object providing information about the
5940
+ * items being dragged.
5941
+ * @param view The view initiating this drag session.
5942
+ * @param touchIdentifier If the event is a touch event, the identifier of the
5943
+ * touch that should be tracked for the drag session.
5944
+ * If not specified, the first touch will be used instead.
5945
+ *
5946
+ */
5947
+ private static _beginDragWithEvent (event: MouseEvent | TouchEvent, {dragDelegate, view, touchIdentifier}: {dragDelegate: BMDragDelegate, view: BMView, touchIdentifier?: number | null | undefined}): void;
5948
+
5949
+
5950
+ /**
5951
+ * Sets the maximum number of additional drag previews for multi-item drag sessions that can be displayed
5952
+ * in addition to the drag preview of the first item. Updating this value only affects drag sessions
5953
+ * started after this method returns.
5954
+ * @param max The new maximum number of previews to display.
5955
+ *
5956
+ */
5957
+ static setMaximumAdditionalDragPreviews (max: number): void;
5958
+
5959
+
5960
+ /**
5961
+ * A map containing views that are drop targets as keys and their associated drop delegate objects as values.
5962
+ *
5963
+ */
5964
+ private static _dropTargets (): void;
5965
+
5966
+
5967
+ /**
5968
+ * Registers a view as a potential drop target for future drag sessions, using the specified delegate
5969
+ * to handle updates to the associated drop sessions and the drop actions.
5970
+ *
5971
+ * If the view is already registered as a drop target, this will replace the delegate handling future
5972
+ * drop sessions for the view with the specified object.
5973
+ * @param target The view that will act as a drop target.
5974
+ * @param delegate The delegate that will handle actions and events from the drop
5975
+ * session on behalf of the target view.
5976
+ *
5977
+ */
5978
+ static registerDropTarget (target: BMView, {delegate}: {delegate: BMDropDelegate}): void;
5979
+
5980
+
5981
+ /**
5982
+ * Unregisters a view as a potential drop target for future drag sessions. This has no effect on any
5983
+ * in-progress drop sessions which will continue using the previously registered delegate to handle
5984
+ * events and actions.
5985
+ *
5986
+ * This method has no effect if the view is not registered as a drop target.
5987
+ * @param target The view that was previously registered as a drop target.
5988
+ *
5989
+ */
5990
+ static unregisterDropTarget (target: BMView): void;
5991
+
5992
+ }
5993
+
5994
+
5995
+ export class BMDropSession {
5996
+
5997
+ /**
5998
+ * The drag session managing the drag gesture for which this drop session was created.
5999
+ *
6000
+ */
6001
+ private _dragSession: BMDragSession;
6002
+
6003
+ /**
6004
+ * The drop delegate specifying the behaviour of the drop over this drop target.
6005
+ *
6006
+ */
6007
+ private _delegate: BMDropDelegate;
6008
+
6009
+ /**
6010
+ * A dictionary of event handlers that have been attached to the drop target view for which this
6011
+ * drop session was created.
6012
+ *
6013
+ */
6014
+ private _eventHandlers: Dictionary<unknown>;
6015
+
6016
+ /**
6017
+ * The current drop action.
6018
+ *
6019
+ */
6020
+ readonly dropAction: BMDropSessionAction;
6021
+
6022
+ /**
6023
+ * Causes this drop session to request a new drop action from its delegate if it
6024
+ * is the current active drop session for the current drag session, then set it as the current action
6025
+ * for the drag session.
6026
+ *
6027
+ */
6028
+ invalidateDropAction(): void;
6029
+
6030
+
6031
+ /**
6032
+ * An array of drop previews that can be used to customize the drop animation. This property is only
6033
+ * initialized at the end of accepted drop sessions if the delegate object implemented the
6034
+ * `dropSessionRequiresCustomDropAnimationForItems` method and returned `YES` from it.
6035
+ *
6036
+ */
6037
+ readonly dropPreviews?: BMDropPreview[] | null | undefined;
6038
+
6039
+ /**
6040
+ * The kind of transfer that will be performed. Only set before the `dropSessionPerformDrop` delegate
6041
+ * method is invoked if the outcome of this drop session is a transfer of items into the target view.
6042
+ *
6043
+ */
6044
+ readonly transferKind?: BMDragTransferKind | null | undefined;
6045
+
6046
+ /**
6047
+ * Initializes this drop session with the specified drag session and the drop delegate.
6048
+ * @param session The drag session associated with this drop session
6049
+ * @param delegate The drop delegate used to determine the outcome of the drop.
6050
+ * @return This drop session.
6051
+ *
6052
+ */
6053
+ private _initWithDragSession(session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
6054
+
6055
+
6056
+ /**
6057
+ * The current position of the drag and drop gesture.
6058
+ *
6059
+ */
6060
+ readonly position: BMPoint;
6061
+
6062
+ /**
6063
+ * The items being transferred in the drag and drop gesture.
6064
+ *
6065
+ */
6066
+ readonly items: BMDragItem[];
6067
+
6068
+ /**
6069
+ * The items that have been accepted through this drop session. This property is only initialized
6070
+ * before the `dropSessionPerformDrop` delegate method is invoked.
6071
+ *
6072
+ */
6073
+ readonly dropItems?: BMDragItem[] | null | undefined;
6074
+
6075
+ /**
6076
+ * Creates and returns a drop session initialized with the specified drag session and the drop delegate.
6077
+ * @param session The drag session associated with the drop session
6078
+ * @param delegate The drop delegate used to determine the outcome of the drop.
6079
+ * @return A drop session.
6080
+ *
6081
+ */
6082
+ private static _sessionForDragSession (session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
6083
+
6084
+ }
6085
+
6086
+
6087
+ /**
6088
+ * The specification of a `BMDragDelegate` object which is used to obtain information about a dragging session
6089
+ * from the object that starts it and customize its behaviour depending on its position in the viewport.
6090
+ *
6091
+ */
6092
+ export interface BMDragDelegate {
6093
+
6094
+ /**
6095
+ * Invoked at the beginning of a drag session to obtain the initial items that will be
6096
+ * part of the drag session.
6097
+ *
6098
+ * The delegate object implementing this method must provide an array of drag items that
6099
+ * will be transferred as part of the drag session. The array must contain at least one item.
6100
+ * @param session The drag session that is starting.
6101
+ * @return An array of drag items that will be part of the drag session.
6102
+ *
6103
+ */
6104
+ dragSessionInitialItems(session: BMDragSession): BMDragItem[];
6105
+
6106
+
6107
+ /**
6108
+ * Invoked by a drag session to obtain a preview for the specified drag item at the beginning
6109
+ * of a drag session. The drag session will invoke this method only for the first few items
6110
+ * that will be visible while the drag session is in progress.
6111
+ *
6112
+ * Delegate objects implementing this method must provide an appropriate preview for the
6113
+ * specified item by returning a {@link BMDragPreview} object initialized for the specified
6114
+ * drag item.
6115
+ * @param session The drag session for which to supply an item preview.
6116
+ * @param item An item that is part of the drag session whose preview
6117
+ * should be provided.
6118
+ * @return The preview that will be displayed for the item.
6119
+ *
6120
+ */
6121
+ dragSessionPreviewForItem(session: BMDragSession, item: BMDragItem): BMDragPreview;
6122
+
6123
+
6124
+ /**
6125
+ * Invoked when a drag session is about to end and there items that will not be transferred to determine if
6126
+ * the drag delegate wants to play a customized drop animation for the specified items which for
6127
+ * which drag previews are currently displayed. This method is only invoked if there is at least one item
6128
+ * with a preview that will not be transferred or deleted as part of the drag session.
6129
+ *
6130
+ * Implementing and returning `YES` from this method will cause the drag session to not play the
6131
+ * standard drop animation for the specified items. Instead, in the `dragSessionAnimateDropWithPreviews`,
6132
+ * `dragSessionPerformMoveForItems` and `dragSessionPerformDelete` methods,
6133
+ * the drag session's `dropPreviews` property will contain an array of drag previews that can be
6134
+ * used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
6135
+ * @param session The drag session.
6136
+ * @param items The items that have not been accepted for transferring or deleted.
6137
+ * @return `NO` to play the standard drop animation, or `YES` to play
6138
+ * a customized drop animation.
6139
+ *
6140
+ */
6141
+ dragSessionRequiresCustomDropAnimationForItems?(session: BMDragSession, items: BMDragItem[]): boolean;
6142
+
6143
+
6144
+ /**
6145
+ * Invoked after returning `YES` from `dragSessionRequiresCustomDropAnimationForItems` to play a drop animation
6146
+ * for the specified drop previews. Delegate objects implementing this method should play an appropriate drop animation
6147
+ * for the specified drop previews, then detach them from the document.
6148
+ * @param session The drag session for which to play the drop animation.
6149
+ * @param previews The drop previews that should be animated.
6150
+ *
6151
+ */
6152
+ dragSessionAnimateDropWithPreviews?(session: BMDragSession, previews: BMDropPreview[]): void;
6153
+
6154
+
6155
+ /**
6156
+ * Invoked by a drag session after a drop target accepts or partially accepts the items in the session
6157
+ * and both this delegate and the associated drop delegate have specified that the transfer should
6158
+ * be a transfer of kind `.Move`.
6159
+ *
6160
+ * Delegate objects that support moving items must implement this method and remove the specified
6161
+ * items that have been moved into the drop target.
6162
+ * @param session The drag session through which items have been moved.
6163
+ * @param items The items that have been moved into the drop target. These
6164
+ * may be a subset of the session's items if the drop target
6165
+ * has specified a drop action of `.AcceptPartially`.
6166
+ *
6167
+ */
6168
+ dragSessionPerformMoveForItems?(session: BMDragSession, items: BMDragItem[]): void;
6169
+
6170
+
6171
+ /**
6172
+ * Invoked by a drag session if a drop occurs in a location where this delegate has specified that
6173
+ * the action should be to delete the items.
6174
+ *
6175
+ * Delegate objects that support deleting items must implement this method and remove all items in
6176
+ * the drag session.
6177
+ * @param session The drag session through which the items have been removed.
6178
+ *
6179
+ */
6180
+ dragSessionPerformDelete?(session: BMDragSession): void;
6181
+
6182
+
6183
+ /**
6184
+ * Invoked by a drag session to determine if items can be transferred to other drop targets.
6185
+ *
6186
+ * Delegate objects implementing this method should return a boolean indicating whether
6187
+ * transfers can be performed or not. A return value of `YES` is assumed when this method
6188
+ * is not implemented by the delegate object.
6189
+ * @param session The drag session that will be transferring items.
6190
+ * @return `YES` if item transfer is supported, `NO` otherwise.
6191
+ *
6192
+ */
6193
+ dragSessionCanTransferItems?(session: BMDragSession): boolean;
6194
+
6195
+
6196
+ /**
6197
+ * Invoked by a drag session that is about to begin from this delegate.
6198
+ * @param session The drag session that is about to begin.
6199
+ *
6200
+ */
6201
+ dragSessionWillBegin?(session: BMDragSession): void;
6202
+
6203
+
6204
+ /**
6205
+ * Invoked when a drag session enters the frame of the source view.
6206
+ * @param session The drag session that entered the view's frame.
6207
+ *
6208
+ */
6209
+ dragSessionDidEnter?(session: BMDragSession): void;
6210
+
6211
+
6212
+ /**
6213
+ * Invoked by a drag session whenever its position is updated. This method is continually
6214
+ * invoked as the drag position changes, even while the gesture moves outside of the
6215
+ * source view's frame.
6216
+ * Delegates implementing this method should return a drop action indicating the outcome of
6217
+ * dropping the items at the session's current position.
6218
+ * @param session The drag session. Its position may be retrieved via
6219
+ * the `position` property.
6220
+ * @return The new action the source view would like to perform if the
6221
+ * drop session ended at the current position, or `undefined`
6222
+ * if the current action should be retained.
6223
+ *
6224
+ */
6225
+ dragSessionDidUpdate?(session: BMDragSession): BMDragSessionAction | null | undefined;
6226
+
6227
+
6228
+ /**
6229
+ * Invoked when a drag session exits the frame of the source view.
6230
+ * @param session The drag session that exited the view's frame.
6231
+ *
6232
+ */
6233
+ dragSessionDidExit?(session: BMDragSession): void;
6234
+
6235
+
6236
+ /**
6237
+ * Invoked by a drag session to obtain the kind of transfer to perform for the items being dragged.
6238
+ * This method is invoked when the drop occurs on a drop target that accepted the transfer or whenever
6239
+ * a drop requests a drop action that requires a specific transfer kind.
6240
+ *
6241
+ * Delegate objects implementing this method should return an appropriate transfer kind for
6242
+ * the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
6243
+ * @param session The drag session through which the item transfer was performed.
6244
+ * @return The kind of transfer to perform.
6245
+ *
6246
+ */
6247
+ dragSessionTransferKind?(session: BMDragSession): BMDragTransferKind;
6248
+
6249
+
6250
+ /**
6251
+ * Invoked by a drag session that is about to finish.
6252
+ *
6253
+ * Delegate objects may optionally implement this method to perform any necessary cleanup
6254
+ * before the drag session ends.
6255
+ * @param session The drag session.
6256
+ *
6257
+ */
6258
+ dragSessionWillFinish?(session: BMDragSession): void;
6259
+
6260
+
6261
+ /**
6262
+ * Invoked by a drag session that has finished and all associated animations have concluded.
6263
+ *
6264
+ * Delegate objects may optionally implement this method to perform any necessary cleanup
6265
+ * before the drag session ends.
6266
+ * @param session The drag session.
6267
+ *
6268
+ */
6269
+ dragSessionDidFinish?(session: BMDragSession): void;
6270
+
6271
+ }
6272
+
6273
+
6274
+ /**
6275
+ * The specification of a `BMDropDelegate` object which is used to obtain information about
6276
+ * whether a drag session can be accepted by potential drop targets and to customize the information
6277
+ * presented to users as the drag moves over the drop area.
6278
+ *
6279
+ */
6280
+ export interface BMDropDelegate {
6281
+
6282
+ /**
6283
+ * Invoked when a drag session starts to verify if the target view can accept the items
6284
+ * in the specified drop session. When returning `YES` from this method, the view will
6285
+ * be considered a valid drop target for the session and will receive updates when the
6286
+ * drag will enter the view's frame.
6287
+ * @param session The drop session containing the items to be verified.
6288
+ * @return `YES` if at least one item is acceptable for dropping,
6289
+ * `NO` otherwise.
6290
+ *
6291
+ */
6292
+ dropSessionCanBegin(session: BMDropSession): boolean;
6293
+
6294
+
6295
+ /**
6296
+ * Invoked when a drop session ends while in the target view's frame. Delegate objects implementing
6297
+ * this method should perform the appropriate changes based on the session's drop action.
6298
+ * @param session The drop session for which to perform the drop action.
6299
+ *
6300
+ */
6301
+ dropSessionPerformDrop(session: BMDropSession): void;
6302
+
6303
+
6304
+ /**
6305
+ * Invoked when a drop session is about to end while in the target view's frame to determine if
6306
+ * the drop delegate wants to play a customized drop animation for the specified items which for
6307
+ * which drag previews are currently displayed. This method is only invoked if the specified drop
6308
+ * action is `.Accept` or `.AcceptPartially`.
6309
+ *
6310
+ * Implementing and returning `YES` from this method will cause the drop session to not play the
6311
+ * standard drop animation for the specified items. Instead, in the `dropSessionPerformDrop` method,
6312
+ * the drop session's `dropPreviews` property will contain an array of drop previews that can be
6313
+ * used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
6314
+ * @param session The drop session.
6315
+ * @param items The items that have been accepted by the drop target and which
6316
+ * have drag previews associated with them.
6317
+ * @return `NO` to play the standard drop animation, or `YES` to play
6318
+ * a customized drop animation.
6319
+ *
6320
+ */
6321
+ dropSessionRequiresCustomDropAnimationForItems?(session: BMDropSession, items: BMDragItem[]): boolean;
6322
+
6323
+
6324
+ /**
6325
+ * Invoked by a drop session to obtain the kind of transfer to perform for the items being dragged.
6326
+ * This method is invoked when the drop occurs on a drop target that accepted the transfer.
6327
+ * Delegate objects implementing this method should return an appropriate transfer kind for
6328
+ * the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
6329
+ * @param session The drop session through which the item transfer was performed.
6330
+ * @return The kind of transfer to perform.
6331
+ *
6332
+ */
6333
+ dropSessionTransferKind?(session: BMDropSession): BMDragTransferKind;
6334
+
6335
+
6336
+ /**
6337
+ * Invoked when a drop session enters the frame of the target view.
6338
+ * @param session The drop session that entered the view's frame.
6339
+ *
6340
+ */
6341
+ dropSessionDidEnter?(session: BMDropSession): void;
6342
+
6343
+
6344
+ /**
6345
+ * Invoked by a drop session whenever it updates while over the target view's frame. This method
6346
+ * is invoked when the session enters the frame and whenever it moves.
6347
+ * Delegates implementing this method should return a drop action indicating the outcome of
6348
+ * dropping the items at the session's current position.
6349
+ * @param session The drop session that updated.
6350
+ * @return The new action the target view would like to perform if the
6351
+ * drop session ended at the current position, or `undefined`
6352
+ * if the current action should be retained.
6353
+ *
6354
+ */
6355
+ dropSessionDidUpdate?(session: BMDropSession): BMDropSessionAction | null | undefined;
6356
+
6357
+
6358
+ /**
6359
+ * Invoked when a drop session exits the frame of the target view. Subsequent updates for this drop
6360
+ * session will no longer be provided until the drop session moves into the target view again.
6361
+ * @param session The drop session that exited the view's frame.
6362
+ *
6363
+ */
6364
+ dropSessionDidExit?(session: BMDropSession): void;
6365
+
6366
+
6367
+ /**
6368
+ * Invoked to notify the delegate that the specified drop session is about to finish. This is invoked for a drop
6369
+ * delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
6370
+ * in the target view's frame or not.
6371
+ * @param session The drop session that ended.
6372
+ *
6373
+ */
6374
+ dropSessionWillFinish?(session: BMDropSession): void;
6375
+
6376
+
6377
+ /**
6378
+ * Invoked to notify the delegate that the specified drop session has finished. This is invoked for a drop
6379
+ * delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
6380
+ * in the target view's frame or not.
6381
+ * @param session The drop session that ended.
6382
+ *
6383
+ */
6384
+ dropSessionDidFinish?(session: BMDropSession): void;
6385
+
6386
+
6387
+ /**
6388
+ * Invoked by a drop session to obtain a preview for the specified drag item while the session is in
6389
+ * the target view's frame.
6390
+ *
6391
+ * Delegate objects implementing this method may provide an appropriate preview for the
6392
+ * specified item by returning a {@link BMDragPreview} object initialized for the specified
6393
+ * drag item. When this method is not implemented, or when returning `undefined`, the preview
6394
+ * already in use for the item will continue to be used while the session is the target view's frame.
6395
+ * @param session The drop session for which to supply an item preview.
6396
+ * @param item An item that is part of the drop session whose preview
6397
+ * should be provided.
6398
+ * @return If specified, the preview that will be displayed for the item.
6399
+ * If omitted, the current preview will continue to be used.
6400
+ *
6401
+ */
6402
+ dropSessionPreviewForItem?(session: BMDropSession, item: BMDragItem): BMDragPreview | null | undefined;
6403
+
6404
+ }
6405
+
6406
+
6407
+ /**
6408
+ * A provider that can supply the contents of an item that is part of a drag and drop gesture
6409
+ * in various representations.
6410
+ *
6411
+ */
6412
+ export interface BMDragItem {
6413
+
6414
+ /**
6415
+ * Invoked to determine whether the contents of this drag item supports being represented
6416
+ * as the specified developer-defined type.
6417
+ * @param type The type being checked.
6418
+ * @return `YES` if the content can be represented as the specified
6419
+ * type, `NO` otherwise.
6420
+ *
6421
+ */
6422
+ canConformToType(type: string): boolean;
6423
+
6424
+
6425
+ /**
6426
+ * Invoked to obtain the representation of the contents in this drag item converted to the specified
6427
+ * developer-defined type. If `canConformToType` returns `YES` for that type, this method must be able
6428
+ * to return an object of that type.
6429
+ *
6430
+ * Core UI may invoke this method supplying a type of `default` to obtain a representation to use for
6431
+ * legacy APIs. In this case, this method can return any representation, but multiple invocations of
6432
+ * this method with the `default` type must return the same representation.
6433
+ * @param type The type of object to return.
6434
+ * @return An object if the specified type representing this drag item's contents.
6435
+ *
6436
+ */
6437
+ itemOfType(type: string): unknown;
6438
+
6439
+ }
6440
+
6441
+
6442
+ export class BMDropSessionActionKind {
6443
+ /**
6444
+ * Indicates that this drag session is ignored by the drop target and should be treated
6445
+ * as if the items are simply dragged out of the source view.
6446
+ *
6447
+ */
6448
+ static Ignore: BMDropSessionActionKind;
6449
+
6450
+ /**
6451
+ * Indicates that the drop target can normally accept items from the source view but none
6452
+ * of the items in the current session are acceptable. Finishing the gesture over the
6453
+ * current drop target should cancel the gesture.
6454
+ *
6455
+ */
6456
+ static Reject: BMDropSessionActionKind;
6457
+
6458
+ /**
6459
+ * Indicates that the drop target can accept the items in the drag session, but dropping them
6460
+ * will cause the items to be deleted. Requires the source view to specify a `.Move` transfer
6461
+ * for this drag session, otherwise the action reverts to `.Reject`.
6462
+ *
6463
+ */
6464
+ static Delete: BMDropSessionActionKind;
6465
+
6466
+ /**
6467
+ * Indicates that the drop target can accept all the items in the drag session.
6468
+ *
6469
+ */
6470
+ static Accept: BMDropSessionActionKind;
6471
+
6472
+ /**
6473
+ * Indicates that the drop target can accept only some of the items in the drag session.
6474
+ * Finishing the gesture will cause the unacceptable items to be discarded.
6475
+ *
6476
+ */
6477
+ static AcceptPartially: BMDropSessionActionKind;
6478
+
6479
+ private constructor();
6480
+ }
6481
+
6482
+ export class BMDragSessionActionKind {
6483
+ /**
6484
+ * Indicates that dropping the items at the current location will have no additional effect.
6485
+ *
6486
+ */
6487
+ static Ignore: BMDragSessionActionKind;
6488
+
6489
+ /**
6490
+ * Indicates that ending the drag session at the current location will cause the items to be
6491
+ * deleted.
6492
+ *
6493
+ */
6494
+ static Delete: BMDragSessionActionKind;
6495
+
6496
+ /**
6497
+ * Indicates that dropping the items at the current location would normally cause an effect,
6498
+ * but that action cannot currently be performed.
6499
+ * Finishing the gesture over the current drop target should cancel the gesture.
6500
+ *
6501
+ */
6502
+ static Reject: BMDragSessionActionKind;
6503
+
6504
+ private constructor();
6505
+ }
6506
+
6507
+ /**
6508
+ * An object that describes the action that should be performed for a drag or drop
6509
+ * session when it ends.
6510
+ *
6511
+ */
6512
+ export class _BMDragDropSessionAction {
6513
+
6514
+ /**
6515
+ * The action to perform at the end of the drag session.
6516
+ *
6517
+ */
6518
+ private _action: BMDragSessionActionKind | BMDropSessionActionKind;
6519
+
6520
+ /**
6521
+ * If specified, the message text to display for this outcome.
6522
+ *
6523
+ */
6524
+ private _message?: string | null | undefined;
6525
+
6526
+ /**
6527
+ * If specified, the message markup to display for this outcome.
6528
+ *
6529
+ */
6530
+ private _messageHTML?: string | null | undefined;
6531
+
6532
+ /**
6533
+ * If specified when the action is `.AcceptPartially`, the drag items that are actually acceptable.
6534
+ * If omitted, the UI will not indicate which items are acceptable.
6535
+ *
6536
+ */
6537
+ private _acceptableItems?: BMDragItem[] | null | undefined;
6538
+ }
6539
+
6540
+
6541
+ /**
6542
+ * An object that represents a preview of a drag item and is displayed during a drag session.
6543
+ *
6544
+ */
6545
+ export class BMDragPreview {
6546
+
6547
+ /**
6548
+ * The drag item represented by this drag preview.
6549
+ *
6550
+ */
6551
+ private _dragItem: BMDragItem;
6552
+
6553
+ /**
6554
+ * Initializes this drag preview by creating a copy of the specified source node.
6555
+ * @param node The source node.
6556
+ * @param forItem The drag item for which a preview is created.
6557
+ * @return This drag preview.
6558
+ *
6559
+ */
6560
+ initWithCopyOfSourceNode(node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
6561
+
6562
+
6563
+ /**
6564
+ * Designated initializer. Initializes this drag preview with the specified preview node
6565
+ * and optionally a source node.
6566
+ * @param node The node representing the preview.
6567
+ * @param forItem The drag item for which a preview is created.
6568
+ * @param sourceNode If specified, the node that the drag item represents.
6569
+ * @return This drag preview.
6570
+ *
6571
+ */
6572
+ initWithPreviewNode(node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
6573
+
6574
+
6575
+ /**
6576
+ * The source node for which a preview is generated. This is used to run an appropriate animation
6577
+ * from the node corresponding to the drag item when the drag session starts or finishes.
6578
+ *
6579
+ * If the source node is not provided, a generic animation will typically play instead for the preview node.
6580
+ *
6581
+ */
6582
+ private _sourceNode?: DOMNode | null | undefined;
6583
+
6584
+ /**
6585
+ * The node representing the preview. This node should not be modified while a drag
6586
+ * session is in progress.
6587
+ *
6588
+ */
6589
+ readonly previewNode: DOMNode;
6590
+
6591
+ /**
6592
+ * When set to `YES`, this indicates that the preview node is an exact copy of the source node
6593
+ * and a transition between the preview and source node is not required.
6594
+ *
6595
+ */
6596
+ private _isCopyOfSourceNode: boolean;
6597
+
6598
+ /**
6599
+ * The current frame of the drag preview, before any transforms are applied.
6600
+ *
6601
+ */
6602
+ readonly frame: BMRect;
6603
+
6604
+ /**
6605
+ * Updates this preview's position on screen.
6606
+ * @param position The new position, relative to the center of this preview's frame.
6607
+ *
6608
+ */
6609
+ private _setPosition(position: BMPoint): void;
6610
+
6611
+
6612
+ /**
6613
+ * Applies the specified frame to the preview node.
6614
+ * @param frame The frame to apply.
6615
+ *
6616
+ */
6617
+ private _applyFrame(frame: BMRect): void;
6618
+
6619
+
6620
+ /**
6621
+ * A dictionary containing transform property names as keys and their applied values, expressed
6622
+ * in pixels as the value. The contents of object should not be modified while the drag session
6623
+ * is in progress.
6624
+ *
6625
+ */
6626
+ readonly transform: Dictionary<number>;
6627
+
6628
+ /**
6629
+ * Applies the transform to the preview node.
6630
+ * @param transform The transform dictionary. See {@link BMDragPreview.transform}.
6631
+ *
6632
+ */
6633
+ private _applyTransform(transform: Dictionary<number>): void;
6634
+
6635
+
6636
+ /**
6637
+ * The total amount of displacement to apply for this preview when rejected.
6638
+ *
6639
+ */
6640
+ private _rejectionDistance: number;
6641
+
6642
+ /**
6643
+ * Set to YES when this preview is displaced to indicate that it is rejected.
6644
+ *
6645
+ */
6646
+ private _rejected: boolean;
6647
+
6648
+ /**
6649
+ * Updates the rejection distance to the specified number of pixels. If this preview is
6650
+ * currently rejected, its position will be animated to the new distance.
6651
+ * @param distance The number of pixels to displace this preview by when rejected.
6652
+ *
6653
+ */
6654
+ private _setRejectionDistance(distance: number): void;
6655
+
6656
+
6657
+ /**
6658
+ * Set to `YES` while this preview is playing the rejection animation.
6659
+ *
6660
+ */
6661
+ private _rejecting: boolean;
6662
+
6663
+ /**
6664
+ * Updates the rejection state of this drag preview.
6665
+ * @param rejected `YES` if this preview's item is rejected, `NO` otherwise.
6666
+ *
6667
+ */
6668
+ private _setRejected(rejected: boolean): void;
6669
+
6670
+
6671
+ /**
6672
+ * Set to `YES` while this preview's frame is animating.
6673
+ *
6674
+ */
6675
+ private _animatingFrame: boolean;
6676
+
6677
+ /**
6678
+ * Set to `YES` after the preview node has been measured.
6679
+ *
6680
+ */
6681
+ private _measured: boolean;
6682
+
6683
+ /**
6684
+ * Measures the preview node and updates the frame to the measured size.
6685
+ *
6686
+ */
6687
+ private _measure(): void;
6688
+
6689
+
6690
+ /**
6691
+ * Attaches this drag session preview to the document and applies its frame and transform properties.
6692
+ * @param position If specified, the point at which the preview will be attached,
6693
+ * relative to the viewport.
6694
+ * @param before If specified, a node before which the preview node will be attached.
6695
+ * @return An iterator that must be iterated to sync DOM reads and writes
6696
+ * when multiple previews are attached at the same time.
6697
+ *
6698
+ */
6699
+ private _attachAtPosition(position?: BMPoint | null | undefined, {before}?: {before?: DOMNode | null | undefined}): Iterator<void>;
6700
+
6701
+
6702
+ /**
6703
+ * Set to the source animation during the lift animation.
6704
+ *
6705
+ */
6706
+ private _animationSourceNode?: DOMNode | null | undefined;
6707
+
6708
+ /**
6709
+ * Plays the lift animation for this drag preview at the beginning of a drag session or when the associated
6710
+ * item is added to an in-progress drag session.
6711
+ * @return A promise that resolves when the associated animation completes.
6712
+ *
6713
+ */
6714
+ private _performLift(): Promise<void>;
6715
+
6716
+
6717
+ /**
6718
+ * Set to `YES` if this preview's drop animation is handled by the drop delegate.
6719
+ *
6720
+ */
6721
+ private _dropHandled: boolean;
6722
+
6723
+ /**
6724
+ * Plays the drop animation for this drag preview at the end of the drag session, if the current
6725
+ * drop target did not handle the drop animation on its own.
6726
+ * @return A promise that resolves when the associated animation completes.
6727
+ *
6728
+ */
6729
+ private _performDrop(): Promise<void>;
6730
+
6731
+
6732
+ /**
6733
+ * Plays the delete animation for this drag preview at the end of the drag session, if the drop
6734
+ * action was set to `.Delete`.
6735
+ * @return A promise that resolves when the associated animation completes.
6736
+ *
6737
+ */
6738
+ private _performDelete(): Promise<void>;
6739
+
6740
+
6741
+ /**
6742
+ * If specified, the preview this preview is transitioning from, while the transition
6743
+ * is in progress. `undefined` in all other cases.
6744
+ *
6745
+ */
6746
+ private _transitionPreview: BMDragPreview;
6747
+
6748
+ /**
6749
+ * A unique identifier for transitions, used to perform the appropriate cleanup at the end
6750
+ * of the transition only when needed.
6751
+ *
6752
+ */
6753
+ private _transitionUID: number;
6754
+
6755
+ /**
6756
+ * Plays a transition animation from the specified drag preview to this drag preview, when the drag
6757
+ * session transitions to a new drop target. Detaches the specified drag preview from the document
6758
+ * if different from the current one.
6759
+ * @param preview The drag preview from which to play a transition.
6760
+ * @param fromRejectionDistance The reject distance prior to this transition taking place.
6761
+ * @return A promise that resolves when the associated animation completes.
6762
+ *
6763
+ */
6764
+ private _performTransitionFromDragPreview(preview: BMDragPreview, {fromRejectionDistance}: {fromRejectionDistance: number}): Promise<void>;
6765
+
6766
+
6767
+ /**
6768
+ * Controls whether this drag preview is detachable. Active drag previews are not detachable.
6769
+ *
6770
+ */
6771
+ private _detachable: boolean;
6772
+
6773
+ /**
6774
+ * Detaches this drag preview from the document and resets its transform to the values of the `_transform` property.
6775
+ * The preview should be reattached to the document using {@link BMDragPreview._attach} before being reused.
6776
+ *
6777
+ */
6778
+ private _detach(): void;
6779
+
6780
+
6781
+ /**
6782
+ * Creates and returns a drag preview initialized by creating a copy of the specified source node.
6783
+ * @param node The source node.
6784
+ * @param forItem The drag item for which a preview is created.
6785
+ * @return A drag preview.
6786
+ *
6787
+ */
6788
+ static dragPreviewWithCopyOfSourceNode (node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
6789
+
6790
+
6791
+ /**
6792
+ * Creates and returns a drag preview initialized with the specified preview node and optionally a source node.
6793
+ * @param node The node representing the preview.
6794
+ * @param forItem The drag item for which a preview is created.
6795
+ * @param sourceNode If specified, the node that the drag item represents.
6796
+ * @return A drag preview.
6797
+ *
6798
+ */
6799
+ static dragPreviewWithPreviewNode (node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
6800
+
6801
+ }
6802
+
6803
+
6804
+ /**
6805
+ * An object that represents a preview of a drag item at the end of a drop session that can be used
6806
+ * by the drop delegate to play an appropriate drop animation for the item. When using the drop preview
6807
+ * to customize the drop animation, it is the responsibility of the drop delegate object to detach
6808
+ * the drop preview at the end of the animation, unless using one of the built-in animations provided
6809
+ * by the drop preview.
6810
+ *
6811
+ * Drop previews should not be created manually. Core UI will automatically create drop previews for
6812
+ * the appropriate items at the end of a drop session if there are items that have been accepted
6813
+ * by the drop target.
6814
+ *
6815
+ */
6816
+ export class BMDropPreview {
6817
+
6818
+ /**
6819
+ * The original drag preview from which this drop preview was created.
6820
+ *
6821
+ */
6822
+ private _preview: BMDragPreview;
6823
+
6824
+ /**
6825
+ * The drag item represented by this drop preview.
6826
+ *
6827
+ */
6828
+ readonly item: BMDragItem;
6829
+
6830
+ /**
6831
+ * Initializes this drop preview with the specified drag preview and drag item.
6832
+ * @param preview The original drag preview.
6833
+ * @param forItem The item represented by this preview.
6834
+ * @return This drop preview.
6835
+ *
6836
+ */
6837
+ private _initWithDragPreview(preview: BMDragPreview, {forItem}: {forItem: BMDragItem}): BMDropPreview;
6838
+
6839
+
6840
+ /**
6841
+ * The HTML element representing this preview.
6842
+ *
6843
+ */
6844
+ readonly previewNode: any;
6845
+
6846
+ /**
6847
+ * A rect that describes the current position and size of the preview node relative to the viewport.
6848
+ *
6849
+ */
6850
+ readonly frame: any;
6851
+
6852
+ /**
6853
+ * An object that describes the transform currently applied to the preview node. Its keys are transform
6854
+ * function names and its values are numbers representing the associated values. The units for the values are:
6855
+ * - `deg` for rotation properties
6856
+ * - `px` for translation properties
6857
+ * - untyped for scale properties
6858
+ *
6859
+ * The rotation transforms are always applied after all other transforms.
6860
+ *
6861
+ */
6862
+ readonly transform: any;
6863
+
6864
+ /**
6865
+ * Plays a generic drop animation for this drop preview. This method must be invoked while an animation context is active.
6866
+ * When the animation finishes this drag preview is detached from the document.
6867
+ *
6868
+ */
6869
+ performDrop(): void;
6870
+
6871
+
6872
+ /**
6873
+ * Plays a drop animation that visually transforms this drop preview into the specified node. This method must be invoked
6874
+ * while an animation context is active. When the animation finishes this drag preview is detached from the document.
6875
+ * @param node The node towards which to play the drop animation.
6876
+ *
6877
+ */
6878
+ performDropToNode(node: DOMNode): void;
6879
+
6880
+ }
6881
+
6882
+
6883
+ export class _BMDragIndicatorOrientation {
6884
+ /**
6885
+ * Indicates that the drag indicator should appear on the top left corner.
6886
+ *
6887
+ */
6888
+ static Left: _BMDragIndicatorOrientation;
6889
+
6890
+ /**
6891
+ * Indicates that the drag indicator should appear on the top right corner.
6892
+ *
6893
+ */
6894
+ static Right: _BMDragIndicatorOrientation;
6895
+
6896
+ private constructor();
6897
+ }
6898
+
6899
+ /**
6900
+ * An object that manages the indicator that appears during a drag and drop gesture.
6901
+ *
6902
+ */
6903
+ export class _BMDragIndicator {
6904
+
6905
+ /**
6906
+ * The number of items that are acceptable for the current drop target. This should be equal to
6907
+ * or lower than the total number of items in this drag session.
6908
+ *
6909
+ */
6910
+ private _acceptableItemCount: number;
6911
+
6912
+ /**
6913
+ * The node containing the indicator.
6914
+ *
6915
+ */
6916
+ private _containerNode: DOMNode;
6917
+
6918
+ /**
6919
+ * The node displaying the item count, drop outcome and message.
6920
+ *
6921
+ */
6922
+ private _indicatorNode: DOMNode;
6923
+
6924
+ /**
6925
+ * The node displaying the icon associated with the current drop icon.
6926
+ *
6927
+ */
6928
+ private _iconNode: DOMNode;
6929
+
6930
+ /**
6931
+ * The HTML element representing the message displayed to the user.
6932
+ *
6933
+ */
6934
+ private _messageNode: DOMNode;
6935
+
6936
+ /**
6937
+ * The HTML element used to measure the message text.
6938
+ *
6939
+ */
6940
+ private _messageMeasurementNode: DOMNode;
6941
+
6942
+ /**
6943
+ * The message text currently displayed on the drag indicator.
6944
+ *
6945
+ */
6946
+ private _message?: string | null | undefined;
6947
+
6948
+ /**
6949
+ * The message HTML markup currently displayed on the drag indicator.
6950
+ *
6951
+ */
6952
+ private _message?: string | null | undefined;
6953
+
6954
+ /**
6955
+ * The kind of action displayed on the indicator.
6956
+ *
6957
+ */
6958
+ private _dropActionKind: BMDragSessionActionKind | BMDropSessionActionKind;
6959
+
6960
+ /**
6961
+ * Initializes this drag indicator and attaches it to the document.
6962
+ * @return This drag indicator.
6963
+ *
6964
+ */
6965
+ init(): _BMDragIndicator;
6966
+
6967
+
6968
+ /**
6969
+ * Updates the contents of this drag indicator using the details of the specified
6970
+ * drag or drop action.
6971
+ * @param action The action.
6972
+ *
6973
+ */
6974
+ setAction(action: BMDragSessionAction | BMDropSessionAction): void;
6975
+
6976
+
6977
+ /**
6978
+ * The offset between the drag pointer and the center of this drag indicator.
6979
+ *
6980
+ */
6981
+ private _offset: BMPoint;
6982
+
6983
+ /**
6984
+ * The unique sequence identifier of the current offset animation.
6985
+ *
6986
+ */
6987
+ private _offsetAnimationID: number;
6988
+
6989
+ /**
6990
+ * Updates the offset of the indicator from the pointer's position.
6991
+ * @param offset The new offset to use.
6992
+ * @param animated Defaults to `NO`. When set to `YES` this change will be
6993
+ * animated, otherwise it will be instant.
6994
+ *
6995
+ */
6996
+ setOffset(offset: BMPoint, {animated}?: {animated?: boolean | null | undefined}): void;
6997
+
6998
+
6999
+ /**
7000
+ * The current position of the drag session, relative to the viewport.
7001
+ *
7002
+ */
7003
+ private _position: BMPoint;
7004
+
7005
+ /**
7006
+ * Updates the position of the drag gesture and all the drag previews.
7007
+ * @param position The new position.
7008
+ *
7009
+ */
7010
+ setPosition(position: BMPoint): void;
7011
+
7012
+
7013
+ /**
7014
+ * Updates the drop action displayed on the drag indicator.
7015
+ * @param action The new drop action to display.
7016
+ *
7017
+ */
7018
+ private _setDropActionKind(action: _BMDragDropSessionAction): void;
7019
+
7020
+
7021
+ /**
7022
+ * Updates the item count displayed on the drag indicator.
7023
+ * @param count The new item count to display.
7024
+ *
7025
+ */
7026
+ setAcceptableItemCount(count: number): void;
7027
+
7028
+
7029
+ /**
7030
+ * Updates the message currently displayed on the drag indicator.
7031
+ * @param message The message to display, or `undefined` to not show any message.
7032
+ *
7033
+ */
7034
+ private _setMessage(message?: string | null | undefined): void;
7035
+
7036
+
7037
+ /**
7038
+ * Updates the message currently displayed on the drag indicator using the specified HTML text.
7039
+ * @param message The message HTML to display, or `undefined` to not show any message.
7040
+ *
7041
+ */
7042
+ private _setMessageHTML(message?: string | null | undefined): void;
7043
+
7044
+
7045
+ /**
7046
+ * Plays the lift animation for this drag indicator.
7047
+ * @return A promise that resolves when the animation completes.
7048
+ *
7049
+ */
7050
+ performLift(): Promise<void>;
7051
+
7052
+
7053
+ /**
7054
+ * Plays the drop animation for this drag indicator.
7055
+ * @return A promise that resolves when the animation completes.
7056
+ *
7057
+ */
7058
+ performDrop(): Promise<void>;
7059
+
7060
+
7061
+ /**
7062
+ * Detaches this drag indicator from the document.
7063
+ * The drag indicator should not be reused after this method returns.
7064
+ *
7065
+ */
7066
+ release(): void;
7067
+
7068
+ }
7069
+
7070
+
7071
+ /**
7072
+ * An object that manages the appearance, position and animations of the preview elements
7073
+ * for items included in a drag session and the drag indicator.
7074
+ *
7075
+ */
7076
+ export class _BMDragPreviewSet {
7077
+
7078
+ /**
7079
+ * The offset between the drag pointer and the center the from of the view from which the drag session
7080
+ * started, expressed in percentages relative to the view's frame.
7081
+ *
7082
+ */
7083
+ private _offsetPercent: BMPoint;
7084
+
7085
+ /**
7086
+ * The offset between the drag pointer and the center of the frames of the preview elements.
7087
+ *
7088
+ */
7089
+ private _offset: BMPoint;
7090
+
7091
+ /**
7092
+ * The current position of the drag session.
7093
+ *
7094
+ */
7095
+ private _position: BMPoint;
7096
+
7097
+ /**
7098
+ * The indicator displaying information about the associated drag session.
7099
+ *
7100
+ */
7101
+ private _dragIndicator: _BMDragIndicator;
7102
+
7103
+ /**
7104
+ * A mapping between drag items and their associated drag previews.
7105
+ *
7106
+ */
7107
+ private _dragPreviews: Map<BMDragItem, BMDragPreview>;
7108
+
7109
+ /**
7110
+ * A mapping between drag items and the drag previews provided initially for each.
7111
+ *
7112
+ */
7113
+ private _baseDragPreviews: Map<BMDragItem, BMDragPreview>;
7114
+
7115
+ /**
7116
+ * A set that controls which items appear as rejected.
7117
+ *
7118
+ */
7119
+ private _rejectedItems: Set<BMDragItem>;
7120
+
7121
+ /**
7122
+ * The total displacement to apply to rejected previews.
7123
+ *
7124
+ */
7125
+ private _rejectionDistance: number;
7126
+
7127
+ /**
7128
+ * Initializes this drag preview set with the specified item previews and offset position.
7129
+ * @param previews The previews for items in the drag session.
7130
+ * @param pointerOffset The offset between the drag pointer and the
7131
+ * center of the frames of the view from which the
7132
+ * drag session started.
7133
+ * @return This preview set.
7134
+ *
7135
+ */
7136
+ initWithPreviews(previews: BMDragPreview[], {pointerOffset}: {pointerOffset: BMPoint}): _BMDragPreviewSet;
7137
+
7138
+
7139
+ /**
7140
+ * An additional preview to display when all items are rejected.
7141
+ *
7142
+ */
7143
+ private _additionalPreview?: BMDragPreview | null | undefined;
7144
+
7145
+ /**
7146
+ * Displays the specified additional preview, or clears it.
7147
+ * @param preview The additional preview to display, or `undefined` to
7148
+ * clear the additional preview.
7149
+ *
7150
+ */
7151
+ setAdditionalPreview(preview?: BMDragPreview | null | undefined): void;
7152
+
7153
+
7154
+ /**
7155
+ * Updates the position of the drag gesture and all the drag previews.
7156
+ * @param position The new position.
7157
+ *
7158
+ */
7159
+ setPosition(position: BMPoint): void;
7160
+
7161
+
7162
+ /**
7163
+ * Causes the previews for the specified items to appear as rejected. All other items will
7164
+ * appear as acceptable even if they had been previously set as rejected using this method.
7165
+ * @param items The items that should appear as rejected,
7166
+ * or `undefined` to clear the rejected items.
7167
+ *
7168
+ */
7169
+ setRejectedItems(items?: BMDragItem[] | null | undefined): void;
7170
+
7171
+
7172
+ /**
7173
+ * Attaches the drag previews and plays their lift animations.
7174
+ * @param position The position of the drag session.
7175
+ *
7176
+ */
7177
+ beginLiftAtPosition(position: BMPoint): void;
7178
+
7179
+
7180
+ /**
7181
+ * Updates or resets the previews for the specified items using a map.
7182
+ * @param previews The drag previews to use, or `undefined` to reset it for each item.
7183
+ *
7184
+ */
7185
+ updatePreviewsWithMap(previews: Map<BMDragItem, BMDragPreview | undefined>): void;
7186
+
7187
+
7188
+ /**
7189
+ * Determines the rejection distance based on the size of all current previews.
7190
+ *
7191
+ */
7192
+ private _updateRejectionDistance(): void;
7193
+
7194
+
7195
+ /**
7196
+ * The orientation of the drag indicator relative to the top edge of the drag previews.
7197
+ *
7198
+ */
7199
+ private readonly _indicatorOrientation: any;
7200
+
7201
+ /**
7202
+ * Updates the orientation of the drag indicator. If the orientation changes as a result
7203
+ * of this method, the change will be animated.
7204
+ * @param orientation The new orientation to use.
5475
7205
  *
5476
7206
  */
5477
- private _menuItemWithLabel(label: string, {action}: {action: (($0: Event) => void)}): DOMNode;
7207
+ private _setIndicatorOrientation(orientation: _BMDragIndicatorOrientation): void;
5478
7208
 
5479
7209
 
5480
7210
  /**
5481
- * Creates and brings up a context menu at the given coordinates, relative to the viewport.
5482
- * @param point The point at which to show the menu.
5483
- * @param withOptions The options that the menu should display.
5484
- * @param kind Defaults to .Menu. The kind of menu to show.
5485
- * @return The menu element.
7211
+ * The offset the indicator would use if the orientation was set to `.Right`.
5486
7212
  *
5487
7213
  */
5488
- private _showMenuAtPoint(point: BMPoint, {withOptions, kind}: {withOptions: DOMNode[], kind?: BMMenuKind | null | undefined}): DOMNode;
5489
-
7214
+ private _indicatorOffsetRight: number;
5490
7215
 
5491
7216
  /**
5492
- * Constructs and returns a text field with a new DOM node.
5493
- * @return A text field.
5494
- *
7217
+ * Updates the drag indicator offset from the drag session's position based on the size
7218
+ * and scale of the first displayed item preview.
7219
+ * The offset for the indicator is set such that it will appear to the top left of
7220
+ * the first preview.
7221
+ * @param animated Defaults to `YES`. Whether this change is animated.
7222
+ *
5495
7223
  */
5496
- static textField (): BMTextField;
7224
+ private _updateDragIndicatorOffsetAnimated(animated?: boolean | null | undefined): void;
5497
7225
 
5498
7226
 
5499
7227
  /**
5500
- * Constructs and returns a text field for the given input DOM node.
5501
- * @param node An input DOM node.
5502
- * @return A text field.
5503
- *
7228
+ * Plays the drop animation for the current drag previews, then detaches them.
7229
+ *
5504
7230
  */
5505
- static textFieldForInputNode (node: DOMNode): BMTextField;
7231
+ performDrop(): void;
5506
7232
 
5507
7233
  }
5508
7234
 
@@ -8296,6 +10022,13 @@ export class BMMenu {
8296
10022
  */
8297
10023
  _delaysClosing: boolean;
8298
10024
 
10025
+ /**
10026
+ * When set to `YES`, the menu item actions and item selection delegate callbacks will be invoked
10027
+ * with a slight delay to allow time for the menu closing animation to play.
10028
+ *
10029
+ */
10030
+ delaysActions: boolean;
10031
+
8299
10032
  /**
8300
10033
  * Initializes this menu with the specified items.
8301
10034
  * The menu will be hidden by default; the method showAtPoint(_) should be used to make the menu visible.
@@ -8332,6 +10065,20 @@ export class BMMenu {
8332
10065
  private _renderMenuItems(): void;
8333
10066
 
8334
10067
 
10068
+ /**
10069
+ * Temporarily set to the menu item that was selected until its action is performed.
10070
+ *
10071
+ */
10072
+ private _selectedMenuItem?: BMMenuItem | null | undefined;
10073
+
10074
+ /**
10075
+ * Performs the action for the specified menu item and invokes the delegate selection callback for it.
10076
+ * @param item The menu item whose action should be performed.
10077
+ *
10078
+ */
10079
+ private _performActionForMenuItem(item: BMMenuItem): void;
10080
+
10081
+
8335
10082
  /**
8336
10083
  * The kind of menu currently displayed.
8337
10084
  *
@@ -8454,7 +10201,7 @@ export class BMMenu {
8454
10201
  * @param forKeyboardShortcut The keyboard shortcut that was triggered.
8455
10202
  *
8456
10203
  */
8457
- private _selectMenuItemWithEvent(event: KeyboardEvent, {forKeyboardShortcut}: {forKeyboardShortcut: BMKeyboardShortcut}): void;
10204
+ protected _selectMenuItemWithEvent(event: KeyboardEvent, {forKeyboardShortcut}: {forKeyboardShortcut: BMKeyboardShortcut}): void;
8458
10205
 
8459
10206
 
8460
10207
  /**
@@ -10055,6 +11802,19 @@ export class BMCollectionViewLayoutInvalidationContext {
10055
11802
  */
10056
11803
  export class BMCollectionViewTransitionLayout extends BMCollectionViewLayout {
10057
11804
 
11805
+ /**
11806
+ * When set to `YES` this transition layout will no longer perform updates.
11807
+ *
11808
+ */
11809
+ private _transitionStopped: boolean;
11810
+
11811
+ /**
11812
+ * Stops the current transition in its tracks, instantly setting the final attributes on all cells.
11813
+ *
11814
+ */
11815
+ private _stopTransition(): void;
11816
+
11817
+
10058
11818
  /**
10059
11819
  * Controls how close to completion the transition is.
10060
11820
  *
@@ -10557,6 +12317,12 @@ export class BMCollectionViewFlowLayout extends BMCollectionViewLayout {
10557
12317
  */
10558
12318
  pinsFootersToContentEdge: boolean;
10559
12319
 
12320
+ /**
12321
+ * Set to `YES` while the current layout is using scrollbar offsets, `NO` otherwise.
12322
+ *
12323
+ */
12324
+ private _usingScrollbarOffset: boolean;
12325
+
10560
12326
  /**
10561
12327
  * Prepares the layout, optionally taking the scrollbar size into account.
10562
12328
  * @param useOffset When set to `YES` the layout will take the scrollbar size into account.
@@ -11221,6 +12987,41 @@ export class BMCollectionViewAcceptPolicy {
11221
12987
  private constructor();
11222
12988
  }
11223
12989
 
12990
+ export class BMCollectionViewAcceptRegion {
12991
+ /**
12992
+ * Indicates that the drop session will have the same drop action regardless of where
12993
+ * in the collection view's frame it is.
12994
+ *
12995
+ */
12996
+ static Anywhere: BMCollectionViewAcceptRegion;
12997
+
12998
+ /**
12999
+ * Indicates that the drop session's drop action changes based on the cell in which the
13000
+ * drop occurs. Drops outside of any cell's frame are rejected. The delegate object is
13001
+ * expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidEnterCell} method
13002
+ * provide the appropriate drop action for each cell.
13003
+ *
13004
+ */
13005
+ static Cell: BMCollectionViewAcceptRegion;
13006
+
13007
+ /**
13008
+ * Indicates the drop session's drop action depends on the specific position in which the drop occurs.
13009
+ * The delegate object is expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidUpdate}
13010
+ * method to provide the appropriate action as the drop session's position updates.
13011
+ *
13012
+ */
13013
+ static Position: BMCollectionViewAcceptRegion;
13014
+
13015
+ /**
13016
+ * Indicates that the collection view cannot process the session's items and no further updates will
13017
+ * be provided regarding this drop session.
13018
+ *
13019
+ */
13020
+ static Nowhere: BMCollectionViewAcceptRegion;
13021
+
13022
+ private constructor();
13023
+ }
13024
+
11224
13025
 
11225
13026
 
11226
13027
  /**
@@ -11319,7 +13120,7 @@ export class BMCollectionViewScrollingDirection {
11319
13120
  }
11320
13121
 
11321
13122
  /**
11322
- * Controls the final horizontal scrolling position of a programatic scroll.
13123
+ * Controls the final horizontal scrolling position of a programmatic scroll.
11323
13124
  *
11324
13125
  */
11325
13126
  export class BMCollectionViewScrollingGravityHorizontal {
@@ -11345,7 +13146,7 @@ export class BMCollectionViewScrollingGravityHorizontal {
11345
13146
  }
11346
13147
 
11347
13148
  /**
11348
- * Controls the final vertical scrolling position of a programatic scroll.
13149
+ * Controls the final vertical scrolling position of a programmatic scroll.
11349
13150
  *
11350
13151
  */
11351
13152
  export class BMCollectionViewScrollingGravityVertical {
@@ -11396,7 +13197,7 @@ export class BMCollectionViewScrollingGravityVertical {
11396
13197
  *
11397
13198
  *
11398
13199
  */
11399
- export class BMCollectionView<T = any> extends BMView {
13200
+ export class BMCollectionView<T = any> extends BMView implements BMDragDelegate, BMDropDelegate {
11400
13201
 
11401
13202
  /**
11402
13203
  * The last measured intrinsic size for this collection view.
@@ -12087,10 +13888,138 @@ export class BMCollectionView<T = any> extends BMView {
12087
13888
  * @param items An array of items.
12088
13889
  * @param toIndexPath The suggested index path at which to add the items.
12089
13890
  * @param withDropShadows A map containing the link between drop shadows and the items.
13891
+ * @return A promise that resolves when the associated data update
13892
+ * has completed.
13893
+ *
13894
+ */
13895
+ private _insertItems(items: any[], {toIndexPath, withDropShadows}: {toIndexPath: BMIndexPath<T>, withDropShadows: Map<any, DOMNode>}): Promise<void>;
13896
+
13897
+
13898
+ /**
13899
+ * An array containing the cells whose index paths are part of the current drag session, or
13900
+ * `undefined` while there is no drag session in progress for this collection view.
13901
+ *
13902
+ */
13903
+ private _draggingCells?: BMCollectionViewCell[] | null | undefined;
13904
+
13905
+ /**
13906
+ * A map that keeps track of the association between drag items in a drag session and the cells
13907
+ * whose items they represent.
13908
+ *
13909
+ */
13910
+ private _cellItemMap: Map<BMDragItem, BMCollectionViewCell>;
13911
+
13912
+ /**
13913
+ * Begins a drag gesture from the specified event. The drag event will move the cell from which
13914
+ * the event originates, or all selected cells if that cell is selected.
13915
+ * @param event The event triggering this action.
13916
+ * @param forCell The cell from which this event originates.
13917
+ * @param touchIdentifier If this event is a `TouchEvent`, this represents the identifier
13918
+ * of the touch point that will control this drag & drop operation.
13919
+ *
13920
+ */
13921
+ beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
13922
+
13923
+
13924
+ /**
13925
+ * Creates and returns a fallback drag item for the specified index path if the data source
13926
+ * object cannot provide a customized drag item.
13927
+ * @param indexPath The index path for which to return a drag item.
13928
+ * @return A drag item;
13929
+ *
13930
+ */
13931
+ private _defaultDragItemForIndexPath(indexPath: BMIndexPath): BMDragItem;
13932
+
13933
+
13934
+ /**
13935
+ * The current drag action to use based on the current drag position.
13936
+ *
13937
+ */
13938
+ private _dragAction?: BMDragSessionAction | null | undefined;
13939
+
13940
+ /**
13941
+ * Set to `YES` while a drag session started by this collection view is in its frame.
13942
+ *
13943
+ */
13944
+ private _dragSessionInFrame: boolean;
13945
+
13946
+ /**
13947
+ * The amount by which to scroll on the Y axis during the current drag session.
13948
+ *
13949
+ */
13950
+ private _dragScrollDirectionY: number;
13951
+
13952
+ /**
13953
+ * The amount by which to scroll on the X axis during the current drag session.
13954
+ *
13955
+ */
13956
+ private _dragScrollDirectionX: number;
13957
+
13958
+ /**
13959
+ * Whenever the pointer moves to the edges of this collection view during a drag session,
13960
+ * this method periodically scrolls the collection view's contents appropriately.
13961
+ *
13962
+ */
13963
+ private _dragScroll(): void;
13964
+
13965
+
13966
+ /**
13967
+ * The identifier of the animation frame callback used to scroll this collection during a drag session while the
13968
+ * mouse pointer
13969
+ *
13970
+ */
13971
+ private _scrollFrameIdentifier?: number | null | undefined;
13972
+
13973
+ /**
13974
+ * The kind of region being tracked during a drop session. `undefined` if a drop session is
13975
+ * not in progress.
13976
+ *
13977
+ */
13978
+ private _dropSessionRegionKind?: BMCollectionViewAcceptRegion | null | undefined;
13979
+
13980
+ /**
13981
+ * The current drop action to use based on the current drop session position.
13982
+ *
13983
+ */
13984
+ private _dropAction?: BMDropSessionAction | null | undefined;
13985
+
13986
+ /**
13987
+ * The index path associated with the current drop session, if any.
13988
+ *
13989
+ */
13990
+ private _dropIndexPath?: BMIndexPath | null | undefined;
13991
+
13992
+ /**
13993
+ * Returns the position of the specified drag or drop session relative to the collection view's bounds.
13994
+ * @param session The drag or drop session.
13995
+ * @return The coordinates relative to the bounds.
13996
+ *
13997
+ */
13998
+ positionOfDragSession(session: BMDragSession | BMDropSession): BMPoint;
13999
+
14000
+
14001
+ /**
14002
+ * Determines the index path at the specified point whose coordinates are relative to the bounds.
14003
+ * @param point The point.
14004
+ * @return The index path, if any cell's frame intersects the point,
14005
+ * or `undefined` otherwise.
14006
+ *
14007
+ */
14008
+ indexPathAtPoint(point: BMPoint): BMIndexPath | null | undefined;
14009
+
14010
+
14011
+ /**
14012
+ * The most recent index path the current drop session has been over.
12090
14013
  *
12091
14014
  */
12092
- private _insertItems(items: any[], {toIndexPath, withDropShadows}: {toIndexPath: BMIndexPath<T>, withDropShadows: Map<any, DOMNode>}): void;
14015
+ private _lastDropIndexPath: BMIndexPath;
12093
14016
 
14017
+ /**
14018
+ * The drop previews that must be animated at the end of a successful drop session. Only set while performing
14019
+ * the data update associated with accepting items via a drop session.
14020
+ *
14021
+ */
14022
+ private _dropPreviews?: BMDropPreview[] | null | undefined;
12094
14023
 
12095
14024
  /**
12096
14025
  * Begins a drag gesture from the given event. The drag event will move the cell from which
@@ -12101,7 +14030,7 @@ export class BMCollectionView<T = any> extends BMView {
12101
14030
  * of the touch point that will control this drag & drop operation.
12102
14031
  *
12103
14032
  */
12104
- beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
14033
+ private _beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
12105
14034
 
12106
14035
 
12107
14036
  /**
@@ -12300,7 +14229,7 @@ export class BMCollectionView<T = any> extends BMView {
12300
14229
  * Invoked when an arrow is pressed while this collection view has keyboard focus.
12301
14230
  * Highlights the index path to the specified direction of the currently highlighted index path.
12302
14231
  * @param arrow The key code of the keyboard arrow that was pressed.
12303
- * @param withEvent The event that triggerred this action.
14232
+ * @param withEvent The event that triggered this action.
12304
14233
  *
12305
14234
  */
12306
14235
  keyboardArrowPressed(arrow: string, {withEvent}: {withEvent: KeyboardEvent}): void;
@@ -12364,6 +14293,14 @@ export class BMCollectionView<T = any> extends BMView {
12364
14293
  setLayout(layout: BMCollectionViewLayout, {animated, completionHandler}?: {animated?: boolean | null | undefined, completionHandler?: (() => void) | null | undefined}): void;
12365
14294
 
12366
14295
 
14296
+ /**
14297
+ * If a layout transition is currently in progress it is stopped, allowing data updates to
14298
+ * start without affecting the retained cells.
14299
+ *
14300
+ */
14301
+ private _stopLayoutTransition(): void;
14302
+
14303
+
12367
14304
  /**
12368
14305
  * Invoked internally by CoreUI to perform a batched update of layout properties.
12369
14306
  * Using this method requires the layout object used by this collection view to support copying.
@@ -12436,6 +14373,20 @@ export class BMCollectionView<T = any> extends BMView {
12436
14373
  */
12437
14374
  readonly dataUpdated?: Promise<void> | null | undefined;
12438
14375
 
14376
+ /**
14377
+ * Finds and returns the drop preview associated with the specified layout attributes, if any exists.
14378
+ * @param attributes Tha attributes for which to find the drop preview.
14379
+ * @param previewMap
14380
+ * An optional mapping between index paths and drop items
14381
+ * used to find the drop preview for the item representation
14382
+ * that the data set actually inserted. The default item
14383
+ * representation will be used if this is not provided.
14384
+ * @return The drop preview if it was found, `undefined` otherwise.
14385
+ *
14386
+ */
14387
+ private _dropPreviewForLayoutAttributes(attributes: BMCollectionViewLayoutAttributes, {previewMap}?: {previewMap?: Map<BMIndexPath<T>, BMDropPreview> | null | undefined}): BMDropPreview | null | undefined;
14388
+
14389
+
12439
14390
  /**
12440
14391
  * Should be invoked when the entire data set is updated in bulk.
12441
14392
  * This method should be invoked when the data set object has access to the new data;
@@ -12636,6 +14587,14 @@ export class BMCollectionView<T = any> extends BMView {
12636
14587
  }
12637
14588
 
12638
14589
 
14590
+ /**
14591
+ * Cleans up the changes performed by the current transition.
14592
+ *
14593
+ */
14594
+ export function cleanupTransition(): void;
14595
+
14596
+
14597
+
12639
14598
  /**
12640
14599
  * @deprecated - Use the static `collectionViewForNode` factory method.
12641
14600
  *
@@ -12817,11 +14776,12 @@ export interface BMCollectionViewDataSet<T = any> {
12817
14776
  * For collection views that support moving items, this method must be implemented by the data sets these collection views
12818
14777
  * use. In this case, data sets that don't support moving items may simply return `NO` from this method.
12819
14778
  * @param indexPath The item's current index path.
12820
- * @param toIndexPath The index path to which the item should move.
12821
- * @return `YES` if the data set has performed the requested change, `NO` otherwise.
14779
+ * @param toIndexPath The index path to which the item should move.
14780
+ * @param session The drag session through which this change was performed.
14781
+ * @return `YES` if the data set has performed the requested change, `NO` otherwise.
12822
14782
  *
12823
14783
  */
12824
- moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T>}): boolean;
14784
+ moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
12825
14785
 
12826
14786
 
12827
14787
  /**
@@ -12835,14 +14795,15 @@ export interface BMCollectionViewDataSet<T = any> {
12835
14795
  * `moveItemFromIndexPath(_, {toIndexPath})` passing in each of the items that need to be moved.
12836
14796
  * @param indexPaths An array of index paths identifying which items have to be moved.
12837
14797
  * @param toIndexPath The starting index path to which the items should move. This represents the index path of the current layout
12838
- * before any items may have moved. It is the data set's responsability to adjust this index path as the items shift
14798
+ * before any items may have moved. It is the data set's responsibility to adjust this index path as the items shift
12839
14799
  * within its data structure.
12840
- * @return An array of index paths specifying the positions of the items after they have been moved.
14800
+ * @param session The drag session through which this change was performed.
14801
+ * @return An array of index paths specifying the positions of the items after they have been moved.
12841
14802
  * The index paths in this array are not required to match either of the lists supplied by
12842
- * collection view.
14803
+ * collection view.
12843
14804
  *
12844
14805
  */
12845
- moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): BMIndexPath<T>[];
14806
+ moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
12846
14807
 
12847
14808
 
12848
14809
  /**
@@ -12852,10 +14813,12 @@ export interface BMCollectionViewDataSet<T = any> {
12852
14813
  * Optionally, data sets may reject the change and not perform any action or only partially accept the update
12853
14814
  * and remove just some of the items, by changing their internal data structures appropriately.
12854
14815
  * The order of the items in the array is guaranteed to be such that the target index paths are in ascending order.
12855
- * @param indexPaths An array of index paths identifying which items have to be removed.
14816
+ * @param indexPaths An array of index paths identifying which items have to be removed.
14817
+ * @param session The drag session through which this change was performed, if it occurred
14818
+ * through a drag and drop gesture.
12856
14819
  *
12857
14820
  */
12858
- removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[]): void;
14821
+ removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
12859
14822
 
12860
14823
 
12861
14824
  /**
@@ -12864,14 +14827,49 @@ export interface BMCollectionViewDataSet<T = any> {
12864
14827
  * the items, then trigger a data update to run on the collection view.
12865
14828
  * Optionally, data sets may reject the change and not perform any action or only partially accept the update
12866
14829
  * and add just some of the items, by changing their internal data structures appropriately.
12867
- * @param items An array of objects to add to the collection view.
12868
- * @param toIndexPath The starting index path to which the items should be inserted.
14830
+ * @param items An array of objects to add to the collection view, using the default representation
14831
+ * of the items in the drop session. Additional representations, if needed, can be obtained
14832
+ * from the drop session.
14833
+ * @param toIndexPath The starting index path to which the items should be inserted.
14834
+ * @param session The drop session through which this change was performed, if it occurred
14835
+ * through a drag and drop gesture.
14836
+ * @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
14837
+ *
14838
+ */
14839
+ insertItems?(items: any[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session?: BMDropSession | null | undefined}): Promise<void> | void;
14840
+
14841
+
14842
+ /**
14843
+ * Invoked by collection after a successful transfer via a drop session to determine the index path associated
14844
+ * with the specified drag item during the associated data update. Data set objects which implement this method
14845
+ * should return the index path associated with the appropriate representation of the specified drag item that
14846
+ * was accepted through the drop session.
14847
+ * @param item The drag item for which to obtain the associated index path.
14848
+ * @return The associated index path if it could be determined, `undefined` otherwise.
14849
+ *
14850
+ */
14851
+ indexPathForDragItem?(item: BMDragItem): BMIndexPath<T> | null | undefined;
14852
+
14853
+
14854
+ /**
14855
+ * This method should be implemented by data set objects that support transferring items via drag and drop
14856
+ * to create the drag items that will be part of a drag session.
14857
+ *
14858
+ * Data set objects implementing this method should return a drag item for the specified index path with
14859
+ * the appropriate representations that potential drop targets can verify to determine if they can accept
14860
+ * the items being transferred through the session.
14861
+ * @param indexPath The index path for which to create a drag item.
14862
+ * @param session The drag session that will be used to transfer the items.
14863
+ * @return The drag item.
12869
14864
  *
12870
14865
  */
12871
- insertItems?(items: any[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): void;
14866
+ dragItemForIndexPath?(indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
12872
14867
 
12873
14868
 
12874
14869
  /**
14870
+ * @deprecated Not used if `dragItemForIndexPath` is implemented.
14871
+ *
14872
+ * ------
12875
14873
  * This method may be implemented by data set objects that support transferring items to another collection view.
12876
14874
  * Data set objects implementing this method are expected to create a copy of the specified item and return it.
12877
14875
  * The item is guaranteed to be an object that was returned at some point by the data set when it provided an index path.
@@ -13006,10 +15004,11 @@ export interface BMCollectionViewDataSource<T = any> {
13006
15004
  * @param collectionView The collection view that is moving the item.
13007
15005
  * @param indexPath The item's current index path.
13008
15006
  * @param toIndexPath The index path to which the item should move.
15007
+ * @param session The drag session through which this change was performed.
13009
15008
  * @return `YES` if the data set has performed the requested change, `NO` otherwise.
13010
15009
  *
13011
15010
  */
13012
- collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T>}): boolean;
15011
+ collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
13013
15012
 
13014
15013
 
13015
15014
  /**
@@ -13026,12 +15025,13 @@ export interface BMCollectionViewDataSource<T = any> {
13026
15025
  * @param toIndexPath The starting index path to which the items should move. This represents the index path of the current layout
13027
15026
  * before any items may have moved. It is the data source's responsibility to adjust this index path as the items shift
13028
15027
  * within its data structure.
15028
+ * @param session The drag session through which this change was performed.
13029
15029
  * @return An array of index paths specifying the positions of the items after they have been moved.
13030
15030
  * The index paths in this array are not required to match either of the lists supplied by
13031
15031
  * collection view.
13032
15032
  *
13033
15033
  */
13034
- collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): BMIndexPath<T>[];
15034
+ collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
13035
15035
 
13036
15036
 
13037
15037
  /**
@@ -13043,9 +15043,11 @@ export interface BMCollectionViewDataSource<T = any> {
13043
15043
  * The order of the items in the array is guaranteed to be such that the target index paths are in ascending order.
13044
15044
  * @param collectionView The collection view that is removing the items.
13045
15045
  * @param indexPaths An array of index paths identifying which items have to be removed.
15046
+ * @param session If this change occurred via a drag session, the session through which
15047
+ * the items were removed.
13046
15048
  *
13047
15049
  */
13048
- collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[]): void;
15050
+ collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
13049
15051
 
13050
15052
 
13051
15053
  /**
@@ -13055,15 +15057,56 @@ export interface BMCollectionViewDataSource<T = any> {
13055
15057
  * this method returns for the appropriate animation to play on the items being transferred.
13056
15058
  * Optionally, data sources may reject the change and not perform any action or only partially accept the update
13057
15059
  * and add just some of the items, by changing their internal data structures appropriately.
13058
- * @param collectionView The collection view into which items are being inserted.
13059
- * @param items An array of objects to add to the collection view.
13060
- * @param toIndexPath The starting index path to which the items should be inserted.
15060
+ * @param collectionView The collection view into which items are being inserted.
15061
+ * @param items An array of objects to add to the collection view. If this change
15062
+ * occurred trough a drop session, this represents the default representation
15063
+ * of the drag items.
15064
+ * @param toIndexPath The starting index path to which the items should be inserted.
15065
+ * @param session The drop session through which this change was performed, if this
15066
+ * occurred via a drag and drop gesture.
15067
+ * @param indexPaths
15068
+ * If the data set inserted a different representation of the items than the default,
15069
+ * this map must be filled out with the new index paths associated with each item in
15070
+ * the drop session that was actually inserted.
15071
+ * @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
13061
15072
  *
13062
15073
  */
13063
- collectionViewInsertItems?(collectionView: BMCollectionView, items: any[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): void;
15074
+ collectionViewInsertItems?(collectionView: BMCollectionView, items: any[], {toIndexPath, session, indexPaths}: {toIndexPath: BMIndexPath<T>, session?: BMDropSession | null | undefined, indexPaths?: Map<BMDragItem, BMIndexPath<T>> | null | undefined}): Promise<void> | void;
15075
+
15076
+
15077
+ /**
15078
+ * This method should be implemented by data source objects that support transferring items via drag and drop
15079
+ * to create the drag items that will be part of a drag session.
15080
+ *
15081
+ * Data source objects implementing this method should return a drag item for the specified index path with
15082
+ * the appropriate representations that potential drop targets can verify to determine if they can accept
15083
+ * the items being transferred through the session.
15084
+ * @param collectionView The collection view that started the dragging session.
15085
+ * @param indexPath The index path for which to create a drag item.
15086
+ * @param session The drag session that will be used to transfer the items.
15087
+ * @return The drag item.
15088
+ *
15089
+ */
15090
+ collectionViewDragItemForIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
15091
+
15092
+
15093
+ /**
15094
+ * Invoked by collection after a successful transfer via a drop session to determine the index path associated
15095
+ * with the specified drag item during the associated data update. Data source objects which implement this method
15096
+ * should return the index path associated with the appropriate representation of the specified drag item that
15097
+ * was accepted through the drop session.
15098
+ * @param collectionView The collection view that accepted items from a drop session.
15099
+ * @param item The drag item for which to obtain the associated index path.
15100
+ * @return The associated index path if it could be determined, `undefined` otherwise.
15101
+ *
15102
+ */
15103
+ collectionViewIndexPathForDragItem?(collectionView: BMCollectionView, item: BMDragItem): BMIndexPath<T> | null | undefined;
13064
15104
 
13065
15105
 
13066
15106
  /**
15107
+ * @deprecated Not used if `dragItemForIndexPath` is implemented.
15108
+ *
15109
+ * ------
13067
15110
  * This method may be implemented by data source objects that support transferring items to another collection view.
13068
15111
  * Data source objects implementing this method are expected to create a copy of the specified item and return it.
13069
15112
  * The item is guaranteed to be an object that was returned at some point by the data set when it provided an index path.
@@ -13165,7 +15208,7 @@ export interface BMCollectionViewDelegate {
13165
15208
 
13166
15209
  /**
13167
15210
  * Invoked by the collection view whenever any cell should be selected to determine whether that selection is allowed.
13168
- * The actuall cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
15211
+ * The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
13169
15212
  * You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
13170
15213
  * If this method is not implemented by the delegate object, the collection view will assume that the cell may be selected.
13171
15214
  * @param collectionView The calling collection view.
@@ -13189,7 +15232,7 @@ export interface BMCollectionViewDelegate {
13189
15232
 
13190
15233
  /**
13191
15234
  * Invoked by the collection view whenever any cell should be deselected to determine whether that selection is allowed.
13192
- * The actuall cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
15235
+ * The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
13193
15236
  * You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
13194
15237
  * If this method is not implemented by the delegate object, the collection view will assume that the cell may be deselected.
13195
15238
  * @param collectionView The calling collection view.
@@ -13324,8 +15367,8 @@ export interface BMCollectionViewDelegate {
13324
15367
  * Invoked by the collection view whenever any cell is clicked or tapped. Delegate objects can implement this method to react
13325
15368
  * to cell click or tap events.
13326
15369
  * Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
13327
- * and prevent the default actions from occuring.
13328
- * By default, when returning NO or nothing from this method, the collection view will togle the selection state of the clicked cell.
15370
+ * and prevent the default actions from occurring.
15371
+ * By default, when returning NO or nothing from this method, the collection view will toggle the selection state of the clicked cell.
13329
15372
  * @param collectionView The calling collection view.
13330
15373
  * @param cell The cell that triggered this event.
13331
15374
  * @param withEvent The event that triggered this action.
@@ -13339,7 +15382,7 @@ export interface BMCollectionViewDelegate {
13339
15382
  * Invoked by the collection view whenever any cell is double clicked or double tapped. Delegate objects can implement this method to react
13340
15383
  * to cell click or tap events.
13341
15384
  * Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
13342
- * and prevent the default actions from occuring.
15385
+ * and prevent the default actions from occurring.
13343
15386
  * @param collectionView The calling collection view.
13344
15387
  * @param cell The cell that triggered this event.
13345
15388
  * @param withEvent The event that triggered this action.
@@ -13353,7 +15396,7 @@ export interface BMCollectionViewDelegate {
13353
15396
  * Invoked by the collection view whenever any cell is long clicked or long tapped. Delegate objects can implement this method to react
13354
15397
  * to cell click or tap events.
13355
15398
  * Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
13356
- * and prevent the default actions from occuring.
15399
+ * and prevent the default actions from occurring.
13357
15400
  * @param collectionView The calling collection view.
13358
15401
  * @param cell The cell that triggered this event.
13359
15402
  * @param withEvent The event that triggered this action.
@@ -13367,7 +15410,7 @@ export interface BMCollectionViewDelegate {
13367
15410
  * Invoked by the collection view whenever any cell is right clicked. Delegate objects can implement this method to react
13368
15411
  * to cell click events.
13369
15412
  * Delegate objects can optionally return YES from this method to signal to the collection view that they wish to handle this event
13370
- * and prevent the default actions from occuring.
15413
+ * and prevent the default actions from occurring.
13371
15414
  * By default, when returning NO or nothing from this method, the browser's default context menu will appear.
13372
15415
  * @param collectionView The calling collection view.
13373
15416
  * @param cell The cell that triggered this event.
@@ -13419,7 +15462,7 @@ export interface BMCollectionViewDelegate {
13419
15462
 
13420
15463
  /**
13421
15464
  * Invoked by the collection view immediately before starting an interactive drag gesture for a cell.
13422
- * Delegate objects can implement this method to perform any changes that might be needed to accomodate this gesture.
15465
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13423
15466
  * @param collectionView The calling collection view.
13424
15467
  * @param cell The cell that is about to be dragged.
13425
15468
  * @param atIndexPath The cell's current index path.
@@ -13435,81 +15478,217 @@ export interface BMCollectionViewDelegate {
13435
15478
  * If this method is not implemented, collection view will assume that items cannot be transferred.
13436
15479
  * @param collectionView The calling collection view.
13437
15480
  * @param indexPaths The index paths that may be transferred by the drag gesture.
15481
+ * @param session The drag session through which the items may be transferred.
13438
15482
  * @return `YES` if the index paths can be removed, `NO` otherwise.
13439
15483
  *
13440
15484
  */
13441
- collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
15485
+ collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
13442
15486
 
13443
15487
 
13444
15488
  /**
13445
- * Invoked by collection view to determine how to handle the transfer of the given items to a different
13446
- * collection view.
15489
+ * Invoked by collection view to determine whether the items at the specified index paths may be reordered as
15490
+ * a result of a drag and drop gesture.
15491
+ *
15492
+ * Delegate objects may implement this method and return `YES` to allow items to be reordered during the drag
15493
+ * and drop gesture or `NO` to prevent this behaviour. **The default return value is assumed to be `YES` when
15494
+ * this method is not implemented.**
15495
+ * @param collectionView The collection view that started the drag session.
15496
+ * @param indexPaths The index paths of the items that are part of the drag session.
15497
+ * @param session The drag session through which the items are reordered.
15498
+ * @return `YES` if the items can be moved, `NO` otherwise.
15499
+ *
15500
+ */
15501
+ collectionViewCanReorderItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
15502
+
15503
+
15504
+ /**
15505
+ * Invoked by collection view to determine how to handle the transfer of the items at the specified index paths to
15506
+ * a different view.
13447
15507
  * @param collectionView The calling collection view.
13448
15508
  * @param indexPaths The index paths that will be transferred by the drag gesture.
15509
+ * @param session The drag session through which the items are transferred.
13449
15510
  * @return The desired accept policy.
13450
15511
  *
13451
15512
  */
13452
- collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): BMCollectionViewTransferPolicy;
15513
+ collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): BMCollectionViewTransferPolicy;
13453
15514
 
13454
15515
 
13455
15516
  /**
13456
15517
  * Invoked by collection view to determine if the given items may be imported from another collection view.
15518
+ *
13457
15519
  * Delegate object can implement this method to let collection view know whether or not it can import the items.
13458
15520
  * If this method is not implemented, collection view will assume that items cannot be imported.
13459
- * @param collectionView The calling collection view.
13460
- * @param items The items that might be imported.
13461
- * @return `YES` if the items can be imported, `NO` otherwise.
15521
+ * @param collectionView The calling collection view.
15522
+ * @param items The items that might be imported, using the default representation
15523
+ * supplied by the item provider. The actual item providers can be obtained
15524
+ * from the drop session.
15525
+ * @param session The associated drop session.
15526
+ * @return `YES` if the items can be imported, `NO` if they can not
15527
+ * or an accept region to further customize how the items can be
15528
+ * imported from the source view.
15529
+ *
15530
+ */
15531
+ collectionViewCanAcceptItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): boolean | BMCollectionViewAcceptRegion;
15532
+
15533
+
15534
+ /**
15535
+ * Invoked by collection view to obtain a preview element for the specified drop session item.
15536
+ *
15537
+ * Delegate objects may optionally implement and return an element to customize the appearance of
15538
+ * the specified element when the drop session enters the collection view's frame.
15539
+ * @param collectionView The collection view.
15540
+ * @param session The drop session.
15541
+ * @param item The item for which to return a preview.
15542
+ * @return A preview for the item, or `undefined` to retain the
15543
+ * preview supplied by the view that started the drag session.
15544
+ *
15545
+ */
15546
+ collectionViewPreviewForDropSession?(collectionView: BMCollectionView, session: BMDropSession, {item}: {item: BMDragItem}): DOMNode | null | undefined;
15547
+
15548
+
15549
+ /**
15550
+ * Invoked by collection view at the start of a drag and drop gesture when the accept region was set to `.Anywhere` or
15551
+ * `YES` was returned from `collectionViewCanAcceptItems`.
15552
+ *
15553
+ * Delegate objects implementing this method should provide the drop action that will be used for this drop session.
15554
+ * A default action of kind `.Accept` is used when this method is not implemented.
15555
+ * @param collectionView The collection view for which the drop session started.
15556
+ * @param session The drop session that started.
15557
+ * @return The drop action to use.
15558
+ *
15559
+ */
15560
+ collectionViewDropActionForDropSession?(collectionView: BMCollectionView, session: BMDropSession): BMDropAction;
15561
+
15562
+
15563
+ /**
15564
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` in
15565
+ * `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position.
15566
+ *
15567
+ * Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
15568
+ * ending the session at its current position, or `undefined` to retain the previous action.
15569
+ * @param collectionView The collection view the drop session is tracking.
15570
+ * @param session The drop session.
15571
+ * @param position The position of the drop session relative to the collection view's bounds.
15572
+ * @return The new drop action, or `undefined` to retain the current action.
15573
+ *
15574
+ */
15575
+ collectionViewDropSessionDidUpdate?(collectionView: BMCollectionView, session: BMDropSession, {position}: {position: BMPoint}): BMDropSessionAction | null | undefined;
15576
+
15577
+
15578
+ /**
15579
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
15580
+ * `.Cell` in `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position
15581
+ * when the gesture enters the frame of the cell at the specified index path.
15582
+ *
15583
+ * Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
15584
+ * ending the session at its current position, or `undefined` to retain the previous action.
15585
+ * @param collectionView The collection view the drop session is tracking.
15586
+ * @param session The drop session.
15587
+ * @param indexPath The index path of the cell the drag and drop gesture has entered.
15588
+ * @return The new drop action, or `undefined` to retain the current action.
15589
+ *
15590
+ */
15591
+ collectionViewDropSessionDidEnterIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): BMDropSessionAction | null | undefined;
15592
+
15593
+
15594
+ /**
15595
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
15596
+ * `.Cell` in `collectionViewCanAcceptItems` when the gesture exits the frame of the cell at the specified index path.
15597
+ *
15598
+ * If the accept region was set to `.Cell` in `collectionViewCanAcceptItems`, collection view will automatically update
15599
+ * the drop session to ignore the drop. If the accept region was set to `.Position`, `collectionViewDropSessionDidUpdate`
15600
+ * will be subsequently invoked to obtain a new drop action.
15601
+ *
15602
+ * Delegate objects can optionally implement this method to perform any necessary cleanup if the drop session is no
15603
+ * longer acceptable outside of any cell.
15604
+ * @param collectionView The collection view the drop session is tracking.
15605
+ * @param session The drop session.
15606
+ * @param indexPath The index path of the cell the drag and drop gesture has entered.
15607
+ *
15608
+ */
15609
+ collectionViewDropSessionDidExitIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): void;
15610
+
15611
+
15612
+ /**
15613
+ * Invoked by collection when a drop session is about to finish, regardless of its outcome.
15614
+ *
15615
+ * Delegate objects can optionally implement this method to perform any cleanup.
15616
+ * @param collectionView The collection view for which the drop session is ending.
15617
+ * @param session The drop session that will end.
13462
15618
  *
13463
15619
  */
13464
- collectionViewCanAcceptItems?(collectionView: BMCollectionView, items: any[]): boolean;
15620
+ collectionViewDropSessionWillFinish?(collectionView: BMCollectionView, session: BMDropSession): void;
13465
15621
 
13466
15622
 
13467
15623
  /**
13468
15624
  * Invoked by collection view to determine how to handle the import of the given items from a different
13469
15625
  * collection view.
13470
15626
  * @param collectionView The calling collection view.
13471
- * @param items The items that might be imported.
15627
+ * @param items The items that might be imported, using the default representation
15628
+ * supplied by the item provider. The actual item providers can be obtained
15629
+ * from the drop session.
15630
+ * @param session The associated drop session.
13472
15631
  * @return The desired accept policy.
13473
15632
  *
13474
15633
  */
13475
- collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[]): BMCollectionViewAcceptPolicy;
15634
+ collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): BMCollectionViewAcceptPolicy;
13476
15635
 
13477
15636
 
13478
15637
  /**
13479
15638
  * Invoked by collection view to determine if the items at the specified index paths may be removed by an interactive
13480
15639
  * drag gesture.
15640
+ *
13481
15641
  * Delegate object can implement this method to let collection view know whether or not it can remove the items.
13482
15642
  * If this method is not implemented, collection view will assume that items cannot be removed.
13483
15643
  * @param collectionView The calling collection view.
13484
15644
  * @param indexPaths The index paths that may be removed by the drag gesture.
15645
+ * @param session The associated drag session.
13485
15646
  * @return `YES` if the index paths can be removed, `NO` otherwise.
13486
15647
  *
13487
15648
  */
13488
- collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
15649
+ collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): boolean;
15650
+
15651
+
15652
+ /**
15653
+ * Invoked by collection view to determine what message to display for a drag session that will delete
15654
+ * the items at the specified index paths.
15655
+ *
15656
+ * Delegate object can implement this method to provide a customized message that will be displayed to
15657
+ * the user while the drag session is in progress. The default message that will be displayed when this
15658
+ * method is not implemented is `"Remove"`.
15659
+ * @param collectionView The calling collection view.
15660
+ * @param indexPaths The index paths that may be removed by the drag gesture.
15661
+ * @param session The associated drag session.
15662
+ * @return The message to display.
15663
+ *
15664
+ */
15665
+ collectionDeleteMessageForIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): string;
13489
15666
 
13490
15667
 
13491
15668
  /**
13492
15669
  * Invoked by the collection view immediately before a drag gesture is about to end for a cell. This is invoked before any
13493
15670
  * associated animations begin.
13494
- * Delegate objects can implement this method to perform any changes that might be needed to accomodate this gesture.
15671
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13495
15672
  * @param collectionView The calling collection view.
13496
15673
  * @param cell The cell that is about to be dragged.
13497
15674
  * @param atIndexPath The cell's new index path.
15675
+ * @param session The drag session managing the interactive movement.
13498
15676
  *
13499
15677
  */
13500
- collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
15678
+ collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
13501
15679
 
13502
15680
 
13503
15681
  /**
13504
15682
  * Invoked by the collection view immediately after a drag gesture has ended for a cell. This is invoked after any
13505
15683
  * associated animations end.
13506
- * Delegate objects can implement this method to perform any changes that might be needed to accomodate this gesture.
15684
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13507
15685
  * @param collectionView The calling collection view.
13508
15686
  * @param cell The cell that is about to be dragged.
13509
15687
  * @param atIndexPath The cell's new index path.
15688
+ * @param session The drag session managing the interactive movement.
13510
15689
  *
13511
15690
  */
13512
- collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
15691
+ collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
13513
15692
 
13514
15693
  }
13515
15694
 
@@ -13918,6 +16097,18 @@ export class BMWindow extends BMView {
13918
16097
  */
13919
16098
  readonly toolbar: DOMNode;
13920
16099
 
16100
+ /**
16101
+ * Defined for non-modal windows. The drag handle used to resize the window.
16102
+ *
16103
+ */
16104
+ private _dragHandle: DOMNode;
16105
+
16106
+ /**
16107
+ * Controls whether the window resize handle appears.
16108
+ *
16109
+ */
16110
+ resizable: boolean;
16111
+
13921
16112
  /**
13922
16113
  * The window overlay.
13923
16114
  *
@@ -14327,6 +16518,12 @@ export class BMToolWindow extends BMWindow {
14327
16518
  */
14328
16519
  opensAutomatically: boolean;
14329
16520
 
16521
+ /**
16522
+ * The window to which this tool window is associated.
16523
+ *
16524
+ */
16525
+ private _parentWindow: BMWindow;
16526
+
14330
16527
  /**
14331
16528
  * Initializes this tool window with the given frame and associates it with the given window.
14332
16529
  * @param frame The window's frame.