@breakside/jskit 2026.9.0 → 2026.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) 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/JSColor.js +5 -0
  7. package/Frameworks/Foundation.jsframework/JS/JSNodeHTTPClient.js +34 -14
  8. package/Frameworks/Foundation.jsframework/JS/JSNodeURLSessionDataTask.js +2 -2
  9. package/Frameworks/Foundation.jsframework/JS/JSPath.js +482 -49
  10. package/Frameworks/Foundation.jsframework/JS/JSSpec.js +5 -1
  11. package/Frameworks/Foundation.jsframework/JS/JSURLRequest.js +3 -0
  12. package/Frameworks/Foundation.jsframework/JS/JSZip.js +155 -1
  13. package/Frameworks/Foundation.jsframework/JS/String+JS.js +78 -2
  14. package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
  15. package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
  16. package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
  17. package/Info.json +2 -2
  18. package/Node/DocCommand.js +5 -2
  19. package/Node/Docs/DocClass.js +40 -3
  20. package/Node/Docs/DocComponent.js +32 -5
  21. package/Node/Docs/DocDictionaryProperty.js +10 -2
  22. package/Node/Docs/DocEnum.js +35 -2
  23. package/Node/Docs/DocEnumOption.js +5 -2
  24. package/Node/Docs/DocExtension.js +130 -0
  25. package/Node/Docs/DocFunction.js +10 -2
  26. package/Node/Docs/DocMethod.js +3 -0
  27. package/Node/Docs/DocProperty.js +13 -2
  28. package/Node/Docs/DocProtocol.js +5 -1
  29. package/Node/Docs/DocSpec.js +5 -1
  30. package/Node/Docs/DocSpecProperty.js +10 -2
  31. package/Node/Docs/DocTopicBasedComponent.js +75 -65
  32. package/Node/Documentation.js +83 -6
  33. package/Node/HTMLBuilder.js +3 -1
  34. package/Node/HTMLProjectServer.js +40 -2
  35. package/Node/Markdown.js +2 -2
  36. package/Node/io.breakside.jskit-bundle.js +4 -4
  37. package/Node/jskit +1 -0
  38. package/Resources/doc-default.css +3 -11
  39. package/Root/Frameworks/APIKit/Info.yaml +1 -1
  40. package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
  41. package/Root/Frameworks/AuthKit/Info.yaml +1 -1
  42. package/Root/Frameworks/CSSOM/Info.yaml +1 -1
  43. package/Root/Frameworks/ChartKit/Info.yaml +1 -1
  44. package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
  45. package/Root/Frameworks/DBKit/Info.yaml +1 -1
  46. package/Root/Frameworks/DOM/Info.yaml +1 -1
  47. package/Root/Frameworks/Dispatch/Info.yaml +1 -1
  48. package/Root/Frameworks/FontKit/Info.yaml +1 -1
  49. package/Root/Frameworks/Foundation/Info.yaml +1 -1
  50. package/Root/Frameworks/Foundation/JSColor.js +5 -0
  51. package/Root/Frameworks/Foundation/JSNodeHTTPClient.js +34 -14
  52. package/Root/Frameworks/Foundation/JSNodeURLSessionDataTask.js +2 -2
  53. package/Root/Frameworks/Foundation/JSPath.js +482 -49
  54. package/Root/Frameworks/Foundation/JSSpec.js +5 -1
  55. package/Root/Frameworks/Foundation/JSURLRequest.js +3 -0
  56. package/Root/Frameworks/Foundation/JSZip.js +155 -1
  57. package/Root/Frameworks/Foundation/String+JS.js +78 -2
  58. package/Root/Frameworks/ImageKit/Info.yaml +1 -1
  59. package/Root/Frameworks/MediaKit/Info.yaml +1 -1
  60. package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
  61. package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
  62. package/Root/Frameworks/PDFKit/Info.yaml +1 -1
  63. package/Root/Frameworks/QRKit/Info.yaml +1 -1
  64. package/Root/Frameworks/SearchKit/Info.yaml +1 -1
  65. package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
  66. package/Root/Frameworks/ServerKit/Info.yaml +1 -1
  67. package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
  68. package/Root/Frameworks/TestKit/Info.yaml +1 -1
  69. package/Root/Frameworks/UIKit/Info.yaml +1 -1
  70. package/Root/Frameworks/UIKit/UIListView.js +11 -3
  71. package/Root/Frameworks/UIKit/UIOutlineView.js +65 -5
  72. package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
  73. package/package.json +1 -1
@@ -49,6 +49,7 @@ JSClass("HTMLProjectServer", JSObject, {
49
49
  _nodeHttpServer: null,
50
50
 
51
51
  run: async function(){
52
+ await this.reload();
52
53
  var scheme = "http";
53
54
  if (this.tlsCertificateFileURL !== null && this.tlsKeyFileURL !== null){
54
55
  scheme = "https";
@@ -81,6 +82,10 @@ JSClass("HTMLProjectServer", JSObject, {
81
82
  }
82
83
  },
83
84
 
85
+ reload: async function(){
86
+ await this.loadFilenameMap();
87
+ },
88
+
84
89
  stop: function(completion, target){
85
90
  if (!completion){
86
91
  completion = Promise.completion();
@@ -107,6 +112,32 @@ JSClass("HTMLProjectServer", JSObject, {
107
112
  "/apple-touch-icon-precomposed.png"
108
113
  ])),
109
114
 
115
+ filenameMap: null,
116
+
117
+ loadFilenameMap: async function(){
118
+ this.filenameMap = {};
119
+ var configFiles = this.project.info.HMTLManifestConfiguration || [];
120
+ if (!(configFiles instanceof Array)){
121
+ configFiles = [configFiles];
122
+ }
123
+
124
+ for (let i = 0, l = configFiles.length; i < l; ++i){
125
+ let config = configFiles[i];
126
+ if (typeof(config) == "string"){
127
+ let url = this.project.url.appendingPathComponent(configFiles[i]);
128
+ let contents = await this.fileManager.contentsAtURL(url);
129
+ let json = contents.stringByDecodingUTF8();
130
+ config = JSON.parse(json);
131
+ }
132
+ for (let k in config){
133
+ let item = config[k];
134
+ if (item.path && item.path !== k){
135
+ this.filenameMap[item.path] = k;
136
+ }
137
+ }
138
+ }
139
+ },
140
+
110
141
  _handleNodeRequest: async function(nodeRequest, nodeResponse){
111
142
  let statusCode = null;
112
143
  let headers = {};
@@ -141,6 +172,12 @@ JSClass("HTMLProjectServer", JSObject, {
141
172
  }
142
173
  }
143
174
  }
175
+ if (this.project.info.HTMLDocViewer){
176
+ if (this.filenameMap["docs" + url.path]){
177
+ statusCode = 302;
178
+ headers.Location = "/#" + url.path;
179
+ }
180
+ }
144
181
  if (statusCode === null){
145
182
  if (url.pathComponents.length === 2){
146
183
  if (url.pathComponents[1] === "index.html"){
@@ -161,11 +198,12 @@ JSClass("HTMLProjectServer", JSObject, {
161
198
  headers["Cache-Control"] = "max-age=315360000"; // ~10 years
162
199
  headers.Etag = url.lastPathComponent;
163
200
  }
164
- let fileURL = this.wwwURL.appendingPathComponents(url.pathComponents.slice(1));
201
+ let path = url.pathComponents.slice(1).join("/");
202
+ let fileURL = this.wwwURL.appendingPathComponents((this.filenameMap[path] || path).split("/"));
165
203
  let exists = await this.fileManager.itemExistsAtURL(fileURL);
166
204
  if (exists){
167
205
  let attributes = await this.fileManager.attributesOfItemAtURL(fileURL);
168
- headers["Content-Type"] = this.contentTypesByExtension[url.fileExtension] || "application/octet-stream";
206
+ headers["Content-Type"] = this.contentTypesByExtension[fileURL.fileExtension] || "application/octet-stream";
169
207
  headers["Content-Length"] = attributes.size;
170
208
  filePath = this.fileManager.pathForURL(fileURL);
171
209
  statusCode = 200;
package/Node/Markdown.js CHANGED
@@ -265,7 +265,7 @@ JSClass("Markdown", JSObject, {
265
265
  let line = lines[i];
266
266
  var trimmed = line.trim();
267
267
  if (inCodeBlock){
268
- if (line.match(/^````+$/)){
268
+ if (line.match(/^```+$/)){
269
269
  inCodeBlock = false;
270
270
  let code = document.createElement(options.codeBlockTagName);
271
271
  code.setAttribute("class", options.codeBlockClassName);
@@ -291,7 +291,7 @@ JSClass("Markdown", JSObject, {
291
291
  addHeader(options.secondLevelHeaderTagName);
292
292
  }else if (line.match(/^#{1,2}\s/)){
293
293
  addATXHeader(line);
294
- }else if (line.match(/^````+$/)){
294
+ }else if (line.match(/^```+$/)){
295
295
  finishBlock();
296
296
  inOrderedList = false;
297
297
  inUnorderedList = false;
@@ -3,22 +3,22 @@ JSBundle.bundles['io.breakside.jskit'] = {
3
3
  "Info": {
4
4
  "JSBundleType": "node",
5
5
  "JSBundleIdentifier": "io.breakside.jskit",
6
- "JSBundleVersion": "2026.9.0",
6
+ "JSBundleVersion": "2026.11.0",
7
7
  "JSExecutableName": "jskit",
8
8
  "NPMOrganization": "breakside",
9
9
  "JSResources": [
10
10
  "Tests/HTMLTestRunner.js",
11
11
  "Tests/NodeTestRunner.js"
12
12
  ],
13
- "GitRevision": "7481a2557e5555dbf2a58e88ba6720b16de86277"
13
+ "GitRevision": "812100aa4c3e5b1ec1d0d432be903bba4db01b0e"
14
14
  },
15
15
  "Resources": [
16
16
  {
17
17
  "path": "doc-default.css",
18
18
  "ext": ".css",
19
- "byte_size": 11088,
19
+ "byte_size": 10906,
20
20
  "mimetype": "text/css",
21
- "hash": "fb20238b7c988f0d959bad2d071b06000068a39d",
21
+ "hash": "1649bda738e2e7e746e78641145cfc85380ea46c",
22
22
  "nodeBundlePath": "Resources/doc-default.css"
23
23
  },
24
24
  {
package/Node/jskit CHANGED
@@ -201,6 +201,7 @@ require("./Docs/DocTopicBasedComponent.js");
201
201
  require("./Docs/DocIndex.js");
202
202
  require("./Docs/DocFramework.js");
203
203
  require("./Docs/DocClass.js");
204
+ require("./Docs/DocExtension.js");
204
205
  require("./Docs/DocProtocol.js");
205
206
  require("./Docs/DocFunction.js");
206
207
  require("./Docs/DocMethod.js");
@@ -21,11 +21,7 @@ article.doc h1,h2,h3,h4,h5,h5,b,strong{
21
21
  font-weight: 600;
22
22
  }
23
23
 
24
- article.doc > section > header > h1, article.doc > section > h1{
25
- font-size: 1.4em;
26
- }
27
-
28
- article.doc > section > section > header > h1{
24
+ article.doc h3{
29
25
  font-size: 1em;
30
26
  }
31
27
 
@@ -221,10 +217,6 @@ article.doc > section{
221
217
  margin-bottom: 40px;
222
218
  }
223
219
 
224
- article.doc > section.description h2{
225
- font-size: 1em;
226
- }
227
-
228
220
  article.doc > section.note{
229
221
  display: flex;
230
222
  flex-direction: row;
@@ -278,7 +270,7 @@ article.doc > section.topics > section.topic > header{
278
270
  margin-right: 20px;
279
271
  }
280
272
 
281
- article.doc > section.topics > section.topic > header > h1{
273
+ article.doc > section.topics > section.topic > header > h3{
282
274
  margin: 0;
283
275
  }
284
276
 
@@ -433,7 +425,7 @@ article.doc > footer > p {
433
425
  article.doc > section.topics > section.topic{
434
426
  display: block;
435
427
  }
436
- article.doc > section.topics > section.topic > header > h1{
428
+ article.doc > section.topics > section.topic > header > h3{
437
429
  margin-bottom: 10px;
438
430
  }
439
431
  }
@@ -1,6 +1,6 @@
1
1
  JSBundleType: framework
2
2
  JSBundleIdentifier: io.breakside.JSKit.APIKit
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.0
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: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.AuthKit
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.CSSOM
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.ChartKit
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.ConferenceKit
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.DBKit
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.DOM
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.Dispatch
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.0
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: 2026.9.0
3
+ JSBundleVersion: 2026.11.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.Foundation
3
- JSBundleVersion: 2026.9.0
3
+ JSBundleVersion: 2026.11.0
4
4
  JSDevelopmentLanguage: en
5
5
  JSCopyright: Copyright © 2020 Breakside Inc.
6
6
  JSBundleEnvironments:
@@ -373,6 +373,11 @@ JSClass('JSColor', JSObject, {
373
373
  var rgbaColor = this.rgbaColor();
374
374
  var hsl = JSColorSpace.rgb.hslFromComponents(rgbaColor.components);
375
375
  return hsl[2];
376
+ },
377
+
378
+ cssString: function(){
379
+ var rgbaColor = this.rgbaColor();
380
+ return 'rgba(%d, %d, %d, %f)'.sprintf(Math.round(rgbaColor.components[0] * 255), Math.round(rgbaColor.components[1] * 255), Math.round(rgbaColor.components[2] * 255), rgbaColor.components[3]);
376
381
  }
377
382
 
378
383
  });
@@ -28,7 +28,10 @@ var https = require('https');
28
28
 
29
29
  JSClass("JSNodeHTTPClient", JSObject, {
30
30
 
31
- send: function(request, callbacks, target){
31
+ send: function(request, callbacks, target, allowedRedirects){
32
+ if (allowedRedirects === undefined){
33
+ allowedRedirects = 5;
34
+ }
32
35
  var completed = false;
33
36
  var complete = function(error){
34
37
  if (completed){
@@ -41,6 +44,7 @@ JSClass("JSNodeHTTPClient", JSObject, {
41
44
  };
42
45
  try{
43
46
  var response = null;
47
+ var client = this;
44
48
 
45
49
  // Create node request
46
50
  var options = {
@@ -66,20 +70,36 @@ JSClass("JSNodeHTTPClient", JSObject, {
66
70
  }
67
71
  response._headerMap.parse(rawHeaders.join("\r\n"));
68
72
  response.statusText = message.statusMessage;
69
- if (callbacks.response){
70
- callbacks.response.call(target, response);
71
- }
72
- var chunks = [];
73
- message.on('data', function(chunk){
74
- chunks.push(JSData.initWithNodeBuffer(chunk));
75
- });
76
- message.on('end', function(){
77
- if (completed){
78
- return;
73
+ if (allowedRedirects > 0 && (response.statusCode === JSURLResponse.StatusCode.movedPermanently || response.statusCode === JSURLResponse.StatusCode.found)){
74
+ message.on('data', function(chunk){
75
+ });
76
+ message.on('end', function(){
77
+ if (completed){
78
+ return;
79
+ }
80
+ request = request.redirectedRequestToURL(response.location);
81
+ if (callbacks.redirect){
82
+ callbacks.redirect(request);
83
+ }
84
+ client.send(request, callbacks, target, allowedRedirects - 1);
85
+ // TODO: send new request
86
+ });
87
+ }else{
88
+ if (callbacks.response){
89
+ callbacks.response.call(target, response);
79
90
  }
80
- response.data = JSData.initWithChunks(chunks);
81
- complete(null);
82
- });
91
+ var chunks = [];
92
+ message.on('data', function(chunk){
93
+ chunks.push(JSData.initWithNodeBuffer(chunk));
94
+ });
95
+ message.on('end', function(){
96
+ if (completed){
97
+ return;
98
+ }
99
+ response.data = JSData.initWithChunks(chunks);
100
+ complete(null);
101
+ });
102
+ }
83
103
  });
84
104
  nodeRequest.on('error', function(error){
85
105
  complete(error);
@@ -38,8 +38,8 @@ JSClass("JSNodeURLSessionDataTask", JSURLSessionDataTask, {
38
38
  }
39
39
  if (this.cancelation === null){
40
40
  this.cancelation = JSNodeHTTPClient.shared.send(this.currentRequest, {
41
- redirect: function(url){
42
- this._currentRequest = this._originalRequest.redirectedRequestToURL(url);
41
+ redirect: function(request){
42
+ this._currentRequest = request;
43
43
  },
44
44
  uploadProgress: function(sent, total){
45
45
  this.session._taskDidSendBodyData(this, sent, total);