@breakside/jskit 2025.41.0 → 2025.53.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/JSImage.js +108 -0
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/sources.json +1 -0
- 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/JSImage.js +108 -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/UILayer.js +4 -0
- package/Root/Frameworks/UIKit/UISplitView.js +4 -16
- package/Root/Frameworks/UIKit/UIView.js +21 -6
- package/Root/Frameworks/UIKit/UIWindow.js +7 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +5 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
13
13
|
}
|
|
@@ -343,6 +343,9 @@ _JSDataImage.sizeFromJPEGData = function(data){
|
|
|
343
343
|
var l = data.length;
|
|
344
344
|
var blockLength;
|
|
345
345
|
var blockdata;
|
|
346
|
+
var exifData;
|
|
347
|
+
var exif = null;
|
|
348
|
+
var flipWidthHeight = false;
|
|
346
349
|
while (i < l){
|
|
347
350
|
b = data[i++];
|
|
348
351
|
if (b != 0xFF){
|
|
@@ -369,10 +372,21 @@ _JSDataImage.sizeFromJPEGData = function(data){
|
|
|
369
372
|
// TODO: Error, not enough room for block data
|
|
370
373
|
return JSSize.Zero;
|
|
371
374
|
}
|
|
375
|
+
// E1 is Exif Data
|
|
376
|
+
if (b === 0xE1){
|
|
377
|
+
exifData = data.subdataInRange(JSRange(i + 2, blockLength - 2));
|
|
378
|
+
exif = JSImageExif.initWithData(exifData);
|
|
379
|
+
if (exif !== null){
|
|
380
|
+
flipWidthHeight = exif.orientationFlipsWidthHeight;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
372
383
|
// C0-CF are start of frame blocks, expect for C4 and CC
|
|
373
384
|
// start of frame blocks have image sizes
|
|
374
385
|
if (b >= 0xC0 && b <= 0xCF && b != 0xC4 && b != 0xCC){
|
|
375
386
|
if (blockLength >= 7){
|
|
387
|
+
if (flipWidthHeight){
|
|
388
|
+
return JSSize(dataView.getUint16(i + 3), dataView.getUint16(i + 5));
|
|
389
|
+
}
|
|
376
390
|
return JSSize(dataView.getUint16(i + 5), dataView.getUint16(i + 3));
|
|
377
391
|
}
|
|
378
392
|
return JSSize.Zero;
|
|
@@ -536,4 +550,98 @@ JSImage.RenderMode = {
|
|
|
536
550
|
template: 2
|
|
537
551
|
};
|
|
538
552
|
|
|
553
|
+
JSClass("JSImageExif", JSObject, {
|
|
554
|
+
|
|
555
|
+
data: null,
|
|
556
|
+
dataView: null,
|
|
557
|
+
|
|
558
|
+
initWithData: function(data){
|
|
559
|
+
if (data.length < 8){
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
if (data[0] === 0x45 && data[1] === 0x78 && data[2] === 0x69 && data[3] === 0x66 && data[4] === 0x00 && data[5] === 0x00){
|
|
563
|
+
data = data.subdataInRange(JSRange(6, data.length - 6));
|
|
564
|
+
}
|
|
565
|
+
this.data = data;
|
|
566
|
+
this.dataView = this.data.dataView();
|
|
567
|
+
this.littleEndian = this.data[0] === 0x49 && this.data[1] === 0x49;
|
|
568
|
+
this.magicNumber = this.dataView.getUint16(2, this.littleEndian);
|
|
569
|
+
if (this.magicNumber !== 42){
|
|
570
|
+
return null;
|
|
571
|
+
}
|
|
572
|
+
this.firstDirectoryOffset = this.dataView.getUint32(4, this.littleEndian);
|
|
573
|
+
if (this.firstDirectoryOffset + 2 > this.data.length){
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
this.numberOfEntries = this.dataView.getUint16(this.firstDirectoryOffset, this.littleEndian);
|
|
577
|
+
if (this.firstDirectoryOffset + this.numberOfEntries * 12 + 4 > this.data.length){
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
valueForTag: function(tag, defaultValue){
|
|
583
|
+
var min = 0;
|
|
584
|
+
var max = this.numberOfEntries;
|
|
585
|
+
var mid;
|
|
586
|
+
var offset;
|
|
587
|
+
var result;
|
|
588
|
+
var type;
|
|
589
|
+
var count;
|
|
590
|
+
while (min < max){
|
|
591
|
+
mid = Math.floor(min + (max - min) / 2);
|
|
592
|
+
offset = this.firstDirectoryOffset + 2 + 12 * mid;
|
|
593
|
+
result = tag - this.dataView.getUint16(offset, this.littleEndian);
|
|
594
|
+
if (result < 0){
|
|
595
|
+
max = mid;
|
|
596
|
+
}else if (result > 0){
|
|
597
|
+
min = mid + 1;
|
|
598
|
+
}else{
|
|
599
|
+
min = max = mid;
|
|
600
|
+
type = this.dataView.getUint16(offset + 2, this.littleEndian);
|
|
601
|
+
count = this.dataView.getUint32(offset + 4, this.littleEndian);
|
|
602
|
+
if (count === 1){
|
|
603
|
+
if (type === JSImageExif.Type.byte){
|
|
604
|
+
return this.data[offset + 8];
|
|
605
|
+
}
|
|
606
|
+
if (type === JSImageExif.Type.short){
|
|
607
|
+
return this.dataView.getUint16(offset + 8, this.littleEndian);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return defaultValue;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return defaultValue;
|
|
614
|
+
},
|
|
615
|
+
|
|
616
|
+
orientation: JSLazyInitProperty(function(){
|
|
617
|
+
return this.valueForTag(JSImageExif.Tag.orientation, 1);
|
|
618
|
+
}),
|
|
619
|
+
|
|
620
|
+
orientationFlipsWidthHeight: JSLazyInitProperty(function(){
|
|
621
|
+
var orientation = this.orientation;
|
|
622
|
+
if (orientation === 5 || orientation === 6 || orientation === 7 || orientation === 8){
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
return false;
|
|
626
|
+
}),
|
|
627
|
+
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
JSImageExif.Type = {
|
|
631
|
+
byte: 1,
|
|
632
|
+
ascii: 2,
|
|
633
|
+
short: 3,
|
|
634
|
+
long: 4,
|
|
635
|
+
rational: 5,
|
|
636
|
+
sbyte: 6,
|
|
637
|
+
undefined: 7,
|
|
638
|
+
sshort: 8,
|
|
639
|
+
slong: 9,
|
|
640
|
+
srational: 10
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
JSImageExif.Tag = {
|
|
644
|
+
orientation: 274,
|
|
645
|
+
};
|
|
646
|
+
|
|
539
647
|
})();
|
|
@@ -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": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
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": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.53.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": "2ebcc765205336466936166a30d076ea3e789cd0"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -343,6 +343,9 @@ _JSDataImage.sizeFromJPEGData = function(data){
|
|
|
343
343
|
var l = data.length;
|
|
344
344
|
var blockLength;
|
|
345
345
|
var blockdata;
|
|
346
|
+
var exifData;
|
|
347
|
+
var exif = null;
|
|
348
|
+
var flipWidthHeight = false;
|
|
346
349
|
while (i < l){
|
|
347
350
|
b = data[i++];
|
|
348
351
|
if (b != 0xFF){
|
|
@@ -369,10 +372,21 @@ _JSDataImage.sizeFromJPEGData = function(data){
|
|
|
369
372
|
// TODO: Error, not enough room for block data
|
|
370
373
|
return JSSize.Zero;
|
|
371
374
|
}
|
|
375
|
+
// E1 is Exif Data
|
|
376
|
+
if (b === 0xE1){
|
|
377
|
+
exifData = data.subdataInRange(JSRange(i + 2, blockLength - 2));
|
|
378
|
+
exif = JSImageExif.initWithData(exifData);
|
|
379
|
+
if (exif !== null){
|
|
380
|
+
flipWidthHeight = exif.orientationFlipsWidthHeight;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
372
383
|
// C0-CF are start of frame blocks, expect for C4 and CC
|
|
373
384
|
// start of frame blocks have image sizes
|
|
374
385
|
if (b >= 0xC0 && b <= 0xCF && b != 0xC4 && b != 0xCC){
|
|
375
386
|
if (blockLength >= 7){
|
|
387
|
+
if (flipWidthHeight){
|
|
388
|
+
return JSSize(dataView.getUint16(i + 3), dataView.getUint16(i + 5));
|
|
389
|
+
}
|
|
376
390
|
return JSSize(dataView.getUint16(i + 5), dataView.getUint16(i + 3));
|
|
377
391
|
}
|
|
378
392
|
return JSSize.Zero;
|
|
@@ -536,4 +550,98 @@ JSImage.RenderMode = {
|
|
|
536
550
|
template: 2
|
|
537
551
|
};
|
|
538
552
|
|
|
553
|
+
JSClass("JSImageExif", JSObject, {
|
|
554
|
+
|
|
555
|
+
data: null,
|
|
556
|
+
dataView: null,
|
|
557
|
+
|
|
558
|
+
initWithData: function(data){
|
|
559
|
+
if (data.length < 8){
|
|
560
|
+
return null;
|
|
561
|
+
}
|
|
562
|
+
if (data[0] === 0x45 && data[1] === 0x78 && data[2] === 0x69 && data[3] === 0x66 && data[4] === 0x00 && data[5] === 0x00){
|
|
563
|
+
data = data.subdataInRange(JSRange(6, data.length - 6));
|
|
564
|
+
}
|
|
565
|
+
this.data = data;
|
|
566
|
+
this.dataView = this.data.dataView();
|
|
567
|
+
this.littleEndian = this.data[0] === 0x49 && this.data[1] === 0x49;
|
|
568
|
+
this.magicNumber = this.dataView.getUint16(2, this.littleEndian);
|
|
569
|
+
if (this.magicNumber !== 42){
|
|
570
|
+
return null;
|
|
571
|
+
}
|
|
572
|
+
this.firstDirectoryOffset = this.dataView.getUint32(4, this.littleEndian);
|
|
573
|
+
if (this.firstDirectoryOffset + 2 > this.data.length){
|
|
574
|
+
return null;
|
|
575
|
+
}
|
|
576
|
+
this.numberOfEntries = this.dataView.getUint16(this.firstDirectoryOffset, this.littleEndian);
|
|
577
|
+
if (this.firstDirectoryOffset + this.numberOfEntries * 12 + 4 > this.data.length){
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
|
|
582
|
+
valueForTag: function(tag, defaultValue){
|
|
583
|
+
var min = 0;
|
|
584
|
+
var max = this.numberOfEntries;
|
|
585
|
+
var mid;
|
|
586
|
+
var offset;
|
|
587
|
+
var result;
|
|
588
|
+
var type;
|
|
589
|
+
var count;
|
|
590
|
+
while (min < max){
|
|
591
|
+
mid = Math.floor(min + (max - min) / 2);
|
|
592
|
+
offset = this.firstDirectoryOffset + 2 + 12 * mid;
|
|
593
|
+
result = tag - this.dataView.getUint16(offset, this.littleEndian);
|
|
594
|
+
if (result < 0){
|
|
595
|
+
max = mid;
|
|
596
|
+
}else if (result > 0){
|
|
597
|
+
min = mid + 1;
|
|
598
|
+
}else{
|
|
599
|
+
min = max = mid;
|
|
600
|
+
type = this.dataView.getUint16(offset + 2, this.littleEndian);
|
|
601
|
+
count = this.dataView.getUint32(offset + 4, this.littleEndian);
|
|
602
|
+
if (count === 1){
|
|
603
|
+
if (type === JSImageExif.Type.byte){
|
|
604
|
+
return this.data[offset + 8];
|
|
605
|
+
}
|
|
606
|
+
if (type === JSImageExif.Type.short){
|
|
607
|
+
return this.dataView.getUint16(offset + 8, this.littleEndian);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
return defaultValue;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return defaultValue;
|
|
614
|
+
},
|
|
615
|
+
|
|
616
|
+
orientation: JSLazyInitProperty(function(){
|
|
617
|
+
return this.valueForTag(JSImageExif.Tag.orientation, 1);
|
|
618
|
+
}),
|
|
619
|
+
|
|
620
|
+
orientationFlipsWidthHeight: JSLazyInitProperty(function(){
|
|
621
|
+
var orientation = this.orientation;
|
|
622
|
+
if (orientation === 5 || orientation === 6 || orientation === 7 || orientation === 8){
|
|
623
|
+
return true;
|
|
624
|
+
}
|
|
625
|
+
return false;
|
|
626
|
+
}),
|
|
627
|
+
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
JSImageExif.Type = {
|
|
631
|
+
byte: 1,
|
|
632
|
+
ascii: 2,
|
|
633
|
+
short: 3,
|
|
634
|
+
long: 4,
|
|
635
|
+
rational: 5,
|
|
636
|
+
sbyte: 6,
|
|
637
|
+
undefined: 7,
|
|
638
|
+
sshort: 8,
|
|
639
|
+
slong: 9,
|
|
640
|
+
srational: 10
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
JSImageExif.Tag = {
|
|
644
|
+
orientation: 274,
|
|
645
|
+
};
|
|
646
|
+
|
|
539
647
|
})();
|
|
@@ -53,6 +53,10 @@ UILayerAnimatedProperty.prototype.define = function(C, key, extensions){
|
|
|
53
53
|
value: setter
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
|
+
getter._JSCustomProperty = this;
|
|
57
|
+
getter._JSCustomPropertyKey = key;
|
|
58
|
+
setter._JSCustomProperty = this;
|
|
59
|
+
setter._JSCustomPropertyKey = key;
|
|
56
60
|
Object.defineProperty(C.prototype, key, {
|
|
57
61
|
configurable: false,
|
|
58
62
|
enumerable: false,
|
|
@@ -496,19 +496,13 @@ JSClass("UISplitView", UIView, {
|
|
|
496
496
|
var leadingSize = z - dividerZ + divider.layoutAdjustment;
|
|
497
497
|
if (this._leadingCollapses && leadingSize < this._minimumLeadingSize / 2){
|
|
498
498
|
if (this._leadingViewOpen){
|
|
499
|
-
this.leadingViewOpen = false;
|
|
500
499
|
this.leadingSize = this._previousLeadingSize;
|
|
501
|
-
|
|
502
|
-
this.delegate.splitViewDidToggleView(this, this._leadingView);
|
|
503
|
-
}
|
|
500
|
+
this.leadingViewOpen = false;
|
|
504
501
|
}
|
|
505
502
|
}else{
|
|
506
503
|
if (!this._leadingViewOpen){
|
|
507
|
-
this.leadingViewOpen = true;
|
|
508
504
|
this.leadingSize = this._minimumLeadingSize;
|
|
509
|
-
|
|
510
|
-
this.delegate.splitViewDidToggleView(this, this._leadingView);
|
|
511
|
-
}
|
|
505
|
+
this.leadingViewOpen = true;
|
|
512
506
|
}
|
|
513
507
|
if (leadingSize >= this._minimumLeadingSize && leadingSize <= maximumLeadingSize){
|
|
514
508
|
this._leadingSize = leadingSize;
|
|
@@ -526,19 +520,13 @@ JSClass("UISplitView", UIView, {
|
|
|
526
520
|
var trailingSize = boundsSize - z + dividerZ - divider.layoutAdjustment;
|
|
527
521
|
if (this._trailingCollapses && trailingSize < this._minimumTrailingSize / 2){
|
|
528
522
|
if (this._trailingViewOpen){
|
|
529
|
-
this.trailingViewOpen = false;
|
|
530
523
|
this.trailingSize = this._previousTrailingSize;
|
|
531
|
-
|
|
532
|
-
this.delegate.splitViewDidToggleView(this, this._trailingView);
|
|
533
|
-
}
|
|
524
|
+
this.trailingViewOpen = false;
|
|
534
525
|
}
|
|
535
526
|
}else{
|
|
536
527
|
if (!this._trailingViewOpen){
|
|
537
|
-
this.trailingViewOpen = true;
|
|
538
528
|
this.trailingSize = this._minimumTrailingSize;
|
|
539
|
-
|
|
540
|
-
this.delegate.splitViewDidToggleView(this, this._trailingView);
|
|
541
|
-
}
|
|
529
|
+
this.trailingViewOpen = true;
|
|
542
530
|
}
|
|
543
531
|
if (trailingSize >= this._minimumTrailingSize && trailingSize <= maximumTrailingSize){
|
|
544
532
|
this._trailingSize = trailingSize;
|
|
@@ -35,15 +35,30 @@ JSGlobalObject.UIViewLayerProperty = function(){
|
|
|
35
35
|
UIViewLayerProperty.prototype = Object.create(JSCustomProperty.prototype);
|
|
36
36
|
|
|
37
37
|
UIViewLayerProperty.prototype.define = function(C, key, extensions){
|
|
38
|
+
var setterName = C.nameOfSetMethodForKey(key);
|
|
39
|
+
var setter = extensions[setterName];
|
|
40
|
+
if (!setter){
|
|
41
|
+
setter = function UIView_setLayerProperty(value){
|
|
42
|
+
this.layer[key] = value;
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(C.prototype, setterName, {
|
|
45
|
+
configurable: true,
|
|
46
|
+
enumerable: false,
|
|
47
|
+
value: setter
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
var getter = function UIView_getLayerProperty(){
|
|
51
|
+
return this.layer[key];
|
|
52
|
+
};
|
|
53
|
+
getter._JSCustomProperty = this;
|
|
54
|
+
getter._JSCustomPropertyKey = key;
|
|
55
|
+
setter._JSCustomProperty = this;
|
|
56
|
+
setter._JSCustomPropertyKey = key;
|
|
38
57
|
Object.defineProperty(C.prototype, key, {
|
|
39
58
|
configurable: false,
|
|
40
59
|
enumerable: false,
|
|
41
|
-
set:
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
get: function UIView_getLayerProperty(){
|
|
45
|
-
return this.layer[key];
|
|
46
|
-
}
|
|
60
|
+
set: setter,
|
|
61
|
+
get: getter
|
|
47
62
|
});
|
|
48
63
|
};
|
|
49
64
|
|
|
@@ -514,6 +514,13 @@ JSClass('UIWindow', UIView, {
|
|
|
514
514
|
}
|
|
515
515
|
},
|
|
516
516
|
|
|
517
|
+
setHidden: function(hidden){
|
|
518
|
+
UIWindow.$super.setHidden.call(this, hidden);
|
|
519
|
+
if (this._modal !== null){
|
|
520
|
+
this._modal.hidden = hidden;
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
|
|
517
524
|
// -------------------------------------------------------------------------
|
|
518
525
|
// MARK: - Window Server
|
|
519
526
|
|
package/package.json
CHANGED
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
"bugs": {
|
|
5
5
|
"url": "https://github.com/breakside/JSKit/issues"
|
|
6
6
|
},
|
|
7
|
-
"repository":
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/breakside/JSKit.git"
|
|
10
|
+
},
|
|
8
11
|
"engines": {
|
|
9
12
|
"node": ">=10.10.0"
|
|
10
13
|
},
|
|
11
14
|
"name": "@breakside/jskit",
|
|
12
|
-
"version": "2025.
|
|
15
|
+
"version": "2025.53.0",
|
|
13
16
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
14
17
|
"files": [
|
|
15
18
|
"*"
|