@breakside/jskit 2023.10.0 → 2023.11.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/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/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/UICollectionReusableView.js +1 -0
- package/Root/Frameworks/UIKit/UICollectionViewGridLayout.js +2 -11
- package/Root/Frameworks/UIKit/UICollectionViewLayout.js +1 -0
- package/Root/Frameworks/UIKit/UIHTMLDisplayServerCanvasContext.js +6 -1
- package/Root/Frameworks/UIKit/UILayer.js +66 -4
- package/Root/Frameworks/UIKit/UIScreen.js +5 -1
- package/Root/Frameworks/UIKit/UIView.js +26 -4
- package/Root/Frameworks/UIKit/UIWindow.js +10 -0
- package/Root/Frameworks/UIKit/UIWindowServer.js +2 -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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
13
13
|
}
|
|
@@ -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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
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": "2023.
|
|
6
|
+
"JSBundleVersion": "2023.11.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": "a030c131edd729dec656c535d8040085d2111960"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -58,6 +58,7 @@ JSClass("UICollectionReusableView", UIView, {
|
|
|
58
58
|
applyAttributes: function(attributes){
|
|
59
59
|
this.untransformedFrame = attributes.frame;
|
|
60
60
|
this.transform = attributes.transform;
|
|
61
|
+
this.zIndex = attributes.zIndex;
|
|
61
62
|
if (!attributes.indexPath.isEqual(this.indexPath)){
|
|
62
63
|
this.indexPath = JSIndexPath(attributes.indexPath);
|
|
63
64
|
}
|
|
@@ -345,17 +345,6 @@ JSClass("UICollectionViewGridLayout", UICollectionViewLayout, {
|
|
|
345
345
|
if (this._cachedLayout.footerFrame.size.height > 0 && rect.intersectsRect(this._cachedLayout.footerFrame)){
|
|
346
346
|
attributes.push(this.layoutAttributesForSupplimentaryViewAtIndexPath(JSIndexPath([]), UICollectionViewGridLayout.SupplimentaryKind.footer));
|
|
347
347
|
}
|
|
348
|
-
if (this._headersStickToTop){
|
|
349
|
-
var i = attributes.length - 1;
|
|
350
|
-
var j = i;
|
|
351
|
-
for (; i >= 0; --i){
|
|
352
|
-
attrs = attributes[i];
|
|
353
|
-
if (attrs.elementCategory === UICollectionView.ElementCategory.supplimentary && attrs.kind === UICollectionViewGridLayout.SupplimentaryKind.header){
|
|
354
|
-
attributes.splice(i, 1);
|
|
355
|
-
attributes.splice(j, 0, attrs);
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
348
|
return attributes;
|
|
360
349
|
},
|
|
361
350
|
|
|
@@ -387,6 +376,7 @@ JSClass("UICollectionViewGridLayout", UICollectionViewLayout, {
|
|
|
387
376
|
if (this._headersStickToTop){
|
|
388
377
|
ty = Math.max(0, this.collectionView.contentView.bounds.origin.y - attributes.frame.origin.y);
|
|
389
378
|
attributes.transform = JSAffineTransform.Translated(0, ty);
|
|
379
|
+
attributes.zIndex = 2;
|
|
390
380
|
}
|
|
391
381
|
return attributes;
|
|
392
382
|
}
|
|
@@ -405,6 +395,7 @@ JSClass("UICollectionViewGridLayout", UICollectionViewLayout, {
|
|
|
405
395
|
if (this._headersStickToTop){
|
|
406
396
|
ty = Math.min(Math.max(0, this.collectionView.contentView.bounds.origin.y - attributes.frame.origin.y + this._cachedLayout.headerFrame.size.height), (sectionLayout.frame.origin.y + sectionLayout.frame.size.height) - (sectionLayout.headerFrame.origin.y + sectionLayout.headerFrame.size.height));
|
|
407
397
|
attributes.transform = JSAffineTransform.Translated(0, ty);
|
|
398
|
+
attributes.zIndex = 1;
|
|
408
399
|
}
|
|
409
400
|
return attributes;
|
|
410
401
|
}
|
|
@@ -56,7 +56,8 @@ JSClass("UIHTMLDisplayServerCanvasContext", UIHTMLDisplayServerContext, {
|
|
|
56
56
|
cornerRadius: true,
|
|
57
57
|
shadow: true,
|
|
58
58
|
contentVisualEffect: true,
|
|
59
|
-
backgroundVisualEffect: true
|
|
59
|
+
backgroundVisualEffect: true,
|
|
60
|
+
zIndex: true,
|
|
60
61
|
};
|
|
61
62
|
this._imageElements = [];
|
|
62
63
|
this._canvasElements = [];
|
|
@@ -377,6 +378,10 @@ JSClass("UIHTMLDisplayServerCanvasContext", UIHTMLDisplayServerContext, {
|
|
|
377
378
|
this.style.filter = layer.presentation.contentVisualEffect ? layer.presentation.contentVisualEffect.cssFilterString() : '';
|
|
378
379
|
},
|
|
379
380
|
|
|
381
|
+
updateHTMLProperty_zIndex: function(layer){
|
|
382
|
+
this.style.zIndex = layer.zIndex;
|
|
383
|
+
},
|
|
384
|
+
|
|
380
385
|
// --------------------------------------------------------------------
|
|
381
386
|
// MARK: - Managing Canvas Elements & Context
|
|
382
387
|
|
|
@@ -80,6 +80,7 @@ JSClass("UILayer", JSObject, {
|
|
|
80
80
|
shadowOffset: UILayerAnimatedProperty(),
|
|
81
81
|
shadowRadius: UILayerAnimatedProperty(),
|
|
82
82
|
clipsToBounds: JSDynamicProperty('_clipsToBounds', false),
|
|
83
|
+
zIndex: JSDynamicProperty("_zIndex", 0),
|
|
83
84
|
model: null,
|
|
84
85
|
presentation: null,
|
|
85
86
|
superlayer: null,
|
|
@@ -300,6 +301,34 @@ JSClass("UILayer", JSObject, {
|
|
|
300
301
|
return path;
|
|
301
302
|
},
|
|
302
303
|
|
|
304
|
+
setZIndex: function(zIndex){
|
|
305
|
+
if (zIndex !== this._zIndex){
|
|
306
|
+
var previousZIndex = this._zIndex;
|
|
307
|
+
this._zIndex = zIndex;
|
|
308
|
+
this.didChangeProperty('zIndex');
|
|
309
|
+
if (this.superlayer !== null){
|
|
310
|
+
if (previousZIndex === 0){
|
|
311
|
+
this.superlayer.numberOfSublayersWithNonZeroZIndex += 1;
|
|
312
|
+
}else{
|
|
313
|
+
if (zIndex === 0){
|
|
314
|
+
this.superlayer.numberOfSublayersWithNonZeroZIndex -= 1;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
this.superlayer.setNeedsZIndexOrderedSublayers();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
|
|
322
|
+
numberOfSublayersWithNonZeroZIndex: 0,
|
|
323
|
+
zIndexOrderedSublayers: null,
|
|
324
|
+
|
|
325
|
+
setNeedsZIndexOrderedSublayers: function(){
|
|
326
|
+
this.zIndexOrderedSublayers = null;
|
|
327
|
+
if (this.delegate && this.delegate.layerDidChangeZIndexSublayers){
|
|
328
|
+
this.delegate.layerDidChangeZIndexSublayers(this);
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
|
|
303
332
|
// -------------------------------------------------------------------------
|
|
304
333
|
// MARK: - Shadows
|
|
305
334
|
|
|
@@ -340,6 +369,12 @@ JSClass("UILayer", JSObject, {
|
|
|
340
369
|
}
|
|
341
370
|
}
|
|
342
371
|
this.sublayers.splice(index, 0, sublayer);
|
|
372
|
+
if (sublayer.zIndex !== 0){
|
|
373
|
+
this.numberOfSublayersWithNonZeroZIndex += 1;
|
|
374
|
+
this.setNeedsZIndexOrderedSublayers();
|
|
375
|
+
}else if (this.numberOfSublayersWithNonZeroZIndex > 0){
|
|
376
|
+
this.setNeedsZIndexOrderedSublayers();
|
|
377
|
+
}
|
|
343
378
|
sublayer.sublayerIndex = index;
|
|
344
379
|
for (i = sublayer.sublayerIndex + 1, l = this.sublayers.length; i < l; ++i){
|
|
345
380
|
this.sublayers[i].sublayerIndex += 1;
|
|
@@ -374,6 +409,12 @@ JSClass("UILayer", JSObject, {
|
|
|
374
409
|
for (var i = sublayer.sublayerIndex + 1, l = this.sublayers.length; i < l; ++i){
|
|
375
410
|
this.sublayers[i].sublayerIndex -= 1;
|
|
376
411
|
}
|
|
412
|
+
if (this.numberOfSublayersWithNonZeroZIndex > 0){
|
|
413
|
+
this.setNeedsZIndexOrderedSublayers();
|
|
414
|
+
}
|
|
415
|
+
if (sublayer.zIndex !== 0){
|
|
416
|
+
this.numberOfSublayersWithNonZeroZIndex -= 1;
|
|
417
|
+
}
|
|
377
418
|
this.sublayers.splice(sublayer.sublayerIndex,1);
|
|
378
419
|
sublayer.superlayer = null;
|
|
379
420
|
sublayer.sublayerIndex = null;
|
|
@@ -540,8 +581,16 @@ JSClass("UILayer", JSObject, {
|
|
|
540
581
|
var sublayer;
|
|
541
582
|
var locationInSublayer;
|
|
542
583
|
var hit = null;
|
|
543
|
-
|
|
544
|
-
|
|
584
|
+
var sublayers = this.sublayers;
|
|
585
|
+
if (this.numberOfSublayersWithNonZeroZIndex > 0){
|
|
586
|
+
if (this.zIndexOrderedSublayers === null){
|
|
587
|
+
this.zIndexOrderedSublayers = JSCopy(sublayers);
|
|
588
|
+
this.zIndexOrderedSublayers.sort(UILayer.compareZIndex);
|
|
589
|
+
}
|
|
590
|
+
sublayers = this.zIndexOrderedSublayers;
|
|
591
|
+
}
|
|
592
|
+
for (var i = sublayers.length - 1; i >= 0 && hit === null; --i){
|
|
593
|
+
sublayer = sublayers[i];
|
|
545
594
|
locationInSublayer = this.convertPointToLayer(locationInLayer, sublayer);
|
|
546
595
|
if (!sublayer.hidden && sublayer.presentation.alpha > 0 && (!sublayer.clipsToBounds || sublayer.containsPoint(locationInSublayer))){
|
|
547
596
|
hit = sublayer.hitTest(locationInSublayer);
|
|
@@ -796,8 +845,17 @@ JSClass("UILayer", JSObject, {
|
|
|
796
845
|
if (includeSublayers && !hidden){
|
|
797
846
|
var sublayer;
|
|
798
847
|
var transform;
|
|
799
|
-
|
|
800
|
-
|
|
848
|
+
var sublayers = this.sublayers;
|
|
849
|
+
if (this.numberOfSublayersWithNonZeroZIndex > 0){
|
|
850
|
+
if (this.zIndexOrderedSublayers === null){
|
|
851
|
+
this.zIndexOrderedSublayers = JSCopy(sublayers);
|
|
852
|
+
this.zIndexOrderedSublayers.sort(UILayer.compareZIndex);
|
|
853
|
+
}
|
|
854
|
+
sublayers = this.zIndexOrderedSublayers;
|
|
855
|
+
}
|
|
856
|
+
sublayers.sort(function(a, b){ return a._zIndex - b._zIndex; });
|
|
857
|
+
for (var i = 0, l = sublayers.length; i < l; ++i){
|
|
858
|
+
sublayer = sublayers[i];
|
|
801
859
|
if (!sublayer.hidden){
|
|
802
860
|
context.save();
|
|
803
861
|
transform = sublayer._presentationTransformFromSuperlayer();
|
|
@@ -842,6 +900,10 @@ UILayer.Path = {
|
|
|
842
900
|
shadow: 2
|
|
843
901
|
};
|
|
844
902
|
|
|
903
|
+
UILayer.compareZIndex = function(a, b){
|
|
904
|
+
return a._zIndex - b._zIndex;
|
|
905
|
+
};
|
|
906
|
+
|
|
845
907
|
JSContext.definePropertiesFromExtensions({
|
|
846
908
|
|
|
847
909
|
drawsHiddenLayers: false,
|
|
@@ -138,6 +138,9 @@ JSClass('UIView', UIResponder, {
|
|
|
138
138
|
if (spec.containsKey("tag")){
|
|
139
139
|
this.tag = spec.valueForKey("tag");
|
|
140
140
|
}
|
|
141
|
+
if (spec.containsKey("zIndex")){
|
|
142
|
+
this.zIndex = spec.valueForKey("zIndex", Number);
|
|
143
|
+
}
|
|
141
144
|
var i, l;
|
|
142
145
|
if (spec.containsKey("gestureRecognizers")){
|
|
143
146
|
var recognizers = spec.valueForKey("gestureRecognizers");
|
|
@@ -193,6 +196,7 @@ JSClass('UIView', UIResponder, {
|
|
|
193
196
|
shadowOffset: UIViewLayerProperty(),
|
|
194
197
|
shadowRadius: UIViewLayerProperty(),
|
|
195
198
|
contentVisualEffect: UIViewLayerProperty(),
|
|
199
|
+
zIndex: UIViewLayerProperty(),
|
|
196
200
|
cursor: JSDynamicProperty(),
|
|
197
201
|
tooltip: null,
|
|
198
202
|
|
|
@@ -207,6 +211,10 @@ JSClass('UIView', UIResponder, {
|
|
|
207
211
|
}
|
|
208
212
|
},
|
|
209
213
|
|
|
214
|
+
layerDidChangeZIndexSublayers: function(layer){
|
|
215
|
+
this.zIndexOrderedSubviews = null;
|
|
216
|
+
},
|
|
217
|
+
|
|
210
218
|
// -------------------------------------------------------------------------
|
|
211
219
|
// MARK: - Superview
|
|
212
220
|
|
|
@@ -967,6 +975,8 @@ JSClass('UIView', UIResponder, {
|
|
|
967
975
|
|
|
968
976
|
userInteractionEnabled: true,
|
|
969
977
|
|
|
978
|
+
zIndexOrderedSubviews: null,
|
|
979
|
+
|
|
970
980
|
containsPoint: function(point){
|
|
971
981
|
return this.layer.containsPoint(point);
|
|
972
982
|
},
|
|
@@ -975,11 +985,19 @@ JSClass('UIView', UIResponder, {
|
|
|
975
985
|
var subview;
|
|
976
986
|
var locationInSubview;
|
|
977
987
|
var hit = null;
|
|
978
|
-
|
|
979
|
-
|
|
988
|
+
var subviews = this.subviews;
|
|
989
|
+
if (this.layer.numberOfSublayersWithNonZeroZIndex > 0){
|
|
990
|
+
if (this.zIndexOrderedSubviews === null){
|
|
991
|
+
this.zIndexOrderedSubviews = JSCopy(subviews);
|
|
992
|
+
this.zIndexOrderedSubviews.sort(UIView.compareZIndex);
|
|
993
|
+
}
|
|
994
|
+
subviews = this.zIndexOrderedSubviews;
|
|
995
|
+
}
|
|
996
|
+
for (var i = subviews.length - 1; i >= 0 && hit === null; --i){
|
|
997
|
+
subview = subviews[i];
|
|
980
998
|
locationInSubview = this.layer.convertPointToLayer(locationInView, subview.layer);
|
|
981
999
|
if (!subview.hidden && subview.layer.presentation.alpha > 0 && (!subview.clipsToBounds || subview.containsPoint(locationInSubview))){
|
|
982
|
-
hit
|
|
1000
|
+
hit = subview.hitTest(locationInSubview);
|
|
983
1001
|
}
|
|
984
1002
|
}
|
|
985
1003
|
if (hit === null && this.userInteractionEnabled && this.containsPoint(locationInView)){
|
|
@@ -1204,4 +1222,8 @@ UIView.animateWithOptions = function(options, animations, callback){
|
|
|
1204
1222
|
UIView.noIntrinsicSize = -1;
|
|
1205
1223
|
|
|
1206
1224
|
UIView.Corners = UILayer.Corners;
|
|
1207
|
-
UIView.Sides = UILayer.Sides;
|
|
1225
|
+
UIView.Sides = UILayer.Sides;
|
|
1226
|
+
|
|
1227
|
+
UIView.compareZIndex = function(a, b){
|
|
1228
|
+
return a.layer._zIndex - b.layer._zIndex;
|
|
1229
|
+
};
|
|
@@ -306,6 +306,16 @@ JSClass('UIWindow', UIView, {
|
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
|
|
309
|
+
zIndex: JSDynamicProperty(),
|
|
310
|
+
|
|
311
|
+
setZIndex: function(zIndex){
|
|
312
|
+
logger.warn("setting zIndex on UIWindow has no effect");
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
getZIndex: function(){
|
|
316
|
+
return 0;
|
|
317
|
+
},
|
|
318
|
+
|
|
309
319
|
// -------------------------------------------------------------------------
|
|
310
320
|
// MARK: Traits
|
|
311
321
|
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
// #import "UIDraggingSession.js"
|
|
23
23
|
// #import "UIUserInterface.js"
|
|
24
24
|
// #import "UIColorSpace.js"
|
|
25
|
+
// #import "UIScreen.js"
|
|
25
26
|
'use strict';
|
|
26
27
|
|
|
27
28
|
(function(){
|
|
@@ -273,6 +274,7 @@ JSClass("UIWindowServer", JSObject, {
|
|
|
273
274
|
window = this.windowStack[i];
|
|
274
275
|
this.layoutWindow(window);
|
|
275
276
|
}
|
|
277
|
+
JSNotificationCenter.shared.post(UIScreen.Notification.frameChanged, this, {screen: this.screen});
|
|
276
278
|
},
|
|
277
279
|
|
|
278
280
|
layoutWindow: function(window){
|