@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.
- package/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSColor.js +5 -0
- package/Frameworks/Foundation.jsframework/JS/JSNodeHTTPClient.js +34 -14
- package/Frameworks/Foundation.jsframework/JS/JSNodeURLSessionDataTask.js +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSPath.js +482 -49
- package/Frameworks/Foundation.jsframework/JS/JSSpec.js +5 -1
- package/Frameworks/Foundation.jsframework/JS/JSURLRequest.js +3 -0
- package/Frameworks/Foundation.jsframework/JS/JSZip.js +155 -1
- package/Frameworks/Foundation.jsframework/JS/String+JS.js +78 -2
- 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/DocCommand.js +5 -2
- package/Node/Docs/DocClass.js +40 -3
- package/Node/Docs/DocComponent.js +32 -5
- package/Node/Docs/DocDictionaryProperty.js +10 -2
- package/Node/Docs/DocEnum.js +35 -2
- package/Node/Docs/DocEnumOption.js +5 -2
- package/Node/Docs/DocExtension.js +130 -0
- package/Node/Docs/DocFunction.js +10 -2
- package/Node/Docs/DocMethod.js +3 -0
- package/Node/Docs/DocProperty.js +13 -2
- package/Node/Docs/DocProtocol.js +5 -1
- package/Node/Docs/DocSpec.js +5 -1
- package/Node/Docs/DocSpecProperty.js +10 -2
- package/Node/Docs/DocTopicBasedComponent.js +75 -65
- package/Node/Documentation.js +83 -6
- package/Node/HTMLBuilder.js +3 -1
- package/Node/HTMLProjectServer.js +40 -2
- package/Node/Markdown.js +2 -2
- package/Node/io.breakside.jskit-bundle.js +4 -4
- package/Node/jskit +1 -0
- package/Resources/doc-default.css +3 -11
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSColor.js +5 -0
- package/Root/Frameworks/Foundation/JSNodeHTTPClient.js +34 -14
- package/Root/Frameworks/Foundation/JSNodeURLSessionDataTask.js +2 -2
- package/Root/Frameworks/Foundation/JSPath.js +482 -49
- package/Root/Frameworks/Foundation/JSSpec.js +5 -1
- package/Root/Frameworks/Foundation/JSURLRequest.js +3 -0
- package/Root/Frameworks/Foundation/JSZip.js +155 -1
- package/Root/Frameworks/Foundation/String+JS.js +78 -2
- 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/UIListView.js +11 -3
- package/Root/Frameworks/UIKit/UIOutlineView.js +65 -5
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- 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
|
|
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[
|
|
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.
|
|
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": "
|
|
13
|
+
"GitRevision": "812100aa4c3e5b1ec1d0d432be903bba4db01b0e"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
17
17
|
"path": "doc-default.css",
|
|
18
18
|
"ext": ".css",
|
|
19
|
-
"byte_size":
|
|
19
|
+
"byte_size": 10906,
|
|
20
20
|
"mimetype": "text/css",
|
|
21
|
-
"hash": "
|
|
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
|
|
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 >
|
|
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 >
|
|
428
|
+
article.doc > section.topics > section.topic > header > h3{
|
|
437
429
|
margin-bottom: 10px;
|
|
438
430
|
}
|
|
439
431
|
}
|
|
@@ -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 (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
81
|
-
|
|
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(
|
|
42
|
-
this._currentRequest =
|
|
41
|
+
redirect: function(request){
|
|
42
|
+
this._currentRequest = request;
|
|
43
43
|
},
|
|
44
44
|
uploadProgress: function(sent, total){
|
|
45
45
|
this.session._taskDidSendBodyData(this, sent, total);
|