@breakside/jskit 2023.21.0 → 2023.28.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/JS/DOMElement.js +8 -0
- package/Frameworks/DOM.jsframework/JS/XMLSerializer.js +29 -3
- 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/JSAttributedString.js +1 -1
- package/Frameworks/Foundation.jsframework/JS/JSImage.js +9 -7
- package/Frameworks/Foundation.jsframework/JS/JSTextLayoutManager.js +3 -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/Resources.js +21 -120
- 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/DOMElement.js +8 -0
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/DOM/XMLSerializer.js +29 -3
- 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/JSAttributedString.js +1 -1
- package/Root/Frameworks/Foundation/JSImage.js +9 -7
- package/Root/Frameworks/Foundation/JSTextLayoutManager.js +3 -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/UIButton.js +1 -1
- package/Root/Frameworks/UIKit/UIHTMLApplication.js +2 -0
- package/Root/Frameworks/UIKit/UIListView.js +4 -2
- package/Root/Frameworks/UIKit/UIPopupWindow.js +1 -0
- package/Root/Frameworks/UIKit/UITextEditor.js +15 -7
- package/Root/Frameworks/UIKit/UITextField.js +9 -0
- package/Root/Frameworks/UIKit/UITextLayer.js +4 -2
- package/Root/Frameworks/UIKit/UITokenField.js +1 -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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
13
13
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
|
|
16
16
|
// #import "DOMNode.js"
|
|
17
|
+
/* global XMLSerializer */
|
|
17
18
|
'use strict';
|
|
18
19
|
|
|
19
20
|
DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
@@ -107,6 +108,13 @@ DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
|
107
108
|
delete this._attributeMap[':global:'][name];
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
innerHTML: {
|
|
114
|
+
get: function DOMElement_innerHTML(){
|
|
115
|
+
var serializer = new XMLSerializer();
|
|
116
|
+
return serializer._serializeToString(this, true);
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
});
|
|
@@ -21,7 +21,12 @@ JSGlobalObject.XMLSerializer = function XMLSerializer(){
|
|
|
21
21
|
|
|
22
22
|
XMLSerializer.prototype = {
|
|
23
23
|
|
|
24
|
-
serializeToString: function(
|
|
24
|
+
serializeToString: function(node){
|
|
25
|
+
return this._serializeToString(node, false);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
_serializeToString: function(node, childrenOnly){
|
|
29
|
+
var document = node.ownerDocument || node;
|
|
25
30
|
var doctype = document.doctype;
|
|
26
31
|
var isHTML = doctype && doctype.name == "html";
|
|
27
32
|
var str = "";
|
|
@@ -127,10 +132,31 @@ XMLSerializer.prototype = {
|
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
134
|
|
|
130
|
-
if (!isHTML){
|
|
135
|
+
if (!isHTML && !childrenOnly){
|
|
131
136
|
str += '<?xml version="1.0" encoding="utf-8"?>\n';
|
|
132
137
|
}
|
|
133
|
-
|
|
138
|
+
if (childrenOnly){
|
|
139
|
+
var namespaces = {':global:': null};
|
|
140
|
+
if (node.nodeType === DOM.Node.ELEMENT_NODE){
|
|
141
|
+
if (node.namespaceURI !== null){
|
|
142
|
+
if (node.prefix !== null){
|
|
143
|
+
if (namespaces[node.prefix] != node.namespaceURI){
|
|
144
|
+
namespaces[node.prefix] = node.namespaceURI;
|
|
145
|
+
}
|
|
146
|
+
}else{
|
|
147
|
+
if (namespaces[':global:'] !== node.namespaceURI){
|
|
148
|
+
namespaces[':global:'] = node.namespaceURI;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var i, l;
|
|
154
|
+
for (i = 0, l = node.childNodes.length; i < l; ++i){
|
|
155
|
+
writeNode(node.childNodes[i], namespaces);
|
|
156
|
+
}
|
|
157
|
+
}else{
|
|
158
|
+
writeNode(node, {':global:': null});
|
|
159
|
+
}
|
|
134
160
|
|
|
135
161
|
return str;
|
|
136
162
|
}
|
|
@@ -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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
13
13
|
}
|
|
@@ -360,7 +360,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
360
360
|
var run = this._runs[runRange.location];
|
|
361
361
|
run.attributes = JSCopy(attributes);
|
|
362
362
|
if (runRange.length > 1){
|
|
363
|
-
run.range.length = this._runs[runRange.end - 1].end - run.range.location;
|
|
363
|
+
run.range.length = this._runs[runRange.end - 1].range.end - run.range.location;
|
|
364
364
|
this._runs.splice(runRange.location + 1, runRange.length - 1);
|
|
365
365
|
}
|
|
366
366
|
this._fixRunsInRunRange(JSRange(runRange.location, 1));
|
|
@@ -417,16 +417,18 @@ _JSDataImage.sizeFromSVGData = function(data){
|
|
|
417
417
|
return multiple[unit] * n;
|
|
418
418
|
};
|
|
419
419
|
if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
|
|
420
|
-
var width = attributes.get("width");
|
|
421
|
-
var height = attributes.get("height");
|
|
420
|
+
var width = px(attributes.get("width"));
|
|
421
|
+
var height = px(attributes.get("height"));
|
|
422
422
|
var viewBox = attributes.get("viewBox");
|
|
423
|
-
if (width && height){
|
|
424
|
-
size.width =
|
|
425
|
-
size.height =
|
|
423
|
+
if (width !== undefined && height !== undefined){
|
|
424
|
+
size.width = width;
|
|
425
|
+
size.height = height;
|
|
426
426
|
}else if (viewBox){
|
|
427
427
|
var box = viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
if (!isNaN(box[2]) && !isNaN(box[3])){
|
|
429
|
+
size.width = box[2];
|
|
430
|
+
size.height = box[3];
|
|
431
|
+
}
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
parser.stop();
|
|
@@ -72,6 +72,9 @@ JSClass("JSTextLayoutManager", JSObject, {
|
|
|
72
72
|
|
|
73
73
|
replaceTextStorage: function(storage){
|
|
74
74
|
var originalStorage = this._textStorage;
|
|
75
|
+
if (storage === originalStorage){
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
75
78
|
if (originalStorage !== null){
|
|
76
79
|
var managers = originalStorage.layoutManagers;
|
|
77
80
|
originalStorage.removeAllLayoutManagers();
|
|
@@ -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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
12
12
|
}
|
package/Node/Resources.js
CHANGED
|
@@ -291,136 +291,37 @@ var addMetadata = {
|
|
|
291
291
|
},
|
|
292
292
|
|
|
293
293
|
'.png': async function(name, contents, metadata){
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
contents[1] == 0x50 &&
|
|
298
|
-
contents[2] == 0x4E &&
|
|
299
|
-
contents[3] == 0x47 &&
|
|
300
|
-
contents[4] == 0x0D &&
|
|
301
|
-
contents[5] == 0x0A &&
|
|
302
|
-
contents[6] == 0x1A &&
|
|
303
|
-
contents[7] == 0x0A &&
|
|
304
|
-
|
|
305
|
-
// IHDR
|
|
306
|
-
contents[12] == 0x49 &&
|
|
307
|
-
contents[13] == 0x48 &&
|
|
308
|
-
contents[14] == 0x44 &&
|
|
309
|
-
contents[15] == 0x52)
|
|
310
|
-
{
|
|
311
|
-
var dataView = contents.dataView();
|
|
294
|
+
var contentType = JSImage.contentTypeOfData(contents);
|
|
295
|
+
if (contentType !== null && contentType.subtype === "png"){
|
|
296
|
+
var image = JSImage.initWithData(contents);
|
|
312
297
|
metadata.image = {
|
|
313
|
-
width:
|
|
314
|
-
height:
|
|
298
|
+
width: image.size.width,
|
|
299
|
+
height: image.size.height
|
|
315
300
|
};
|
|
316
301
|
}
|
|
317
302
|
},
|
|
318
303
|
|
|
319
304
|
'.jpg': async function(name, contents, metadata){
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var l = contents.length;
|
|
328
|
-
var blockLength;
|
|
329
|
-
var blockdata;
|
|
330
|
-
while (i < l){
|
|
331
|
-
b = contents[i++];
|
|
332
|
-
if (b != 0xFF){
|
|
333
|
-
// TODO: Error, not at a maker
|
|
334
|
-
return;
|
|
335
|
-
}
|
|
336
|
-
if (i == l){
|
|
337
|
-
// TODO: Error, not enough room for marker
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
b = contents[i++];
|
|
341
|
-
if (b == 0x00){
|
|
342
|
-
// TODO: Error, invalid marker
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
// D0-D9 are standalone markers...make sure not to look for a length
|
|
346
|
-
if (b < 0xD0 || b > 0xD9){
|
|
347
|
-
if (i >= l - 2){
|
|
348
|
-
// TODO: Error, not enough room for block header
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
blockLength = dataView.getUint16(i);
|
|
352
|
-
if (i + blockLength > l){
|
|
353
|
-
// TODO: Error, not enough room for block data
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
// C0-CF are start of frame blocks, expect for C4 and CC
|
|
357
|
-
// start of frame blocks have image sizes
|
|
358
|
-
if (b >= 0xC0 && b <= 0xCF && b != 0xC4 && b != 0xCC){
|
|
359
|
-
if (blockLength >= 7){
|
|
360
|
-
metadata.image = {
|
|
361
|
-
height: dataView.getUint16(i + 3),
|
|
362
|
-
width: dataView.getUint16(i + 5)
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
i += blockLength;
|
|
368
|
-
}
|
|
305
|
+
var contentType = JSImage.contentTypeOfData(contents);
|
|
306
|
+
if (contentType !== null && contentType.subtype === "jpeg"){
|
|
307
|
+
var image = JSImage.initWithData(contents);
|
|
308
|
+
metadata.image = {
|
|
309
|
+
width: image.size.width,
|
|
310
|
+
height: image.size.height
|
|
311
|
+
};
|
|
369
312
|
}
|
|
370
313
|
},
|
|
371
314
|
|
|
372
315
|
'.svg': async function(name, contents, metadata){
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
'px': 1,
|
|
383
|
-
'in': 72,
|
|
384
|
-
'cm': 72/2.54,
|
|
385
|
-
'mm': 72/25.4,
|
|
386
|
-
'pt': 1,
|
|
387
|
-
'pc': 12
|
|
388
|
-
};
|
|
389
|
-
var px = function(length){
|
|
390
|
-
if (length === undefined || length === null){
|
|
391
|
-
return undefined;
|
|
392
|
-
}
|
|
393
|
-
var matches = length.match(/^\s*(\d+)\s*(em|ex|px|in|cm|mm|pt|pc|%)?\s*$/);
|
|
394
|
-
if (!matches){
|
|
395
|
-
return undefined;
|
|
396
|
-
}
|
|
397
|
-
let n = parseInt(matches[1]);
|
|
398
|
-
if (!matches[2]){
|
|
399
|
-
return n;
|
|
400
|
-
}
|
|
401
|
-
let unit = matches[2];
|
|
402
|
-
if (unit == '%'){
|
|
403
|
-
return undefined;
|
|
404
|
-
}
|
|
405
|
-
return multiple[unit] * n;
|
|
406
|
-
};
|
|
407
|
-
if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
|
|
408
|
-
let width = attributes.get("width");
|
|
409
|
-
let height = attributes.get("height");
|
|
410
|
-
let viewBox = attributes.get("viewBox");
|
|
411
|
-
if (width && height){
|
|
412
|
-
metadata.image.width = px(width);
|
|
413
|
-
metadata.image.height = px(height);
|
|
414
|
-
}else if (viewBox){
|
|
415
|
-
var box = viewBox.split(/\s+/).map(n => parseInt(n));
|
|
416
|
-
metadata.image.width = box[2];
|
|
417
|
-
metadata.image.height = box[3];
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
parser.stop();
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
parser.parse();
|
|
316
|
+
var contentType = JSImage.contentTypeOfData(contents);
|
|
317
|
+
if (contentType !== null && contentType.subtype === "svg+xml"){
|
|
318
|
+
var image = JSImage.initWithData(contents);
|
|
319
|
+
metadata.image = {
|
|
320
|
+
vector: true,
|
|
321
|
+
width: image.size.width,
|
|
322
|
+
height: image.size.height
|
|
323
|
+
};
|
|
324
|
+
}
|
|
424
325
|
},
|
|
425
326
|
|
|
426
327
|
'.ttf': async function(name, contents, metadata){
|
|
@@ -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.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
|
|
16
16
|
// #import "DOMNode.js"
|
|
17
|
+
/* global XMLSerializer */
|
|
17
18
|
'use strict';
|
|
18
19
|
|
|
19
20
|
DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
@@ -107,6 +108,13 @@ DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
|
107
108
|
delete this._attributeMap[':global:'][name];
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
innerHTML: {
|
|
114
|
+
get: function DOMElement_innerHTML(){
|
|
115
|
+
var serializer = new XMLSerializer();
|
|
116
|
+
return serializer._serializeToString(this, true);
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
});
|
|
@@ -21,7 +21,12 @@ JSGlobalObject.XMLSerializer = function XMLSerializer(){
|
|
|
21
21
|
|
|
22
22
|
XMLSerializer.prototype = {
|
|
23
23
|
|
|
24
|
-
serializeToString: function(
|
|
24
|
+
serializeToString: function(node){
|
|
25
|
+
return this._serializeToString(node, false);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
_serializeToString: function(node, childrenOnly){
|
|
29
|
+
var document = node.ownerDocument || node;
|
|
25
30
|
var doctype = document.doctype;
|
|
26
31
|
var isHTML = doctype && doctype.name == "html";
|
|
27
32
|
var str = "";
|
|
@@ -127,10 +132,31 @@ XMLSerializer.prototype = {
|
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
134
|
|
|
130
|
-
if (!isHTML){
|
|
135
|
+
if (!isHTML && !childrenOnly){
|
|
131
136
|
str += '<?xml version="1.0" encoding="utf-8"?>\n';
|
|
132
137
|
}
|
|
133
|
-
|
|
138
|
+
if (childrenOnly){
|
|
139
|
+
var namespaces = {':global:': null};
|
|
140
|
+
if (node.nodeType === DOM.Node.ELEMENT_NODE){
|
|
141
|
+
if (node.namespaceURI !== null){
|
|
142
|
+
if (node.prefix !== null){
|
|
143
|
+
if (namespaces[node.prefix] != node.namespaceURI){
|
|
144
|
+
namespaces[node.prefix] = node.namespaceURI;
|
|
145
|
+
}
|
|
146
|
+
}else{
|
|
147
|
+
if (namespaces[':global:'] !== node.namespaceURI){
|
|
148
|
+
namespaces[':global:'] = node.namespaceURI;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var i, l;
|
|
154
|
+
for (i = 0, l = node.childNodes.length; i < l; ++i){
|
|
155
|
+
writeNode(node.childNodes[i], namespaces);
|
|
156
|
+
}
|
|
157
|
+
}else{
|
|
158
|
+
writeNode(node, {':global:': null});
|
|
159
|
+
}
|
|
134
160
|
|
|
135
161
|
return str;
|
|
136
162
|
}
|
|
@@ -360,7 +360,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
360
360
|
var run = this._runs[runRange.location];
|
|
361
361
|
run.attributes = JSCopy(attributes);
|
|
362
362
|
if (runRange.length > 1){
|
|
363
|
-
run.range.length = this._runs[runRange.end - 1].end - run.range.location;
|
|
363
|
+
run.range.length = this._runs[runRange.end - 1].range.end - run.range.location;
|
|
364
364
|
this._runs.splice(runRange.location + 1, runRange.length - 1);
|
|
365
365
|
}
|
|
366
366
|
this._fixRunsInRunRange(JSRange(runRange.location, 1));
|
|
@@ -417,16 +417,18 @@ _JSDataImage.sizeFromSVGData = function(data){
|
|
|
417
417
|
return multiple[unit] * n;
|
|
418
418
|
};
|
|
419
419
|
if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
|
|
420
|
-
var width = attributes.get("width");
|
|
421
|
-
var height = attributes.get("height");
|
|
420
|
+
var width = px(attributes.get("width"));
|
|
421
|
+
var height = px(attributes.get("height"));
|
|
422
422
|
var viewBox = attributes.get("viewBox");
|
|
423
|
-
if (width && height){
|
|
424
|
-
size.width =
|
|
425
|
-
size.height =
|
|
423
|
+
if (width !== undefined && height !== undefined){
|
|
424
|
+
size.width = width;
|
|
425
|
+
size.height = height;
|
|
426
426
|
}else if (viewBox){
|
|
427
427
|
var box = viewBox.split(/\s+/).map(function(n){ return parseInt(n); });
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
if (!isNaN(box[2]) && !isNaN(box[3])){
|
|
429
|
+
size.width = box[2];
|
|
430
|
+
size.height = box[3];
|
|
431
|
+
}
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
parser.stop();
|
|
@@ -72,6 +72,9 @@ JSClass("JSTextLayoutManager", JSObject, {
|
|
|
72
72
|
|
|
73
73
|
replaceTextStorage: function(storage){
|
|
74
74
|
var originalStorage = this._textStorage;
|
|
75
|
+
if (storage === originalStorage){
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
75
78
|
if (originalStorage !== null){
|
|
76
79
|
var managers = originalStorage.layoutManagers;
|
|
77
80
|
originalStorage.removeAllLayoutManagers();
|
|
@@ -214,7 +214,7 @@ JSClass("UIButton", UIControl, {
|
|
|
214
214
|
this.active = false;
|
|
215
215
|
}
|
|
216
216
|
var location = event.locationInView(this);
|
|
217
|
-
this.over = this.window !== null && this.containsPoint(location);
|
|
217
|
+
this.over = this.enabled && this.window !== null && this.containsPoint(location);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
UIButton.$super.mouseUp.call(this, event);
|
|
@@ -305,6 +305,8 @@ JSGlobalObject.UIApplicationMain = function(rootElement, bootstrapper){
|
|
|
305
305
|
application.run(function(error){
|
|
306
306
|
if (error === null){
|
|
307
307
|
application.addEventListeners();
|
|
308
|
+
}else{
|
|
309
|
+
application.windowServer.stop();
|
|
308
310
|
}
|
|
309
311
|
if (bootstrapper){
|
|
310
312
|
bootstrapper.applicationLaunchResult(application, error);
|
|
@@ -535,9 +535,10 @@ JSClass("UIListView", UIScrollView, {
|
|
|
535
535
|
},
|
|
536
536
|
|
|
537
537
|
_approximateYForVisibleItem: function(item){
|
|
538
|
+
var y;
|
|
538
539
|
if (item.kind === VisibleItem.Kind.cell){
|
|
539
540
|
var row = this._sectionRowForIndexPath(item.indexPath);
|
|
540
|
-
|
|
541
|
+
y = this._approximateYForSection(item.indexPath.section);
|
|
541
542
|
y += this._approximateYForSectionRow(item.indexPath.section, row);
|
|
542
543
|
return y;
|
|
543
544
|
}
|
|
@@ -545,7 +546,8 @@ JSClass("UIListView", UIScrollView, {
|
|
|
545
546
|
return this._approximateYForSection(item.indexPath.section);
|
|
546
547
|
}
|
|
547
548
|
if (item.kind === VisibleItem.Kind.footer){
|
|
548
|
-
|
|
549
|
+
y = this._approximateYForSection(item.indexPath.section);
|
|
550
|
+
return y + this._approximateYForSectionFooter(item.indexPath.section);
|
|
549
551
|
}
|
|
550
552
|
return 0;
|
|
551
553
|
},
|
|
@@ -394,6 +394,7 @@ JSClass("UIPopupWindowStyler", UIWindowStyler, {
|
|
|
394
394
|
},
|
|
395
395
|
|
|
396
396
|
layoutWindow: function(window){
|
|
397
|
+
UIPopupWindowStyler.$super.layoutWindow.call(this, window);
|
|
397
398
|
var contentInsets = JSInsets(window.contentInsets);
|
|
398
399
|
if (window._showsSourceArrow){
|
|
399
400
|
var popupBacking = window.stylerProperties.popupBacking;
|
|
@@ -475,7 +475,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
475
475
|
var selections = this._selectionsCopy();
|
|
476
476
|
for (i = 0, l = selections.length; i < l; ++i){
|
|
477
477
|
selection = selections[i];
|
|
478
|
-
this._setAttributeValueForSelection(name, value, selection);
|
|
478
|
+
this._setAttributeValueForSelection(name, value, selection, false);
|
|
479
479
|
}
|
|
480
480
|
this._setSelectionsAllowingUndo(selections);
|
|
481
481
|
this.undoManager.endUndoGrouping();
|
|
@@ -585,7 +585,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
585
585
|
var selections = this._selectionsCopy();
|
|
586
586
|
for (i = 0, l = selections.length; i < l; ++i){
|
|
587
587
|
selection = selections[i];
|
|
588
|
-
this._setAttributeValueForSelection(name, !currentValue, selection);
|
|
588
|
+
this._setAttributeValueForSelection(name, !currentValue, selection, true);
|
|
589
589
|
}
|
|
590
590
|
this._setSelectionsAllowingUndo(selections);
|
|
591
591
|
this.undoManager.endUndoGrouping();
|
|
@@ -593,17 +593,25 @@ JSClass("UITextEditor", JSObject, {
|
|
|
593
593
|
this._resetSelectionAffinity();
|
|
594
594
|
},
|
|
595
595
|
|
|
596
|
-
_setAttributeValueForSelection: function(name, value, selection){
|
|
596
|
+
_setAttributeValueForSelection: function(name, value, selection, expandingSelection){
|
|
597
597
|
var textStorage = this.textLayoutManager.textStorage;
|
|
598
|
+
var str = textStorage.string;
|
|
599
|
+
var range = selection.range;
|
|
600
|
+
if (expandingSelection && selection.range.length === 0){
|
|
601
|
+
range = str.rangeForWordAtIndex(selection.range.location);
|
|
602
|
+
if (selection.range.location === range.location || selection.range.location === range.end){
|
|
603
|
+
range = selection.range;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
598
606
|
var replacementString;
|
|
599
|
-
if (
|
|
600
|
-
replacementString = textStorage.attributedSubstringInRange(
|
|
607
|
+
if (range.length > 0){
|
|
608
|
+
replacementString = textStorage.attributedSubstringInRange(range);
|
|
601
609
|
if (value !== null && value !== undefined){
|
|
602
610
|
replacementString.addAttributeInRange(name, value, JSRange(0, replacementString.string.length));
|
|
603
611
|
}else{
|
|
604
612
|
replacementString.removeAttributeInRange(name, JSRange(0, replacementString.string.length));
|
|
605
613
|
}
|
|
606
|
-
this._replaceTextStorageRangeAllowingUndo(textStorage,
|
|
614
|
+
this._replaceTextStorageRangeAllowingUndo(textStorage, range, replacementString);
|
|
607
615
|
}else{
|
|
608
616
|
selection.attributes = this._insertAttributesForSelection(selection);
|
|
609
617
|
var currentValue = selection.attributes[name];
|
|
@@ -612,7 +620,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
612
620
|
}else{
|
|
613
621
|
delete selection.attributes[name];
|
|
614
622
|
}
|
|
615
|
-
this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection);
|
|
623
|
+
this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection, expandingSelection);
|
|
616
624
|
}
|
|
617
625
|
},
|
|
618
626
|
|
|
@@ -1407,6 +1407,7 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1407
1407
|
disabledBorderColor: null,
|
|
1408
1408
|
borderWidth: 0,
|
|
1409
1409
|
textColor: null,
|
|
1410
|
+
disabledTextColor: null,
|
|
1410
1411
|
placeholderColor: null,
|
|
1411
1412
|
cornerRadius: 0,
|
|
1412
1413
|
textInsets: null,
|
|
@@ -1442,6 +1443,11 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1442
1443
|
}else{
|
|
1443
1444
|
this.textColor = JSColor.text;
|
|
1444
1445
|
}
|
|
1446
|
+
if (spec.containsKey("disabledTextColor")){
|
|
1447
|
+
this.disabledTextColor = spec.valueForKey("disabledTextColor", JSColor);
|
|
1448
|
+
}else{
|
|
1449
|
+
this.disabledTextColor = this.textColor;
|
|
1450
|
+
}
|
|
1445
1451
|
if (spec.containsKey("placeholderColor")){
|
|
1446
1452
|
this.placeholderColor = spec.valueForKey("placeholderColor", JSColor);
|
|
1447
1453
|
}
|
|
@@ -1486,6 +1492,7 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1486
1492
|
if (textField.active){
|
|
1487
1493
|
textField.backgroundColor = this.activeBackgroundColor || this.backgroundColor;
|
|
1488
1494
|
textField.borderColor = this.activeBorderColor || this.borderColor;
|
|
1495
|
+
textField.textColor = this.textColor;
|
|
1489
1496
|
}else if (textField.enabled){
|
|
1490
1497
|
if (textField.over){
|
|
1491
1498
|
textField.backgroundColor = this.overBackgroundColor || this.backgroundColor;
|
|
@@ -1494,9 +1501,11 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1494
1501
|
textField.backgroundColor = this.backgroundColor;
|
|
1495
1502
|
textField.borderColor = this.borderColor;
|
|
1496
1503
|
}
|
|
1504
|
+
textField.textColor = this.textColor;
|
|
1497
1505
|
}else{
|
|
1498
1506
|
textField.backgroundColor = this.disabledBackgroundColor || this.backgroundColor;
|
|
1499
1507
|
textField.borderColor = this.disabledBorderColor || this.borderColor;
|
|
1508
|
+
textField.textColor = this.disabledTextColor;
|
|
1500
1509
|
}
|
|
1501
1510
|
},
|
|
1502
1511
|
|
|
@@ -167,8 +167,10 @@ JSClass("UITextLayer", UILayer, {
|
|
|
167
167
|
if (!text.isKindOfClass(JSTextStorage)){
|
|
168
168
|
text = JSTextStorage.initWithAttributedString(text);
|
|
169
169
|
}
|
|
170
|
-
this._textStorage
|
|
171
|
-
|
|
170
|
+
if (text !== this._textStorage){
|
|
171
|
+
this._textStorage = text;
|
|
172
|
+
this._textLayoutManager.replaceTextStorage(this._textStorage);
|
|
173
|
+
}
|
|
172
174
|
this.setNeedsDisplay();
|
|
173
175
|
this._displayQueued = true;
|
|
174
176
|
},
|
|
@@ -143,6 +143,7 @@ JSClass("UITokenField", UITextField, {
|
|
|
143
143
|
this.attributedText.replaceCharactersInRangeWithAttributedString(JSRange(range.location + indexAdjustment, range.length), attachmentString);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
this.sendActionsForEvents(UIControl.Event.primaryAction | UIControl.Event.valueChanged);
|
|
146
147
|
},
|
|
147
148
|
|
|
148
149
|
_convertStringToRepresentedObject: function(string, range){
|