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

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 +2237 -71
  3. package/build/BMCollectionView/BMCollectionView.js +1057 -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 +1185 -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 +47 -19
  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 +2237 -71
  61. package/lib/BMCoreUI.min.js +1 -1
  62. package/package.json +2 -2
@@ -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,1721 @@ 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
+ * Sets up the drag previews and indicator and appropriate event handlers and starts tracking
5843
+ * a drag originating from the event with which this drag session was initialized.
5844
+ *
5845
+ */
5846
+ private _beginDrag(): void;
5847
+
5848
+
5849
+ /**
5850
+ * Invoked when a key is pressed while this drag session is in progress.
5851
+ * @param event The event.
5852
+ *
5853
+ */
5854
+ private _keyPressedWithEvent(event: KeyboardEvent): void;
5855
+
5856
+
5857
+ /**
5858
+ * Invoked whenever the pointer moves while this drag session is in progress.
5859
+ * @param event The event.
5860
+ *
5861
+ */
5862
+ private _dragDidMoveWithEvent(event: MouseEvent | TouchEvent): void;
5863
+
5864
+
5865
+ /**
5866
+ * Invoked when the pointer is released or cancelled while this drag session is in progress.
5867
+ * @param event The event.
5868
+ * @return A promise that resolves when all associated animations finish.
5869
+ *
5870
+ */
5871
+ private _dragDidFinishWithEvent(event: MouseEvent | TouchEvent | KeyboardEvent): Promise<void>;
5872
+
5873
+
5874
+ /**
5875
+ * Sets up the event handlers that are used to determine when the drag moves over one
5876
+ * of the valid drop targets.
5877
+ *
5878
+ */
5879
+ private _initDropTargetHandlers(): void;
5880
+
5881
+
5882
+ /**
5883
+ * Removes the event handlers used to determine the drop target that have been set up for this drag session.
5884
+ *
5885
+ */
5886
+ private _releaseDropTargetHandlers(): void;
5887
+
5888
+
5889
+ /**
5890
+ * An identifier for the timeout registered to update the item previews after the
5891
+ * drag gesture moves over a new drop target.
5892
+ *
5893
+ */
5894
+ private _itemPreviewsUpdateIdentifier?: number | null | undefined;
5895
+
5896
+ /**
5897
+ * Updates the drop target, invoking the appropriate method on the delegate objects.
5898
+ * @param target The current drop target, or `undefined` if the drag gesture
5899
+ * is not currently over any drop target.
5900
+ *
5901
+ */
5902
+ private _setDropTarget(target?: BMView | null | undefined): void;
5903
+
5904
+
5905
+ /**
5906
+ * Updates the drop action displayed by this drag session, based on the current
5907
+ * source and target drop actions.
5908
+ *
5909
+ */
5910
+ private _updateDropAction(): void;
5911
+
5912
+
5913
+ /**
5914
+ * Starts a drag and drop session from the specified mouse or touch event.
5915
+ * using a delegate to supply information about the items that are being transferred.
5916
+ * @param event The event starting the drag.
5917
+ * @param dragDelegate The delegate object providing information about the
5918
+ * items being dragged.
5919
+ * @param view The view initiating this drag session.
5920
+ * @param touchIdentifier If the event is a touch event, the identifier of the
5921
+ * touch that should be tracked for the drag session.
5922
+ * If not specified, the first touch will be used instead.
5923
+ *
5924
+ */
5925
+ private static _beginDragWithEvent (event: MouseEvent | TouchEvent, {dragDelegate, view, touchIdentifier}: {dragDelegate: BMDragDelegate, view: BMView, touchIdentifier?: number | null | undefined}): void;
5926
+
5927
+
5928
+ /**
5929
+ * Sets the maximum number of additional drag previews for multi-item drag sessions that can be displayed
5930
+ * in addition to the drag preview of the first item. Updating this value only affects drag sessions
5931
+ * started after this method returns.
5932
+ * @param max The new maximum number of previews to display.
5933
+ *
5934
+ */
5935
+ static setMaximumAdditionalDragPreviews (max: number): void;
5936
+
5937
+
5938
+ /**
5939
+ * A map containing views that are drop targets as keys and their associated drop delegate objects as values.
5940
+ *
5941
+ */
5942
+ private static _dropTargets (): void;
5943
+
5944
+
5945
+ /**
5946
+ * Registers a view as a potential drop target for future drag sessions, using the specified delegate
5947
+ * to handle updates to the associated drop sessions and the drop actions.
5948
+ *
5949
+ * If the view is already registered as a drop target, this will replace the delegate handling future
5950
+ * drop sessions for the view with the specified object.
5951
+ * @param target The view that will act as a drop target.
5952
+ * @param delegate The delegate that will handle actions and events from the drop
5953
+ * session on behalf of the target view.
5954
+ *
5955
+ */
5956
+ static registerDropTarget (target: BMView, {delegate}: {delegate: BMDropDelegate}): void;
5957
+
5958
+
5959
+ /**
5960
+ * Unregisters a view as a potential drop target for future drag sessions. This has no effect on any
5961
+ * in-progress drop sessions which will continue using the previously registered delegate to handle
5962
+ * events and actions.
5963
+ *
5964
+ * This method has no effect if the view is not registered as a drop target.
5965
+ * @param target The view that was previously registered as a drop target.
5966
+ *
5967
+ */
5968
+ static unregisterDropTarget (target: BMView): void;
5969
+
5970
+ }
5971
+
5972
+
5973
+ export class BMDropSession {
5974
+
5975
+ /**
5976
+ * The drag session managing the drag gesture for which this drop session was created.
5977
+ *
5978
+ */
5979
+ private _dragSession: BMDragSession;
5980
+
5981
+ /**
5982
+ * The drop delegate specifying the behaviour of the drop over this drop target.
5983
+ *
5984
+ */
5985
+ private _delegate: BMDropDelegate;
5986
+
5987
+ /**
5988
+ * A dictionary of event handlers that have been attached to the drop target view for which this
5989
+ * drop session was created.
5990
+ *
5991
+ */
5992
+ private _eventHandlers: Dictionary<unknown>;
5993
+
5994
+ /**
5995
+ * The current drop action.
5996
+ *
5997
+ */
5998
+ readonly dropAction: BMDropSessionAction;
5999
+
6000
+ /**
6001
+ * An array of drop previews that can be used to customize the drop animation. This property is only
6002
+ * initialized at the end of accepted drop sessions if the delegate object implemented the
6003
+ * `dropSessionRequiresCustomDropAnimationForItems` method and returned `YES` from it.
6004
+ *
6005
+ */
6006
+ readonly dropPreviews?: BMDropPreview[] | null | undefined;
6007
+
6008
+ /**
6009
+ * The kind of transfer that will be performed. Only set before the `dropSessionPerformDrop` delegate
6010
+ * method is invoked if the outcome of this drop session is a transfer of items into the target view.
6011
+ *
6012
+ */
6013
+ readonly transferKind?: BMDragTransferKind | null | undefined;
6014
+
6015
+ /**
6016
+ * Initializes this drop session with the specified drag session and the drop delegate.
6017
+ * @param session The drag session associated with this drop session
6018
+ * @param delegate The drop delegate used to determine the outcome of the drop.
6019
+ * @return This drop session.
6020
+ *
6021
+ */
6022
+ private _initWithDragSession(session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
6023
+
6024
+
6025
+ /**
6026
+ * The current position of the drag and drop gesture.
6027
+ *
6028
+ */
6029
+ readonly position: BMPoint;
6030
+
6031
+ /**
6032
+ * The items being transferred in the drag and drop gesture.
6033
+ *
6034
+ */
6035
+ readonly items: BMDragItem[];
6036
+
6037
+ /**
6038
+ * The items that have been accepted through this drop session. This property is only initialized
6039
+ * before the `dropSessionPerformDrop` delegate method is invoked.
6040
+ *
6041
+ */
6042
+ readonly dropItems?: BMDragItem[] | null | undefined;
6043
+
6044
+ /**
6045
+ * Creates and returns a drop session initialized with the specified drag session and the drop delegate.
6046
+ * @param session The drag session associated with the drop session
6047
+ * @param delegate The drop delegate used to determine the outcome of the drop.
6048
+ * @return A drop session.
6049
+ *
6050
+ */
6051
+ private static _sessionForDragSession (session: BMDragSession, {delegate}: {delegate: BMDropDelegate}): BMDropSession;
6052
+
6053
+ }
6054
+
6055
+
6056
+ /**
6057
+ * The specification of a `BMDragDelegate` object which is used to obtain information about a dragging session
6058
+ * from the object that starts it and customize its behaviour depending on its position in the viewport.
6059
+ *
6060
+ */
6061
+ export interface BMDragDelegate {
6062
+
6063
+ /**
6064
+ * Invoked at the beginning of a drag session to obtain the initial items that will be
6065
+ * part of the drag session.
6066
+ *
6067
+ * The delegate object implementing this method must provide an array of drag items that
6068
+ * will be transferred as part of the drag session. The array must contain at least one item.
6069
+ * @param session The drag session that is starting.
6070
+ * @return An array of drag items that will be part of the drag session.
6071
+ *
6072
+ */
6073
+ dragSessionInitialItems(session: BMDragSession): BMDragItem[];
6074
+
6075
+
6076
+ /**
6077
+ * Invoked by a drag session to obtain a preview for the specified drag item at the beginning
6078
+ * of a drag session. The drag session will invoke this method only for the first few items
6079
+ * that will be visible while the drag session is in progress.
6080
+ *
6081
+ * Delegate objects implementing this method must provide an appropriate preview for the
6082
+ * specified item by returning a {@link BMDragPreview} object initialized for the specified
6083
+ * drag item.
6084
+ * @param session The drag session for which to supply an item preview.
6085
+ * @param item An item that is part of the drag session whose preview
6086
+ * should be provided.
6087
+ * @return The preview that will be displayed for the item.
6088
+ *
6089
+ */
6090
+ dragSessionPreviewForItem(session: BMDragSession, item: BMDragItem): BMDragPreview;
6091
+
6092
+
6093
+ /**
6094
+ * Invoked when a drag session is about to end and there items that will not be transferred to determine if
6095
+ * the drag delegate wants to play a customized drop animation for the specified items which for
6096
+ * which drag previews are currently displayed. This method is only invoked if there is at least one item
6097
+ * with a preview that will not be transferred or deleted as part of the drag session.
6098
+ *
6099
+ * Implementing and returning `YES` from this method will cause the drag session to not play the
6100
+ * standard drop animation for the specified items. Instead, in the `dragSessionAnimateDropWithPreviews`,
6101
+ * `dragSessionPerformMoveForItems` and `dragSessionPerformDelete` methods,
6102
+ * the drag session's `dropPreviews` property will contain an array of drag previews that can be
6103
+ * used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
6104
+ * @param session The drag session.
6105
+ * @param items The items that have not been accepted for transferring or deleted.
6106
+ * @return `NO` to play the standard drop animation, or `YES` to play
6107
+ * a customized drop animation.
6108
+ *
6109
+ */
6110
+ dragSessionRequiresCustomDropAnimationForItems?(session: BMDragSession, items: BMDragItem[]): boolean;
6111
+
6112
+
6113
+ /**
6114
+ * Invoked after returning `YES` from `dragSessionRequiresCustomDropAnimationForItems` to play a drop animation
6115
+ * for the specified drop previews. Delegate objects implementing this method should play an appropriate drop animation
6116
+ * for the specified drop previews, then detach them from the document.
6117
+ * @param session The drag session for which to play the drop animation.
6118
+ * @param previews The drop previews that should be animated.
6119
+ *
6120
+ */
6121
+ dragSessionAnimateDropWithPreviews?(session: BMDragSession, previews: BMDropPreview[]): void;
6122
+
6123
+
6124
+ /**
6125
+ * Invoked by a drag session after a drop target accepts or partially accepts the items in the session
6126
+ * and both this delegate and the associated drop delegate have specified that the transfer should
6127
+ * be a transfer of kind `.Move`.
6128
+ *
6129
+ * Delegate objects that support moving items must implement this method and remove the specified
6130
+ * items that have been moved into the drop target.
6131
+ * @param session The drag session through which items have been moved.
6132
+ * @param items The items that have been moved into the drop target. These
6133
+ * may be a subset of the session's items if the drop target
6134
+ * has specified a drop action of `.AcceptPartially`.
6135
+ *
6136
+ */
6137
+ dragSessionPerformMoveForItems?(session: BMDragSession, items: BMDragItem[]): void;
6138
+
6139
+
6140
+ /**
6141
+ * Invoked by a drag session if a drop occurs in a location where this delegate has specified that
6142
+ * the action should be to delete the items.
6143
+ *
6144
+ * Delegate objects that support deleting items must implement this method and remove all items in
6145
+ * the drag session.
6146
+ * @param session The drag session through which the items have been removed.
6147
+ *
6148
+ */
6149
+ dragSessionPerformDelete?(session: BMDragSession): void;
6150
+
6151
+
6152
+ /**
6153
+ * Invoked by a drag session to determine if items can be transferred to other drop targets.
6154
+ *
6155
+ * Delegate objects implementing this method should return a boolean indicating whether
6156
+ * transfers can be performed or not. A return value of `YES` is assumed when this method
6157
+ * is not implemented by the delegate object.
6158
+ * @param session The drag session that will be transferring items.
6159
+ * @return `YES` if item transfer is supported, `NO` otherwise.
6160
+ *
6161
+ */
6162
+ dragSessionCanTransferItems?(session: BMDragSession): boolean;
6163
+
6164
+
6165
+ /**
6166
+ * Invoked by a drag session that is about to begin from this delegate.
6167
+ * @param session The drag session that is about to begin.
6168
+ *
6169
+ */
6170
+ dragSessionWillBegin?(session: BMDragSession): void;
6171
+
6172
+
6173
+ /**
6174
+ * Invoked when a drag session enters the frame of the source view.
6175
+ * @param session The drag session that entered the view's frame.
6176
+ *
6177
+ */
6178
+ dragSessionDidEnter?(session: BMDragSession): void;
6179
+
6180
+
6181
+ /**
6182
+ * Invoked by a drag session whenever its position is updated. This method is continually
6183
+ * invoked as the drag position changes, even while the gesture moves outside of the
6184
+ * source view's frame.
6185
+ * Delegates implementing this method should return a drop action indicating the outcome of
6186
+ * dropping the items at the session's current position.
6187
+ * @param session The drag session. Its position may be retrieved via
6188
+ * the `position` property.
6189
+ * @return The new action the source view would like to perform if the
6190
+ * drop session ended at the current position, or `undefined`
6191
+ * if the current action should be retained.
6192
+ *
6193
+ */
6194
+ dragSessionDidUpdate?(session: BMDragSession): BMDragSessionAction | null | undefined;
6195
+
6196
+
6197
+ /**
6198
+ * Invoked when a drag session exits the frame of the source view.
6199
+ * @param session The drag session that exited the view's frame.
6200
+ *
6201
+ */
6202
+ dragSessionDidExit?(session: BMDragSession): void;
6203
+
6204
+
6205
+ /**
6206
+ * Invoked by a drag session to obtain the kind of transfer to perform for the items being dragged.
6207
+ * This method is invoked when the drop occurs on a drop target that accepted the transfer or whenever
6208
+ * a drop requests a drop action that requires a specific transfer kind.
6209
+ *
6210
+ * Delegate objects implementing this method should return an appropriate transfer kind for
6211
+ * the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
6212
+ * @param session The drag session through which the item transfer was performed.
6213
+ * @return The kind of transfer to perform.
6214
+ *
6215
+ */
6216
+ dragSessionTransferKind?(session: BMDragSession): BMDragTransferKind;
6217
+
6218
+
6219
+ /**
6220
+ * Invoked by a drag session that is about to finish.
6221
+ *
6222
+ * Delegate objects may optionally implement this method to perform any necessary cleanup
6223
+ * before the drag session ends.
6224
+ * @param session The drag session.
6225
+ *
6226
+ */
6227
+ dragSessionWillFinish?(session: BMDragSession): void;
6228
+
6229
+
6230
+ /**
6231
+ * Invoked by a drag session that has finished and all associated animations have concluded.
6232
+ *
6233
+ * Delegate objects may optionally implement this method to perform any necessary cleanup
6234
+ * before the drag session ends.
6235
+ * @param session The drag session.
6236
+ *
6237
+ */
6238
+ dragSessionDidFinish?(session: BMDragSession): void;
6239
+
6240
+ }
6241
+
6242
+
6243
+ /**
6244
+ * The specification of a `BMDropDelegate` object which is used to obtain information about
6245
+ * whether a drag session can be accepted by potential drop targets and to customize the information
6246
+ * presented to users as the drag moves over the drop area.
6247
+ *
6248
+ */
6249
+ export interface BMDropDelegate {
6250
+
6251
+ /**
6252
+ * Invoked when a drag session starts to verify if the target view can accept the items
6253
+ * in the specified drop session. When returning `YES` from this method, the view will
6254
+ * be considered a valid drop target for the session and will receive updates when the
6255
+ * drag will enter the view's frame.
6256
+ * @param session The drop session containing the items to be verified.
6257
+ * @return `YES` if at least one item is acceptable for dropping,
6258
+ * `NO` otherwise.
6259
+ *
6260
+ */
6261
+ dropSessionCanBegin(session: BMDropSession): boolean;
6262
+
6263
+
6264
+ /**
6265
+ * Invoked when a drop session ends while in the target view's frame. Delegate objects implementing
6266
+ * this method should perform the appropriate changes based on the session's drop action.
6267
+ * @param session The drop session for which to perform the drop action.
6268
+ *
6269
+ */
6270
+ dropSessionPerformDrop(session: BMDropSession): void;
6271
+
6272
+
6273
+ /**
6274
+ * Invoked when a drop session is about to end while in the target view's frame to determine if
6275
+ * the drop delegate wants to play a customized drop animation for the specified items which for
6276
+ * which drag previews are currently displayed. This method is only invoked if the specified drop
6277
+ * action is `.Accept` or `.AcceptPartially`.
6278
+ *
6279
+ * Implementing and returning `YES` from this method will cause the drop session to not play the
6280
+ * standard drop animation for the specified items. Instead, in the `dropSessionPerformDrop` method,
6281
+ * the drop session's `dropPreviews` property will contain an array of drop previews that can be
6282
+ * used to obtain a reference to the preview elements and use them to play an appropriate drop animation.
6283
+ * @param session The drop session.
6284
+ * @param items The items that have been accepted by the drop target and which
6285
+ * have drag previews associated with them.
6286
+ * @return `NO` to play the standard drop animation, or `YES` to play
6287
+ * a customized drop animation.
6288
+ *
6289
+ */
6290
+ dropSessionRequiresCustomDropAnimationForItems?(session: BMDropSession, items: BMDragItem[]): boolean;
6291
+
6292
+
6293
+ /**
6294
+ * Invoked by a drop session to obtain the kind of transfer to perform for the items being dragged.
6295
+ * This method is invoked when the drop occurs on a drop target that accepted the transfer.
6296
+ * Delegate objects implementing this method should return an appropriate transfer kind for
6297
+ * the items. When this method is not implemented, the transfer defaults to a `.Copy` transfer.
6298
+ * @param session The drop session through which the item transfer was performed.
6299
+ * @return The kind of transfer to perform.
6300
+ *
6301
+ */
6302
+ dropSessionTransferKind?(session: BMDropSession): BMDragTransferKind;
6303
+
6304
+
6305
+ /**
6306
+ * Invoked when a drop session enters the frame of the target view.
6307
+ * @param session The drop session that entered the view's frame.
6308
+ *
6309
+ */
6310
+ dropSessionDidEnter?(session: BMDropSession): void;
6311
+
6312
+
6313
+ /**
6314
+ * Invoked by a drop session whenever it updates while over the target view's frame. This method
6315
+ * is invoked when the session enters the frame and whenever it moves.
6316
+ * Delegates implementing this method should return a drop action indicating the outcome of
6317
+ * dropping the items at the session's current position.
6318
+ * @param session The drop session that updated.
6319
+ * @return The new action the target view would like to perform if the
6320
+ * drop session ended at the current position, or `undefined`
6321
+ * if the current action should be retained.
6322
+ *
6323
+ */
6324
+ dropSessionDidUpdate?(session: BMDropSession): BMDropSessionAction | null | undefined;
6325
+
6326
+
6327
+ /**
6328
+ * Invoked when a drop session exits the frame of the target view. Subsequent updates for this drop
6329
+ * session will no longer be provided until the drop session moves into the target view again.
6330
+ * @param session The drop session that exited the view's frame.
6331
+ *
6332
+ */
6333
+ dropSessionDidExit?(session: BMDropSession): void;
6334
+
6335
+
6336
+ /**
6337
+ * Invoked to notify the delegate that the specified drop session is about to finish. This is invoked for a drop
6338
+ * delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
6339
+ * in the target view's frame or not.
6340
+ * @param session The drop session that ended.
6341
+ *
6342
+ */
6343
+ dropSessionWillFinish?(session: BMDropSession): void;
6344
+
6345
+
6346
+ /**
6347
+ * Invoked to notify the delegate that the specified drop session has finished. This is invoked for a drop
6348
+ * delegate that has returned `YES` from `dropSessionCanBegin` regardless of whether the drop finished
6349
+ * in the target view's frame or not.
6350
+ * @param session The drop session that ended.
6351
+ *
6352
+ */
6353
+ dropSessionDidFinish?(session: BMDropSession): void;
6354
+
6355
+
6356
+ /**
6357
+ * Invoked by a drop session to obtain a preview for the specified drag item while the session is in
6358
+ * the target view's frame.
6359
+ *
6360
+ * Delegate objects implementing this method may provide an appropriate preview for the
6361
+ * specified item by returning a {@link BMDragPreview} object initialized for the specified
6362
+ * drag item. When this method is not implemented, or when returning `undefined`, the preview
6363
+ * already in use for the item will continue to be used while the session is the target view's frame.
6364
+ * @param session The drop session for which to supply an item preview.
6365
+ * @param item An item that is part of the drop session whose preview
6366
+ * should be provided.
6367
+ * @return If specified, the preview that will be displayed for the item.
6368
+ * If omitted, the current preview will continue to be used.
6369
+ *
6370
+ */
6371
+ dropSessionPreviewForItem?(session: BMDropSession, item: BMDragItem): BMDragPreview | null | undefined;
6372
+
6373
+ }
6374
+
6375
+
6376
+ /**
6377
+ * A provider that can supply the contents of an item that is part of a drag and drop gesture
6378
+ * in various representations.
6379
+ *
6380
+ */
6381
+ export interface BMDragItem {
6382
+
6383
+ /**
6384
+ * Invoked to determine whether the contents of this drag item supports being represented
6385
+ * as the specified developer-defined type.
6386
+ * @param type The type being checked.
6387
+ * @return `YES` if the content can be represented as the specified
6388
+ * type, `NO` otherwise.
6389
+ *
6390
+ */
6391
+ canConformToType(type: string): boolean;
6392
+
6393
+
6394
+ /**
6395
+ * Invoked to obtain the representation of the contents in this drag item converted to the specified
6396
+ * developer-defined type. If `canConformToType` returns `YES` for that type, this method must be able
6397
+ * to return an object of that type.
6398
+ *
6399
+ * Core UI may invoke this method supplying a type of `default` to obtain a representation to use for
6400
+ * legacy APIs. In this case, this method can return any representation, but multiple invocations of
6401
+ * this method with the `default` type must return the same representation.
6402
+ * @param type The type of object to return.
6403
+ * @return An object if the specified type representing this drag item's contents.
6404
+ *
6405
+ */
6406
+ itemOfType(type: string): unknown;
6407
+
6408
+ }
6409
+
6410
+
6411
+ export class BMDropSessionActionKind {
6412
+ /**
6413
+ * Indicates that this drag session is ignored by the drop target and should be treated
6414
+ * as if the items are simply dragged out of the source view.
6415
+ *
6416
+ */
6417
+ static Ignore: BMDropSessionActionKind;
6418
+
6419
+ /**
6420
+ * Indicates that the drop target can normally accept items from the source view but none
6421
+ * of the items in the current session are acceptable. Finishing the gesture over the
6422
+ * current drop target should cancel the gesture.
6423
+ *
6424
+ */
6425
+ static Reject: BMDropSessionActionKind;
6426
+
6427
+ /**
6428
+ * Indicates that the drop target can accept the items in the drag session, but dropping them
6429
+ * will cause the items to be deleted. Requires the source view to specify a `.Move` transfer
6430
+ * for this drag session, otherwise the action reverts to `.Reject`.
6431
+ *
6432
+ */
6433
+ static Delete: BMDropSessionActionKind;
6434
+
6435
+ /**
6436
+ * Indicates that the drop target can accept all the items in the drag session.
6437
+ *
6438
+ */
6439
+ static Accept: BMDropSessionActionKind;
6440
+
6441
+ /**
6442
+ * Indicates that the drop target can accept only some of the items in the drag session.
6443
+ * Finishing the gesture will cause the unacceptable items to be discarded.
6444
+ *
6445
+ */
6446
+ static AcceptPartially: BMDropSessionActionKind;
6447
+
6448
+ private constructor();
6449
+ }
6450
+
6451
+ export class BMDragSessionActionKind {
6452
+ /**
6453
+ * Indicates that dropping the items at the current location will have no additional effect.
6454
+ *
6455
+ */
6456
+ static Ignore: BMDragSessionActionKind;
6457
+
6458
+ /**
6459
+ * Indicates that ending the drag session at the current location will cause the items to be
6460
+ * deleted.
6461
+ *
6462
+ */
6463
+ static Delete: BMDragSessionActionKind;
6464
+
6465
+ /**
6466
+ * Indicates that dropping the items at the current location would normally cause an effect,
6467
+ * but that action cannot currently be performed.
6468
+ * Finishing the gesture over the current drop target should cancel the gesture.
6469
+ *
6470
+ */
6471
+ static Reject: BMDragSessionActionKind;
6472
+
6473
+ private constructor();
6474
+ }
6475
+
6476
+ /**
6477
+ * An object that describes the action that should be performed for a drag or drop
6478
+ * session when it ends.
6479
+ *
6480
+ */
6481
+ export class _BMDragDropSessionAction {
6482
+
6483
+ /**
6484
+ * The action to perform at the end of the drag session.
6485
+ *
6486
+ */
6487
+ private _action: BMDragSessionActionKind | BMDropSessionActionKind;
6488
+
6489
+ /**
6490
+ * If specified, the message text to display for this outcome.
6491
+ *
6492
+ */
6493
+ private _message?: string | null | undefined;
6494
+
6495
+ /**
6496
+ * If specified, the message markup to display for this outcome.
6497
+ *
6498
+ */
6499
+ private _messageHTML?: string | null | undefined;
6500
+
6501
+ /**
6502
+ * If specified when the action is `.AcceptPartially`, the drag items that are actually acceptable.
6503
+ * If omitted, the UI will not indicate which items are acceptable.
6504
+ *
6505
+ */
6506
+ private _acceptableItems?: BMDragItem[] | null | undefined;
6507
+ }
6508
+
6509
+
6510
+ /**
6511
+ * An object that represents a preview of a drag item and is displayed during a drag session.
6512
+ *
6513
+ */
6514
+ export class BMDragPreview {
6515
+
6516
+ /**
6517
+ * The drag item represented by this drag preview.
6518
+ *
6519
+ */
6520
+ private _dragItem: BMDragItem;
6521
+
6522
+ /**
6523
+ * Initializes this drag preview by creating a copy of the specified source node.
6524
+ * @param node The source node.
6525
+ * @param forItem The drag item for which a preview is created.
6526
+ * @return This drag preview.
6527
+ *
6528
+ */
6529
+ initWithCopyOfSourceNode(node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
6530
+
6531
+
6532
+ /**
6533
+ * Designated initializer. Initializes this drag preview with the specified preview node
6534
+ * and optionally a source node.
6535
+ * @param node The node representing the preview.
6536
+ * @param forItem The drag item for which a preview is created.
6537
+ * @param sourceNode If specified, the node that the drag item represents.
6538
+ * @return This drag preview.
6539
+ *
6540
+ */
6541
+ initWithPreviewNode(node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
6542
+
6543
+
6544
+ /**
6545
+ * The source node for which a preview is generated. This is used to run an appropriate animation
6546
+ * from the node corresponding to the drag item when the drag session starts or finishes.
6547
+ *
6548
+ * If the source node is not provided, a generic animation will typically play instead for the preview node.
6549
+ *
6550
+ */
6551
+ private _sourceNode?: DOMNode | null | undefined;
6552
+
6553
+ /**
6554
+ * The node representing the preview. This node should not be modified while a drag
6555
+ * session is in progress.
6556
+ *
6557
+ */
6558
+ readonly previewNode: DOMNode;
6559
+
6560
+ /**
6561
+ * When set to `YES`, this indicates that the preview node is an exact copy of the source node
6562
+ * and a transition between the preview and source node is not required.
6563
+ *
6564
+ */
6565
+ private _isCopyOfSourceNode: boolean;
6566
+
6567
+ /**
6568
+ * The current frame of the drag preview, before any transforms are applied.
6569
+ *
6570
+ */
6571
+ readonly frame: BMRect;
6572
+
6573
+ /**
6574
+ * Updates this preview's position on screen.
6575
+ * @param position The new position, relative to the center of this preview's frame.
6576
+ *
6577
+ */
6578
+ private _setPosition(position: BMPoint): void;
6579
+
6580
+
6581
+ /**
6582
+ * Applies the specified frame to the preview node.
6583
+ * @param frame The frame to apply.
6584
+ *
6585
+ */
6586
+ private _applyFrame(frame: BMRect): void;
6587
+
6588
+
6589
+ /**
6590
+ * A dictionary containing transform property names as keys and their applied values, expressed
6591
+ * in pixels as the value. The contents of object should not be modified while the drag session
6592
+ * is in progress.
6593
+ *
6594
+ */
6595
+ readonly transform: Dictionary<number>;
6596
+
6597
+ /**
6598
+ * Applies the transform to the preview node.
6599
+ * @param transform The transform dictionary. See {@link BMDragPreview.transform}.
6600
+ *
6601
+ */
6602
+ private _applyTransform(transform: Dictionary<number>): void;
6603
+
6604
+
6605
+ /**
6606
+ * The total amount of displacement to apply for this preview when rejected.
6607
+ *
6608
+ */
6609
+ private _rejectionDistance: number;
6610
+
6611
+ /**
6612
+ * Set to YES when this preview is displaced to indicate that it is rejected.
6613
+ *
6614
+ */
6615
+ private _rejected: boolean;
6616
+
6617
+ /**
6618
+ * Updates the rejection distance to the specified number of pixels. If this preview is
6619
+ * currently rejected, its position will be animated to the new distance.
6620
+ * @param distance The number of pixels to displace this preview by when rejected.
6621
+ *
6622
+ */
6623
+ private _setRejectionDistance(distance: number): void;
6624
+
6625
+
6626
+ /**
6627
+ * Set to `YES` while this preview is playing the rejection animation.
6628
+ *
6629
+ */
6630
+ private _rejecting: boolean;
6631
+
6632
+ /**
6633
+ * Updates the rejection state of this drag preview.
6634
+ * @param rejected `YES` if this preview's item is rejected, `NO` otherwise.
6635
+ *
6636
+ */
6637
+ private _setRejected(rejected: boolean): void;
6638
+
6639
+
6640
+ /**
6641
+ * Set to `YES` while this preview's frame is animating.
6642
+ *
6643
+ */
6644
+ private _animatingFrame: boolean;
6645
+
6646
+ /**
6647
+ * Set to `YES` after the preview node has been measured.
6648
+ *
6649
+ */
6650
+ private _measured: boolean;
6651
+
6652
+ /**
6653
+ * Measures the preview node and updates the frame to the measured size.
6654
+ *
6655
+ */
6656
+ private _measure(): void;
6657
+
6658
+
6659
+ /**
6660
+ * Attaches this drag session preview to the document and applies its frame and transform properties.
6661
+ * @param position If specified, the point at which the preview will be attached,
6662
+ * relative to the viewport.
6663
+ * @param before If specified, a node before which the preview node will be attached.
6664
+ * @return An iterator that must be iterated to sync DOM reads and writes
6665
+ * when multiple previews are attached at the same time.
6666
+ *
6667
+ */
6668
+ private _attachAtPosition(position?: BMPoint | null | undefined, {before}?: {before?: DOMNode | null | undefined}): Iterator<void>;
6669
+
6670
+
6671
+ /**
6672
+ * Set to the source animation during the lift animation.
6673
+ *
6674
+ */
6675
+ private _animationSourceNode?: DOMNode | null | undefined;
6676
+
6677
+ /**
6678
+ * Plays the lift animation for this drag preview at the beginning of a drag session or when the associated
6679
+ * item is added to an in-progress drag session.
6680
+ * @return A promise that resolves when the associated animation completes.
6681
+ *
6682
+ */
6683
+ private _performLift(): Promise<void>;
6684
+
6685
+
6686
+ /**
6687
+ * Set to `YES` if this preview's drop animation is handled by the drop delegate.
6688
+ *
6689
+ */
6690
+ private _dropHandled: boolean;
6691
+
6692
+ /**
6693
+ * Plays the drop animation for this drag preview at the end of the drag session, if the current
6694
+ * drop target did not handle the drop animation on its own.
6695
+ * @return A promise that resolves when the associated animation completes.
6696
+ *
6697
+ */
6698
+ private _performDrop(): Promise<void>;
6699
+
6700
+
6701
+ /**
6702
+ * Plays the delete animation for this drag preview at the end of the drag session, if the drop
6703
+ * action was set to `.Delete`.
6704
+ * @return A promise that resolves when the associated animation completes.
6705
+ *
6706
+ */
6707
+ private _performDelete(): Promise<void>;
6708
+
6709
+
6710
+ /**
6711
+ * If specified, the preview this preview is transitioning from, while the transition
6712
+ * is in progress. `undefined` in all other cases.
6713
+ *
6714
+ */
6715
+ private _transitionPreview: BMDragPreview;
6716
+
6717
+ /**
6718
+ * A unique identifier for transitions, used to perform the appropriate cleanup at the end
6719
+ * of the transition only when needed.
6720
+ *
6721
+ */
6722
+ private _transitionUID: number;
6723
+
6724
+ /**
6725
+ * Plays a transition animation from the specified drag preview to this drag preview, when the drag
6726
+ * session transitions to a new drop target. Detaches the specified drag preview from the document
6727
+ * if different from the current one.
6728
+ * @param preview The drag preview from which to play a transition.
6729
+ * @param fromRejectionDistance The reject distance prior to this transition taking place.
6730
+ * @return A promise that resolves when the associated animation completes.
6731
+ *
6732
+ */
6733
+ private _performTransitionFromDragPreview(preview: BMDragPreview, {fromRejectionDistance}: {fromRejectionDistance: number}): Promise<void>;
6734
+
6735
+
6736
+ /**
6737
+ * Controls whether this drag preview is detachable. Active drag previews are not detachable.
6738
+ *
6739
+ */
6740
+ private _detachable: boolean;
6741
+
6742
+ /**
6743
+ * Detaches this drag preview from the document and resets its transform to the values of the `_transform` property.
6744
+ * The preview should be reattached to the document using {@link BMDragPreview._attach} before being reused.
6745
+ *
6746
+ */
6747
+ private _detach(): void;
6748
+
6749
+
6750
+ /**
6751
+ * Creates and returns a drag preview initialized by creating a copy of the specified source node.
6752
+ * @param node The source node.
6753
+ * @param forItem The drag item for which a preview is created.
6754
+ * @return A drag preview.
6755
+ *
6756
+ */
6757
+ static dragPreviewWithCopyOfSourceNode (node: DOMNode, {forItem}: {forItem: BMDragItem}): BMDragPreview;
6758
+
6759
+
6760
+ /**
6761
+ * Creates and returns a drag preview initialized with the specified preview node and optionally a source node.
6762
+ * @param node The node representing the preview.
6763
+ * @param forItem The drag item for which a preview is created.
6764
+ * @param sourceNode If specified, the node that the drag item represents.
6765
+ * @return A drag preview.
6766
+ *
6767
+ */
6768
+ static dragPreviewWithPreviewNode (node: DOMNode, {forItem, sourceNode}: {forItem: BMDragItem, sourceNode?: DOMNode | null | undefined}): BMDragPreview;
6769
+
6770
+ }
6771
+
6772
+
6773
+ /**
6774
+ * An object that represents a preview of a drag item at the end of a drop session that can be used
6775
+ * by the drop delegate to play an appropriate drop animation for the item. When using the drop preview
6776
+ * to customize the drop animation, it is the responsibility of the drop delegate object to detach
6777
+ * the drop preview at the end of the animation, unless using one of the built-in animations provided
6778
+ * by the drop preview.
6779
+ *
6780
+ * Drop previews should not be created manually. Core UI will automatically create drop previews for
6781
+ * the appropriate items at the end of a drop session if there are items that have been accepted
6782
+ * by the drop target.
6783
+ *
6784
+ */
6785
+ export class BMDropPreview {
6786
+
6787
+ /**
6788
+ * The original drag preview from which this drop preview was created.
6789
+ *
6790
+ */
6791
+ private _preview: BMDragPreview;
6792
+
6793
+ /**
6794
+ * The drag item represented by this drop preview.
6795
+ *
6796
+ */
6797
+ readonly item: BMDragItem;
6798
+
6799
+ /**
6800
+ * Initializes this drop preview with the specified drag preview and drag item.
6801
+ * @param preview The original drag preview.
6802
+ * @param forItem The item represented by this preview.
6803
+ * @return This drop preview.
6804
+ *
6805
+ */
6806
+ private _initWithDragPreview(preview: BMDragPreview, {forItem}: {forItem: BMDragItem}): BMDropPreview;
6807
+
6808
+
6809
+ /**
6810
+ * The HTML element representing this preview.
6811
+ *
6812
+ */
6813
+ readonly previewNode: any;
6814
+
6815
+ /**
6816
+ * A rect that describes the current position and size of the preview node relative to the viewport.
6817
+ *
6818
+ */
6819
+ readonly frame: any;
6820
+
6821
+ /**
6822
+ * An object that describes the transform currently applied to the preview node. Its keys are transform
6823
+ * function names and its values are numbers representing the associated values. The units for the values are:
6824
+ * - `deg` for rotation properties
6825
+ * - `px` for translation properties
6826
+ * - untyped for scale properties
6827
+ *
6828
+ * The rotation transforms are always applied after all other transforms.
6829
+ *
6830
+ */
6831
+ readonly transform: any;
6832
+
6833
+ /**
6834
+ * Plays a generic drop animation for this drop preview. This method must be invoked while an animation context is active.
6835
+ * When the animation finishes this drag preview is detached from the document.
6836
+ *
6837
+ */
6838
+ performDrop(): void;
6839
+
6840
+
6841
+ /**
6842
+ * Plays a drop animation that visually transforms this drop preview into the specified node. This method must be invoked
6843
+ * while an animation context is active. When the animation finishes this drag preview is detached from the document.
6844
+ * @param node The node towards which to play the drop animation.
6845
+ *
6846
+ */
6847
+ performDropToNode(node: DOMNode): void;
6848
+
6849
+ }
6850
+
6851
+
6852
+ export class _BMDragIndicatorOrientation {
6853
+ /**
6854
+ * Indicates that the drag indicator should appear on the top left corner.
6855
+ *
6856
+ */
6857
+ static Left: _BMDragIndicatorOrientation;
6858
+
6859
+ /**
6860
+ * Indicates that the drag indicator should appear on the top right corner.
6861
+ *
6862
+ */
6863
+ static Right: _BMDragIndicatorOrientation;
6864
+
6865
+ private constructor();
6866
+ }
6867
+
6868
+ /**
6869
+ * An object that manages the indicator that appears during a drag and drop gesture.
6870
+ *
6871
+ */
6872
+ export class _BMDragIndicator {
6873
+
6874
+ /**
6875
+ * The number of items that are acceptable for the current drop target. This should be equal to
6876
+ * or lower than the total number of items in this drag session.
6877
+ *
6878
+ */
6879
+ private _acceptableItemCount: number;
6880
+
6881
+ /**
6882
+ * The node containing the indicator.
6883
+ *
6884
+ */
6885
+ private _containerNode: DOMNode;
6886
+
6887
+ /**
6888
+ * The node displaying the item count, drop outcome and message.
6889
+ *
6890
+ */
6891
+ private _indicatorNode: DOMNode;
6892
+
6893
+ /**
6894
+ * The node displaying the icon associated with the current drop icon.
6895
+ *
6896
+ */
6897
+ private _iconNode: DOMNode;
6898
+
6899
+ /**
6900
+ * The HTML element representing the message displayed to the user.
6901
+ *
6902
+ */
6903
+ private _messageNode: DOMNode;
6904
+
6905
+ /**
6906
+ * The HTML element used to measure the message text.
6907
+ *
6908
+ */
6909
+ private _messageMeasurementNode: DOMNode;
6910
+
6911
+ /**
6912
+ * The message text currently displayed on the drag indicator.
6913
+ *
6914
+ */
6915
+ private _message?: string | null | undefined;
6916
+
6917
+ /**
6918
+ * The message HTML markup currently displayed on the drag indicator.
6919
+ *
6920
+ */
6921
+ private _message?: string | null | undefined;
6922
+
6923
+ /**
6924
+ * The kind of action displayed on the indicator.
6925
+ *
6926
+ */
6927
+ private _dropActionKind: BMDragSessionActionKind | BMDropSessionActionKind;
6928
+
6929
+ /**
6930
+ * Initializes this drag indicator and attaches it to the document.
6931
+ * @return This drag indicator.
6932
+ *
6933
+ */
6934
+ init(): _BMDragIndicator;
6935
+
6936
+
6937
+ /**
6938
+ * Updates the contents of this drag indicator using the details of the specified
6939
+ * drag or drop action.
6940
+ * @param action The action.
6941
+ *
6942
+ */
6943
+ setAction(action: BMDragSessionAction | BMDropSessionAction): void;
6944
+
6945
+
6946
+ /**
6947
+ * The offset between the drag pointer and the center of this drag indicator.
6948
+ *
6949
+ */
6950
+ private _offset: BMPoint;
6951
+
6952
+ /**
6953
+ * The unique sequence identifier of the current offset animation.
6954
+ *
6955
+ */
6956
+ private _offsetAnimationID: number;
6957
+
6958
+ /**
6959
+ * Updates the offset of the indicator from the pointer's position.
6960
+ * @param offset The new offset to use.
6961
+ * @param animated Defaults to `NO`. When set to `YES` this change will be
6962
+ * animated, otherwise it will be instant.
6963
+ *
6964
+ */
6965
+ setOffset(offset: BMPoint, {animated}?: {animated?: boolean | null | undefined}): void;
6966
+
6967
+
6968
+ /**
6969
+ * The current position of the drag session, relative to the viewport.
6970
+ *
6971
+ */
6972
+ private _position: BMPoint;
6973
+
6974
+ /**
6975
+ * Updates the position of the drag gesture and all the drag previews.
6976
+ * @param position The new position.
6977
+ *
6978
+ */
6979
+ setPosition(position: BMPoint): void;
6980
+
6981
+
6982
+ /**
6983
+ * Updates the drop action displayed on the drag indicator.
6984
+ * @param action The new drop action to display.
6985
+ *
6986
+ */
6987
+ private _setDropActionKind(action: _BMDragDropSessionAction): void;
6988
+
6989
+
6990
+ /**
6991
+ * Updates the item count displayed on the drag indicator.
6992
+ * @param count The new item count to display.
6993
+ *
6994
+ */
6995
+ setAcceptableItemCount(count: number): void;
6996
+
6997
+
6998
+ /**
6999
+ * Updates the message currently displayed on the drag indicator.
7000
+ * @param message The message to display, or `undefined` to not show any message.
7001
+ *
7002
+ */
7003
+ private _setMessage(message?: string | null | undefined): void;
7004
+
7005
+
7006
+ /**
7007
+ * Updates the message currently displayed on the drag indicator using the specified HTML text.
7008
+ * @param message The message HTML to display, or `undefined` to not show any message.
7009
+ *
7010
+ */
7011
+ private _setMessageHTML(message?: string | null | undefined): void;
7012
+
7013
+
7014
+ /**
7015
+ * Plays the lift animation for this drag indicator.
7016
+ * @return A promise that resolves when the animation completes.
7017
+ *
7018
+ */
7019
+ performLift(): Promise<void>;
7020
+
7021
+
7022
+ /**
7023
+ * Plays the drop animation for this drag indicator.
7024
+ * @return A promise that resolves when the animation completes.
7025
+ *
7026
+ */
7027
+ performDrop(): Promise<void>;
7028
+
7029
+
7030
+ /**
7031
+ * Detaches this drag indicator from the document.
7032
+ * The drag indicator should not be reused after this method returns.
7033
+ *
7034
+ */
7035
+ release(): void;
7036
+
7037
+ }
7038
+
7039
+
7040
+ /**
7041
+ * An object that manages the appearance, position and animations of the preview elements
7042
+ * for items included in a drag session and the drag indicator.
7043
+ *
7044
+ */
7045
+ export class _BMDragPreviewSet {
7046
+
7047
+ /**
7048
+ * The offset between the drag pointer and the center the from of the view from which the drag session
7049
+ * started, expressed in percentages relative to the view's frame.
7050
+ *
7051
+ */
7052
+ private _offsetPercent: BMPoint;
7053
+
7054
+ /**
7055
+ * The offset between the drag pointer and the center of the frames of the preview elements.
7056
+ *
7057
+ */
7058
+ private _offset: BMPoint;
7059
+
7060
+ /**
7061
+ * The current position of the drag session.
7062
+ *
7063
+ */
7064
+ private _position: BMPoint;
7065
+
7066
+ /**
7067
+ * The indicator displaying information about the associated drag session.
7068
+ *
7069
+ */
7070
+ private _dragIndicator: _BMDragIndicator;
7071
+
7072
+ /**
7073
+ * A mapping between drag items and their associated drag previews.
7074
+ *
7075
+ */
7076
+ private _dragPreviews: Map<BMDragItem, BMDragPreview>;
7077
+
7078
+ /**
7079
+ * A mapping between drag items and the drag previews provided initially for each.
7080
+ *
7081
+ */
7082
+ private _baseDragPreviews: Map<BMDragItem, BMDragPreview>;
7083
+
7084
+ /**
7085
+ * A set that controls which items appear as rejected.
7086
+ *
7087
+ */
7088
+ private _rejectedItems: Set<BMDragItem>;
7089
+
7090
+ /**
7091
+ * The total displacement to apply to rejected previews.
7092
+ *
7093
+ */
7094
+ private _rejectionDistance: number;
7095
+
7096
+ /**
7097
+ * Initializes this drag preview set with the specified item previews and offset position.
7098
+ * @param previews The previews for items in the drag session.
7099
+ * @param pointerOffset The offset between the drag pointer and the
7100
+ * center of the frames of the view from which the
7101
+ * drag session started.
7102
+ * @return This preview set.
7103
+ *
7104
+ */
7105
+ initWithPreviews(previews: BMDragPreview[], {pointerOffset}: {pointerOffset: BMPoint}): _BMDragPreviewSet;
7106
+
7107
+
7108
+ /**
7109
+ * An additional preview to display when all items are rejected.
7110
+ *
7111
+ */
7112
+ private _additionalPreview?: BMDragPreview | null | undefined;
7113
+
7114
+ /**
7115
+ * Displays the specified additional preview, or clears it.
7116
+ * @param preview The additional preview to display, or `undefined` to
7117
+ * clear the additional preview.
7118
+ *
7119
+ */
7120
+ setAdditionalPreview(preview?: BMDragPreview | null | undefined): void;
7121
+
7122
+
7123
+ /**
7124
+ * Updates the position of the drag gesture and all the drag previews.
7125
+ * @param position The new position.
7126
+ *
7127
+ */
7128
+ setPosition(position: BMPoint): void;
7129
+
7130
+
7131
+ /**
7132
+ * Causes the previews for the specified items to appear as rejected. All other items will
7133
+ * appear as acceptable even if they had been previously set as rejected using this method.
7134
+ * @param items The items that should appear as rejected,
7135
+ * or `undefined` to clear the rejected items.
7136
+ *
7137
+ */
7138
+ setRejectedItems(items?: BMDragItem[] | null | undefined): void;
7139
+
7140
+
7141
+ /**
7142
+ * Attaches the drag previews and plays their lift animations.
7143
+ * @param position The position of the drag session.
7144
+ *
7145
+ */
7146
+ beginLiftAtPosition(position: BMPoint): void;
7147
+
7148
+
7149
+ /**
7150
+ * Updates or resets the previews for the specified items using a map.
7151
+ * @param previews The drag previews to use, or `undefined` to reset it for each item.
7152
+ *
7153
+ */
7154
+ updatePreviewsWithMap(previews: Map<BMDragItem, BMDragPreview | undefined>): void;
7155
+
7156
+
7157
+ /**
7158
+ * Determines the rejection distance based on the size of all current previews.
7159
+ *
7160
+ */
7161
+ private _updateRejectionDistance(): void;
7162
+
7163
+
7164
+ /**
7165
+ * The orientation of the drag indicator relative to the top edge of the drag previews.
7166
+ *
7167
+ */
7168
+ private readonly _indicatorOrientation: any;
7169
+
7170
+ /**
7171
+ * Updates the orientation of the drag indicator. If the orientation changes as a result
7172
+ * of this method, the change will be animated.
7173
+ * @param orientation The new orientation to use.
5475
7174
  *
5476
7175
  */
5477
- private _menuItemWithLabel(label: string, {action}: {action: (($0: Event) => void)}): DOMNode;
7176
+ private _setIndicatorOrientation(orientation: _BMDragIndicatorOrientation): void;
5478
7177
 
5479
7178
 
5480
7179
  /**
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.
7180
+ * The offset the indicator would use if the orientation was set to `.Right`.
5486
7181
  *
5487
7182
  */
5488
- private _showMenuAtPoint(point: BMPoint, {withOptions, kind}: {withOptions: DOMNode[], kind?: BMMenuKind | null | undefined}): DOMNode;
5489
-
7183
+ private _indicatorOffsetRight: number;
5490
7184
 
5491
7185
  /**
5492
- * Constructs and returns a text field with a new DOM node.
5493
- * @return A text field.
5494
- *
7186
+ * Updates the drag indicator offset from the drag session's position based on the size
7187
+ * and scale of the first displayed item preview.
7188
+ * The offset for the indicator is set such that it will appear to the top left of
7189
+ * the first preview.
7190
+ * @param animated Defaults to `YES`. Whether this change is animated.
7191
+ *
5495
7192
  */
5496
- static textField (): BMTextField;
7193
+ private _updateDragIndicatorOffsetAnimated(animated?: boolean | null | undefined): void;
5497
7194
 
5498
7195
 
5499
7196
  /**
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
- *
7197
+ * Plays the drop animation for the current drag previews, then detaches them.
7198
+ *
5504
7199
  */
5505
- static textFieldForInputNode (node: DOMNode): BMTextField;
7200
+ performDrop(): void;
5506
7201
 
5507
7202
  }
5508
7203
 
@@ -8296,6 +9991,13 @@ export class BMMenu {
8296
9991
  */
8297
9992
  _delaysClosing: boolean;
8298
9993
 
9994
+ /**
9995
+ * When set to `YES`, the menu item actions and item selection delegate callbacks will be invoked
9996
+ * with a slight delay to allow time for the menu closing animation to play.
9997
+ *
9998
+ */
9999
+ delaysActions: boolean;
10000
+
8299
10001
  /**
8300
10002
  * Initializes this menu with the specified items.
8301
10003
  * The menu will be hidden by default; the method showAtPoint(_) should be used to make the menu visible.
@@ -8332,6 +10034,20 @@ export class BMMenu {
8332
10034
  private _renderMenuItems(): void;
8333
10035
 
8334
10036
 
10037
+ /**
10038
+ * Temporarily set to the menu item that was selected until its action is performed.
10039
+ *
10040
+ */
10041
+ private _selectedMenuItem?: BMMenuItem | null | undefined;
10042
+
10043
+ /**
10044
+ * Performs the action for the specified menu item and invokes the delegate selection callback for it.
10045
+ * @param item The menu item whose action should be performed.
10046
+ *
10047
+ */
10048
+ private _performActionForMenuItem(item: BMMenuItem): void;
10049
+
10050
+
8335
10051
  /**
8336
10052
  * The kind of menu currently displayed.
8337
10053
  *
@@ -8454,7 +10170,7 @@ export class BMMenu {
8454
10170
  * @param forKeyboardShortcut The keyboard shortcut that was triggered.
8455
10171
  *
8456
10172
  */
8457
- private _selectMenuItemWithEvent(event: KeyboardEvent, {forKeyboardShortcut}: {forKeyboardShortcut: BMKeyboardShortcut}): void;
10173
+ protected _selectMenuItemWithEvent(event: KeyboardEvent, {forKeyboardShortcut}: {forKeyboardShortcut: BMKeyboardShortcut}): void;
8458
10174
 
8459
10175
 
8460
10176
  /**
@@ -10055,6 +11771,19 @@ export class BMCollectionViewLayoutInvalidationContext {
10055
11771
  */
10056
11772
  export class BMCollectionViewTransitionLayout extends BMCollectionViewLayout {
10057
11773
 
11774
+ /**
11775
+ * When set to `YES` this transition layout will no longer perform updates.
11776
+ *
11777
+ */
11778
+ private _transitionStopped: boolean;
11779
+
11780
+ /**
11781
+ * Stops the current transition in its tracks, instantly setting the final attributes on all cells.
11782
+ *
11783
+ */
11784
+ private _stopTransition(): void;
11785
+
11786
+
10058
11787
  /**
10059
11788
  * Controls how close to completion the transition is.
10060
11789
  *
@@ -10557,6 +12286,12 @@ export class BMCollectionViewFlowLayout extends BMCollectionViewLayout {
10557
12286
  */
10558
12287
  pinsFootersToContentEdge: boolean;
10559
12288
 
12289
+ /**
12290
+ * Set to `YES` while the current layout is using scrollbar offsets, `NO` otherwise.
12291
+ *
12292
+ */
12293
+ private _usingScrollbarOffset: boolean;
12294
+
10560
12295
  /**
10561
12296
  * Prepares the layout, optionally taking the scrollbar size into account.
10562
12297
  * @param useOffset When set to `YES` the layout will take the scrollbar size into account.
@@ -11221,6 +12956,41 @@ export class BMCollectionViewAcceptPolicy {
11221
12956
  private constructor();
11222
12957
  }
11223
12958
 
12959
+ export class BMCollectionViewAcceptRegion {
12960
+ /**
12961
+ * Indicates that the drop session will have the same drop action regardless of where
12962
+ * in the collection view's frame it is.
12963
+ *
12964
+ */
12965
+ static Anywhere: BMCollectionViewAcceptRegion;
12966
+
12967
+ /**
12968
+ * Indicates that the drop session's drop action changes based on the cell in which the
12969
+ * drop occurs. Drops outside of any cell's frame are rejected. The delegate object is
12970
+ * expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidEnterCell} method
12971
+ * provide the appropriate drop action for each cell.
12972
+ *
12973
+ */
12974
+ static Cell: BMCollectionViewAcceptRegion;
12975
+
12976
+ /**
12977
+ * Indicates the drop session's drop action depends on the specific position in which the drop occurs.
12978
+ * The delegate object is expected to implement the {@link BMCollectionViewDelegate.collectionViewDropSessionDidUpdate}
12979
+ * method to provide the appropriate action as the drop session's position updates.
12980
+ *
12981
+ */
12982
+ static Position: BMCollectionViewAcceptRegion;
12983
+
12984
+ /**
12985
+ * Indicates that the collection view cannot process the session's items and no further updates will
12986
+ * be provided regarding this drop session.
12987
+ *
12988
+ */
12989
+ static Nowhere: BMCollectionViewAcceptRegion;
12990
+
12991
+ private constructor();
12992
+ }
12993
+
11224
12994
 
11225
12995
 
11226
12996
  /**
@@ -11319,7 +13089,7 @@ export class BMCollectionViewScrollingDirection {
11319
13089
  }
11320
13090
 
11321
13091
  /**
11322
- * Controls the final horizontal scrolling position of a programatic scroll.
13092
+ * Controls the final horizontal scrolling position of a programmatic scroll.
11323
13093
  *
11324
13094
  */
11325
13095
  export class BMCollectionViewScrollingGravityHorizontal {
@@ -11345,7 +13115,7 @@ export class BMCollectionViewScrollingGravityHorizontal {
11345
13115
  }
11346
13116
 
11347
13117
  /**
11348
- * Controls the final vertical scrolling position of a programatic scroll.
13118
+ * Controls the final vertical scrolling position of a programmatic scroll.
11349
13119
  *
11350
13120
  */
11351
13121
  export class BMCollectionViewScrollingGravityVertical {
@@ -11396,7 +13166,7 @@ export class BMCollectionViewScrollingGravityVertical {
11396
13166
  *
11397
13167
  *
11398
13168
  */
11399
- export class BMCollectionView<T = any> extends BMView {
13169
+ export class BMCollectionView<T = any> extends BMView implements BMDragDelegate, BMDropDelegate {
11400
13170
 
11401
13171
  /**
11402
13172
  * The last measured intrinsic size for this collection view.
@@ -12087,10 +13857,138 @@ export class BMCollectionView<T = any> extends BMView {
12087
13857
  * @param items An array of items.
12088
13858
  * @param toIndexPath The suggested index path at which to add the items.
12089
13859
  * @param withDropShadows A map containing the link between drop shadows and the items.
13860
+ * @return A promise that resolves when the associated data update
13861
+ * has completed.
13862
+ *
13863
+ */
13864
+ private _insertItems(items: any[], {toIndexPath, withDropShadows}: {toIndexPath: BMIndexPath<T>, withDropShadows: Map<any, DOMNode>}): Promise<void>;
13865
+
13866
+
13867
+ /**
13868
+ * An array containing the cells whose index paths are part of the current drag session, or
13869
+ * `undefined` while there is no drag session in progress for this collection view.
13870
+ *
13871
+ */
13872
+ private _draggingCells?: BMCollectionViewCell[] | null | undefined;
13873
+
13874
+ /**
13875
+ * A map that keeps track of the association between drag items in a drag session and the cells
13876
+ * whose items they represent.
13877
+ *
13878
+ */
13879
+ private _cellItemMap: Map<BMDragItem, BMCollectionViewCell>;
13880
+
13881
+ /**
13882
+ * Begins a drag gesture from the specified event. The drag event will move the cell from which
13883
+ * the event originates, or all selected cells if that cell is selected.
13884
+ * @param event The event triggering this action.
13885
+ * @param forCell The cell from which this event originates.
13886
+ * @param touchIdentifier If this event is a `TouchEvent`, this represents the identifier
13887
+ * of the touch point that will control this drag & drop operation.
13888
+ *
13889
+ */
13890
+ beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
13891
+
13892
+
13893
+ /**
13894
+ * Creates and returns a fallback drag item for the specified index path if the data source
13895
+ * object cannot provide a customized drag item.
13896
+ * @param indexPath The index path for which to return a drag item.
13897
+ * @return A drag item;
13898
+ *
13899
+ */
13900
+ private _defaultDragItemForIndexPath(indexPath: BMIndexPath): BMDragItem;
13901
+
13902
+
13903
+ /**
13904
+ * The current drag action to use based on the current drag position.
13905
+ *
13906
+ */
13907
+ private _dragAction?: BMDragSessionAction | null | undefined;
13908
+
13909
+ /**
13910
+ * Set to `YES` while a drag session started by this collection view is in its frame.
13911
+ *
13912
+ */
13913
+ private _dragSessionInFrame: boolean;
13914
+
13915
+ /**
13916
+ * The amount by which to scroll on the Y axis during the current drag session.
13917
+ *
13918
+ */
13919
+ private _dragScrollDirectionY: number;
13920
+
13921
+ /**
13922
+ * The amount by which to scroll on the X axis during the current drag session.
13923
+ *
13924
+ */
13925
+ private _dragScrollDirectionX: number;
13926
+
13927
+ /**
13928
+ * Whenever the pointer moves to the edges of this collection view during a drag session,
13929
+ * this method periodically scrolls the collection view's contents appropriately.
13930
+ *
13931
+ */
13932
+ private _dragScroll(): void;
13933
+
13934
+
13935
+ /**
13936
+ * The identifier of the animation frame callback used to scroll this collection during a drag session while the
13937
+ * mouse pointer
13938
+ *
13939
+ */
13940
+ private _scrollFrameIdentifier?: number | null | undefined;
13941
+
13942
+ /**
13943
+ * The kind of region being tracked during a drop session. `undefined` if a drop session is
13944
+ * not in progress.
13945
+ *
13946
+ */
13947
+ private _dropSessionRegionKind?: BMCollectionViewAcceptRegion | null | undefined;
13948
+
13949
+ /**
13950
+ * The current drop action to use based on the current drop session position.
13951
+ *
13952
+ */
13953
+ private _dropAction?: BMDropSessionAction | null | undefined;
13954
+
13955
+ /**
13956
+ * The index path associated with the current drop session, if any.
13957
+ *
13958
+ */
13959
+ private _dropIndexPath?: BMIndexPath | null | undefined;
13960
+
13961
+ /**
13962
+ * Returns the position of the specified drag or drop session relative to the collection view's bounds.
13963
+ * @param session The drag or drop session.
13964
+ * @return The coordinates relative to the bounds.
13965
+ *
13966
+ */
13967
+ positionOfDragSession(session: BMDragSession | BMDropSession): BMPoint;
13968
+
13969
+
13970
+ /**
13971
+ * Determines the index path at the specified point whose coordinates are relative to the bounds.
13972
+ * @param point The point.
13973
+ * @return The index path, if any cell's frame intersects the point,
13974
+ * or `undefined` otherwise.
13975
+ *
13976
+ */
13977
+ indexPathAtPoint(point: BMPoint): BMIndexPath | null | undefined;
13978
+
13979
+
13980
+ /**
13981
+ * The most recent index path the current drop session has been over.
12090
13982
  *
12091
13983
  */
12092
- private _insertItems(items: any[], {toIndexPath, withDropShadows}: {toIndexPath: BMIndexPath<T>, withDropShadows: Map<any, DOMNode>}): void;
13984
+ private _lastDropIndexPath: BMIndexPath;
12093
13985
 
13986
+ /**
13987
+ * The drop previews that must be animated at the end of a successful drop session. Only set while performing
13988
+ * the data update associated with accepting items via a drop session.
13989
+ *
13990
+ */
13991
+ private _dropPreviews?: BMDropPreview[] | null | undefined;
12094
13992
 
12095
13993
  /**
12096
13994
  * Begins a drag gesture from the given event. The drag event will move the cell from which
@@ -12101,7 +13999,7 @@ export class BMCollectionView<T = any> extends BMView {
12101
13999
  * of the touch point that will control this drag & drop operation.
12102
14000
  *
12103
14001
  */
12104
- beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
14002
+ private _beginDragWithEvent(event: Event, {forCell, touchIdentifier}: {forCell: BMCollectionViewCell, touchIdentifier: any}): void;
12105
14003
 
12106
14004
 
12107
14005
  /**
@@ -12300,7 +14198,7 @@ export class BMCollectionView<T = any> extends BMView {
12300
14198
  * Invoked when an arrow is pressed while this collection view has keyboard focus.
12301
14199
  * Highlights the index path to the specified direction of the currently highlighted index path.
12302
14200
  * @param arrow The key code of the keyboard arrow that was pressed.
12303
- * @param withEvent The event that triggerred this action.
14201
+ * @param withEvent The event that triggered this action.
12304
14202
  *
12305
14203
  */
12306
14204
  keyboardArrowPressed(arrow: string, {withEvent}: {withEvent: KeyboardEvent}): void;
@@ -12364,6 +14262,14 @@ export class BMCollectionView<T = any> extends BMView {
12364
14262
  setLayout(layout: BMCollectionViewLayout, {animated, completionHandler}?: {animated?: boolean | null | undefined, completionHandler?: (() => void) | null | undefined}): void;
12365
14263
 
12366
14264
 
14265
+ /**
14266
+ * If a layout transition is currently in progress it is stopped, allowing data updates to
14267
+ * start without affecting the retained cells.
14268
+ *
14269
+ */
14270
+ private _stopLayoutTransition(): void;
14271
+
14272
+
12367
14273
  /**
12368
14274
  * Invoked internally by CoreUI to perform a batched update of layout properties.
12369
14275
  * Using this method requires the layout object used by this collection view to support copying.
@@ -12436,6 +14342,20 @@ export class BMCollectionView<T = any> extends BMView {
12436
14342
  */
12437
14343
  readonly dataUpdated?: Promise<void> | null | undefined;
12438
14344
 
14345
+ /**
14346
+ * Finds and returns the drop preview associated with the specified layout attributes, if any exists.
14347
+ * @param attributes Tha attributes for which to find the drop preview.
14348
+ * @param previewMap
14349
+ * An optional mapping between index paths and drop items
14350
+ * used to find the drop preview for the item representation
14351
+ * that the data set actually inserted. The default item
14352
+ * representation will be used if this is not provided.
14353
+ * @return The drop preview if it was found, `undefined` otherwise.
14354
+ *
14355
+ */
14356
+ private _dropPreviewForLayoutAttributes(attributes: BMCollectionViewLayoutAttributes, {previewMap}?: {previewMap?: Map<BMIndexPath<T>, BMDropPreview> | null | undefined}): BMDropPreview | null | undefined;
14357
+
14358
+
12439
14359
  /**
12440
14360
  * Should be invoked when the entire data set is updated in bulk.
12441
14361
  * This method should be invoked when the data set object has access to the new data;
@@ -12636,6 +14556,14 @@ export class BMCollectionView<T = any> extends BMView {
12636
14556
  }
12637
14557
 
12638
14558
 
14559
+ /**
14560
+ * Cleans up the changes performed by the current transition.
14561
+ *
14562
+ */
14563
+ export function cleanupTransition(): void;
14564
+
14565
+
14566
+
12639
14567
  /**
12640
14568
  * @deprecated - Use the static `collectionViewForNode` factory method.
12641
14569
  *
@@ -12817,11 +14745,12 @@ export interface BMCollectionViewDataSet<T = any> {
12817
14745
  * For collection views that support moving items, this method must be implemented by the data sets these collection views
12818
14746
  * use. In this case, data sets that don't support moving items may simply return `NO` from this method.
12819
14747
  * @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.
14748
+ * @param toIndexPath The index path to which the item should move.
14749
+ * @param session The drag session through which this change was performed.
14750
+ * @return `YES` if the data set has performed the requested change, `NO` otherwise.
12822
14751
  *
12823
14752
  */
12824
- moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T>}): boolean;
14753
+ moveItemFromIndexPath?(indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
12825
14754
 
12826
14755
 
12827
14756
  /**
@@ -12835,14 +14764,15 @@ export interface BMCollectionViewDataSet<T = any> {
12835
14764
  * `moveItemFromIndexPath(_, {toIndexPath})` passing in each of the items that need to be moved.
12836
14765
  * @param indexPaths An array of index paths identifying which items have to be moved.
12837
14766
  * @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
14767
+ * before any items may have moved. It is the data set's responsibility to adjust this index path as the items shift
12839
14768
  * within its data structure.
12840
- * @return An array of index paths specifying the positions of the items after they have been moved.
14769
+ * @param session The drag session through which this change was performed.
14770
+ * @return An array of index paths specifying the positions of the items after they have been moved.
12841
14771
  * The index paths in this array are not required to match either of the lists supplied by
12842
- * collection view.
14772
+ * collection view.
12843
14773
  *
12844
14774
  */
12845
- moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): BMIndexPath<T>[];
14775
+ moveItemsFromIndexPaths?(indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
12846
14776
 
12847
14777
 
12848
14778
  /**
@@ -12852,10 +14782,12 @@ export interface BMCollectionViewDataSet<T = any> {
12852
14782
  * Optionally, data sets may reject the change and not perform any action or only partially accept the update
12853
14783
  * and remove just some of the items, by changing their internal data structures appropriately.
12854
14784
  * 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.
14785
+ * @param indexPaths An array of index paths identifying which items have to be removed.
14786
+ * @param session The drag session through which this change was performed, if it occurred
14787
+ * through a drag and drop gesture.
12856
14788
  *
12857
14789
  */
12858
- removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[]): void;
14790
+ removeItemsAtIndexPaths?(indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
12859
14791
 
12860
14792
 
12861
14793
  /**
@@ -12864,14 +14796,49 @@ export interface BMCollectionViewDataSet<T = any> {
12864
14796
  * the items, then trigger a data update to run on the collection view.
12865
14797
  * Optionally, data sets may reject the change and not perform any action or only partially accept the update
12866
14798
  * 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.
14799
+ * @param items An array of objects to add to the collection view, using the default representation
14800
+ * of the items in the drop session. Additional representations, if needed, can be obtained
14801
+ * from the drop session.
14802
+ * @param toIndexPath The starting index path to which the items should be inserted.
14803
+ * @param session The drop session through which this change was performed, if it occurred
14804
+ * through a drag and drop gesture.
14805
+ * @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
14806
+ *
14807
+ */
14808
+ insertItems?(items: any[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session?: BMDropSession | null | undefined}): Promise<void> | void;
14809
+
14810
+
14811
+ /**
14812
+ * Invoked by collection after a successful transfer via a drop session to determine the index path associated
14813
+ * with the specified drag item during the associated data update. Data set objects which implement this method
14814
+ * should return the index path associated with the appropriate representation of the specified drag item that
14815
+ * was accepted through the drop session.
14816
+ * @param item The drag item for which to obtain the associated index path.
14817
+ * @return The associated index path if it could be determined, `undefined` otherwise.
14818
+ *
14819
+ */
14820
+ indexPathForDragItem?(item: BMDragItem): BMIndexPath<T> | null | undefined;
14821
+
14822
+
14823
+ /**
14824
+ * This method should be implemented by data set objects that support transferring items via drag and drop
14825
+ * to create the drag items that will be part of a drag session.
14826
+ *
14827
+ * Data set objects implementing this method should return a drag item for the specified index path with
14828
+ * the appropriate representations that potential drop targets can verify to determine if they can accept
14829
+ * the items being transferred through the session.
14830
+ * @param indexPath The index path for which to create a drag item.
14831
+ * @param session The drag session that will be used to transfer the items.
14832
+ * @return The drag item.
12869
14833
  *
12870
14834
  */
12871
- insertItems?(items: any[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): void;
14835
+ dragItemForIndexPath?(indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
12872
14836
 
12873
14837
 
12874
14838
  /**
14839
+ * @deprecated Not used if `dragItemForIndexPath` is implemented.
14840
+ *
14841
+ * ------
12875
14842
  * This method may be implemented by data set objects that support transferring items to another collection view.
12876
14843
  * Data set objects implementing this method are expected to create a copy of the specified item and return it.
12877
14844
  * 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 +14973,11 @@ export interface BMCollectionViewDataSource<T = any> {
13006
14973
  * @param collectionView The collection view that is moving the item.
13007
14974
  * @param indexPath The item's current index path.
13008
14975
  * @param toIndexPath The index path to which the item should move.
14976
+ * @param session The drag session through which this change was performed.
13009
14977
  * @return `YES` if the data set has performed the requested change, `NO` otherwise.
13010
14978
  *
13011
14979
  */
13012
- collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath}: {toIndexPath: BMIndexPath<T>}): boolean;
14980
+ collectionViewMoveItemFromIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): boolean;
13013
14981
 
13014
14982
 
13015
14983
  /**
@@ -13026,12 +14994,13 @@ export interface BMCollectionViewDataSource<T = any> {
13026
14994
  * @param toIndexPath The starting index path to which the items should move. This represents the index path of the current layout
13027
14995
  * before any items may have moved. It is the data source's responsibility to adjust this index path as the items shift
13028
14996
  * within its data structure.
14997
+ * @param session The drag session through which this change was performed.
13029
14998
  * @return An array of index paths specifying the positions of the items after they have been moved.
13030
14999
  * The index paths in this array are not required to match either of the lists supplied by
13031
15000
  * collection view.
13032
15001
  *
13033
15002
  */
13034
- collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): BMIndexPath<T>[];
15003
+ collectionViewMoveItemsFromIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {toIndexPath, session}: {toIndexPath: BMIndexPath<T>, session: BMDragSession}): BMIndexPath<T>[];
13035
15004
 
13036
15005
 
13037
15006
  /**
@@ -13043,9 +15012,11 @@ export interface BMCollectionViewDataSource<T = any> {
13043
15012
  * The order of the items in the array is guaranteed to be such that the target index paths are in ascending order.
13044
15013
  * @param collectionView The collection view that is removing the items.
13045
15014
  * @param indexPaths An array of index paths identifying which items have to be removed.
15015
+ * @param session If this change occurred via a drag session, the session through which
15016
+ * the items were removed.
13046
15017
  *
13047
15018
  */
13048
- collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[]): void;
15019
+ collectionViewRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath<T>[], {session}?: {session?: BMDragSession | null | undefined}): void;
13049
15020
 
13050
15021
 
13051
15022
  /**
@@ -13055,15 +15026,56 @@ export interface BMCollectionViewDataSource<T = any> {
13055
15026
  * this method returns for the appropriate animation to play on the items being transferred.
13056
15027
  * Optionally, data sources may reject the change and not perform any action or only partially accept the update
13057
15028
  * 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.
15029
+ * @param collectionView The collection view into which items are being inserted.
15030
+ * @param items An array of objects to add to the collection view. If this change
15031
+ * occurred trough a drop session, this represents the default representation
15032
+ * of the drag items.
15033
+ * @param toIndexPath The starting index path to which the items should be inserted.
15034
+ * @param session The drop session through which this change was performed, if this
15035
+ * occurred via a drag and drop gesture.
15036
+ * @param indexPaths
15037
+ * If the data set inserted a different representation of the items than the default,
15038
+ * this map must be filled out with the new index paths associated with each item in
15039
+ * the drop session that was actually inserted.
15040
+ * @return An optional promise that resolves when data has updated, if it cannot be updated synchronously.
13061
15041
  *
13062
15042
  */
13063
- collectionViewInsertItems?(collectionView: BMCollectionView, items: any[], {toIndexPath}: {toIndexPath: BMIndexPath<T>}): void;
15043
+ 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;
15044
+
15045
+
15046
+ /**
15047
+ * This method should be implemented by data source objects that support transferring items via drag and drop
15048
+ * to create the drag items that will be part of a drag session.
15049
+ *
15050
+ * Data source objects implementing this method should return a drag item for the specified index path with
15051
+ * the appropriate representations that potential drop targets can verify to determine if they can accept
15052
+ * the items being transferred through the session.
15053
+ * @param collectionView The collection view that started the dragging session.
15054
+ * @param indexPath The index path for which to create a drag item.
15055
+ * @param session The drag session that will be used to transfer the items.
15056
+ * @return The drag item.
15057
+ *
15058
+ */
15059
+ collectionViewDragItemForIndexPath?(collectionView: BMCollectionView, indexPath: BMIndexPath<T>, {session}: {session: BMDragSession}): BMDragItem;
15060
+
15061
+
15062
+ /**
15063
+ * Invoked by collection after a successful transfer via a drop session to determine the index path associated
15064
+ * with the specified drag item during the associated data update. Data source objects which implement this method
15065
+ * should return the index path associated with the appropriate representation of the specified drag item that
15066
+ * was accepted through the drop session.
15067
+ * @param collectionView The collection view that accepted items from a drop session.
15068
+ * @param item The drag item for which to obtain the associated index path.
15069
+ * @return The associated index path if it could be determined, `undefined` otherwise.
15070
+ *
15071
+ */
15072
+ collectionViewIndexPathForDragItem?(collectionView: BMCollectionView, item: BMDragItem): BMIndexPath<T> | null | undefined;
13064
15073
 
13065
15074
 
13066
15075
  /**
15076
+ * @deprecated Not used if `dragItemForIndexPath` is implemented.
15077
+ *
15078
+ * ------
13067
15079
  * This method may be implemented by data source objects that support transferring items to another collection view.
13068
15080
  * Data source objects implementing this method are expected to create a copy of the specified item and return it.
13069
15081
  * 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 +15177,7 @@ export interface BMCollectionViewDelegate {
13165
15177
 
13166
15178
  /**
13167
15179
  * 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.
15180
+ * The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
13169
15181
  * You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
13170
15182
  * If this method is not implemented by the delegate object, the collection view will assume that the cell may be selected.
13171
15183
  * @param collectionView The calling collection view.
@@ -13189,7 +15201,7 @@ export interface BMCollectionViewDelegate {
13189
15201
 
13190
15202
  /**
13191
15203
  * 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.
15204
+ * The actual cell may not be visible on screen and as such it may not have a BMCollectionViewCell object associated with it.
13193
15205
  * You may invoke the cellAtIndexPath(indexPath) method to obtain a reference to the cell if it is visible.
13194
15206
  * If this method is not implemented by the delegate object, the collection view will assume that the cell may be deselected.
13195
15207
  * @param collectionView The calling collection view.
@@ -13324,8 +15336,8 @@ export interface BMCollectionViewDelegate {
13324
15336
  * Invoked by the collection view whenever any cell is clicked or tapped. Delegate objects can implement this method to react
13325
15337
  * to cell click or tap events.
13326
15338
  * 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.
15339
+ * and prevent the default actions from occurring.
15340
+ * By default, when returning NO or nothing from this method, the collection view will toggle the selection state of the clicked cell.
13329
15341
  * @param collectionView The calling collection view.
13330
15342
  * @param cell The cell that triggered this event.
13331
15343
  * @param withEvent The event that triggered this action.
@@ -13339,7 +15351,7 @@ export interface BMCollectionViewDelegate {
13339
15351
  * Invoked by the collection view whenever any cell is double clicked or double tapped. Delegate objects can implement this method to react
13340
15352
  * to cell click or tap events.
13341
15353
  * 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.
15354
+ * and prevent the default actions from occurring.
13343
15355
  * @param collectionView The calling collection view.
13344
15356
  * @param cell The cell that triggered this event.
13345
15357
  * @param withEvent The event that triggered this action.
@@ -13353,7 +15365,7 @@ export interface BMCollectionViewDelegate {
13353
15365
  * Invoked by the collection view whenever any cell is long clicked or long tapped. Delegate objects can implement this method to react
13354
15366
  * to cell click or tap events.
13355
15367
  * 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.
15368
+ * and prevent the default actions from occurring.
13357
15369
  * @param collectionView The calling collection view.
13358
15370
  * @param cell The cell that triggered this event.
13359
15371
  * @param withEvent The event that triggered this action.
@@ -13367,7 +15379,7 @@ export interface BMCollectionViewDelegate {
13367
15379
  * Invoked by the collection view whenever any cell is right clicked. Delegate objects can implement this method to react
13368
15380
  * to cell click events.
13369
15381
  * 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.
15382
+ * and prevent the default actions from occurring.
13371
15383
  * By default, when returning NO or nothing from this method, the browser's default context menu will appear.
13372
15384
  * @param collectionView The calling collection view.
13373
15385
  * @param cell The cell that triggered this event.
@@ -13419,7 +15431,7 @@ export interface BMCollectionViewDelegate {
13419
15431
 
13420
15432
  /**
13421
15433
  * 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.
15434
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13423
15435
  * @param collectionView The calling collection view.
13424
15436
  * @param cell The cell that is about to be dragged.
13425
15437
  * @param atIndexPath The cell's current index path.
@@ -13435,81 +15447,217 @@ export interface BMCollectionViewDelegate {
13435
15447
  * If this method is not implemented, collection view will assume that items cannot be transferred.
13436
15448
  * @param collectionView The calling collection view.
13437
15449
  * @param indexPaths The index paths that may be transferred by the drag gesture.
15450
+ * @param session The drag session through which the items may be transferred.
13438
15451
  * @return `YES` if the index paths can be removed, `NO` otherwise.
13439
15452
  *
13440
15453
  */
13441
- collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
15454
+ collectionViewCanTransferItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
13442
15455
 
13443
15456
 
13444
15457
  /**
13445
- * Invoked by collection view to determine how to handle the transfer of the given items to a different
13446
- * collection view.
15458
+ * Invoked by collection view to determine whether the items at the specified index paths may be reordered as
15459
+ * a result of a drag and drop gesture.
15460
+ *
15461
+ * Delegate objects may implement this method and return `YES` to allow items to be reordered during the drag
15462
+ * and drop gesture or `NO` to prevent this behaviour. **The default return value is assumed to be `YES` when
15463
+ * this method is not implemented.**
15464
+ * @param collectionView The collection view that started the drag session.
15465
+ * @param indexPaths The index paths of the items that are part of the drag session.
15466
+ * @param session The drag session through which the items are reordered.
15467
+ * @return `YES` if the items can be moved, `NO` otherwise.
15468
+ *
15469
+ */
15470
+ collectionViewCanReorderItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): boolean;
15471
+
15472
+
15473
+ /**
15474
+ * Invoked by collection view to determine how to handle the transfer of the items at the specified index paths to
15475
+ * a different view.
13447
15476
  * @param collectionView The calling collection view.
13448
15477
  * @param indexPaths The index paths that will be transferred by the drag gesture.
15478
+ * @param session The drag session through which the items are transferred.
13449
15479
  * @return The desired accept policy.
13450
15480
  *
13451
15481
  */
13452
- collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): BMCollectionViewTransferPolicy;
15482
+ collectionViewTransferPolicyForItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDragSession}): BMCollectionViewTransferPolicy;
13453
15483
 
13454
15484
 
13455
15485
  /**
13456
15486
  * Invoked by collection view to determine if the given items may be imported from another collection view.
15487
+ *
13457
15488
  * Delegate object can implement this method to let collection view know whether or not it can import the items.
13458
15489
  * 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.
15490
+ * @param collectionView The calling collection view.
15491
+ * @param items The items that might be imported, using the default representation
15492
+ * supplied by the item provider. The actual item providers can be obtained
15493
+ * from the drop session.
15494
+ * @param session The associated drop session.
15495
+ * @return `YES` if the items can be imported, `NO` if they can not
15496
+ * or an accept region to further customize how the items can be
15497
+ * imported from the source view.
15498
+ *
15499
+ */
15500
+ collectionViewCanAcceptItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): boolean | BMCollectionViewAcceptRegion;
15501
+
15502
+
15503
+ /**
15504
+ * Invoked by collection view to obtain a preview element for the specified drop session item.
15505
+ *
15506
+ * Delegate objects may optionally implement and return an element to customize the appearance of
15507
+ * the specified element when the drop session enters the collection view's frame.
15508
+ * @param collectionView The collection view.
15509
+ * @param session The drop session.
15510
+ * @param item The item for which to return a preview.
15511
+ * @return A preview for the item, or `undefined` to retain the
15512
+ * preview supplied by the view that started the drag session.
15513
+ *
15514
+ */
15515
+ collectionViewPreviewForDropSession?(collectionView: BMCollectionView, session: BMDropSession, {item}: {item: BMDragItem}): DOMNode | null | undefined;
15516
+
15517
+
15518
+ /**
15519
+ * Invoked by collection view at the start of a drag and drop gesture when the accept region was set to `.Anywhere` or
15520
+ * `YES` was returned from `collectionViewCanAcceptItems`.
15521
+ *
15522
+ * Delegate objects implementing this method should provide the drop action that will be used for this drop session.
15523
+ * A default action of kind `.Accept` is used when this method is not implemented.
15524
+ * @param collectionView The collection view for which the drop session started.
15525
+ * @param session The drop session that started.
15526
+ * @return The drop action to use.
15527
+ *
15528
+ */
15529
+ collectionViewDropActionForDropSession?(collectionView: BMCollectionView, session: BMDropSession): BMDropAction;
15530
+
15531
+
15532
+ /**
15533
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` in
15534
+ * `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position.
15535
+ *
15536
+ * Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
15537
+ * ending the session at its current position, or `undefined` to retain the previous action.
15538
+ * @param collectionView The collection view the drop session is tracking.
15539
+ * @param session The drop session.
15540
+ * @param position The position of the drop session relative to the collection view's bounds.
15541
+ * @return The new drop action, or `undefined` to retain the current action.
15542
+ *
15543
+ */
15544
+ collectionViewDropSessionDidUpdate?(collectionView: BMCollectionView, session: BMDropSession, {position}: {position: BMPoint}): BMDropSessionAction | null | undefined;
15545
+
15546
+
15547
+ /**
15548
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
15549
+ * `.Cell` in `collectionViewCanAcceptItems`, to determine the appropriate drop action for the drop session's new position
15550
+ * when the gesture enters the frame of the cell at the specified index path.
15551
+ *
15552
+ * Delegate objects implementing this method may return a `BMDropSessionAction` object describing the behaviour of
15553
+ * ending the session at its current position, or `undefined` to retain the previous action.
15554
+ * @param collectionView The collection view the drop session is tracking.
15555
+ * @param session The drop session.
15556
+ * @param indexPath The index path of the cell the drag and drop gesture has entered.
15557
+ * @return The new drop action, or `undefined` to retain the current action.
15558
+ *
15559
+ */
15560
+ collectionViewDropSessionDidEnterIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): BMDropSessionAction | null | undefined;
15561
+
15562
+
15563
+ /**
15564
+ * Invoked by collection view during a drag and drop gesture if the accept region has been specified as `.Position` or
15565
+ * `.Cell` in `collectionViewCanAcceptItems` when the gesture exits the frame of the cell at the specified index path.
15566
+ *
15567
+ * If the accept region was set to `.Cell` in `collectionViewCanAcceptItems`, collection view will automatically update
15568
+ * the drop session to ignore the drop. If the accept region was set to `.Position`, `collectionViewDropSessionDidUpdate`
15569
+ * will be subsequently invoked to obtain a new drop action.
15570
+ *
15571
+ * Delegate objects can optionally implement this method to perform any necessary cleanup if the drop session is no
15572
+ * longer acceptable outside of any cell.
15573
+ * @param collectionView The collection view the drop session is tracking.
15574
+ * @param session The drop session.
15575
+ * @param indexPath The index path of the cell the drag and drop gesture has entered.
15576
+ *
15577
+ */
15578
+ collectionViewDropSessionDidExitIndexPath?(collectionView: BMCollectionView, session: BMDropSession, {indexPath}: {indexPath: BMIndexPath}): void;
15579
+
15580
+
15581
+ /**
15582
+ * Invoked by collection when a drop session is about to finish, regardless of its outcome.
15583
+ *
15584
+ * Delegate objects can optionally implement this method to perform any cleanup.
15585
+ * @param collectionView The collection view for which the drop session is ending.
15586
+ * @param session The drop session that will end.
13462
15587
  *
13463
15588
  */
13464
- collectionViewCanAcceptItems?(collectionView: BMCollectionView, items: any[]): boolean;
15589
+ collectionViewDropSessionWillFinish?(collectionView: BMCollectionView, session: BMDropSession): void;
13465
15590
 
13466
15591
 
13467
15592
  /**
13468
15593
  * Invoked by collection view to determine how to handle the import of the given items from a different
13469
15594
  * collection view.
13470
15595
  * @param collectionView The calling collection view.
13471
- * @param items The items that might be imported.
15596
+ * @param items The items that might be imported, using the default representation
15597
+ * supplied by the item provider. The actual item providers can be obtained
15598
+ * from the drop session.
15599
+ * @param session The associated drop session.
13472
15600
  * @return The desired accept policy.
13473
15601
  *
13474
15602
  */
13475
- collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[]): BMCollectionViewAcceptPolicy;
15603
+ collectionViewAcceptPolicyForItems?(collectionView: BMCollectionView, items: any[], {session}: {session: BMDropSession}): BMCollectionViewAcceptPolicy;
13476
15604
 
13477
15605
 
13478
15606
  /**
13479
15607
  * Invoked by collection view to determine if the items at the specified index paths may be removed by an interactive
13480
15608
  * drag gesture.
15609
+ *
13481
15610
  * Delegate object can implement this method to let collection view know whether or not it can remove the items.
13482
15611
  * If this method is not implemented, collection view will assume that items cannot be removed.
13483
15612
  * @param collectionView The calling collection view.
13484
15613
  * @param indexPaths The index paths that may be removed by the drag gesture.
15614
+ * @param session The associated drag session.
13485
15615
  * @return `YES` if the index paths can be removed, `NO` otherwise.
13486
15616
  *
13487
15617
  */
13488
- collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[]): boolean;
15618
+ collectionViewCanRemoveItemsAtIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): boolean;
15619
+
15620
+
15621
+ /**
15622
+ * Invoked by collection view to determine what message to display for a drag session that will delete
15623
+ * the items at the specified index paths.
15624
+ *
15625
+ * Delegate object can implement this method to provide a customized message that will be displayed to
15626
+ * the user while the drag session is in progress. The default message that will be displayed when this
15627
+ * method is not implemented is `"Remove"`.
15628
+ * @param collectionView The calling collection view.
15629
+ * @param indexPaths The index paths that may be removed by the drag gesture.
15630
+ * @param session The associated drag session.
15631
+ * @return The message to display.
15632
+ *
15633
+ */
15634
+ collectionDeleteMessageForIndexPaths?(collectionView: BMCollectionView, indexPaths: BMIndexPath[], {session}: {session: BMDropSession}): string;
13489
15635
 
13490
15636
 
13491
15637
  /**
13492
15638
  * Invoked by the collection view immediately before a drag gesture is about to end for a cell. This is invoked before any
13493
15639
  * associated animations begin.
13494
- * Delegate objects can implement this method to perform any changes that might be needed to accomodate this gesture.
15640
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13495
15641
  * @param collectionView The calling collection view.
13496
15642
  * @param cell The cell that is about to be dragged.
13497
15643
  * @param atIndexPath The cell's new index path.
15644
+ * @param session The drag session managing the interactive movement.
13498
15645
  *
13499
15646
  */
13500
- collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
15647
+ collectionViewWillFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
13501
15648
 
13502
15649
 
13503
15650
  /**
13504
15651
  * Invoked by the collection view immediately after a drag gesture has ended for a cell. This is invoked after any
13505
15652
  * associated animations end.
13506
- * Delegate objects can implement this method to perform any changes that might be needed to accomodate this gesture.
15653
+ * Delegate objects can implement this method to perform any changes that might be needed to accommodate this gesture.
13507
15654
  * @param collectionView The calling collection view.
13508
15655
  * @param cell The cell that is about to be dragged.
13509
15656
  * @param atIndexPath The cell's new index path.
15657
+ * @param session The drag session managing the interactive movement.
13510
15658
  *
13511
15659
  */
13512
- collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath}: {atIndexPath: BMIndexPath}): void;
15660
+ collectionViewDidFinishInteractiveMovementForCell?(collectionView: BMCollectionView, cell: BMCollectionViewCell, {atIndexPath, session}: {atIndexPath: BMIndexPath, session: BMDragSession}): void;
13513
15661
 
13514
15662
  }
13515
15663
 
@@ -13918,6 +16066,18 @@ export class BMWindow extends BMView {
13918
16066
  */
13919
16067
  readonly toolbar: DOMNode;
13920
16068
 
16069
+ /**
16070
+ * Defined for non-modal windows. The drag handle used to resize the window.
16071
+ *
16072
+ */
16073
+ private _dragHandle: DOMNode;
16074
+
16075
+ /**
16076
+ * Controls whether the window resize handle appears.
16077
+ *
16078
+ */
16079
+ resizable: boolean;
16080
+
13921
16081
  /**
13922
16082
  * The window overlay.
13923
16083
  *
@@ -14327,6 +16487,12 @@ export class BMToolWindow extends BMWindow {
14327
16487
  */
14328
16488
  opensAutomatically: boolean;
14329
16489
 
16490
+ /**
16491
+ * The window to which this tool window is associated.
16492
+ *
16493
+ */
16494
+ private _parentWindow: BMWindow;
16495
+
14330
16496
  /**
14331
16497
  * Initializes this tool window with the given frame and associates it with the given window.
14332
16498
  * @param frame The window's frame.