@cardenelabs/dragon 0.42.2 → 0.43.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/README.md +34 -1
- package/dist/cli.cjs +1723 -493
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1723 -493
- package/dist/cli.js.map +1 -1
- package/dist/export.cjs +1636 -498
- package/dist/export.cjs.map +1 -1
- package/dist/export.d.cts +1 -1
- package/dist/export.d.ts +1 -1
- package/dist/export.js +1636 -498
- package/dist/export.js.map +1 -1
- package/dist/index.cjs +1651 -417
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -3
- package/dist/index.d.ts +66 -3
- package/dist/index.js +1651 -417
- package/dist/index.js.map +1 -1
- package/dist/{ink-B8EZL7JV.d.cts → ink-B6s_SMXG.d.cts} +23 -3
- package/dist/{ink-B8EZL7JV.d.ts → ink-B6s_SMXG.d.ts} +23 -3
- package/dist/node.cjs +1102 -475
- package/dist/node.cjs.map +1 -1
- package/dist/node.js +1102 -475
- package/dist/node.js.map +1 -1
- package/dist/player.global.js +3 -2
- package/package.json +1 -1
- package/src/index.ts +4 -1
- package/src/layout/tree.ts +458 -0
- package/src/look/values.ts +42 -0
- package/src/messages.ts +34 -2
- package/src/parser.ts +89 -1
- package/src/printer.ts +6 -1
- package/src/render/icons.ts +2 -0
- package/src/render/svg.ts +41 -3
- package/src/render/tree.ts +164 -0
- package/src/schema.ts +27 -3
- package/src/schemas/diagram.schema.json +79 -14
- package/src/schemas/validate-diagram.js +1 -1
- package/src/timeline.ts +2 -2
- package/src/words.ts +12 -2
package/dist/index.cjs
CHANGED
|
@@ -97,7 +97,7 @@ function ucs2length(str) {
|
|
|
97
97
|
return length;
|
|
98
98
|
}
|
|
99
99
|
var validate_diagram_default = validate10;
|
|
100
|
-
var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
|
|
100
|
+
var schema11 = { "properties": { "version": { "description": "\u5F62\u5F0F\u306E\u7248", "type": "integer", "minimum": 1 }, "kind": { "description": "\u56F3\u306E\u7A2E\u985E", "enum": ["sequence", "architecture", "state", "git", "time", "tree"] }, "title": { "$ref": "#/definitions/text" }, "view": { "description": "\u898B\u305B\u65B9\u3002\u66F8\u304B\u306A\u3051\u308C\u3070\u5B57\u306E\u5927\u304D\u3055\u3067\u9078\u3076\u3002fixed \u306F\u5168\u4F53\u3092\u6B62\u3081\u3066\u4E2D\u3060\u3051\u52D5\u304B\u3057\u3001follow \u306F\u5BC4\u3063\u3066\u52D5\u304B\u3057\u5168\u4F53\u56F3\u3067\u4ECA\u3069\u3053\u304B\u3092\u793A\u3059", "enum": ["fixed", "follow"] }, "regions": { "type": "array", "items": { "$ref": "#/definitions/region" } }, "boxes": { "type": "array", "items": { "$ref": "#/definitions/box" } }, "strip": { "$ref": "#/definitions/strip" }, "steps": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/step" } }, "sequence": { "$ref": "#/definitions/sequence" }, "state": { "$ref": "#/definitions/state" }, "git": { "$ref": "#/definitions/git" }, "time": { "$ref": "#/definitions/time" } }};
|
|
101
101
|
function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
102
102
|
let vErrors = null;
|
|
103
103
|
let errors = 0;
|
|
@@ -157,34 +157,79 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
+
const _errs8 = errors;
|
|
161
|
+
const _errs9 = errors;
|
|
162
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
163
|
+
if (data2.type === void 0 && ("type")) {
|
|
164
|
+
const err3 = {};
|
|
165
|
+
if (vErrors === null) {
|
|
166
|
+
vErrors = [err3];
|
|
167
|
+
} else {
|
|
168
|
+
vErrors.push(err3);
|
|
169
|
+
}
|
|
170
|
+
errors++;
|
|
171
|
+
} else {
|
|
172
|
+
if (data2.type !== void 0) {
|
|
173
|
+
let data4 = data2.type;
|
|
174
|
+
if (!(data4 === "leaf" || data4 === "node")) {
|
|
175
|
+
const err4 = {};
|
|
176
|
+
if (vErrors === null) {
|
|
177
|
+
vErrors = [err4];
|
|
178
|
+
} else {
|
|
179
|
+
vErrors.push(err4);
|
|
180
|
+
}
|
|
181
|
+
errors++;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
var valid9 = _errs9 === errors;
|
|
187
|
+
if (valid9) {
|
|
188
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
189
|
+
if (vErrors === null) {
|
|
190
|
+
vErrors = [err5];
|
|
191
|
+
} else {
|
|
192
|
+
vErrors.push(err5);
|
|
193
|
+
}
|
|
194
|
+
errors++;
|
|
195
|
+
} else {
|
|
196
|
+
errors = _errs8;
|
|
197
|
+
if (vErrors !== null) {
|
|
198
|
+
if (_errs8) {
|
|
199
|
+
vErrors.length = _errs8;
|
|
200
|
+
} else {
|
|
201
|
+
vErrors = null;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
160
205
|
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
161
206
|
if (data2.type !== void 0) {
|
|
162
|
-
let
|
|
163
|
-
const
|
|
164
|
-
const
|
|
165
|
-
if (!(
|
|
166
|
-
const
|
|
207
|
+
let data5 = data2.type;
|
|
208
|
+
const _errs13 = errors;
|
|
209
|
+
const _errs14 = errors;
|
|
210
|
+
if (!(data5 === "commit" || data5 === "branch")) {
|
|
211
|
+
const err6 = {};
|
|
167
212
|
if (vErrors === null) {
|
|
168
|
-
vErrors = [
|
|
213
|
+
vErrors = [err6];
|
|
169
214
|
} else {
|
|
170
|
-
vErrors.push(
|
|
215
|
+
vErrors.push(err6);
|
|
171
216
|
}
|
|
172
217
|
errors++;
|
|
173
218
|
}
|
|
174
|
-
var
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
219
|
+
var valid13 = _errs14 === errors;
|
|
220
|
+
if (valid13) {
|
|
221
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
177
222
|
if (vErrors === null) {
|
|
178
|
-
vErrors = [
|
|
223
|
+
vErrors = [err7];
|
|
179
224
|
} else {
|
|
180
|
-
vErrors.push(
|
|
225
|
+
vErrors.push(err7);
|
|
181
226
|
}
|
|
182
227
|
errors++;
|
|
183
228
|
} else {
|
|
184
|
-
errors =
|
|
229
|
+
errors = _errs13;
|
|
185
230
|
if (vErrors !== null) {
|
|
186
|
-
if (
|
|
187
|
-
vErrors.length =
|
|
231
|
+
if (_errs13) {
|
|
232
|
+
vErrors.length = _errs13;
|
|
188
233
|
} else {
|
|
189
234
|
vErrors = null;
|
|
190
235
|
}
|
|
@@ -192,29 +237,29 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
192
237
|
}
|
|
193
238
|
}
|
|
194
239
|
if (data2.at !== void 0) {
|
|
195
|
-
const
|
|
240
|
+
const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
196
241
|
if (vErrors === null) {
|
|
197
|
-
vErrors = [
|
|
242
|
+
vErrors = [err8];
|
|
198
243
|
} else {
|
|
199
|
-
vErrors.push(
|
|
244
|
+
vErrors.push(err8);
|
|
200
245
|
}
|
|
201
246
|
errors++;
|
|
202
247
|
}
|
|
203
248
|
if (data2.into !== void 0) {
|
|
204
|
-
const
|
|
249
|
+
const err9 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
205
250
|
if (vErrors === null) {
|
|
206
|
-
vErrors = [
|
|
251
|
+
vErrors = [err9];
|
|
207
252
|
} else {
|
|
208
|
-
vErrors.push(
|
|
253
|
+
vErrors.push(err9);
|
|
209
254
|
}
|
|
210
255
|
errors++;
|
|
211
256
|
}
|
|
212
257
|
if (data2.color !== void 0) {
|
|
213
|
-
const
|
|
258
|
+
const err10 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
214
259
|
if (vErrors === null) {
|
|
215
|
-
vErrors = [
|
|
260
|
+
vErrors = [err10];
|
|
216
261
|
} else {
|
|
217
|
-
vErrors.push(
|
|
262
|
+
vErrors.push(err10);
|
|
218
263
|
}
|
|
219
264
|
errors++;
|
|
220
265
|
}
|
|
@@ -304,31 +349,309 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
304
349
|
}
|
|
305
350
|
}
|
|
306
351
|
}
|
|
352
|
+
const _errs8 = errors;
|
|
353
|
+
const _errs9 = errors;
|
|
307
354
|
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
308
|
-
if (data2.
|
|
309
|
-
const err3 = {
|
|
355
|
+
if (data2.type === void 0 && ("type")) {
|
|
356
|
+
const err3 = {};
|
|
310
357
|
if (vErrors === null) {
|
|
311
358
|
vErrors = [err3];
|
|
312
359
|
} else {
|
|
313
360
|
vErrors.push(err3);
|
|
314
361
|
}
|
|
315
362
|
errors++;
|
|
363
|
+
} else {
|
|
364
|
+
if (data2.type !== void 0) {
|
|
365
|
+
let data4 = data2.type;
|
|
366
|
+
if (!(data4 === "leaf" || data4 === "node")) {
|
|
367
|
+
const err4 = {};
|
|
368
|
+
if (vErrors === null) {
|
|
369
|
+
vErrors = [err4];
|
|
370
|
+
} else {
|
|
371
|
+
vErrors.push(err4);
|
|
372
|
+
}
|
|
373
|
+
errors++;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
var valid9 = _errs9 === errors;
|
|
379
|
+
if (valid9) {
|
|
380
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
381
|
+
if (vErrors === null) {
|
|
382
|
+
vErrors = [err5];
|
|
383
|
+
} else {
|
|
384
|
+
vErrors.push(err5);
|
|
385
|
+
}
|
|
386
|
+
errors++;
|
|
387
|
+
} else {
|
|
388
|
+
errors = _errs8;
|
|
389
|
+
if (vErrors !== null) {
|
|
390
|
+
if (_errs8) {
|
|
391
|
+
vErrors.length = _errs8;
|
|
392
|
+
} else {
|
|
393
|
+
vErrors = null;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
398
|
+
if (data2.at !== void 0) {
|
|
399
|
+
const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
400
|
+
if (vErrors === null) {
|
|
401
|
+
vErrors = [err6];
|
|
402
|
+
} else {
|
|
403
|
+
vErrors.push(err6);
|
|
404
|
+
}
|
|
405
|
+
errors++;
|
|
316
406
|
}
|
|
317
407
|
if (data2.into !== void 0) {
|
|
318
|
-
const
|
|
408
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
319
409
|
if (vErrors === null) {
|
|
320
|
-
vErrors = [
|
|
410
|
+
vErrors = [err7];
|
|
321
411
|
} else {
|
|
322
|
-
vErrors.push(
|
|
412
|
+
vErrors.push(err7);
|
|
323
413
|
}
|
|
324
414
|
errors++;
|
|
325
415
|
}
|
|
326
416
|
if (data2.color !== void 0) {
|
|
327
|
-
const
|
|
417
|
+
const err8 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
418
|
+
if (vErrors === null) {
|
|
419
|
+
vErrors = [err8];
|
|
420
|
+
} else {
|
|
421
|
+
vErrors.push(err8);
|
|
422
|
+
}
|
|
423
|
+
errors++;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
validate17.errors = vErrors;
|
|
433
|
+
return errors === 0;
|
|
434
|
+
}
|
|
435
|
+
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
436
|
+
let vErrors = null;
|
|
437
|
+
let errors = 0;
|
|
438
|
+
if (Array.isArray(data)) {
|
|
439
|
+
const len0 = data.length;
|
|
440
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
441
|
+
let data0 = data[i0];
|
|
442
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
443
|
+
if (data0.events !== void 0) {
|
|
444
|
+
let data1 = data0.events;
|
|
445
|
+
if (Array.isArray(data1)) {
|
|
446
|
+
const len1 = data1.length;
|
|
447
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
448
|
+
let data2 = data1[i1];
|
|
449
|
+
const _errs4 = errors;
|
|
450
|
+
const _errs5 = errors;
|
|
451
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
452
|
+
if (data2.type === void 0 && ("type")) {
|
|
453
|
+
const err0 = {};
|
|
454
|
+
if (vErrors === null) {
|
|
455
|
+
vErrors = [err0];
|
|
456
|
+
} else {
|
|
457
|
+
vErrors.push(err0);
|
|
458
|
+
}
|
|
459
|
+
errors++;
|
|
460
|
+
} else {
|
|
461
|
+
if (data2.type !== void 0) {
|
|
462
|
+
let data3 = data2.type;
|
|
463
|
+
if (!(data3 === "leaf" || data3 === "node")) {
|
|
464
|
+
const err1 = {};
|
|
465
|
+
if (vErrors === null) {
|
|
466
|
+
vErrors = [err1];
|
|
467
|
+
} else {
|
|
468
|
+
vErrors.push(err1);
|
|
469
|
+
}
|
|
470
|
+
errors++;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
var valid6 = _errs5 === errors;
|
|
476
|
+
if (valid6) {
|
|
477
|
+
const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/allOf/0/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
478
|
+
if (vErrors === null) {
|
|
479
|
+
vErrors = [err2];
|
|
480
|
+
} else {
|
|
481
|
+
vErrors.push(err2);
|
|
482
|
+
}
|
|
483
|
+
errors++;
|
|
484
|
+
} else {
|
|
485
|
+
errors = _errs4;
|
|
486
|
+
if (vErrors !== null) {
|
|
487
|
+
if (_errs4) {
|
|
488
|
+
vErrors.length = _errs4;
|
|
489
|
+
} else {
|
|
490
|
+
vErrors = null;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
495
|
+
if (data2.type !== void 0) {
|
|
496
|
+
let data4 = data2.type;
|
|
497
|
+
const _errs9 = errors;
|
|
498
|
+
const _errs10 = errors;
|
|
499
|
+
if (!(data4 === "commit" || data4 === "branch")) {
|
|
500
|
+
const err3 = {};
|
|
501
|
+
if (vErrors === null) {
|
|
502
|
+
vErrors = [err3];
|
|
503
|
+
} else {
|
|
504
|
+
vErrors.push(err3);
|
|
505
|
+
}
|
|
506
|
+
errors++;
|
|
507
|
+
}
|
|
508
|
+
var valid10 = _errs10 === errors;
|
|
509
|
+
if (valid10) {
|
|
510
|
+
const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
511
|
+
if (vErrors === null) {
|
|
512
|
+
vErrors = [err4];
|
|
513
|
+
} else {
|
|
514
|
+
vErrors.push(err4);
|
|
515
|
+
}
|
|
516
|
+
errors++;
|
|
517
|
+
} else {
|
|
518
|
+
errors = _errs9;
|
|
519
|
+
if (vErrors !== null) {
|
|
520
|
+
if (_errs9) {
|
|
521
|
+
vErrors.length = _errs9;
|
|
522
|
+
} else {
|
|
523
|
+
vErrors = null;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
validate20.errors = vErrors;
|
|
536
|
+
return errors === 0;
|
|
537
|
+
}
|
|
538
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
539
|
+
let vErrors = null;
|
|
540
|
+
let errors = 0;
|
|
541
|
+
if (Array.isArray(data)) {
|
|
542
|
+
const len0 = data.length;
|
|
543
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
544
|
+
let data0 = data[i0];
|
|
545
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
546
|
+
if (data0.events !== void 0) {
|
|
547
|
+
let data1 = data0.events;
|
|
548
|
+
if (Array.isArray(data1)) {
|
|
549
|
+
const len1 = data1.length;
|
|
550
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
551
|
+
let data2 = data1[i1];
|
|
552
|
+
const _errs3 = errors;
|
|
553
|
+
const _errs4 = errors;
|
|
554
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
555
|
+
if (data2.type === void 0 && ("type")) {
|
|
556
|
+
const err0 = {};
|
|
557
|
+
if (vErrors === null) {
|
|
558
|
+
vErrors = [err0];
|
|
559
|
+
} else {
|
|
560
|
+
vErrors.push(err0);
|
|
561
|
+
}
|
|
562
|
+
errors++;
|
|
563
|
+
} else {
|
|
564
|
+
if (data2.type !== void 0) {
|
|
565
|
+
let data3 = data2.type;
|
|
566
|
+
if (!(data3 === "now" || data3 === "mark" || data3 === "span")) {
|
|
567
|
+
const err1 = {};
|
|
568
|
+
if (vErrors === null) {
|
|
569
|
+
vErrors = [err1];
|
|
570
|
+
} else {
|
|
571
|
+
vErrors.push(err1);
|
|
572
|
+
}
|
|
573
|
+
errors++;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
var valid5 = _errs4 === errors;
|
|
579
|
+
if (valid5) {
|
|
580
|
+
const err2 = { instancePath: instancePath + "/" + i0 + "/events/" + i1, schemaPath: "#/items/properties/events/items/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
581
|
+
if (vErrors === null) {
|
|
582
|
+
vErrors = [err2];
|
|
583
|
+
} else {
|
|
584
|
+
vErrors.push(err2);
|
|
585
|
+
}
|
|
586
|
+
errors++;
|
|
587
|
+
} else {
|
|
588
|
+
errors = _errs3;
|
|
589
|
+
if (vErrors !== null) {
|
|
590
|
+
if (_errs3) {
|
|
591
|
+
vErrors.length = _errs3;
|
|
592
|
+
} else {
|
|
593
|
+
vErrors = null;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
|
|
598
|
+
if (data2.type !== void 0) {
|
|
599
|
+
let data4 = data2.type;
|
|
600
|
+
const _errs8 = errors;
|
|
601
|
+
const _errs9 = errors;
|
|
602
|
+
if (!(data4 === "commit" || data4 === "branch")) {
|
|
603
|
+
const err3 = {};
|
|
604
|
+
if (vErrors === null) {
|
|
605
|
+
vErrors = [err3];
|
|
606
|
+
} else {
|
|
607
|
+
vErrors.push(err3);
|
|
608
|
+
}
|
|
609
|
+
errors++;
|
|
610
|
+
}
|
|
611
|
+
var valid9 = _errs9 === errors;
|
|
612
|
+
if (valid9) {
|
|
613
|
+
const err4 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/type", schemaPath: "#/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
614
|
+
if (vErrors === null) {
|
|
615
|
+
vErrors = [err4];
|
|
616
|
+
} else {
|
|
617
|
+
vErrors.push(err4);
|
|
618
|
+
}
|
|
619
|
+
errors++;
|
|
620
|
+
} else {
|
|
621
|
+
errors = _errs8;
|
|
622
|
+
if (vErrors !== null) {
|
|
623
|
+
if (_errs8) {
|
|
624
|
+
vErrors.length = _errs8;
|
|
625
|
+
} else {
|
|
626
|
+
vErrors = null;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
if (data2.at !== void 0) {
|
|
632
|
+
const err5 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/at", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
328
633
|
if (vErrors === null) {
|
|
329
634
|
vErrors = [err5];
|
|
330
635
|
} else {
|
|
331
|
-
vErrors.push(err5);
|
|
636
|
+
vErrors.push(err5);
|
|
637
|
+
}
|
|
638
|
+
errors++;
|
|
639
|
+
}
|
|
640
|
+
if (data2.into !== void 0) {
|
|
641
|
+
const err6 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/into", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
642
|
+
if (vErrors === null) {
|
|
643
|
+
vErrors = [err6];
|
|
644
|
+
} else {
|
|
645
|
+
vErrors.push(err6);
|
|
646
|
+
}
|
|
647
|
+
errors++;
|
|
648
|
+
}
|
|
649
|
+
if (data2.color !== void 0) {
|
|
650
|
+
const err7 = { instancePath: instancePath + "/" + i0 + "/events/" + i1 + "/color", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
651
|
+
if (vErrors === null) {
|
|
652
|
+
vErrors = [err7];
|
|
653
|
+
} else {
|
|
654
|
+
vErrors.push(err7);
|
|
332
655
|
}
|
|
333
656
|
errors++;
|
|
334
657
|
}
|
|
@@ -339,13 +662,13 @@ function validate17(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
339
662
|
}
|
|
340
663
|
}
|
|
341
664
|
}
|
|
342
|
-
|
|
665
|
+
validate22.errors = vErrors;
|
|
343
666
|
return errors === 0;
|
|
344
667
|
}
|
|
345
|
-
var
|
|
668
|
+
var schema57 = { "enum": ["blue", "amber", "green", "violet", "rose", "slate", "coin"] };
|
|
346
669
|
var pattern0 = new RegExp("^[^\\s\\[\\]\u300C\u300D=:]+$", "u");
|
|
347
670
|
var func3 = ucs2length;
|
|
348
|
-
function
|
|
671
|
+
function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
349
672
|
let vErrors = null;
|
|
350
673
|
let errors = 0;
|
|
351
674
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -447,7 +770,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
447
770
|
if (data.color !== void 0) {
|
|
448
771
|
let data3 = data.color;
|
|
449
772
|
if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
|
|
450
|
-
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
773
|
+
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
451
774
|
if (vErrors === null) {
|
|
452
775
|
vErrors = [err9];
|
|
453
776
|
} else {
|
|
@@ -487,11 +810,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
487
810
|
}
|
|
488
811
|
errors++;
|
|
489
812
|
}
|
|
490
|
-
|
|
813
|
+
validate27.errors = vErrors;
|
|
491
814
|
return errors === 0;
|
|
492
815
|
}
|
|
493
816
|
var pattern3 = new RegExp("^(/|https?://)", "u");
|
|
494
|
-
function
|
|
817
|
+
function validate29(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
495
818
|
let vErrors = null;
|
|
496
819
|
let errors = 0;
|
|
497
820
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -593,7 +916,7 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
593
916
|
if (data.color !== void 0) {
|
|
594
917
|
let data3 = data.color;
|
|
595
918
|
if (!(data3 === "blue" || data3 === "amber" || data3 === "green" || data3 === "violet" || data3 === "rose" || data3 === "slate" || data3 === "coin")) {
|
|
596
|
-
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
919
|
+
const err9 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
597
920
|
if (vErrors === null) {
|
|
598
921
|
vErrors = [err9];
|
|
599
922
|
} else {
|
|
@@ -677,11 +1000,11 @@ function validate24(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
677
1000
|
}
|
|
678
1001
|
errors++;
|
|
679
1002
|
}
|
|
680
|
-
|
|
1003
|
+
validate29.errors = vErrors;
|
|
681
1004
|
return errors === 0;
|
|
682
1005
|
}
|
|
683
1006
|
var pattern4 = new RegExp("^([0-9]+/[0-9]+|[0-9]+(\\.[0-9]+)?%)$", "u");
|
|
684
|
-
function
|
|
1007
|
+
function validate32(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
685
1008
|
let vErrors = null;
|
|
686
1009
|
let errors = 0;
|
|
687
1010
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -767,10 +1090,10 @@ function validate27(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
767
1090
|
}
|
|
768
1091
|
errors++;
|
|
769
1092
|
}
|
|
770
|
-
|
|
1093
|
+
validate32.errors = vErrors;
|
|
771
1094
|
return errors === 0;
|
|
772
1095
|
}
|
|
773
|
-
function
|
|
1096
|
+
function validate31(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
774
1097
|
let vErrors = null;
|
|
775
1098
|
let errors = 0;
|
|
776
1099
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -884,8 +1207,8 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
884
1207
|
}
|
|
885
1208
|
const len1 = data3.length;
|
|
886
1209
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
887
|
-
if (!
|
|
888
|
-
vErrors = vErrors === null ?
|
|
1210
|
+
if (!validate32(data3[i1], { instancePath: instancePath + "/meters/" + i1, parentData: data3, parentDataProperty: i1, rootData })) {
|
|
1211
|
+
vErrors = vErrors === null ? validate32.errors : vErrors.concat(validate32.errors);
|
|
889
1212
|
errors = vErrors.length;
|
|
890
1213
|
}
|
|
891
1214
|
}
|
|
@@ -908,10 +1231,10 @@ function validate26(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
908
1231
|
}
|
|
909
1232
|
errors++;
|
|
910
1233
|
}
|
|
911
|
-
|
|
1234
|
+
validate31.errors = vErrors;
|
|
912
1235
|
return errors === 0;
|
|
913
1236
|
}
|
|
914
|
-
function
|
|
1237
|
+
function validate36(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
915
1238
|
let vErrors = null;
|
|
916
1239
|
let errors = 0;
|
|
917
1240
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -997,13 +1320,13 @@ function validate31(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
997
1320
|
}
|
|
998
1321
|
errors++;
|
|
999
1322
|
}
|
|
1000
|
-
|
|
1323
|
+
validate36.errors = vErrors;
|
|
1001
1324
|
return errors === 0;
|
|
1002
1325
|
}
|
|
1003
|
-
var
|
|
1326
|
+
var schema80 = { "oneOf": [{ "description": "\u7DDA\u3002\u904B\u3076\u7269\u3092\u8F09\u305B\u3066\u9001\u308B\u5074\u304B\u3089\u53D7\u3051\u308B\u5074\u3078\u8D70\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "carry"], "properties": { "type": { "const": "edge" }, "from": { "$ref": "#/definitions/id" }, "to": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" }, "carry": { "$ref": "#/definitions/carry" }, "labelSide": { "description": "\u7DDA\u306E\u540D\u524D\u3092\u7F6E\u304F\u5074 (\u5BC4\u305B\u306E\u6307\u793A)", "enum": ["above", "below", "left", "right"] }, "at": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u7DDA\u3092\u5F15\u304F\u5217\u306E\u76EE\u76DB\u308A", "$ref": "#/definitions/unit" }, "into": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u62E1\u5927\u306E\u5E2F\u3067\u3001\u53D7\u3051\u308B\u7BB1\u3092\u9078\u3076\u5217\u306E\u76EE\u76DB\u308A\u3002\u66F8\u304B\u306A\u3051\u308C\u3070 at \u306E\u5217", "$ref": "#/definitions/unit" } } }, { "description": "\u7BB1\u306E\u4E2D\u306E\u51E6\u7406", "type": "object", "additionalProperties": false, "required": ["type", "box", "label"], "properties": { "type": { "const": "action" }, "box": { "$ref": "#/definitions/id" }, "label": { "$ref": "#/definitions/text" } } }, { "description": "\u7BB1\u306E\u4E0B\u306E\u5C0F\u3055\u306A\u5B57\u306E\u66F8\u304D\u63DB\u3048", "type": "object", "additionalProperties": false, "required": ["type", "box", "text"], "properties": { "type": { "const": "swap" }, "box": { "$ref": "#/definitions/id" }, "text": { "$ref": "#/definitions/text" }, "color": { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u7BC0\u76EE\u306E\u4E38\u306E\u8272", "$ref": "#/definitions/color" } } }, { "description": "commit \u3092\u7A4D\u3080\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u7A4D\u3093\u3060\u679D\u306E\u672D\u3068\u3001\u305D\u306E\u679D\u3092\u6307\u3059 HEAD \u304C\u9032\u3080\u3002\u5F53\u3066\u76F4\u3057 (copy) \u306F\u679D\u306E\u672D\u3092\u52D5\u304B\u3055\u305A\u3001merge commit (merge) \u306F\u53D6\u308A\u8FBC\u3080\u679D\u306E\u5148\u7AEF\u3082\u89AA\u306B\u6301\u3064", "type": "object", "additionalProperties": false, "required": ["type", "id", "branch"], "properties": { "type": { "const": "commit" }, "id": { "$ref": "#/definitions/id" }, "branch": { "$ref": "#/definitions/id" }, "copy": { "$ref": "#/definitions/id" }, "merge": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" }, "note": { "$ref": "#/definitions/text" } } }, { "description": "\u679D\u3092\u5207\u308B\u3002\u679D\u5206\u304B\u308C\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u679D\u306E\u672D\u3092 from \u306E commit \u3078\u7F6E\u304D\u3001HEAD \u3092\u305D\u306E\u679D\u3078\u79FB\u3059", "type": "object", "additionalProperties": false, "required": ["type", "branch", "from"], "properties": { "type": { "const": "branch" }, "branch": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/id" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u4ECA\u306E\u6642\u523B\u306E\u91DD\u3092\u3001to \u306E\u76EE\u76DB\u308A\u306E\u7D42\u308F\u308A\u307E\u3067\u9032\u3081\u308B", "type": "object", "additionalProperties": false, "required": ["type", "to"], "properties": { "type": { "const": "now" }, "to": { "$ref": "#/definitions/unit" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E\u5370\u306E\u5217 row \u306E\u3001from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306E\u5370\u306E\u8272\u3092\u5909\u3048\u308B", "type": "object", "additionalProperties": false, "required": ["type", "row", "from", "to", "color"], "properties": { "type": { "const": "mark" }, "row": { "$ref": "#/definitions/id" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u6642\u9593\u8EF8\u306E\u56F3\u306E from \u304B\u3089 to \u306E\u76EE\u76DB\u308A\u306B\u3001\u62EC\u5F27\u3068\u5B57\u3092\u51FA\u3059\u3002shape \u304C box \u306A\u3089\u5370\u306E\u5217\u3092\u56F2\u307F\u3001\u5B57\u3092\u7E01\u306E\u672D\u306B\u3059\u308B", "type": "object", "additionalProperties": false, "required": ["type", "from", "to", "text"], "properties": { "type": { "const": "span" }, "from": { "$ref": "#/definitions/unit" }, "to": { "$ref": "#/definitions/unit" }, "text": { "$ref": "#/definitions/text" }, "shape": { "enum": ["box"] }, "color": { "$ref": "#/definitions/color" } } }, { "description": "\u8449\u3092\u51FA\u3059\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u8449\u306E\u7BB1\u304C\u73FE\u308C\u308B\u3002hash \u3092\u66F8\u304F\u3068\u7BB1\u306B\u5024\u3092\u51FA\u3057\u3001\u540D\u672D\u3092\u8449\u306E\u4E0B\u306E\u672D\u306B\u51FA\u3059", "type": "object", "additionalProperties": false, "required": ["type", "id"], "properties": { "type": { "const": "leaf" }, "id": { "$ref": "#/definitions/id" }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "1 \u3064\u4EE5\u4E0A\u306E\u5B50\u304B\u3089\u89AA\u3092\u7D44\u3080\u3002\u6728\u306E\u56F3\u3060\u3051\u304C\u66F8\u3051\u308B\u3002\u66F8\u3044\u305F\u6BB5\u3067\u89AA\u306E\u7BB1\u3068\u3001\u5B50\u304B\u3089\u89AA\u3078\u306E\u6728\u306E\u7DDA\u304C\u73FE\u308C\u308B", "type": "object", "additionalProperties": false, "required": ["type", "id", "children"], "properties": { "type": { "const": "node" }, "id": { "$ref": "#/definitions/id" }, "children": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/id" } }, "hash": { "$ref": "#/definitions/hash" } } }, { "description": "\u4E2D\u8EAB\u306E\u5E2F\u306E\u6B04\u306E\u5024\u3068\u672D", "type": "object", "additionalProperties": false, "required": ["type", "field"], "anyOf": [{ "required": ["value"] }, { "required": ["tag"] }], "properties": { "type": { "const": "strip" }, "field": { "$ref": "#/definitions/text" }, "value": { "$ref": "#/definitions/text" }, "tag": { "$ref": "#/definitions/text" } } }] };
|
|
1004
1327
|
var pattern14 = new RegExp("^[0-9a-f]{4,40}$", "u");
|
|
1005
|
-
var
|
|
1006
|
-
function
|
|
1328
|
+
var schema84 = { "properties": { "kind": { "enum": ["envelope", "tag", "coin", "none"] }}};
|
|
1329
|
+
function validate39(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
1007
1330
|
let vErrors = null;
|
|
1008
1331
|
let errors = 0;
|
|
1009
1332
|
const _errs1 = errors;
|
|
@@ -1129,7 +1452,7 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1129
1452
|
if (data.kind !== void 0) {
|
|
1130
1453
|
let data1 = data.kind;
|
|
1131
1454
|
if (!(data1 === "envelope" || data1 === "tag" || data1 === "coin" || data1 === "none")) {
|
|
1132
|
-
const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues:
|
|
1455
|
+
const err8 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema84.properties.kind.enum }, message: "must be equal to one of the allowed values" };
|
|
1133
1456
|
if (vErrors === null) {
|
|
1134
1457
|
vErrors = [err8];
|
|
1135
1458
|
} else {
|
|
@@ -1169,10 +1492,10 @@ function validate34(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1169
1492
|
}
|
|
1170
1493
|
errors++;
|
|
1171
1494
|
}
|
|
1172
|
-
|
|
1495
|
+
validate39.errors = vErrors;
|
|
1173
1496
|
return errors === 0;
|
|
1174
1497
|
}
|
|
1175
|
-
function
|
|
1498
|
+
function validate38(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
1176
1499
|
let vErrors = null;
|
|
1177
1500
|
let errors = 0;
|
|
1178
1501
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -1314,15 +1637,15 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1314
1637
|
}
|
|
1315
1638
|
}
|
|
1316
1639
|
if (data.carry !== void 0) {
|
|
1317
|
-
if (!
|
|
1318
|
-
vErrors = vErrors === null ?
|
|
1640
|
+
if (!validate39(data.carry, { instancePath: instancePath + "/carry", parentData: data, parentDataProperty: "carry", rootData })) {
|
|
1641
|
+
vErrors = vErrors === null ? validate39.errors : vErrors.concat(validate39.errors);
|
|
1319
1642
|
errors = vErrors.length;
|
|
1320
1643
|
}
|
|
1321
1644
|
}
|
|
1322
1645
|
if (data.labelSide !== void 0) {
|
|
1323
1646
|
let data5 = data.labelSide;
|
|
1324
1647
|
if (!(data5 === "above" || data5 === "below" || data5 === "left" || data5 === "right")) {
|
|
1325
|
-
const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues:
|
|
1648
|
+
const err13 = { instancePath: instancePath + "/labelSide", schemaPath: "#/oneOf/0/properties/labelSide/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[0].properties.labelSide.enum }, message: "must be equal to one of the allowed values" };
|
|
1326
1649
|
if (vErrors === null) {
|
|
1327
1650
|
vErrors = [err13];
|
|
1328
1651
|
} else {
|
|
@@ -1588,7 +1911,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1588
1911
|
if (data.color !== void 0) {
|
|
1589
1912
|
let data14 = data.color;
|
|
1590
1913
|
if (!(data14 === "blue" || data14 === "amber" || data14 === "green" || data14 === "violet" || data14 === "rose" || data14 === "slate" || data14 === "coin")) {
|
|
1591
|
-
const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
1914
|
+
const err38 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
1592
1915
|
if (vErrors === null) {
|
|
1593
1916
|
vErrors = [err38];
|
|
1594
1917
|
} else {
|
|
@@ -2116,7 +2439,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2116
2439
|
if (data.color !== void 0) {
|
|
2117
2440
|
let data31 = data.color;
|
|
2118
2441
|
if (!(data31 === "blue" || data31 === "amber" || data31 === "green" || data31 === "violet" || data31 === "rose" || data31 === "slate" || data31 === "coin")) {
|
|
2119
|
-
const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
2442
|
+
const err88 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
2120
2443
|
if (vErrors === null) {
|
|
2121
2444
|
vErrors = [err88];
|
|
2122
2445
|
} else {
|
|
@@ -2264,7 +2587,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2264
2587
|
}
|
|
2265
2588
|
if (data.shape !== void 0) {
|
|
2266
2589
|
if (!(data.shape === "box")) {
|
|
2267
|
-
const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues:
|
|
2590
|
+
const err102 = { instancePath: instancePath + "/shape", schemaPath: "#/oneOf/7/properties/shape/enum", keyword: "enum", params: { allowedValues: schema80.oneOf[7].properties.shape.enum }, message: "must be equal to one of the allowed values" };
|
|
2268
2591
|
if (vErrors === null) {
|
|
2269
2592
|
vErrors = [err102];
|
|
2270
2593
|
} else {
|
|
@@ -2276,7 +2599,7 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2276
2599
|
if (data.color !== void 0) {
|
|
2277
2600
|
let data37 = data.color;
|
|
2278
2601
|
if (!(data37 === "blue" || data37 === "amber" || data37 === "green" || data37 === "violet" || data37 === "rose" || data37 === "slate" || data37 === "coin")) {
|
|
2279
|
-
const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
2602
|
+
const err103 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
2280
2603
|
if (vErrors === null) {
|
|
2281
2604
|
vErrors = [err103];
|
|
2282
2605
|
} else {
|
|
@@ -2294,13 +2617,10 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2294
2617
|
}
|
|
2295
2618
|
errors++;
|
|
2296
2619
|
}
|
|
2297
|
-
} else if (tag0 === "
|
|
2298
|
-
const _errs117 = errors;
|
|
2299
|
-
let valid45 = false;
|
|
2300
|
-
const _errs118 = errors;
|
|
2620
|
+
} else if (tag0 === "leaf") {
|
|
2301
2621
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2302
|
-
if (data.
|
|
2303
|
-
const err105 = { instancePath, schemaPath: "#/oneOf/8/
|
|
2622
|
+
if (data.type === void 0) {
|
|
2623
|
+
const err105 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
2304
2624
|
if (vErrors === null) {
|
|
2305
2625
|
vErrors = [err105];
|
|
2306
2626
|
} else {
|
|
@@ -2308,38 +2628,285 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2308
2628
|
}
|
|
2309
2629
|
errors++;
|
|
2310
2630
|
}
|
|
2631
|
+
if (data.id === void 0) {
|
|
2632
|
+
const err106 = { instancePath, schemaPath: "#/oneOf/8/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
2633
|
+
if (vErrors === null) {
|
|
2634
|
+
vErrors = [err106];
|
|
2635
|
+
} else {
|
|
2636
|
+
vErrors.push(err106);
|
|
2637
|
+
}
|
|
2638
|
+
errors++;
|
|
2639
|
+
}
|
|
2640
|
+
for (const key8 in data) {
|
|
2641
|
+
if (!(key8 === "type" || key8 === "id" || key8 === "hash")) {
|
|
2642
|
+
const err107 = { instancePath, schemaPath: "#/oneOf/8/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key8 }, message: "must NOT have additional properties" };
|
|
2643
|
+
if (vErrors === null) {
|
|
2644
|
+
vErrors = [err107];
|
|
2645
|
+
} else {
|
|
2646
|
+
vErrors.push(err107);
|
|
2647
|
+
}
|
|
2648
|
+
errors++;
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
if (data.type !== void 0) {
|
|
2652
|
+
if ("leaf" !== data.type) {
|
|
2653
|
+
const err108 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/8/properties/type/const", keyword: "const", params: { allowedValue: "leaf" }, message: "must be equal to constant" };
|
|
2654
|
+
if (vErrors === null) {
|
|
2655
|
+
vErrors = [err108];
|
|
2656
|
+
} else {
|
|
2657
|
+
vErrors.push(err108);
|
|
2658
|
+
}
|
|
2659
|
+
errors++;
|
|
2660
|
+
}
|
|
2661
|
+
}
|
|
2662
|
+
if (data.id !== void 0) {
|
|
2663
|
+
let data39 = data.id;
|
|
2664
|
+
if (typeof data39 === "string") {
|
|
2665
|
+
if (!pattern0.test(data39)) {
|
|
2666
|
+
const err109 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
2667
|
+
if (vErrors === null) {
|
|
2668
|
+
vErrors = [err109];
|
|
2669
|
+
} else {
|
|
2670
|
+
vErrors.push(err109);
|
|
2671
|
+
}
|
|
2672
|
+
errors++;
|
|
2673
|
+
}
|
|
2674
|
+
} else {
|
|
2675
|
+
const err110 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2676
|
+
if (vErrors === null) {
|
|
2677
|
+
vErrors = [err110];
|
|
2678
|
+
} else {
|
|
2679
|
+
vErrors.push(err110);
|
|
2680
|
+
}
|
|
2681
|
+
errors++;
|
|
2682
|
+
}
|
|
2683
|
+
}
|
|
2684
|
+
if (data.hash !== void 0) {
|
|
2685
|
+
let data40 = data.hash;
|
|
2686
|
+
if (typeof data40 === "string") {
|
|
2687
|
+
if (!pattern14.test(data40)) {
|
|
2688
|
+
const err111 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
|
|
2689
|
+
if (vErrors === null) {
|
|
2690
|
+
vErrors = [err111];
|
|
2691
|
+
} else {
|
|
2692
|
+
vErrors.push(err111);
|
|
2693
|
+
}
|
|
2694
|
+
errors++;
|
|
2695
|
+
}
|
|
2696
|
+
} else {
|
|
2697
|
+
const err112 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2698
|
+
if (vErrors === null) {
|
|
2699
|
+
vErrors = [err112];
|
|
2700
|
+
} else {
|
|
2701
|
+
vErrors.push(err112);
|
|
2702
|
+
}
|
|
2703
|
+
errors++;
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
} else {
|
|
2707
|
+
const err113 = { instancePath, schemaPath: "#/oneOf/8/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2708
|
+
if (vErrors === null) {
|
|
2709
|
+
vErrors = [err113];
|
|
2710
|
+
} else {
|
|
2711
|
+
vErrors.push(err113);
|
|
2712
|
+
}
|
|
2713
|
+
errors++;
|
|
2714
|
+
}
|
|
2715
|
+
} else if (tag0 === "node") {
|
|
2716
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2717
|
+
if (data.type === void 0) {
|
|
2718
|
+
const err114 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
2719
|
+
if (vErrors === null) {
|
|
2720
|
+
vErrors = [err114];
|
|
2721
|
+
} else {
|
|
2722
|
+
vErrors.push(err114);
|
|
2723
|
+
}
|
|
2724
|
+
errors++;
|
|
2725
|
+
}
|
|
2726
|
+
if (data.id === void 0) {
|
|
2727
|
+
const err115 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "id" }, message: "must have required property 'id'" };
|
|
2728
|
+
if (vErrors === null) {
|
|
2729
|
+
vErrors = [err115];
|
|
2730
|
+
} else {
|
|
2731
|
+
vErrors.push(err115);
|
|
2732
|
+
}
|
|
2733
|
+
errors++;
|
|
2734
|
+
}
|
|
2735
|
+
if (data.children === void 0) {
|
|
2736
|
+
const err116 = { instancePath, schemaPath: "#/oneOf/9/required", keyword: "required", params: { missingProperty: "children" }, message: "must have required property 'children'" };
|
|
2737
|
+
if (vErrors === null) {
|
|
2738
|
+
vErrors = [err116];
|
|
2739
|
+
} else {
|
|
2740
|
+
vErrors.push(err116);
|
|
2741
|
+
}
|
|
2742
|
+
errors++;
|
|
2743
|
+
}
|
|
2744
|
+
for (const key9 in data) {
|
|
2745
|
+
if (!(key9 === "type" || key9 === "id" || key9 === "children" || key9 === "hash")) {
|
|
2746
|
+
const err117 = { instancePath, schemaPath: "#/oneOf/9/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key9 }, message: "must NOT have additional properties" };
|
|
2747
|
+
if (vErrors === null) {
|
|
2748
|
+
vErrors = [err117];
|
|
2749
|
+
} else {
|
|
2750
|
+
vErrors.push(err117);
|
|
2751
|
+
}
|
|
2752
|
+
errors++;
|
|
2753
|
+
}
|
|
2754
|
+
}
|
|
2755
|
+
if (data.type !== void 0) {
|
|
2756
|
+
if ("node" !== data.type) {
|
|
2757
|
+
const err118 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/9/properties/type/const", keyword: "const", params: { allowedValue: "node" }, message: "must be equal to constant" };
|
|
2758
|
+
if (vErrors === null) {
|
|
2759
|
+
vErrors = [err118];
|
|
2760
|
+
} else {
|
|
2761
|
+
vErrors.push(err118);
|
|
2762
|
+
}
|
|
2763
|
+
errors++;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
if (data.id !== void 0) {
|
|
2767
|
+
let data42 = data.id;
|
|
2768
|
+
if (typeof data42 === "string") {
|
|
2769
|
+
if (!pattern0.test(data42)) {
|
|
2770
|
+
const err119 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
2771
|
+
if (vErrors === null) {
|
|
2772
|
+
vErrors = [err119];
|
|
2773
|
+
} else {
|
|
2774
|
+
vErrors.push(err119);
|
|
2775
|
+
}
|
|
2776
|
+
errors++;
|
|
2777
|
+
}
|
|
2778
|
+
} else {
|
|
2779
|
+
const err120 = { instancePath: instancePath + "/id", schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2780
|
+
if (vErrors === null) {
|
|
2781
|
+
vErrors = [err120];
|
|
2782
|
+
} else {
|
|
2783
|
+
vErrors.push(err120);
|
|
2784
|
+
}
|
|
2785
|
+
errors++;
|
|
2786
|
+
}
|
|
2787
|
+
}
|
|
2788
|
+
if (data.children !== void 0) {
|
|
2789
|
+
let data43 = data.children;
|
|
2790
|
+
if (Array.isArray(data43)) {
|
|
2791
|
+
if (data43.length < 1) {
|
|
2792
|
+
const err121 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
2793
|
+
if (vErrors === null) {
|
|
2794
|
+
vErrors = [err121];
|
|
2795
|
+
} else {
|
|
2796
|
+
vErrors.push(err121);
|
|
2797
|
+
}
|
|
2798
|
+
errors++;
|
|
2799
|
+
}
|
|
2800
|
+
const len0 = data43.length;
|
|
2801
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
2802
|
+
let data44 = data43[i0];
|
|
2803
|
+
if (typeof data44 === "string") {
|
|
2804
|
+
if (!pattern0.test(data44)) {
|
|
2805
|
+
const err122 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/pattern", keyword: "pattern", params: { pattern: "^[^\\s\\[\\]\u300C\u300D=:]+$" }, message: 'must match pattern "^[^\\s\\[\\]\u300C\u300D=:]+$"' };
|
|
2806
|
+
if (vErrors === null) {
|
|
2807
|
+
vErrors = [err122];
|
|
2808
|
+
} else {
|
|
2809
|
+
vErrors.push(err122);
|
|
2810
|
+
}
|
|
2811
|
+
errors++;
|
|
2812
|
+
}
|
|
2813
|
+
} else {
|
|
2814
|
+
const err123 = { instancePath: instancePath + "/children/" + i0, schemaPath: "#/definitions/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2815
|
+
if (vErrors === null) {
|
|
2816
|
+
vErrors = [err123];
|
|
2817
|
+
} else {
|
|
2818
|
+
vErrors.push(err123);
|
|
2819
|
+
}
|
|
2820
|
+
errors++;
|
|
2821
|
+
}
|
|
2822
|
+
}
|
|
2823
|
+
} else {
|
|
2824
|
+
const err124 = { instancePath: instancePath + "/children", schemaPath: "#/oneOf/9/properties/children/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
2825
|
+
if (vErrors === null) {
|
|
2826
|
+
vErrors = [err124];
|
|
2827
|
+
} else {
|
|
2828
|
+
vErrors.push(err124);
|
|
2829
|
+
}
|
|
2830
|
+
errors++;
|
|
2831
|
+
}
|
|
2832
|
+
}
|
|
2833
|
+
if (data.hash !== void 0) {
|
|
2834
|
+
let data45 = data.hash;
|
|
2835
|
+
if (typeof data45 === "string") {
|
|
2836
|
+
if (!pattern14.test(data45)) {
|
|
2837
|
+
const err125 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/pattern", keyword: "pattern", params: { pattern: "^[0-9a-f]{4,40}$" }, message: 'must match pattern "^[0-9a-f]{4,40}$"' };
|
|
2838
|
+
if (vErrors === null) {
|
|
2839
|
+
vErrors = [err125];
|
|
2840
|
+
} else {
|
|
2841
|
+
vErrors.push(err125);
|
|
2842
|
+
}
|
|
2843
|
+
errors++;
|
|
2844
|
+
}
|
|
2845
|
+
} else {
|
|
2846
|
+
const err126 = { instancePath: instancePath + "/hash", schemaPath: "#/definitions/hash/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2847
|
+
if (vErrors === null) {
|
|
2848
|
+
vErrors = [err126];
|
|
2849
|
+
} else {
|
|
2850
|
+
vErrors.push(err126);
|
|
2851
|
+
}
|
|
2852
|
+
errors++;
|
|
2853
|
+
}
|
|
2854
|
+
}
|
|
2855
|
+
} else {
|
|
2856
|
+
const err127 = { instancePath, schemaPath: "#/oneOf/9/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2857
|
+
if (vErrors === null) {
|
|
2858
|
+
vErrors = [err127];
|
|
2859
|
+
} else {
|
|
2860
|
+
vErrors.push(err127);
|
|
2861
|
+
}
|
|
2862
|
+
errors++;
|
|
2863
|
+
}
|
|
2864
|
+
} else if (tag0 === "strip") {
|
|
2865
|
+
const _errs142 = errors;
|
|
2866
|
+
let valid56 = false;
|
|
2867
|
+
const _errs143 = errors;
|
|
2868
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2869
|
+
if (data.value === void 0) {
|
|
2870
|
+
const err128 = { instancePath, schemaPath: "#/oneOf/10/anyOf/0/required", keyword: "required", params: { missingProperty: "value" }, message: "must have required property 'value'" };
|
|
2871
|
+
if (vErrors === null) {
|
|
2872
|
+
vErrors = [err128];
|
|
2873
|
+
} else {
|
|
2874
|
+
vErrors.push(err128);
|
|
2875
|
+
}
|
|
2876
|
+
errors++;
|
|
2877
|
+
}
|
|
2311
2878
|
}
|
|
2312
|
-
var _valid0 =
|
|
2313
|
-
|
|
2314
|
-
if (!
|
|
2315
|
-
const
|
|
2879
|
+
var _valid0 = _errs143 === errors;
|
|
2880
|
+
valid56 = valid56 || _valid0;
|
|
2881
|
+
if (!valid56) {
|
|
2882
|
+
const _errs144 = errors;
|
|
2316
2883
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2317
2884
|
if (data.tag === void 0) {
|
|
2318
|
-
const
|
|
2885
|
+
const err129 = { instancePath, schemaPath: "#/oneOf/10/anyOf/1/required", keyword: "required", params: { missingProperty: "tag" }, message: "must have required property 'tag'" };
|
|
2319
2886
|
if (vErrors === null) {
|
|
2320
|
-
vErrors = [
|
|
2887
|
+
vErrors = [err129];
|
|
2321
2888
|
} else {
|
|
2322
|
-
vErrors.push(
|
|
2889
|
+
vErrors.push(err129);
|
|
2323
2890
|
}
|
|
2324
2891
|
errors++;
|
|
2325
2892
|
}
|
|
2326
2893
|
}
|
|
2327
|
-
var _valid0 =
|
|
2328
|
-
|
|
2894
|
+
var _valid0 = _errs144 === errors;
|
|
2895
|
+
valid56 = valid56 || _valid0;
|
|
2329
2896
|
}
|
|
2330
|
-
if (!
|
|
2331
|
-
const
|
|
2897
|
+
if (!valid56) {
|
|
2898
|
+
const err130 = { instancePath, schemaPath: "#/oneOf/10/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
2332
2899
|
if (vErrors === null) {
|
|
2333
|
-
vErrors = [
|
|
2900
|
+
vErrors = [err130];
|
|
2334
2901
|
} else {
|
|
2335
|
-
vErrors.push(
|
|
2902
|
+
vErrors.push(err130);
|
|
2336
2903
|
}
|
|
2337
2904
|
errors++;
|
|
2338
2905
|
} else {
|
|
2339
|
-
errors =
|
|
2906
|
+
errors = _errs142;
|
|
2340
2907
|
if (vErrors !== null) {
|
|
2341
|
-
if (
|
|
2342
|
-
vErrors.length =
|
|
2908
|
+
if (_errs142) {
|
|
2909
|
+
vErrors.length = _errs142;
|
|
2343
2910
|
} else {
|
|
2344
2911
|
vErrors = null;
|
|
2345
2912
|
}
|
|
@@ -2347,151 +2914,151 @@ function validate33(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2347
2914
|
}
|
|
2348
2915
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2349
2916
|
if (data.type === void 0) {
|
|
2350
|
-
const
|
|
2917
|
+
const err131 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "type" }, message: "must have required property 'type'" };
|
|
2351
2918
|
if (vErrors === null) {
|
|
2352
|
-
vErrors = [
|
|
2919
|
+
vErrors = [err131];
|
|
2353
2920
|
} else {
|
|
2354
|
-
vErrors.push(
|
|
2921
|
+
vErrors.push(err131);
|
|
2355
2922
|
}
|
|
2356
2923
|
errors++;
|
|
2357
2924
|
}
|
|
2358
2925
|
if (data.field === void 0) {
|
|
2359
|
-
const
|
|
2926
|
+
const err132 = { instancePath, schemaPath: "#/oneOf/10/required", keyword: "required", params: { missingProperty: "field" }, message: "must have required property 'field'" };
|
|
2360
2927
|
if (vErrors === null) {
|
|
2361
|
-
vErrors = [
|
|
2928
|
+
vErrors = [err132];
|
|
2362
2929
|
} else {
|
|
2363
|
-
vErrors.push(
|
|
2930
|
+
vErrors.push(err132);
|
|
2364
2931
|
}
|
|
2365
2932
|
errors++;
|
|
2366
2933
|
}
|
|
2367
|
-
for (const
|
|
2368
|
-
if (!(
|
|
2369
|
-
const
|
|
2934
|
+
for (const key10 in data) {
|
|
2935
|
+
if (!(key10 === "type" || key10 === "field" || key10 === "value" || key10 === "tag")) {
|
|
2936
|
+
const err133 = { instancePath, schemaPath: "#/oneOf/10/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key10 }, message: "must NOT have additional properties" };
|
|
2370
2937
|
if (vErrors === null) {
|
|
2371
|
-
vErrors = [
|
|
2938
|
+
vErrors = [err133];
|
|
2372
2939
|
} else {
|
|
2373
|
-
vErrors.push(
|
|
2940
|
+
vErrors.push(err133);
|
|
2374
2941
|
}
|
|
2375
2942
|
errors++;
|
|
2376
2943
|
}
|
|
2377
2944
|
}
|
|
2378
2945
|
if (data.type !== void 0) {
|
|
2379
2946
|
if ("strip" !== data.type) {
|
|
2380
|
-
const
|
|
2947
|
+
const err134 = { instancePath: instancePath + "/type", schemaPath: "#/oneOf/10/properties/type/const", keyword: "const", params: { allowedValue: "strip" }, message: "must be equal to constant" };
|
|
2381
2948
|
if (vErrors === null) {
|
|
2382
|
-
vErrors = [
|
|
2949
|
+
vErrors = [err134];
|
|
2383
2950
|
} else {
|
|
2384
|
-
vErrors.push(
|
|
2951
|
+
vErrors.push(err134);
|
|
2385
2952
|
}
|
|
2386
2953
|
errors++;
|
|
2387
2954
|
}
|
|
2388
2955
|
}
|
|
2389
2956
|
if (data.field !== void 0) {
|
|
2390
|
-
let
|
|
2391
|
-
if (typeof
|
|
2392
|
-
if (func3(
|
|
2393
|
-
const
|
|
2957
|
+
let data47 = data.field;
|
|
2958
|
+
if (typeof data47 === "string") {
|
|
2959
|
+
if (func3(data47) < 1) {
|
|
2960
|
+
const err135 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
2394
2961
|
if (vErrors === null) {
|
|
2395
|
-
vErrors = [
|
|
2962
|
+
vErrors = [err135];
|
|
2396
2963
|
} else {
|
|
2397
|
-
vErrors.push(
|
|
2964
|
+
vErrors.push(err135);
|
|
2398
2965
|
}
|
|
2399
2966
|
errors++;
|
|
2400
2967
|
}
|
|
2401
2968
|
} else {
|
|
2402
|
-
const
|
|
2969
|
+
const err136 = { instancePath: instancePath + "/field", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2403
2970
|
if (vErrors === null) {
|
|
2404
|
-
vErrors = [
|
|
2971
|
+
vErrors = [err136];
|
|
2405
2972
|
} else {
|
|
2406
|
-
vErrors.push(
|
|
2973
|
+
vErrors.push(err136);
|
|
2407
2974
|
}
|
|
2408
2975
|
errors++;
|
|
2409
2976
|
}
|
|
2410
2977
|
}
|
|
2411
2978
|
if (data.value !== void 0) {
|
|
2412
|
-
let
|
|
2413
|
-
if (typeof
|
|
2414
|
-
if (func3(
|
|
2415
|
-
const
|
|
2979
|
+
let data48 = data.value;
|
|
2980
|
+
if (typeof data48 === "string") {
|
|
2981
|
+
if (func3(data48) < 1) {
|
|
2982
|
+
const err137 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
2416
2983
|
if (vErrors === null) {
|
|
2417
|
-
vErrors = [
|
|
2984
|
+
vErrors = [err137];
|
|
2418
2985
|
} else {
|
|
2419
|
-
vErrors.push(
|
|
2986
|
+
vErrors.push(err137);
|
|
2420
2987
|
}
|
|
2421
2988
|
errors++;
|
|
2422
2989
|
}
|
|
2423
2990
|
} else {
|
|
2424
|
-
const
|
|
2991
|
+
const err138 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2425
2992
|
if (vErrors === null) {
|
|
2426
|
-
vErrors = [
|
|
2993
|
+
vErrors = [err138];
|
|
2427
2994
|
} else {
|
|
2428
|
-
vErrors.push(
|
|
2995
|
+
vErrors.push(err138);
|
|
2429
2996
|
}
|
|
2430
2997
|
errors++;
|
|
2431
2998
|
}
|
|
2432
2999
|
}
|
|
2433
3000
|
if (data.tag !== void 0) {
|
|
2434
|
-
let
|
|
2435
|
-
if (typeof
|
|
2436
|
-
if (func3(
|
|
2437
|
-
const
|
|
3001
|
+
let data49 = data.tag;
|
|
3002
|
+
if (typeof data49 === "string") {
|
|
3003
|
+
if (func3(data49) < 1) {
|
|
3004
|
+
const err139 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
2438
3005
|
if (vErrors === null) {
|
|
2439
|
-
vErrors = [
|
|
3006
|
+
vErrors = [err139];
|
|
2440
3007
|
} else {
|
|
2441
|
-
vErrors.push(
|
|
3008
|
+
vErrors.push(err139);
|
|
2442
3009
|
}
|
|
2443
3010
|
errors++;
|
|
2444
3011
|
}
|
|
2445
3012
|
} else {
|
|
2446
|
-
const
|
|
3013
|
+
const err140 = { instancePath: instancePath + "/tag", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2447
3014
|
if (vErrors === null) {
|
|
2448
|
-
vErrors = [
|
|
3015
|
+
vErrors = [err140];
|
|
2449
3016
|
} else {
|
|
2450
|
-
vErrors.push(
|
|
3017
|
+
vErrors.push(err140);
|
|
2451
3018
|
}
|
|
2452
3019
|
errors++;
|
|
2453
3020
|
}
|
|
2454
3021
|
}
|
|
2455
3022
|
} else {
|
|
2456
|
-
const
|
|
3023
|
+
const err141 = { instancePath, schemaPath: "#/oneOf/10/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2457
3024
|
if (vErrors === null) {
|
|
2458
|
-
vErrors = [
|
|
3025
|
+
vErrors = [err141];
|
|
2459
3026
|
} else {
|
|
2460
|
-
vErrors.push(
|
|
3027
|
+
vErrors.push(err141);
|
|
2461
3028
|
}
|
|
2462
3029
|
errors++;
|
|
2463
3030
|
}
|
|
2464
3031
|
} else {
|
|
2465
|
-
const
|
|
3032
|
+
const err142 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "mapping", tag: "type", tagValue: tag0 }, message: 'value of tag "type" must be in oneOf' };
|
|
2466
3033
|
if (vErrors === null) {
|
|
2467
|
-
vErrors = [
|
|
3034
|
+
vErrors = [err142];
|
|
2468
3035
|
} else {
|
|
2469
|
-
vErrors.push(
|
|
3036
|
+
vErrors.push(err142);
|
|
2470
3037
|
}
|
|
2471
3038
|
errors++;
|
|
2472
3039
|
}
|
|
2473
3040
|
} else {
|
|
2474
|
-
const
|
|
3041
|
+
const err143 = { instancePath, schemaPath: "#/discriminator", keyword: "discriminator", params: { error: "tag", tag: "type", tagValue: tag0 }, message: 'tag "type" must be string' };
|
|
2475
3042
|
if (vErrors === null) {
|
|
2476
|
-
vErrors = [
|
|
3043
|
+
vErrors = [err143];
|
|
2477
3044
|
} else {
|
|
2478
|
-
vErrors.push(
|
|
3045
|
+
vErrors.push(err143);
|
|
2479
3046
|
}
|
|
2480
3047
|
errors++;
|
|
2481
3048
|
}
|
|
2482
3049
|
} else {
|
|
2483
|
-
const
|
|
3050
|
+
const err144 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2484
3051
|
if (vErrors === null) {
|
|
2485
|
-
vErrors = [
|
|
3052
|
+
vErrors = [err144];
|
|
2486
3053
|
} else {
|
|
2487
|
-
vErrors.push(
|
|
3054
|
+
vErrors.push(err144);
|
|
2488
3055
|
}
|
|
2489
3056
|
errors++;
|
|
2490
3057
|
}
|
|
2491
|
-
|
|
3058
|
+
validate38.errors = vErrors;
|
|
2492
3059
|
return errors === 0;
|
|
2493
3060
|
}
|
|
2494
|
-
function
|
|
3061
|
+
function validate35(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2495
3062
|
let vErrors = null;
|
|
2496
3063
|
let errors = 0;
|
|
2497
3064
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -2613,8 +3180,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2613
3180
|
}
|
|
2614
3181
|
const len0 = data3.length;
|
|
2615
3182
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
2616
|
-
if (!
|
|
2617
|
-
vErrors = vErrors === null ?
|
|
3183
|
+
if (!validate36(data3[i0], { instancePath: instancePath + "/sources/" + i0, parentData: data3, parentDataProperty: i0, rootData })) {
|
|
3184
|
+
vErrors = vErrors === null ? validate36.errors : vErrors.concat(validate36.errors);
|
|
2618
3185
|
errors = vErrors.length;
|
|
2619
3186
|
}
|
|
2620
3187
|
}
|
|
@@ -2633,8 +3200,8 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2633
3200
|
if (Array.isArray(data5)) {
|
|
2634
3201
|
const len1 = data5.length;
|
|
2635
3202
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
2636
|
-
if (!
|
|
2637
|
-
vErrors = vErrors === null ?
|
|
3203
|
+
if (!validate38(data5[i1], { instancePath: instancePath + "/events/" + i1, parentData: data5, parentDataProperty: i1, rootData })) {
|
|
3204
|
+
vErrors = vErrors === null ? validate38.errors : vErrors.concat(validate38.errors);
|
|
2638
3205
|
errors = vErrors.length;
|
|
2639
3206
|
}
|
|
2640
3207
|
}
|
|
@@ -2657,10 +3224,10 @@ function validate30(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2657
3224
|
}
|
|
2658
3225
|
errors++;
|
|
2659
3226
|
}
|
|
2660
|
-
|
|
3227
|
+
validate35.errors = vErrors;
|
|
2661
3228
|
return errors === 0;
|
|
2662
3229
|
}
|
|
2663
|
-
function
|
|
3230
|
+
function validate43(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2664
3231
|
let vErrors = null;
|
|
2665
3232
|
let errors = 0;
|
|
2666
3233
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -2738,10 +3305,10 @@ function validate38(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2738
3305
|
}
|
|
2739
3306
|
errors++;
|
|
2740
3307
|
}
|
|
2741
|
-
|
|
3308
|
+
validate43.errors = vErrors;
|
|
2742
3309
|
return errors === 0;
|
|
2743
3310
|
}
|
|
2744
|
-
function
|
|
3311
|
+
function validate46(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2745
3312
|
let vErrors = null;
|
|
2746
3313
|
let errors = 0;
|
|
2747
3314
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -2849,10 +3416,10 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2849
3416
|
}
|
|
2850
3417
|
errors++;
|
|
2851
3418
|
}
|
|
2852
|
-
|
|
3419
|
+
validate46.errors = vErrors;
|
|
2853
3420
|
return errors === 0;
|
|
2854
3421
|
}
|
|
2855
|
-
function
|
|
3422
|
+
function validate45(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2856
3423
|
let vErrors = null;
|
|
2857
3424
|
let errors = 0;
|
|
2858
3425
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -2890,8 +3457,8 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2890
3457
|
}
|
|
2891
3458
|
const len0 = data0.length;
|
|
2892
3459
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
2893
|
-
if (!
|
|
2894
|
-
vErrors = vErrors === null ?
|
|
3460
|
+
if (!validate46(data0[i0], { instancePath: instancePath + "/paths/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
|
|
3461
|
+
vErrors = vErrors === null ? validate46.errors : vErrors.concat(validate46.errors);
|
|
2895
3462
|
errors = vErrors.length;
|
|
2896
3463
|
}
|
|
2897
3464
|
}
|
|
@@ -2914,10 +3481,10 @@ function validate40(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2914
3481
|
}
|
|
2915
3482
|
errors++;
|
|
2916
3483
|
}
|
|
2917
|
-
|
|
3484
|
+
validate45.errors = vErrors;
|
|
2918
3485
|
return errors === 0;
|
|
2919
3486
|
}
|
|
2920
|
-
function
|
|
3487
|
+
function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2921
3488
|
let vErrors = null;
|
|
2922
3489
|
let errors = 0;
|
|
2923
3490
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -2994,10 +3561,10 @@ function validate45(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2994
3561
|
}
|
|
2995
3562
|
errors++;
|
|
2996
3563
|
}
|
|
2997
|
-
|
|
3564
|
+
validate50.errors = vErrors;
|
|
2998
3565
|
return errors === 0;
|
|
2999
3566
|
}
|
|
3000
|
-
function
|
|
3567
|
+
function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3001
3568
|
let vErrors = null;
|
|
3002
3569
|
let errors = 0;
|
|
3003
3570
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3035,8 +3602,8 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3035
3602
|
}
|
|
3036
3603
|
const len0 = data0.length;
|
|
3037
3604
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
3038
|
-
if (!
|
|
3039
|
-
vErrors = vErrors === null ?
|
|
3605
|
+
if (!validate50(data0[i0], { instancePath: instancePath + "/branches/" + i0, parentData: data0, parentDataProperty: i0, rootData })) {
|
|
3606
|
+
vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
|
|
3040
3607
|
errors = vErrors.length;
|
|
3041
3608
|
}
|
|
3042
3609
|
}
|
|
@@ -3059,11 +3626,11 @@ function validate44(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3059
3626
|
}
|
|
3060
3627
|
errors++;
|
|
3061
3628
|
}
|
|
3062
|
-
|
|
3629
|
+
validate49.errors = vErrors;
|
|
3063
3630
|
return errors === 0;
|
|
3064
3631
|
}
|
|
3065
|
-
var
|
|
3066
|
-
function
|
|
3632
|
+
var pattern27 = new RegExp("^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$", "u");
|
|
3633
|
+
function validate54(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3067
3634
|
let vErrors = null;
|
|
3068
3635
|
let errors = 0;
|
|
3069
3636
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3130,7 +3697,7 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3130
3697
|
if (data.length !== void 0) {
|
|
3131
3698
|
let data1 = data.length;
|
|
3132
3699
|
if (typeof data1 === "string") {
|
|
3133
|
-
if (!
|
|
3700
|
+
if (!pattern27.test(data1)) {
|
|
3134
3701
|
const err6 = { instancePath: instancePath + "/length", schemaPath: "#/definitions/duration/pattern", keyword: "pattern", params: { pattern: "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$" }, message: 'must match pattern "^[0-9]+(\\.[0-9]+)?(ms|s|min|h|d)$"' };
|
|
3135
3702
|
if (vErrors === null) {
|
|
3136
3703
|
vErrors = [err6];
|
|
@@ -3204,10 +3771,10 @@ function validate49(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3204
3771
|
}
|
|
3205
3772
|
errors++;
|
|
3206
3773
|
}
|
|
3207
|
-
|
|
3774
|
+
validate54.errors = vErrors;
|
|
3208
3775
|
return errors === 0;
|
|
3209
3776
|
}
|
|
3210
|
-
function
|
|
3777
|
+
function validate56(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3211
3778
|
let vErrors = null;
|
|
3212
3779
|
let errors = 0;
|
|
3213
3780
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3317,10 +3884,10 @@ function validate51(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3317
3884
|
}
|
|
3318
3885
|
errors++;
|
|
3319
3886
|
}
|
|
3320
|
-
|
|
3887
|
+
validate56.errors = vErrors;
|
|
3321
3888
|
return errors === 0;
|
|
3322
3889
|
}
|
|
3323
|
-
function
|
|
3890
|
+
function validate58(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3324
3891
|
let vErrors = null;
|
|
3325
3892
|
let errors = 0;
|
|
3326
3893
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3400,7 +3967,7 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3400
3967
|
if (data.color !== void 0) {
|
|
3401
3968
|
let data2 = data.color;
|
|
3402
3969
|
if (!(data2 === "blue" || data2 === "amber" || data2 === "green" || data2 === "violet" || data2 === "rose" || data2 === "slate" || data2 === "coin")) {
|
|
3403
|
-
const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues:
|
|
3970
|
+
const err7 = { instancePath: instancePath + "/color", schemaPath: "#/definitions/color/enum", keyword: "enum", params: { allowedValues: schema57.enum }, message: "must be equal to one of the allowed values" };
|
|
3404
3971
|
if (vErrors === null) {
|
|
3405
3972
|
vErrors = [err7];
|
|
3406
3973
|
} else {
|
|
@@ -3455,10 +4022,10 @@ function validate53(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3455
4022
|
}
|
|
3456
4023
|
errors++;
|
|
3457
4024
|
}
|
|
3458
|
-
|
|
4025
|
+
validate58.errors = vErrors;
|
|
3459
4026
|
return errors === 0;
|
|
3460
4027
|
}
|
|
3461
|
-
function
|
|
4028
|
+
function validate60(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3462
4029
|
let vErrors = null;
|
|
3463
4030
|
let errors = 0;
|
|
3464
4031
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3545,10 +4112,10 @@ function validate55(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3545
4112
|
}
|
|
3546
4113
|
errors++;
|
|
3547
4114
|
}
|
|
3548
|
-
|
|
4115
|
+
validate60.errors = vErrors;
|
|
3549
4116
|
return errors === 0;
|
|
3550
4117
|
}
|
|
3551
|
-
function
|
|
4118
|
+
function validate62(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3552
4119
|
let vErrors = null;
|
|
3553
4120
|
let errors = 0;
|
|
3554
4121
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3636,10 +4203,10 @@ function validate57(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3636
4203
|
}
|
|
3637
4204
|
errors++;
|
|
3638
4205
|
}
|
|
3639
|
-
|
|
4206
|
+
validate62.errors = vErrors;
|
|
3640
4207
|
return errors === 0;
|
|
3641
4208
|
}
|
|
3642
|
-
function
|
|
4209
|
+
function validate53(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
3643
4210
|
let vErrors = null;
|
|
3644
4211
|
let errors = 0;
|
|
3645
4212
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
@@ -3673,14 +4240,14 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3673
4240
|
}
|
|
3674
4241
|
}
|
|
3675
4242
|
if (data.scale !== void 0) {
|
|
3676
|
-
if (!
|
|
3677
|
-
vErrors = vErrors === null ?
|
|
4243
|
+
if (!validate54(data.scale, { instancePath: instancePath + "/scale", parentData: data, parentDataProperty: "scale", rootData })) {
|
|
4244
|
+
vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);
|
|
3678
4245
|
errors = vErrors.length;
|
|
3679
4246
|
}
|
|
3680
4247
|
}
|
|
3681
4248
|
if (data.period !== void 0) {
|
|
3682
|
-
if (!
|
|
3683
|
-
vErrors = vErrors === null ?
|
|
4249
|
+
if (!validate56(data.period, { instancePath: instancePath + "/period", parentData: data, parentDataProperty: "period", rootData })) {
|
|
4250
|
+
vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);
|
|
3684
4251
|
errors = vErrors.length;
|
|
3685
4252
|
}
|
|
3686
4253
|
}
|
|
@@ -3698,8 +4265,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3698
4265
|
}
|
|
3699
4266
|
const len0 = data2.length;
|
|
3700
4267
|
for (let i0 = 0; i0 < len0; i0++) {
|
|
3701
|
-
if (!
|
|
3702
|
-
vErrors = vErrors === null ?
|
|
4268
|
+
if (!validate58(data2[i0], { instancePath: instancePath + "/rows/" + i0, parentData: data2, parentDataProperty: i0, rootData })) {
|
|
4269
|
+
vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);
|
|
3703
4270
|
errors = vErrors.length;
|
|
3704
4271
|
}
|
|
3705
4272
|
}
|
|
@@ -3718,8 +4285,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3718
4285
|
if (Array.isArray(data4)) {
|
|
3719
4286
|
const len1 = data4.length;
|
|
3720
4287
|
for (let i1 = 0; i1 < len1; i1++) {
|
|
3721
|
-
if (!
|
|
3722
|
-
vErrors = vErrors === null ?
|
|
4288
|
+
if (!validate60(data4[i1], { instancePath: instancePath + "/points/" + i1, parentData: data4, parentDataProperty: i1, rootData })) {
|
|
4289
|
+
vErrors = vErrors === null ? validate60.errors : vErrors.concat(validate60.errors);
|
|
3723
4290
|
errors = vErrors.length;
|
|
3724
4291
|
}
|
|
3725
4292
|
}
|
|
@@ -3734,8 +4301,8 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3734
4301
|
}
|
|
3735
4302
|
}
|
|
3736
4303
|
if (data.zoom !== void 0) {
|
|
3737
|
-
if (!
|
|
3738
|
-
vErrors = vErrors === null ?
|
|
4304
|
+
if (!validate62(data.zoom, { instancePath: instancePath + "/zoom", parentData: data, parentDataProperty: "zoom", rootData })) {
|
|
4305
|
+
vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);
|
|
3739
4306
|
errors = vErrors.length;
|
|
3740
4307
|
}
|
|
3741
4308
|
}
|
|
@@ -3748,7 +4315,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
3748
4315
|
}
|
|
3749
4316
|
errors++;
|
|
3750
4317
|
}
|
|
3751
|
-
|
|
4318
|
+
validate53.errors = vErrors;
|
|
3752
4319
|
return errors === 0;
|
|
3753
4320
|
}
|
|
3754
4321
|
var func2 = Object.prototype.hasOwnProperty;
|
|
@@ -4132,84 +4699,35 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4132
4699
|
errors++;
|
|
4133
4700
|
}
|
|
4134
4701
|
if (data.steps !== void 0) {
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
for (let i1 = 0; i1 < len1; i1++) {
|
|
4139
|
-
let data23 = data22[i1];
|
|
4140
|
-
if (data23 && typeof data23 == "object" && !Array.isArray(data23)) {
|
|
4141
|
-
if (data23.events !== void 0) {
|
|
4142
|
-
let data24 = data23.events;
|
|
4143
|
-
if (Array.isArray(data24)) {
|
|
4144
|
-
const len2 = data24.length;
|
|
4145
|
-
for (let i2 = 0; i2 < len2; i2++) {
|
|
4146
|
-
let data25 = data24[i2];
|
|
4147
|
-
if (data25 && typeof data25 == "object" && !Array.isArray(data25)) {
|
|
4148
|
-
if (data25.type !== void 0) {
|
|
4149
|
-
let data26 = data25.type;
|
|
4150
|
-
const _errs62 = errors;
|
|
4151
|
-
const _errs63 = errors;
|
|
4152
|
-
if (!(data26 === "commit" || data26 === "branch")) {
|
|
4153
|
-
const err23 = {};
|
|
4154
|
-
if (vErrors === null) {
|
|
4155
|
-
vErrors = [err23];
|
|
4156
|
-
} else {
|
|
4157
|
-
vErrors.push(err23);
|
|
4158
|
-
}
|
|
4159
|
-
errors++;
|
|
4160
|
-
}
|
|
4161
|
-
var valid31 = _errs63 === errors;
|
|
4162
|
-
if (valid31) {
|
|
4163
|
-
const err24 = { instancePath: instancePath + "/steps/" + i1 + "/events/" + i2 + "/type", schemaPath: "#/definitions/timeSteps/items/properties/events/items/properties/type/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4164
|
-
if (vErrors === null) {
|
|
4165
|
-
vErrors = [err24];
|
|
4166
|
-
} else {
|
|
4167
|
-
vErrors.push(err24);
|
|
4168
|
-
}
|
|
4169
|
-
errors++;
|
|
4170
|
-
} else {
|
|
4171
|
-
errors = _errs62;
|
|
4172
|
-
if (vErrors !== null) {
|
|
4173
|
-
if (_errs62) {
|
|
4174
|
-
vErrors.length = _errs62;
|
|
4175
|
-
} else {
|
|
4176
|
-
vErrors = null;
|
|
4177
|
-
}
|
|
4178
|
-
}
|
|
4179
|
-
}
|
|
4180
|
-
}
|
|
4181
|
-
}
|
|
4182
|
-
}
|
|
4183
|
-
}
|
|
4184
|
-
}
|
|
4185
|
-
}
|
|
4186
|
-
}
|
|
4702
|
+
if (!validate20(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
4703
|
+
vErrors = vErrors === null ? validate20.errors : vErrors.concat(validate20.errors);
|
|
4704
|
+
errors = vErrors.length;
|
|
4187
4705
|
}
|
|
4188
4706
|
}
|
|
4189
4707
|
if (data.state !== void 0) {
|
|
4190
|
-
const
|
|
4708
|
+
const err23 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4191
4709
|
if (vErrors === null) {
|
|
4192
|
-
vErrors = [
|
|
4710
|
+
vErrors = [err23];
|
|
4193
4711
|
} else {
|
|
4194
|
-
vErrors.push(
|
|
4712
|
+
vErrors.push(err23);
|
|
4195
4713
|
}
|
|
4196
4714
|
errors++;
|
|
4197
4715
|
}
|
|
4198
4716
|
if (data.git !== void 0) {
|
|
4199
|
-
const
|
|
4717
|
+
const err24 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4200
4718
|
if (vErrors === null) {
|
|
4201
|
-
vErrors = [
|
|
4719
|
+
vErrors = [err24];
|
|
4202
4720
|
} else {
|
|
4203
|
-
vErrors.push(
|
|
4721
|
+
vErrors.push(err24);
|
|
4204
4722
|
}
|
|
4205
4723
|
errors++;
|
|
4206
4724
|
}
|
|
4207
4725
|
if (data.regions !== void 0) {
|
|
4208
|
-
const
|
|
4726
|
+
const err25 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4209
4727
|
if (vErrors === null) {
|
|
4210
|
-
vErrors = [
|
|
4728
|
+
vErrors = [err25];
|
|
4211
4729
|
} else {
|
|
4212
|
-
vErrors.push(
|
|
4730
|
+
vErrors.push(err25);
|
|
4213
4731
|
}
|
|
4214
4732
|
errors++;
|
|
4215
4733
|
}
|
|
@@ -4218,72 +4736,178 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4218
4736
|
valid21 = _valid3;
|
|
4219
4737
|
ifClause3 = "then";
|
|
4220
4738
|
} else {
|
|
4221
|
-
const
|
|
4739
|
+
const _errs66 = errors;
|
|
4740
|
+
const _errs67 = errors;
|
|
4741
|
+
let valid27 = true;
|
|
4742
|
+
const _errs68 = errors;
|
|
4222
4743
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4223
|
-
if (data.
|
|
4224
|
-
|
|
4225
|
-
if (
|
|
4226
|
-
|
|
4227
|
-
|
|
4744
|
+
if (data.kind === void 0 && ("kind")) {
|
|
4745
|
+
const err26 = {};
|
|
4746
|
+
if (vErrors === null) {
|
|
4747
|
+
vErrors = [err26];
|
|
4748
|
+
} else {
|
|
4749
|
+
vErrors.push(err26);
|
|
4750
|
+
}
|
|
4751
|
+
errors++;
|
|
4752
|
+
} else {
|
|
4753
|
+
if (data.kind !== void 0) {
|
|
4754
|
+
if ("tree" !== data.kind) {
|
|
4755
|
+
const err27 = {};
|
|
4228
4756
|
if (vErrors === null) {
|
|
4229
|
-
vErrors = [
|
|
4757
|
+
vErrors = [err27];
|
|
4230
4758
|
} else {
|
|
4231
|
-
vErrors.push(
|
|
4759
|
+
vErrors.push(err27);
|
|
4760
|
+
}
|
|
4761
|
+
errors++;
|
|
4762
|
+
}
|
|
4763
|
+
}
|
|
4764
|
+
}
|
|
4765
|
+
}
|
|
4766
|
+
var _valid4 = _errs68 === errors;
|
|
4767
|
+
errors = _errs67;
|
|
4768
|
+
if (vErrors !== null) {
|
|
4769
|
+
if (_errs67) {
|
|
4770
|
+
vErrors.length = _errs67;
|
|
4771
|
+
} else {
|
|
4772
|
+
vErrors = null;
|
|
4773
|
+
}
|
|
4774
|
+
}
|
|
4775
|
+
let ifClause4;
|
|
4776
|
+
if (_valid4) {
|
|
4777
|
+
const _errs70 = errors;
|
|
4778
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4779
|
+
if (data.steps !== void 0) {
|
|
4780
|
+
if (!validate22(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
4781
|
+
vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
|
|
4782
|
+
errors = vErrors.length;
|
|
4783
|
+
}
|
|
4784
|
+
}
|
|
4785
|
+
if (data.strip !== void 0) {
|
|
4786
|
+
if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
4787
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
4788
|
+
errors = vErrors.length;
|
|
4789
|
+
}
|
|
4790
|
+
}
|
|
4791
|
+
if (data.state !== void 0) {
|
|
4792
|
+
const err28 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4793
|
+
if (vErrors === null) {
|
|
4794
|
+
vErrors = [err28];
|
|
4795
|
+
} else {
|
|
4796
|
+
vErrors.push(err28);
|
|
4797
|
+
}
|
|
4798
|
+
errors++;
|
|
4799
|
+
}
|
|
4800
|
+
if (data.git !== void 0) {
|
|
4801
|
+
const err29 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4802
|
+
if (vErrors === null) {
|
|
4803
|
+
vErrors = [err29];
|
|
4804
|
+
} else {
|
|
4805
|
+
vErrors.push(err29);
|
|
4806
|
+
}
|
|
4807
|
+
errors++;
|
|
4808
|
+
}
|
|
4809
|
+
if (data.time !== void 0) {
|
|
4810
|
+
const err30 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4811
|
+
if (vErrors === null) {
|
|
4812
|
+
vErrors = [err30];
|
|
4813
|
+
} else {
|
|
4814
|
+
vErrors.push(err30);
|
|
4815
|
+
}
|
|
4816
|
+
errors++;
|
|
4817
|
+
}
|
|
4818
|
+
if (data.regions !== void 0) {
|
|
4819
|
+
const err31 = { instancePath: instancePath + "/regions", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4820
|
+
if (vErrors === null) {
|
|
4821
|
+
vErrors = [err31];
|
|
4822
|
+
} else {
|
|
4823
|
+
vErrors.push(err31);
|
|
4824
|
+
}
|
|
4825
|
+
errors++;
|
|
4826
|
+
}
|
|
4827
|
+
}
|
|
4828
|
+
var _valid4 = _errs70 === errors;
|
|
4829
|
+
valid27 = _valid4;
|
|
4830
|
+
ifClause4 = "then";
|
|
4831
|
+
} else {
|
|
4832
|
+
const _errs85 = errors;
|
|
4833
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4834
|
+
if (data.boxes !== void 0) {
|
|
4835
|
+
let data33 = data.boxes;
|
|
4836
|
+
if (Array.isArray(data33)) {
|
|
4837
|
+
if (data33.length < 1) {
|
|
4838
|
+
const err32 = { instancePath: instancePath + "/boxes", schemaPath: "#/else/else/else/else/else/properties/boxes/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
4839
|
+
if (vErrors === null) {
|
|
4840
|
+
vErrors = [err32];
|
|
4841
|
+
} else {
|
|
4842
|
+
vErrors.push(err32);
|
|
4843
|
+
}
|
|
4844
|
+
errors++;
|
|
4232
4845
|
}
|
|
4233
|
-
errors++;
|
|
4234
4846
|
}
|
|
4235
4847
|
}
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4848
|
+
if (data.steps !== void 0) {
|
|
4849
|
+
if (!validate11(data.steps, { instancePath: instancePath + "/steps", parentData: data, parentDataProperty: "steps", rootData })) {
|
|
4850
|
+
vErrors = vErrors === null ? validate11.errors : vErrors.concat(validate11.errors);
|
|
4851
|
+
errors = vErrors.length;
|
|
4852
|
+
}
|
|
4241
4853
|
}
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4854
|
+
if (data.strip !== void 0) {
|
|
4855
|
+
if (!validate13(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
4856
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
4857
|
+
errors = vErrors.length;
|
|
4858
|
+
}
|
|
4247
4859
|
}
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4860
|
+
if (data.state !== void 0) {
|
|
4861
|
+
const err33 = { instancePath: instancePath + "/state", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4862
|
+
if (vErrors === null) {
|
|
4863
|
+
vErrors = [err33];
|
|
4864
|
+
} else {
|
|
4865
|
+
vErrors.push(err33);
|
|
4866
|
+
}
|
|
4867
|
+
errors++;
|
|
4255
4868
|
}
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4869
|
+
if (data.git !== void 0) {
|
|
4870
|
+
const err34 = { instancePath: instancePath + "/git", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4871
|
+
if (vErrors === null) {
|
|
4872
|
+
vErrors = [err34];
|
|
4873
|
+
} else {
|
|
4874
|
+
vErrors.push(err34);
|
|
4875
|
+
}
|
|
4876
|
+
errors++;
|
|
4264
4877
|
}
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4878
|
+
if (data.time !== void 0) {
|
|
4879
|
+
const err35 = { instancePath: instancePath + "/time", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4880
|
+
if (vErrors === null) {
|
|
4881
|
+
vErrors = [err35];
|
|
4882
|
+
} else {
|
|
4883
|
+
vErrors.push(err35);
|
|
4884
|
+
}
|
|
4885
|
+
errors++;
|
|
4273
4886
|
}
|
|
4274
|
-
errors++;
|
|
4275
4887
|
}
|
|
4888
|
+
var _valid4 = _errs85 === errors;
|
|
4889
|
+
valid27 = _valid4;
|
|
4890
|
+
ifClause4 = "else";
|
|
4891
|
+
}
|
|
4892
|
+
if (!valid27) {
|
|
4893
|
+
const err36 = { instancePath, schemaPath: "#/else/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause4 }, message: 'must match "' + ifClause4 + '" schema' };
|
|
4894
|
+
if (vErrors === null) {
|
|
4895
|
+
vErrors = [err36];
|
|
4896
|
+
} else {
|
|
4897
|
+
vErrors.push(err36);
|
|
4898
|
+
}
|
|
4899
|
+
errors++;
|
|
4276
4900
|
}
|
|
4277
|
-
var _valid3 =
|
|
4901
|
+
var _valid3 = _errs66 === errors;
|
|
4278
4902
|
valid21 = _valid3;
|
|
4279
4903
|
ifClause3 = "else";
|
|
4280
4904
|
}
|
|
4281
4905
|
if (!valid21) {
|
|
4282
|
-
const
|
|
4906
|
+
const err37 = { instancePath, schemaPath: "#/else/else/else/if", keyword: "if", params: { failingKeyword: ifClause3 }, message: 'must match "' + ifClause3 + '" schema' };
|
|
4283
4907
|
if (vErrors === null) {
|
|
4284
|
-
vErrors = [
|
|
4908
|
+
vErrors = [err37];
|
|
4285
4909
|
} else {
|
|
4286
|
-
vErrors.push(
|
|
4910
|
+
vErrors.push(err37);
|
|
4287
4911
|
}
|
|
4288
4912
|
errors++;
|
|
4289
4913
|
}
|
|
@@ -4292,11 +4916,11 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4292
4916
|
ifClause2 = "else";
|
|
4293
4917
|
}
|
|
4294
4918
|
if (!valid15) {
|
|
4295
|
-
const
|
|
4919
|
+
const err38 = { instancePath, schemaPath: "#/else/else/if", keyword: "if", params: { failingKeyword: ifClause2 }, message: 'must match "' + ifClause2 + '" schema' };
|
|
4296
4920
|
if (vErrors === null) {
|
|
4297
|
-
vErrors = [
|
|
4921
|
+
vErrors = [err38];
|
|
4298
4922
|
} else {
|
|
4299
|
-
vErrors.push(
|
|
4923
|
+
vErrors.push(err38);
|
|
4300
4924
|
}
|
|
4301
4925
|
errors++;
|
|
4302
4926
|
}
|
|
@@ -4305,21 +4929,21 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4305
4929
|
ifClause1 = "else";
|
|
4306
4930
|
}
|
|
4307
4931
|
if (!valid6) {
|
|
4308
|
-
const
|
|
4932
|
+
const err39 = { instancePath, schemaPath: "#/else/if", keyword: "if", params: { failingKeyword: ifClause1 }, message: 'must match "' + ifClause1 + '" schema' };
|
|
4309
4933
|
if (vErrors === null) {
|
|
4310
|
-
vErrors = [
|
|
4934
|
+
vErrors = [err39];
|
|
4311
4935
|
} else {
|
|
4312
|
-
vErrors.push(
|
|
4936
|
+
vErrors.push(err39);
|
|
4313
4937
|
}
|
|
4314
4938
|
errors++;
|
|
4315
4939
|
}
|
|
4316
4940
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4317
4941
|
if (data.sequence !== void 0) {
|
|
4318
|
-
const
|
|
4942
|
+
const err40 = { instancePath: instancePath + "/sequence", schemaPath: "#/definitions/absent/not", keyword: "not", params: {}, message: "must NOT be valid" };
|
|
4319
4943
|
if (vErrors === null) {
|
|
4320
|
-
vErrors = [
|
|
4944
|
+
vErrors = [err40];
|
|
4321
4945
|
} else {
|
|
4322
|
-
vErrors.push(
|
|
4946
|
+
vErrors.push(err40);
|
|
4323
4947
|
}
|
|
4324
4948
|
errors++;
|
|
4325
4949
|
}
|
|
@@ -4329,245 +4953,245 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4329
4953
|
ifClause0 = "else";
|
|
4330
4954
|
}
|
|
4331
4955
|
if (!valid0) {
|
|
4332
|
-
const
|
|
4956
|
+
const err41 = { instancePath, schemaPath: "#/if", keyword: "if", params: { failingKeyword: ifClause0 }, message: 'must match "' + ifClause0 + '" schema' };
|
|
4333
4957
|
if (vErrors === null) {
|
|
4334
|
-
vErrors = [
|
|
4958
|
+
vErrors = [err41];
|
|
4335
4959
|
} else {
|
|
4336
|
-
vErrors.push(
|
|
4960
|
+
vErrors.push(err41);
|
|
4337
4961
|
}
|
|
4338
4962
|
errors++;
|
|
4339
4963
|
}
|
|
4340
4964
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
4341
4965
|
if (data.version === void 0) {
|
|
4342
|
-
const
|
|
4966
|
+
const err42 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "version" }, message: "must have required property 'version'" };
|
|
4343
4967
|
if (vErrors === null) {
|
|
4344
|
-
vErrors = [
|
|
4968
|
+
vErrors = [err42];
|
|
4345
4969
|
} else {
|
|
4346
|
-
vErrors.push(
|
|
4970
|
+
vErrors.push(err42);
|
|
4347
4971
|
}
|
|
4348
4972
|
errors++;
|
|
4349
4973
|
}
|
|
4350
4974
|
if (data.kind === void 0) {
|
|
4351
|
-
const
|
|
4975
|
+
const err43 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "kind" }, message: "must have required property 'kind'" };
|
|
4352
4976
|
if (vErrors === null) {
|
|
4353
|
-
vErrors = [
|
|
4977
|
+
vErrors = [err43];
|
|
4354
4978
|
} else {
|
|
4355
|
-
vErrors.push(
|
|
4979
|
+
vErrors.push(err43);
|
|
4356
4980
|
}
|
|
4357
4981
|
errors++;
|
|
4358
4982
|
}
|
|
4359
4983
|
if (data.title === void 0) {
|
|
4360
|
-
const
|
|
4984
|
+
const err44 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "title" }, message: "must have required property 'title'" };
|
|
4361
4985
|
if (vErrors === null) {
|
|
4362
|
-
vErrors = [
|
|
4986
|
+
vErrors = [err44];
|
|
4363
4987
|
} else {
|
|
4364
|
-
vErrors.push(
|
|
4988
|
+
vErrors.push(err44);
|
|
4365
4989
|
}
|
|
4366
4990
|
errors++;
|
|
4367
4991
|
}
|
|
4368
4992
|
if (data.boxes === void 0) {
|
|
4369
|
-
const
|
|
4993
|
+
const err45 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "boxes" }, message: "must have required property 'boxes'" };
|
|
4370
4994
|
if (vErrors === null) {
|
|
4371
|
-
vErrors = [
|
|
4995
|
+
vErrors = [err45];
|
|
4372
4996
|
} else {
|
|
4373
|
-
vErrors.push(
|
|
4997
|
+
vErrors.push(err45);
|
|
4374
4998
|
}
|
|
4375
4999
|
errors++;
|
|
4376
5000
|
}
|
|
4377
5001
|
if (data.steps === void 0) {
|
|
4378
|
-
const
|
|
5002
|
+
const err46 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "steps" }, message: "must have required property 'steps'" };
|
|
4379
5003
|
if (vErrors === null) {
|
|
4380
|
-
vErrors = [
|
|
5004
|
+
vErrors = [err46];
|
|
4381
5005
|
} else {
|
|
4382
|
-
vErrors.push(
|
|
5006
|
+
vErrors.push(err46);
|
|
4383
5007
|
}
|
|
4384
5008
|
errors++;
|
|
4385
5009
|
}
|
|
4386
5010
|
for (const key0 in data) {
|
|
4387
5011
|
if (!func2.call(schema11.properties, key0)) {
|
|
4388
|
-
const
|
|
5012
|
+
const err47 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
4389
5013
|
if (vErrors === null) {
|
|
4390
|
-
vErrors = [
|
|
5014
|
+
vErrors = [err47];
|
|
4391
5015
|
} else {
|
|
4392
|
-
vErrors.push(
|
|
5016
|
+
vErrors.push(err47);
|
|
4393
5017
|
}
|
|
4394
5018
|
errors++;
|
|
4395
5019
|
}
|
|
4396
5020
|
}
|
|
4397
5021
|
if (data.version !== void 0) {
|
|
4398
|
-
let
|
|
4399
|
-
if (!(typeof
|
|
4400
|
-
const
|
|
5022
|
+
let data40 = data.version;
|
|
5023
|
+
if (!(typeof data40 == "number" && (!(data40 % 1) && !isNaN(data40)) && isFinite(data40))) {
|
|
5024
|
+
const err48 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
|
|
4401
5025
|
if (vErrors === null) {
|
|
4402
|
-
vErrors = [
|
|
5026
|
+
vErrors = [err48];
|
|
4403
5027
|
} else {
|
|
4404
|
-
vErrors.push(
|
|
5028
|
+
vErrors.push(err48);
|
|
4405
5029
|
}
|
|
4406
5030
|
errors++;
|
|
4407
5031
|
}
|
|
4408
|
-
if (typeof
|
|
4409
|
-
if (
|
|
4410
|
-
const
|
|
5032
|
+
if (typeof data40 == "number" && isFinite(data40)) {
|
|
5033
|
+
if (data40 < 1 || isNaN(data40)) {
|
|
5034
|
+
const err49 = { instancePath: instancePath + "/version", schemaPath: "#/properties/version/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
|
|
4411
5035
|
if (vErrors === null) {
|
|
4412
|
-
vErrors = [
|
|
5036
|
+
vErrors = [err49];
|
|
4413
5037
|
} else {
|
|
4414
|
-
vErrors.push(
|
|
5038
|
+
vErrors.push(err49);
|
|
4415
5039
|
}
|
|
4416
5040
|
errors++;
|
|
4417
5041
|
}
|
|
4418
5042
|
}
|
|
4419
5043
|
}
|
|
4420
5044
|
if (data.kind !== void 0) {
|
|
4421
|
-
let
|
|
4422
|
-
if (!(
|
|
4423
|
-
const
|
|
5045
|
+
let data41 = data.kind;
|
|
5046
|
+
if (!(data41 === "sequence" || data41 === "architecture" || data41 === "state" || data41 === "git" || data41 === "time" || data41 === "tree")) {
|
|
5047
|
+
const err50 = { instancePath: instancePath + "/kind", schemaPath: "#/properties/kind/enum", keyword: "enum", params: { allowedValues: schema11.properties.kind.enum }, message: "must be equal to one of the allowed values" };
|
|
4424
5048
|
if (vErrors === null) {
|
|
4425
|
-
vErrors = [
|
|
5049
|
+
vErrors = [err50];
|
|
4426
5050
|
} else {
|
|
4427
|
-
vErrors.push(
|
|
5051
|
+
vErrors.push(err50);
|
|
4428
5052
|
}
|
|
4429
5053
|
errors++;
|
|
4430
5054
|
}
|
|
4431
5055
|
}
|
|
4432
5056
|
if (data.title !== void 0) {
|
|
4433
|
-
let
|
|
4434
|
-
if (typeof
|
|
4435
|
-
if (func3(
|
|
4436
|
-
const
|
|
5057
|
+
let data42 = data.title;
|
|
5058
|
+
if (typeof data42 === "string") {
|
|
5059
|
+
if (func3(data42) < 1) {
|
|
5060
|
+
const err51 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
4437
5061
|
if (vErrors === null) {
|
|
4438
|
-
vErrors = [
|
|
5062
|
+
vErrors = [err51];
|
|
4439
5063
|
} else {
|
|
4440
|
-
vErrors.push(
|
|
5064
|
+
vErrors.push(err51);
|
|
4441
5065
|
}
|
|
4442
5066
|
errors++;
|
|
4443
5067
|
}
|
|
4444
5068
|
} else {
|
|
4445
|
-
const
|
|
5069
|
+
const err52 = { instancePath: instancePath + "/title", schemaPath: "#/definitions/text/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
4446
5070
|
if (vErrors === null) {
|
|
4447
|
-
vErrors = [
|
|
5071
|
+
vErrors = [err52];
|
|
4448
5072
|
} else {
|
|
4449
|
-
vErrors.push(
|
|
5073
|
+
vErrors.push(err52);
|
|
4450
5074
|
}
|
|
4451
5075
|
errors++;
|
|
4452
5076
|
}
|
|
4453
5077
|
}
|
|
4454
5078
|
if (data.view !== void 0) {
|
|
4455
|
-
let
|
|
4456
|
-
if (!(
|
|
4457
|
-
const
|
|
5079
|
+
let data43 = data.view;
|
|
5080
|
+
if (!(data43 === "fixed" || data43 === "follow")) {
|
|
5081
|
+
const err53 = { instancePath: instancePath + "/view", schemaPath: "#/properties/view/enum", keyword: "enum", params: { allowedValues: schema11.properties.view.enum }, message: "must be equal to one of the allowed values" };
|
|
4458
5082
|
if (vErrors === null) {
|
|
4459
|
-
vErrors = [
|
|
5083
|
+
vErrors = [err53];
|
|
4460
5084
|
} else {
|
|
4461
|
-
vErrors.push(
|
|
5085
|
+
vErrors.push(err53);
|
|
4462
5086
|
}
|
|
4463
5087
|
errors++;
|
|
4464
5088
|
}
|
|
4465
5089
|
}
|
|
4466
5090
|
if (data.regions !== void 0) {
|
|
4467
|
-
let
|
|
4468
|
-
if (Array.isArray(
|
|
4469
|
-
const
|
|
4470
|
-
for (let
|
|
4471
|
-
if (!
|
|
4472
|
-
vErrors = vErrors === null ?
|
|
5091
|
+
let data44 = data.regions;
|
|
5092
|
+
if (Array.isArray(data44)) {
|
|
5093
|
+
const len1 = data44.length;
|
|
5094
|
+
for (let i1 = 0; i1 < len1; i1++) {
|
|
5095
|
+
if (!validate27(data44[i1], { instancePath: instancePath + "/regions/" + i1, parentData: data44, parentDataProperty: i1, rootData })) {
|
|
5096
|
+
vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
|
|
4473
5097
|
errors = vErrors.length;
|
|
4474
5098
|
}
|
|
4475
5099
|
}
|
|
4476
5100
|
} else {
|
|
4477
|
-
const
|
|
5101
|
+
const err54 = { instancePath: instancePath + "/regions", schemaPath: "#/properties/regions/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
4478
5102
|
if (vErrors === null) {
|
|
4479
|
-
vErrors = [
|
|
5103
|
+
vErrors = [err54];
|
|
4480
5104
|
} else {
|
|
4481
|
-
vErrors.push(
|
|
5105
|
+
vErrors.push(err54);
|
|
4482
5106
|
}
|
|
4483
5107
|
errors++;
|
|
4484
5108
|
}
|
|
4485
5109
|
}
|
|
4486
5110
|
if (data.boxes !== void 0) {
|
|
4487
|
-
let
|
|
4488
|
-
if (Array.isArray(
|
|
4489
|
-
const
|
|
4490
|
-
for (let
|
|
4491
|
-
if (!
|
|
4492
|
-
vErrors = vErrors === null ?
|
|
5111
|
+
let data46 = data.boxes;
|
|
5112
|
+
if (Array.isArray(data46)) {
|
|
5113
|
+
const len2 = data46.length;
|
|
5114
|
+
for (let i2 = 0; i2 < len2; i2++) {
|
|
5115
|
+
if (!validate29(data46[i2], { instancePath: instancePath + "/boxes/" + i2, parentData: data46, parentDataProperty: i2, rootData })) {
|
|
5116
|
+
vErrors = vErrors === null ? validate29.errors : vErrors.concat(validate29.errors);
|
|
4493
5117
|
errors = vErrors.length;
|
|
4494
5118
|
}
|
|
4495
5119
|
}
|
|
4496
5120
|
} else {
|
|
4497
|
-
const
|
|
5121
|
+
const err55 = { instancePath: instancePath + "/boxes", schemaPath: "#/properties/boxes/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
4498
5122
|
if (vErrors === null) {
|
|
4499
|
-
vErrors = [
|
|
5123
|
+
vErrors = [err55];
|
|
4500
5124
|
} else {
|
|
4501
|
-
vErrors.push(
|
|
5125
|
+
vErrors.push(err55);
|
|
4502
5126
|
}
|
|
4503
5127
|
errors++;
|
|
4504
5128
|
}
|
|
4505
5129
|
}
|
|
4506
5130
|
if (data.strip !== void 0) {
|
|
4507
|
-
if (!
|
|
4508
|
-
vErrors = vErrors === null ?
|
|
5131
|
+
if (!validate31(data.strip, { instancePath: instancePath + "/strip", parentData: data, parentDataProperty: "strip", rootData })) {
|
|
5132
|
+
vErrors = vErrors === null ? validate31.errors : vErrors.concat(validate31.errors);
|
|
4509
5133
|
errors = vErrors.length;
|
|
4510
5134
|
}
|
|
4511
5135
|
}
|
|
4512
5136
|
if (data.steps !== void 0) {
|
|
4513
|
-
let
|
|
4514
|
-
if (Array.isArray(
|
|
4515
|
-
if (
|
|
4516
|
-
const
|
|
5137
|
+
let data49 = data.steps;
|
|
5138
|
+
if (Array.isArray(data49)) {
|
|
5139
|
+
if (data49.length < 1) {
|
|
5140
|
+
const err56 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" };
|
|
4517
5141
|
if (vErrors === null) {
|
|
4518
|
-
vErrors = [
|
|
5142
|
+
vErrors = [err56];
|
|
4519
5143
|
} else {
|
|
4520
|
-
vErrors.push(
|
|
5144
|
+
vErrors.push(err56);
|
|
4521
5145
|
}
|
|
4522
5146
|
errors++;
|
|
4523
5147
|
}
|
|
4524
|
-
const
|
|
4525
|
-
for (let
|
|
4526
|
-
if (!
|
|
4527
|
-
vErrors = vErrors === null ?
|
|
5148
|
+
const len3 = data49.length;
|
|
5149
|
+
for (let i3 = 0; i3 < len3; i3++) {
|
|
5150
|
+
if (!validate35(data49[i3], { instancePath: instancePath + "/steps/" + i3, parentData: data49, parentDataProperty: i3, rootData })) {
|
|
5151
|
+
vErrors = vErrors === null ? validate35.errors : vErrors.concat(validate35.errors);
|
|
4528
5152
|
errors = vErrors.length;
|
|
4529
5153
|
}
|
|
4530
5154
|
}
|
|
4531
5155
|
} else {
|
|
4532
|
-
const
|
|
5156
|
+
const err57 = { instancePath: instancePath + "/steps", schemaPath: "#/properties/steps/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
4533
5157
|
if (vErrors === null) {
|
|
4534
|
-
vErrors = [
|
|
5158
|
+
vErrors = [err57];
|
|
4535
5159
|
} else {
|
|
4536
|
-
vErrors.push(
|
|
5160
|
+
vErrors.push(err57);
|
|
4537
5161
|
}
|
|
4538
5162
|
errors++;
|
|
4539
5163
|
}
|
|
4540
5164
|
}
|
|
4541
5165
|
if (data.sequence !== void 0) {
|
|
4542
|
-
if (!
|
|
4543
|
-
vErrors = vErrors === null ?
|
|
5166
|
+
if (!validate43(data.sequence, { instancePath: instancePath + "/sequence", parentData: data, parentDataProperty: "sequence", rootData })) {
|
|
5167
|
+
vErrors = vErrors === null ? validate43.errors : vErrors.concat(validate43.errors);
|
|
4544
5168
|
errors = vErrors.length;
|
|
4545
5169
|
}
|
|
4546
5170
|
}
|
|
4547
5171
|
if (data.state !== void 0) {
|
|
4548
|
-
if (!
|
|
4549
|
-
vErrors = vErrors === null ?
|
|
5172
|
+
if (!validate45(data.state, { instancePath: instancePath + "/state", parentData: data, parentDataProperty: "state", rootData })) {
|
|
5173
|
+
vErrors = vErrors === null ? validate45.errors : vErrors.concat(validate45.errors);
|
|
4550
5174
|
errors = vErrors.length;
|
|
4551
5175
|
}
|
|
4552
5176
|
}
|
|
4553
5177
|
if (data.git !== void 0) {
|
|
4554
|
-
if (!
|
|
4555
|
-
vErrors = vErrors === null ?
|
|
5178
|
+
if (!validate49(data.git, { instancePath: instancePath + "/git", parentData: data, parentDataProperty: "git", rootData })) {
|
|
5179
|
+
vErrors = vErrors === null ? validate49.errors : vErrors.concat(validate49.errors);
|
|
4556
5180
|
errors = vErrors.length;
|
|
4557
5181
|
}
|
|
4558
5182
|
}
|
|
4559
5183
|
if (data.time !== void 0) {
|
|
4560
|
-
if (!
|
|
4561
|
-
vErrors = vErrors === null ?
|
|
5184
|
+
if (!validate53(data.time, { instancePath: instancePath + "/time", parentData: data, parentDataProperty: "time", rootData })) {
|
|
5185
|
+
vErrors = vErrors === null ? validate53.errors : vErrors.concat(validate53.errors);
|
|
4562
5186
|
errors = vErrors.length;
|
|
4563
5187
|
}
|
|
4564
5188
|
}
|
|
4565
5189
|
} else {
|
|
4566
|
-
const
|
|
5190
|
+
const err58 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
4567
5191
|
if (vErrors === null) {
|
|
4568
|
-
vErrors = [
|
|
5192
|
+
vErrors = [err58];
|
|
4569
5193
|
} else {
|
|
4570
|
-
vErrors.push(
|
|
5194
|
+
vErrors.push(err58);
|
|
4571
5195
|
}
|
|
4572
5196
|
errors++;
|
|
4573
5197
|
}
|
|
@@ -4577,11 +5201,12 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
4577
5201
|
|
|
4578
5202
|
// src/words.ts
|
|
4579
5203
|
var keys = (table) => Object.keys(table);
|
|
4580
|
-
var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true });
|
|
5204
|
+
var KINDS = keys({ sequence: true, architecture: true, state: true, git: true, time: true, tree: true });
|
|
4581
5205
|
var STATE_ENDS = ["start", "finish"];
|
|
4582
5206
|
var TIME_HEADS = ["scale", "period", "row", "point", "zoom", "mark", "span"];
|
|
4583
5207
|
var NOW = "now";
|
|
4584
|
-
var
|
|
5208
|
+
var TREE_HEADS = ["leaf", "node"];
|
|
5209
|
+
var HEADS = ["group", "end", "box", "strip", "step", "say", "code", "source", "act", "note", "set", "branch", "commit", ...TIME_HEADS, ...TREE_HEADS];
|
|
4585
5210
|
var AS = "as";
|
|
4586
5211
|
var ON = "on";
|
|
4587
5212
|
var COPY = "copy";
|
|
@@ -4589,6 +5214,7 @@ var MERGE = "merge";
|
|
|
4589
5214
|
var FROM = "from";
|
|
4590
5215
|
var HEAD = "HEAD";
|
|
4591
5216
|
var AT = "at";
|
|
5217
|
+
var OF = "of";
|
|
4592
5218
|
var ATTRS = {
|
|
4593
5219
|
diagram: ["view"],
|
|
4594
5220
|
group: ["note", "color", "icon"],
|
|
@@ -4600,6 +5226,8 @@ var ATTRS = {
|
|
|
4600
5226
|
strip: ["meter"],
|
|
4601
5227
|
branch: ["note"],
|
|
4602
5228
|
commit: ["hash", "note"],
|
|
5229
|
+
leaf: ["hash"],
|
|
5230
|
+
node: ["hash"],
|
|
4603
5231
|
scale: ["from"],
|
|
4604
5232
|
period: ["from"],
|
|
4605
5233
|
row: ["color", "empty"],
|
|
@@ -4623,7 +5251,7 @@ var OLD_HEADS = {
|
|
|
4623
5251
|
|
|
4624
5252
|
// src/schema.ts
|
|
4625
5253
|
var COLORS = ["blue", "amber", "green", "violet", "rose", "slate", "coin"];
|
|
4626
|
-
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span"];
|
|
5254
|
+
var EVENT_TYPES = ["edge", "action", "swap", "strip", "commit", "branch", "now", "mark", "span", "leaf", "node"];
|
|
4627
5255
|
var ABSENT = "#/definitions/absent/not";
|
|
4628
5256
|
var ABSENT_KINDS = { regions: "sequence / architecture / state", at: "time", into: "time", color: "time", meters: "time" };
|
|
4629
5257
|
var NOT_ALLOWED = {
|
|
@@ -4634,6 +5262,8 @@ var GIT_EVENT = /\/events\/items\/properties\/type\/not$/u;
|
|
|
4634
5262
|
var GIT_EVENTS = ["commit", "branch"];
|
|
4635
5263
|
var TIME_EVENT = /\/events\/items\/not$/u;
|
|
4636
5264
|
var TIME_EVENTS = ["now", "mark", "span"];
|
|
5265
|
+
var TREE_EVENT = /\/events\/items\/allOf\/0\/not$/u;
|
|
5266
|
+
var TREE_EVENTS = ["leaf", "node"];
|
|
4637
5267
|
var DURATION = /^\^\[0-9\]\+\(\\\.\[0-9\]\+\)\?\(([a-z|]+)\)\$$/u;
|
|
4638
5268
|
var RATIO = /%\)\$$/u;
|
|
4639
5269
|
var escape = (key2) => key2.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
@@ -4664,6 +5294,7 @@ function toFieldError(error, errors, m) {
|
|
|
4664
5294
|
if (RESERVED_ID.test(error.schemaPath)) return { pointer: at, message: m.reserved(STATE_ENDS) };
|
|
4665
5295
|
if (GIT_EVENT.test(error.schemaPath)) return { pointer: at, message: m.kindOnly(GIT_EVENTS, "git") };
|
|
4666
5296
|
if (TIME_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TIME_EVENTS, "time") };
|
|
5297
|
+
if (TREE_EVENT.test(error.schemaPath)) return { pointer: `${at}/type`, message: m.kindOnly(TREE_EVENTS, "tree") };
|
|
4667
5298
|
const last = at.slice(at.lastIndexOf("/") + 1);
|
|
4668
5299
|
if (error.schemaPath === ABSENT) return { pointer: at, message: m.not({ field: last, kind: ABSENT_KINDS[last] ?? last }) };
|
|
4669
5300
|
const allowed = NOT_ALLOWED[last];
|
|
@@ -4752,7 +5383,7 @@ var ja2 = () => {
|
|
|
4752
5383
|
emptyCode: "code \u306E\u5F8C\u308D\u306B\u547D\u4EE4\u3092\u66F8\u304F",
|
|
4753
5384
|
sourceShape: "source \u306F source <\u540D\u524D> [url: <URL>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
4754
5385
|
declarationInStep: "group \u3068 box \u3068 strip \u3068 branch \u3068\u3001scale \u3068 period \u3068 row \u3068 point \u3068 zoom \u306F\u6700\u521D\u306E step \u3088\u308A\u524D\u306B\u66F8\u304F",
|
|
4755
|
-
stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
|
|
5386
|
+
stepLineBeforeStep: "\u7DDA\u3068 say \u3068 code \u3068 source \u3068 act \u3068 note \u3068 set \u3068 commit \u3068\u679D\u3092\u5207\u308B\u884C\u3068\u3001now \u3068 mark \u3068 span \u3068\u3001leaf \u3068 node \u306E\u884C\u306F step \u306E\u4E0B\u306B\u66F8\u304F",
|
|
4756
5387
|
nestedGroup: "group \u306E\u4E2D\u306B group \u306F\u66F8\u3051\u306A\u3044\u3002\u5148\u306B end \u3067\u9589\u3058\u308B",
|
|
4757
5388
|
strayEnd: "end \u306E\u524D\u306B\u3001\u9589\u3058\u308B group \u304C\u7121\u3044",
|
|
4758
5389
|
endTakesNothing: "end \u306E\u5F8C\u308D\u306B\u306F\u4F55\u3082\u66F8\u304B\u306A\u3044",
|
|
@@ -4800,6 +5431,15 @@ var ja2 = () => {
|
|
|
4800
5431
|
headReserved: (name2) => `${name2} \u306F\u679D\u5206\u304B\u308C\u306E\u56F3\u3067\u4ECA\u3044\u308B\u5834\u6240\u306E\u672D\u306E\u540D\u524D\u3067\u3001\u540D\u672D\u306B\u4F7F\u3048\u306A\u3044`,
|
|
4801
5432
|
badHash: "hash \u306F 0 \u304B\u3089 9 \u3068 a \u304B\u3089 f \u306E\u5B57\u3067 4 \u304B\u3089 40 \u5B57\u306B\u3059\u308B",
|
|
4802
5433
|
timeOnly: (word) => `${word} \u306F time (\u6642\u9593\u8EF8\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
|
|
5434
|
+
treeOnly: (word) => `${word} \u306E\u884C\u306F tree (\u6728\u306E\u56F3) \u3067\u3060\u3051\u66F8\u3051\u308B`,
|
|
5435
|
+
treeNoGroup: "tree (\u6728\u306E\u56F3) \u306B\u306F group \u3092\u66F8\u3051\u306A\u3044\u3002\u6728\u306E\u7BB1\u306F leaf \u3068 node \u306E\u884C\u3067\u66F8\u304F",
|
|
5436
|
+
noLeaves: "leaf \u306E\u884C\u3067\u8449\u3092 1 \u3064\u4EE5\u4E0A\u66F8\u304F",
|
|
5437
|
+
leafShape: "leaf \u306F leaf <\u540D\u672D> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
5438
|
+
nodeShape: "node \u306F node <\u540D\u672D> of <\u5B50>, <\u5B50> [hash: <hash>] \u306E\u5F62\u3067\u66F8\u304F",
|
|
5439
|
+
noTreeChild: (id) => `${id} \u3068\u3044\u3046\u8449\u304B\u89AA\u306F\u307E\u3060\u66F8\u3044\u3066\u3044\u306A\u3044\u3002\u5B50\u306F\u524D\u306B leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
|
|
5440
|
+
notTreeBox: (id) => `${id} \u306F box \u306E\u884C\u3067\u7F6E\u3044\u305F\u7BB1\u3067\u3001\u6728\u306E\u7BB1\u3067\u306A\u3044\u3002\u5B50\u306F leaf \u304B node \u3067\u66F8\u3044\u305F\u540D\u672D\u306B\u3059\u308B`,
|
|
5441
|
+
twoParents: (id) => `${id} \u306F\u3082\u3046\u5225\u306E\u89AA\u306E\u5B50\u306B\u306A\u3063\u3066\u3044\u308B\u3002\u6728\u306E\u7BB1\u306E\u89AA\u306F 1 \u3064\u3060\u3051`,
|
|
5442
|
+
manyRoots: (id, root) => `${id} \u304C\u89AA\u3092\u6301\u305F\u306A\u3044\u307E\u307E\u6B8B\u308B\u3002\u6728\u306E\u6839\u306F 1 \u3064\u3060\u3051\u3067\u3001${id} \u3082 ${root} \u3082\u6700\u5F8C\u306B 1 \u3064\u306E\u6839\u3078\u7D44\u3080`,
|
|
4803
5443
|
timeTwice: (word) => `${word} \u306F 1 \u3064\u3060\u3051\u5BA3\u8A00\u3059\u308B`,
|
|
4804
5444
|
noScale: "scale \u306E\u884C\u3067\u76EE\u76DB\u308A\u3092\u5BA3\u8A00\u3059\u308B",
|
|
4805
5445
|
noRows: "row \u306E\u884C\u3067\u5370\u306E\u5217\u3092 1 \u3064\u4EE5\u4E0A\u5BA3\u8A00\u3059\u308B",
|
|
@@ -4865,7 +5505,7 @@ var en2 = () => {
|
|
|
4865
5505
|
emptyCode: "Write the command after code",
|
|
4866
5506
|
sourceShape: "Write a source as source <name> [url: <URL>]",
|
|
4867
5507
|
declarationInStep: "Write group, box, strip, branch, scale, period, row, point and zoom before the first step",
|
|
4868
|
-
stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark and
|
|
5508
|
+
stepLineBeforeStep: "Write lines, say, code, source, act, note, set, commit, branch cuts, now, mark, span, leaf and node under a step",
|
|
4869
5509
|
nestedGroup: "A group cannot hold another group. Close it with end first",
|
|
4870
5510
|
strayEnd: "There is no group for this end to close",
|
|
4871
5511
|
endTakesNothing: "Write nothing after end",
|
|
@@ -4913,6 +5553,15 @@ var en2 = () => {
|
|
|
4913
5553
|
headReserved: (name2) => `${name2} names where you are in a git diagram and cannot be an id`,
|
|
4914
5554
|
badHash: "Write a hash as 4 to 40 characters of 0-9 and a-f",
|
|
4915
5555
|
timeOnly: (word) => `${word} can be written only in time diagrams`,
|
|
5556
|
+
treeOnly: (word) => `${word} lines can be written only in tree diagrams`,
|
|
5557
|
+
treeNoGroup: "A tree diagram takes no group. Write the tree boxes with leaf and node lines",
|
|
5558
|
+
noLeaves: "Write at least one leaf with a leaf line",
|
|
5559
|
+
leafShape: "Write a leaf as leaf <id> [hash: <hash>]",
|
|
5560
|
+
nodeShape: "Write a node as node <id> of <child>, <child> [hash: <hash>]",
|
|
5561
|
+
noTreeChild: (id) => `No leaf or node named ${id} has been written yet. A child must be an id written earlier with leaf or node`,
|
|
5562
|
+
notTreeBox: (id) => `${id} is a box from a box line, not a tree box. A child must be an id written with leaf or node`,
|
|
5563
|
+
twoParents: (id) => `${id} is already a child of another node. A tree box has only one parent`,
|
|
5564
|
+
manyRoots: (id, root) => `${id} is left without a parent. A tree has one root, so join ${id} and ${root} under one root by the end`,
|
|
4916
5565
|
timeTwice: (word) => `Declare only one ${word}`,
|
|
4917
5566
|
noScale: "Declare the scale with a scale line",
|
|
4918
5567
|
noRows: "Declare at least one row with a row line",
|
|
@@ -4992,6 +5641,8 @@ var ID = /^[^\s[\]「」=:]+$/u;
|
|
|
4992
5641
|
var EDGE = /^([^\s:[\]]+?)\s*->\s*([^\s:[\]]+)/du;
|
|
4993
5642
|
var COMMIT = new RegExp(`^commit\\s+([^\\s[]+)(?:\\s+${ON}\\s+([^\\s[]+))?(?:\\s+${COPY}\\s+([^\\s[]+))?(?:\\s+${MERGE}\\s+([^\\s[]+))?`, "du");
|
|
4994
5643
|
var CUT = new RegExp(`^([^\\s[]+)\\s+${FROM}(?:\\s+([^\\s[]+))?\\s*$`, "du");
|
|
5644
|
+
var LEAF = /^leaf\s+([^\s[]+)/du;
|
|
5645
|
+
var NODE = new RegExp(`^node\\s+([^\\s[]+)\\s+${OF}\\s+`, "du");
|
|
4995
5646
|
var HASH = /^[0-9a-f]{4,40}$/u;
|
|
4996
5647
|
var URL_FORM = /^(\/|https?:\/\/)/u;
|
|
4997
5648
|
var SCALE = /^scale\s+(\S+)\s+(\S+)\s+([^\s[]+)/du;
|
|
@@ -5157,6 +5808,9 @@ function parseLines(lines, m) {
|
|
|
5157
5808
|
const isState = kind === "state";
|
|
5158
5809
|
const isGit = kind === "git";
|
|
5159
5810
|
const isTime = kind === "time";
|
|
5811
|
+
const isTree = kind === "tree";
|
|
5812
|
+
const trees = /* @__PURE__ */ new Map();
|
|
5813
|
+
const parents = /* @__PURE__ */ new Map();
|
|
5160
5814
|
let scale;
|
|
5161
5815
|
let period;
|
|
5162
5816
|
const rows = [];
|
|
@@ -5204,6 +5858,7 @@ function parseLines(lines, m) {
|
|
|
5204
5858
|
if (!boxes.some((box) => box.id === id) && !points.some((point) => point.id === id)) throw fail(source, at, m.undeclaredNote(id));
|
|
5205
5859
|
return id;
|
|
5206
5860
|
}
|
|
5861
|
+
if (isTree && trees.has(id)) return id;
|
|
5207
5862
|
if (!isState || !isOneOf(STATE_ENDS, id)) return boxAt(source, id, at);
|
|
5208
5863
|
if (id === "start" !== (side2 === "from")) throw fail(source, at, id === "start" ? m.intoStart : m.outOfFinish);
|
|
5209
5864
|
return id;
|
|
@@ -5254,6 +5909,7 @@ function parseLines(lines, m) {
|
|
|
5254
5909
|
}
|
|
5255
5910
|
if (!isGit && (word === "branch" || word === "commit")) throw fail(source, 0, m.gitOnly(word));
|
|
5256
5911
|
if (!isTime && isOneOf(TIME_HEADS, word)) throw fail(source, 0, m.timeOnly(word));
|
|
5912
|
+
if (!isTree && isOneOf(TREE_HEADS, word)) throw fail(source, 0, m.treeOnly(word));
|
|
5257
5913
|
if (!isOneOf(HEADS, word)) {
|
|
5258
5914
|
const old = oldForm(text2, building !== void 0);
|
|
5259
5915
|
throw fail(source, 0, old ? m.oldForm(old.word, old.shape) : m.unknownHead(word));
|
|
@@ -5344,14 +6000,29 @@ function parseLines(lines, m) {
|
|
|
5344
6000
|
case "span":
|
|
5345
6001
|
inStep(source).events.push(readSpan(source));
|
|
5346
6002
|
break;
|
|
6003
|
+
case "leaf": {
|
|
6004
|
+
const step = inStep(source);
|
|
6005
|
+
step.events.push(readLeaf(source));
|
|
6006
|
+
break;
|
|
6007
|
+
}
|
|
6008
|
+
case "node": {
|
|
6009
|
+
const step = inStep(source);
|
|
6010
|
+
step.events.push(readNode(source));
|
|
6011
|
+
break;
|
|
6012
|
+
}
|
|
5347
6013
|
}
|
|
5348
6014
|
}
|
|
5349
6015
|
if (group) throw fail(group.source, 0, m.unclosedGroup(group.id));
|
|
5350
6016
|
settle();
|
|
5351
6017
|
finish();
|
|
5352
6018
|
if (isGit && branches.length === 0) throw fail(head, 0, m.noBranches);
|
|
5353
|
-
if (
|
|
6019
|
+
if (isTree && trees.size === 0) throw fail(head, 0, m.noLeaves);
|
|
6020
|
+
if (boxes.length === 0 && !isGit && !isTime && !isTree) throw fail(head, 0, m.noBoxes);
|
|
5354
6021
|
if (steps.length === 0) throw fail(head, 0, m.noSteps);
|
|
6022
|
+
const roots = [...trees.keys()].filter((id) => !parents.has(id));
|
|
6023
|
+
const [root, stray] = roots;
|
|
6024
|
+
const strayAt = stray === void 0 ? void 0 : trees.get(stray);
|
|
6025
|
+
if (root !== void 0 && stray !== void 0 && strayAt) throw fail(strayAt.source, strayAt.at, m.manyRoots(stray, root));
|
|
5355
6026
|
return {
|
|
5356
6027
|
version: FORMAT_VERSION,
|
|
5357
6028
|
kind,
|
|
@@ -5532,6 +6203,7 @@ function parseLines(lines, m) {
|
|
|
5532
6203
|
function readGroup(source) {
|
|
5533
6204
|
beforeSteps(source);
|
|
5534
6205
|
if (isGit) throw fail(source, 0, m.gitNoGroup);
|
|
6206
|
+
if (isTree) throw fail(source, 0, m.treeNoGroup);
|
|
5535
6207
|
if (group) throw fail(source, 0, m.nestedGroup);
|
|
5536
6208
|
const declared = readDeclared(source, "group", ATTRS.group, m);
|
|
5537
6209
|
if (regions.some((region) => region.id === declared.id)) {
|
|
@@ -5626,6 +6298,53 @@ function parseLines(lines, m) {
|
|
|
5626
6298
|
tips.set(branch, from);
|
|
5627
6299
|
return { type: "branch", branch, from };
|
|
5628
6300
|
}
|
|
6301
|
+
function readLeaf(source) {
|
|
6302
|
+
const text2 = source.text;
|
|
6303
|
+
const found = LEAF.exec(text2);
|
|
6304
|
+
const id = found?.[1];
|
|
6305
|
+
if (!found || id === void 0) throw fail(source, 0, m.leafShape);
|
|
6306
|
+
const idAt = found.indices?.[1]?.[0] ?? 0;
|
|
6307
|
+
if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
|
|
6308
|
+
declare(source, id, idAt);
|
|
6309
|
+
trees.set(id, { source, at: idAt });
|
|
6310
|
+
const rest2 = skipSpaces(text2, found[0].length);
|
|
6311
|
+
if (rest2 < text2.length && text2[rest2] !== "[") throw fail(source, rest2, m.leafShape);
|
|
6312
|
+
const hash = treeHash(source, rest2, ATTRS.leaf);
|
|
6313
|
+
return { type: "leaf", id, ...hash !== void 0 ? { hash } : {} };
|
|
6314
|
+
}
|
|
6315
|
+
function readNode(source) {
|
|
6316
|
+
const text2 = source.text;
|
|
6317
|
+
const found = NODE.exec(text2);
|
|
6318
|
+
const id = found?.[1];
|
|
6319
|
+
if (!found || id === void 0) throw fail(source, 0, m.nodeShape);
|
|
6320
|
+
const idAt = found.indices?.[1]?.[0] ?? 0;
|
|
6321
|
+
if (!ID.test(id)) throw fail(source, idAt, m.badId(id));
|
|
6322
|
+
declare(source, id, idAt);
|
|
6323
|
+
const children = [];
|
|
6324
|
+
let end = found[0].length;
|
|
6325
|
+
for (; ; ) {
|
|
6326
|
+
const start = skipSpaces(text2, end);
|
|
6327
|
+
end = start;
|
|
6328
|
+
while (end < text2.length && text2[end] !== "," && text2[end] !== "[") end++;
|
|
6329
|
+
const child = text2.slice(start, end).trim();
|
|
6330
|
+
if (child === "" || !ID.test(child)) throw fail(source, start, m.nodeShape);
|
|
6331
|
+
if (!trees.has(child)) throw fail(source, start, ids.has(child) && child !== id ? m.notTreeBox(child) : m.noTreeChild(child));
|
|
6332
|
+
if (parents.has(child)) throw fail(source, start, m.twoParents(child));
|
|
6333
|
+
parents.set(child, id);
|
|
6334
|
+
children.push(child);
|
|
6335
|
+
if (text2[end] !== ",") break;
|
|
6336
|
+
end++;
|
|
6337
|
+
}
|
|
6338
|
+
const hash = treeHash(source, end, ATTRS.node);
|
|
6339
|
+
trees.set(id, { source, at: idAt });
|
|
6340
|
+
return { type: "node", id, children, ...hash !== void 0 ? { hash } : {} };
|
|
6341
|
+
}
|
|
6342
|
+
function treeHash(source, at, keys2) {
|
|
6343
|
+
if (at >= source.text.length) return void 0;
|
|
6344
|
+
const hash = readAttrs(source, at, keys2, m).get("hash");
|
|
6345
|
+
if (hash && !HASH.test(hash.value)) throw fail(source, hash.at, m.badHash);
|
|
6346
|
+
return hash?.value;
|
|
6347
|
+
}
|
|
5629
6348
|
function readStrip(source) {
|
|
5630
6349
|
beforeSteps(source);
|
|
5631
6350
|
if (strip2) throw fail(source, 0, m.stripTwice);
|
|
@@ -5882,6 +6601,10 @@ function event(e, kind) {
|
|
|
5882
6601
|
])}`;
|
|
5883
6602
|
case "branch":
|
|
5884
6603
|
return `${e.branch} ${FROM} ${e.from}`;
|
|
6604
|
+
case "leaf":
|
|
6605
|
+
return `leaf ${e.id}${attrs([["hash", e.hash]])}`;
|
|
6606
|
+
case "node":
|
|
6607
|
+
return `node ${e.id} ${OF} ${e.children.join(", ")}${attrs([["hash", e.hash]])}`;
|
|
5885
6608
|
}
|
|
5886
6609
|
}
|
|
5887
6610
|
function timeBlocks(time) {
|
|
@@ -6238,6 +6961,15 @@ var TYPE = {
|
|
|
6238
6961
|
gitId: text(11, 700),
|
|
6239
6962
|
gitHash: text(10.5, 600, "mono"),
|
|
6240
6963
|
gitNote: text(10.5, 650),
|
|
6964
|
+
/**
|
|
6965
|
+
* 木の図 (#3233) の、箱の中の値 (hash) と名札、根の箱の値と名札、葉の下の札の字。
|
|
6966
|
+
* 値を持たない箱の名札は箱の名前 (`boxName`) の字で描く
|
|
6967
|
+
*/
|
|
6968
|
+
treeHash: text(13.5, 700, "mono"),
|
|
6969
|
+
treeName: text(10.5, 600),
|
|
6970
|
+
rootHash: text(15, 700, "mono"),
|
|
6971
|
+
rootName: text(11, 700),
|
|
6972
|
+
treeCard: text(11.5, 650),
|
|
6241
6973
|
/**
|
|
6242
6974
|
* 時間軸の図 (#3165)。拡大の帯の列の上の字、印の列の名前、時刻の字、区切りの名前と目盛りの番号の範囲、
|
|
6243
6975
|
* 節目の名札と状態、範囲の括弧の字、空きの枠の字、物差しの線の字。和文を含む字は同じ大きさと太さの和文の字で描く
|
|
@@ -6330,6 +7062,36 @@ var LOOK = {
|
|
|
6330
7062
|
labelUnder: 50,
|
|
6331
7063
|
colors: ["blue", "violet", "green", "amber", "rose"]
|
|
6332
7064
|
},
|
|
7065
|
+
/**
|
|
7066
|
+
* 木の図 (#3233)。step 2 で本人が選んだ「根を上」の試作 (`.context/propose/merkle-look/`) の寸法を写す。
|
|
7067
|
+
* 木の箱は幅の下限 `w`、高さ `h`、字の左右の余白 `padX`、角の丸み `radius`。根の箱は `root` の幅の下限と高さと角の丸みを持ち、
|
|
7068
|
+
* 左に絵柄を置いて (`iconX` は箱の左端から絵柄の左端まで)、`textX` から字を左に揃えて並べ、右に `padR` を空ける。
|
|
7069
|
+
* `nameY` と `hashY` は根の箱の真ん中から名札と値の基準線まで。ほかの箱の値と名札は `hashY` と `nameY`、1 行の字は `oneY` に置く。
|
|
7070
|
+
* 葉は書いた順に横に並べ、隣の葉の箱の間を `slotGap` 空ける。根の上端は図の上の余白から `top` 下げ、深さの段の真ん中どうしは `row` 離す。
|
|
7071
|
+
* `card` は値を持つ葉の下の名札の札で、葉の真ん中から札の真ん中まで `drop`、高さ `h`、幅の下限 `minW`、
|
|
7072
|
+
* 字の左右の余白 `padX`、絵柄の幅 `icon` と絵柄と字の間 `gap`、絵柄の縮み `glyph`、角の丸み `radius`。
|
|
7073
|
+
* `boxGap` は木と木でない箱の列の間、`badgeAlong` は木の線を走る段の番号を、曲がり角から横の線に沿って進める長さ。
|
|
7074
|
+
* `faint` は木の線を運ぶ物が通った段から後に、運ぶ物を送りも受けもしていない木の箱を薄く出す濃さ。`color` と `rootColor` は木の箱と根の箱の色
|
|
7075
|
+
*/
|
|
7076
|
+
tree: {
|
|
7077
|
+
w: 74,
|
|
7078
|
+
h: 44,
|
|
7079
|
+
padX: 10,
|
|
7080
|
+
radius: 10,
|
|
7081
|
+
root: { w: 112, h: 54, radius: 13, iconX: 10, textX: 46, padR: 14, nameY: -4, hashY: 14 },
|
|
7082
|
+
hashY: -1,
|
|
7083
|
+
nameY: 14,
|
|
7084
|
+
oneY: 4.5,
|
|
7085
|
+
slotGap: 12,
|
|
7086
|
+
top: 16,
|
|
7087
|
+
row: 102,
|
|
7088
|
+
card: { drop: 78, h: 30, minW: 70, padX: 10, icon: 12, gap: 6, glyph: 0.62, radius: 9 },
|
|
7089
|
+
boxGap: 24,
|
|
7090
|
+
badgeAlong: 22,
|
|
7091
|
+
faint: 0.42,
|
|
7092
|
+
color: "violet",
|
|
7093
|
+
rootColor: "green"
|
|
7094
|
+
},
|
|
6333
7095
|
/**
|
|
6334
7096
|
* 時間軸の図 (#3165)。見本帳の試作 (`scenes/finality.js`) の寸法を写す。
|
|
6335
7097
|
* 図の幅は `width` で、時間軸は左の `axisX` から右の余白 `right` の手前まで。印の列の名前が長い時は、名前の右に `gutterGap` を空けて軸を右へ寄せる。
|
|
@@ -6433,7 +7195,10 @@ var LOOK = {
|
|
|
6433
7195
|
timePoint: 1.75,
|
|
6434
7196
|
timeFlag: 1.8,
|
|
6435
7197
|
timeNeedle: 1.25,
|
|
6436
|
-
timeMeter: 1.25
|
|
7198
|
+
timeMeter: 1.25,
|
|
7199
|
+
tree: 1.5,
|
|
7200
|
+
treeTrail: 2.6,
|
|
7201
|
+
treeCon: 1.3
|
|
6437
7202
|
},
|
|
6438
7203
|
shadow: { near: 0.8, far: 4, nearY: 1, farY: 3 },
|
|
6439
7204
|
mini: { w: 168, pad: 8, title: 14, inset: 12, radius: 10 },
|
|
@@ -7164,7 +7929,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
7164
7929
|
};
|
|
7165
7930
|
const inset = LOOK.edge.inset;
|
|
7166
7931
|
const gapX = (col, toRight) => toRight ? colLeft[col] + colW[col] + (between[col] ?? A.columnGap) / 2 : colLeft[col] - (between[col - 1] ?? A.columnGap) / 2;
|
|
7167
|
-
const
|
|
7932
|
+
const route2 = (from, to) => {
|
|
7168
7933
|
const a = byId.get(from);
|
|
7169
7934
|
const b = byId.get(to);
|
|
7170
7935
|
if (from === to) return loopUnder(a);
|
|
@@ -7237,7 +8002,7 @@ function arrange(diagram, groups, slots, rooms) {
|
|
|
7237
8002
|
event: event2,
|
|
7238
8003
|
from: edge2.from,
|
|
7239
8004
|
to: edge2.to,
|
|
7240
|
-
points:
|
|
8005
|
+
points: route2(edge2.from, edge2.to),
|
|
7241
8006
|
color: edgeColor(edge2, colors),
|
|
7242
8007
|
carry: edge2.carry
|
|
7243
8008
|
}));
|
|
@@ -7534,11 +8299,11 @@ function layoutGit(diagram) {
|
|
|
7534
8299
|
col.set(c.id, k);
|
|
7535
8300
|
laneLast.set(c.branch, k);
|
|
7536
8301
|
}
|
|
7537
|
-
const
|
|
8302
|
+
const linesOf2 = (c) => [
|
|
7538
8303
|
...c.hash !== void 0 ? [{ text: c.hash, style: TYPE.gitHash }] : [],
|
|
7539
8304
|
...c.note !== void 0 ? [{ text: c.note, style: TYPE.gitNote }] : []
|
|
7540
8305
|
];
|
|
7541
|
-
const textW = (c) => Math.max(0, ...
|
|
8306
|
+
const textW = (c) => Math.max(0, ...linesOf2(c).map((line2) => textWidth(line2.text, line2.style)));
|
|
7542
8307
|
const tagW = (ref) => textWidth(ref, hasWide(ref) ? TYPE.carrierJa : TYPE.carrier) + C.tagPadX * 2;
|
|
7543
8308
|
const refWidth = Math.max(0, ...walked.refs.map((r) => tagW(r.name)));
|
|
7544
8309
|
const pitch = Math.max(G.pitch, ...walked.made.map((c) => textW(c) + G.textGap), refWidth + G.textGap);
|
|
@@ -7553,7 +8318,7 @@ function layoutGit(diagram) {
|
|
|
7553
8318
|
})
|
|
7554
8319
|
);
|
|
7555
8320
|
const extraRows = (branch) => Math.max(0, ...walked.made.filter((c) => c.branch === branch).map((c) => (walked.rows.get(c.id) ?? 0) - 2)) * G.row;
|
|
7556
|
-
const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 &&
|
|
8321
|
+
const topText = walked.made.some((c) => laneIndex.get(c.branch) === 0 && linesOf2(c).length > 0);
|
|
7557
8322
|
const lanes = [];
|
|
7558
8323
|
let y = margin;
|
|
7559
8324
|
walked.branches.forEach((id, i) => {
|
|
@@ -7571,7 +8336,7 @@ function layoutGit(diagram) {
|
|
|
7571
8336
|
const isTop = laneIndex.get(c.branch) === 0;
|
|
7572
8337
|
const cx = x0 + pitch * (col.get(c.id) ?? 0) + (isTop ? 0 : pitch / 2);
|
|
7573
8338
|
const cy = lane.line;
|
|
7574
|
-
const lines =
|
|
8339
|
+
const lines = linesOf2(c);
|
|
7575
8340
|
const baselines = lines.map((_, k) => isTop ? cy - G.above - (lines.length - 1 - k) * G.lineStep : cy + G.under + k * G.lineStep);
|
|
7576
8341
|
const boxes2 = lines.map((line2, k) => textBox(line2.text, cx, baselines[k], line2.style, "middle"));
|
|
7577
8342
|
const text2 = boxes2.length === 0 ? void 0 : { ...union(boxes2), lines: lines.map((line2) => line2.text), baselines };
|
|
@@ -8131,7 +8896,7 @@ function layoutState(diagram, lang) {
|
|
|
8131
8896
|
};
|
|
8132
8897
|
const exitX = (box) => starts && box === first ? box.cx + T.side.entry : box.cx;
|
|
8133
8898
|
const finishOf = (id) => ends.find((e) => e.kind === "finish" && e.box === id);
|
|
8134
|
-
const
|
|
8899
|
+
const route2 = (from, to) => {
|
|
8135
8900
|
if (from === "start") {
|
|
8136
8901
|
const start = ends.find((e) => e.kind === "start");
|
|
8137
8902
|
const target = byId.get(to);
|
|
@@ -8175,7 +8940,7 @@ function layoutState(diagram, lang) {
|
|
|
8175
8940
|
event: event2,
|
|
8176
8941
|
from: edge2.from,
|
|
8177
8942
|
to: edge2.to,
|
|
8178
|
-
points:
|
|
8943
|
+
points: route2(edge2.from, edge2.to),
|
|
8179
8944
|
color: colorOf(edge2, colors),
|
|
8180
8945
|
carry: edge2.carry,
|
|
8181
8946
|
...settle ? { settle } : {},
|
|
@@ -8192,7 +8957,7 @@ function layoutState(diagram, lang) {
|
|
|
8192
8957
|
e.points = e.points.map(([x, y]) => flat ? [x, y + d] : [x + d, y]);
|
|
8193
8958
|
outward.set(e, flat ? d > 0 ? "below" : "above" : d > 0 ? "right" : "left");
|
|
8194
8959
|
}
|
|
8195
|
-
const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points:
|
|
8960
|
+
const paths = notTaken.map((p) => ({ from: p.from, to: p.to, points: route2(p.from, p.to) }));
|
|
8196
8961
|
const badgeAt = (edge2, taken, lines2) => edge2.from === edge2.to ? loopBadge(edge2.points) : badgeOnPath(edge2.points, taken, lines2);
|
|
8197
8962
|
const labels = [];
|
|
8198
8963
|
const marks = ends.flatMap((e) => e.text === "" ? [] : [textBox(e.text, ...markText(e), TYPE.regionNote)]);
|
|
@@ -8725,6 +9490,321 @@ function labelsOf2(diagram, layout) {
|
|
|
8725
9490
|
return labels;
|
|
8726
9491
|
}
|
|
8727
9492
|
|
|
9493
|
+
// src/layout/tree.ts
|
|
9494
|
+
var isTreeLayout = (layout) => layout.kind === "tree";
|
|
9495
|
+
function grow2(diagram) {
|
|
9496
|
+
const boxes = new Set(diagram.boxes.map((b) => b.id));
|
|
9497
|
+
const byId = /* @__PURE__ */ new Set();
|
|
9498
|
+
const parents = /* @__PURE__ */ new Map();
|
|
9499
|
+
const grown = [];
|
|
9500
|
+
diagram.steps.forEach((step, s) => {
|
|
9501
|
+
step.events.forEach((e, k) => {
|
|
9502
|
+
if (e.type !== "leaf" && e.type !== "node" || byId.has(e.id) || boxes.has(e.id)) return;
|
|
9503
|
+
const children = e.type === "node" ? [...new Set(e.children)].filter((c) => byId.has(c) && !parents.has(c)) : [];
|
|
9504
|
+
for (const c of children) parents.set(c, e.id);
|
|
9505
|
+
grown.push({ id: e.id, kind: e.type, children, step: s, event: k, ...e.hash !== void 0 ? { hash: e.hash } : {} });
|
|
9506
|
+
byId.add(e.id);
|
|
9507
|
+
});
|
|
9508
|
+
});
|
|
9509
|
+
return { grown, parents };
|
|
9510
|
+
}
|
|
9511
|
+
function linesOf(g, root) {
|
|
9512
|
+
if (g.hash === void 0) return [{ text: g.id, style: TYPE.boxName }];
|
|
9513
|
+
if (root)
|
|
9514
|
+
return [
|
|
9515
|
+
{ text: g.id, style: TYPE.rootName },
|
|
9516
|
+
{ text: g.hash, style: TYPE.rootHash }
|
|
9517
|
+
];
|
|
9518
|
+
if (g.kind === "leaf") return [{ text: g.hash, style: TYPE.treeHash }];
|
|
9519
|
+
return [
|
|
9520
|
+
{ text: g.hash, style: TYPE.treeHash },
|
|
9521
|
+
{ text: g.id, style: TYPE.treeName }
|
|
9522
|
+
];
|
|
9523
|
+
}
|
|
9524
|
+
function route(a, b) {
|
|
9525
|
+
const i = LOOK.edge.inset;
|
|
9526
|
+
const top = Math.max(a.y, b.y);
|
|
9527
|
+
const bottom = Math.min(a.y + a.h, b.y + b.h);
|
|
9528
|
+
if (bottom > top) {
|
|
9529
|
+
const y = (top + bottom) / 2;
|
|
9530
|
+
return b.x >= a.x + a.w ? [
|
|
9531
|
+
[a.x + a.w + i, y],
|
|
9532
|
+
[b.x - i, y]
|
|
9533
|
+
] : [
|
|
9534
|
+
[a.x - i, y],
|
|
9535
|
+
[b.x + b.w + i, y]
|
|
9536
|
+
];
|
|
9537
|
+
}
|
|
9538
|
+
const left = Math.max(a.x, b.x);
|
|
9539
|
+
const right = Math.min(a.x + a.w, b.x + b.w);
|
|
9540
|
+
if (right > left) {
|
|
9541
|
+
const x = (left + right) / 2;
|
|
9542
|
+
return b.y >= a.y + a.h ? [
|
|
9543
|
+
[x, a.y + a.h + i],
|
|
9544
|
+
[x, b.y - i]
|
|
9545
|
+
] : [
|
|
9546
|
+
[x, a.y - i],
|
|
9547
|
+
[x, b.y + b.h + i]
|
|
9548
|
+
];
|
|
9549
|
+
}
|
|
9550
|
+
const ax = a.x + a.w / 2;
|
|
9551
|
+
const ty = b.y + b.h / 2;
|
|
9552
|
+
return [
|
|
9553
|
+
[ax, b.y > a.y ? a.y + a.h + i : a.y - i],
|
|
9554
|
+
[ax, ty],
|
|
9555
|
+
[b.x > ax ? b.x - i : b.x + b.w + i, ty]
|
|
9556
|
+
];
|
|
9557
|
+
}
|
|
9558
|
+
function layoutTree(diagram) {
|
|
9559
|
+
const { margin, gap, box: B, tree: T, badge: BD } = LOOK;
|
|
9560
|
+
const { grown, parents } = grow2(diagram);
|
|
9561
|
+
const tops = grown.filter((g) => !parents.has(g.id));
|
|
9562
|
+
const rootId = tops[tops.length - 1]?.id;
|
|
9563
|
+
const byId = new Map(grown.map((g) => [g.id, g]));
|
|
9564
|
+
const depth = /* @__PURE__ */ new Map();
|
|
9565
|
+
const walk2 = (id, d) => {
|
|
9566
|
+
depth.set(id, d);
|
|
9567
|
+
for (const c of byId.get(id)?.children ?? []) walk2(c, d + 1);
|
|
9568
|
+
};
|
|
9569
|
+
for (const t of tops) walk2(t.id, 0);
|
|
9570
|
+
const texts = new Map(grown.map((g) => [g.id, linesOf(g, g.id === rootId)]));
|
|
9571
|
+
const widest = (id) => Math.max(0, ...(texts.get(id) ?? []).map((line2) => textWidth(line2.text, line2.style)));
|
|
9572
|
+
const widthOf = (g) => g.id === rootId ? Math.max(T.root.w, T.root.textX + widest(g.id) + T.root.padR) : Math.max(T.w, widest(g.id) + T.padX * 2);
|
|
9573
|
+
const cardW = (g) => Math.max(T.card.minW, T.card.padX * 2 + T.card.icon + T.card.gap + textWidth(g.id, TYPE.treeCard));
|
|
9574
|
+
const hasCard = (g) => g.kind === "leaf" && g.hash !== void 0;
|
|
9575
|
+
const slots = grown.filter((g) => g.children.length === 0);
|
|
9576
|
+
const pitch = Math.max(...grown.filter((g) => g.id !== rootId || g.children.length === 0).map((g) => Math.max(widthOf(g), hasCard(g) ? cardW(g) : 0)), T.w) + T.slotGap;
|
|
9577
|
+
const x0 = margin + BD.r * 2 + BD.inset;
|
|
9578
|
+
const xs = /* @__PURE__ */ new Map();
|
|
9579
|
+
slots.forEach((g, i) => xs.set(g.id, x0 + pitch * (i + 0.5)));
|
|
9580
|
+
const xOf = (id) => {
|
|
9581
|
+
const known = xs.get(id);
|
|
9582
|
+
if (known !== void 0) return known;
|
|
9583
|
+
const kids = byId.get(id)?.children ?? [];
|
|
9584
|
+
const x = (xOf(kids[0]) + xOf(kids[kids.length - 1])) / 2;
|
|
9585
|
+
xs.set(id, x);
|
|
9586
|
+
return x;
|
|
9587
|
+
};
|
|
9588
|
+
const top0 = margin + T.top;
|
|
9589
|
+
const yOf = (d) => top0 + T.root.h / 2 + d * T.row;
|
|
9590
|
+
const colors = boxColors(diagram);
|
|
9591
|
+
const nodes = grown.map((g) => {
|
|
9592
|
+
const root = g.id === rootId;
|
|
9593
|
+
const d = depth.get(g.id) ?? 0;
|
|
9594
|
+
const cx = xOf(g.id);
|
|
9595
|
+
const cy = yOf(d);
|
|
9596
|
+
const w = widthOf(g);
|
|
9597
|
+
const h = root ? T.root.h : T.h;
|
|
9598
|
+
const lines = texts.get(g.id) ?? [];
|
|
9599
|
+
const baselines = lines.length === 1 ? [cy + T.oneY] : root ? [cy + T.root.nameY, cy + T.root.hashY] : [cy + T.hashY, cy + T.nameY];
|
|
9600
|
+
const parent = parents.get(g.id);
|
|
9601
|
+
const color = root ? T.rootColor : T.color;
|
|
9602
|
+
colors.set(g.id, color);
|
|
9603
|
+
const cw = cardW(g);
|
|
9604
|
+
return {
|
|
9605
|
+
id: g.id,
|
|
9606
|
+
kind: g.kind,
|
|
9607
|
+
depth: d,
|
|
9608
|
+
...parent !== void 0 ? { parent } : {},
|
|
9609
|
+
children: g.children,
|
|
9610
|
+
step: g.step,
|
|
9611
|
+
event: g.event,
|
|
9612
|
+
...g.hash !== void 0 ? { hash: g.hash } : {},
|
|
9613
|
+
root,
|
|
9614
|
+
x: cx - w / 2,
|
|
9615
|
+
y: cy - h / 2,
|
|
9616
|
+
w,
|
|
9617
|
+
h,
|
|
9618
|
+
cx,
|
|
9619
|
+
cy,
|
|
9620
|
+
color,
|
|
9621
|
+
lines: lines.map((line2) => line2.text),
|
|
9622
|
+
baselines,
|
|
9623
|
+
styles: lines.map((line2) => line2.style),
|
|
9624
|
+
...hasCard(g) ? { card: { x: cx - cw / 2, y: cy + T.card.drop - T.card.h / 2, w: cw, h: T.card.h, text: g.id } } : {}
|
|
9625
|
+
};
|
|
9626
|
+
});
|
|
9627
|
+
const placed = new Map(nodes.map((n) => [n.id, n]));
|
|
9628
|
+
const links = nodes.flatMap(
|
|
9629
|
+
(p) => p.children.flatMap((id) => {
|
|
9630
|
+
const c = placed.get(id);
|
|
9631
|
+
if (!c) return [];
|
|
9632
|
+
const mid = (c.y + p.y + p.h) / 2;
|
|
9633
|
+
const points2 = [
|
|
9634
|
+
[c.cx, c.y - LOOK.edge.inset],
|
|
9635
|
+
[c.cx, mid],
|
|
9636
|
+
[p.cx, mid],
|
|
9637
|
+
[p.cx, p.y + p.h + LOOK.edge.inset]
|
|
9638
|
+
];
|
|
9639
|
+
return [{ from: c.id, to: p.id, step: p.step, event: p.event, points: points2 }];
|
|
9640
|
+
})
|
|
9641
|
+
);
|
|
9642
|
+
const rooms = slotRooms(diagram);
|
|
9643
|
+
const treeRight = Math.max(x0, ...nodes.flatMap((n) => [n.x + n.w, ...n.card ? [n.card.x + n.card.w] : []]));
|
|
9644
|
+
const rootBox = nodes.find((n) => n.root);
|
|
9645
|
+
const ids = new Set(diagram.boxes.map((b) => b.id));
|
|
9646
|
+
const named = edgesOf(diagram).flatMap(({ edge: edge2 }) => edge2.label !== void 0 && (ids.has(edge2.from) || ids.has(edge2.to)) ? [textWidth(edge2.label, labelStyle(edge2.label)) + LOOK.label.padX * 2] : []);
|
|
9647
|
+
const boxX = Math.max(treeRight + T.boxGap, (rootBox ? rootBox.x + rootBox.w : x0) + Math.max(0, ...named) + gap * 2);
|
|
9648
|
+
let by = rootBox?.y ?? top0;
|
|
9649
|
+
const boxes = diagram.boxes.map((b) => {
|
|
9650
|
+
const w = Math.max(boxWidth(diagram, b.id, true), slotBoxWidth(rooms.get(b.id), b.icon !== void 0, B.padX));
|
|
9651
|
+
const y = by;
|
|
9652
|
+
by += B.h + gap;
|
|
9653
|
+
const box = {
|
|
9654
|
+
id: b.id,
|
|
9655
|
+
name: b.name,
|
|
9656
|
+
...b.sub !== void 0 ? { sub: b.sub } : {},
|
|
9657
|
+
...b.icon !== void 0 ? { icon: b.icon } : {},
|
|
9658
|
+
color: colors.get(b.id) ?? "slate",
|
|
9659
|
+
x: boxX,
|
|
9660
|
+
y,
|
|
9661
|
+
w,
|
|
9662
|
+
h: B.h,
|
|
9663
|
+
cx: boxX + w / 2,
|
|
9664
|
+
cy: y + B.h / 2
|
|
9665
|
+
};
|
|
9666
|
+
placeSlot(box, rooms.get(b.id));
|
|
9667
|
+
return box;
|
|
9668
|
+
});
|
|
9669
|
+
const boxById = new Map(boxes.map((b) => [b.id, b]));
|
|
9670
|
+
const runs = [];
|
|
9671
|
+
const edges = diagram.steps.flatMap(
|
|
9672
|
+
(step, s) => step.events.flatMap((e, k) => {
|
|
9673
|
+
if (e.type !== "edge") return [];
|
|
9674
|
+
const a = placed.get(e.from) ?? boxById.get(e.from);
|
|
9675
|
+
const b = placed.get(e.to) ?? boxById.get(e.to);
|
|
9676
|
+
if (!a || !b) return [];
|
|
9677
|
+
const up = links.find((l) => l.from === e.from && l.to === e.to);
|
|
9678
|
+
const down = links.find((l) => l.from === e.to && l.to === e.from);
|
|
9679
|
+
const link = up ?? down;
|
|
9680
|
+
if (link) runs.push({ step: s, event: k, link: link.from });
|
|
9681
|
+
const points2 = up ? up.points : down ? [...down.points].reverse() : e.from === e.to ? loopUnder({ cx: a.x + a.w / 2, y: a.y, h: a.h }) : route(a, b);
|
|
9682
|
+
return [{ step: s, event: k, from: e.from, to: e.to, points: points2, color: edgeColor(e, colors), carry: e.carry }];
|
|
9683
|
+
})
|
|
9684
|
+
);
|
|
9685
|
+
seatCarriers(edges, boxById, rooms);
|
|
9686
|
+
const layout = {
|
|
9687
|
+
kind: "tree",
|
|
9688
|
+
width: 0,
|
|
9689
|
+
height: 0,
|
|
9690
|
+
regions: [],
|
|
9691
|
+
boxes,
|
|
9692
|
+
lifelines: [],
|
|
9693
|
+
edges,
|
|
9694
|
+
labels: [],
|
|
9695
|
+
actions: [],
|
|
9696
|
+
badges: [],
|
|
9697
|
+
paths: [],
|
|
9698
|
+
ends: [],
|
|
9699
|
+
nodes,
|
|
9700
|
+
links,
|
|
9701
|
+
runs
|
|
9702
|
+
};
|
|
9703
|
+
layout.badges = badgesOf3(diagram, layout);
|
|
9704
|
+
layout.labels = labelsOf3(diagram, layout);
|
|
9705
|
+
const cards = nodes.flatMap((n) => n.card ? [n.card] : []);
|
|
9706
|
+
const solids = [...nodes, ...cards, ...boxes, ...layout.labels];
|
|
9707
|
+
const points = edges.flatMap((e) => e.points);
|
|
9708
|
+
const right = Math.max(...solids.map((r) => r.x + r.w), ...points.map(([x]) => x), x0);
|
|
9709
|
+
const bottom = Math.max(...solids.map((r) => r.y + r.h), ...points.map(([, y]) => y), top0);
|
|
9710
|
+
const width = Math.max(right + margin, stripNeed(diagram) + margin * 2);
|
|
9711
|
+
const strip2 = layoutStrip(diagram, margin, bottom + gap, width - margin * 2);
|
|
9712
|
+
layout.width = width;
|
|
9713
|
+
layout.height = (strip2 ? strip2.y + strip2.h : bottom) + margin;
|
|
9714
|
+
if (strip2) layout.strip = strip2;
|
|
9715
|
+
layout.badges = badgesOf3(diagram, layout);
|
|
9716
|
+
return layout;
|
|
9717
|
+
}
|
|
9718
|
+
function badgesOf3(diagram, layout) {
|
|
9719
|
+
const { r, inset } = LOOK.badge;
|
|
9720
|
+
const apart = r * 2 + inset;
|
|
9721
|
+
const taken = [];
|
|
9722
|
+
const out = [];
|
|
9723
|
+
const solids = [...layout.nodes, ...layout.nodes.flatMap((n) => n.card ? [n.card] : []), ...layout.boxes];
|
|
9724
|
+
const free = (p) => taken.every(([x, y]) => Math.hypot(p[0] - x, p[1] - y) >= apart) && solids.every((s) => gapBetween(badgeRect(p), s) >= LOOK.label.touch);
|
|
9725
|
+
const put = (s, p, color) => {
|
|
9726
|
+
taken.push(p);
|
|
9727
|
+
out.push({ step: s, x: p[0], y: p[1], color });
|
|
9728
|
+
};
|
|
9729
|
+
const passed = /* @__PURE__ */ new Map();
|
|
9730
|
+
diagram.steps.forEach((step, s) => {
|
|
9731
|
+
const k = step.events.findIndex((e2) => e2.type === "leaf" || e2.type === "node" || e2.type === "edge");
|
|
9732
|
+
const first = step.events[k];
|
|
9733
|
+
const n = layout.nodes.find((x) => x.step === s && x.event === k);
|
|
9734
|
+
if (first && first.type !== "edge" && n) {
|
|
9735
|
+
const spots = [
|
|
9736
|
+
[n.x - inset - r, n.cy],
|
|
9737
|
+
[n.x, n.y],
|
|
9738
|
+
[n.x + n.w + inset + r, n.cy],
|
|
9739
|
+
[n.x + n.w, n.y]
|
|
9740
|
+
];
|
|
9741
|
+
put(s, spots.find(free) ?? spots[0], n.color);
|
|
9742
|
+
return;
|
|
9743
|
+
}
|
|
9744
|
+
const e = layout.edges.find((x) => x.step === s && x.event === k);
|
|
9745
|
+
if (first?.type === "edge" && e) {
|
|
9746
|
+
const key2 = [e.from, e.to].sort().join("\n");
|
|
9747
|
+
const run = layout.runs.some((x) => x.step === s && x.event === k);
|
|
9748
|
+
const lines = layout.edges.filter((x) => x !== e).map((x) => x.points);
|
|
9749
|
+
const point = passed.get(key2) ?? (run ? onLink(e.points, free) : midway(e, free)) ?? badgeOnPath(e.points, taken, lines);
|
|
9750
|
+
passed.set(key2, point);
|
|
9751
|
+
put(s, point, e.color);
|
|
9752
|
+
return;
|
|
9753
|
+
}
|
|
9754
|
+
const box = step.events.flatMap((ev) => ev.type === "swap" || ev.type === "action" ? [ev.box] : []).flatMap((id) => layout.boxes.filter((b) => b.id === id))[0];
|
|
9755
|
+
if (box) {
|
|
9756
|
+
out.push({ step: s, x: box.x, y: box.y, color: box.color });
|
|
9757
|
+
return;
|
|
9758
|
+
}
|
|
9759
|
+
if (layout.strip && step.events.some((ev) => ev.type === "strip")) {
|
|
9760
|
+
out.push({ step: s, x: layout.strip.x + inset, y: layout.strip.y + inset, color: "slate" });
|
|
9761
|
+
return;
|
|
9762
|
+
}
|
|
9763
|
+
const before = out[out.length - 1];
|
|
9764
|
+
const root = layout.nodes.find((x) => x.root);
|
|
9765
|
+
out.push(before ? { ...before, step: s } : { step: s, x: root?.x ?? LOOK.margin, y: root?.y ?? LOOK.margin, color: root?.color ?? "slate" });
|
|
9766
|
+
});
|
|
9767
|
+
return replaceSameSpot(out);
|
|
9768
|
+
}
|
|
9769
|
+
function onLink(points, free) {
|
|
9770
|
+
const [p0, p1, p2] = points;
|
|
9771
|
+
const flat = Math.abs(p2[0] - p1[0]);
|
|
9772
|
+
const { r, inset } = LOOK.badge;
|
|
9773
|
+
if (flat >= LOOK.tree.badgeAlong + r) {
|
|
9774
|
+
const p = along(points, pathLength([p0, p1]) + LOOK.tree.badgeAlong);
|
|
9775
|
+
if (free(p)) return p;
|
|
9776
|
+
}
|
|
9777
|
+
const side2 = [p1[0] + r + inset, p1[1]];
|
|
9778
|
+
return free(side2) ? side2 : void 0;
|
|
9779
|
+
}
|
|
9780
|
+
function midway(e, free) {
|
|
9781
|
+
const length = pathLength(e.points);
|
|
9782
|
+
const room = carrierHalf(e.carry)[0] + LOOK.badge.r + LOOK.badge.inset;
|
|
9783
|
+
for (let d = 0; d <= length / 2 - room; d += 1) {
|
|
9784
|
+
for (const at of [length / 2 - d, length / 2 + d]) {
|
|
9785
|
+
const p = along(e.points, at);
|
|
9786
|
+
if (free(p)) return p;
|
|
9787
|
+
}
|
|
9788
|
+
}
|
|
9789
|
+
return void 0;
|
|
9790
|
+
}
|
|
9791
|
+
function labelsOf3(diagram, layout) {
|
|
9792
|
+
const labels = [];
|
|
9793
|
+
const cards = layout.nodes.flatMap((n) => n.card ? [n.card] : []);
|
|
9794
|
+
for (const e of layout.edges) {
|
|
9795
|
+
const source = diagram.steps[e.step]?.events[e.event];
|
|
9796
|
+
if (source?.type !== "edge" || source.label === void 0) continue;
|
|
9797
|
+
const seen = layout.badges.filter((b) => b.step <= e.step).map((b) => badgeRect([b.x, b.y]));
|
|
9798
|
+
labels.push(
|
|
9799
|
+
placeLabel(
|
|
9800
|
+
{ step: e.step, event: e.event, text: source.label, points: e.points, color: e.color, ...source.labelSide ? { side: source.labelSide } : {}, flip: true },
|
|
9801
|
+
{ hard: [...layout.nodes, ...layout.boxes], soft: [...cards, ...labels.filter((l) => l.step === e.step)], touch: seen }
|
|
9802
|
+
)
|
|
9803
|
+
);
|
|
9804
|
+
}
|
|
9805
|
+
return labels;
|
|
9806
|
+
}
|
|
9807
|
+
|
|
8728
9808
|
// src/timeline.ts
|
|
8729
9809
|
function plan(step, needle) {
|
|
8730
9810
|
const out = { edges: [], events: [], busy: 0 };
|
|
@@ -8766,7 +9846,7 @@ function plan(step, needle) {
|
|
|
8766
9846
|
return;
|
|
8767
9847
|
}
|
|
8768
9848
|
if (event2.type === "now" || needle && pulled(event2)) return;
|
|
8769
|
-
if (event2.type === "commit" || event2.type === "branch") {
|
|
9849
|
+
if (event2.type === "commit" || event2.type === "branch" || event2.type === "leaf" || event2.type === "node") {
|
|
8770
9850
|
const a = cursor;
|
|
8771
9851
|
const b = a + MOTION.draw;
|
|
8772
9852
|
out.edges.push({ event: e, a, b, carries: false, coin: false, named: false });
|
|
@@ -8992,6 +10072,7 @@ var ICONS = {
|
|
|
8992
10072
|
layers: "M 0 -8 l9 4.5 l-9 4.5 l-9 -4.5 z M -9 2.5 l9 4.5 l9 -4.5",
|
|
8993
10073
|
code: "M -4 -6 l-5 6 l5 6 M 4 -6 l5 6 l-5 6",
|
|
8994
10074
|
paint: "M -8 8 c 0 -3 2 -5 4.5 -5 l 9 -9 l 3.5 3.5 l -9 9 c 0 2.5 -2 4.5 -5 4.5 z",
|
|
10075
|
+
tree: "M 0 -5 v4 M -6 -1 h12 M -6 -1 v3 M 6 -1 v3 M -9 2 h6 v6 h-6 z M 3 2 h6 v6 h-6 z M -3 -10 h6 v5 h-6 z",
|
|
8995
10076
|
block: "M -9 -7 h18 a2 2 0 0 1 2 2 v10 a2 2 0 0 1 -2 2 h-18 a2 2 0 0 1 -2 -2 v-10 a2 2 0 0 1 2 -2 z M -11 -2.5 h22 M -6 2.5 h8"
|
|
8996
10077
|
};
|
|
8997
10078
|
|
|
@@ -9249,12 +10330,12 @@ var easeInOut = (t) => t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
|
|
|
9249
10330
|
function carrier(e, time, ctx) {
|
|
9250
10331
|
const { m } = ctx;
|
|
9251
10332
|
const n = LOOK.carrier.samples;
|
|
9252
|
-
const
|
|
9253
|
-
const length = pathLength(
|
|
10333
|
+
const route2 = e.wait ? [e.wait, ...e.points] : e.points;
|
|
10334
|
+
const length = pathLength(route2);
|
|
9254
10335
|
const { depart: a, arrive: b, start: from, end: gone } = time;
|
|
9255
10336
|
const path2 = [];
|
|
9256
10337
|
for (let k = 0; k <= n; k++) {
|
|
9257
|
-
const [x, y] = along(
|
|
10338
|
+
const [x, y] = along(route2, easeInOut(k / n) * length);
|
|
9258
10339
|
path2.push([a + (b - a) * k / n, x, y]);
|
|
9259
10340
|
}
|
|
9260
10341
|
const first = path2[0];
|
|
@@ -9731,6 +10812,128 @@ function timeFocus(layout, timeline, step, parts, vw, vh) {
|
|
|
9731
10812
|
return held;
|
|
9732
10813
|
}
|
|
9733
10814
|
|
|
10815
|
+
// src/render/tree.ts
|
|
10816
|
+
var r14 = (v) => Math.round(v * 100) / 100;
|
|
10817
|
+
function drawTree(layout, diagram, timeline, ctx) {
|
|
10818
|
+
const { m } = ctx;
|
|
10819
|
+
const T = LOOK.tree;
|
|
10820
|
+
const B = LOOK.box;
|
|
10821
|
+
const timeOf = (step, event2) => timeline.edges.find((t) => t.step === step && t.event === event2);
|
|
10822
|
+
const active = /* @__PURE__ */ new Map();
|
|
10823
|
+
const touched = /* @__PURE__ */ new Map();
|
|
10824
|
+
diagram.steps.forEach((step, s) => {
|
|
10825
|
+
for (const e of step.events) {
|
|
10826
|
+
if (e.type !== "edge") continue;
|
|
10827
|
+
for (const id of [e.from, e.to]) {
|
|
10828
|
+
active.set(id, (active.get(id) ?? /* @__PURE__ */ new Set()).add(s));
|
|
10829
|
+
if (e.carry.kind !== "none" && !touched.has(id)) touched.set(id, s);
|
|
10830
|
+
}
|
|
10831
|
+
}
|
|
10832
|
+
});
|
|
10833
|
+
const carries = (step, event2) => {
|
|
10834
|
+
const e = diagram.steps[step]?.events[event2];
|
|
10835
|
+
return e?.type === "edge" && e.carry.kind !== "none";
|
|
10836
|
+
};
|
|
10837
|
+
const fadeStep = layout.runs.filter((run) => carries(run.step, run.event)).reduce((s, run) => s === void 0 ? run.step : Math.min(s, run.step), void 0);
|
|
10838
|
+
const fadeAt = fadeStep === void 0 ? void 0 : timeline.steps[fadeStep]?.start;
|
|
10839
|
+
const fadeOf = (id) => {
|
|
10840
|
+
if (fadeStep === void 0 || fadeAt === void 0) return void 0;
|
|
10841
|
+
const t = touched.get(id);
|
|
10842
|
+
if (t !== void 0 && t <= fadeStep) return void 0;
|
|
10843
|
+
const back = t === void 0 ? void 0 : timeline.steps[t]?.start;
|
|
10844
|
+
const frames = [
|
|
10845
|
+
[0, { opacity: 1 }],
|
|
10846
|
+
[fadeAt, { opacity: 1 }, EASE.inOut],
|
|
10847
|
+
[fadeAt + MOTION.fade, { opacity: T.faint }]
|
|
10848
|
+
];
|
|
10849
|
+
if (back !== void 0) frames.push([back, { opacity: T.faint }, EASE.inOut], [back + MOTION.fade, { opacity: 1 }]);
|
|
10850
|
+
frames.push([m.last, { opacity: back === void 0 ? T.faint : 1 }, EASE.inOut], [m.total, { opacity: 1 }]);
|
|
10851
|
+
return m.kf(frames);
|
|
10852
|
+
};
|
|
10853
|
+
const faded = (id, markup, attrs2 = "") => {
|
|
10854
|
+
const fade = fadeOf(id);
|
|
10855
|
+
return fade ? `<g class="dg-a"${attrs2} style="${fade}">${markup}</g>` : attrs2 === "" ? markup : `<g${attrs2}>${markup}</g>`;
|
|
10856
|
+
};
|
|
10857
|
+
const drawnAt = new Map(layout.nodes.map((n) => [n.id, timeOf(n.step, n.event)?.drawn ?? 0]));
|
|
10858
|
+
const links = layout.links.map((l) => {
|
|
10859
|
+
const time = timeOf(l.step, l.event);
|
|
10860
|
+
if (!time) return "";
|
|
10861
|
+
ctx.traces.push({ from: l.from, to: l.to, points: l.points, shown: [[time.start, Number.POSITIVE_INFINITY]] });
|
|
10862
|
+
const kf = m.kf([
|
|
10863
|
+
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
10864
|
+
[time.start, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
|
|
10865
|
+
[time.start + 0.05, { opacity: 1 }],
|
|
10866
|
+
[time.drawn, { "stroke-dashoffset": 0 }],
|
|
10867
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
|
|
10868
|
+
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
10869
|
+
]);
|
|
10870
|
+
return faded(l.from, `<path class="dg-tree-l dg-a" data-tree-link="${esc(l.from)}" pathLength="1" d="${pathOf(l.points)}" style="${kf}"/>`);
|
|
10871
|
+
}).join("");
|
|
10872
|
+
const ties = layout.nodes.flatMap((n) => {
|
|
10873
|
+
if (!n.card) return [];
|
|
10874
|
+
const at = drawnAt.get(n.id) ?? 0;
|
|
10875
|
+
const d = `M ${r14(n.cx)} ${r14(n.y + n.h + LOOK.edge.inset)} V ${r14(n.card.y - LOOK.edge.inset)}`;
|
|
10876
|
+
return [faded(n.id, `<path class="dg-tree-con dg-a" d="${d}" style="${m.vis(at)}"/>`)];
|
|
10877
|
+
}).join("");
|
|
10878
|
+
const traced = /* @__PURE__ */ new Set();
|
|
10879
|
+
const trails = layout.runs.flatMap((run) => {
|
|
10880
|
+
const e = layout.edges.find((x) => x.step === run.step && x.event === run.event);
|
|
10881
|
+
if (!e || traced.has(run.link)) return [];
|
|
10882
|
+
const carried = timeline.carriers.find((c) => c.step === run.step && c.event === run.event);
|
|
10883
|
+
const time = timeOf(run.step, run.event);
|
|
10884
|
+
const a = carried?.depart ?? time?.start;
|
|
10885
|
+
const b = carried?.arrive ?? time?.drawn;
|
|
10886
|
+
if (a === void 0 || b === void 0) return [];
|
|
10887
|
+
traced.add(run.link);
|
|
10888
|
+
const kf = m.kf([
|
|
10889
|
+
[0, { opacity: 0, "stroke-dashoffset": 1 }],
|
|
10890
|
+
[a, { opacity: 0, "stroke-dashoffset": 1 }, EASE.inOut],
|
|
10891
|
+
[a + 0.05, { opacity: 1 }],
|
|
10892
|
+
[b, { "stroke-dashoffset": 0 }],
|
|
10893
|
+
[m.last, { opacity: 1, "stroke-dashoffset": 0 }, EASE.inOut],
|
|
10894
|
+
[m.total, { opacity: 0, "stroke-dashoffset": 0 }]
|
|
10895
|
+
]);
|
|
10896
|
+
const d = pathOf(e.points);
|
|
10897
|
+
return [
|
|
10898
|
+
`<g style="${cs(e.color)}"><path class="dg-tree-tr dg-a" data-tree-trail="${esc(run.link)}" pathLength="1" d="${d}" style="${kf}"/><path class="dg-tree-h dg-a" d="${arrowHead(e.points)}" style="${m.vis(b)}"/></g>`
|
|
10899
|
+
];
|
|
10900
|
+
}).join("");
|
|
10901
|
+
const cards = layout.nodes.flatMap((n) => {
|
|
10902
|
+
const c = n.card;
|
|
10903
|
+
if (!c) return [];
|
|
10904
|
+
const gx = c.x + T.card.padX + T.card.icon / 2;
|
|
10905
|
+
const cy = c.y + c.h / 2;
|
|
10906
|
+
const text2 = write(ctx.ink, "dg-tree-ct", c.x + T.card.padX + T.card.icon + T.card.gap, cy + LOOK.baseline.label, c.text, TYPE.treeCard, ALWAYS);
|
|
10907
|
+
return [
|
|
10908
|
+
faded(
|
|
10909
|
+
n.id,
|
|
10910
|
+
`<rect class="dg-tree-card" x="${r14(c.x)}" y="${r14(c.y)}" width="${r14(c.w)}" height="${c.h}" rx="${T.card.radius}"/>${glyph("doc", gx, cy, T.card.glyph, "dg-tree-cg")}${text2}`,
|
|
10911
|
+
` data-tree-card="${esc(n.id)}"`
|
|
10912
|
+
)
|
|
10913
|
+
];
|
|
10914
|
+
}).join("");
|
|
10915
|
+
const nodes = layout.nodes.map((n) => {
|
|
10916
|
+
const at = drawnAt.get(n.id) ?? 0;
|
|
10917
|
+
const on = [...active.get(n.id) ?? []].sort((x, y) => x - y);
|
|
10918
|
+
const act = on.length > 0 ? activeKf(ctx, on) : void 0;
|
|
10919
|
+
const radius = n.root ? T.root.radius : T.radius;
|
|
10920
|
+
const rect = (cls, extra = "") => `<rect class="${cls}" x="${r14(n.x)}" y="${r14(n.y)}" width="${r14(n.w)}" height="${n.h}" rx="${radius}"${extra}/>`;
|
|
10921
|
+
const frame = `${act ? `<g class="dg-a" style="${act}">${rect("dg-halo")}</g>` : ""}${rect("dg-st", ` ${ctx.sh}`)}${act ? `<g class="dg-a" style="${act}">${rect("dg-on")}</g>` : ""}`;
|
|
10922
|
+
const ix = n.x + T.root.iconX + B.icon / 2;
|
|
10923
|
+
const mark = n.root ? `<rect class="dg-ic" x="${r14(ix - B.icon / 2)}" y="${r14(n.cy - B.icon / 2)}" width="${B.icon}" height="${B.icon}" rx="${B.iconRadius}"/>${glyph("tree", ix, n.cy, B.iconScale)}` : "";
|
|
10924
|
+
const shown2 = [[at, Number.POSITIVE_INFINITY]];
|
|
10925
|
+
const texts = n.lines.map((line2, k) => {
|
|
10926
|
+
const style = n.styles[k] ?? TYPE.boxName;
|
|
10927
|
+
const cls = style === TYPE.treeHash ? "dg-tree-hash" : style === TYPE.treeName ? "dg-tree-name" : style === TYPE.rootHash ? "dg-tree-rh" : style === TYPE.rootName ? "dg-tree-rn" : "dg-tree-one";
|
|
10928
|
+
const baseline = n.baselines[k] ?? n.cy;
|
|
10929
|
+
return n.root ? write(ctx.ink, cls, n.x + T.root.textX, baseline, line2, style, shown2) : write(ctx.ink, cls, n.cx, baseline, line2, style, shown2, "middle");
|
|
10930
|
+
}).join("");
|
|
10931
|
+
const inner = faded(n.id, `${frame}${mark}${texts}`, ` data-tree-node="${esc(n.id)}"${n.root ? ` data-tree-root="${esc(n.id)}"` : ""}`);
|
|
10932
|
+
return `<g class="dg-popc dg-a" style="${cs(n.color)};${m.pop(at)}">${inner}</g>`;
|
|
10933
|
+
}).join("");
|
|
10934
|
+
return { links: links + ties, trails, nodes: cards + nodes };
|
|
10935
|
+
}
|
|
10936
|
+
|
|
9734
10937
|
// src/render/motion.ts
|
|
9735
10938
|
var r2 = (v) => Math.round(v * 100) / 100;
|
|
9736
10939
|
var Motion = class {
|
|
@@ -9909,6 +11112,19 @@ var PART_CSS = [
|
|
|
9909
11112
|
`.dg-git-n{${font(TYPE.gitNote)};fill:var(--ink2)}`,
|
|
9910
11113
|
`.dg-git-old{fill:var(--surf);stroke:var(--c);stroke-width:${S.gitOrphan};stroke-dasharray:3 3;stroke-opacity:.6}`,
|
|
9911
11114
|
`.dg-git-oldl{${font(TYPE.gitId)};fill:var(--ct);opacity:.55}`,
|
|
11115
|
+
// 木の図 (#3233)。木の線は線の灰で、運ぶ物が通った跡は運ぶ物の色で引く
|
|
11116
|
+
`.dg-tree-l{fill:none;stroke:var(--line);stroke-width:${S.tree};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
11117
|
+
`.dg-tree-tr{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:1 2}`,
|
|
11118
|
+
`.dg-tree-h{fill:none;stroke:var(--c);stroke-width:${S.treeTrail};stroke-linecap:round;stroke-linejoin:round}`,
|
|
11119
|
+
`.dg-tree-con{fill:none;stroke:var(--line);stroke-width:${S.treeCon};stroke-linecap:round;stroke-dasharray:2 3.5}`,
|
|
11120
|
+
`.dg-tree-card{fill:var(--surf);stroke:var(--hair);stroke-width:${S.hair}}`,
|
|
11121
|
+
`.dg-tree-cg{fill:none;stroke:var(--mute);stroke-width:${S.glyph};stroke-linecap:round;stroke-linejoin:round}`,
|
|
11122
|
+
`.dg-tree-ct{${font(TYPE.treeCard)};fill:var(--ink)}`,
|
|
11123
|
+
`.dg-tree-hash{${font(TYPE.treeHash)};fill:var(--ink)}`,
|
|
11124
|
+
`.dg-tree-name{${font(TYPE.treeName)};fill:var(--mute)}`,
|
|
11125
|
+
`.dg-tree-one{${font(TYPE.boxName)};fill:var(--ink)}`,
|
|
11126
|
+
`.dg-tree-rh{${font(TYPE.rootHash)};fill:var(--ink)}`,
|
|
11127
|
+
`.dg-tree-rn{${font(TYPE.rootName)};fill:var(--mute)}`,
|
|
9912
11128
|
// 時間軸の図 (#3165)。和文を含む字は、末尾に j を付けた class で同じ大きさと太さの和文の字にする
|
|
9913
11129
|
`.dg-tm-ep{fill:color-mix(in srgb,var(--ink) ${X.timeShade}%,transparent)}`,
|
|
9914
11130
|
`.dg-tm-sep{stroke:var(--hair);stroke-width:${S.hair};stroke-dasharray:2 4}`,
|
|
@@ -10070,6 +11286,14 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
10070
11286
|
L.node.push(git.commits);
|
|
10071
11287
|
L.top.push(git.tags);
|
|
10072
11288
|
}
|
|
11289
|
+
const treeLayout = isTreeLayout(layout) ? layout : void 0;
|
|
11290
|
+
if (treeLayout) {
|
|
11291
|
+
const tree = drawTree(treeLayout, diagram, timeline, ctx);
|
|
11292
|
+
L.base.push(tree.links);
|
|
11293
|
+
L.lit.push(tree.trails);
|
|
11294
|
+
L.node.push(tree.nodes);
|
|
11295
|
+
}
|
|
11296
|
+
const runs = new Set((treeLayout?.runs ?? []).map((r) => `${r.step}/${r.event}`));
|
|
10073
11297
|
const timeLayout = isTimeLayout(layout) ? layout : void 0;
|
|
10074
11298
|
if (timeLayout) {
|
|
10075
11299
|
const drawn = drawTime(timeLayout, diagram, timeline, ctx, subs);
|
|
@@ -10081,7 +11305,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
10081
11305
|
const wired = new Set((timeLayout?.wires ?? []).map((w) => `${w.step}/${w.event}`));
|
|
10082
11306
|
for (const e of layout.edges) {
|
|
10083
11307
|
const time = timeline.edges.find((t) => t.step === e.step && t.event === e.event);
|
|
10084
|
-
if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`)) continue;
|
|
11308
|
+
if (!time || timeLayout && !wired.has(`${e.step}/${e.event}`) || runs.has(`${e.step}/${e.event}`)) continue;
|
|
10085
11309
|
const drawn = edge(e, time, ctx, isState);
|
|
10086
11310
|
L.base.push(drawn.base);
|
|
10087
11311
|
L.lit.push(drawn.lit);
|
|
@@ -10112,7 +11336,7 @@ function drawSvg(diagram, layout, timeline, palette, theme, follow, ink = [], tr
|
|
|
10112
11336
|
}
|
|
10113
11337
|
for (const time of timeline.carriers) {
|
|
10114
11338
|
const e = layout.edges.find((x) => x.step === time.step && x.event === time.event);
|
|
10115
|
-
if (e) L.top.push(carrier(e, time, ctx));
|
|
11339
|
+
if (e) L.top.push(carrier(e, treeLayout ? { ...time, start: time.depart, end: time.arrive + MOTION.fade } : time, ctx));
|
|
10116
11340
|
}
|
|
10117
11341
|
const content = Object.values(L).map((parts) => parts.join("")).join("");
|
|
10118
11342
|
const { near, far, nearY, farY } = LOOK.shadow;
|
|
@@ -10150,6 +11374,15 @@ function focusParts(layout, diagram, step) {
|
|
|
10150
11374
|
rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
|
|
10151
11375
|
}
|
|
10152
11376
|
rects.push(...layout.labels.filter((l) => l.step === step), ...layout.actions.filter((a) => a.step === step));
|
|
11377
|
+
if (isTreeLayout(layout)) {
|
|
11378
|
+
const ends = new Set((diagram.steps[step]?.events ?? []).flatMap((e) => e.type === "edge" ? [e.from, e.to] : []));
|
|
11379
|
+
rects.push(...layout.nodes.filter((n) => n.step === step || ends.has(n.id)));
|
|
11380
|
+
for (const l of layout.links.filter((x) => x.step === step)) {
|
|
11381
|
+
const xs = l.points.map((p) => p[0]);
|
|
11382
|
+
const ys = l.points.map((p) => p[1]);
|
|
11383
|
+
rects.push({ x: Math.min(...xs), y: Math.min(...ys), w: Math.max(...xs) - Math.min(...xs), h: Math.max(...ys) - Math.min(...ys) });
|
|
11384
|
+
}
|
|
11385
|
+
}
|
|
10153
11386
|
for (const event2 of diagram.steps[step]?.events ?? []) {
|
|
10154
11387
|
const ids = event2.type === "edge" ? [event2.from, event2.to] : event2.type === "action" || event2.type === "swap" ? [event2.box] : [];
|
|
10155
11388
|
for (const id of ids) {
|
|
@@ -10222,7 +11455,8 @@ function followView(layout, timeline, diagram, m, id, content, follow, heads) {
|
|
|
10222
11455
|
const overview = () => {
|
|
10223
11456
|
const shapes = [
|
|
10224
11457
|
...layout.regions.map((r3) => `<rect class="dg-mm-band" style="${cs(r3.color)}" x="${mx + r3.x * k}" y="${my + r3.y * k}" width="${r3.w * k}" height="${r3.h * k}" rx="3"/>`),
|
|
10225
|
-
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`)
|
|
11458
|
+
...layout.boxes.map((b) => `<rect class="dg-mm-card" style="${cs(b.color)}" x="${mx + b.x * k}" y="${my + b.y * k}" width="${b.w * k}" height="${b.h * k}" rx="1.5"/>`),
|
|
11459
|
+
...(isTreeLayout(layout) ? layout.nodes : []).map((n) => `<rect class="dg-mm-card" style="${cs(n.color)}" x="${mx + n.x * k}" y="${my + n.y * k}" width="${n.w * k}" height="${n.h * k}" rx="1.5"/>`)
|
|
10226
11460
|
].join("");
|
|
10227
11461
|
const vp = m.move(cam.map(([t, cx, cy, , e]) => [t, mx + (cx - vw / 2) * k, my + (cy - vh / 2) * k, 1, e]));
|
|
10228
11462
|
return {
|
|
@@ -10248,7 +11482,7 @@ function renderDiagram(input, options = {}) {
|
|
|
10248
11482
|
const read = readDiagram(input, { lang });
|
|
10249
11483
|
if (!read.ok) throw new Error(FIGURE_TEXT[lang].cannotDraw(read.errors.map((e) => `${e.pointer} ${e.message}`).join(" / ")));
|
|
10250
11484
|
const diagram = read.diagram;
|
|
10251
|
-
const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : layoutArchitecture(diagram);
|
|
11485
|
+
const layout = diagram.kind === "sequence" ? layoutSequence(diagram) : diagram.kind === "state" ? layoutState(diagram, lang) : diagram.kind === "git" ? layoutGit(diagram) : diagram.kind === "time" ? layoutTime(diagram, lang) : diagram.kind === "tree" ? layoutTree(diagram) : layoutArchitecture(diagram);
|
|
10252
11486
|
return renderLayout(diagram, layout, buildTimeline(diagram, options.still === true), options);
|
|
10253
11487
|
}
|
|
10254
11488
|
function renderLayout(diagram, layout, timeline, options = {}) {
|