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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/build/@types/index.d.ts +2268 -71
  3. package/build/BMCollectionView/BMCollectionView.js +1070 -235
  4. package/build/BMCollectionView/BMCollectionViewFlowLayout.js +11 -4
  5. package/build/BMCollectionView/BMCollectionViewLayout.js +19 -0
  6. package/build/BMCoreUI.css +213 -44
  7. package/build/BMView/BMDragSession.js +1243 -0
  8. package/build/BMView/BMDragSessionActions.js +121 -0
  9. package/build/BMView/BMDragSessionPreview.js +1650 -0
  10. package/build/BMView/BMLayoutConstraint_v2.5.js +14 -59
  11. package/build/BMView/BMMenu.js +50 -20
  12. package/build/BMView/BMView_v2.5.js +34 -3
  13. package/build/BMWindow/BMPopover/BMPopover.js +35 -20
  14. package/build/BMWindow/BMToolWindow.js +29 -1
  15. package/build/BMWindow/BMWindow.js +128 -65
  16. package/build/images/AlignBottom.png +0 -0
  17. package/build/images/AlignCenterX.png +0 -0
  18. package/build/images/AlignCenterY.png +0 -0
  19. package/build/images/AlignLeading.png +0 -0
  20. package/build/images/AlignTop.png +0 -0
  21. package/build/images/AlignTrailing.png +0 -0
  22. package/build/images/AllConstraints.png +0 -0
  23. package/build/images/BottomConstraint.png +0 -0
  24. package/build/images/CenterXConstraint.png +0 -0
  25. package/build/images/CenterYConstraint.png +0 -0
  26. package/build/images/CoreUI2.png +0 -0
  27. package/build/images/CoreUI2@2x.png +0 -0
  28. package/build/images/Desktop.png +0 -0
  29. package/build/images/DesktopMini.png +0 -0
  30. package/build/images/EqualHeight.png +0 -0
  31. package/build/images/EqualHorizontalSpacing.png +0 -0
  32. package/build/images/EqualHorizontalSpacingInSuperview.png +0 -0
  33. package/build/images/EqualVerticalSpacing.png +0 -0
  34. package/build/images/EqualVerticalSpacingInSuperview.png +0 -0
  35. package/build/images/EqualWidth.png +0 -0
  36. package/build/images/HeightConstraint.png +0 -0
  37. package/build/images/InactiveConstraints.png +0 -0
  38. package/build/images/Layout.png +0 -0
  39. package/build/images/LayoutVariables.png +0 -0
  40. package/build/images/LeftConstraint.png +0 -0
  41. package/build/images/OwnConstraints.png +0 -0
  42. package/build/images/Phone.png +0 -0
  43. package/build/images/PhoneLandscape.png +0 -0
  44. package/build/images/PhoneLandscapeMini.png +0 -0
  45. package/build/images/PhoneMini.png +0 -0
  46. package/build/images/PhonePortrait.png +0 -0
  47. package/build/images/PhonePortraitMini.png +0 -0
  48. package/build/images/Properties.png +0 -0
  49. package/build/images/RightConstraint.png +0 -0
  50. package/build/images/SubviewConstraints.png +0 -0
  51. package/build/images/Tablet.png +0 -0
  52. package/build/images/TabletLandscape.png +0 -0
  53. package/build/images/TabletLandscapeMini.png +0 -0
  54. package/build/images/TabletMini.png +0 -0
  55. package/build/images/TabletPortrait.png +0 -0
  56. package/build/images/TabletPortraitMini.png +0 -0
  57. package/build/images/TopConstraint.png +0 -0
  58. package/build/images/WidthConstraint.png +0 -0
  59. package/build/index.js +4 -0
  60. package/lib/@types/BMCoreUI.min.d.ts +2268 -71
  61. package/lib/BMCoreUI.min.js +1 -1
  62. package/package.json +3 -3
@@ -1670,6 +1670,11 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
1670
1670
  return this._prepareLayoutWithScrollbarOffset(NO);
1671
1671
  },
1672
1672
 
1673
+ /**
1674
+ * Set to `YES` while the current layout is using scrollbar offsets, `NO` otherwise.
1675
+ */
1676
+ _usingScrollbarOffset: NO, // <Boolean>
1677
+
1673
1678
  /**
1674
1679
  * Prepares the layout, optionally taking the scrollbar size into account.
1675
1680
  * @param useOffset <Boolean> When set to `YES` the layout will take the scrollbar size into account.
@@ -1680,6 +1685,8 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
1680
1685
  return;
1681
1686
  }
1682
1687
 
1688
+ this._usingScrollbarOffset = useOffset;
1689
+
1683
1690
  // When the scrollbar offset is used, invalidate any measurement that exceeds the available space.
1684
1691
  if (this._expectedCellSize && this._collectionView.scrollBarSize) {
1685
1692
  switch (this.orientation) {
@@ -1794,11 +1801,11 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
1794
1801
  // is measured up to at least the current collection view bounds
1795
1802
  if (this._expectedCellSize && this._copy) {
1796
1803
  target = target || {};
1797
- if (target.targetRect) {
1798
- target.targetRect = target.targetRect.rectByUnionWithRect(this.collectionView.bounds)
1804
+ if (target.rect) {
1805
+ target.rect = target.rect.rectByUnionWithRect(this.collectionView.bounds)
1799
1806
  }
1800
1807
  else {
1801
- target.targetRect = this.collectionView.bounds;
1808
+ target.rect = this.collectionView.bounds;
1802
1809
  }
1803
1810
  }
1804
1811
 
@@ -3087,7 +3094,7 @@ BMCollectionViewFlowLayout.prototype = BMExtend(Object.create(BMCollectionViewLa
3087
3094
  return [BMLayoutConstraint.constraintWithView(cell, {
3088
3095
  attribute: BMLayoutAttribute.Width,
3089
3096
  relatedBy: BMLayoutConstraintRelation.LessThanOrEquals,
3090
- constant: this.collectionView.frame.size.width - this.sectionInsets.left - this.sectionInsets.right
3097
+ constant: this.collectionView.frame.size.width - this.sectionInsets.left - this.sectionInsets.right - (this._usingScrollbarOffset ? this.collectionView.scrollBarSize : 0)
3091
3098
  })]
3092
3099
  },
3093
3100
 
@@ -910,6 +910,19 @@ export var _BMCollectionViewTransitionLayout = function (attributes, initialSize
910
910
  };
911
911
 
912
912
  _BMCollectionViewTransitionLayout.prototype = BMExtend({}, BMCollectionViewLayout.prototype, {
913
+
914
+ /**
915
+ * When set to `YES` this transition layout will no longer perform updates.
916
+ */
917
+ _transitionStopped: NO, // <Boolean>
918
+
919
+ /**
920
+ * Stops the current transition in its tracks, instantly setting the final attributes on all cells.
921
+ */
922
+ _stopTransition() {
923
+ this._applyFinalAttributes();
924
+ this._transitionStopped = YES;
925
+ },
913
926
 
914
927
  /**
915
928
  * Controls how close to completion the transition is.
@@ -917,6 +930,12 @@ _BMCollectionViewTransitionLayout.prototype = BMExtend({}, BMCollectionViewLayou
917
930
  _fraction: 0, // <Number>
918
931
  get fraction() { return this._fraction; },
919
932
  set fraction(fraction) {
933
+ // If this transition was stopped, don't perform any other changes
934
+ if (this._transitionStopped) {
935
+ this._fraction = fraction;
936
+ return;
937
+ }
938
+
920
939
  // If this is no longer attached to a collection view, don't perform any changes
921
940
  if (!this.collectionView) return;
922
941
 
@@ -1,14 +1,25 @@
1
1
  /* MARK: Collection view */
2
2
 
3
- .BMCollectionViewCellDragging {
3
+ .BMCollectionViewCellDragging:not(.BMAnimationNode) {
4
4
  opacity: .5 !important;
5
5
  }
6
6
 
7
+ .BMCollectionViewCellInserting {
8
+ visibility: hidden !important;
9
+ opacity: 0 !important;
10
+ }
11
+
12
+ .BMAnimationNode {
13
+ position: fixed !important;
14
+ z-index: 999998 !important;
15
+ pointer-events: none;
16
+ }
17
+
7
18
  .BMDragShadow .BMRipple {
8
19
  visibility: hidden !important;
9
20
  }
10
21
 
11
- .BMDragShadow {
22
+ .BMDragShadow, .BMAnimationNode {
12
23
  backface-visibility: hidden;
13
24
  -webkit-backface-visibility: hidden;
14
25
  }
@@ -54,6 +65,126 @@
54
65
  font-weight: bolder;
55
66
  }
56
67
 
68
+ /* MARK: Drag Session */
69
+
70
+ .BMDragSessionIndicatorContainer {
71
+ position: fixed;
72
+ pointer-events: none;
73
+
74
+ top: 0;
75
+ left: 0;
76
+ width: 100vw;
77
+ height: 100vh;
78
+
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: center;
82
+
83
+ z-index: 999999 !important;
84
+ }
85
+
86
+ .BMDragSessionIndicator {
87
+ background-color: rgba(0, 128, 255, 1);
88
+
89
+ color: white;
90
+ font-family: -apple-system, BlinkMacSystemFont, Roboto, 'Segoe UI', sans-serif !important;
91
+ font-size: 18px !important;
92
+ font-weight: bold !important;
93
+
94
+ padding-left: 16px;
95
+ padding-right: 16px;
96
+
97
+ height: 24px;
98
+ border-radius: 12px;
99
+
100
+ position: relative;
101
+ display: flex;
102
+ align-items: center;
103
+ justify-content: center;
104
+
105
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, .33);
106
+
107
+ pointer-events: none;
108
+ transition: background-color .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
109
+ }
110
+
111
+ .BMDragSessionIndicatorBlue {
112
+ background-color: rgba(0, 128, 255, 1);
113
+ }
114
+
115
+ .BMDragSessionIndicatorRed {
116
+ background-color: rgba(220, 30, 0, 1);
117
+ }
118
+
119
+ .BMDragSessionIndicatorYellow {
120
+ background-color: rgb(255, 183, 0);
121
+ }
122
+
123
+ .BMDragSessionIndicatorGray {
124
+ background-color: rgb(108, 119, 124);
125
+ }
126
+
127
+ .BMDragSessionIndicatorGreen {
128
+ background-color: rgba(0, 200, 60, 1);
129
+ }
130
+
131
+ .BMDragSessionIndicatorIcon {
132
+ width: 16px;
133
+ height: 16px;
134
+
135
+ margin-right: 8px;
136
+
137
+ opacity: 1;
138
+
139
+ transition:
140
+ width .3s cubic-bezier(0.455, 0.03, 0.515, 0.955),
141
+ height .3s cubic-bezier(0.455, 0.03, 0.515, 0.955),
142
+ margin-right .3s cubic-bezier(0.455, 0.03, 0.515, 0.955),
143
+ opacity .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
144
+ }
145
+
146
+ .BMDragSessionIndicatorIcon.BMDragSessionIndicatorIconHidden {
147
+ width: 0;
148
+ height: 0;
149
+ margin-right: 0;
150
+ opacity: 0;
151
+ }
152
+
153
+ .BMDragSessionIndicatorItemCount {
154
+ transition: width .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
155
+ }
156
+
157
+ .BMDragSessionIndicatorMessage {
158
+ white-space: nowrap;
159
+ font-size: 16px !important;
160
+ font-weight: 500;
161
+
162
+ margin-left: 8px;
163
+
164
+ opacity: 1;
165
+
166
+ transition:
167
+ width .3s cubic-bezier(0.455, 0.03, 0.515, 0.955),
168
+ margin-left .3s cubic-bezier(0.455, 0.03, 0.515, 0.955),
169
+ opacity .3s cubic-bezier(0.455, 0.03, 0.515, 0.955);
170
+ }
171
+
172
+ .BMDragSessionIndicatorMessage.BMDragSessionIndicatorMessageHidden {
173
+ width: 0px;
174
+ opacity: 0;
175
+ margin-left: 0;
176
+ }
177
+
178
+ .BMDragSessionIndicatorMessage.BMDragSessionIndicatorMessageMeasurement {
179
+ transition: none;
180
+ visibility: hidden;
181
+
182
+ font-family: -apple-system, BlinkMacSystemFont, Roboto, 'Segoe UI', sans-serif !important;
183
+ font-size: 16px !important;
184
+
185
+ position: absolute;
186
+ }
187
+
57
188
  /* MARK: Layout Guide */
58
189
 
59
190
  .BMLayoutGuideMask {
@@ -1393,21 +1524,8 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1393
1524
  }
1394
1525
 
1395
1526
  .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem {
1396
- height: 44px;
1397
- line-height: 44px;
1398
- border-top: 1px solid rgba(0, 0, 0, .1);
1399
- }
1400
-
1401
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:first-child {
1402
- border-top-width: 0px;
1403
- }
1404
-
1405
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted + .BMMenuItem {
1406
- border-top-color: rgba(0, 0, 0, .2);
1407
- }
1408
-
1409
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted + .BMMenuDivider {
1410
- box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, .1) inset;
1527
+ height: 38px;
1528
+ line-height: 38px;
1411
1529
  }
1412
1530
 
1413
1531
  .BMMenuIcon {
@@ -1465,48 +1583,104 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1465
1583
 
1466
1584
  @keyframes BMMenuItemActiveAnimation {
1467
1585
  from {
1468
- background: transparent;
1469
1586
  color: rgba(0, 0, 0, .8);
1470
1587
  }
1471
1588
 
1472
1589
  49% {
1473
- background: transparent;
1474
1590
  color: rgba(0, 0, 0, .8);
1475
1591
  }
1476
1592
 
1477
1593
  50% {
1478
- background: rgb(0, 128, 255);
1479
1594
  color: white;
1480
1595
  }
1481
1596
 
1482
1597
  to {
1483
- background: rgb(0, 128, 255);
1484
1598
  color: white;
1485
1599
  }
1486
1600
  }
1487
1601
 
1488
- .BMLayoutEditorConstraintPopupOption:hover, .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):active, .BMMenuItem.BMMenuItemHighlighted {
1489
- background: rgb(0, 128, 255);
1602
+ @keyframes BMMenuItemActiveAnimationBackground {
1603
+ from {
1604
+ background: transparent;
1605
+ }
1606
+
1607
+ 49% {
1608
+ background: transparent;
1609
+ }
1610
+
1611
+ 50% {
1612
+ background: rgb(0, 128, 255);
1613
+ }
1614
+
1615
+ to {
1616
+ background: rgb(0, 128, 255);
1617
+ }
1618
+ }
1619
+
1620
+ .BMLayoutEditorConstraintPopupOption::before,
1621
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem::before,
1622
+ .BMMenuItem::before {
1623
+ content: '';
1624
+
1625
+ position: absolute;
1626
+
1627
+ top: 0;
1628
+ bottom: 0;
1629
+
1630
+ left: 4px;
1631
+ right: 4px;
1632
+
1633
+ border-radius: 5px;
1634
+
1635
+ z-index: -1;
1636
+ }
1637
+
1638
+ .BMLayoutEditorConstraintPopupOption:hover,
1639
+ .BMMenuItem.BMMenuItemHighlighted {
1490
1640
  color: white;
1491
1641
  }
1492
1642
 
1643
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted,
1644
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):active {
1645
+ color: rgba(0, 0, 0, .8);
1646
+ }
1647
+
1648
+ .BMLayoutEditorConstraintPopupOption:hover::before,
1649
+ .BMMenuItem.BMMenuItemHighlighted::before {
1650
+ background: rgb(0, 128, 255);
1651
+ }
1652
+
1493
1653
  .BMMenuSourceNodeShadow.BMMenuItem.BMMenuItemHighlighted {
1494
1654
  background: white;
1495
1655
  color: rgba(0, 0, 0, .8);
1496
1656
  }
1497
1657
 
1498
- .BMLayoutEditorConstraintPopupOption:active, .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):hover {
1658
+ .BMLayoutEditorConstraintPopupOption:active,
1659
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):hover {
1499
1660
  background: transparent;
1500
1661
  color: rgba(0, 0, 0, .8);
1501
1662
  }
1502
1663
 
1664
+ .BMLayoutEditorConstraintPopupOption:active::before,
1665
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted::before,
1666
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):hover::before,
1667
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):active::before {
1668
+ background: transparent;
1669
+ }
1670
+
1671
+
1503
1672
  .BMMenuItem.BMMenuItemActive {
1504
1673
  animation: .15s linear BMMenuItemActiveAnimation;
1505
1674
  animation-fill-mode: both;
1506
1675
  }
1507
1676
 
1508
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemActive,
1509
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted {
1677
+ .BMMenuItem.BMMenuItemActive::before {
1678
+ animation: .15s linear BMMenuItemActiveAnimationBackground;
1679
+ animation-fill-mode: both;
1680
+ }
1681
+
1682
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemActive::before,
1683
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted::before {
1510
1684
  animation: none;
1511
1685
  background: transparent;
1512
1686
  color: rgba(0, 0, 0, .8);
@@ -1515,7 +1689,8 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1515
1689
  -webkit-backdrop-filter: brightness(80%);
1516
1690
  }
1517
1691
 
1518
- .BMLayoutEditorConstraintPopupOptionHighlighted, .BMMenuItemHighlighted {
1692
+ .BMLayoutEditorConstraintPopupOptionHighlighted::before,
1693
+ .BMMenuItemHighlighted::before {
1519
1694
  background: rgba(0, 128, 255, .5);
1520
1695
  }
1521
1696
 
@@ -1528,46 +1703,46 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1528
1703
  color: rgba(255, 255, 255, .45);
1529
1704
  }
1530
1705
 
1531
- .BMLayoutEditorConstraintPopupOption:active, .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):hover {
1706
+ .BMLayoutEditorConstraintPopupOption:active,
1707
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):hover,
1708
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem:not(.BMMenuItemDisabled):active {
1532
1709
  background: transparent;
1533
1710
  color: white;
1534
1711
  }
1535
1712
 
1536
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem {
1537
- border-bottom-color: rgba(255, 255, 255, .1);
1538
- }
1539
-
1540
1713
  .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemActive,
1541
1714
  .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted {
1542
1715
  color: rgba(255, 255, 255, 1);
1543
-
1716
+ }
1717
+
1718
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemActive::before,
1719
+ .BMMenuTouch > .BMMenuItemsContainer > .BMMenuItem.BMMenuItemHighlighted::before {
1544
1720
  backdrop-filter: brightness(110%);
1545
1721
  -webkit-backdrop-filter: brightness(110%);
1546
1722
  }
1547
1723
 
1548
1724
  .BMMenuSourceNodeShadow.BMMenuItem.BMMenuItemHighlighted {
1549
- background: rgba(33, 33, 33, 1);
1550
1725
  color: rgba(255, 255, 255, .9);
1551
1726
  }
1552
1727
 
1728
+ .BMMenuSourceNodeShadow.BMMenuItem.BMMenuItemHighlighted::before {
1729
+ background: rgba(33, 33, 33, 1);
1730
+ }
1731
+
1553
1732
  @keyframes BMMenuItemActiveAnimation {
1554
1733
  from {
1555
- background: transparent;
1556
1734
  color: rgba(255, 255, 255, .9);
1557
1735
  }
1558
1736
 
1559
1737
  49% {
1560
- background: transparent;
1561
1738
  color: rgba(255, 255, 255, .9);
1562
1739
  }
1563
1740
 
1564
1741
  50% {
1565
- background: rgb(0, 128, 255);
1566
1742
  color: white;
1567
1743
  }
1568
1744
 
1569
1745
  to {
1570
- background: rgb(0, 128, 255);
1571
1746
  color: white;
1572
1747
  }
1573
1748
  }
@@ -1703,12 +1878,6 @@ input:not(:checked) + .BMWindowSwitchGutter > .BMWindowSwitchKnob, .BMWindowSwit
1703
1878
  flex-shrink: 0;
1704
1879
  }
1705
1880
 
1706
- .BMMenuTouch > .BMMenuItemsContainer > .BMMenuDivider {
1707
- margin: 0;
1708
- height: 3px;
1709
- background: rgba(0, 0, 0, .1);
1710
- }
1711
-
1712
1881
  .BMLayoutEditorDetailsDividerCell {
1713
1882
  background: rgba(0, 0, 0, .05);
1714
1883
  }