@breakside/jskit 2022.11.0 → 2022.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSEnvironment.js +5 -0
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSEnvironment.js +5 -0
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UICollectionView.js +72 -2
- package/Root/Frameworks/UIKit/UICollectionViewCell.js +11 -1
- package/Root/Frameworks/UIKit/UICollectionViewLayout.js +1 -1
- package/Root/Frameworks/UIKit/UIDraggingSession.js +7 -0
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +13 -1
- package/Root/Frameworks/UIKit/UIWindow.js +21 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "DOM+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
11
11
|
"node": "DOM+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
8
8
|
"html": "FontKit+HTML.js"
|
|
9
9
|
},
|
|
10
10
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
10
10
|
"html": "FontKit+HTML.js"
|
|
11
11
|
},
|
|
12
12
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [],
|
|
16
16
|
"ResourceLookup": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "Foundation+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -112,6 +112,11 @@ JSClass("JSEnvironment", JSObject, {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return null;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
booleanForName: function(name){
|
|
118
|
+
var stringValue = this.stringForName(name);
|
|
119
|
+
return (stringValue === 'true' || stringValue === '1' || stringValue === 'yes' || stringValue === 'on');
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
});
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
11
11
|
"node": "Foundation+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "SecurityKit+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
11
11
|
"node": "SecurityKit+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
package/Info.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "node",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
4
|
-
"JSBundleVersion": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.20.0",
|
|
5
5
|
"JSExecutableName": "jskit",
|
|
6
6
|
"NPMOrganization": "breakside",
|
|
7
7
|
"JSResources": [
|
|
8
8
|
"Tests/HTMLTestRunner.js",
|
|
9
9
|
"Tests/NodeTestRunner.js"
|
|
10
10
|
],
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "node",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
6
|
-
"JSBundleVersion": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.20.0",
|
|
7
7
|
"JSExecutableName": "jskit",
|
|
8
8
|
"NPMOrganization": "breakside",
|
|
9
9
|
"JSResources": [
|
|
10
10
|
"Tests/HTMLTestRunner.js",
|
|
11
11
|
"Tests/NodeTestRunner.js"
|
|
12
12
|
],
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "77c03ed85e862b4c68c6d2961cdc7cdcf82f0d85"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -112,6 +112,11 @@ JSClass("JSEnvironment", JSObject, {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
return null;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
booleanForName: function(name){
|
|
118
|
+
var stringValue = this.stringForName(name);
|
|
119
|
+
return (stringValue === 'true' || stringValue === '1' || stringValue === 'yes' || stringValue === 'on');
|
|
115
120
|
}
|
|
116
121
|
|
|
117
122
|
});
|
|
@@ -36,7 +36,13 @@ JSProtocol("UICollectionViewDelegate", JSProtocol, {
|
|
|
36
36
|
// Dragging cells
|
|
37
37
|
collectionViewShouldDragCellAtIndexPath: function(collectionView, indexPath){},
|
|
38
38
|
pasteboardItemsForCollectionViewAtIndexPath: function(collectionView, indexPath){},
|
|
39
|
-
collectionViewWillBeginDraggingSession: function(collectionView, session){}
|
|
39
|
+
collectionViewWillBeginDraggingSession: function(collectionView, session){},
|
|
40
|
+
|
|
41
|
+
// Dragging destination
|
|
42
|
+
collectionViewDraggingSessionDidEnter: function(collectionView, sesssion){},
|
|
43
|
+
collectionViewDraggingSessionDidUpdate: function(collectionView, sesssion, indexPath){},
|
|
44
|
+
collectionViewDraggingSessionDidExit: function(collectionView, sesssion){},
|
|
45
|
+
collectionViewPerformDragOperation: function(collectionView, sesssion, operation, indexPath){}
|
|
40
46
|
|
|
41
47
|
});
|
|
42
48
|
|
|
@@ -344,6 +350,9 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
344
350
|
},
|
|
345
351
|
|
|
346
352
|
deleteCellsAtIndexPaths: function(indexPaths, animation){
|
|
353
|
+
if (this.selectedIndexPaths.length > 0){
|
|
354
|
+
this._setSelectedIndexPaths([], {notifyDelegate: true});
|
|
355
|
+
}
|
|
347
356
|
// TODO:
|
|
348
357
|
this.reloadData();
|
|
349
358
|
},
|
|
@@ -837,11 +846,13 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
837
846
|
this._updateVisibleCellStates();
|
|
838
847
|
},
|
|
839
848
|
|
|
849
|
+
|
|
840
850
|
mouseDragged: function(event){
|
|
841
851
|
var location = event.locationInView(this);
|
|
842
852
|
var cell = this._cellHitTest(location);
|
|
843
853
|
if (this._shouldDrag){
|
|
844
854
|
var dragItems = [];
|
|
855
|
+
var indexPaths = [];
|
|
845
856
|
if (cell !== null){
|
|
846
857
|
var cellItems = [];
|
|
847
858
|
if (this.allowsMultipleSelection && this._selectionContainsIndexPath(cell.indexPath)){
|
|
@@ -853,6 +864,7 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
853
864
|
if (cellItems !== null){
|
|
854
865
|
dragItems = dragItems.concat(cellItems);
|
|
855
866
|
}
|
|
867
|
+
indexPaths.push(indexPath);
|
|
856
868
|
}
|
|
857
869
|
}
|
|
858
870
|
}else{
|
|
@@ -861,13 +873,14 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
861
873
|
if (cellItems !== null){
|
|
862
874
|
dragItems = cellItems;
|
|
863
875
|
}
|
|
876
|
+
indexPaths.push(cell.indexPath);
|
|
864
877
|
}
|
|
865
878
|
}
|
|
866
879
|
}
|
|
867
880
|
if (dragItems.length > 0){
|
|
868
881
|
var session = this.beginDraggingSessionWithItems(dragItems, event);
|
|
869
882
|
if (this.delegate && this.delegate.collectionViewWillBeginDraggingSession){
|
|
870
|
-
this.delegate.collectionViewWillBeginDraggingSession(this, session);
|
|
883
|
+
this.delegate.collectionViewWillBeginDraggingSession(this, session, indexPaths, location);
|
|
871
884
|
}
|
|
872
885
|
}
|
|
873
886
|
}else{
|
|
@@ -1018,6 +1031,62 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
1018
1031
|
this._cancelTouchSelection();
|
|
1019
1032
|
},
|
|
1020
1033
|
|
|
1034
|
+
// ----------------------------------------------------------------------
|
|
1035
|
+
// MARK: - Drag Destination
|
|
1036
|
+
|
|
1037
|
+
draggingEntered: function(session){
|
|
1038
|
+
if (this.delegate && this.delegate.collectionViewDraggingSessionDidEnter){
|
|
1039
|
+
this.delegate.collectionViewDraggingSessionDidEnter(this, session);
|
|
1040
|
+
}
|
|
1041
|
+
return UIDragOperation.none;
|
|
1042
|
+
},
|
|
1043
|
+
|
|
1044
|
+
draggingUpdated: function(session){
|
|
1045
|
+
var location = this.convertPointFromScreen(session.screenLocation);
|
|
1046
|
+
var indexPath = null;
|
|
1047
|
+
var cell = this._cellHitTest(location);
|
|
1048
|
+
if (cell !== null){
|
|
1049
|
+
indexPath = cell.indexPath;
|
|
1050
|
+
}
|
|
1051
|
+
var operation = UIDragOperation.none;
|
|
1052
|
+
if (this.delegate && this.delegate.collectionViewDraggingSessionDidUpdate){
|
|
1053
|
+
operation = this.delegate.collectionViewDraggingSessionDidUpdate(this, session, indexPath);
|
|
1054
|
+
}
|
|
1055
|
+
if (operation === UIDragOperation.none){
|
|
1056
|
+
this._updateDropTarget(null);
|
|
1057
|
+
}else{
|
|
1058
|
+
this._updateDropTarget(cell);
|
|
1059
|
+
}
|
|
1060
|
+
return operation;
|
|
1061
|
+
},
|
|
1062
|
+
|
|
1063
|
+
draggingExited: function(session){
|
|
1064
|
+
this._updateDropTarget(null);
|
|
1065
|
+
if (this.delegate && this.delegate.collectionViewDraggingSessionDidExit){
|
|
1066
|
+
this.delegate.collectionViewDraggingSessionDidExit(this, session);
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
performDragOperation: function(session, operation){
|
|
1071
|
+
var location = this.convertPointFromScreen(session.screenLocation);
|
|
1072
|
+
var cell = this._cellHitTest(location);
|
|
1073
|
+
this._updateDropTarget(null);
|
|
1074
|
+
if (cell && this.delegate && this.delegate.collectionViewPerformDragOperation){
|
|
1075
|
+
this.delegate.collectionViewPerformDragOperation(this, session, operation, cell.indexPath);
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
|
|
1079
|
+
_updateDropTarget: function(cell){
|
|
1080
|
+
var i, l;
|
|
1081
|
+
var item;
|
|
1082
|
+
for (i = 0, l = this._visibleElements.length; i < l; ++i){
|
|
1083
|
+
item = this._visibleElements[i];
|
|
1084
|
+
if (item.attributes.elementCategory === UICollectionView.ElementCategory.cell){
|
|
1085
|
+
item.view.dropTarget = item.view === cell;
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
},
|
|
1089
|
+
|
|
1021
1090
|
// --------------------------------------------------------------------
|
|
1022
1091
|
// MARK: - Finding Cells by Location
|
|
1023
1092
|
|
|
@@ -1117,6 +1186,7 @@ JSClass("UICollectionView", UIScrollView, {
|
|
|
1117
1186
|
// MARK: - Scrolling
|
|
1118
1187
|
|
|
1119
1188
|
scrollToCellAtIndexPath: function(indexPath, position){
|
|
1189
|
+
this.layoutIfNeeded();
|
|
1120
1190
|
if (position === undefined){
|
|
1121
1191
|
position = UICollectionView.ScrollPosition.auto;
|
|
1122
1192
|
}
|
|
@@ -36,6 +36,7 @@ JSClass("UICollectionViewCell", UICollectionReusableView, {
|
|
|
36
36
|
active: JSDynamicProperty(null, null, 'isActive'),
|
|
37
37
|
selected: JSDynamicProperty(null, null, 'isSelected'),
|
|
38
38
|
contextSelected: JSDynamicProperty(null, null, 'isContextSelected'),
|
|
39
|
+
dropTarget: JSDynamicProperty(null, null, 'isDropTarget'),
|
|
39
40
|
|
|
40
41
|
_updateState: function(newState){
|
|
41
42
|
if (newState != this._state){
|
|
@@ -94,6 +95,14 @@ JSClass("UICollectionViewCell", UICollectionReusableView, {
|
|
|
94
95
|
this._toggleState(UICollectionViewCell.State.contextSelected, isContextSelected);
|
|
95
96
|
},
|
|
96
97
|
|
|
98
|
+
isDropTarget: function(){
|
|
99
|
+
return (this._state & UICollectionViewCell.State.dropTarget) === UICollectionViewCell.State.dropTarget;
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
setDropTarget: function(isDropTarget){
|
|
103
|
+
this._toggleState(UICollectionViewCell.State.dropTarget, isDropTarget);
|
|
104
|
+
},
|
|
105
|
+
|
|
97
106
|
// --------------------------------------------------------------------
|
|
98
107
|
// MARK: - Accessibility
|
|
99
108
|
|
|
@@ -117,5 +126,6 @@ UICollectionViewCell.State = {
|
|
|
117
126
|
active: 1 << 1,
|
|
118
127
|
selected: 1 << 2,
|
|
119
128
|
contextSelected: 1 << 3,
|
|
120
|
-
|
|
129
|
+
dropTarget: 1 << 4,
|
|
130
|
+
firstUserState: 1 << 5
|
|
121
131
|
};
|
|
@@ -35,7 +35,7 @@ JSClass("UICollectionViewLayout", JSObject, {
|
|
|
35
35
|
layoutAttributesForCellAtIndexPath: function(indexPath){
|
|
36
36
|
},
|
|
37
37
|
|
|
38
|
-
layoutAttributesForSupplimentaryViewAtIndexPath: function(indexPath){
|
|
38
|
+
layoutAttributesForSupplimentaryViewAtIndexPath: function(indexPath, kind){
|
|
39
39
|
},
|
|
40
40
|
|
|
41
41
|
shouldInvalidateLayoutForBounds: function(bounds){
|
|
@@ -83,6 +83,9 @@ JSClass("UIDraggingSession", JSObject, {
|
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
cancel: function(){
|
|
86
|
+
if (this.destination){
|
|
87
|
+
this.destination.draggingExited(this);
|
|
88
|
+
}
|
|
86
89
|
},
|
|
87
90
|
|
|
88
91
|
isValidDestination: function(destination){
|
|
@@ -95,6 +98,10 @@ JSClass("UIDraggingSession", JSObject, {
|
|
|
95
98
|
this.imageOffset = JSPoint(offset);
|
|
96
99
|
},
|
|
97
100
|
|
|
101
|
+
setImageFromView: function(view, offset){
|
|
102
|
+
this.imageOffset = JSPoint(offset);
|
|
103
|
+
},
|
|
104
|
+
|
|
98
105
|
centerImageScreenLocation: JSReadOnlyProperty(),
|
|
99
106
|
|
|
100
107
|
getCenterImageScreenLocation: function(){
|
|
@@ -562,7 +562,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
562
562
|
dragend: function(e){
|
|
563
563
|
// dragend is not cancelable, so no need for preventDefault()
|
|
564
564
|
if (this._dragImageElement !== null){
|
|
565
|
-
if (this._dragImageElement.parentNode !== null){
|
|
565
|
+
if (this._dragImageElement.parentNode !== null && this._createdDragImageElement){
|
|
566
566
|
this._dragImageElement.parentNode.removeChild(this._dragImageElement);
|
|
567
567
|
}
|
|
568
568
|
this._dragImageElement = null;
|
|
@@ -839,6 +839,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
839
839
|
// MARK: - Drag & Drop Support
|
|
840
840
|
|
|
841
841
|
_dragImageElement: null,
|
|
842
|
+
_createdDragImageElement: false,
|
|
842
843
|
|
|
843
844
|
prerenderDragImage: function(image){
|
|
844
845
|
// Safari is picky here and requires that the image element be in the document and
|
|
@@ -852,6 +853,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
852
853
|
imageElement.src = image.htmlURLString();
|
|
853
854
|
this.rootElement.appendChild(imageElement);
|
|
854
855
|
this._dragImageElement = imageElement;
|
|
856
|
+
this._createdDragImageElement = true;
|
|
855
857
|
},
|
|
856
858
|
|
|
857
859
|
createDraggingSessionWithItems: function(items, event, view){
|
|
@@ -863,6 +865,7 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
863
865
|
context.element.draggable = true;
|
|
864
866
|
// Could use a subclass here, but this seems to work too
|
|
865
867
|
var originalSetImage = session.setImage;
|
|
868
|
+
var originalSetImageFromView = session.setImageFromView;
|
|
866
869
|
var windowServer = this;
|
|
867
870
|
Object.defineProperties(session, {
|
|
868
871
|
setImage: {
|
|
@@ -871,6 +874,15 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
871
874
|
originalSetImage.call(this, image, imageOffset);
|
|
872
875
|
windowServer.prerenderDragImage(image);
|
|
873
876
|
}
|
|
877
|
+
},
|
|
878
|
+
setImageFromView: {
|
|
879
|
+
configurable: true,
|
|
880
|
+
value: function UIHTMLWindowServer_UIDragSession_setImageFromView(view, imageOffset){
|
|
881
|
+
originalSetImageFromView.call(this, view, imageOffset);
|
|
882
|
+
var context = windowServer.displayServer.contextForLayer(view.layer);
|
|
883
|
+
windowServer._dragImageElement = context.element;
|
|
884
|
+
windowServer._createdDragImageElement = false;
|
|
885
|
+
}
|
|
874
886
|
}
|
|
875
887
|
});
|
|
876
888
|
}
|
|
@@ -1148,7 +1148,18 @@ JSClass("UIWindowStyler", JSObject, {
|
|
|
1148
1148
|
window.layer.addSublayer(window.stylerProperties.focusRingLayer);
|
|
1149
1149
|
},
|
|
1150
1150
|
|
|
1151
|
+
_isUpdatingFocusRing: false,
|
|
1152
|
+
|
|
1151
1153
|
updateFocusRingInWindow: function(window, animated){
|
|
1154
|
+
if (this._isUpdatingFocusRing){
|
|
1155
|
+
return;
|
|
1156
|
+
}
|
|
1157
|
+
this._isUpdatingFocusRing = true;
|
|
1158
|
+
this._updateFocusRingInWindow(window, animated);
|
|
1159
|
+
this._isUpdatingFocusRing = false;
|
|
1160
|
+
},
|
|
1161
|
+
|
|
1162
|
+
_updateFocusRingInWindow: function(window, animated){
|
|
1152
1163
|
var responder = window.firstResponder;
|
|
1153
1164
|
var focusRingLayer = window.stylerProperties.focusRingLayer;
|
|
1154
1165
|
if (!window.isKeyWindow || responder === null || !responder.isKindOfClass(UIView)){
|
|
@@ -1156,6 +1167,16 @@ JSClass("UIWindowStyler", JSObject, {
|
|
|
1156
1167
|
return;
|
|
1157
1168
|
}
|
|
1158
1169
|
var view = responder;
|
|
1170
|
+
var views = [];
|
|
1171
|
+
while (view !== window){
|
|
1172
|
+
views.push(view);
|
|
1173
|
+
view = view.superview;
|
|
1174
|
+
}
|
|
1175
|
+
view = responder;
|
|
1176
|
+
var i;
|
|
1177
|
+
for (i = views.length - 1; i >= 0; --i){
|
|
1178
|
+
views[i].layoutIfNeeded();
|
|
1179
|
+
}
|
|
1159
1180
|
var path = view.focusRingPath;
|
|
1160
1181
|
if (path === null){
|
|
1161
1182
|
focusRingLayer.hidden = true;
|