bm-core-ui 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +1624 -0
  2. package/LICENSE +21 -0
  3. package/README.md +145 -0
  4. package/build/@types/index.d.ts +14078 -0
  5. package/build/BMCodeEditor/BMCodeEditor.js +707 -0
  6. package/build/BMCollectionView/BMCollectionView.js +5861 -0
  7. package/build/BMCollectionView/BMCollectionViewCell.js +688 -0
  8. package/build/BMCollectionView/BMCollectionViewFlowLayout.js +4467 -0
  9. package/build/BMCollectionView/BMCollectionViewLayout.js +830 -0
  10. package/build/BMCollectionView/BMCollectionViewLayoutAttributes.js +673 -0
  11. package/build/BMCollectionView/BMCollectionViewMasonryLayout.js +491 -0
  12. package/build/BMCollectionView/BMCollectionViewStackLayout.js +634 -0
  13. package/build/BMCollectionView/BMCollectionViewTileLayout.js +1121 -0
  14. package/build/BMCoreUI.css +2833 -0
  15. package/build/BMView/BMAttributedLabelView.js +310 -0
  16. package/build/BMView/BMLayoutConstraint_v2.5.js +1813 -0
  17. package/build/BMView/BMLayoutGuide.js +192 -0
  18. package/build/BMView/BMLayoutSizeClass.js +466 -0
  19. package/build/BMView/BMMenu.js +574 -0
  20. package/build/BMView/BMScrollView.js +247 -0
  21. package/build/BMView/BMTextField.js +512 -0
  22. package/build/BMView/BMTextFieldDelegate.js +71 -0
  23. package/build/BMView/BMView_v2.5.js +3572 -0
  24. package/build/BMView/BMViewport.js +221 -0
  25. package/build/BMViewLayoutEditor/BMLayoutEditor.js +6117 -0
  26. package/build/BMViewLayoutEditor/BMLayoutEditorConstraintSettings.js +417 -0
  27. package/build/BMViewLayoutEditor/BMLayoutEditorDelegate.js +59 -0
  28. package/build/BMViewLayoutEditor/BMLayoutEditorSettingCells.js +1653 -0
  29. package/build/BMViewLayoutEditor/BMLayoutEditorSettings.js +1480 -0
  30. package/build/BMViewLayoutEditor/BMLayoutEditorSettingsComplexCells.js +431 -0
  31. package/build/BMViewLayoutEditor/BMLayoutEditorSettingsDelegate.js +46 -0
  32. package/build/BMViewLayoutEditor/BMLayoutEditorVariablesController.js +460 -0
  33. package/build/BMViewLayoutEditor/BMLayoutEditorViewGroupSettings.js +293 -0
  34. package/build/BMViewLayoutEditor/BMLayoutEditorViewSettings.js +382 -0
  35. package/build/BMViewLayoutEditor/BMLayoutVariableProvider.js +202 -0
  36. package/build/BMWindow/BMConfirmationPopup.js +477 -0
  37. package/build/BMWindow/BMKeyboardShortcut.js +151 -0
  38. package/build/BMWindow/BMPopover/BMPopover.js +492 -0
  39. package/build/BMWindow/BMToolWindow.js +71 -0
  40. package/build/BMWindow/BMWindow.js +2000 -0
  41. package/build/Core/BMAnimationContext.js +1181 -0
  42. package/build/Core/BMColor.js +991 -0
  43. package/build/Core/BMCoreUI.js +470 -0
  44. package/build/Core/BMFunctionCollection.js +110 -0
  45. package/build/Core/BMIndexPath.js +165 -0
  46. package/build/Core/BMInset.js +138 -0
  47. package/build/Core/BMKeyPath.js +100 -0
  48. package/build/Core/BMPoint.js +291 -0
  49. package/build/Core/BMRect.js +556 -0
  50. package/build/Core/BMSize.js +137 -0
  51. package/build/iScroll/LICENSE +22 -0
  52. package/build/iScroll/iscroll-probe.js +2154 -0
  53. package/build/images/AlignBottom.png +0 -0
  54. package/build/images/AlignCenterX.png +0 -0
  55. package/build/images/AlignCenterY.png +0 -0
  56. package/build/images/AlignLeading.png +0 -0
  57. package/build/images/AlignTop.png +0 -0
  58. package/build/images/AlignTrailing.png +0 -0
  59. package/build/images/AllConstraints.png +0 -0
  60. package/build/images/BottomConstraint.png +0 -0
  61. package/build/images/CenterXConstraint.png +0 -0
  62. package/build/images/CenterYConstraint.png +0 -0
  63. package/build/images/CoreUI2.png +0 -0
  64. package/build/images/CoreUI2@2x.png +0 -0
  65. package/build/images/Desktop.png +0 -0
  66. package/build/images/DesktopMini.png +0 -0
  67. package/build/images/EqualHeight.png +0 -0
  68. package/build/images/EqualHorizontalSpacing.png +0 -0
  69. package/build/images/EqualHorizontalSpacingInSuperview.png +0 -0
  70. package/build/images/EqualVerticalSpacing.png +0 -0
  71. package/build/images/EqualVerticalSpacingInSuperview.png +0 -0
  72. package/build/images/EqualWidth.png +0 -0
  73. package/build/images/HeightConstraint.png +0 -0
  74. package/build/images/InactiveConstraints.png +0 -0
  75. package/build/images/Layout.png +0 -0
  76. package/build/images/LayoutVariables.png +0 -0
  77. package/build/images/LeftConstraint.png +0 -0
  78. package/build/images/OwnConstraints.png +0 -0
  79. package/build/images/Phone.png +0 -0
  80. package/build/images/PhoneLandscape.png +0 -0
  81. package/build/images/PhoneLandscapeMini.png +0 -0
  82. package/build/images/PhoneMini.png +0 -0
  83. package/build/images/PhonePortrait.png +0 -0
  84. package/build/images/PhonePortraitMini.png +0 -0
  85. package/build/images/Properties.png +0 -0
  86. package/build/images/RightConstraint.png +0 -0
  87. package/build/images/SubviewConstraints.png +0 -0
  88. package/build/images/Tablet.png +0 -0
  89. package/build/images/TabletLandscape.png +0 -0
  90. package/build/images/TabletLandscapeMini.png +0 -0
  91. package/build/images/TabletMini.png +0 -0
  92. package/build/images/TabletPortrait.png +0 -0
  93. package/build/images/TabletPortraitMini.png +0 -0
  94. package/build/images/TopConstraint.png +0 -0
  95. package/build/images/WidthConstraint.png +0 -0
  96. package/build/index.js +40 -0
  97. package/lib/@types/BMCoreUI.min.d.ts +14078 -0
  98. package/lib/BMCoreUI.min.js +1 -0
  99. package/package.json +58 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,1624 @@
1
+ # 2.7
2
+
3
+ ## BMLayoutEditorSettingsView
4
+
5
+ The property titles will now be clipped if they are too long.
6
+
7
+ Numeric inputs will no longer show the OS provided spinner controls.
8
+
9
+ View links will no longer show a text selection cursor when hovered.
10
+
11
+ Added a new `setValue(_, {forSetting})` that sets the appropriate variation or property value for the given setting. Setting cell subclasses are recommended to use this method instead of directly updating property values themselves.
12
+
13
+ Added the `BMLayoutEditorSettingsSizeCell` and `BMLayoutEditorSettingsInsetCell` classes that can be used to edit `BMSize` and `BMInset` properties. Added a `Size` constant to the `BMLayoutEditorSettingKind` enum.
14
+
15
+ Resolves an issue that could allow the creation of a duplicate size class override for layout variables.
16
+
17
+ Resolves an issue that could cause the highlighted style to persist on the navigation window when creating constraints.
18
+
19
+ Added support for editing a view's content insets.
20
+
21
+ ## BMLayoutEditorEnumSetting
22
+
23
+ Fixes an issue where this type was incorrectly declared as being a root class. It is now properly declared as extending `BMLayoutEditorSetting`.
24
+
25
+ ## BMLayoutEditorSettingsTab
26
+
27
+ Resolves an issue with `updateSettings` that could cause an error to be thrown if this method was invoked while a previous update was still in progress.
28
+
29
+ Resolves an issue with `updateSettings` that caused settings to be duplicated.
30
+
31
+ Resolves an issue that could cause an error to be thrown when a settings tab had no content.
32
+
33
+ Resolves a layout issue that could cause settings tab contents to overlap if the settings window was resized while a tab was inactive.
34
+
35
+ ## BMLayoutEditorSettingsTitleView
36
+
37
+ This class is now exported and can be used by setting cell subclasses to render a setting's title. This view will also render, when appropriate, a size class selector and a size class icon on its setting.
38
+
39
+ ## BMView
40
+
41
+ The `isCurrentlyVisible` property will now return `NO` if any of the view's ancestors are hidden.
42
+
43
+ When first assigning a frame, the CSS `contain` property will be set to `layout` on views.
44
+
45
+ Two new `viewDidBecomeVisible` and `viewDidBecomeInvisible` properties are now invoked on views when they become visible or invisible, either through setting the `isVisible` property on them or because any of their ancestors become visible or invisible.
46
+
47
+ ## BMCollectionView
48
+
49
+ Collection view will no longer retain cell measurements while it or any of its view ancestors are hidden.
50
+
51
+ Added a new `allowsOffscreenLayout` property, with a default value of `YES` that controls whether collection view will perform layout operations while hidden. When set to `NO`, collection view will ignore layout invalidations while invisible and only invalidate the layout after becoming visible.
52
+
53
+ When the intrinsic size of a cell is measured wile collection view is hidden, collection view will invalidate the layout upon becoming visible. Additionally, the intrinsic size of cell subviews are also invalidated upon becoming visible.
54
+
55
+ ## BMWindowDelegate
56
+
57
+ A new `windowShouldEnterShowcase` method can be implemented on window delegates to control whether the default toolbar gesture should trigger the window showcase or not.
58
+
59
+ ## BMAlertPopup
60
+
61
+ This popup can now be dismissed by pressing the escape key, in addition to the return key.
62
+
63
+ ## BMConfirmationPopup
64
+
65
+ When this popup handles the escape key, the default browser behavior will now be prevented.
66
+
67
+ ## BMCodeEditor
68
+
69
+ Added a new color for CSS selectors to the default themes. This resolves an issue where CSS selectors would be barely visible in dark mode.
70
+
71
+ This class and all of its related types and subclasses are now deprecated and will be removed in a future release.
72
+
73
+ # 2.6.10
74
+
75
+ ## BMPopover
76
+
77
+ Added a new `edgeInsets` property that is used to control the minimum spacing the popover will keep to the content edges when its position would move it outside of the viewport.
78
+
79
+ # 2.6.9
80
+
81
+ ## BMView
82
+
83
+ When a root view has no subviews, it will now take its own intrinsic size into account when performing a layout pass.
84
+
85
+ ## BMCollectionView
86
+
87
+ When using `measuredSizeOfCellAtIndexPath(_)` on a cell that has no subviews, the measured size will be derived from the cell's computed CSS size when its `width` and `height` properties are set to `auto`.
88
+
89
+ Resolves an issue with `invalidateMeasuredSizeOfCells()` that caused measures to not be invalidated when the data set supported identifiers.
90
+
91
+ Resolves an issue that caused collection view to ignore the return value of `collectionViewCellWasLongClicked(_, _, {withEvent})`. In touch mode, if the long click event is handled, a drag & drop operation can still be initiated by moving the touch pointer afterwards without releasing it.
92
+
93
+ Resolves an issue that caused error messages related to calling `preventDefault` in passive event listeners when using drag & drop on Chrome.
94
+
95
+ ## BMCollectionViewLayout
96
+
97
+ The `shouldInvalidateLayoutForFrameChange()` method now also receives the previous frame as an argument.
98
+
99
+ ## BMCollectionViewFlowLayout
100
+
101
+ Resolves an issue that caused flow layout to write out messages to the console that were intended for debug builds only. A new `BM_AUTOMATIC_CELL_SIZE_MESSAGES` flag is now used to control when these messages appear.
102
+
103
+ Resolves an issue that could cause a crash when using automatic cell size and content that was short enough to not cause a scrollbar to appear.
104
+
105
+ ## BMMenu
106
+
107
+ The menu will now invoke a `menuWillClose(_)` method on its delegate prior to closing.
108
+
109
+ Menu shadows will now have the `overflow` CSS property set to `hidden`.
110
+
111
+ # 2.6.8
112
+
113
+ ## BMRect
114
+
115
+ The `inset` method is now deprecated. Use either `insetWithWidth(_, {height})` or `insetWithInset(_)` instead.
116
+
117
+ A new `scaleWithFactor(_, {aroundPoint})` method can be used to scale a rect around a given point. The counterpart `rectByScalingWithFactor(_, {aroundPoint})` method can be used to perform this action on a copy of the rect.
118
+
119
+ ## BMCollectionView
120
+
121
+ Added a new `assignsReuseIdentifierAsClass` boolean property, with a default value of `YES` that can be used to disable setting the cell's reuse identifier as a CSS class.
122
+
123
+ ## BMViewLayoutEditor
124
+
125
+ Resolves an issue that caused viewports generated by the layout manager to not have proper surface area measurements.
126
+
127
+ Resolves an issue that caused the settings tool window to not be draggable from the title.
128
+
129
+ Improved the appearance of the settings tool window back button.
130
+
131
+ ## BMCollectionViewLayout
132
+
133
+ Added factory methods for all of the layout subclasses.
134
+
135
+ # 2.6.7
136
+
137
+ ## BMCollectionViewCell
138
+
139
+ When setting a cell's `reuseIdentifier` property, a matching CSS class will be added to the cell's `node`. It will be named `BMCollectionViewCell-<reuseIdentifier>`, where `<reuseIdentifier>` will be the value used for the reuse identifier.
140
+
141
+ The `initWithCollectionView` initializer is now supplied an additional parameter `kind` that identifies whether the cell will be used as a supplementary view or a data cell.
142
+
143
+ ## BViewLayoutEditor
144
+
145
+ Resolves an issue that could cause fields for settings that applied to size class variations to appear blank even though a value was set for them.
146
+
147
+ # 2.6.6
148
+
149
+ ## BMPopover
150
+
151
+ The popover will now appear correctly on Chrome and other browsers that support the `url()` value for the CSS `clip-path` property. Previously, this required support for the `path()` value, which was supported only on Safari and Firefox.
152
+
153
+ # 2.6.5
154
+
155
+ ## BMPopover
156
+
157
+ Fixes an issue that could lead to a thrown error when using a popover with `anchorNode`.
158
+
159
+ # 2.6.3
160
+
161
+ ## BMCollectionView
162
+
163
+ Resolves an issue that caused collection view to assign an incorrect size to the content wrapper element on WebKit/Blink based browsers. This caused the space occupied by the scrollbar to be accounted for twice leading to a visible gap between the scrollbar and the content.
164
+
165
+ ## BMWindow
166
+
167
+ A new `zIndexMax` static method will return the value of the `BM_WINDOW_Z_INDEX_MAX` constant.
168
+
169
+ ## BMViewLayoutEditor
170
+
171
+ When selecting a constraint while the inspector is closed, the text field that appears will now also have its contents automatically selected.
172
+
173
+ The pointer cursor will now appear whenever the mouse cursor is in any of a constraint's selectable area, rather than just directly on the constraint line.
174
+
175
+ # 2.6.1
176
+
177
+ ## BMCollectionView
178
+
179
+ Resolves an issue that could cause collection view to indefinitely stall awaiting for a valid frame after being assigned a frame with one of the size fields set to 0.
180
+
181
+ Specifying the `BMCollectionViewCellEventHandler` class on a node will now cause collection view to also ignore events originating from that element's direct descendants.
182
+
183
+ Collection view will now ignore events originating from folding panel headers.
184
+
185
+ # 2.6
186
+
187
+ ## General Changes
188
+
189
+ A new `BMStringByCapitalizingString(_)` function is now available that returns a copy of the given string with the first character uppercased.
190
+
191
+ The `BMAddSmoothMousewheelInteractionToNode()` method will now forward the modifier key properties from the original event when generating smooth scroll events.
192
+
193
+ ## BMKeyboardShortcutModifier
194
+
195
+ A new `BMKeyboardShortcutModifier` enum contains the modifier keys that can be used when registering keyboard shortcuts.
196
+
197
+ ## BMPoint
198
+
199
+ Two new `multiplyWithScalar(_)` and `pointByMultiplyingWithScalar(_)` methods can be used to multiply all of a point's components with a given scalar.
200
+
201
+ ## BMRect
202
+
203
+ Two new `multiplyWithScalar(_)` and `rectByMultiplyingWithScalar(_)` methods can be used to multiply all of a rect's components with a given scalar.
204
+
205
+ ## BMJQueryShim
206
+
207
+ When **jQuery** is available, the factory method for this class will now return an equivalent jQuery object. In Thingworx, this change will allow the built-in `Collection` widget to work with this version of CoreUI.
208
+
209
+ ## BMAnimationContext
210
+
211
+ Resolved an issue that caused custom bezier easings to not work when using web animations.
212
+
213
+ Resolved an issue that caused certain animations to immediately skip to the end when using web animations.
214
+
215
+ ## BMLayoutConstraint
216
+
217
+ Resolved an issue that could trigger an unsolvable layout error to occur when changing the constant of a constraint.
218
+
219
+ ## BMView
220
+
221
+ The `release` method can now be safely invoked on views that have superviews; it will now recursively invoke the `release` method on all of the view's descendants.
222
+
223
+ When a view is removed while it had a pending layout pass, it is now removed from its layout queue.
224
+
225
+ When adding or removing subviews in a hierarchy, the size classes are now correctly invalidated on the root view.
226
+
227
+ ## BMTextField
228
+
229
+ `BMTextField` is a new subclass of view that encapsulates some of the functionality that was previously used by the layout editor in relation to input elements. The layout editor now uses this class for such cases and it is now available for use in other situations as well. The primary objective of the text field class in this release is to add support for suggestions and autocompleting text to input elements. This works in conjunction with a `BMTextFieldDelegate` object that supplies the suggestions to be used and can further customize the situations in which those suggestions are used or displayed.
230
+
231
+ ## BMLayoutConstraint
232
+
233
+ A new `descriptionRelativeToView(_)` method can now be invoked to obtain a string description of the constraint that is relative to the given view.
234
+
235
+ ## BMMenu
236
+
237
+ When opened towards the right side of the page, if the menu doesn't fit to the right of the event source point, it will now open towards the left.
238
+
239
+ Resolved an issue that caused the backdrop filter used by this element to not be applied properly.
240
+
241
+ A new `CSSClass` property can be set on menu objects and can be used to add additional CSS classes to the menu DOM node.
242
+
243
+ Menu items beginning with at least 3 dashes will now be added as separators.
244
+
245
+ ## BMCollectionViewFlowLayout
246
+
247
+ Resolved a crash that could occur in certain situations when using footers and automatic cell sizes.
248
+
249
+ Resolved a crash that could occur in certain situations when using automatic cell sizes.
250
+
251
+ Resolved an issue that would cause the `End` gravity to behave the same as `Start`.
252
+
253
+ The `Expand` constant can now be used for the `contentGravity` property and will expand the rows along the primary scrolling axis to take up the entire available space. The sizes of supplementary views and spacing will be kept constant.
254
+
255
+ Resolved an issue that could cause the content width to add the size of the `bottomSpacing` property to the right of the content when using horizontal orientation.
256
+
257
+ ## BMCollectionView
258
+
259
+ A new static `collectionView()` method can be used to create a new collection view and a `DOMNode` for it.
260
+
261
+ A new `measureSizesOfCellsAtIndexPaths(_)` method can be used to measure several cells in bulk. When measuring multiple cells, this can be faster than individually measuring each cell, as the measurements will happen on the same layout queue to reduce the amount of layout thrashing. Note that in order to be measured, new cells have to be created, so this method should not be used with a very large amount of cells.
262
+
263
+ When assigned a data set while invisible or while part of a view hierarchy but before obtaining a valid frame, collection view will now delay initialization until becoming visible and having been assigned a valid frame.
264
+
265
+ When measuring cells, the measurement operation will now run in a separate layout queue.
266
+
267
+ Resolved an issue that would cause cells to improperly lose their layout attributes during measurement if they had an exact retain count of 1.
268
+
269
+ Resolved an issue that would cause the `scrollBarSize` property to return an incorrect value during the initial layout pass when `iScroll` was used.
270
+
271
+ Resolves an issue when transferring items that caused transferred items to lose their properties that had undefined values.
272
+
273
+ ## BMCollectionViewCell
274
+
275
+ A new `invalidate` method can now be overriden on collection view cells. This method is invoked prior to the cell being permanently removed and can be used by subclasses to perform any final cleanup they might need.
276
+
277
+ ## BMWindow
278
+
279
+ A new `toggleAnimated(_, {completionHandler})` method is now available. If the window is visible, it will invoke `dismissAnimated`; otherwise it will invoke `bringToFrontAnimated`.
280
+
281
+ For `bringToFrontAnimated(_, {completionHandler})` and `dismissAnimated(_, {completionHandler})`, the `fromNode`, `fromRect`, `toNode` and `toRect` arguments have been deprecated.
282
+
283
+ Three new `anchorPoint`, `anchorRect` and `anchorNode` properties can now be specified on windows. These control the open/dismiss animations of the windows.
284
+
285
+ The `minimizeAnimated` and `restoreAnimated` methods will now invoke the completion handler correctly. Clarified that the non-animated versions of these operations are not yet implemented.
286
+
287
+ Preliminary support for keyboard shortcuts. The `registerKeyboardShortcut(_)` method can now be invoked by passing in a `BMKeyboardShortcut` object to set up a keyboard shortcut for the window. The `unregisterKeyboardShortcut(_)` method can be used to remove a previously registered keyboard shortcut.
288
+
289
+ Window will no longer perform layout operations while it is invisible. All pending layout passes will be condensed into a single layout pass that occurs as soon as the window becomes visible.
290
+
291
+ Resolved an issue that caused the backdrop filter used by this element to not be applied properly.
292
+
293
+ When a window is released, its node is now removed from the document.
294
+
295
+ View hierarchies whose root view is a `BMWindow` will now use the window's size as the viewport.
296
+
297
+ Resolved an issue that caused some windows in full screen mode to be able to move or resize.
298
+
299
+ Resolved an issue that caused full screen windows to not adapt to browser size changes.
300
+
301
+ Modal windows will now use a z index based on the value of `BM_WINDOW_Z_INDEX_MAX`.
302
+
303
+ ## BMWindowDelegate
304
+
305
+ The following methods can now be implemented by window delegates:
306
+ * `windowShouldResize(_, _)`: Invoked to determine if a window can be resized.
307
+ * `windowShouldMove(_, _)`: Invoked to determine if a window can be moved.
308
+ * `windowDidMove(_, _)`: Invoked whenever a window is moved.
309
+
310
+ The `DOMNodeForDismissedWindow(_)` and `rectForDimissedWindow(_)` methods have been deprecated. They will still be invoked when `anchorPoint`, `anchorRect` and `anchorNode` are all `undefined` on the window.
311
+
312
+ ## BMKeyboardShortcut
313
+
314
+ This new class can be used to define keyboard shortcuts and the actions that should be taken when the shortcut is triggered. An instance of this class can be obtained by invoking the static `keyboardShortcutWithKey` method.
315
+
316
+ ## BMToolWindow
317
+
318
+ This class is now exported.
319
+
320
+ A new `opensAutomatically` property can be now set on tool windows, with a default value of `YES`. When this property is set to `NO` the tool window will no longer open automatically when its owning window is opened.
321
+
322
+ ## BMPopover
323
+
324
+ A new `BMPopover` subclass of `BMWindow` is now available for use. It represents a modal window that is visually linked to an element or point on the document. The anchor element or point can be set on it via the `anchorNode` or `anchorPoint` properties.
325
+
326
+ ## BMConfirmationPopup
327
+
328
+ A new `BMConfirmationPopup` class that is a subclass of `BMWindow` may be used for simple confirmation dialog boxes in place of the standard `confirm()`. `BMConfirmationPopup` provides a `Promise` that resolves when the user chooses any option.
329
+
330
+ ## BMMenuItem
331
+
332
+ A new `userInfo` property can now be set on menu items. It can be used to add additional information to the item. This object has no specific type and is not directly used by CoreUI, but can be used by custom implementations to attach arbitrary data to the item.
333
+
334
+ ## BMLayoutEditor
335
+
336
+ It is now possible to freely pan the edited view hierarchy using the touchpad, mousewheel, clicking and dragging while holding the ⌥ key or by dragging with two fingers on touch devices.
337
+
338
+ It is now possible to zoom the edited view hierarchy by using the mousewheel or touchpad scrolling while holding the ⌥ key or by pinch zooming on touch devices.
339
+ There is also a slider control and precise zoom input box available in the toolbar to control the zoom level.
340
+
341
+ Constraints are now drawn in such a way that whenever possible they will touch the edges of the affected views instead of defaulting to originate from the center of the selected view.
342
+
343
+ A new **Reset** button is now available in the toolbar that can be used to reset the zoom level and pan position.
344
+
345
+ The height of the toolbar and the various settings controls has been reduced.
346
+
347
+ The following keyboard shortcuts are now available when a view is selected:
348
+ * `⌘←`: Selects the first active constraint that affects the view's `Leading` or `Left` attribute. If such a constraint isn't available but the view has a constraints that affect its `Width` and `Trailing` or `Right` attributes, the `Width` constraint will be selected. If no such constraints are available, an appropriate `Leading` or `Width` constraint is created and selected.
349
+ * `⌘↑`: Selects the first active constraint that affects the view's `Top` attribute. If such a constraint isn't available but the view has a constraints that affect its `Height` and `Bottom` attributes, the `Height` constraint will be selected. If no such constraints are available, an appropriate `Top` constraint is created and selected.
350
+ * `⌘→`: Selects the first active constraint that affects the view's `Trailing`, `Right` or `Width` attribute. If no such constraint is available, an appropriate `Trailing` or `Width` constraint is created.
351
+ * `⌘↓`: Selects the first active constraint that affects the view's `Bottom` or `Height` attribute. If no such constraint is available, an appropriate `Bottom` or `Height` constraint is created.
352
+ * `⌘⌥C`: Creates missing constraints for the selected view.
353
+ In all of the above cases, if a size class is selected, the newly created constraints will only be activated for the given size class.
354
+
355
+ The following keyboard shortcuts are now available when a constraint is selected:
356
+ * `⌫`: Toggles activation of the constraint for the current size class.
357
+ * `⌘⌫`: Deletes the constraint.
358
+ * `⌘⌥-`: Sets the constraint equality sign to less than or equal to.
359
+ * `⌘⌥=`: Sets the constraint equality sign to greater than or equal to.
360
+ * `⌘⌥0`: Sets the constraint equality sign to equal to.
361
+
362
+ The manner in which custom settings can be added and the structure and organization of the settings panel has changed. In this release, the change is opt-in and the previous method is still available and enabled by default.
363
+ A new `BMViewLayoutEditor` subclass of `BMLayoutEditor` should be created and used instead to enable this. In addition to the changes above, when enabling the settings view, the layout editor will also have the following changes:
364
+ * The navigation tree is now hidden by default and no longer appears as a sidebar. It now appears as an inspector window that can be moved and resized.
365
+ * The settings sidebar is now hidden by default and no longer appears as a sidebar. It now appears as an inspector window that can be moved and resied. Whenever the settings inspector is dismissed, double clicking a view will cause it to reappear.
366
+
367
+ When a view doesn't expose an intrinsic size, the compression and expansion resistance settings will no longer be displayed by the layout editor.
368
+
369
+ When using the settings view, it is no longer required to subclass the layout editor to enable custom settings. The settings are now organized in:
370
+ * The settings view is the root of the settings inspector and contains one or several *settings panels*. Only one settings panel can be visible at any time and CoreUI manages creating and destroying these panels.
371
+ * A settings panel can contain one or more tabs. Tabs are represented by `BMLayoutEditorSettingsTab` objects.
372
+ * Each tab contains one or more *sections*, represented by the `BMLayoutEditorSettingsSection` class, each containing several *setting* objects, represented by the `BMLayoutEditorSetting` class.
373
+
374
+ When setting panels are created, during initialization and at several points throughout their lifecycle, CoreUI will invoke one of the following methods on the editor's delegate, depending on what kind of item is selected:
375
+ * `layoutEditorAdditionalSettingTabsForView(_, _)` can be used to add additional setting tabs that are visible when views are selected.
376
+ * `layoutEditorAdditionalSettingTabsForConstraint(_, _)` can be used to add additional setting tabs that are visible when constraints are selected.
377
+
378
+ View subclasses can also implement the `additionalSettingTabsForLayoutEditor(_)` method to supply their own specific settings regardless of the delegate object.
379
+
380
+ After the tabs are created and whenever they are updated, for each tab, CoreUI will invoke the following method on the editor's delegate:
381
+ * `layoutEditorAdditionalSettingSectionsForTab(_, _)` can be used to add additional settings to a tab. This includes the custom tabs created previously, which normally have no settings of their own.
382
+
383
+ Similarly, view subclasses can implement the `additionalSettingSectionsForTab(_, {layoutEditor})` to add their own specific settings.
384
+
385
+ ## BMMonacoCodeEditor
386
+
387
+ The monaco code editor will now set the tsc `alwaysStrict` flag to `false`.
388
+
389
+ # 2.6 Beta 8
390
+
391
+ ## BMWindow
392
+
393
+ The `setArguments(_)`, `animateInWithArguments(_, {completionHandler})` and `animateOutWithArguments(_, {completionHandler})` methods have been removed. Subclasses the need to customize these animations that were previously associated with those methods can now override the new `animateInWithCompletionHandler(_)` and `animateOutWithCompletionHandler(_)` methods.
394
+
395
+ For `bringToFrontAnimated(_, {completionHandler})` and `dismissAnimated(_, {completionHandler})`, the `fromNode`, `fromRect`, `toNode` and `toRect` arguments have been deprecated.
396
+
397
+ Three new `anchorPoint`, `anchorRect` and `anchorNode` properties can now be specified on windows. These control the open/dismiss animations of the windows.
398
+
399
+ The `minimizeAnimated` and `restoreAnimated` methods will now invoke the completion handler correctly. Clarified that the non-animated versions of these operations are not yet implemented.
400
+
401
+ ## BMConfirmationPopup
402
+
403
+ A new `BMConfirmationPopup` class that is a subclass of `BMWindow` may be used for simple confirmation dialog boxes in place of the standard `confirm()`. `BMConfirmationPopup` provides a `Promise` that resolves when the user chooses any option.
404
+
405
+ ## BMPopover
406
+
407
+ Added support for the `anchorRect` property inherited from `BMWindow`.
408
+
409
+ The various properties that were marked animatable but were not animatable have had their descriptions clarified.
410
+
411
+ ## BMWindowDelegate
412
+
413
+ The `DOMNodeForDismissedWindow(_)` and `rectForDimissedWindow(_)` methods have been deprecated. They will still be invoked when `anchorPoint`, `anchorRect` and `anchorNode` are all `undefined` on the window.
414
+
415
+ ## BMLayoutEditorSettingsConstraintCell
416
+
417
+ Resolved an issue that caused this cell to display an improper icon for `CenterY` constraints.
418
+
419
+ # 2.6 Beta 7
420
+
421
+ ## BMAnimationContext
422
+
423
+ Resolved an issue that caused certain animations to immediately skip to the end when using web animations.
424
+
425
+ ## BMMenu
426
+
427
+ A new `CSSClass` property can be set on menu objects and can be used to add additional CSS classes to the menu DOM node.
428
+
429
+ Menu items beginning with at least 3 dashes will now be added as separators. Previous betas required items to have exactly 3 dashes.
430
+
431
+ ## BMWindow
432
+
433
+ Resolved an issue with the blur effect on windows being cut off in recent versions of Safari.
434
+
435
+ ## BMViewLayoutEditor
436
+
437
+ Added the missing icons for center x and center y constraint types.
438
+
439
+ # 2.6 Beta 5
440
+
441
+ ## BMLayoutEditor
442
+
443
+ The new editor layout is no longer accessible by setting the global `BM_LAYOUT_EDITOR_USE_SETTINGS_VIEW` flag. Instead, a new `BMViewLayoutEditor` subclass of `BMLayoutEditor` should be created and used instead. This allows both the old layout and the new one to coexist in the same project.
444
+
445
+ # 2.6 Beta 4
446
+
447
+ ## BMWindow
448
+
449
+ Modal windows will now use a z index based on the value of `BM_WINDOW_Z_INDEX_MAX`.
450
+
451
+ ## BMLayoutEditor
452
+
453
+ Whenever the constraint inspector panel appears, the appropriate constant field will now be focused by default.
454
+
455
+ Resolved an issue that could allow the editor inspector to be shrunk below an acceptable size.
456
+
457
+ ## BMMonacoCodeEditor
458
+
459
+ The monaco code editor will now set the tsc `alwaysStrict` flag to `false`.
460
+
461
+ # 2.6 Beta 3
462
+
463
+ ## BMCollectionView
464
+
465
+ Resolves an issue when transferring items that caused transferred items to lose their properties that had undefined values.
466
+
467
+ ## BMLayoutEditor
468
+
469
+ Creating a new constraint or selecting one via a keyboard shortcut while the inspector is hidden will now correctly bring up the constant editor for that constraint.
470
+
471
+ # 2.6 Beta 2
472
+
473
+ ## BMAnimationContext
474
+
475
+ Resolved an issue that caused custom bezier easings to not work when using web animations.
476
+
477
+ ## BMLayoutConstraint
478
+
479
+ Resolved an issue that could trigger an unsolvable layout error to occur when changing the constant of a constraint.
480
+
481
+ ## BMView
482
+
483
+ When a view is removed while it had a pending layout pass, it is now removed from its layout queue.
484
+
485
+ When adding or removing subviews in a hierarchy, the size classes are now correctly invalidated on the root view.
486
+
487
+ ## BMWindow
488
+
489
+ When a window is released, its node is now removed from the document.
490
+
491
+ View hierarchies whose root view is a `BMWindow` will now use the window's size as the viewport.
492
+
493
+ Resolved an issue that caused some windows in full screen mode to be able to move or resize.
494
+
495
+ Resolved an issue that caused full screen windows to not adapt to browser size changes.
496
+
497
+ ## BMWindowDelegate
498
+
499
+ The following methods can now be implemented by window delegates:
500
+ * `windowShouldResize(_, _)`: Invoked to determine if a window can be resized.
501
+ * `windowShouldMove(_, _)`: Invoked to determine if a window can be moved.
502
+ * `windowDidMove(_, _)`: Invoked whenever a window is moved.
503
+
504
+ ## BMPopover
505
+
506
+ A new `BMPopover` subclass of `BMWindow` is now available for use. It represents a modal window that is visually linked to an element or point on the document. The anchor element or point can be set on it via the `anchorNode` or `anchorPoint` properties.
507
+
508
+ ## BMLayoutEditor
509
+
510
+ Resolved an issue that caused entries in the view hierarchy window to be cut off.
511
+
512
+ Resolved an issue with numeric setting cells that caused values to be assigned as strings instead of numbers.
513
+
514
+ ## BMTextField
515
+
516
+ Resolved a display issue when the text field had a very large number of items. Additionaly, the suggestions dropdown will now only display the first 10 entries.
517
+
518
+ # 2.6
519
+
520
+ ## General Changes
521
+
522
+ A new `BMStringByCapitalizingString(_)` function is now available that returns a copy of the given string with the first character uppercased.
523
+
524
+ The `BMAddSmoothMousewheelInteractionToNode()` method will now forward the modifier key properties from the original event when generating smooth scroll events.
525
+
526
+ ## BMKeyboardShortcutModifier
527
+
528
+ A new `BMKeyboardShortcutModifier` enum contains the modifier keys that can be used when registering keyboard shortcuts.
529
+
530
+ ## BMPoint
531
+
532
+ Two new `multiplyWithScalar(_)` and `pointByMultiplyingWithScalar(_)` methods can be used to multiply all of a point's components with a given scalar.
533
+
534
+ ## BMRect
535
+
536
+ Two new `multiplyWithScalar(_)` and `rectByMultiplyingWithScalar(_)` methods can be used to multiply all of a rect's components with a given scalar.
537
+
538
+ ## BMJQueryShim
539
+
540
+ When **jQuery** is available, the factory method for this class will now return an equivalent jQuery object. In Thingworx, this change will allow the built-in `Collection` widget to work with this version of CoreUI.
541
+
542
+ ## BMView
543
+
544
+ The `release` method can now be safely invoked on views that have superviews; it will now recursively invoke the `release` method on all of the view's descendants.
545
+
546
+ ## BMTextField
547
+
548
+ `BMTextField` is a new subclass of view that encapsulates some of the functionality that was previously used by the layout editor in relation to input elements. The layout editor now uses this class for such cases and it is now available for use in other situations as well. The primary objective of the text field class in this release is to add support for suggestions and autocompleting text to input elements. This works in conjunction with a `BMTextFieldDelegate` object that supplies the suggestions to be used and can further customize the situations in which those suggestions are used or displayed.
549
+
550
+ ## BMLayoutConstraint
551
+
552
+ A new `descriptionRelativeToView(_)` method can now be invoked to obtain a string description of the constraint that is relative to the given view.
553
+
554
+ ## BMMenu
555
+
556
+ When opened towards the right side of the page, if the menu doesn't fit to the right of the event source point, it will now open towards the left.
557
+
558
+ ## BMCollectionViewFlowLayout
559
+
560
+ Resolved a crash that could occur in certain situations when using footers and automatic cell sizes.
561
+
562
+ Resolved a crash that could occur in certain situations when using automatic cell sizes.
563
+
564
+ Resolved an issue that would cause the `End` gravity to behave the same as `Start`.
565
+
566
+ The `Expand` constant can now be used for the `contentGravity` property and will expand the rows along the primary scrolling axis to take up the entire available space. The sizes of supplementary views and spacing will be kept constant.
567
+
568
+ Resolved an issue that could cause the content width to add the size of the `bottomSpacing` property to the right of the content when using horizontal orientation.
569
+
570
+ ## BMCollectionView
571
+
572
+ A new static `collectionView()` method can be used to create a new collection view and a `DOMNode` for it.
573
+
574
+ A new `measureSizesOfCellsAtIndexPaths(_)` method can be used to measure several cells in bulk. When measuring multiple cells, this can be faster than individually measuring each cell, as the measurements will happen on the same layout queue to reduce the amount of layout thrashing. Note that in order to be measured, new cells have to be created, so this method should not be used with a very large amount of cells.
575
+
576
+ When assigned a data set while invisible or while part of a view hierarchy but before obtaining a valid frame, collection view will now delay initialization until becoming visible and having been assigned a valid frame.
577
+
578
+ When measuring cells, the measurement operation will now run in a separate layout queue.
579
+
580
+ Resolved an issue that would cause cells to improperly lose their layout attributes during measurement if they had an exact retain count of 1.
581
+
582
+ Resolved an issue that would cause the `scrollBarSize` property to return an incorrect value during the initial layout pass when `iScroll` was used.
583
+
584
+ ## BMCollectionViewCell
585
+
586
+ A new `invalidate` method can now be overriden on collection view cells. This method is invoked prior to the cell being permanently removed and can be used by subclasses to perform any final cleanup they might need.
587
+
588
+ ## BMWindow
589
+
590
+ A new `toggleAnimated(_, {completionHandler})` method is now available. If the window is visible, it will invoke `dismissAnimated`; otherwise it will invoke `bringToFrontAnimated`.
591
+
592
+ Preliminary support for keyboard shortcuts. The `registerKeyboardShortcut(_)` method can now be invoked by passing in a `BMKeyboardShortcut` object to set up a keyboard shortcut for the window. The `unregisterKeyboardShortcut(_)` method can be used to remove a previously registered keyboard shortcut.
593
+
594
+ Window will no longer perform layout operations while it is invisible. All pending layout passes will be condensed into a single layout pass that occurs as soon as the window becomes visible.
595
+
596
+ ## BMKeyboardShortcut
597
+
598
+ This new class can be used to define keyboard shortcuts and the actions that should be taken when the shortcut is triggered. An instance of this class can be obtained by invoking the static `keyboardShortcutWithKey` method.
599
+
600
+ ## BMToolWindow
601
+
602
+ This class is now exported.
603
+
604
+ A new `opensAutomatically` property can be now set on tool windows, with a default value of `YES`. When this property is set to `NO` the tool window will no longer open automatically when its owning window is opened.
605
+
606
+ ## BMMenuItem
607
+
608
+ A new `userInfo` property can now be set on menu items. It can be used to add additional information to the item. This object has no specific type and is not directly used by CoreUI, but can be used by custom implementations to attach arbitrary data to the item.
609
+
610
+ ## BMLayoutEditor
611
+
612
+ It is now possible to freely pan the edited view hierarchy using the touchpad, mousewheel, clicking and dragging while holding the ⌥ key or by dragging with two fingers on touch devices.
613
+
614
+ It is now possible to zoom the edited view hierarchy by using the mousewheel or touchpad scrolling while holding the ⌥ key or by pinch zooming on touch devices.
615
+ There is also a slider control and precise zoom input box available in the toolbar to control the zoom level.
616
+
617
+ Constraints are now drawn in such a way that whenever possible they will touch the edges of the affected views instead of defaulting to originate from the center of the selected view.
618
+
619
+ A new **Reset** button is now available in the toolbar that can be used to reset the zoom level and pan position.
620
+
621
+ The height of the toolbar and the various settings controls has been reduced.
622
+
623
+ The following keyboard shortcuts are now available when a view is selected:
624
+ * `⌘←`: Selects the first active constraint that affects the view's `Leading` or `Left` attribute. If such a constraint isn't available but the view has a constraints that affect its `Width` and `Trailing` or `Right` attributes, the `Width` constraint will be selected. If no such constraints are available, an appropriate `Leading` or `Width` constraint is created and selected.
625
+ * `⌘↑`: Selects the first active constraint that affects the view's `Top` attribute. If such a constraint isn't available but the view has a constraints that affect its `Height` and `Bottom` attributes, the `Height` constraint will be selected. If no such constraints are available, an appropriate `Top` constraint is created and selected.
626
+ * `⌘→`: Selects the first active constraint that affects the view's `Trailing`, `Right` or `Width` attribute. If no such constraint is available, an appropriate `Trailing` or `Width` constraint is created.
627
+ * `⌘↓`: Selects the first active constraint that affects the view's `Bottom` or `Height` attribute. If no such constraint is available, an appropriate `Bottom` or `Height` constraint is created.
628
+ * `⌘⌥C`: Creates missing constraints for the selected view.
629
+ In all of the above cases, if a size class is selected, the newly created constraints will only be activated for the given size class.
630
+
631
+ The following keyboard shortcuts are now available when a constraint is selected:
632
+ * `⌫`: Toggles activation of the constraint for the current size class.
633
+ * `⌘⌫`: Deletes the constraint.
634
+ * `⌘⌥-`: Sets the constraint equality sign to less than or equal to.
635
+ * `⌘⌥=`: Sets the constraint equality sign to greater than or equal to.
636
+ * `⌘⌥0`: Sets the constraint equality sign to equal to.
637
+
638
+ The manner in which custom settings can be added and the structure and organization of the settings panel has changed. In this release, the change is opt-in and the previous method is still available and enabled by default.
639
+ The new method can be enabled by setting the global `BM_LAYOUT_EDITOR_USE_SETTINGS_VIEW` flag to `YES`. In addition to the changes above, when enabling the settings view, the layout editor will also have the following changes:
640
+ * The navigation tree is now hidden by default and no longer appears as a sidebar. It now appears as an inspector window that can be moved and resized.
641
+ * The settings sidebar is now hidden by default and no longer appears as a sidebar. It now appears as an inspector window that can be moved and resied. Whenever the settings inspector is dismissed, double clicking a view will cause it to reappear.
642
+
643
+ When a view doesn't expose an intrinsic size, the compression and expansion resistance settings will no longer be displayed by the layout editor.
644
+
645
+ When using the settings view, it is no longer required to subclass the layout editor to enable custom settings. The settings are now organized in:
646
+ * The settings view is the root of the settings inspector and contains one or several *settings panels*. Only one settings panel can be visible at any time and CoreUI manages creating and destroying these panels.
647
+ * A settings panel can contain one or more tabs. Tabs are represented by `BMLayoutEditorSettingsTab` objects.
648
+ * Each tab contains one or more *sections*, represented by the `BMLayoutEditorSettingsSection` class, each containing several *setting* objects, represented by the `BMLayoutEditorSetting` class.
649
+
650
+ When setting panels are created, during initialization and at several points throughout their lifecycle, CoreUI will invoke one of the following methods on the editor's delegate, depending on what kind of item is selected:
651
+ * `layoutEditorAdditionalSettingTabsForView(_, _)` can be used to add additional setting tabs that are visible when views are selected.
652
+ * `layoutEditorAdditionalSettingTabsForConstraint(_, _)` can be used to add additional setting tabs that are visible when constraints are selected.
653
+
654
+ View subclasses can also implement the `additionalSettingTabsForLayoutEditor(_)` method to supply their own specific settings regardless of the delegate object.
655
+
656
+ After the tabs are created and whenever they are updated, for each tab, CoreUI will invoke the following method on the editor's delegate:
657
+ * `layoutEditorAdditionalSettingSectionsForTab(_, _)` can be used to add additional settings to a tab. This includes the custom tabs created previously, which normally have no settings of their own.
658
+
659
+ Similarly, view subclasses can implement the `additionalSettingSectionsForTab(_, {layoutEditor})` to add their own specific settings.
660
+
661
+ ## BMMenu
662
+
663
+ Resolved an issue that caused the backdrop filter used by this element to not be applied properly.
664
+
665
+ # 2.5.3
666
+
667
+ Resolved an incompatibility issue with Thingworx 8.5.
668
+
669
+ # 2.5.2
670
+
671
+ ## General Changes
672
+
673
+ Resolved an issue with the Thingworx extension that could cause CoreUI to crash upon loading. This issue would occur when the environment had a module loader available. This would cause `kiwi` to expose itself as a module in one of those systems instead of globally as the CoreUI extension expected. CoreUI will now explicitly disable modules for kiwi in such environments.
674
+
675
+ Resolved an issue that caused certain async methods to be excluded from the TypeScript definitions.
676
+
677
+ ## BMAnimationContext
678
+
679
+ When web animations are enabled, array easings are now converted into cubic bezier easings.
680
+
681
+ ## BMMenu
682
+
683
+ A new `openFromNode` method is now available. It opens the menu from the given DOM node and visually highlights it.
684
+
685
+ A new `iconSize` property can be set on the menu. It controls the size of the menu item icons.
686
+
687
+ When specified on menu items, the menu will now also display icons.
688
+
689
+ # 2.5.1
690
+
691
+ ## BMView
692
+
693
+ Changes to `contentInsets`, `visibility` and `CSSClass` will now correctly automatically invalidate the view's intrinsic size, if the view supports intrinsic sizes.
694
+
695
+ ## BMScrollContentView
696
+
697
+ This class no longer uses its own implementation for the `frame` setter.
698
+
699
+ ## BMCollectionView
700
+
701
+ Resolved an issue that caused interactive movement to only start the first time per cell instance on touch devices.
702
+
703
+ # 2.5
704
+
705
+ CoreUI 2.5 focuses on improving on the foundation laid out by CoreUI 2.0 and expanding the role of View while also fixing many of its issues and quirks from the previous version. In 2.0, the `BMView` class was introduced as a new API that was completely separate from everything else. In this release, `BMWindow`, `BMCollectionView` and `BMCollectionViewCell` now all inherit from `BMView` and make use of its functionality in different ways - for example Collection View can now use layout constraints to automatically determine appropriate sizes for cells and windows can now be opened in non-modal mode where they can be dragged around and resized.
706
+
707
+ ## General Changes
708
+
709
+ Core UI is now built using a gulp script instead of the previous gradle build script, allowing modern javascript tools to be integrated with the build system.
710
+
711
+ The various parts of CoreUI can now be imported as modules in Javascript or TypeScript projects. When used outside of Thingworx, CoreUI can now also be added to a project via npm:
712
+ ```sh
713
+ npm install bm-core-ui
714
+ ```
715
+
716
+ Whenever using smooth wheel scrolling, additional scrolls will now also introduce additional friction.
717
+
718
+ The timing of various implicit animations has changed slightly, which should make the affected animations feel more responsive.
719
+
720
+ On macOS Mojave, various CoreUI elements, including `BMLayoutEditor` support dark mode.
721
+
722
+ Upgraded the version of `kiwi.js` used to `1.1.0`.
723
+
724
+ Most classes that support copying now also include a copy initializer to make it easy for subclasses to implement their copy methods on top of the base class method.
725
+
726
+ ## TypeScript
727
+
728
+ Improved the formatting of the definitions file and resolved several issues including:
729
+ - empty parameters for callback types
730
+ - missing return types for various functions
731
+ - optional first parameters but required parameters object
732
+
733
+ Added the missing interface definitions for `BMWindowDelegate` and `BMCodeEditorDelegate`.
734
+
735
+ `BMHook()` is now correctly marked as working with `DOMNode` objects in addition to jQuery elements.
736
+
737
+ The generation of the definitions file is now part of the build system to ensure it is always up to date.
738
+
739
+ Classes that CoreUI depends upon are now declared as empty interfaces instead of classes to prevent conflicts when the correct definitions are included for those classes.
740
+
741
+ `BMIndexPath`, `BMCollectionViewDataSet` and `BMCollectionView` are now generic types.
742
+
743
+ ## BMSize
744
+
745
+ The `toString` method of `BMPoint` and `BMSize` now returns a customized string.
746
+
747
+ Two new `isGreaterThanSize(_)` and `isLessThanSize(_)` methods can now be used to compare two sizes.
748
+
749
+ This type now includes a copy initializer.
750
+
751
+ ## BMPoint
752
+
753
+ The `toString` method of `BMPoint` and `BMSize` now returns a customized string.
754
+
755
+ Two new `r` and `t` number properties allow working with points in polar coordinates. Note that internally, points are still represented in cartesian coordinates and accessing or setting the polar coordinates will always trigger a calculation based on the point's cartesian coordinates.
756
+
757
+ The new `BMPointMakeWithRadius(_, {angle})` function and the static `pointWithRadius(_, {angle})` method can be used to construct points from polar coordinates.
758
+
759
+ This type now includes a copy initializer.
760
+
761
+ ## BMRect
762
+
763
+ A new `rectByUnionWithRect(_)` method is now available and returns a new rect that represents the union between two rects.
764
+
765
+ A new `initWithRect(_)` copy initializer is now available.
766
+
767
+ ## BMIndexPath
768
+
769
+ A new `initWithIndexPath(_)` copy initializer is now available.
770
+
771
+ ## BMAnimationContext
772
+
773
+ If an animation context is started by an event handler while the shift key is pressed, the resulting animation will run in slow-motion.
774
+
775
+ A new `BMAnimationContextBeginStatic()` function can be invoked to create an animation context in which animatable properties will not be animated. While a static animation context is active, `BMAnimationContextGetCurrent()` returns `undefined`. To clear the static animation context, `BMAnimationApply()` or `BMAnimationApplyBlocking(_)` must be invoked. Static animation contexts can be used to temporarily disable implicit animations while an animation context is already active.
776
+
777
+ A new `BMAnimationContextAddCompletionHandler(_)` function can now be used to attach a handler that will be executed when the current animation context finshes its animation. If there is no current animation context or if the current animation context is static, the handler will be executed synchronously before the function returns.
778
+
779
+ When using the `@BMAnimatable` and `@BMAnimatableNumber` decorators on a class that doesn't have the `node` property, the animation will be registered on the body element as a fallback.
780
+
781
+ When using `@BMAnimatableNumber` to animate a numeric property whose initial value is `undefined` or `NaN`, the animation will use `0` as an initial value.
782
+
783
+ Resolved an issue with `@BMAnimatableNumber` that would incorrectly attempt to use the `copy()` method on the initial value, leading to a crash.
784
+
785
+ ### Web Animations
786
+
787
+ This release includes preliminary support for the Web Animations API. In this version, web animations are disabled by default but can be enabled by setting the global flag `BM_USE_WEB_ANIMATIONS` to `true`. When this flag is enabled, whenever possible, animation contexts will now use the Web Animations API in place of Velocity.js; depending on how the animation is set up, CoreUI may split the animation into web animations-compatible animations and animations that require Velocity.js. In those cases, the two types of animations may have slightly different timings as each type of animation is handled independently by its engine. Regardless of whether web animations are enabled or not, the syntax for using animations in CoreUI remains the same.
788
+
789
+ A new `BMAnimationContextEnableWebAnimations()` global method is now available to selectively activate the web animation engine for specific animations. When this function is invoked while an animation context is active, the animation created by that context will attempt to use web animations. In general, animations that modify hardware accelerated properties such as `transform` and `opacity` tend to run better with web animations than with Velocity. By contrast, animations that modify other properties, especially those affect flow such as `left`, `top`, `width` and `height` tend to run better with Velocity. The animation will nevertheless still fall back to Velocity if the environment does not support web animations. Whenever the environment fails to start the requested animation, it will be set up as a legacy Velocity.js call and all subsequent animations will run in legacy mode regardless of whether `BM_USE_WEB_ANIMATIONS` is set to `true` or `BMAnimationContextEnableWebAnimations()` has been used.
790
+
791
+ To support web animations, the manner in which some animations are set up has changed. For many property-based animations, the value of the property will no longer be repeatedly updated during the animation. Instead, the value will be instantly set to the final value and only the CSS properties of the affected node will be animated. This is relevant for implementations that previously relied on this behaviour, such as handling view animations in the `boundsWillChangeToBounds(_)` method; in this release, those implementations will have to set up their own animations.
792
+
793
+ Several built-in CoreUI animations now use web animations by default where supported.
794
+
795
+ ## BMAnimationSubscriber
796
+
797
+ Animation subscribers can optionally implement a new `prepare()` method that is invoked prior to the animation being applied. Animation subscribers can further modify the animation from within this method by adding new animation subscribers to the pending animation. Note that the `prepare()` method will not be invoked on those new subscribers. `BMAnimationContextGetCurrent()` will return the current animation when invoked from within this method, unlike with `apply()`.
798
+
799
+ ## BMAnimationController
800
+
801
+ A new `registerBuiltInPropertiesWithDictionary(_)` method is now available for animation controllers and can be used to register multiple animation properties at the same time.
802
+
803
+ ## BMAttributedLabelView
804
+
805
+ `BMAttributedLabelView` is a new subclass of `BMView`.
806
+
807
+ An attributed label view is a view that displays a text that can have various arguments which may be changed at runtime.
808
+ The attributed label view automatically generates DOM nodes for each argument.
809
+
810
+ Creating a label view with a template can be done using the factory method:
811
+ ```js
812
+ BMAttributedView.labelViewWithTemplate('Template with ${firstPlaceholder} and ${secondPlaceholder}');
813
+ ```
814
+ which creates an attributed label with two arguments named `firstPlaceholder` and `secondPlaceholder`.
815
+
816
+ The arguments themselves are accessed and updated via the `arguments` property of the attributed label view. Each argument appears a property of that object. Their value can be read or written through the `value` property of that object e.g.:
817
+ ```js
818
+ // This sets the value of the firstPlaceholder argument
819
+ myLabelView.arguments.firstPlaceholder.value = 3;
820
+ ```
821
+
822
+ Additionally, the arguments objects allow specifying CSS styles for each argument. The attributed label view will reapply these styles whenever the underlying DOM structure changes, for example when changing the template string. This is accessible via the `style` property of each argument object. This takes a regular CSS rule object, such as `{color: 'red', borderWidth: '2px'}`.
823
+
824
+ Finally, the underlying DOM nodes themselves are accessible via the `node` property of these arguments objects. Note that there is no guarantee of the lifetime of these DOM nodes. The attribute label can remove and re-create these nodes at any time as needed.
825
+
826
+ ## BMViewport
827
+
828
+ `BMViewport` is a new class introduced in this release. Its purpose is to describe the metrics of the current viewport, or in certain cases various parts of the viewport. Viewports are not typically created manually, but instead each view has a new `viewport` property that will return such an object describing the viewport used by that view's hierarchy.
829
+
830
+ If needed, a viewport object describing the current viewport can be obtained by invoking the `currentViewport()` static method.
831
+
832
+ ## BMLayoutSizeClass
833
+
834
+ A new `BMLayoutSizeClass` class is now available and can be used to specify various requirements that a viewport should match. The requirements supported by size classes are in this release are:
835
+ * maximum width
836
+ * maximum height
837
+ * maximum diagonal
838
+ * orientation
839
+
840
+ A size class can contain one or more of these requirements.
841
+
842
+ Size classes are used by views and layout constraints to specify variations to their properties. The root of a view hierarchy will monitor its viewport for changes and activate and deactivate size classes in response to these changes. Whenever the active size classes change, the root of the view hierarchy will send a notification to all of its descendants and layout constraints and update their configuration accordingly.
843
+
844
+ It is not required to tell the view hierarchy which size classes it should check against viewport changes; instead view will automatically discover which size classes it should use whenever variations are created or removed within its hierarchy.
845
+
846
+ ## BMView
847
+
848
+ ### **General changes**
849
+
850
+ By default, views created with the default `BMView` class no longer support automatic intrinsic size; it is now required to manually enable this functionality for these views.
851
+
852
+ ### **Bug fixes**
853
+
854
+ Resolved an issue that caused the expansion resistance to use the compression value instead for height measurement.
855
+
856
+ Resolved an issue that caused unsolvable layouts to trigger an infinite loop. View will now correctly remove unsatisfiable constraints and retry the layout operation. View will still try to use the unsatisfiable constraint during subsequent layout passes.
857
+
858
+ When computing the automatic intrinsic size of an element, View will now take the width of the border into account.
859
+
860
+
861
+ ### **New properties and methods**
862
+
863
+ A new `opacity` property may be used to control the opacity of the view's node. This property corresponds to the CSS `opacity` property and is animatable.
864
+
865
+ A new `isVisible` property may be used to control the visibility of a view. Internally, this will control the node's CSS `display` property, switching between `none` and `block`.
866
+
867
+ A new `CSSClass` property may be used to add additional CSS classes to the view's node.
868
+
869
+ Two new methods, `boundsWillChangeToBounds(_)` and `boundsDidChangeToBounds(_)` can be overriden on subclasses of `BMView`. These methods are invoked whenever applying a new frame causes the view's size to change. Note that view subclasses may change their bounds independently of their layout; in those cases these methods should be invoked whenever the `bounds` property is updated.
870
+
871
+ A new `frameRelativeToRootView` property can be used to retrieve or update a view's `frame` in coordinates that are relative to the root view of its view hierarchy instead of using coordinates relative to the view's superview. If the root view is the first element in the page, this effectively controls the view's position and size relative to the viewport. Note that for views that are within scroll view content views, the resulting frame will depend on the scroll view's scroll position.
872
+
873
+ A new `viewport` readonly property can be used to obtain the viewport associated with a view hierarchy.
874
+
875
+ A new `frameForDescendant(_)` method is invoked on the root view of a view hierarchy at the end of a layout operation to obtain the frames to assign to all of its descendant views. Subclasses can override this method to customize the frames that will be assigned to views after a layout operation. Subclasses that override this method must return a `BMRect` object that will represent the frame to be assigned to the descendant given as a parameter. To obtain the frame resulting from solving the layout constraint equations, subclasses should invoke the superclass implementation.
876
+
877
+ A new `removeFromSuperview()` method is now available to remove a view from its superview, if it has one.
878
+
879
+ A new `isDescendantOfView(_)` method may be used to verify if a view is a descendant of a given view.
880
+
881
+ A new `constraintWithIdentifier(_)` method may be used to obtain a reference to a layout constraint using the identifier that has been assigned to it.
882
+
883
+ A new `allConstraints` readonly property will return all constraints used by a view and all of its descendants, regardless of whether they are active or not.
884
+
885
+ The `layout()` method is now deprecated. The new `layoutIfNeeded()` method should be used instead. In addition to the previous functionality, this method will not perform any changes if no pending layout update had been registered.
886
+
887
+ ### **Subview management improvements**
888
+
889
+ When adding a subview to a view whose node is already a direct descendant of the new superview's content node, the subview's node will no longer be temporarily detached from the DOM.
890
+
891
+ When removing a subview from its superview while its node is no longer a direct descendant of the superview's content node, the subview's node will no longer be detached from the DOM.
892
+
893
+ When removing a subview from its superview, all constraints that are no longer valid (that reference views that are no longer part of the same view hierarchy) will now be removed.
894
+
895
+
896
+
897
+ ### **Layout process improvements**
898
+
899
+ Improved layout performance by eliminating several sources of layout thrashing.
900
+
901
+ When a view is assigned a size that is different from its preferred instrinsic size during a layout pass, its intrinsic size will be recalculated during the next layout pass.
902
+
903
+ When a view is assigned a size that is greater than its preferred intrinsic size during a layout pass, its preferred intrinsic size will not be recalculated until its intrinsic size is invalidated or the view is assigned a smaller size.
904
+
905
+ If the assigned width of a view does not change and its intrinsic size does not become invalidated, neither the view's preferred intrinsic size nor its constrained intrinsic size will be recalculated, which can avoid having to modify the DOM at all during layout passes.
906
+
907
+ If a view's constraints specify a static size, with a greater priority than the view's intrinsic size resistances, the intrinsic size of that view will no longer be measured.
908
+
909
+ When an immediate layout pass is scheduled while there is already a pending layout pass, the pending layout pass is cancelled as the immediate pass will occur faster. This also reduces the number of unnecessary layout passes.
910
+
911
+ Immediate layout passes now use `async/await` instead of `window.postMessage(_)` to move the layout processing into the next event loop which should decrease the chances of the layout pass occurring after invalidated content has had a chance to draw itself using the old layout.
912
+
913
+ When the `layout()` method is invoked, all scheduled layout passes are cancelled.
914
+
915
+ Whenever a layout animation is set up for a view hierarchy, subsequent layout invalidations will be delayed until after that animation finishes. Because of how layout invalidations are now queued, regardless of how many times a view's layout has been invalidated during this time, only a single layout pass will occur at the end of the animation.
916
+
917
+ View will now correctly re-evaluate constraints when changing the compression or expansion resistance after the initial layout pass.
918
+
919
+ The unused `isManagingLayout` property has been removed.
920
+
921
+ The unused `layoutSubviews()` method has been deprecated.
922
+
923
+
924
+ ### **`BMViewLayoutQueue`**
925
+
926
+ Whenever several view hierarchies register pending layout passes independently, the first view to start a layout pass will now cause all other pending views to run a layout pass as well, cancelling their scheduled layout passes. Additionally, whenever layout for several views occurs in this way, for each view, the layout pass is split into several phases and all views will await for all other views to reach the same phase before starting it. The result is that DOM reads and writes are now batched together across all views instead of each view independently modifying and reading the DOM, which is especially important for layout passes that would otherwise quickly occur one after another, such as in a scrolling collection view.
927
+
928
+ A new `BMViewLayoutQueue` class is now available to allow a limited control over this behaviour. Layout queues can be created via the static `layoutQueue()` method.
929
+
930
+ A new `layoutQueue` property may be set on views. By default, the value of this property is a global queue shared by most views. This property controls which views perform layout passes in sync.
931
+
932
+
933
+
934
+ ### **Responsive design**
935
+
936
+ View now supports responsive design in a manner similar to media queries in CSS. The newly added `BMViewport` and `BMSizeClass` classes are used to facilitate this behavior.
937
+
938
+ For view itself, the only variable aspects with regards to responsive design are visibility, opacity and CSS classes. To support this, view has several new methods:
939
+ * `setIsVisible(_, {forSizeClass})`, `removeIsVisibleVariationForSizeClass(_)` and `hasVisibilityVariationForSizeClass(_)` are used to control the visibility variation.
940
+ * `setOpacity(_, {forSizeClass})`, `removeOpacityVariationForSizeClass(_)` and `hasOpacityVariationForSizeClass(_)` are used to control the opacity variation.
941
+ * `setCSSClass(_, {forSizeClass})`, `removeCSSClassVariationForSizeClass(_)` and `hasCSSVariationForSizelass(_)` are used to control the CSS class variation.
942
+
943
+
944
+ ### **`BMViewConstraintAttribute`**
945
+
946
+ A new `BMViewConstraintAttribute` class is now available. It cannot be created manually, but each view object now has a property of this type for each available layout attribute. This class makes it easier to create layout constraints, with a much more succint syntax than the usual layout constraint factory methods.
947
+ For example, a constraint is typically created by setting all of its attributes using the factory method `constraintWithView`:
948
+ ```js
949
+ let constraint = BMLayoutConstraint.constraintWithView(sourceView, {attribute: BMLayoutAttribute.Left, toView: targetView, secondAttribute: BMLayoutAttribute.Left, relatedBy: BMLayoutConstraintRelation.LessThanOrEquals, constant: 8, multiplier: 2});
950
+ ```
951
+
952
+ That syntax is quite verbose and can be difficult to read due to the large number of arguments, so constraint attributes can be used to simplify it:
953
+ ```js
954
+ let constraint = sourceView.left.lessThanOrEqualTo(targetView.left, {times: 2, plus: 8});
955
+ ```
956
+
957
+ ## BMLayoutConstraint
958
+
959
+ Resolved an issue where changing a constant of a required constraint would crash the layout solver, if the new constant caused the layout to become unsatisfiable. View will now correctly discard unsatisfiable constraints that result from changing a constraint's constant.
960
+
961
+ The `constraintWithSerializedConstraint(_)` static method will now default to the `BMLayoutConstraint` class when a serialized constraint does not specify which class should be used.
962
+
963
+ A new `identifier` property is created and assigned to constraints upon creation. It can be used to uniquely identify constraint objects after being serialized and deserialized. When deserializing a constraint that didn't have an `identifier`, a new random one will be created and assigned to it.
964
+
965
+ Several new methods have been added to control the variations supported by constraints depending on size classes. Whenever any of these methods is invoked, if the new variation affects the layout in the current configuration, CoreUI will accordingly invalidate the layout. These methods are:
966
+ * `setConstant(_, {forSizeClass})`, `removeConstantVariationForSizeClass(_)` and `hasConstantVariationForSizeClass(_)` can be used to control the value of the `constant` property across configurations.
967
+ * `setPriority(_, {forSizeClass})`, `removePriorityVariationForSizeClass(_)` and `hasPriorityVariationForSizeClass(_)` can be used to control the value of the `priority` property across configurations.
968
+ * `setisActive(_, {forSizeClass})`, `removeIsActiveVariationForSizeClass(_)` and `hasIsActiveVariationForSizeClass(_)` can be used to control the value of the `isActive` property across configurations.
969
+
970
+ The new `affectsLayout` property is set to `YES` only when the constraint is included in layout operations for the current configuration. It is similar to how the `isActive` property behaves when there are no variations based on size classes, but is readonly.
971
+
972
+ ## Layout Variables
973
+
974
+ It is now possible to define global layout variables for layout constraints to use as their constant values. Layout variables are values that are often reused in layouts such as a standard spacing to use between elements or the height of toolbars. Layout variables also support variations based on size classes making it easier to adapt layouts for various screen sizes.
975
+
976
+ The `BMView` class has several new static methods to manage these layout variables:
977
+ * `registerLayoutVariableNamed(_, {withValue})` is used to create a layout variable and define a value for it.
978
+ * `setLayoutVariableValue(_, {named, inSizeClass})` can be used to create a variation for a layout variable.
979
+ * `removeVariationForLayoutVariableNamed(_, {inSizeClass})` can be used to remove a previously created variation for a layout variable.
980
+ * `unregisterLayoutVariableNamed(_)` can be used to remove a previously registered layout variable.
981
+
982
+ To use a layout variable as a constraint constant value, the name of the layout variable can be assigned to the `constant` property of the layout constraint. It is also possible prefix the name of the layout variable with a `-` sign to cause the constraint to use the negated value of the layout variable. Layout variables can be used as both the default value of the `constant` property or in any variation definition.
983
+
984
+ ## BMLayoutGuide
985
+
986
+ Layout guide now supports touch events.
987
+
988
+ ## BMLayoutEditor
989
+
990
+ Layout editor now supports touch interfaces.
991
+
992
+ Resolved an issue in which the layout editor would not show the correct relation sign for a selected constraint.
993
+
994
+ Improved the performance of the animation that runs when toggling the visibility of the view hierarchy tree and the settings sidebar.
995
+
996
+ Improved the fidelity of the animation that runs when opening or closing the layout editor.
997
+
998
+ The layout editor now includes support for defining, using and removing layout variables and their variations.
999
+
1000
+ Simplified the appearance of constraints by hiding subview constraints under a disclosure control; views that are more likely to affect a superview's
1001
+ size and position are now more likely to appear by default. Inactive constraints are also placed under a disclosure control. When these disclosure controls are opened, the associated constraints are also drawn in the preview area.
1002
+
1003
+ Layout editor now supports constraint and view variations for several built-in size classes.
1004
+
1005
+ The `Remove Constraints` button now deactivates constraints instead and only those constraints that affect a view and its superviews. Holding control, option/alt and/or shift switches this button between affecting all constraints affecting the view, removing instead of deactivating constraints or entirely resetting the layout.
1006
+
1007
+ A new `createAdditionalSettingsForConstraint(constraint, {withReferenceView, inContainer})` method can now be overriden by subclasses to create additional custom settings for a selected constraint.
1008
+
1009
+ A new `layoutVariableProvider` property may now be set on layout editors. This represents the source of layout variables that may be used within the current view hierarchy.
1010
+
1011
+ ## BMMenu
1012
+
1013
+ A new `BMMenu` class is available that can be used to create and display popup menus.
1014
+
1015
+ ## BMJQueryShim
1016
+
1017
+ A new `BMJQueryShim` class is now available. Its purpose is to allow CoreUI to work without jQuery.
1018
+
1019
+ Initially, CoreUI assumed jQuery was always available because it was only meant to run with Thingworx. Because of that, jQuery wrappers were used in a few places instead of regular DOM nodes, however, only a few methods of jQuery were actually used (such as `css`, `width` and `height`) but those methods could easily map directly to standard DOM methods with no change in functionality.
1020
+
1021
+ In essence, CoreUI used jQuery without actually taking advantage of it and this lead to a requirement of including jQuery in order to use CoreUI for no benefit.
1022
+
1023
+ Now, the `BMJQueryShim` class is used in place of jQuery wrappers wherever they existed previously and simply map the jQuery calls to standard DOM calls. **This change is breaking** for implementations that previously relied on the jQuery objects used by CoreUI as the shim object is not compatible with jQuery wrappers beyond the few methods used by CoreUI.
1024
+
1025
+ ## BMCollectionViewCell
1026
+
1027
+ `BMCollectionViewCell` is now a subclass of `BMView`.
1028
+
1029
+ A new `boundsDidTransitionToBounds(_)` method that may be overriden on subclasses of cell is repeatedly invoked by CoreUI during animated size changes. Subclasses can override this method to improve the fidelity of the animation. Note that if the content of the cell is a view hierarchy, animated size changes will trigger an accompanying animated layout update by default without repeatedly triggering layout passes. `boundsDidTransitionToBounds(_)` should instead be used for non-view contents that CoreUI does not handle automatically.
1030
+
1031
+ ## BMCollectionView
1032
+
1033
+ Collection View is now a subclass of `BMView`.
1034
+
1035
+ Resolved an issue that caused collection view to retain stale attribute caches after an animated layout change.
1036
+
1037
+ Resolved an issue that sometimes caused cells to quickly flash in incorrect positions at the beginning of a drag operation.
1038
+
1039
+ Improved the fidelity of the animation that runs when transferring cells from one collection view to another.
1040
+
1041
+ Collection View now creates a specialized layout queue for its cells and assigns it to them upon creation. To improve scrolling performance while minimizing visual artifacts, collection view may drain its layout queue at various key moments.
1042
+
1043
+ A new `updateEntireDataWithCompletionHandler()` method is now available. It behaves the same as `updateEntireDataAnimated(_, {updateLayout, completionHandler})`, but the value of the `animated` parameter is implicitly set to `NO`, unless an animation context is active, in which case the data update will use the animation context's options to perform the update. The value of the `updateLayout` parameter will be set to `YES`.
1044
+
1045
+ `updateEntireDataAnimated(_, {updateLayout, completionHandler})` will use the current animation context's options if the `animated` parameter is set to `YES` and an animation context is active. This will also override any animation options provided by the delegate.
1046
+
1047
+ `setLayout(_, {animated, completionHandler})` and the `layout` property are now animatable when an animation context is active while they are invoked. If one is active, its options will be used instead of the default set or the ones returned by the delegate.
1048
+
1049
+ When a collection view's `frame` property is changed from within an animation context, a matching layout update animation will run in parallel if this change causes a layout invalidation. Addionally, collection view will now only compute the new layout once at the beginning of the animation instead of repeatedly as before.
1050
+
1051
+ Resolved a bug that would crash the collection view when using hidden cell attributes on a cell that was retained.
1052
+
1053
+ Resolved a bug with `scrollToCellAtIndexPath(_, {withVerticalGravity, horizontalGravity, animated})` that would cause collection view to scroll to an unexpected position if the `withVerticalGravity` parameter was not specified.
1054
+
1055
+ Resolved an issue that would permanently disable layout updates following an initial animated layout update.
1056
+
1057
+ Resolved an issue that caused collection view to behave unexpectedly when web animations were enabled.
1058
+
1059
+ Resolved an issue that caused drag & drop to fail to trigger if the mouse pointer left the cell's node before moving the distance required to trigger this behaviour.
1060
+
1061
+ Resolved an issue that could cause drag & drop to trigger without clicking on a cell, if a drag & drop was previously attempted but did not trigger because the mouse pointer had left the cell's node.
1062
+
1063
+ ### **Automatic cell sizes**
1064
+
1065
+ Collection view now has preliminary support for automatic cell sizes through several methods that may be leveraged by layout objects. These rely on the intrinsic size of the content that is displayed by the cell and require the use of layout constraints. Currently only flow layout supports this feature (in beta) and support from other layout types may roll out in the future.
1066
+
1067
+ `measuredSizeOfCellAtIndexPath(_)` can now be invoked to determine the preferred size that should be assigned to a cell so that its content fits without any clipping. When this method is invoked, collection view will retain the size, so that subsequent requests to obtain the measured size of the same cell will return the cached size instead of going through the whole process of rendering, laying out and measuring the cell.
1068
+
1069
+ `invalidateMeasuredSizeOfCellAtIndexPath(_)` can be invoked to clear out the measured size of a cell, forcing subsequent measurements to go through the process of laying out and measuring the cell.
1070
+
1071
+ `invalidateMeasuredSizeOfCells()` can be invoked to clear out all previous measurements.
1072
+
1073
+ `invalidateMeasuredSizeOfCellsWithBlock(_)` can be used to selectively clear out previous measurements.
1074
+
1075
+ ## BMCollectionViewLayout
1076
+
1077
+ A new method `constraintsForMeasuringCell(_, {atIndexPath})` may be overriden by layout objects to provide additional constraints that the cell should conform to during measurements. Layout subclasses can, for example, use this to define size limits that the measurement should not exceed or size preferrences through optional constraints. The default implementation returns an empty array.
1078
+ The constraints returned by this method should not be activated by the layout object. Collection View will handle activating, adding, inactivating and removing the constraints that are returned by this method.
1079
+
1080
+ Layout objects that support copying can now have their properties animated when an animation context is active. If the copy is guaranteed to behave the same as the source layout object, no additional implementation is required by layout objects to support this functionality.
1081
+
1082
+ A new `supportsCopying` property should overriden and set to `YES` for layout objects that support copying. The default value of this property is `NO`. Collection View will use the value of this property to determine if it can perform animated layout changes in certain cases.
1083
+
1084
+ A new `supportsStatefulCopying` property should be override and set to `YES` for layout objects that support stateful copying. The default value of this property is `NO`. Collection View will use the value of this property to determine if it can perform animated layout changes using a stateful copy instead of a regular copy, in order to avoid having to request a rebuild of the layout from the temporary copy.
1085
+
1086
+ A new `statefulCopy()` method can now be overriden by layout subclasses and should return a stateful copy of the layout object when implemented. Unlike a regular copy, a stateful copy is expected to also retain the internal state of the layout. When a stateful copy is created, collection view will assume that it can directly use the layout copy to request attributes without any additional preparation.
1087
+
1088
+ A new `beginUpdates()` method is now available on layout objects that support copying. This method should be used when a series of changes are expected to be applied to a layout object that each invalidate the layout. After this method is invoked, layout invalidations are temporarily suspended. The `applyUpdates()` method must be invoked to apply the changes and trigger the final layout invalidation.
1089
+ When animating layout properties, using this method pair is required to have the properties animate. In this case, `beginUpdates()` can be invoked at any point, but `applyUpdates()` must be invoked from within an animation context.
1090
+
1091
+ ## BMCollectionViewTransitionLayout
1092
+
1093
+ When requesting attributes from the transition layout, it will now first try to return the transition attributes for the requested cell, if available, otherwise it will default to returning the attributes from the new layout.
1094
+
1095
+ ## BMCollectionViewTableLayout
1096
+
1097
+ Table Layout has been deprecated in this release as all of its functionality and more can be achieved by using the flow layout. It will be removed in a future version of CoreUI.
1098
+
1099
+ ## BMCollectionViewFlowLayoutGravity
1100
+
1101
+ Two new gravities are now available for flow layout:
1102
+ * `Start`: Aligns cells to the start of the row. This represents the left of the row in a vertical orientation and the top of the row in a horizontal one.
1103
+ * `End`: Aligns cells to the end of the row. This represents the right of the row in a vertical orientation and the bottom of the row in a horizontal one.
1104
+
1105
+ ## BMCollectionViewFlowLayoutAlignment
1106
+
1107
+ The `Top` and `Bottom` alignment options have deprecated and replaced with `Start` and `End` respectively to support horizontal orientation as well.
1108
+
1109
+ ## BMCollectionViewFlowLayoutOrientation
1110
+
1111
+ A new enum is now available to specify the orientation for flow layout:
1112
+ * `Vertical`: Aligns cells left to right in rows, and each row below the previous one
1113
+ * `Horizontal`: Aligns cells top to bottom in rows, and each row to the right of the previous one
1114
+
1115
+ ## BMCollectionViewFlowLayout
1116
+
1117
+ Flow layout will no longer generate non-integer positions when the gravity is set to `.Center`.
1118
+
1119
+ Resolved an issue that caused flow layout to not correctly center its contents when the content gravity was set to `.Center` and a non-zero `rowSpacing` was used.
1120
+
1121
+ A new `maximumCellsPerRow` property can now be set on flow layout. When this property is set to a strictly positive number, flow layout will ensure that each row will contain no more than that number of cells.
1122
+
1123
+ A new `orientation` property can now be set on flow layout and takes values from the `BMCollectionViewFlowLayoutOrientation` enum.
1124
+
1125
+ ### **Automatic Cell Sizes**
1126
+
1127
+ **`[BETA]`** A new `expectedCellSize` property can now be set on flow layout. When set to a size, this will cause flow layout to use the automatic cell sizing information provided by collection view to lay out the cells. To maintain performance, flow layout will only measure the cells that are initially visible on-screen and then subsequently measure new cells as they become visible. For cells that have never been on-screen and for the initial layout pass, the value of the `expectedCellSize` will be used to build an approximate initial layout.
1128
+
1129
+ Note that whenever the data set is updated, flow layout will still have to recompute the layout up to the current scroll position. While collection view caches the measured sizes of cells which should speed up this process, if collection view is scrolled to the end of the data set and a large number of new items are inserted at the beginning of the data set, flow layout will have to individually measure each new cell and this can lead to long delays on the UI thread during which the page will appear to have frozen.
1130
+
1131
+ ## BMCollectionViewDataSet
1132
+
1133
+ Data sets can now optionally implement a new `identifierForIndexPath(_)` method that returns a string identifier that uniquely identifies the object to which the given index path points. This is used to optimize certain calculations performed by collection view, including automatic cell sizes.
1134
+
1135
+ ## BMWindow
1136
+
1137
+ `BMWindow` is now a subclass of `BMView`.
1138
+
1139
+ When creating a window, it is now possible to mark it as non-modal by specifying the `modal` parameter. When a window is non-modal, it will be possible to interact with content that is not obstructed by the window. Note that the default action of clicking outside to close the window will also be disabled in this case, requiring a custom close mechanism to be provided.
1140
+
1141
+ Windows that are not modal can now be moved and resized.
1142
+
1143
+ A new `becomeKeyWindow()` method can be invoked on windows to bring them to front in a multi-window environment. A new `resignKeyWindow()` method can be used to cause the key window to become inactive.
1144
+
1145
+ Two new `minimizeAnimated(_)` and `restoreAnimated(_)` methods can now be invoked on non-modal windows to minimize or restore them.
1146
+
1147
+ Two new `minimizeAllAnimated(_)` and `restoreAllAnimated(_)` static methods can be used to minimize or restore all non-modal windows.
1148
+
1149
+ Two new `hide()` and `show()` methods are now available and can be used to hide or a non-modal window.
1150
+
1151
+ Two new `hideAll()` and `showAll()` static methods can be invoked to hide or show all non-modal windows.
1152
+
1153
+ A new `enterShowcase()` static method can now be invoked to make it easier to select between non-modal windows. A new `exitShowcase()` static method can be invoked to exit showcase mode.
1154
+
1155
+ ## BMMonacoCodeEditor
1156
+
1157
+ The monaco code editor will no longer emit `"use strict";` when transpiling TypeScript code.
1158
+
1159
+ # 2.1.1
1160
+
1161
+ ## BMCoreUI
1162
+
1163
+ Resolved a build issue that caused some of the third-party license comments to be removed in minified release builds.
1164
+
1165
+ ## BMCollectionView
1166
+
1167
+ Resolved an issue where collection view would disable selection on cell contents when drag & drop was disabled. To combat this, collection view will now ask the delegate if it can start a drag and drop operation prior to actually being ready to start it. As such it is no longer guaranteed that returning `YES` from the delegate method `collectionViewCanMoveCell(_, _, {atIndexPath})` will cause collection view to begin a drag & drop operation.
1168
+
1169
+ Collection View will no longer start drag & drop operations while a current drag & drop operation is in progress.
1170
+
1171
+ # 2.1
1172
+
1173
+ CoreUI now requires a browser with support for `async/await`, `Promise` and other modern features.
1174
+
1175
+ ## BMCodeEditor
1176
+
1177
+ A new `requiresTranspilation` getter should be overriden by subclasses and return `YES` when the current language requires transpilation in order to be used by the browser.
1178
+
1179
+ A new `transpiledCode()` async method should be overriden by subclasses and return the transpiled code when `requiresTranspilation` returns `YES`. Note that it is required for the overriden method to be async as well.
1180
+
1181
+ A new `setImports(_)` method should be overriden by subclasses that support autocompletion is used to set a flat file of external imports that are referenced by the
1182
+ code editor.
1183
+
1184
+ A set of similar new functions are available for specific library files as well:
1185
+ * `addExternalLibraryNamed(_, {code})` is used to import an external library file.
1186
+ * `removeExternalLibraryNamed(_)` is used to remove a previously added external library file.
1187
+ * `hasExternalLibraryNamed(_)` is used to check for the existence of an external library file.
1188
+
1189
+ ## BMMonacoCodeEditor
1190
+
1191
+ Enabled support for TypeScript.
1192
+
1193
+ ## BMLayoutEditor
1194
+
1195
+ Layout editor will no longer show disclosure triangles for views without subviews.
1196
+
1197
+ Resolved an issue in which labels would be cut-off and leak into other elements.
1198
+
1199
+ Dragging a view with the left mouse button will now temporarily displace its frame. This makes it easier to move views out of the way when creating contraints.
1200
+ Note that the frame is only displaced until the next layout pass occurs. If that view has a well defined layout then creating, modifying or deleting contraints and resizing the window will cause the view to move back to its correct location.
1201
+
1202
+ # BMCoreUI 2
1203
+
1204
+ ![BMCoreUI2](http://roicentersvn.ptcnet.ptc.com/BogdanMihaiciuc/BMCoreUI/raw/branch/master/ui/BMCoreUI/CoreUI2@2x.png =128x128)
1205
+
1206
+ Release versions of CoreUI are now transpiled from ES7 down to ES5. As a result, development builds will no longer work on legacy browsers that lack ES6/7 support.
1207
+ **In the future, CoreUI may drop support for legacy browsers.**
1208
+
1209
+ CoreUI now supports automatic updates via http://roicentersvn.ptcnet.ptc.com/BogdanMihaiciuc/BMUpdater
1210
+
1211
+ CoreUI 2 is a major release including a large number of fixes and improvements for `BMCollectionView`, `BMCodeEditor` and many of the primitive classes. It also adds interoperability with TypeScript through a definitions file that lets TypeScript projects use CoreUI features without having to opt-out of type safety. Finally it adds a new module that allows developers to lay out their pages using layout constraints that specify positioning and sizing relationships between elements on the page.
1212
+
1213
+ ## TypeScript
1214
+
1215
+ CoreUI now provides a definitions file allowing CoreUI classes to be used as first-party TypeScript types. All CoreUI types are available for use in TypeScript. The definitions file also supports strict-null checking.
1216
+
1217
+ Two new `@BMAnimatable` and `@BMAnimatableNumber` decorators are now available in TypeScript projects. These may be applied to properties to easily make them animatable as long as they are numbers or types that implement the `BMAnimating` interface. For animatable properties, classes need only specify what happens when the property is updated; CoreUI handles storage, detecting animation contexts and setting up value interpolation.
1218
+
1219
+ **Example:**
1220
+ ```ts
1221
+ class MyClass {
1222
+ // The annotation marks the backgroundColor property as animatable with CoreUI.
1223
+ // Setting this property while an animation context is active will cause this
1224
+ // change to be animated without any other code required
1225
+ @BMAnimatable
1226
+ set backgroundColor(value: BMColor) {
1227
+ document.body.style.backgroundColor = value.RGBAString;
1228
+ }
1229
+
1230
+ setBackgroundColorAnimated(color: BMColor): void {
1231
+ BMAnimateWithBlock(_ => this.backgroundColor = color, {duration: 300});
1232
+ }
1233
+ }
1234
+ ```
1235
+
1236
+ ## BMAnimationController
1237
+
1238
+ The new animation controller class makes it easier to integrate with the CoreUI animation engine. Whereas the previously animation subscribers made this possible, they required a lot of boilerplate and provided very little functionality of their own. Note that CoreUI still uses *Velocity.js* as its animation backend.
1239
+
1240
+ Animation subscribers continue to exist in this release; the new animation controllers implement the `BMAnimationSubscriber` interface and take their place, so instances cannot use both for the same animation.
1241
+
1242
+ Animation subscribers provide methods to automatically interpolate values or even update their target's properties. They work with standard CSS/Velocity.js properties, numeric properties, `BMAnimating` properties or even arbitrary properties.
1243
+
1244
+ While decorators are the easiest way to integrate with CoreUI animations, animation controllers provide an easy to use alternative, with relatively little boilerplate code required.
1245
+
1246
+ The new animatable decorators make use of animation controllers behind the scenes.
1247
+
1248
+ **Example:**
1249
+ ```ts
1250
+ class MyClass {
1251
+ let _myProperty: number;
1252
+ get myProperty(): number {
1253
+ return this._myProperty;
1254
+ }
1255
+ set myProperty(value: number) {
1256
+ if (let animation = BMAnimationContextGetCurrent()) {
1257
+ // If animation context is active obtain the animation controller for this object
1258
+ let controller = animation.controllerForObject(this, {node: document.body});
1259
+ // Then use it to register an animation for the myProperty property
1260
+ controller.registerOwnProperty('myProperty', {targetValue: value});
1261
+ }
1262
+ else {
1263
+ // Otherwise just set the value
1264
+ this._myProperty = value;
1265
+ }
1266
+ }
1267
+ }
1268
+ ```
1269
+
1270
+ Additionally, `BMAnimateWithBlock()`, `BMAnimationApply()` and `BMAnimationApplyBlocking()` will now each return a promise that resolves when the animation finishes.
1271
+
1272
+ Animation controllers also provide a promise that may be awaited on by the objects for which they have been created. These resolve when the portion of the animation that the controller has set up finishes, but not necessarily when the entire animation has finished.
1273
+
1274
+ ## BMView
1275
+
1276
+ `BMView` is a new class available in `CoreUI 2`. It acts as a CoreUI extension point for regular DOM nodes. Views are strongly linked to the DOM node they are created with and manage various aspects of its lifecycle, depending on which view features are enabled. Views are created by invoking the `BMView.viewForNode(_)` or `BMView.view()` static methods. The first one creates a view from an existing node whereas the second method creates both a new node and view for it.
1277
+
1278
+ In this release, the main functionality of views is the ability to perform layout operations by specifying constraints between themselves. This is primarily done by solving the layout constraints using *kiwi.js*.
1279
+
1280
+ An important feature of views is their ability to specify an intrinsic size that represents the minimal size a view should have so that all of its content is visible. For views whose intrinsic size can be directly measured based on its DOM node, CoreUI can automatically determine the intrinsic size, but subclasses with more complex contents may provide custom values for the intrinsic size. These intrinsic sizes act as inputs for the CoreUI layout engine, allowing it to output a layout that is optimized for the contents of all of its views.
1281
+
1282
+ As with most CoreUI types, the layout performed by `BMView` is easily animatable from within an animation context.
1283
+
1284
+ **Example:**
1285
+ ```ts
1286
+ function changeLayout(): void {
1287
+ let myView = BMView.viewForNode(document.body.firstChild);
1288
+ BMAnimateWithBlock(_ => {
1289
+ // Set the intrinsic size for myView. This normally causes a layout
1290
+ // update to be scheduled before the next frame is drawn.
1291
+ myView.intrinsicSize = BMSizeMake(500, 300);
1292
+ // But since we want this change to be animated, we tell
1293
+ // the view hierarchy to perform an out-of-order layout pass.
1294
+ // Since this happens in an animation block, the views will smoothly
1295
+ // transition to their new layout attributes.
1296
+ myView.layout();
1297
+ }, {duration: 300});
1298
+ }
1299
+ ```
1300
+
1301
+ // TODO: `BMCollectionViewCell` and `BMCollectionView` are now subclasses of `BMView`. If collection view is now part of a view hierarchy whose layout is managed by CoreUI, invoking the `resized()` is no longer required.
1302
+
1303
+ ## BMScrollView
1304
+
1305
+ `BMScrollView` is a subclass of view that translates its scroll position into constraints that other views can use. It makes it possible to use constraints to create effects such as parallax scrolling or even letting views outside of the scroll view position themselves relative to the scrolled position of views within the scroll view.
1306
+
1307
+ ## BMLayoutGuide
1308
+
1309
+ `BMLayoutGuide` is a subclass of view that can be dragged and translates its dragged position into constraints relative to its superview. This makes it possible to use constraints to create expandable panels, movable content or other kinds of interactive behaviour.
1310
+
1311
+ ## BMLayoutConstraint
1312
+
1313
+ A new `BMLayoutConstraint` class is now available that makes it possible to specify a layout constraint between two views or a view and a constant value. These are then used by the CoreUI layout engine to compute a layout that satisfies all of the constaints affect the views within a view hierarchy.
1314
+
1315
+ A layout constraint is a mathematical equality or inequality between two layout attributes on a view that takes the form of :
1316
+ ```
1317
+ view1.attribute1 = multiplier * view2.attribute2 + constant
1318
+ ```
1319
+ where the equals sign can be replaced with an inequality sign as needed.
1320
+ Note that despite looking like an assignment statement, the constraint expression is a mathematical equation and the layout
1321
+ system may choose to modify either side (or even both) of the equation to fulfill the constraint's requirements.
1322
+
1323
+ There are four types of layout constraints: vertical position, horizontal position, width and height.
1324
+ Each of them controls a specific aspect of a view's layout. A view must have constraints which clearly define all four of those
1325
+ attributes for the layout system to be able to size it and position it correctly.
1326
+ Additionally, constraints having an attribute of a type on the left hand side of the equation can only have an attribute of the same type on the right hand side.
1327
+ In other words, for example, a view's vertical positioning can only depend on the vertical positioning of another view and not on its horizontal positioning or its size.
1328
+ For views that have intrinsic sizes, the sizing constraints are optional as the intrinsic sizes of the views will be used by default as size constraint inequalities.
1329
+ In addition, it is also possible to specify a constraint for a view's aspect ratio by linking its width to its own height.
1330
+ Similarly, it is also possible to specify a constraint that makes a view's aspect ratio depend upon the aspect ratio of another view.
1331
+ When creating an aspect ratio constraint, this may only be to another view's aspect ratio.
1332
+
1333
+ Constraints may also have a priority value assigned to them. All constraints with a priority value lower than `BMLayoutConstraintPriorityRequired` are considered
1334
+ optional. The layout system will try to fulfill them, but it does not guarantee that it will do so and optional constraints may be ignored if it is needed to do so to fulfill
1335
+ the required constraints. When an optional constraint cannot be fulfilled, the layout system may nevertheless attempt to change the values of the attributes so that they are
1336
+ as close as possible to fulfill the optional constraint without breaking the required constraints.
1337
+
1338
+ ## BMLayoutEditor
1339
+
1340
+ To make defining constraints easier, a `BMLayoutEditor` class has been added in CoreUI 2. This subclass of `BMWindow` is initialized with the root of a view hierarchy and opens a full-screen editor that allows developers to codelessly define layout constraints using only drag-and-drop.
1341
+
1342
+ While the layout editor modifies constraints on the view hierarchy directly, the constraints created by this editor can also be exported as a definitions JSON.
1343
+
1344
+
1345
+
1346
+ ## BMCoreUI
1347
+
1348
+ `BMCopyProperties` now correctly handles the target object being set to undefined.
1349
+
1350
+ `BMRect` has a new `rectWithInset` method that returns a copy of the rect that is inset with a given inset object.
1351
+
1352
+ `BMInset` has the new static method `insetWithEqualInsets` and global constructor `BMInsetMakeWithEqualInsets` that constructs a new inset with the same value for all four edges.
1353
+
1354
+ `BMColorMakeWithString(_)` will now accept an undefined or empty string. In this case it will return a black transparent color.
1355
+
1356
+ Custom scrollbars used by CoreUI will no longer shrink below 32 pixels.
1357
+
1358
+ Whenever using custom scrollbars, CoreUI will now smoothly animate scroll events. It will also enable momentum scrolling for mouse wheels.
1359
+
1360
+ Ripple effects will now disappear correctly when the pointer moves outside of the element.
1361
+
1362
+ ## BMAnimation
1363
+
1364
+ Resolved an issue that would cause the animation to not run if a custom queue was specified.
1365
+
1366
+ `BMAnimationApply`, `BMAnimationApplyBlocking` and `BMAnimateWithBlock` will now each return a promise that resolves when the animation finishes. For animations that affect multiple elements with varying delays, durations or strides, the returned promise will resolve when all sub-animations are finished.
1367
+
1368
+ ## BMCell
1369
+
1370
+ `BMCell` has been renamed to `BMCollectionViewCell` to better match is functionality. The old `BMCell` symbol temporarily exists as an alias to `BMCollectionViewCell` but is deprecated. Related global symbols have also been renamed appropriatedly and similarly still have the old symbol names as aliases.
1371
+
1372
+ `BMCollectionViewCell` can now be subclassed. For more information, refer to the documentation for `BMCollectionViewCell` and its methods. To help with subclassing, the cell class now includes several additional methods that do nothing in the base class but may be overriden by subclasses to customize the cell's behaviour.
1373
+
1374
+ ## BMCellAttributes
1375
+
1376
+ `BMCellAttributes` has been renamed to `BMCollectionViewLayoutAttributes` to better match its functionality. The old `BMCellAttributes` symbol temporarily exists as an alias to `BMCollectionViewLayoutAttributes` but is deprecated. Related global symbols have also been renamed appropriatedly and similarly still have the old symbol names as aliases.
1377
+
1378
+ The `hidden` property has been renamed to `isHidden`.
1379
+
1380
+ When attributes with `isHidden` set to YES are applied to a cell, the cell will be hidden from the layout.
1381
+
1382
+ ## BMCollectionViewLayout
1383
+
1384
+ Collection view layouts may now return hidden attributes by setting the `isHidden` property of the attributes to `YES`.
1385
+
1386
+ It is recommended to only return hidden attributes from `attributesForCellAtIndexPath(_)` and `attributesForSupplementaryViewWithIdentifier(_, {atIndexPath})`, skipping them when returning attributes from `attributesForElementsInRect(_)`. Nevertheless, collection view will appropriately handle hidden attributes returned from `attributesForElementsInRect(_)`.
1387
+
1388
+ The layout type has a new method `rectWithScrollingPositionOfCellAtIndexPath(_)` that is invoked by the collection view to determine the position it should scroll to in order to reveal the cell at a specific index path. Layout subclasses may optionally override this method in order to provide custom locations for cells instead of relying on the current attributes returned by `attributesForCellAtIndexPath(_)`.
1389
+
1390
+ The new `rectWithScrollPositionOfSupplementaryViewWithIdentifier(_, {atIndexPath})` is used in a similar manner for supplementary views.
1391
+
1392
+ Layouts may now specify snapping offsets for the collection view. When a layout returns `YES` from the `snapsScrollPosition` getter, the collection view will periodically request snapping offsets from the layout by invoking the `snappingScrollOffsetForScrollOffset(_, {withVerticalDirection, horizontalDirection})` method, passing in the terminal scrolling offset and scrolling directions. Layout objects that support snapping should override that method and return the appropriate offset to which the collection view should snap.
1393
+
1394
+ A new `preferredScrollOffsetForTransitionFromLayout(_, {withOffset})` may optionally be overriden by layout subclasses and allows the layout to customize the scroll offset when collection view transitions from its current layout to that layout. The default implementation returns the result of invoking `preferredScrollOffsetWithOffset(_)`.
1395
+
1396
+ ## BMCollectionViewMasonryLayout
1397
+
1398
+ // TODO: The masonry layout will now supply the correct coordinates when `scrollToCellAtIndexPath(_)` is used on the collection view.
1399
+
1400
+ ## BMCollectionViewStackLayout
1401
+
1402
+ A new stack layout type is available for use.
1403
+ The stack layout is a vertically scrolling layout that presents cells a stack, where the current cell appears above the other cells.
1404
+ In the stack layout, previous cells appear behind the current cell, while upcoming cells are hidden.
1405
+
1406
+ When scrolling in the stack layout, the scroll position will always snap back to fully show a single cell.
1407
+
1408
+ The stack layout does not support sections or supplementary views.
1409
+
1410
+ ## BMCollectionViewTileLayout
1411
+
1412
+ A new tile layout type is available for use.
1413
+
1414
+ The tile layout tries to position cells wherever there is space for them within their section's area, favoring spaces that are closer to the top and left sides of their respective sections. Because cells can have arbitrary sizes and this might cause the final layout to appear dissonant, it offers several options to help with the positioning:
1415
+ - `spacing` is a numeric property that controls the minimum spacing between cells.
1416
+ - `gridSize` is a numeric property that acts as a quantum size unit for the cells, also taking the value of the `spacing` property into account. It guarantees that regardless of the cell size reported by the collection view's delegate, the layout will use the closest multiple of the `gridSize` for the final layout, adding in values of `spacing` for multipliers greater than one. For example, with the `gridSize` set to `32` and the spacing set to `16`, a cell with a reported width of `64` will end up with a final width of `80`, because the closest multiple of the `gridSize` is 2 and there would be one space fitting between two sizes.
1417
+
1418
+ As the tile layout can be computationally intensive, it is not recommended for data sets where sections contain a large amount of items. Additionally, using sufficiently large values for `spacing` and `gridSize` may also help with performance as the tile layout is then able to eliminate certain gaps in the resulting layout which would be too small for any cells to be placed there.
1419
+
1420
+ The tile layout can optionally generate supplementary views for headers, footers and an empty view when there is no content in the collection view.
1421
+
1422
+ ## BMCollectionView
1423
+
1424
+ The `scrollOffset` property is now read/write and animatable.
1425
+
1426
+ Collection view will now take the `isHidden` property of attributes into account when laying out cells. Hidden cells behave different from regular cells in the following ways:
1427
+ - Cells that are hidden by the layout and not retained by any external source are removed from the layout and not rendered.
1428
+ - Cells that are hidden but retained by an external source will continue to appear in the layout, but will be visually hidden. In this case, the cell's position in the DOM is not guaranteed to match the position of its layout attributes.
1429
+ - When assigning hidden cell attributes to a visible cell during an animation, the cell will animate to the target attributes and will be made hidden when the animation ends.
1430
+ - When assigning visible cell attributes to a hidden cell during an animation, the cell will be made visible, then transition from the source attributes to the given attributes.
1431
+
1432
+ When the layout object provides a new scroll offset for animated data updates, the scrolling animation will now use the same animation options as the data update.
1433
+
1434
+ Fixed an issue that would cause layout assignment to fail when using the property syntax instead of the `setLayout(_, {animated})` method.
1435
+
1436
+ Collection view will no longer run the intro animation on bound cells that are not strictly in the visible bounds.
1437
+
1438
+ A new `cellClass` property can now be modified on the collection view. This controls the class from which new cells are instantiated. This property should be set to a class that extends `BMCollectionViewCell`. When any class other than the default is used for a cell, collection view will no longer request the contents of the cell from the data set object, instead the custom subclass is expected to create and manage its own contents.
1439
+
1440
+ The new `registerCellClass(_, {forReuseIdentifier})` and `registerSupplementaryViewClass(_, {forReuseIdentifier})` may be used to register different subclasses for each specific reuse identifier. When `dequeueCellForReuseIdentifier(_)` and `dequeueCellForSupplementaryViewWithIdentifier(_)` are used, collection view will return a cell of the appropriate class. When there is no class registered for that specific reuse identifier, collection view will return a cell of the default `cellClass` class.
1441
+
1442
+ `updateEntireDataAnimated(_), {refreshLayout, completionHandler})` and `setLayout(_, {animated})` will now both return a promise that resolves when the operation completes. This makes it possible to await on these operations from async functions.
1443
+
1444
+ Resolved an issue that caused scrolling to not be animated during an animated data update when not using custom scrolling.
1445
+
1446
+ Resolved an issue that would cause scrolling in nested collection views to scroll both collection views at the same time.
1447
+
1448
+ Resolved an issue with animated layout updates that caused the scrolling offset to reset to the beginning of the content.
1449
+
1450
+ Resolved an issue with animated layout updates that caused cells to not be released properly.
1451
+
1452
+ ## Drag & Drop
1453
+
1454
+ Collection View now supports drag & drop as an alternative way to manipulate the data it displays. This feature requires that the collection view data set is able to respond to requests to add, move and remove items. This feature can enable several behaviours:
1455
+ * Dragging items from the collection view in order to change their positions
1456
+ * Dragging items outside the collection view to remove them
1457
+ * Dragging items from a collection view onto another collection view which will move or copy the items into that collection view.
1458
+
1459
+ On devices with a mouse, a drag & drop interaction is initiated by clicking and dragging on a collection view cell. On touch-based devices, this interaction is initiated by long pressing on a cell until a badge appears on the top-left corner of the cell. At that point, the user can move their finger to continue dragging the cell. Whenever the user begins dragging a selected cell, all of the other selected cells will be included in the drag operation as well.
1460
+
1461
+ Most of the implementation details are handled by Collection View, however the behaviour of this interaction can be controlled by the delegate.
1462
+
1463
+ ## BMCollectionViewDataSet
1464
+
1465
+ `contentsForCellWithReuseIdentifier(_)` and `contentsForSupplementaryViewWithIdentifier(_)` have been deprecated in favor of using custom cell classes. The current version of collection view will still invoke these methods when using the default cell class.
1466
+
1467
+ `updateCell(_, {atIndexPath})` and `updateSupplementaryView(_, {withIdentifier, atIndexPath})` have been deprecated and are now optional. The current version of collection view will continue to invoke these methods when implemented during data updates, but it is recommended to update visible cells manually when their contents change instead.
1468
+
1469
+ For data sets that support manipulating contents via drag & drop, the following methods must now be implemented:
1470
+ * `moveItemFromIndexPath(_, {toIndexPath})` is invoked when an item should move.
1471
+ * `moveItemsFromIndexPaths(_, {toIndexPath})` is invoked when several items should move.
1472
+ * `removeItemsAtIndexPaths(_)` is invoked when one or more items should be removed.
1473
+ * `insertItems(_, {toIndexPath})` is invoked when the data set should accept the items from a different collection view.
1474
+
1475
+ In all of these cases, the data set is required to implement the methods but not necesarrily to actually perform the requested actions. For example, the data set is free to only import part of the items provided to `insertItems` or not move items at all from the `moveItemsFromIndexPath` method.
1476
+
1477
+ ## BMCollectionViewDelegate
1478
+
1479
+ Delegate objects may now implement any of the following methods:
1480
+ - `collectionViewDidResizeCell(_, _, {toSize})` is invoked after any cell is resized. The method will be invoked after any associated animations have finished running.
1481
+ - `collectionViewWillResizeCell(_, _, {toSize})` is invoked prior to any cell being resized. This method will be invoked before any associated animation begins.
1482
+ - `collectionViewCanMoveCell(_, _, {atIndexPath})` is invoked by Collection View prior to a drag & drop operation beginning. The delegate object is expected to return `YES` to let collection view initiate the operation or `NO` otherwise. Collection view will not initiate drag & drop operations if this method is not implemented.
1483
+ - `collectionViewWillBeginInteractiveMovementForCell(_, _, {atIndexPath})` is invoked by Collection View prior to starting a drag & drop operation.
1484
+ - `collectionViewCanTransferItemsAtIndexPaths(_, _)` is invoked by CoreUI to determine if the items at the given index paths can be transferred to another collection view.
1485
+ - `collectionViewTransferPolicyForItemsAtIndexPaths(_, _)` invoked to determine how to handle the transfer of the given items.
1486
+ - `collectionViewCanAcceptItems(_, _)` is invoked by CoreUI to determine if the collection view may accept items from another source.
1487
+ - `collectionViewAcceptPolicyForItems(_, _)` is invoked to determine how to handle the transfer of the given items.
1488
+ - `collectionViewCanRemoveItemsAtIndexPaths(_, _)` is invoked by collection view to determine if the items at the given index path can be removed by the drag & drop operation.
1489
+ - `collectionViewWillFinishInteractiveMovementForCell(_, _, {atIndexPath})` and `collectionViewDidFinishInteractiveMovementForCell(_, _, {atIndexPath})` are invoked at the end of the drag & drop operation.
1490
+
1491
+ # 1.0.55
1492
+
1493
+ ## BMCoreUI
1494
+
1495
+ A new `BMHTMLEntity` enum is available for use. It contains a list of commonly used HTML entities.
1496
+
1497
+ ## BMCollectionView
1498
+
1499
+ Fixed an issue which caused the `scrollToRect`, `scrollToCellAtIndexPath` and `scrollToSupplementaryViewWithIdentifier` methods to not correctly update the collection view's contents.
1500
+
1501
+ # 1.0.53
1502
+
1503
+ ## BMCellAttributes
1504
+
1505
+ Preliminary support for hidden cell attributes. This feature isn't functional yet.
1506
+ The cell attributes type now has a new property called `hidden` with a default value of `NO`. When this property is set to `YES` it marks the cell using those attributes as hidden. Hidden cells do not appear in the layout. As a further optimization, the collection may choose to not render hidden cells at all.
1507
+
1508
+ ## BMCollectionViewLayout
1509
+
1510
+ The layout type now supports four additional methods:
1511
+ - `finalAttributesForHidingCellAtIndexPath(_)` is invoked during layout or data updates for cells that become hidden. The default implementation returns the same attributes that layout normally returns for newly added cells.
1512
+ - `finalAttributesForHidingSupplementaryViewWithIdentifier(_, {atIndexPath})` is invoked during layout or data updates for supplementary views that become hidden. The default implementation returns the same attributes that layout normally returns for newly added supplementary views.
1513
+ - `initialAttributesForRevealingCellAtIndexPath(_)` is invoked during layout or data updates for cells that become visible. The default implementation returns the same attributes that layout normally returns for deleted cells.
1514
+ - `initialAttributesForRevealingSupplementaryViewWithIdentifier(_, {atIndexPath})` is invoked during layout or data updates for supplementary views that become visible. The default implementation returns the same attributes that layout normally returns for deleted supplementary views.
1515
+
1516
+ ## BMCollectionViewFlowLayout
1517
+
1518
+ Fixed an issue where the flow layout would assign non-integer sizes to cell attributes.
1519
+
1520
+ The `BMFlowLayoutAlignment` enum has an additional field called `Expand`. When this value is used for the flow layout alignment, all items will have their heights resized to fill the entire row height.
1521
+
1522
+ When using the `Expand` gravity, the flow layout will now add one additional pixel to the leftmost cells as needed to ensure that the entire row width is used.
1523
+
1524
+ When using the other gravities, the flow layout will now add additional pixels to the leftmost spacing areas to ensure that the entire row width is used.
1525
+
1526
+ ## BMCollectionView
1527
+
1528
+ The collection view will now use passive event listeners for scroll events.
1529
+
1530
+ Fixed an issue that caused the collection view bounds to move off-screen during updates and frame changes.
1531
+
1532
+ Fixed an issue that caused the collection view to invoke `collectionViewCellWasLongClicked(_, _, {withEvent})` for cells that were short clicked or tapped.
1533
+
1534
+ The new `scrollBarSize` property may be used to get the scrollbar size from the collection view. Unlike the global `BMScrollBarGetSize()` function, the collection view will return 0 from this property when using iScroll.
1535
+
1536
+ When using iScroll on touch devices, the scrollbars will now fade away when not in use.
1537
+
1538
+ # 1.0.38
1539
+
1540
+ ## BMCollectionView
1541
+
1542
+ The collection view will now allow events originating from `<label>` and `<a>` elements to reach their intended target.
1543
+
1544
+ ## BMCollectionViewFlowLayout
1545
+
1546
+ Fixed an issue in which the flow layout would not properly respond to frame changes.
1547
+
1548
+ # 1.0.36
1549
+
1550
+ ## BMCollectionViewFlowLayout and BMCollectionViewTableLayout
1551
+
1552
+ When the layout height exceeds the collection view's height, the table flow layouts will now take the scrollbar's size into account when laying out items when not using iScroll on the platforms where the scrollbar affects the collection view's usable size.
1553
+
1554
+ # 1.0.34
1555
+
1556
+ ## BMCollectionViewFlowLayout
1557
+
1558
+ The flow layout has a new property called `minimumSpacing`. When this is set to a positive number, the flow layout will guarantee that cells will have at least that spacing between them regardless of the selected gravity.
1559
+
1560
+ # 1.0.31
1561
+
1562
+ ## BMCollectionView
1563
+
1564
+ When performing a layout change while there is already an in-progress animated change, the collection view delay applying that layout until after the change is finished.
1565
+
1566
+ ## BMCollectionViewTransitionLayout
1567
+
1568
+ Fixed an issue which caused the transition layout to invoke methods on the collection view reference after it was cleared.
1569
+
1570
+ Fixed an issue which caused the transition layout to crash with an exception when requesting attributes from the target layout.
1571
+
1572
+ # 1.0.16
1573
+
1574
+ ## BMCollectionView
1575
+
1576
+ When requesting initial or final attributes for cells during animations, the collection view will now supply the cell's current attributes to the layout object as the `withTargetAttributes` argument.
1577
+
1578
+ ## BMCollectionViewLayout
1579
+
1580
+ The default implementation for initial and final attributes will now use the attributes supplied by the collection view rather than requesting the current attributes from the layout.
1581
+
1582
+ ## BMCollectionViewTransitionLayout
1583
+
1584
+ The transition layout will now supply the attributes generated by the target layout when `attributesForCellAtIndexPath(_)` or `attributesForSupplementaryViewWithIdentifier(_, {atIndexPath})` are invoked.
1585
+
1586
+ # 1.0.15
1587
+
1588
+ ## BMColor
1589
+
1590
+ The `BMColorMakeWithString(_)` function now works with internet explorer.
1591
+
1592
+ ## BMCollectionViewFlowLayout
1593
+
1594
+ Fixed an issue that caused the flow layout to repeatedly invalidate the layout when it was not needed.
1595
+
1596
+ ## BMCollectionView
1597
+
1598
+ Event handlers now fire correctly for hybrid touch and pointer based devices.
1599
+
1600
+ # 1.0.9
1601
+
1602
+ ## BMCodeHostCore
1603
+
1604
+ `BMMonacoCodeEditor` now has its own set of defaults instead of relying on the Thingworx extension defaults.
1605
+
1606
+ # 1.0.7
1607
+
1608
+ ## CoreUI
1609
+
1610
+ Added the `BMKeysForValue(_, {inObject})` global function that, when given a value, returns all keys within an object whose value is equal to the given value.
1611
+
1612
+ ## BMColor
1613
+
1614
+ Fixed the `RGBString` and `RGBAString` properties that were previously returning incorrect colors.
1615
+
1616
+ ## BMCollectionView
1617
+
1618
+ Added the `highFrequencyScrollingEnabled` property that, when set to `YES`, causes the collection view to handle scroll events during the capture phase and as often as they are triggered.
1619
+
1620
+ For the `cellAtIndexPath(_, {ofType, withIdentifier})`, the ofType parameter is now nullable and defaults to `BMCellAttributesType.Cell`.
1621
+
1622
+ The `refreshCellAtIndexPath(_)` method will now correctly destroy retained cells.
1623
+
1624
+ The collection view will now request the correct index paths from the data set prior to invoking `cellForItemAtIndexPath(_)` and `updateCell(_, {atIndexPath})` methods, if `updateEntireDataAnimated(_, {updateLayout, completionHandler})` has been invoked with `updateLayout` set to NO.