@breakside/jskit 2021.52.0 → 2022.3.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 (60) hide show
  1. package/Frameworks/DOM.jsframework/Info.json +2 -2
  2. package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
  3. package/Frameworks/FontKit.jsframework/Info.json +2 -2
  4. package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
  5. package/Frameworks/Foundation.jsframework/Info.json +2 -2
  6. package/Frameworks/Foundation.jsframework/JS/JSColorSpace.js +106 -20
  7. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  8. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  9. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  10. package/Info.json +2 -2
  11. package/Node/io.breakside.jskit-bundle.js +2 -2
  12. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  13. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  14. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  15. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  16. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  17. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  18. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  19. package/Root/Frameworks/DOM/Info.yaml +1 -1
  20. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  21. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  22. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  23. package/Root/Frameworks/Foundation/JSColorSpace.js +106 -20
  24. package/Root/Frameworks/ImageKit/IKColorProfile.js +979 -0
  25. package/Root/Frameworks/ImageKit/IKColorSpace.js +49 -198
  26. package/Root/Frameworks/ImageKit/IKMatrix.js +124 -0
  27. package/Root/Frameworks/ImageKit/ImageKit.js +2 -0
  28. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  29. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  30. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  31. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  32. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  33. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  34. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  35. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  36. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  37. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  38. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  39. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  40. package/Root/Frameworks/UIKit/UICollectionReusableView.js +91 -0
  41. package/Root/Frameworks/UIKit/UICollectionView.js +1254 -0
  42. package/Root/Frameworks/UIKit/UICollectionViewCell.js +121 -0
  43. package/Root/Frameworks/UIKit/UICollectionViewGridLayout.js +425 -0
  44. package/Root/Frameworks/UIKit/UICollectionViewLayout.js +82 -0
  45. package/Root/Frameworks/UIKit/UIColorWell.js +12 -1
  46. package/Root/Frameworks/UIKit/UIDisplayServer.js +5 -1
  47. package/Root/Frameworks/UIKit/UIKit.js +7 -0
  48. package/Root/Frameworks/UIKit/UILayer.js +3 -0
  49. package/Root/Frameworks/UIKit/UIListView.js +8 -9
  50. package/Root/Frameworks/UIKit/UIMenu.js +1 -1
  51. package/Root/Frameworks/UIKit/UIMenuView.js +5 -1
  52. package/Root/Frameworks/UIKit/UINavigationBar.js +2 -2
  53. package/Root/Frameworks/UIKit/UIPopupButton.js +31 -3
  54. package/Root/Frameworks/UIKit/UIScrollView.js +2 -0
  55. package/Root/Frameworks/UIKit/UISplitViewController.js +43 -9
  56. package/Root/Frameworks/UIKit/UITextField.js +3 -0
  57. package/Root/Frameworks/UIKit/UIView.js +3 -0
  58. package/Root/Frameworks/UIKit/UIViewController.js +8 -0
  59. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  60. package/package.json +1 -1
@@ -14,6 +14,7 @@
14
14
  // limitations under the License.
15
15
 
16
16
  // #import Foundation
17
+ // #import "IKColorProfile.js"
17
18
  'use strict';
18
19
 
19
20
  (function(){
@@ -23,220 +24,70 @@ var logger = JSLog("imagekit", "colorspace");
23
24
  JSClass("IKColorSpace", JSColorSpace, {
24
25
 
25
26
  initWithProfileData: function(data){
26
- this._data = data;
27
- this._dataView = data.dataView();
28
- try{
29
- this._readHeader();
30
- this._readTags();
31
- this._createConnectionSpace();
32
- }catch (e){
33
- logger.error(e);
34
- return null;
35
- }
27
+ var profile = IKColorProfile.initWithData(data);
28
+ return this.initWithProfile(profile);
36
29
  },
37
30
 
38
- data: JSReadOnlyProperty('_data', null),
39
- _dataView: null,
40
-
41
- preferredCMM: 0,
42
- version: 0,
43
- profileClass: null,
44
- type: null,
45
- connectionType: null,
46
- createdDate: null,
47
- signature: null,
48
- platform: null,
49
- manufacturer: null,
50
- embedded: false,
51
- independent: false,
52
- model: null,
53
- renderingIntent: 0,
54
- creator: 0,
55
- id: null,
56
-
57
- _readHeader: function(){
58
- if (this._data.length < 128){
59
- throw new Error("Invalid profile, not enough data for header");
60
- }
61
- var data = this._data;
62
- var dataView = this._dataView;
63
- if (dataView.getUint32(0) != data.length){
64
- throw new Error("Invalid profile, size does not match data length");
31
+ initWithProfile: function(profile){
32
+ if (profile === undefined || profile === null){
33
+ return null;
65
34
  }
66
- this.preferredCMM = dataView.getUint32(4);
67
- this.version = dataView.getUint32(8);
68
- this.profileClass = String.initWithData(data.subdataInRange(JSRange(12, 4)), String.Encoding.latin1);
69
- this.type = String.initWithData(data.subdataInRange(JSRange(16, 4)), String.Encoding.latin1);
70
- this.connectionType = String.initWithData(data.subdataInRange(JSRange(20, 4)), String.Encoding.latin1);
71
- this.createdDate = JSCalendar.gregorian.dateFromComponents({
72
- year: dataView.getUint16(24),
73
- month: dataView.getUint16(26),
74
- day: dataView.getUint16(28),
75
- hour: dataView.getUint16(30),
76
- minute: dataView.getUint16(32),
77
- second: dataView.getUint16(34)
78
- });
79
- this.signature = String.initWithData(data.subdataInRange(JSRange(36, 4)), String.Encoding.latin1);
80
- this.platform = String.initWithData(data.subdataInRange(JSRange(40, 4)), String.Encoding.latin1);
81
- var flags = dataView.getUint32(44);
82
- this.embedded = (flags & 0x01) === 0x01;
83
- this.independent = (flags & 0x02) === 0x02;
84
- this.manufacturer = dataView.getUint32(48);
85
- this.model = dataView.getUint32(52);
86
- // attributes1: dataView.getUint32(56),
87
- // attributes2: dataView.getUint32(60),
88
- this.renderingIntent = dataView.getUint32(64);
89
- this.connectionWhitepoint = XYZ32(dataView.getUint32(68), dataView.getUint32(72), dataView.getUint32(76));
90
- this.creator = dataView.getUint32(80);
91
- this.id = data.subdataInRange(JSRange(84, 16)).hexStringRepresentation();
92
- },
93
-
94
- _tags: null,
95
-
96
- _readTags: function(){
97
- if (this._data.length < 128){
98
- throw new Error("Invalid profile, not enough data for tag count");
35
+ if (profile.profileClass === IKColorProfile.ProfileClass.deviceLink){
36
+ logger.warn("color profile must not be a device link class");
37
+ return null;
99
38
  }
100
- var tagCount = this._dataView.getUint32(128);
101
- if (this._data.length < 132 + tagCount * 12){
102
- throw new Error("Invalid profile, not enough data for tag table");
39
+ if (profile.connectionWhitepoint !== JSColorSpace.Whitepoint.D50){
40
+ logger.warn("color profile must use the D50 pcs illuminant");
41
+ return null;
103
42
  }
104
- var offset = 132;
105
- this._tags = {};
106
- var tag;
107
- for (var i = 0; i < tagCount; ++i){
108
- tag = {
109
- name: String.initWithData(this._data.subdataInRange(JSRange(offset, 4)), String.Encoding.latin1),
110
- range: JSRange(this._dataView.getUint32(offset + 4), this._dataView.getUint32(offset + 8))
111
- };
112
- if (tag.range.end > this._data.length){
113
- throw new Error("Invalid profile, not enough data for tag %s at %d (%d)".sprintf(tag.name, tag.range.location, tag.range.length));
114
- }
115
- this._tags[tag.name.trim()] = tag;
116
- offset += 12;
43
+ if (profile.connectionSpace === IKColorProfile.ColorSpace.lab){
44
+ this._connectionSpace = JSColorSpace.lab;
45
+ }else if (profile.connectionSpace === IKColorProfile.ColorSpace.xyz){
46
+ this._connectionSpace = JSColorSpace.xyz;
47
+ }else{
48
+ logger.warn("color profile must have a Lab or XYZ connection space");
49
+ return null;
117
50
  }
118
- },
119
-
120
- connectionSpace: null,
121
- connectionWhitepoint: null,
122
-
123
- _createConnectionSpace: function(){
124
- if (this._header.connectionType == IKColorSpace.Type.lab){
125
- this.connectionSpace = JSLabColorSpace.initWithWhitepoint(this.mediaWhitepoint);
126
- }else if (this._header.connectionType == IKColorSpace.Type.xyz){
127
- this.connectionSpace = JSXYZColorSpace.initWithWhitepoint(this.mediaWhitepoint, JSColorSpace.Whitepoint.D50);
51
+ if (profile.numberOfComponents === 1 && profile.grayToneReproductionCurve !== null){
52
+ this._componentConverter = IKColorProfileCurveComponentConverter.initWithCurve(profile.grayToneReproductionCurve.fn);
53
+ }else if (profile.aToB0 !== null && profile.bToA0 !== null){
54
+ this._componentConverter = IKColorProfileLookupComponentConverter.initWithLookupTables(profile.aToB0, profile.bToA0, profile.connectionSpace);
55
+ }else if (profile.redToneReproductionCurve !== null && profile.greenToneReproductionCurve !== null && profile.blueToneReproductionCurve !== null && profile.redMatrixColumn !== null && profile.greenMatrixColumn !== null && profile.blueMatrixColumn !== null){
56
+ var matrix = [
57
+ [profile.redMatrixColumn.value[0], profile.greenMatrixColumn.value[0], profile.blueMatrixColumn.value[0]],
58
+ [profile.redMatrixColumn.value[1], profile.greenMatrixColumn.value[1], profile.blueMatrixColumn.value[1]],
59
+ [profile.redMatrixColumn.value[2], profile.greenMatrixColumn.value[2], profile.blueMatrixColumn.value[2]]
60
+ ];
61
+ var curves = [
62
+ profile.redToneReproductionCurve.fn,
63
+ profile.greenToneReproductionCurve.fn,
64
+ profile.blueToneReproductionCurve.fn
65
+ ];
66
+ this._componentConverter = IKColorProfileMatrixComponentConverter.initWithMatrix(matrix, curves);
128
67
  }else{
129
- throw new Error("Invalid profile, connection space must be Lab or XYZ");
68
+ logger.warn("color profile does not contain supported conversion tags");
69
+ return null;
130
70
  }
71
+ // TODO: anything with media white point?
72
+ this._profile = profile;
73
+ this.numberOfComponents = profile.numberOfComponents;
74
+ this.name = "icc-%s".sprintf(profile.colorSpace.trim());
131
75
  },
132
76
 
77
+ profile: JSReadOnlyProperty("_profile", null),
78
+ connectionSpace:JSReadOnlyProperty("_connectionSpace", null),
79
+ _componentConverter: null,
80
+
133
81
  xyzFromComponents: function(components){
134
- var connectionComponents = this.connectionComponentsFromComponents(components);
135
- return this.connectionSpace.xyzFromComponents(connectionComponents);
82
+ var connectionComponents = this._componentConverter.connectionComponentsFromComponents(components);
83
+ return this._connectionSpace.xyzFromComponents(connectionComponents);
136
84
  },
137
85
 
138
86
  componentsFromXYZ: function(xyz){
139
- var connectionComponents = this.connectionSpace.componentsFromXYZ(xyz);
140
- return this.componentsFromConnectionComponents(connectionComponents);
141
- },
142
-
143
- connectionComponentsFromComponents: function(components){
144
- // TODO:
87
+ var connectionComponents = this._connectionSpace.componentsFromXYZ(xyz);
88
+ return this._componentConverter.componentsFromConnectionComponents(connectionComponents);
145
89
  },
146
90
 
147
- componentsFromConnectionComponents: function(connectionComponents){
148
- // TODO:
149
- },
150
-
151
- mediaWhitepoint: JSLazyInitProperty("_readMediaWhitepoint"),
152
-
153
- _readMediaWhitepoint: function(){
154
- var tag = this.tags.wtpt;
155
- if (!tag){
156
- throw new Error("wtpt tag not found");
157
- }
158
- return XYZ32(
159
- this._dataView.getUint32(tag.offset + 8),
160
- this._dataView.getUint32(tag.offset + 12),
161
- this._dataView.getUint32(tag.offset + 16)
162
- );
163
- }
164
-
165
91
  });
166
92
 
167
- var s15Fixed16 = function(i){
168
- var f = ((i & 0x7FFF0000) >> 16) + ((i & 0xFFFF) / 65536.0);
169
- if (i & (0x80000000) != 0){
170
- return -f;
171
- }
172
- return f;
173
- };
174
-
175
- var u8Fixed8 = function(i){
176
- return (i >> 8) + ((i & 0xFF) / 256.0);
177
- };
178
-
179
- var XYZ32 = function(x, y, z){
180
- if (x == 0x0000F6D6 && y == 0x00010000 && z == 0x0000D32D){
181
- return JSColorSpace.Whitepoint.D50;
182
- }
183
- return [
184
- s15Fixed16(x),
185
- s15Fixed16(y),
186
- s15Fixed16(z)
187
- ];
188
- };
189
-
190
- IKColorSpace.ProfileClass = {
191
- input: "scnr",
192
- display: "mntr",
193
- output: "prtr",
194
- deviceLink: "link",
195
- colorSpace: "spac",
196
- abstract: "abst",
197
- namedColor: "nmcl"
198
- };
199
-
200
- IKColorSpace.Type = {
201
- xyz: "XYZ ",
202
- lab: "Lab ",
203
- luv: "Luv ",
204
- ycbcr: "YCbr",
205
- yxy: "Yxy ",
206
- rgb: "RGB",
207
- gray: "GRAY",
208
- hsv: "HSV ",
209
- hls: "HLS ",
210
- cmyk: "CMYK",
211
- cmy: "CMY ",
212
- twoColor: "2CLR",
213
- threeColor: "3CLR",
214
- fourColor: "4CLR",
215
- fiveColor: "5CLR",
216
- sixColor: "6CLR",
217
- sevenColor: "7CLR",
218
- eightColor: "8CLR",
219
- nineColor: "9CLR",
220
- tenColor: "ACLR",
221
- elevenColor: "BCLR",
222
- twelveColor: "CCLR",
223
- thirteenColor: "DCLR",
224
- fourteenColor: "ECLR",
225
- fifteenColor: "FCLR"
226
- };
227
-
228
- IKColorSpace.Platform = {
229
- apple: "APPL",
230
- microsoft: "MSFT",
231
- siliconGraphics: "SGI ",
232
- sunMicrosystems: "SUNW"
233
- };
234
-
235
- IKColorSpace.RenderingIntent = {
236
- perceptual: 0,
237
- mediaRelative: 1,
238
- saturation: 2,
239
- absolute: 3
240
- };
241
-
242
93
  })();
@@ -0,0 +1,124 @@
1
+ // // Copyright 2022 Breakside Inc.
2
+ //
3
+ // Licensed under the Breakside Public License, Version 1.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // If a copy of the License was not distributed with this file, you may
6
+ // obtain a copy at
7
+ //
8
+ // http://breakside.io/licenses/LICENSE-1.0.txt
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ // #import Foundation
17
+ 'use strict';
18
+
19
+ JSGlobalObject.IKMatrix = function(m){
20
+ Object.defineProperties(m, {
21
+ rows: {
22
+ configurable: true,
23
+ enumerable: false,
24
+ value: m.length
25
+ },
26
+ columns: {
27
+ configurable: true,
28
+ enumerable: false,
29
+ value: m.length > 0 ? m[0].length : 0
30
+ },
31
+ determinant: {
32
+ configurable: true,
33
+ enumerable: false,
34
+ value: function(){
35
+ if (m.rows === 2 && m.columns === 2){
36
+ return m[0][0] * m[1][1] - m[0][1] * m[1][0];
37
+ }
38
+ if (m.rows === 3 && m.columns === 3){
39
+ return m[0][0] * m[1][1] * m[2][2] -
40
+ m[0][0] * m[1][2] * m[2][1] -
41
+ m[0][1] * m[1][0] * m[2][2] +
42
+ m[0][1] * m[1][2] * m[2][0] +
43
+ m[0][2] * m[1][0] * m[2][1] -
44
+ m[0][2] * m[1][1] * m[2][0];
45
+ }
46
+ throw new Error("Unable to compute %dx%d determinant".sprintf(m.rows, m.columns));
47
+ }
48
+ },
49
+ inverse: {
50
+ configurable: true,
51
+ enumerable: false,
52
+ value: function(){
53
+ if (m.rows === 2 && m.columns === 2){
54
+ return IKMatrix([
55
+ [m[1][1], -m[0][1]],
56
+ [-m[1][0], m[0][0]]
57
+ ]).multiplied(1.0 / m.determinant());
58
+ }
59
+ if (m.rows === 3 && m.columns === 3){
60
+ return IKMatrix([
61
+ [
62
+ IKMatrix([
63
+ [m[1][1], m[1][2]],
64
+ [m[2][1], m[2][2]]
65
+ ]).determinant(),
66
+ IKMatrix([
67
+ [m[0][2], m[0][1]],
68
+ [m[2][2], m[2][1]]
69
+ ]).determinant(),
70
+ IKMatrix([
71
+ [m[0][1], m[0][2]],
72
+ [m[1][1], m[1][2]]
73
+ ]).determinant()
74
+ ],
75
+ [
76
+ IKMatrix([
77
+ [m[1][2], m[1][0]],
78
+ [m[2][2], m[2][0]]
79
+ ]).determinant(),
80
+ IKMatrix([
81
+ [m[0][0], m[0][2]],
82
+ [m[2][0], m[2][2]]
83
+ ]).determinant(),
84
+ IKMatrix([
85
+ [m[0][2], m[0][0]],
86
+ [m[1][2], m[1][0]]
87
+ ]).determinant()
88
+ ],
89
+ [
90
+ IKMatrix([
91
+ [m[1][0], m[1][1]],
92
+ [m[2][0], m[2][1]]
93
+ ]).determinant(),
94
+ IKMatrix([
95
+ [m[0][1], m[0][0]],
96
+ [m[2][1], m[2][0]]
97
+ ]).determinant(),
98
+ IKMatrix([
99
+ [m[0][0], m[0][1]],
100
+ [m[1][0], m[1][1]]
101
+ ]).determinant()
102
+ ]
103
+ ]).multiplied(1.0 / m.determinant());
104
+ }
105
+ throw new Error("Unable to compute %dx%d inverse".sprintf(m.rows, m.columns));
106
+ }
107
+ },
108
+ multiplied: {
109
+ configurable: true,
110
+ enumerable: false,
111
+ value: function(x){
112
+ var result = IKMatrix(JSDeepCopy(m));
113
+ var row, col;
114
+ for (row = 0; row < result.rows; ++row){
115
+ for (col = 0; col < result.columns; ++col){
116
+ result[row][col] *= x;
117
+ }
118
+ }
119
+ return result;
120
+ }
121
+ }
122
+ });
123
+ return m;
124
+ };
@@ -21,4 +21,6 @@
21
21
  // #import "IKEncoderJPEG.js"
22
22
  // #import "IKEncoderPNG.js"
23
23
  // #import "IKColorSpace.js"
24
+ // #import "IKColorProfile.js"
25
+ // #import "IKMatrix.js"
24
26
  // #import "JSImage+IKBitmap.js"
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.MediaKitUI
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.NotificationKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2021 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.PDFKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.QRKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SearchKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.SecurityKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ServerKitTesting
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.TestKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKit
3
- JSBundleVersion: 2021.52.0
3
+ JSBundleVersion: 2022.3.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -0,0 +1,91 @@
1
+ // Copyright 2022 Breakside Inc.
2
+ //
3
+ // Licensed under the Breakside Public License, Version 1.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // If a copy of the License was not distributed with this file, you may
6
+ // obtain a copy at
7
+ //
8
+ // http://breakside.io/licenses/LICENSE-1.0.txt
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ // #import "UIView.js"
17
+ // #import "UILabel.js"
18
+ // #import "UIImageView.js"
19
+ 'use strict';
20
+
21
+ JSClass("UICollectionReusableView", UIView, {
22
+
23
+ collectionView: null,
24
+ indexPath: null,
25
+ reuseIdentifier: null,
26
+ contentView: JSReadOnlyProperty('_contentView', null),
27
+ stylerProperties: null,
28
+ _styler: null,
29
+
30
+ initWithReuseIdentifier: function(identifier, styler){
31
+ this.init();
32
+ this.reuseIdentifier = identifier;
33
+ this._styler = styler;
34
+ },
35
+
36
+ initWithFrame: function(frame){
37
+ UICollectionReusableView.$super.initWithFrame.call(this, frame);
38
+ this._commonReusableViewInit();
39
+ },
40
+
41
+ initWithSpec: function(spec){
42
+ UICollectionReusableView.$super.initWithSpec.call(this, spec);
43
+ this._commonReusableViewInit();
44
+ },
45
+
46
+ _commonReusableViewInit: function(){
47
+ this.stylerProperties = {};
48
+ this._contentView = UIView.init();
49
+ this.addSubview(this._contentView);
50
+ },
51
+
52
+ // --------------------------------------------------------------------
53
+ // MARK: - Applying Attributes
54
+
55
+ applyAttributes: function(attributes){
56
+ this.untransformedFrame = attributes.frame;
57
+ this.transform = attributes.transform;
58
+ },
59
+
60
+ // --------------------------------------------------------------------
61
+ // MARK: - Accessibility
62
+
63
+ getAccessibilityLabel: function(){
64
+ var label = UICollectionReusableView.$super.getAccessibilityLabel.call(this);
65
+ if (label !== null){
66
+ return label;
67
+ }
68
+ var stack = [this.contentView];
69
+ var view;
70
+ var i, l;
71
+ while (stack.length > 0){
72
+ view = stack.pop();
73
+ if (view.isKindOfClass(UILabel)){
74
+ return view.text;
75
+ }
76
+ for (i = 0, l = view.subviews.length; i < l; ++i){
77
+ stack.push(view.subviews[i]);
78
+ }
79
+ }
80
+ return null;
81
+ },
82
+
83
+ getAccessibilityElements: function(){
84
+ return this._contentView.accessibilityElements;
85
+ },
86
+
87
+ layoutSubviews: function(){
88
+ this.contentView.untransformedFrame = this.bounds;
89
+ }
90
+
91
+ });