@breakside/jskit 2023.14.2 → 2023.17.1

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 (45) 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/JSImage.js +13 -2
  7. package/Frameworks/Foundation.jsframework/JS/JSInsets.js +1 -1
  8. package/Frameworks/Foundation.jsframework/JS/JSXMLParser.js +13 -5
  9. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  10. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  11. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  12. package/Info.json +2 -2
  13. package/Node/Resources.js +1 -10
  14. package/Node/io.breakside.jskit-bundle.js +2 -2
  15. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  16. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  17. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  18. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  19. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  20. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  21. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  22. package/Root/Frameworks/DOM/Info.yaml +1 -1
  23. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  24. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  25. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  26. package/Root/Frameworks/Foundation/JSImage.js +13 -2
  27. package/Root/Frameworks/Foundation/JSInsets.js +1 -1
  28. package/Root/Frameworks/Foundation/JSXMLParser.js +13 -5
  29. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  30. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  31. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  32. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  33. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  34. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  35. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  36. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  37. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  38. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  39. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  40. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  41. package/Root/Frameworks/UIKit/UIControl.js +1 -1
  42. package/Root/Frameworks/UIKit/UIHTMLOpenPanel.js +17 -3
  43. package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +27 -2
  44. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  45. 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.14.2",
4
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
12
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
6
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
14
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
4
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
11
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
6
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
13
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
4
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
12
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
13
13
  }
@@ -314,8 +314,19 @@ JSImage.contentTypeOfData = function(data){
314
314
  return JSMediaType("image/png");
315
315
  }else if (data.length > 2 && data[0] == 0xFF && data[1] == 0xD8){
316
316
  return JSMediaType("image/jpeg");
317
- }else if (data.length > 5 && data[0] == 0x3C && data[1] == 0x3F && data[2] == 0x78 && data[3] == 0x6D && data[4] == 0x6C){
318
- return JSMediaType("image/svg+xml");
317
+ }else if (data.length > 0 && data[0] == 0x3C){
318
+ var parser = JSXMLParser.initWithData(data);
319
+ var contentType = null;
320
+ parser.delegate = {
321
+ xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
322
+ if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
323
+ contentType = JSMediaType("image/svg+xml");
324
+ }
325
+ parser.stop();
326
+ }
327
+ };
328
+ parser.parse();
329
+ return contentType;
319
330
  }
320
331
  return null;
321
332
  };
@@ -39,10 +39,10 @@ JSInsets.prototype = {
39
39
 
40
40
  insetsWithInsets: function(top, left, bottom, right){
41
41
  if (top instanceof JSInsets){
42
- top = top.top;
43
42
  left = top.left;
44
43
  bottom = top.bottom;
45
44
  right = top.right;
45
+ top = top.top;
46
46
  }
47
47
  if (left === undefined) left = top;
48
48
  if (bottom === undefined) bottom = top;
@@ -362,13 +362,21 @@ JSClass("JSXMLParser", JSObject, {
362
362
  var obj;
363
363
  if (isHTML){
364
364
  readWhitespace();
365
- }else{
366
- obj = readObject();
367
- if (obj === null || obj.kind != 'PI' || obj.name != 'xml'){
368
- throw new Error("Expecting <?xml at start of document");
369
- }
370
365
  }
371
366
  obj = readObject();
367
+ if (!isHTML){
368
+ if (obj === null){
369
+ throw new Error("Expecting XML prolog or root element");
370
+ }
371
+ if (obj.kind === "PI"){
372
+ if (obj.name != 'xml'){
373
+ throw new Error("Expecting XML prolog");
374
+ }
375
+ obj = readObject();
376
+ }else if (obj.kind !== "ElementStart"){
377
+ throw new Error("Expecting XML root element");
378
+ }
379
+ }
372
380
  var elementStack = [];
373
381
  var namespaces = {
374
382
  ':default:': null,
@@ -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.14.2",
6
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
14
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
4
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
12
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
6
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
14
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
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.14.2",
4
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
11
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
12
12
  }
package/Node/Resources.js CHANGED
@@ -370,19 +370,10 @@ var addMetadata = {
370
370
  },
371
371
 
372
372
  '.svg': async function(name, contents, metadata){
373
- var xml = contents.stringByDecodingUTF8();
374
- // SVG icons from fontawesome don't start with xml prologue, so
375
- // add one if it looks to be missing
376
- if (xml.startsWith("<svg ")){
377
- xml = '<?xml version="1.0" encoding="utf-8"?>\n' + xml;
378
- }
379
- if (!xml.startsWith("<?xml")){
380
- return;
381
- }
382
373
  metadata.image = {
383
374
  vector: true
384
375
  };
385
- var parser = JSXMLParser.initWithString(xml);
376
+ var parser = JSXMLParser.initWithData(contents);
386
377
  parser.delegate = {
387
378
  xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
388
379
  var multiple = {
@@ -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.14.2",
6
+ "JSBundleVersion": "2023.17.1",
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
13
+ "GitRevision": "8119c698c7b280a6d2df6ce91ef86e0a69d14936"
14
14
  },
15
15
  "Resources": [
16
16
  {
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSIncludeDirectories:
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKitTesting
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.AuthKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.CSSOM
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.ChartKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.ConferenceKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.DBKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.DOM
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.Dispatch
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
4
4
  JSCopyright: Copyright © 2020 Breakside Inc.
5
5
  JSBundleEnvironments:
6
6
  html: Dispatch+HTML.js
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.FontKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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.Foundation
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -314,8 +314,19 @@ JSImage.contentTypeOfData = function(data){
314
314
  return JSMediaType("image/png");
315
315
  }else if (data.length > 2 && data[0] == 0xFF && data[1] == 0xD8){
316
316
  return JSMediaType("image/jpeg");
317
- }else if (data.length > 5 && data[0] == 0x3C && data[1] == 0x3F && data[2] == 0x78 && data[3] == 0x6D && data[4] == 0x6C){
318
- return JSMediaType("image/svg+xml");
317
+ }else if (data.length > 0 && data[0] == 0x3C){
318
+ var parser = JSXMLParser.initWithData(data);
319
+ var contentType = null;
320
+ parser.delegate = {
321
+ xmlParserDidBeginElement: function(parser, name, prefix, namespace, attributes){
322
+ if (namespace == 'http://www.w3.org/2000/svg' && name.toLowerCase() == 'svg'){
323
+ contentType = JSMediaType("image/svg+xml");
324
+ }
325
+ parser.stop();
326
+ }
327
+ };
328
+ parser.parse();
329
+ return contentType;
319
330
  }
320
331
  return null;
321
332
  };
@@ -39,10 +39,10 @@ JSInsets.prototype = {
39
39
 
40
40
  insetsWithInsets: function(top, left, bottom, right){
41
41
  if (top instanceof JSInsets){
42
- top = top.top;
43
42
  left = top.left;
44
43
  bottom = top.bottom;
45
44
  right = top.right;
45
+ top = top.top;
46
46
  }
47
47
  if (left === undefined) left = top;
48
48
  if (bottom === undefined) bottom = top;
@@ -362,13 +362,21 @@ JSClass("JSXMLParser", JSObject, {
362
362
  var obj;
363
363
  if (isHTML){
364
364
  readWhitespace();
365
- }else{
366
- obj = readObject();
367
- if (obj === null || obj.kind != 'PI' || obj.name != 'xml'){
368
- throw new Error("Expecting <?xml at start of document");
369
- }
370
365
  }
371
366
  obj = readObject();
367
+ if (!isHTML){
368
+ if (obj === null){
369
+ throw new Error("Expecting XML prolog or root element");
370
+ }
371
+ if (obj.kind === "PI"){
372
+ if (obj.name != 'xml'){
373
+ throw new Error("Expecting XML prolog");
374
+ }
375
+ obj = readObject();
376
+ }else if (obj.kind !== "ElementStart"){
377
+ throw new Error("Expecting XML root element");
378
+ }
379
+ }
372
380
  var elementStack = [];
373
381
  var namespaces = {
374
382
  ':default:': null,
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.ImageKit
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
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: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -159,7 +159,7 @@ JSClass("UIControl", UIView, {
159
159
  var actions = this._actionsByEvent[event];
160
160
  if (actions){
161
161
  for (var i = actions.length - 1; i >= 0; --i){
162
- if (actions[i] === action && actions[i].target === target){
162
+ if (actions[i].action === action && actions[i].target === target){
163
163
  actions.splice(i, 1);
164
164
  }
165
165
  }
@@ -25,8 +25,14 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
25
25
  },
26
26
 
27
27
  show: function(action, target){
28
- var fileInput = document.createElement('input');
28
+ if (UIHTMLOpenPanel.fileInput !== null){
29
+ UIHTMLOpenPanel.fileInput.parentNode.removeChild(UIHTMLOpenPanel.fileInput);
30
+ }
31
+ UIHTMLOpenPanel.fileInput = document.createElement('input');
32
+ var fileInput = UIHTMLOpenPanel.fileInput;
29
33
  fileInput.type = 'file';
34
+ fileInput.style.display = 'none';
35
+ document.body.appendChild(fileInput);
30
36
  if (this.allowsMultipleSelection){
31
37
  fileInput.multiple = true;
32
38
  }
@@ -38,7 +44,7 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
38
44
  }
39
45
  }
40
46
  var panel = this;
41
- fileInput.onchange = function(){
47
+ fileInput.addEventListener("change", function(){
42
48
  if (panel.allowsMultipleSelection || panel.chooseDirectories){
43
49
  if (fileInput.webkitEntries && fileInput.webkitEntries.length > 0){
44
50
  panel._fileEnumerator = JSHTMLFileSystemEntryFileEnumerator.initWithHTMLEntries(fileInput.webkitEntries);
@@ -51,12 +57,20 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
51
57
  }
52
58
  }
53
59
  action.call(target, panel);
54
- };
60
+ fileInput.parentNode.removeChild(fileInput);
61
+ UIHTMLOpenPanel.fileInput = null;
62
+ });
63
+ fileInput.addEventListener("cancel", function(){
64
+ fileInput.parentNode.removeChild(fileInput);
65
+ UIHTMLOpenPanel.fileInput = null;
66
+ });
55
67
  fileInput.click();
56
68
  }
57
69
 
58
70
  });
59
71
 
72
+ UIHTMLOpenPanel.fileInput = null;
73
+
60
74
  UIOpenPanel.definePropertiesFromExtensions({
61
75
  init: function(){
62
76
  return UIHTMLOpenPanel.init();
@@ -83,8 +83,10 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
83
83
  body.style.right = '0';
84
84
  body.style.bottom = '0';
85
85
  body.style.overflow = 'hidden';
86
- body.style.borderLeft = "env(safe-area-inset-left) solid black";
87
- body.style.borderRight = "env(safe-area-inset-right) solid black";
86
+ body.style.setProperty("--jskit-safe-area-inset-left", "env(safe-area-inset-left)");
87
+ body.style.setProperty("--jskit-safe-area-inset-right", "env(safe-area-inset-right)");
88
+ body.style.setProperty("--jskit-safe-area-inset-top", "env(safe-area-inset-top)");
89
+ body.style.setProperty("--jskit-safe-area-inset-bottom", "env(safe-area-inset-bottom)");
88
90
  var head = this.domDocument.head;
89
91
  var child;
90
92
  for (var i = head.childNodes.length - 1; i >= 0; --i){
@@ -719,6 +721,22 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
719
721
  return JSSize(this.rootElement.clientWidth, this.rootElement.clientHeight);
720
722
  },
721
723
 
724
+ safeAreaInsets: function(){
725
+ var style = this.domWindow.getComputedStyle(this.rootElement);
726
+ var parseValue = function(value){
727
+ if (value.endsWith("px")){
728
+ return parseInt(value.substr(0, value.length - 2));
729
+ }
730
+ return 0;
731
+ };
732
+ return JSInsets(
733
+ parseValue(style.getPropertyValue("--jskit-safe-area-inset-top")),
734
+ parseValue(style.getPropertyValue("--jskit-safe-area-inset-left")),
735
+ parseValue(style.getPropertyValue("--jskit-safe-area-inset-bottom")),
736
+ parseValue(style.getPropertyValue("--jskit-safe-area-inset-right"))
737
+ );
738
+ },
739
+
722
740
  contextmenu: function(e){
723
741
  // prevent the default context menu
724
742
  e.preventDefault();
@@ -923,6 +941,13 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
923
941
  this._screenClientOrigin = JSPoint(clientRect.left, clientRect.top);
924
942
  },
925
943
 
944
+ layoutWindow: function(window){
945
+ UIHTMLWindowServer.$super.layoutWindow.call(this, window);
946
+ if (window instanceof UIRootWindow){
947
+ window.contentInsets = this.safeAreaInsets();
948
+ }
949
+ },
950
+
926
951
  // ----------------------------------------------------------------------
927
952
  // MARK: - Accessibility
928
953
 
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.UIKitTesting
3
- JSBundleVersion: 2023.14.2
3
+ JSBundleVersion: 2023.17.1
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSLicenseNotice: |
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "node": ">=10.10.0"
10
10
  },
11
11
  "name": "@breakside/jskit",
12
- "version": "2023.14.2",
12
+ "version": "2023.17.1",
13
13
  "license": "SEE LICENSE IN LICENSE.txt",
14
14
  "files": [
15
15
  "*"