@valbuild/core 0.48.1 → 0.50.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/index.d.ts +4 -0
- package/dist/declarations/src/initSchema.d.ts +3 -0
- package/dist/declarations/src/schema/file.d.ts +23 -0
- package/dist/declarations/src/schema/index.d.ts +2 -1
- package/dist/declarations/src/schema/richtext.d.ts +2 -1
- package/dist/declarations/src/schema/validation/ValidationFix.d.ts +1 -1
- package/dist/declarations/src/selector/SelectorProxy.d.ts +2 -2
- package/dist/declarations/src/source/richtext.d.ts +1 -1
- package/dist/{index-7b467ee6.cjs.prod.js → index-0391a11a.cjs.prod.js} +133 -71
- package/dist/{index-799bcf49.esm.js → index-14edbcc8.esm.js} +1 -1
- package/dist/{index-5750c299.esm.js → index-a038a0f3.esm.js} +131 -71
- package/dist/{index-d23e237a.cjs.dev.js → index-b14b0d9c.cjs.dev.js} +133 -71
- package/dist/{index-db60fc1d.cjs.prod.js → index-df01e42d.cjs.prod.js} +1 -1
- package/dist/{index-00276955.cjs.dev.js → index-f66c449e.cjs.dev.js} +1 -1
- package/dist/{ops-ffed3406.esm.js → ops-2029f7c3.esm.js} +11 -17
- package/dist/{ops-74e62ffe.cjs.dev.js → ops-2b3f01fb.cjs.dev.js} +11 -17
- package/dist/{ops-c0e7e3a8.cjs.prod.js → ops-cff2b7c2.cjs.prod.js} +11 -17
- package/dist/valbuild-core.cjs.dev.js +18 -13
- package/dist/valbuild-core.cjs.prod.js +18 -13
- package/dist/valbuild-core.esm.js +19 -15
- package/expr/dist/valbuild-core-expr.cjs.dev.js +2 -2
- package/expr/dist/valbuild-core-expr.cjs.prod.js +2 -2
- package/expr/dist/valbuild-core-expr.esm.js +2 -2
- package/package.json +1 -1
- package/patch/dist/valbuild-core-patch.cjs.dev.js +2 -2
- package/patch/dist/valbuild-core-patch.cjs.prod.js +2 -2
- package/patch/dist/valbuild-core-patch.esm.js +3 -3
@@ -1,18 +1,17 @@
|
|
1
|
-
import { a as array, o as object, u as union, r as richtext$1, i as image, l as literal, b as record, c as content, P as PatchError, n as newSelectorProxy, d as createValPathOfItem, e as isSelector, g as getSource, f as resolvePath, s as splitModuleIdAndModulePath } from './ops-
|
2
|
-
export { A as ArraySchema, I as ImageSchema, L as LiteralSchema, O as ObjectSchema, R as RecordSchema, h as RichTextSchema, U as UnionSchema } from './ops-
|
3
|
-
import { _ as _inherits, a as
|
4
|
-
export { F as FILE_REF_PROP,
|
5
|
-
export { i as expr } from './index-
|
1
|
+
import { a as array, o as object, u as union, r as richtext$1, i as image, l as literal, b as record, c as content, P as PatchError, n as newSelectorProxy, d as createValPathOfItem, e as isSelector, g as getSource, f as resolvePath, s as splitModuleIdAndModulePath } from './ops-2029f7c3.esm.js';
|
2
|
+
export { A as ArraySchema, I as ImageSchema, L as LiteralSchema, O as ObjectSchema, R as RecordSchema, h as RichTextSchema, U as UnionSchema } from './ops-2029f7c3.esm.js';
|
3
|
+
import { _ as _inherits, a as _classCallCheck, b as _callSuper, c as _createClass, d as _defineProperty, e as _typeof, S as Schema, G as GetSchema, g as getValPath, f as file, V as VAL_EXTENSION, h as file$1, i as _slicedToArray, j as isFile, F as FILE_REF_PROP, P as Path, k as GetSource, l as isSerializedVal, m as convertFileSource, n as getSchema, o as isVal } from './index-a038a0f3.esm.js';
|
4
|
+
export { F as FILE_REF_PROP, q as FileSchema, p as GenericSelector, S as Schema, V as VAL_EXTENSION } from './index-a038a0f3.esm.js';
|
5
|
+
export { i as expr } from './index-14edbcc8.esm.js';
|
6
6
|
import { _ as _createForOfIteratorHelper, i as isErr, a as isOk, e as err, o as ok, r as result } from './result-b96df128.esm.js';
|
7
7
|
|
8
8
|
var NumberSchema = /*#__PURE__*/function (_Schema) {
|
9
9
|
_inherits(NumberSchema, _Schema);
|
10
|
-
var _super = _createSuper(NumberSchema);
|
11
10
|
function NumberSchema(options) {
|
12
11
|
var _this;
|
13
12
|
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
14
13
|
_classCallCheck(this, NumberSchema);
|
15
|
-
_this =
|
14
|
+
_this = _callSuper(this, NumberSchema);
|
16
15
|
_this.options = options;
|
17
16
|
_this.opt = opt;
|
18
17
|
return _this;
|
@@ -62,13 +61,12 @@ var number = function number(options) {
|
|
62
61
|
|
63
62
|
var StringSchema = /*#__PURE__*/function (_Schema) {
|
64
63
|
_inherits(StringSchema, _Schema);
|
65
|
-
var _super = _createSuper(StringSchema);
|
66
64
|
function StringSchema(options) {
|
67
65
|
var _this;
|
68
66
|
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
69
67
|
var isRaw = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
70
68
|
_classCallCheck(this, StringSchema);
|
71
|
-
_this =
|
69
|
+
_this = _callSuper(this, StringSchema);
|
72
70
|
_this.options = options;
|
73
71
|
_this.opt = opt;
|
74
72
|
_this.isRaw = isRaw;
|
@@ -156,12 +154,11 @@ var string = function string(options) {
|
|
156
154
|
|
157
155
|
var BooleanSchema = /*#__PURE__*/function (_Schema) {
|
158
156
|
_inherits(BooleanSchema, _Schema);
|
159
|
-
var _super = _createSuper(BooleanSchema);
|
160
157
|
function BooleanSchema() {
|
161
158
|
var _this;
|
162
159
|
var opt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
163
160
|
_classCallCheck(this, BooleanSchema);
|
164
|
-
_this =
|
161
|
+
_this = _callSuper(this, BooleanSchema);
|
165
162
|
_this.opt = opt;
|
166
163
|
return _this;
|
167
164
|
}
|
@@ -209,12 +206,11 @@ var _boolean = function _boolean() {
|
|
209
206
|
|
210
207
|
var KeyOfSchema = /*#__PURE__*/function (_Schema) {
|
211
208
|
_inherits(KeyOfSchema, _Schema);
|
212
|
-
var _super = _createSuper(KeyOfSchema);
|
213
209
|
function KeyOfSchema(selector) {
|
214
210
|
var _this;
|
215
211
|
var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
216
212
|
_classCallCheck(this, KeyOfSchema);
|
217
|
-
_this =
|
213
|
+
_this = _callSuper(this, KeyOfSchema);
|
218
214
|
_this.selector = selector;
|
219
215
|
_this.opt = opt;
|
220
216
|
return _this;
|
@@ -339,6 +335,7 @@ var keyOf = function keyOf(valModule) {
|
|
339
335
|
// import type { F } from "ts-toolbelt";
|
340
336
|
// import { i18n, I18n } from "./schema/future/i18n";
|
341
337
|
// import { oneOf } from "./schema/future/oneOf";
|
338
|
+
|
342
339
|
// export type InitSchemaLocalized<Locales extends readonly string[]> = {
|
343
340
|
// readonly i18n: I18n<Locales>;
|
344
341
|
// };
|
@@ -356,7 +353,8 @@ function initSchema() {
|
|
356
353
|
image: image,
|
357
354
|
literal: literal,
|
358
355
|
keyOf: keyOf,
|
359
|
-
record: record
|
356
|
+
record: record,
|
357
|
+
file: file
|
360
358
|
// i18n: i18n(locales),
|
361
359
|
};
|
362
360
|
}
|
@@ -380,13 +378,16 @@ function initSchema() {
|
|
380
378
|
/// Root and nodes
|
381
379
|
|
382
380
|
/// Main types
|
381
|
+
|
383
382
|
/**
|
384
383
|
* RichTextSource is defined in ValModules
|
385
384
|
**/
|
385
|
+
|
386
386
|
/**
|
387
387
|
* RichText is accessible by users (after conversion via useVal / fetchVal)
|
388
388
|
* Internally it is a Selector
|
389
389
|
**/
|
390
|
+
|
390
391
|
function richtext(templateStrings) {
|
391
392
|
for (var _len = arguments.length, nodes = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
392
393
|
nodes[_key - 1] = arguments[_key];
|
@@ -402,12 +403,14 @@ function link(text, _ref) {
|
|
402
403
|
/* eslint-disable @typescript-eslint/ban-types */
|
403
404
|
// import { i18n, I18n } from "./source/future/i18n";
|
404
405
|
// import { remote } from "./source/future/remote";
|
406
|
+
|
405
407
|
// type NarrowStrings<A> =
|
406
408
|
// | (A extends [] ? [] : never)
|
407
409
|
// | (A extends string ? A : never)
|
408
410
|
// | {
|
409
411
|
// [K in keyof A]: NarrowStrings<A[K]>;
|
410
412
|
// };
|
413
|
+
|
411
414
|
// TODO: Rename to createValSystem (only to be used by internal things), we can then export * from '@valbuild/core' in the next package then.
|
412
415
|
var initVal = function initVal() {
|
413
416
|
// const locales = options?.locales;
|
@@ -433,7 +436,7 @@ var initVal = function initVal() {
|
|
433
436
|
content: content,
|
434
437
|
// remote,
|
435
438
|
getPath: getValPath,
|
436
|
-
file: file,
|
439
|
+
file: file$1,
|
437
440
|
richtext: richtext,
|
438
441
|
link: link
|
439
442
|
},
|
@@ -1557,6 +1560,7 @@ var Internal = {
|
|
1557
1560
|
isVal: isVal,
|
1558
1561
|
createValPathOfItem: createValPathOfItem,
|
1559
1562
|
getSHA256Hash: getSHA256Hash,
|
1563
|
+
initSchema: initSchema,
|
1560
1564
|
createPatchJSONPath: function createPatchJSONPath(modulePath) {
|
1561
1565
|
return "/".concat(modulePath.split(".").map(function (segment) {
|
1562
1566
|
return segment && tryJsonParse(segment);
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var expr_dist_valbuildCoreExpr = require('../../dist/index-
|
6
|
-
var index = require('../../dist/index-
|
5
|
+
var expr_dist_valbuildCoreExpr = require('../../dist/index-f66c449e.cjs.dev.js');
|
6
|
+
var index = require('../../dist/index-b14b0d9c.cjs.dev.js');
|
7
7
|
require('../../dist/result-48320acd.cjs.dev.js');
|
8
8
|
|
9
9
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var expr_dist_valbuildCoreExpr = require('../../dist/index-
|
6
|
-
var index = require('../../dist/index-
|
5
|
+
var expr_dist_valbuildCoreExpr = require('../../dist/index-df01e42d.cjs.prod.js');
|
6
|
+
var index = require('../../dist/index-0391a11a.cjs.prod.js');
|
7
7
|
require('../../dist/result-26f67b40.cjs.prod.js');
|
8
8
|
|
9
9
|
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { e as evaluate, p as parse } from '../../dist/index-
|
2
|
-
export { C as Call, E as Expr, N as NilSym,
|
1
|
+
export { e as evaluate, p as parse } from '../../dist/index-14edbcc8.esm.js';
|
2
|
+
export { C as Call, E as Expr, N as NilSym, t as StringLiteral, u as StringTemplate, s as Sym } from '../../dist/index-a038a0f3.esm.js';
|
3
3
|
import '../../dist/result-b96df128.esm.js';
|
package/package.json
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var index = require('../../dist/index-
|
5
|
+
var index = require('../../dist/index-b14b0d9c.cjs.dev.js');
|
6
6
|
var result = require('../../dist/result-48320acd.cjs.dev.js');
|
7
7
|
var util = require('../../dist/util-b213092b.cjs.dev.js');
|
8
|
-
var ops = require('../../dist/ops-
|
8
|
+
var ops = require('../../dist/ops-2b3f01fb.cjs.dev.js');
|
9
9
|
|
10
10
|
function isNotRoot(path) {
|
11
11
|
return result.isNonEmpty(path);
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var index = require('../../dist/index-
|
5
|
+
var index = require('../../dist/index-0391a11a.cjs.prod.js');
|
6
6
|
var result = require('../../dist/result-26f67b40.cjs.prod.js');
|
7
7
|
var util = require('../../dist/util-030d8a1f.cjs.prod.js');
|
8
|
-
var ops = require('../../dist/ops-
|
8
|
+
var ops = require('../../dist/ops-cff2b7c2.cjs.prod.js');
|
9
9
|
|
10
10
|
function isNotRoot(path) {
|
11
11
|
return result.isNonEmpty(path);
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import { e as _typeof,
|
1
|
+
import { e as _typeof, i as _slicedToArray, c as _createClass, a as _classCallCheck, v as _toConsumableArray } from '../../dist/index-a038a0f3.esm.js';
|
2
2
|
import { f as isNonEmpty, e as err, o as ok, m as map, g as flatMap, i as isErr, h as flatMapReduce, j as filterOrElse, k as mapErr, l as map$1, n as all, p as flatten, q as allT } from '../../dist/result-b96df128.esm.js';
|
3
3
|
import { p as pipe } from '../../dist/util-18613e99.esm.js';
|
4
|
-
import { P as PatchError, s as splitModuleIdAndModulePath } from '../../dist/ops-
|
5
|
-
export { P as PatchError } from '../../dist/ops-
|
4
|
+
import { P as PatchError, s as splitModuleIdAndModulePath } from '../../dist/ops-2029f7c3.esm.js';
|
5
|
+
export { P as PatchError } from '../../dist/ops-2029f7c3.esm.js';
|
6
6
|
|
7
7
|
function isNotRoot(path) {
|
8
8
|
return isNonEmpty(path);
|