@valbuild/core 0.100.0 → 0.102.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/dist/declarations/src/extractValModules.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +12 -1
- package/dist/declarations/src/initSchema.d.ts +22 -1
- package/dist/declarations/src/render.d.ts +56 -5
- package/dist/declarations/src/schema/array.d.ts +12 -2
- package/dist/declarations/src/schema/color.d.ts +57 -0
- package/dist/declarations/src/schema/colorFormat.d.ts +83 -0
- package/dist/declarations/src/schema/files.d.ts +6 -2
- package/dist/declarations/src/schema/hasRemoteFileSchema.d.ts +34 -0
- package/dist/declarations/src/schema/images.d.ts +10 -5
- package/dist/declarations/src/schema/index.d.ts +11 -3
- package/dist/declarations/src/schema/object.d.ts +2 -2
- package/dist/declarations/src/schema/record.d.ts +4 -2
- package/dist/declarations/src/schema/string.d.ts +4 -2
- package/dist/declarations/src/schema/union.d.ts +2 -2
- package/dist/{index-202e48a3.cjs.dev.js → index-30ecb49c.cjs.dev.js} +932 -46
- package/dist/{index-c9241d81.esm.js → index-796fd204.esm.js} +928 -47
- package/dist/{index-92ba715b.cjs.prod.js → index-ca1bbeb2.cjs.prod.js} +932 -46
- package/dist/valbuild-core.cjs.dev.js +6 -1
- package/dist/valbuild-core.cjs.prod.js +6 -1
- package/dist/valbuild-core.esm.js +1 -1
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
- package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
- package/patch/dist/valbuild-core-patch.esm.js +2 -2
|
@@ -920,6 +920,7 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
|
|
|
920
920
|
var _this$options4, _this$options5, _this$options6, _this$customValidateF, _this$customValidateF2;
|
|
921
921
|
return {
|
|
922
922
|
type: "string",
|
|
923
|
+
render: this.renderInput ? true : undefined,
|
|
923
924
|
options: {
|
|
924
925
|
maxLength: (_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.maxLength,
|
|
925
926
|
minLength: (_this$options5 = this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.minLength,
|
|
@@ -945,7 +946,12 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
|
|
|
945
946
|
}
|
|
946
947
|
}, {
|
|
947
948
|
key: "executeRender",
|
|
948
|
-
value: function executeRender(sourcePath, src
|
|
949
|
+
value: function executeRender(sourcePath, src,
|
|
950
|
+
// Accepted and unused: a string's render is a static layout hint
|
|
951
|
+
// (`{as:"textarea"}` / `{as:"code",language}`) with no closure behind it, so
|
|
952
|
+
// there is nothing a scope could prune. Declared so the signature is uniform
|
|
953
|
+
// across every schema rather than something a reader has to check.
|
|
954
|
+
_scope) {
|
|
949
955
|
if (this.renderInput) {
|
|
950
956
|
if (this.renderInput.as === "code") {
|
|
951
957
|
return _defineProperty({}, sourcePath, {
|
|
@@ -1158,7 +1164,7 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
|
|
|
1158
1164
|
}
|
|
1159
1165
|
}, {
|
|
1160
1166
|
key: "executeRender",
|
|
1161
|
-
value: function executeRender(sourcePath, src) {
|
|
1167
|
+
value: function executeRender(sourcePath, src, scope) {
|
|
1162
1168
|
var res = {};
|
|
1163
1169
|
if (src === null) {
|
|
1164
1170
|
return res;
|
|
@@ -1169,7 +1175,13 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
|
|
|
1169
1175
|
continue;
|
|
1170
1176
|
}
|
|
1171
1177
|
var subPath = unsafeCreateSourcePath(sourcePath, _key3);
|
|
1172
|
-
|
|
1178
|
+
// An object produces no render of its own, so it is pure recursion — and
|
|
1179
|
+
// pruning it is the whole contribution: a field deep in one branch stops
|
|
1180
|
+
// paying for every sibling branch's renders.
|
|
1181
|
+
if (scope !== undefined && !scope.wantsUnder(subPath)) {
|
|
1182
|
+
continue;
|
|
1183
|
+
}
|
|
1184
|
+
var itemResult = this.items[_key3]["executeRender"](subPath, itemSrc, scope);
|
|
1173
1185
|
for (var keyS in itemResult) {
|
|
1174
1186
|
var _key4 = keyS;
|
|
1175
1187
|
res[_key4] = itemResult[_key4];
|
|
@@ -1311,6 +1323,7 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
|
|
|
1311
1323
|
type: "array",
|
|
1312
1324
|
item: this.item["executeSerialize"](),
|
|
1313
1325
|
opt: this.opt,
|
|
1326
|
+
render: this.renderInput ? true : undefined,
|
|
1314
1327
|
customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
|
|
1315
1328
|
readonly: this.isReadonly,
|
|
1316
1329
|
hidden: this.isHidden,
|
|
@@ -1319,7 +1332,7 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
|
|
|
1319
1332
|
}
|
|
1320
1333
|
}, {
|
|
1321
1334
|
key: "executeRender",
|
|
1322
|
-
value: function executeRender(sourcePath, src) {
|
|
1335
|
+
value: function executeRender(sourcePath, src, scope) {
|
|
1323
1336
|
var res = {};
|
|
1324
1337
|
if (src === null) {
|
|
1325
1338
|
return res;
|
|
@@ -1331,7 +1344,10 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
|
|
|
1331
1344
|
continue;
|
|
1332
1345
|
}
|
|
1333
1346
|
var subPath = unsafeCreateSourcePath(sourcePath, key);
|
|
1334
|
-
|
|
1347
|
+
if (scope !== undefined && !scope.wantsUnder(subPath)) {
|
|
1348
|
+
continue;
|
|
1349
|
+
}
|
|
1350
|
+
var itemResult = this.item["executeRender"](subPath, itemSrc, scope);
|
|
1335
1351
|
for (var keyS in itemResult) {
|
|
1336
1352
|
var _key = keyS;
|
|
1337
1353
|
res[_key] = itemResult[_key];
|
|
@@ -1347,34 +1363,51 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
|
|
|
1347
1363
|
message: "Unknown layout type: " + layout
|
|
1348
1364
|
};
|
|
1349
1365
|
}
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1366
|
+
// The whole list when the LIST is what is being shown; only the wanted
|
|
1367
|
+
// rows when it is not. `select` is the user's closure and the real expense
|
|
1368
|
+
// — a list view asks for the container and gets every row, a single field
|
|
1369
|
+
// asks for its own path and costs one call.
|
|
1370
|
+
// Non-null once, as a value, rather than a boolean the compiler cannot
|
|
1371
|
+
// tie back to `scope`: no scope and a scope that wants this exact path
|
|
1372
|
+
// both mean the whole list, and anything else is a window.
|
|
1373
|
+
var window = scope !== undefined && !scope.wants(sourcePath) ? scope : null;
|
|
1374
|
+
var items = [];
|
|
1375
|
+
for (var index = 0; index < src.length; index++) {
|
|
1376
|
+
if (window !== null && !window.wantsUnder(unsafeCreateSourcePath(sourcePath, index))) {
|
|
1377
|
+
continue;
|
|
1378
|
+
}
|
|
1379
|
+
// Per ITEM, not per list, matching what `record` already does: `select`
|
|
1380
|
+
// is user code, and one row whose data trips it up must not take out the
|
|
1381
|
+
// whole list. Before scoping, one throwing row produced an error at the
|
|
1382
|
+
// container and no items at all.
|
|
1383
|
+
try {
|
|
1384
|
+
// NB NB: display is actually defined by the user
|
|
1385
|
+
var _select = select({
|
|
1386
|
+
val: src[index]
|
|
1387
|
+
}),
|
|
1388
|
+
title = _select.title,
|
|
1389
|
+
subtitle = _select.subtitle,
|
|
1390
|
+
image = _select.image;
|
|
1391
|
+
items.push([index, {
|
|
1392
|
+
title: title,
|
|
1393
|
+
subtitle: subtitle,
|
|
1394
|
+
image: image
|
|
1395
|
+
}]);
|
|
1396
|
+
} catch (e) {
|
|
1397
|
+
res[unsafeCreateSourcePath(sourcePath, index)] = {
|
|
1398
|
+
status: "error",
|
|
1399
|
+
message: e instanceof Error ? e.message : "Unknown error"
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1377
1402
|
}
|
|
1403
|
+
res[sourcePath] = {
|
|
1404
|
+
status: "success",
|
|
1405
|
+
data: {
|
|
1406
|
+
layout: "list",
|
|
1407
|
+
parent: "array",
|
|
1408
|
+
items: items
|
|
1409
|
+
}
|
|
1410
|
+
};
|
|
1378
1411
|
}
|
|
1379
1412
|
return res;
|
|
1380
1413
|
}
|
|
@@ -1948,7 +1981,7 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
|
|
|
1948
1981
|
}
|
|
1949
1982
|
}, {
|
|
1950
1983
|
key: "executeRender",
|
|
1951
|
-
value: function executeRender(sourcePath, src) {
|
|
1984
|
+
value: function executeRender(sourcePath, src, scope) {
|
|
1952
1985
|
var res = {};
|
|
1953
1986
|
if (src === null) {
|
|
1954
1987
|
return res;
|
|
@@ -1970,7 +2003,7 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
|
|
|
1970
2003
|
return false;
|
|
1971
2004
|
});
|
|
1972
2005
|
if (thisSchema) {
|
|
1973
|
-
var itemResult = thisSchema["executeRender"](sourcePath, src);
|
|
2006
|
+
var itemResult = thisSchema["executeRender"](sourcePath, src, scope);
|
|
1974
2007
|
for (var keyS in itemResult) {
|
|
1975
2008
|
var _key3 = keyS;
|
|
1976
2009
|
res[_key3] = itemResult[_key3];
|
|
@@ -3857,6 +3890,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3857
3890
|
item: this.item["executeSerialize"](),
|
|
3858
3891
|
key: (_this$keySchema = this.keySchema) === null || _this$keySchema === void 0 ? void 0 : _this$keySchema["executeSerialize"](),
|
|
3859
3892
|
opt: this.opt,
|
|
3893
|
+
render: this.renderInput ? true : undefined,
|
|
3860
3894
|
router: (_this$currentRouter = this.currentRouter) === null || _this$currentRouter === void 0 ? void 0 : _this$currentRouter.getRouterId(),
|
|
3861
3895
|
customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
|
|
3862
3896
|
jsonValues: this.isJsonValues ? true : undefined,
|
|
@@ -3889,7 +3923,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3889
3923
|
}
|
|
3890
3924
|
}, {
|
|
3891
3925
|
key: "executeRender",
|
|
3892
|
-
value: function executeRender(sourcePath, src) {
|
|
3926
|
+
value: function executeRender(sourcePath, src, scope) {
|
|
3893
3927
|
var res = {};
|
|
3894
3928
|
if (src === null) {
|
|
3895
3929
|
return res;
|
|
@@ -3907,7 +3941,10 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3907
3941
|
continue;
|
|
3908
3942
|
}
|
|
3909
3943
|
var subPath = unsafeCreateSourcePath(sourcePath, _key);
|
|
3910
|
-
|
|
3944
|
+
if (scope !== undefined && !scope.wantsUnder(subPath)) {
|
|
3945
|
+
continue;
|
|
3946
|
+
}
|
|
3947
|
+
var itemResult = this.item["executeRender"](subPath, itemSrc, scope);
|
|
3911
3948
|
for (var keyS in itemResult) {
|
|
3912
3949
|
var _key2 = keyS;
|
|
3913
3950
|
res[_key2] = itemResult[_key2];
|
|
@@ -3923,6 +3960,9 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3923
3960
|
message: "Unknown layout type: " + layout
|
|
3924
3961
|
};
|
|
3925
3962
|
}
|
|
3963
|
+
// See the same block in `array`: the whole record when the record is what
|
|
3964
|
+
// is being shown, only the wanted entries when it is not.
|
|
3965
|
+
var window = scope !== undefined && !scope.wants(sourcePath) ? scope : null;
|
|
3926
3966
|
var items = [];
|
|
3927
3967
|
for (var _i = 0, _Object$entries = Object.entries(src); _i < _Object$entries.length; _i++) {
|
|
3928
3968
|
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
@@ -3931,6 +3971,9 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3931
3971
|
if (isJson(val)) {
|
|
3932
3972
|
continue; // as above: nothing to select from an un-loaded entry
|
|
3933
3973
|
}
|
|
3974
|
+
if (window !== null && !window.wantsUnder(unsafeCreateSourcePath(sourcePath, _key3))) {
|
|
3975
|
+
continue;
|
|
3976
|
+
}
|
|
3934
3977
|
// Per KEY, not per record: `select` is user code, and one entry whose
|
|
3935
3978
|
// data trips it up must not take out the whole list.
|
|
3936
3979
|
try {
|
|
@@ -5063,8 +5106,8 @@ var keyOf = function keyOf(valModule) {
|
|
|
5063
5106
|
* ```
|
|
5064
5107
|
*/
|
|
5065
5108
|
var files = function files(options) {
|
|
5066
|
-
var _options$
|
|
5067
|
-
var directory =
|
|
5109
|
+
var _options$remote;
|
|
5110
|
+
var directory = options.directory;
|
|
5068
5111
|
var itemSchema = new ObjectSchema({
|
|
5069
5112
|
mimeType: new StringSchema({}, false)
|
|
5070
5113
|
}, false);
|
|
@@ -5452,6 +5495,647 @@ var datetime = function datetime(options) {
|
|
|
5452
5495
|
return new DateTimeSchema(options);
|
|
5453
5496
|
};
|
|
5454
5497
|
|
|
5498
|
+
/**
|
|
5499
|
+
* Parsing / formatting of the CSS color strings stored by `s.color()`.
|
|
5500
|
+
*
|
|
5501
|
+
* Colors are stored as plain CSS strings so that they can be used directly in
|
|
5502
|
+
* `style` attributes and CSS custom properties. The schema decides which family
|
|
5503
|
+
* (`hex`, `rgb`, `hsl` or `oklch`) the string is written in, this module does
|
|
5504
|
+
* the conversion between them.
|
|
5505
|
+
*
|
|
5506
|
+
* All colors are sRGB: `oklch` is only used as an output notation, so any
|
|
5507
|
+
* `oklch` value that falls outside the sRGB gamut is clipped when converted
|
|
5508
|
+
* back to the other formats.
|
|
5509
|
+
*/
|
|
5510
|
+
|
|
5511
|
+
var COLOR_FORMATS = ["hex", "rgb", "hsl", "oklch"];
|
|
5512
|
+
var DEFAULT_COLOR_FORMAT = "hsl";
|
|
5513
|
+
|
|
5514
|
+
/**
|
|
5515
|
+
* A color, normalized to sRGB.
|
|
5516
|
+
*
|
|
5517
|
+
* `r`, `g` and `b` are 0-255 (not rounded), `a` is 0-1.
|
|
5518
|
+
*/
|
|
5519
|
+
|
|
5520
|
+
/**
|
|
5521
|
+
* Which color notation a string uses, or `null` if it is not a notation we
|
|
5522
|
+
* recognize. This looks at the syntax only: `detectColorFormat` says nothing
|
|
5523
|
+
* about whether the value actually parses (`hsl(nope)` is still `"hsl"`).
|
|
5524
|
+
*/
|
|
5525
|
+
function detectColorFormat(value) {
|
|
5526
|
+
var trimmed = value.trim().toLowerCase();
|
|
5527
|
+
if (trimmed.startsWith("#")) {
|
|
5528
|
+
return "hex";
|
|
5529
|
+
}
|
|
5530
|
+
if (trimmed.startsWith("rgb(") || trimmed.startsWith("rgba(")) {
|
|
5531
|
+
return "rgb";
|
|
5532
|
+
}
|
|
5533
|
+
if (trimmed.startsWith("hsl(") || trimmed.startsWith("hsla(")) {
|
|
5534
|
+
return "hsl";
|
|
5535
|
+
}
|
|
5536
|
+
if (trimmed.startsWith("oklch(")) {
|
|
5537
|
+
return "oklch";
|
|
5538
|
+
}
|
|
5539
|
+
return null;
|
|
5540
|
+
}
|
|
5541
|
+
function clamp(value, min, max) {
|
|
5542
|
+
if (Number.isNaN(value)) {
|
|
5543
|
+
return min;
|
|
5544
|
+
}
|
|
5545
|
+
return Math.min(max, Math.max(min, value));
|
|
5546
|
+
}
|
|
5547
|
+
|
|
5548
|
+
/**
|
|
5549
|
+
* Splits the inside of a CSS color function into components.
|
|
5550
|
+
*
|
|
5551
|
+
* Handles both the legacy comma syntax (`rgb(1, 2, 3, 0.5)`) and the modern
|
|
5552
|
+
* space syntax (`rgb(1 2 3 / 0.5)`), returning the alpha (if any) separately.
|
|
5553
|
+
*/
|
|
5554
|
+
function splitComponents(args) {
|
|
5555
|
+
var slashParts = args.split("/");
|
|
5556
|
+
if (slashParts.length > 2) {
|
|
5557
|
+
return null;
|
|
5558
|
+
}
|
|
5559
|
+
var alpha = slashParts.length === 2 ? slashParts[1].trim() : null;
|
|
5560
|
+
var head = slashParts[0].trim();
|
|
5561
|
+
if (head === "") {
|
|
5562
|
+
return null;
|
|
5563
|
+
}
|
|
5564
|
+
var components;
|
|
5565
|
+
if (head.includes(",")) {
|
|
5566
|
+
if (alpha !== null) {
|
|
5567
|
+
// Mixing the comma and the slash syntax is not valid CSS
|
|
5568
|
+
return null;
|
|
5569
|
+
}
|
|
5570
|
+
components = head.split(",").map(function (part) {
|
|
5571
|
+
return part.trim();
|
|
5572
|
+
});
|
|
5573
|
+
if (components.length === 4) {
|
|
5574
|
+
alpha = components[3];
|
|
5575
|
+
components = components.slice(0, 3);
|
|
5576
|
+
}
|
|
5577
|
+
} else {
|
|
5578
|
+
components = head.split(/\s+/);
|
|
5579
|
+
}
|
|
5580
|
+
if (components.length !== 3 || components.some(function (part) {
|
|
5581
|
+
return part === "";
|
|
5582
|
+
})) {
|
|
5583
|
+
return null;
|
|
5584
|
+
}
|
|
5585
|
+
if (alpha === "") {
|
|
5586
|
+
return null;
|
|
5587
|
+
}
|
|
5588
|
+
return {
|
|
5589
|
+
components: components,
|
|
5590
|
+
alpha: alpha
|
|
5591
|
+
};
|
|
5592
|
+
}
|
|
5593
|
+
function parseNumber(value) {
|
|
5594
|
+
if (!/^[+-]?(\d+\.?\d*|\.\d+)$/.test(value)) {
|
|
5595
|
+
return null;
|
|
5596
|
+
}
|
|
5597
|
+
var parsed = Number(value);
|
|
5598
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
5599
|
+
}
|
|
5600
|
+
|
|
5601
|
+
/**
|
|
5602
|
+
* A `<number>` or a `<percentage>`, where 100% maps to `percentageBasis`.
|
|
5603
|
+
*/
|
|
5604
|
+
function parseNumberOrPercentage(value, percentageBasis) {
|
|
5605
|
+
if (value.endsWith("%")) {
|
|
5606
|
+
var percentage = parseNumber(value.slice(0, -1));
|
|
5607
|
+
return percentage === null ? null : percentage / 100 * percentageBasis;
|
|
5608
|
+
}
|
|
5609
|
+
return parseNumber(value);
|
|
5610
|
+
}
|
|
5611
|
+
function parsePercentage(value) {
|
|
5612
|
+
if (!value.endsWith("%")) {
|
|
5613
|
+
return null;
|
|
5614
|
+
}
|
|
5615
|
+
return parseNumber(value.slice(0, -1));
|
|
5616
|
+
}
|
|
5617
|
+
function parseAlpha(value) {
|
|
5618
|
+
if (value === null) {
|
|
5619
|
+
return 1;
|
|
5620
|
+
}
|
|
5621
|
+
if (value === "none") {
|
|
5622
|
+
return 0;
|
|
5623
|
+
}
|
|
5624
|
+
var parsed = parseNumberOrPercentage(value, 1);
|
|
5625
|
+
return parsed === null ? null : clamp(parsed, 0, 1);
|
|
5626
|
+
}
|
|
5627
|
+
function parseHue(value) {
|
|
5628
|
+
var match = /^([+-]?(?:\d+\.?\d*|\.\d+))(deg|grad|rad|turn)?$/.exec(value);
|
|
5629
|
+
if (!match) {
|
|
5630
|
+
return null;
|
|
5631
|
+
}
|
|
5632
|
+
var amount = Number(match[1]);
|
|
5633
|
+
switch (match[2]) {
|
|
5634
|
+
case "grad":
|
|
5635
|
+
return amount / 400 * 360;
|
|
5636
|
+
case "rad":
|
|
5637
|
+
return amount * 180 / Math.PI;
|
|
5638
|
+
case "turn":
|
|
5639
|
+
return amount * 360;
|
|
5640
|
+
default:
|
|
5641
|
+
return amount;
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
function normalizeHue(hue) {
|
|
5645
|
+
var wrapped = hue % 360;
|
|
5646
|
+
return wrapped < 0 ? wrapped + 360 : wrapped;
|
|
5647
|
+
}
|
|
5648
|
+
function parseHex(value) {
|
|
5649
|
+
var hex = value.slice(1);
|
|
5650
|
+
if (!/^[0-9a-f]+$/i.test(hex)) {
|
|
5651
|
+
return null;
|
|
5652
|
+
}
|
|
5653
|
+
var expand = function expand(_char) {
|
|
5654
|
+
return parseInt(_char + _char, 16);
|
|
5655
|
+
};
|
|
5656
|
+
var pair = function pair(index) {
|
|
5657
|
+
return parseInt(hex.slice(index, index + 2), 16);
|
|
5658
|
+
};
|
|
5659
|
+
if (hex.length === 3 || hex.length === 4) {
|
|
5660
|
+
return {
|
|
5661
|
+
r: expand(hex[0]),
|
|
5662
|
+
g: expand(hex[1]),
|
|
5663
|
+
b: expand(hex[2]),
|
|
5664
|
+
a: hex.length === 4 ? expand(hex[3]) / 255 : 1
|
|
5665
|
+
};
|
|
5666
|
+
}
|
|
5667
|
+
if (hex.length === 6 || hex.length === 8) {
|
|
5668
|
+
return {
|
|
5669
|
+
r: pair(0),
|
|
5670
|
+
g: pair(2),
|
|
5671
|
+
b: pair(4),
|
|
5672
|
+
a: hex.length === 8 ? pair(6) / 255 : 1
|
|
5673
|
+
};
|
|
5674
|
+
}
|
|
5675
|
+
return null;
|
|
5676
|
+
}
|
|
5677
|
+
function extractFunctionArgs(value, name) {
|
|
5678
|
+
if (!value.startsWith(name + "(") || !value.endsWith(")")) {
|
|
5679
|
+
return null;
|
|
5680
|
+
}
|
|
5681
|
+
return value.slice(name.length + 1, -1);
|
|
5682
|
+
}
|
|
5683
|
+
function parseRgb(value) {
|
|
5684
|
+
var _extractFunctionArgs;
|
|
5685
|
+
var args = (_extractFunctionArgs = extractFunctionArgs(value, "rgba")) !== null && _extractFunctionArgs !== void 0 ? _extractFunctionArgs : extractFunctionArgs(value, "rgb");
|
|
5686
|
+
if (args === null) {
|
|
5687
|
+
return null;
|
|
5688
|
+
}
|
|
5689
|
+
var split = splitComponents(args);
|
|
5690
|
+
if (!split) {
|
|
5691
|
+
return null;
|
|
5692
|
+
}
|
|
5693
|
+
var channels = split.components.map(function (component) {
|
|
5694
|
+
return component === "none" ? 0 : parseNumberOrPercentage(component, 255);
|
|
5695
|
+
});
|
|
5696
|
+
var alpha = parseAlpha(split.alpha);
|
|
5697
|
+
if (channels.some(function (channel) {
|
|
5698
|
+
return channel === null;
|
|
5699
|
+
}) || alpha === null) {
|
|
5700
|
+
return null;
|
|
5701
|
+
}
|
|
5702
|
+
return {
|
|
5703
|
+
r: clamp(channels[0], 0, 255),
|
|
5704
|
+
g: clamp(channels[1], 0, 255),
|
|
5705
|
+
b: clamp(channels[2], 0, 255),
|
|
5706
|
+
a: alpha
|
|
5707
|
+
};
|
|
5708
|
+
}
|
|
5709
|
+
function parseHsl(value) {
|
|
5710
|
+
var _extractFunctionArgs2, _parsePercentage, _parsePercentage2;
|
|
5711
|
+
var args = (_extractFunctionArgs2 = extractFunctionArgs(value, "hsla")) !== null && _extractFunctionArgs2 !== void 0 ? _extractFunctionArgs2 : extractFunctionArgs(value, "hsl");
|
|
5712
|
+
if (args === null) {
|
|
5713
|
+
return null;
|
|
5714
|
+
}
|
|
5715
|
+
var split = splitComponents(args);
|
|
5716
|
+
if (!split) {
|
|
5717
|
+
return null;
|
|
5718
|
+
}
|
|
5719
|
+
var _split$components = _slicedToArray(split.components, 3),
|
|
5720
|
+
rawHue = _split$components[0],
|
|
5721
|
+
rawSaturation = _split$components[1],
|
|
5722
|
+
rawLightness = _split$components[2];
|
|
5723
|
+
var hue = rawHue === "none" ? 0 : parseHue(rawHue);
|
|
5724
|
+
// CSS requires percentages for s/l in hsl(), but the modern syntax also
|
|
5725
|
+
// allows bare numbers, so accept both.
|
|
5726
|
+
var saturation = rawSaturation === "none" ? 0 : (_parsePercentage = parsePercentage(rawSaturation)) !== null && _parsePercentage !== void 0 ? _parsePercentage : parseNumber(rawSaturation);
|
|
5727
|
+
var lightness = rawLightness === "none" ? 0 : (_parsePercentage2 = parsePercentage(rawLightness)) !== null && _parsePercentage2 !== void 0 ? _parsePercentage2 : parseNumber(rawLightness);
|
|
5728
|
+
var alpha = parseAlpha(split.alpha);
|
|
5729
|
+
if (hue === null || saturation === null || lightness === null || alpha === null) {
|
|
5730
|
+
return null;
|
|
5731
|
+
}
|
|
5732
|
+
return _objectSpread2(_objectSpread2({}, hslToRgb(normalizeHue(hue), clamp(saturation, 0, 100), clamp(lightness, 0, 100))), {}, {
|
|
5733
|
+
a: alpha
|
|
5734
|
+
});
|
|
5735
|
+
}
|
|
5736
|
+
function parseOklch(value) {
|
|
5737
|
+
var args = extractFunctionArgs(value, "oklch");
|
|
5738
|
+
if (args === null) {
|
|
5739
|
+
return null;
|
|
5740
|
+
}
|
|
5741
|
+
var split = splitComponents(args);
|
|
5742
|
+
if (!split) {
|
|
5743
|
+
return null;
|
|
5744
|
+
}
|
|
5745
|
+
var _split$components2 = _slicedToArray(split.components, 3),
|
|
5746
|
+
rawLightness = _split$components2[0],
|
|
5747
|
+
rawChroma = _split$components2[1],
|
|
5748
|
+
rawHue = _split$components2[2];
|
|
5749
|
+
// Lightness is a <number> in 0-1 or a <percentage>, chroma is a <number>
|
|
5750
|
+
// where 0.4 is roughly the maximum, or a <percentage> where 100% = 0.4.
|
|
5751
|
+
var lightness = rawLightness === "none" ? 0 : parseNumberOrPercentage(rawLightness, 1);
|
|
5752
|
+
var chroma = rawChroma === "none" ? 0 : parseNumberOrPercentage(rawChroma, 0.4);
|
|
5753
|
+
var hue = rawHue === "none" ? 0 : parseHue(rawHue);
|
|
5754
|
+
var alpha = parseAlpha(split.alpha);
|
|
5755
|
+
if (lightness === null || chroma === null || hue === null || alpha === null) {
|
|
5756
|
+
return null;
|
|
5757
|
+
}
|
|
5758
|
+
return _objectSpread2(_objectSpread2({}, oklchToRgb(clamp(lightness, 0, 1), Math.max(0, chroma), normalizeHue(hue))), {}, {
|
|
5759
|
+
a: alpha
|
|
5760
|
+
});
|
|
5761
|
+
}
|
|
5762
|
+
|
|
5763
|
+
/**
|
|
5764
|
+
* Parses a CSS color string into sRGB channels.
|
|
5765
|
+
*
|
|
5766
|
+
* Accepts hex (3, 4, 6 and 8 digits), `rgb()` / `rgba()`, `hsl()` / `hsla()`
|
|
5767
|
+
* and `oklch()`, in both the legacy comma and the modern space syntax. Returns
|
|
5768
|
+
* `null` if the value is not a color we can parse - notably: named colors
|
|
5769
|
+
* (`red`), `color()`, `lab()` and `color-mix()` are not supported.
|
|
5770
|
+
*/
|
|
5771
|
+
function parseColor(value) {
|
|
5772
|
+
var normalized = value.trim().toLowerCase();
|
|
5773
|
+
if (normalized === "") {
|
|
5774
|
+
return null;
|
|
5775
|
+
}
|
|
5776
|
+
switch (detectColorFormat(normalized)) {
|
|
5777
|
+
case "hex":
|
|
5778
|
+
return parseHex(normalized);
|
|
5779
|
+
case "rgb":
|
|
5780
|
+
return parseRgb(normalized);
|
|
5781
|
+
case "hsl":
|
|
5782
|
+
return parseHsl(normalized);
|
|
5783
|
+
case "oklch":
|
|
5784
|
+
return parseOklch(normalized);
|
|
5785
|
+
default:
|
|
5786
|
+
return null;
|
|
5787
|
+
}
|
|
5788
|
+
}
|
|
5789
|
+
|
|
5790
|
+
/**
|
|
5791
|
+
* Rounds to at most `decimals` decimals, without trailing zeros.
|
|
5792
|
+
*/
|
|
5793
|
+
function round(value, decimals) {
|
|
5794
|
+
var factor = Math.pow(10, decimals);
|
|
5795
|
+
// `|| 0` normalizes -0 to 0
|
|
5796
|
+
return Math.round(value * factor) / factor || 0;
|
|
5797
|
+
}
|
|
5798
|
+
function toHexPair(value) {
|
|
5799
|
+
return clamp(Math.round(value), 0, 255).toString(16).padStart(2, "0");
|
|
5800
|
+
}
|
|
5801
|
+
function rgbToHsl(r, g, b) {
|
|
5802
|
+
var red = r / 255;
|
|
5803
|
+
var green = g / 255;
|
|
5804
|
+
var blue = b / 255;
|
|
5805
|
+
var max = Math.max(red, green, blue);
|
|
5806
|
+
var min = Math.min(red, green, blue);
|
|
5807
|
+
var delta = max - min;
|
|
5808
|
+
var l = (max + min) / 2;
|
|
5809
|
+
if (delta === 0) {
|
|
5810
|
+
return {
|
|
5811
|
+
h: 0,
|
|
5812
|
+
s: 0,
|
|
5813
|
+
l: l * 100
|
|
5814
|
+
};
|
|
5815
|
+
}
|
|
5816
|
+
var s = delta / (1 - Math.abs(2 * l - 1));
|
|
5817
|
+
var h;
|
|
5818
|
+
if (max === red) {
|
|
5819
|
+
h = (green - blue) / delta % 6;
|
|
5820
|
+
} else if (max === green) {
|
|
5821
|
+
h = (blue - red) / delta + 2;
|
|
5822
|
+
} else {
|
|
5823
|
+
h = (red - green) / delta + 4;
|
|
5824
|
+
}
|
|
5825
|
+
return {
|
|
5826
|
+
h: normalizeHue(h * 60),
|
|
5827
|
+
s: s * 100,
|
|
5828
|
+
l: l * 100
|
|
5829
|
+
};
|
|
5830
|
+
}
|
|
5831
|
+
function hslToRgb(h, s, l) {
|
|
5832
|
+
var saturation = s / 100;
|
|
5833
|
+
var lightness = l / 100;
|
|
5834
|
+
var c = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
5835
|
+
var hPrime = normalizeHue(h) / 60;
|
|
5836
|
+
var x = c * (1 - Math.abs(hPrime % 2 - 1));
|
|
5837
|
+
var m = lightness - c / 2;
|
|
5838
|
+
var rgb;
|
|
5839
|
+
if (hPrime < 1) {
|
|
5840
|
+
rgb = [c, x, 0];
|
|
5841
|
+
} else if (hPrime < 2) {
|
|
5842
|
+
rgb = [x, c, 0];
|
|
5843
|
+
} else if (hPrime < 3) {
|
|
5844
|
+
rgb = [0, c, x];
|
|
5845
|
+
} else if (hPrime < 4) {
|
|
5846
|
+
rgb = [0, x, c];
|
|
5847
|
+
} else if (hPrime < 5) {
|
|
5848
|
+
rgb = [x, 0, c];
|
|
5849
|
+
} else {
|
|
5850
|
+
rgb = [c, 0, x];
|
|
5851
|
+
}
|
|
5852
|
+
return {
|
|
5853
|
+
r: (rgb[0] + m) * 255,
|
|
5854
|
+
g: (rgb[1] + m) * 255,
|
|
5855
|
+
b: (rgb[2] + m) * 255
|
|
5856
|
+
};
|
|
5857
|
+
}
|
|
5858
|
+
function srgbToLinear(channel) {
|
|
5859
|
+
var c = channel / 255;
|
|
5860
|
+
return c <= 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
5861
|
+
}
|
|
5862
|
+
function linearToSrgb(channel) {
|
|
5863
|
+
var c = channel <= 0.0031308 ? channel * 12.92 : 1.055 * Math.pow(channel, 1 / 2.4) - 0.055;
|
|
5864
|
+
return clamp(c * 255, 0, 255);
|
|
5865
|
+
}
|
|
5866
|
+
|
|
5867
|
+
/**
|
|
5868
|
+
* sRGB to Oklch, using Björn Ottosson's Oklab matrices.
|
|
5869
|
+
*/
|
|
5870
|
+
function rgbToOklch(r, g, b) {
|
|
5871
|
+
var lr = srgbToLinear(r);
|
|
5872
|
+
var lg = srgbToLinear(g);
|
|
5873
|
+
var lb = srgbToLinear(b);
|
|
5874
|
+
var _long = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
5875
|
+
var medium = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
5876
|
+
var _short = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
5877
|
+
var lightness = 0.2104542553 * _long + 0.793617785 * medium - 0.0040720468 * _short;
|
|
5878
|
+
var a = 1.9779984951 * _long - 2.428592205 * medium + 0.4505937099 * _short;
|
|
5879
|
+
var bComponent = 0.0259040371 * _long + 0.7827717662 * medium - 0.808675766 * _short;
|
|
5880
|
+
var chroma = Math.sqrt(a * a + bComponent * bComponent);
|
|
5881
|
+
// Achromatic colors have an undefined hue: report 0 rather than the noise
|
|
5882
|
+
// that atan2 of two near-zero numbers produces.
|
|
5883
|
+
var hue = chroma < 1e-6 ? 0 : normalizeHue(Math.atan2(bComponent, a) * 180 / Math.PI);
|
|
5884
|
+
return {
|
|
5885
|
+
l: clamp(lightness, 0, 1),
|
|
5886
|
+
c: chroma,
|
|
5887
|
+
h: hue
|
|
5888
|
+
};
|
|
5889
|
+
}
|
|
5890
|
+
|
|
5891
|
+
/**
|
|
5892
|
+
* Oklch to sRGB. Out of gamut colors are clipped per channel.
|
|
5893
|
+
*/
|
|
5894
|
+
function oklchToRgb(l, c, h) {
|
|
5895
|
+
var hueRadians = normalizeHue(h) * Math.PI / 180;
|
|
5896
|
+
var a = c * Math.cos(hueRadians);
|
|
5897
|
+
var bComponent = c * Math.sin(hueRadians);
|
|
5898
|
+
var _long2 = Math.pow(l + 0.3963377774 * a + 0.2158037573 * bComponent, 3);
|
|
5899
|
+
var medium = Math.pow(l - 0.1055613458 * a - 0.0638541728 * bComponent, 3);
|
|
5900
|
+
var _short2 = Math.pow(l - 0.0894841775 * a - 1.291485548 * bComponent, 3);
|
|
5901
|
+
return {
|
|
5902
|
+
r: linearToSrgb(4.0767416621 * _long2 - 3.3077115913 * medium + 0.2309699292 * _short2),
|
|
5903
|
+
g: linearToSrgb(-1.2684380046 * _long2 + 2.6097574011 * medium - 0.3413193965 * _short2),
|
|
5904
|
+
b: linearToSrgb(-0.0041960863 * _long2 - 0.7034186147 * medium + 1.707614701 * _short2)
|
|
5905
|
+
};
|
|
5906
|
+
}
|
|
5907
|
+
|
|
5908
|
+
/**
|
|
5909
|
+
* Serializes a color to the canonical string of the given format.
|
|
5910
|
+
*
|
|
5911
|
+
* The modern, space separated CSS syntax is used for the color functions
|
|
5912
|
+
* (`rgb(255 0 0 / 0.5)`). Alpha is only included when it is not fully opaque.
|
|
5913
|
+
*/
|
|
5914
|
+
function formatColor(color, format) {
|
|
5915
|
+
var alpha = clamp(color.a, 0, 1);
|
|
5916
|
+
var alphaSuffix = alpha >= 1 ? "" : " / ".concat(round(alpha, 4));
|
|
5917
|
+
switch (format) {
|
|
5918
|
+
case "hex":
|
|
5919
|
+
{
|
|
5920
|
+
var hex = "#".concat(toHexPair(color.r)).concat(toHexPair(color.g)).concat(toHexPair(color.b));
|
|
5921
|
+
return alpha >= 1 ? hex : "".concat(hex).concat(toHexPair(alpha * 255));
|
|
5922
|
+
}
|
|
5923
|
+
case "rgb":
|
|
5924
|
+
{
|
|
5925
|
+
var r = clamp(Math.round(color.r), 0, 255);
|
|
5926
|
+
var g = clamp(Math.round(color.g), 0, 255);
|
|
5927
|
+
var b = clamp(Math.round(color.b), 0, 255);
|
|
5928
|
+
return "rgb(".concat(r, " ").concat(g, " ").concat(b).concat(alphaSuffix, ")");
|
|
5929
|
+
}
|
|
5930
|
+
case "hsl":
|
|
5931
|
+
{
|
|
5932
|
+
var _rgbToHsl = rgbToHsl(color.r, color.g, color.b),
|
|
5933
|
+
h = _rgbToHsl.h,
|
|
5934
|
+
s = _rgbToHsl.s,
|
|
5935
|
+
l = _rgbToHsl.l;
|
|
5936
|
+
return "hsl(".concat(round(h, 2), " ").concat(round(s, 2), "% ").concat(round(l, 2), "%").concat(alphaSuffix, ")");
|
|
5937
|
+
}
|
|
5938
|
+
case "oklch":
|
|
5939
|
+
{
|
|
5940
|
+
var _rgbToOklch = rgbToOklch(color.r, color.g, color.b),
|
|
5941
|
+
_l = _rgbToOklch.l,
|
|
5942
|
+
c = _rgbToOklch.c,
|
|
5943
|
+
_h = _rgbToOklch.h;
|
|
5944
|
+
return "oklch(".concat(round(_l, 4), " ").concat(round(c, 4), " ").concat(round(_h, 2)).concat(alphaSuffix, ")");
|
|
5945
|
+
}
|
|
5946
|
+
}
|
|
5947
|
+
}
|
|
5948
|
+
|
|
5949
|
+
/**
|
|
5950
|
+
* Converts a color string to the canonical string of the given format, or
|
|
5951
|
+
* `null` if the input cannot be parsed.
|
|
5952
|
+
*/
|
|
5953
|
+
function convertColor(value, format) {
|
|
5954
|
+
var parsed = parseColor(value);
|
|
5955
|
+
if (parsed === null) {
|
|
5956
|
+
return null;
|
|
5957
|
+
}
|
|
5958
|
+
return formatColor(parsed, format);
|
|
5959
|
+
}
|
|
5960
|
+
|
|
5961
|
+
/**
|
|
5962
|
+
* `#rrggbb`, which is what `<input type="color">` uses as its value.
|
|
5963
|
+
*/
|
|
5964
|
+
function colorToHex(color) {
|
|
5965
|
+
return "#".concat(toHexPair(color.r)).concat(toHexPair(color.g)).concat(toHexPair(color.b));
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5968
|
+
/**
|
|
5969
|
+
* An example of the canonical output of each format, used in error messages so
|
|
5970
|
+
* that the expected syntax is obvious from the error alone.
|
|
5971
|
+
*/
|
|
5972
|
+
var FORMAT_EXAMPLES = {
|
|
5973
|
+
hex: "#3b82f6",
|
|
5974
|
+
rgb: "rgb(59 130 246)",
|
|
5975
|
+
hsl: "hsl(217.22 91.22% 59.8%)",
|
|
5976
|
+
oklch: "oklch(0.6231 0.188 259.81)"
|
|
5977
|
+
};
|
|
5978
|
+
var ColorSchema = /*#__PURE__*/function (_Schema) {
|
|
5979
|
+
function ColorSchema(options) {
|
|
5980
|
+
var _this;
|
|
5981
|
+
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
5982
|
+
var customValidateFunctions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
5983
|
+
var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
5984
|
+
var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
5985
|
+
var description = arguments.length > 5 ? arguments[5] : undefined;
|
|
5986
|
+
_classCallCheck(this, ColorSchema);
|
|
5987
|
+
_this = _callSuper(this, ColorSchema);
|
|
5988
|
+
_this.options = options;
|
|
5989
|
+
_this.opt = opt;
|
|
5990
|
+
_this.customValidateFunctions = customValidateFunctions;
|
|
5991
|
+
_this.isReadonly = isReadonly;
|
|
5992
|
+
_this.isHidden = isHidden;
|
|
5993
|
+
_this.description = description;
|
|
5994
|
+
return _this;
|
|
5995
|
+
}
|
|
5996
|
+
_inherits(ColorSchema, _Schema);
|
|
5997
|
+
return _createClass(ColorSchema, [{
|
|
5998
|
+
key: "describe",
|
|
5999
|
+
value: function describe(description) {
|
|
6000
|
+
return new ColorSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined);
|
|
6001
|
+
}
|
|
6002
|
+
}, {
|
|
6003
|
+
key: "validate",
|
|
6004
|
+
value: function validate(validationFunction) {
|
|
6005
|
+
return new ColorSchema(this.options, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description);
|
|
6006
|
+
}
|
|
6007
|
+
}, {
|
|
6008
|
+
key: "executeCustomValidateAt",
|
|
6009
|
+
value: function executeCustomValidateAt(path, src) {
|
|
6010
|
+
return this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
|
|
6011
|
+
path: path
|
|
6012
|
+
});
|
|
6013
|
+
}
|
|
6014
|
+
}, {
|
|
6015
|
+
key: "executeValidate",
|
|
6016
|
+
value: function executeValidate(path, src) {
|
|
6017
|
+
var _this$options$format, _this$options;
|
|
6018
|
+
var errors = this.executeCustomValidateFunctions(src, this.customValidateFunctions, {
|
|
6019
|
+
path: path
|
|
6020
|
+
});
|
|
6021
|
+
if (this.opt && (src === null || src === undefined)) {
|
|
6022
|
+
return errors.length > 0 ? _defineProperty({}, path, errors) : false;
|
|
6023
|
+
}
|
|
6024
|
+
if (typeof src !== "string") {
|
|
6025
|
+
errors.push({
|
|
6026
|
+
message: "Expected 'string', got '".concat(_typeof(src), "'"),
|
|
6027
|
+
value: src
|
|
6028
|
+
});
|
|
6029
|
+
return _defineProperty({}, path, errors);
|
|
6030
|
+
}
|
|
6031
|
+
var expectedFormat = (_this$options$format = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.format) !== null && _this$options$format !== void 0 ? _this$options$format : DEFAULT_COLOR_FORMAT;
|
|
6032
|
+
var parsed = parseColor(src);
|
|
6033
|
+
if (parsed === null) {
|
|
6034
|
+
errors.push({
|
|
6035
|
+
message: "Invalid color: '".concat(src, "'. Expected a CSS color in the '").concat(expectedFormat, "' format (e.g. '").concat(FORMAT_EXAMPLES[expectedFormat], "')"),
|
|
6036
|
+
value: src
|
|
6037
|
+
});
|
|
6038
|
+
} else {
|
|
6039
|
+
var _this$options3;
|
|
6040
|
+
var actualFormat = detectColorFormat(src);
|
|
6041
|
+
if (actualFormat !== expectedFormat) {
|
|
6042
|
+
var _this$options2;
|
|
6043
|
+
// Drop alpha from the SUGGESTION when alpha is not enabled, the same way
|
|
6044
|
+
// the field's commit does. Keeping it would suggest a value that fails
|
|
6045
|
+
// the alpha check immediately below, so following the advice would not
|
|
6046
|
+
// clear the error.
|
|
6047
|
+
var suggestion = formatColor((_this$options2 = this.options) !== null && _this$options2 !== void 0 && _this$options2.alpha ? parsed : _objectSpread2(_objectSpread2({}, parsed), {}, {
|
|
6048
|
+
a: 1
|
|
6049
|
+
}), expectedFormat);
|
|
6050
|
+
errors.push({
|
|
6051
|
+
message: "Expected a color in the '".concat(expectedFormat, "' format (e.g. '").concat(FORMAT_EXAMPLES[expectedFormat], "'), got '").concat(src, "'. Did you mean '").concat(suggestion, "'?"),
|
|
6052
|
+
value: src
|
|
6053
|
+
});
|
|
6054
|
+
}
|
|
6055
|
+
if (!((_this$options3 = this.options) !== null && _this$options3 !== void 0 && _this$options3.alpha) && parsed.a < 1) {
|
|
6056
|
+
errors.push({
|
|
6057
|
+
message: "Color '".concat(src, "' has an alpha channel, but alpha is not enabled. Use s.color({ alpha: true }) to allow transparency"),
|
|
6058
|
+
value: src
|
|
6059
|
+
});
|
|
6060
|
+
}
|
|
6061
|
+
}
|
|
6062
|
+
if (errors.length > 0) {
|
|
6063
|
+
return _defineProperty({}, path, errors);
|
|
6064
|
+
}
|
|
6065
|
+
return false;
|
|
6066
|
+
}
|
|
6067
|
+
}, {
|
|
6068
|
+
key: "executeAssert",
|
|
6069
|
+
value: function executeAssert(path, src) {
|
|
6070
|
+
if (this.opt && src === null) {
|
|
6071
|
+
return {
|
|
6072
|
+
success: true,
|
|
6073
|
+
data: src
|
|
6074
|
+
};
|
|
6075
|
+
}
|
|
6076
|
+
if (src === null) {
|
|
6077
|
+
return {
|
|
6078
|
+
success: false,
|
|
6079
|
+
errors: _defineProperty({}, path, [{
|
|
6080
|
+
message: "Expected 'string', got 'null'",
|
|
6081
|
+
typeError: true
|
|
6082
|
+
}])
|
|
6083
|
+
};
|
|
6084
|
+
}
|
|
6085
|
+
if (typeof src !== "string") {
|
|
6086
|
+
return {
|
|
6087
|
+
success: false,
|
|
6088
|
+
errors: _defineProperty({}, path, [{
|
|
6089
|
+
message: "Expected 'string', got '".concat(_typeof(src), "'"),
|
|
6090
|
+
typeError: true
|
|
6091
|
+
}])
|
|
6092
|
+
};
|
|
6093
|
+
}
|
|
6094
|
+
return {
|
|
6095
|
+
success: true,
|
|
6096
|
+
data: src
|
|
6097
|
+
};
|
|
6098
|
+
}
|
|
6099
|
+
}, {
|
|
6100
|
+
key: "nullable",
|
|
6101
|
+
value: function nullable() {
|
|
6102
|
+
return new ColorSchema(this.options, true, [], this.isReadonly, this.isHidden, this.description);
|
|
6103
|
+
}
|
|
6104
|
+
}, {
|
|
6105
|
+
key: "readonly",
|
|
6106
|
+
value: function readonly() {
|
|
6107
|
+
return new ColorSchema(this.options, this.opt, this.customValidateFunctions, true, this.isHidden, this.description);
|
|
6108
|
+
}
|
|
6109
|
+
}, {
|
|
6110
|
+
key: "hidden",
|
|
6111
|
+
value: function hidden() {
|
|
6112
|
+
return new ColorSchema(this.options, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description);
|
|
6113
|
+
}
|
|
6114
|
+
}, {
|
|
6115
|
+
key: "executeSerialize",
|
|
6116
|
+
value: function executeSerialize() {
|
|
6117
|
+
var _this$customValidateF;
|
|
6118
|
+
return {
|
|
6119
|
+
type: "color",
|
|
6120
|
+
opt: this.opt,
|
|
6121
|
+
options: this.options,
|
|
6122
|
+
customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
|
|
6123
|
+
readonly: this.isReadonly,
|
|
6124
|
+
hidden: this.isHidden,
|
|
6125
|
+
description: this.description
|
|
6126
|
+
};
|
|
6127
|
+
}
|
|
6128
|
+
}, {
|
|
6129
|
+
key: "executeRender",
|
|
6130
|
+
value: function executeRender() {
|
|
6131
|
+
return {};
|
|
6132
|
+
}
|
|
6133
|
+
}]);
|
|
6134
|
+
}(Schema);
|
|
6135
|
+
var color = function color(options) {
|
|
6136
|
+
return new ColorSchema(options);
|
|
6137
|
+
};
|
|
6138
|
+
|
|
5455
6139
|
function router(router, keyOrItem, maybeItem) {
|
|
5456
6140
|
if (maybeItem) {
|
|
5457
6141
|
return new RecordSchema(maybeItem, false, [], router, keyOrItem);
|
|
@@ -5476,8 +6160,9 @@ function router(router, keyOrItem, maybeItem) {
|
|
|
5476
6160
|
/**
|
|
5477
6161
|
* Define a collection of images.
|
|
5478
6162
|
*
|
|
5479
|
-
*
|
|
5480
|
-
*
|
|
6163
|
+
* `directory` is required — it decides where uploads land, so it is not something
|
|
6164
|
+
* to be inferred. The rest defaults: any image type (`"image/*"`), nullable alt
|
|
6165
|
+
* text, remote disabled.
|
|
5481
6166
|
*
|
|
5482
6167
|
* @example
|
|
5483
6168
|
* ```typescript
|
|
@@ -5497,9 +6182,9 @@ function router(router, keyOrItem, maybeItem) {
|
|
|
5497
6182
|
* ```
|
|
5498
6183
|
*/
|
|
5499
6184
|
var images = function images(options) {
|
|
5500
|
-
var _options$
|
|
5501
|
-
var directory =
|
|
5502
|
-
var altSchema = (_options$alt = options
|
|
6185
|
+
var _options$alt, _options$accept, _options$remote;
|
|
6186
|
+
var directory = options.directory;
|
|
6187
|
+
var altSchema = (_options$alt = options.alt) !== null && _options$alt !== void 0 ? _options$alt : string().nullable();
|
|
5503
6188
|
var itemSchema = new ObjectSchema({
|
|
5504
6189
|
width: new NumberSchema(undefined, false),
|
|
5505
6190
|
height: new NumberSchema(undefined, false),
|
|
@@ -5508,9 +6193,9 @@ var images = function images(options) {
|
|
|
5508
6193
|
}, false);
|
|
5509
6194
|
return new RecordSchema(itemSchema, false, [], null, null, {
|
|
5510
6195
|
type: "images",
|
|
5511
|
-
accept: (_options$accept = options
|
|
6196
|
+
accept: (_options$accept = options.accept) !== null && _options$accept !== void 0 ? _options$accept : "image/*",
|
|
5512
6197
|
directory: directory,
|
|
5513
|
-
remote: (_options$remote = options
|
|
6198
|
+
remote: (_options$remote = options.remote) !== null && _options$remote !== void 0 ? _options$remote : false,
|
|
5514
6199
|
altSchema: altSchema
|
|
5515
6200
|
});
|
|
5516
6201
|
};
|
|
@@ -5541,6 +6226,7 @@ function initSchema() {
|
|
|
5541
6226
|
files: files,
|
|
5542
6227
|
date: date,
|
|
5543
6228
|
datetime: datetime,
|
|
6229
|
+
color: color,
|
|
5544
6230
|
route: route,
|
|
5545
6231
|
router: router,
|
|
5546
6232
|
images: images
|
|
@@ -6110,7 +6796,7 @@ function collectObjectRecursive(item, collector) {
|
|
|
6110
6796
|
* Extracts schemas and sources from a ValModules registry and computes the
|
|
6111
6797
|
* deterministic SHAs that the server and client both use to detect changes.
|
|
6112
6798
|
*
|
|
6113
|
-
* Used by ValOps on the server and by
|
|
6799
|
+
* Used by ValOps on the server and by `HostStore` on the client so the
|
|
6114
6800
|
* hash algorithm has a single source of truth.
|
|
6115
6801
|
*/
|
|
6116
6802
|
function extractValModules(_x) {
|
|
@@ -6286,6 +6972,104 @@ function _extractValModules() {
|
|
|
6286
6972
|
return _extractValModules.apply(this, arguments);
|
|
6287
6973
|
}
|
|
6288
6974
|
|
|
6975
|
+
/**
|
|
6976
|
+
* Does this schema store any file remotely?
|
|
6977
|
+
*
|
|
6978
|
+
* The one answer to that question. There used to be two — `hasRemoteFileSchema`
|
|
6979
|
+
* in the server, gating whether `/save` demands remote credentials, and
|
|
6980
|
+
* `findRequiredRemoteFiles` in the Studio, gating the `/remote/settings` fetch —
|
|
6981
|
+
* and they disagreed about `s.images({ remote: true })`: the Studio's counted a
|
|
6982
|
+
* remote media record, the server's did not, because a media collection
|
|
6983
|
+
* serializes as a `record` of metadata rather than as an image schema.
|
|
6984
|
+
*
|
|
6985
|
+
* The server's answer was the wrong one, and silently so. With it false,
|
|
6986
|
+
* `/save` runs `saveOrUploadFiles` in `skip-remote` mode, and that mode does not
|
|
6987
|
+
* merely skip the upload — it drops every remote descriptor without an error. The
|
|
6988
|
+
* commit then lands a remote ref with no bytes behind it: a broken image, in the
|
|
6989
|
+
* repository, with nothing anywhere saying why.
|
|
6990
|
+
*
|
|
6991
|
+
* ## Why it stays a walk over the SERIALIZED schema
|
|
6992
|
+
*
|
|
6993
|
+
* Both callers have a `SerializedSchema` and not a `Schema`: the server reads
|
|
6994
|
+
* them out of `getSchemas()`, and the Studio is handed them by `host.receive`.
|
|
6995
|
+
* Asking the schema classes directly would mean a method on every one of them,
|
|
6996
|
+
* and the two places that need the answer cannot call it.
|
|
6997
|
+
*
|
|
6998
|
+
* ## Throwing
|
|
6999
|
+
*
|
|
7000
|
+
* The `never` assignment at the end is the point of the default branch: adding a
|
|
7001
|
+
* schema type without teaching this function about it must not compile. The throw
|
|
7002
|
+
* is what happens if one arrives anyway — which for a caller reading schemas out
|
|
7003
|
+
* of its own process should be impossible. A caller that cannot afford to throw
|
|
7004
|
+
* (the Studio, whose whole UI is downstream of this) catches it; returning `false`
|
|
7005
|
+
* instead would reintroduce exactly the silent skip described above.
|
|
7006
|
+
*/
|
|
7007
|
+
function hasRemoteFileSchema(schema) {
|
|
7008
|
+
if (schema.type === "file" || schema.type === "image") {
|
|
7009
|
+
return !!schema.remote;
|
|
7010
|
+
} else if (schema.type === "richtext") {
|
|
7011
|
+
var _schema$options;
|
|
7012
|
+
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0 || (_schema$options = _schema$options.inline) === null || _schema$options === void 0 ? void 0 : _schema$options.img) === "object") {
|
|
7013
|
+
return hasRemoteFileSchema(schema.options.inline.img);
|
|
7014
|
+
}
|
|
7015
|
+
return false;
|
|
7016
|
+
} else if (schema.type === "array") {
|
|
7017
|
+
return hasRemoteFileSchema(schema.item);
|
|
7018
|
+
} else if (schema.type === "record") {
|
|
7019
|
+
/**
|
|
7020
|
+
* A media collection — `s.images()` / `s.files()` — is the case both of the
|
|
7021
|
+
* old functions were written around, and the one they disagreed on.
|
|
7022
|
+
*
|
|
7023
|
+
* It has no file or image schema inside it to find: `item` is an object of
|
|
7024
|
+
* width/height/mimeType/alt, and the file itself is named by the record's
|
|
7025
|
+
* KEY. So `remote` on the record is the only place the answer is written
|
|
7026
|
+
* down, and recursing into `item` can only ever say no.
|
|
7027
|
+
*/
|
|
7028
|
+
if (schema.mediaType && schema.remote) {
|
|
7029
|
+
return true;
|
|
7030
|
+
}
|
|
7031
|
+
return hasRemoteFileSchema(schema.item);
|
|
7032
|
+
} else if (schema.type === "object") {
|
|
7033
|
+
for (var key in schema.items) {
|
|
7034
|
+
var hasRemoteFile = hasRemoteFileSchema(schema.items[key]);
|
|
7035
|
+
if (hasRemoteFile) {
|
|
7036
|
+
return true;
|
|
7037
|
+
}
|
|
7038
|
+
}
|
|
7039
|
+
return false;
|
|
7040
|
+
} else if (schema.type === "union") {
|
|
7041
|
+
var unionStringSchema = _typeof(schema.key) === "object" && schema.key.type === "literal" ? schema : undefined;
|
|
7042
|
+
var unionObjectSchema = typeof schema.key === "string" ? schema : undefined;
|
|
7043
|
+
if (unionStringSchema) {
|
|
7044
|
+
// A string union's items are literals, so there is nothing to look inside.
|
|
7045
|
+
return false;
|
|
7046
|
+
}
|
|
7047
|
+
if (unionObjectSchema) {
|
|
7048
|
+
var _iterator = _createForOfIteratorHelper(unionObjectSchema.items),
|
|
7049
|
+
_step;
|
|
7050
|
+
try {
|
|
7051
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
7052
|
+
var item = _step.value;
|
|
7053
|
+
var _hasRemoteFile = hasRemoteFileSchema(item);
|
|
7054
|
+
if (_hasRemoteFile) {
|
|
7055
|
+
return true;
|
|
7056
|
+
}
|
|
7057
|
+
}
|
|
7058
|
+
} catch (err) {
|
|
7059
|
+
_iterator.e(err);
|
|
7060
|
+
} finally {
|
|
7061
|
+
_iterator.f();
|
|
7062
|
+
}
|
|
7063
|
+
}
|
|
7064
|
+
return false;
|
|
7065
|
+
} else if (schema.type === "boolean" || schema.type === "number" || schema.type === "string" || schema.type === "literal" || schema.type === "date" || schema.type === "dateTime" || schema.type === "color" || schema.type === "keyOf" || schema.type === "route") {
|
|
7066
|
+
return false;
|
|
7067
|
+
} else {
|
|
7068
|
+
var exhaustiveCheck = schema;
|
|
7069
|
+
throw new Error("Unexpected schema: ".concat(JSON.stringify(exhaustiveCheck)));
|
|
7070
|
+
}
|
|
7071
|
+
}
|
|
7072
|
+
|
|
6289
7073
|
var DEFAULT_VAL_REMOTE_HOST = "https://remote.val.build";
|
|
6290
7074
|
function convertRemoteSource(src) {
|
|
6291
7075
|
if (src !== null && src !== void 0 && src.patch_id) {
|
|
@@ -7263,6 +8047,8 @@ function deserializeSchemaImpl(serialized) {
|
|
|
7263
8047
|
return new DateSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
|
|
7264
8048
|
case "dateTime":
|
|
7265
8049
|
return new DateTimeSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
|
|
8050
|
+
case "color":
|
|
8051
|
+
return new ColorSchema(serialized.options, serialized.opt, [], false, false, serialized.description);
|
|
7266
8052
|
default:
|
|
7267
8053
|
{
|
|
7268
8054
|
var exhaustiveCheck = serialized;
|
|
@@ -7276,6 +8062,94 @@ function deserializeSchemaImpl(serialized) {
|
|
|
7276
8062
|
}
|
|
7277
8063
|
}
|
|
7278
8064
|
|
|
8065
|
+
// TODO: we want to change layout -> as to be more consistent across the board
|
|
8066
|
+
|
|
8067
|
+
// Main render type:
|
|
8068
|
+
|
|
8069
|
+
//
|
|
8070
|
+
|
|
8071
|
+
/**
|
|
8072
|
+
* Which paths a render is being computed FOR.
|
|
8073
|
+
*
|
|
8074
|
+
* `executeRender` takes a whole module, so one request has always walked every
|
|
8075
|
+
* node in it and run every `select` closure — for `handboka`, with `select` at
|
|
8076
|
+
* two nested array levels, that is every chapter and every section to serve one
|
|
8077
|
+
* visible row. A scope is what makes the walk proportional to what is being
|
|
8078
|
+
* looked at instead of to the project.
|
|
8079
|
+
*
|
|
8080
|
+
* Two questions, because a container and its items need different answers:
|
|
8081
|
+
*
|
|
8082
|
+
* - {@link RenderScope.wants} — is a render AT this exact path wanted? A
|
|
8083
|
+
* container answers `true` here when the whole of it is being shown, and its
|
|
8084
|
+
* list render is then computed in full.
|
|
8085
|
+
* - {@link RenderScope.wantsUnder} — could anything at or below this path be
|
|
8086
|
+
* wanted? Recursion is pruned where this is `false`, and a container whose own
|
|
8087
|
+
* path is not wanted but which has wanted descendants renders a WINDOW: only
|
|
8088
|
+
* the items that were asked for. That is the case a single visible row is, and
|
|
8089
|
+
* it is why {@link ListArrayRender} carries indices.
|
|
8090
|
+
*
|
|
8091
|
+
* Absent scope means the whole module, which is what every existing caller
|
|
8092
|
+
* passes and what every existing caller got.
|
|
8093
|
+
*/
|
|
8094
|
+
|
|
8095
|
+
/**
|
|
8096
|
+
* A scope covering exactly `paths` and their subtrees.
|
|
8097
|
+
*
|
|
8098
|
+
* Compares SEGMENTS rather than string prefixes. A source path's module path is
|
|
8099
|
+
* a quoted, dot-joined encoding (`?p="a".1."b"`), so `startsWith` gets the
|
|
8100
|
+
* ancestor test wrong wherever a key is a prefix of a sibling key or contains a
|
|
8101
|
+
* dot or a quote — `"title"` against `"titles"` being the cheapest example.
|
|
8102
|
+
* Segments are parsed once here, not per comparison.
|
|
8103
|
+
*/
|
|
8104
|
+
function renderScope(paths) {
|
|
8105
|
+
var wanted = paths.map(function (path) {
|
|
8106
|
+
var _splitModuleFilePathA = splitModuleFilePathAndModulePath(path),
|
|
8107
|
+
_splitModuleFilePathA2 = _slicedToArray(_splitModuleFilePathA, 2),
|
|
8108
|
+
moduleFilePath = _splitModuleFilePathA2[0],
|
|
8109
|
+
modulePath = _splitModuleFilePathA2[1];
|
|
8110
|
+
return {
|
|
8111
|
+
moduleFilePath: moduleFilePath,
|
|
8112
|
+
segments: modulePath === "" ? [] : splitModulePath(modulePath)
|
|
8113
|
+
};
|
|
8114
|
+
});
|
|
8115
|
+
var parse = function parse(path) {
|
|
8116
|
+
var _splitModuleFilePathA3 = splitModuleFilePathAndModulePath(path),
|
|
8117
|
+
_splitModuleFilePathA4 = _slicedToArray(_splitModuleFilePathA3, 2),
|
|
8118
|
+
moduleFilePath = _splitModuleFilePathA4[0],
|
|
8119
|
+
modulePath = _splitModuleFilePathA4[1];
|
|
8120
|
+
return {
|
|
8121
|
+
moduleFilePath: moduleFilePath,
|
|
8122
|
+
segments: modulePath === "" ? [] : splitModulePath(modulePath)
|
|
8123
|
+
};
|
|
8124
|
+
};
|
|
8125
|
+
var isPrefix = function isPrefix(prefix, of) {
|
|
8126
|
+
if (prefix.length > of.length) return false;
|
|
8127
|
+
for (var i = 0; i < prefix.length; i++) {
|
|
8128
|
+
if (prefix[i] !== of[i]) return false;
|
|
8129
|
+
}
|
|
8130
|
+
return true;
|
|
8131
|
+
};
|
|
8132
|
+
return {
|
|
8133
|
+
wants: function wants(path) {
|
|
8134
|
+
var at = parse(path);
|
|
8135
|
+
return wanted.some(function (entry) {
|
|
8136
|
+
return entry.moduleFilePath === at.moduleFilePath && entry.segments.length === at.segments.length && isPrefix(entry.segments, at.segments);
|
|
8137
|
+
});
|
|
8138
|
+
},
|
|
8139
|
+
wantsUnder: function wantsUnder(path) {
|
|
8140
|
+
var at = parse(path);
|
|
8141
|
+
return wanted.some(function (entry) {
|
|
8142
|
+
return entry.moduleFilePath === at.moduleFilePath && (
|
|
8143
|
+
// Either direction: a wanted path below `path` means recurse into it,
|
|
8144
|
+
// and a wanted path ABOVE it means the whole subtree was asked for.
|
|
8145
|
+
isPrefix(at.segments, entry.segments) || isPrefix(entry.segments, at.segments));
|
|
8146
|
+
});
|
|
8147
|
+
}
|
|
8148
|
+
};
|
|
8149
|
+
}
|
|
8150
|
+
|
|
8151
|
+
// TODO: improve this so that we do not get RawString and string, only string. Are there other things?
|
|
8152
|
+
|
|
7279
8153
|
var externalPageRouter = {
|
|
7280
8154
|
getRouterId: function getRouterId() {
|
|
7281
8155
|
return "external-url-router";
|
|
@@ -7549,6 +8423,13 @@ var Internal = {
|
|
|
7549
8423
|
joinModuleFilePathAndModulePath: joinModuleFilePathAndModulePath,
|
|
7550
8424
|
nextAppRouter: nextAppRouter,
|
|
7551
8425
|
externalPageRouter: externalPageRouter,
|
|
8426
|
+
color: {
|
|
8427
|
+
parseColor: parseColor,
|
|
8428
|
+
formatColor: formatColor,
|
|
8429
|
+
convertColor: convertColor,
|
|
8430
|
+
detectColorFormat: detectColorFormat,
|
|
8431
|
+
colorToHex: colorToHex
|
|
8432
|
+
},
|
|
7552
8433
|
remote: {
|
|
7553
8434
|
createRemoteRef: createRemoteRef,
|
|
7554
8435
|
getValidationBasis: getValidationBasis,
|
|
@@ -7629,4 +8510,4 @@ function tryJsonParse(str) {
|
|
|
7629
8510
|
}
|
|
7630
8511
|
}
|
|
7631
8512
|
|
|
7632
|
-
export { ArraySchema as A, BooleanSchema as B, DEFAULT_CONTENT_HOST as D, FATAL_ERROR_TYPES as F, GenericSelector as G, Internal as I, KeyOfSchema as K, LiteralSchema as L, ModuleFilePathSep as M, NumberSchema as N, ObjectSchema as O, PatchError as P, RecordSchema as R, Schema as S, UnionSchema as U, VAL_EXTENSION as V, _typeof as _, _slicedToArray as a, _createClass as b, _classCallCheck as c, _toConsumableArray as d, DEFAULT_APP_HOST as e, extractValModules as f, DEFAULT_VAL_REMOTE_HOST as g,
|
|
8513
|
+
export { ArraySchema as A, BooleanSchema as B, ColorSchema as C, DEFAULT_CONTENT_HOST as D, FATAL_ERROR_TYPES as F, GenericSelector as G, Internal as I, KeyOfSchema as K, LiteralSchema as L, ModuleFilePathSep as M, NumberSchema as N, ObjectSchema as O, PatchError as P, RecordSchema as R, Schema as S, UnionSchema as U, VAL_EXTENSION as V, _typeof as _, _slicedToArray as a, _createClass as b, _classCallCheck as c, _toConsumableArray as d, DEFAULT_APP_HOST as e, extractValModules as f, DEFAULT_VAL_REMOTE_HOST as g, hasRemoteFileSchema as h, initVal as i, FILE_REF_PROP as j, FILE_REF_SUBTYPE_TAG as k, derefPatch as l, modules as m, StringSchema as n, ImageSchema as o, FileSchema as p, DateSchema as q, COLOR_FORMATS as r, splitModuleFilePathAndModulePath as s, DEFAULT_COLOR_FORMAT as t, DateTimeSchema as u, RouteSchema as v, RichTextSchema as w, deserializeSchema as x, renderScope as y, getSourcePathFromRoute as z };
|