@valbuild/core 0.74.0 → 0.75.1

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.
@@ -54,6 +54,8 @@ export { type SerializedLiteralSchema, LiteralSchema } from "./schema/literal.js
54
54
  export { deserializeSchema } from "./schema/deserialize.js";
55
55
  export declare const FATAL_ERROR_TYPES: readonly ["no-schema", "no-source", "invalid-id", "no-module", "invalid-patch"];
56
56
  export type FatalErrorType = (typeof FATAL_ERROR_TYPES)[number];
57
+ export declare const DEFAULT_CONTENT_HOST = "https://content.val.build";
58
+ export declare const DEFAULT_APP_HOST = "https://app.val.build";
57
59
  declare const Internal: {
58
60
  VERSION: {
59
61
  core: string | null;
@@ -20,7 +20,7 @@ export type ReplaceRawStringWithString<T extends SelectorSource> = SelectorSourc
20
20
  export declare function define<T extends Schema<SelectorSource>>(id: string, // TODO: `/${string}`
21
21
  schema: T, source: ReplaceRawStringWithString<SelectorOfSchema<T>>): ValModule<SelectorOfSchema<T>>;
22
22
  export declare function getSource(valModule: ValModule<SelectorSource>): Source;
23
- export declare function splitModuleFilePathAndModulePath(path: SourcePath): [moduleId: ModuleFilePath, path: ModulePath];
23
+ export declare function splitModuleFilePathAndModulePath(path: SourcePath | ModuleFilePath): [moduleId: ModuleFilePath, path: ModulePath];
24
24
  export declare function joinModuleFilePathAndModulePath(moduleFilePath: ModuleFilePath, modulePath: ModulePath): SourcePath;
25
25
  export declare function getSourceAtPath(modulePath: ModulePath, valModule: ValModule<SelectorSource> | Source): any;
26
26
  export declare function resolvePath<Src extends ValModule<SelectorSource> | Source, Sch extends Schema<SelectorSource> | SerializedSchema>(path: ModulePath, valModule: Src, schema: Sch): {
@@ -3,6 +3,7 @@ import { FileSource } from "../source/file.js";
3
3
  import { ImageSource } from "../source/image.js";
4
4
  import { SourcePath } from "../val/index.js";
5
5
  import { ValidationErrors } from "./validation/ValidationError.js";
6
+ import { FileMetadata } from "../index.js";
6
7
  import { RemoteSource } from "../source/remote.js";
7
8
  export type ImageOptions = {
8
9
  ext?: ["jpg"] | ["webp"];
@@ -16,10 +17,9 @@ export type SerializedImageSchema = {
16
17
  opt: boolean;
17
18
  remote?: boolean;
18
19
  };
19
- export type ImageMetadata = {
20
+ export type ImageMetadata = FileMetadata & {
20
21
  width: number;
21
22
  height: number;
22
- mimeType: string;
23
23
  alt?: string;
24
24
  hotspot?: {
25
25
  x: number;
@@ -1883,6 +1883,8 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
1883
1883
  key: "serialize",
1884
1884
  value: function serialize() {
1885
1885
  var serializedOptions = {
1886
+ maxLength: this.options.maxLength,
1887
+ minLength: this.options.minLength,
1886
1888
  style: this.options.style,
1887
1889
  block: this.options.block,
1888
1890
  inline: this.options.inline && {
@@ -4076,7 +4078,7 @@ var EXT_TO_MIME_TYPES = {
4076
4078
  ssf: "application/vnd.epson.ssf",
4077
4079
  qam: "application/vnd.epson.quickanime",
4078
4080
  qfx: "application/vnd.intu.qfx",
4079
- qt: "video/quicktime",
4081
+ mov: "video/quicktime",
4080
4082
  rar: "application/x-rar-compressed",
4081
4083
  ram: "audio/x-pn-realaudio",
4082
4084
  rmp: "audio/x-pn-realaudio-plugin",
@@ -4369,6 +4371,8 @@ function deserializeSchema(serialized) {
4369
4371
 
4370
4372
  var ModuleFilePathSep = "?p=";
4371
4373
  var FATAL_ERROR_TYPES = ["no-schema", "no-source", "invalid-id", "no-module", "invalid-patch"];
4374
+ var DEFAULT_CONTENT_HOST = "https://content.val.build";
4375
+ var DEFAULT_APP_HOST = "https://app.val.build";
4372
4376
  var Internal = {
4373
4377
  VERSION: {
4374
4378
  core: function () {
@@ -4461,4 +4465,4 @@ function tryJsonParse(str) {
4461
4465
  }
4462
4466
  }
4463
4467
 
4464
- export { ArraySchema as A, BooleanSchema as B, DEFAULT_VAL_REMOTE_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, FILE_REF_PROP as e, FILE_REF_SUBTYPE_TAG as f, derefPatch as g, StringSchema as h, initVal as i, ImageSchema as j, FileSchema as k, DateSchema as l, modules as m, RichTextSchema as n, deserializeSchema as o, splitModuleFilePathAndModulePath as s };
4468
+ 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, DEFAULT_VAL_REMOTE_HOST as f, FILE_REF_PROP as g, FILE_REF_SUBTYPE_TAG as h, initVal as i, derefPatch as j, StringSchema as k, ImageSchema as l, modules as m, FileSchema as n, DateSchema as o, RichTextSchema as p, deserializeSchema as q, splitModuleFilePathAndModulePath as s };
@@ -1885,6 +1885,8 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
1885
1885
  key: "serialize",
1886
1886
  value: function serialize() {
1887
1887
  var serializedOptions = {
1888
+ maxLength: this.options.maxLength,
1889
+ minLength: this.options.minLength,
1888
1890
  style: this.options.style,
1889
1891
  block: this.options.block,
1890
1892
  inline: this.options.inline && {
@@ -4078,7 +4080,7 @@ var EXT_TO_MIME_TYPES = {
4078
4080
  ssf: "application/vnd.epson.ssf",
4079
4081
  qam: "application/vnd.epson.quickanime",
4080
4082
  qfx: "application/vnd.intu.qfx",
4081
- qt: "video/quicktime",
4083
+ mov: "video/quicktime",
4082
4084
  rar: "application/x-rar-compressed",
4083
4085
  ram: "audio/x-pn-realaudio",
4084
4086
  rmp: "audio/x-pn-realaudio-plugin",
@@ -4371,6 +4373,8 @@ function deserializeSchema(serialized) {
4371
4373
 
4372
4374
  var ModuleFilePathSep = "?p=";
4373
4375
  var FATAL_ERROR_TYPES = ["no-schema", "no-source", "invalid-id", "no-module", "invalid-patch"];
4376
+ var DEFAULT_CONTENT_HOST = "https://content.val.build";
4377
+ var DEFAULT_APP_HOST = "https://app.val.build";
4374
4378
  var Internal = {
4375
4379
  VERSION: {
4376
4380
  core: function () {
@@ -4465,6 +4469,8 @@ function tryJsonParse(str) {
4465
4469
 
4466
4470
  exports.ArraySchema = ArraySchema;
4467
4471
  exports.BooleanSchema = BooleanSchema;
4472
+ exports.DEFAULT_APP_HOST = DEFAULT_APP_HOST;
4473
+ exports.DEFAULT_CONTENT_HOST = DEFAULT_CONTENT_HOST;
4468
4474
  exports.DEFAULT_VAL_REMOTE_HOST = DEFAULT_VAL_REMOTE_HOST;
4469
4475
  exports.DateSchema = DateSchema;
4470
4476
  exports.FATAL_ERROR_TYPES = FATAL_ERROR_TYPES;
@@ -1885,6 +1885,8 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
1885
1885
  key: "serialize",
1886
1886
  value: function serialize() {
1887
1887
  var serializedOptions = {
1888
+ maxLength: this.options.maxLength,
1889
+ minLength: this.options.minLength,
1888
1890
  style: this.options.style,
1889
1891
  block: this.options.block,
1890
1892
  inline: this.options.inline && {
@@ -4078,7 +4080,7 @@ var EXT_TO_MIME_TYPES = {
4078
4080
  ssf: "application/vnd.epson.ssf",
4079
4081
  qam: "application/vnd.epson.quickanime",
4080
4082
  qfx: "application/vnd.intu.qfx",
4081
- qt: "video/quicktime",
4083
+ mov: "video/quicktime",
4082
4084
  rar: "application/x-rar-compressed",
4083
4085
  ram: "audio/x-pn-realaudio",
4084
4086
  rmp: "audio/x-pn-realaudio-plugin",
@@ -4371,6 +4373,8 @@ function deserializeSchema(serialized) {
4371
4373
 
4372
4374
  var ModuleFilePathSep = "?p=";
4373
4375
  var FATAL_ERROR_TYPES = ["no-schema", "no-source", "invalid-id", "no-module", "invalid-patch"];
4376
+ var DEFAULT_CONTENT_HOST = "https://content.val.build";
4377
+ var DEFAULT_APP_HOST = "https://app.val.build";
4374
4378
  var Internal = {
4375
4379
  VERSION: {
4376
4380
  core: function () {
@@ -4465,6 +4469,8 @@ function tryJsonParse(str) {
4465
4469
 
4466
4470
  exports.ArraySchema = ArraySchema;
4467
4471
  exports.BooleanSchema = BooleanSchema;
4472
+ exports.DEFAULT_APP_HOST = DEFAULT_APP_HOST;
4473
+ exports.DEFAULT_CONTENT_HOST = DEFAULT_CONTENT_HOST;
4468
4474
  exports.DEFAULT_VAL_REMOTE_HOST = DEFAULT_VAL_REMOTE_HOST;
4469
4475
  exports.DateSchema = DateSchema;
4470
4476
  exports.FATAL_ERROR_TYPES = FATAL_ERROR_TYPES;
@@ -2,13 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('./index-f6fd3df3.cjs.dev.js');
5
+ var dist_valbuildCore = require('./index-b1932ca0.cjs.dev.js');
6
6
  require('./result-bb1f436e.cjs.dev.js');
7
7
 
8
8
 
9
9
 
10
10
  exports.ArraySchema = dist_valbuildCore.ArraySchema;
11
11
  exports.BooleanSchema = dist_valbuildCore.BooleanSchema;
12
+ exports.DEFAULT_APP_HOST = dist_valbuildCore.DEFAULT_APP_HOST;
13
+ exports.DEFAULT_CONTENT_HOST = dist_valbuildCore.DEFAULT_CONTENT_HOST;
12
14
  exports.DEFAULT_VAL_REMOTE_HOST = dist_valbuildCore.DEFAULT_VAL_REMOTE_HOST;
13
15
  exports.DateSchema = dist_valbuildCore.DateSchema;
14
16
  exports.FATAL_ERROR_TYPES = dist_valbuildCore.FATAL_ERROR_TYPES;
@@ -2,13 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('./index-da9933cf.cjs.prod.js');
5
+ var dist_valbuildCore = require('./index-b141017e.cjs.prod.js');
6
6
  require('./result-787e35f6.cjs.prod.js');
7
7
 
8
8
 
9
9
 
10
10
  exports.ArraySchema = dist_valbuildCore.ArraySchema;
11
11
  exports.BooleanSchema = dist_valbuildCore.BooleanSchema;
12
+ exports.DEFAULT_APP_HOST = dist_valbuildCore.DEFAULT_APP_HOST;
13
+ exports.DEFAULT_CONTENT_HOST = dist_valbuildCore.DEFAULT_CONTENT_HOST;
12
14
  exports.DEFAULT_VAL_REMOTE_HOST = dist_valbuildCore.DEFAULT_VAL_REMOTE_HOST;
13
15
  exports.DateSchema = dist_valbuildCore.DateSchema;
14
16
  exports.FATAL_ERROR_TYPES = dist_valbuildCore.FATAL_ERROR_TYPES;
@@ -1,2 +1,2 @@
1
- export { A as ArraySchema, B as BooleanSchema, D as DEFAULT_VAL_REMOTE_HOST, l as DateSchema, F as FATAL_ERROR_TYPES, e as FILE_REF_PROP, f as FILE_REF_SUBTYPE_TAG, k as FileSchema, G as GenericSelector, j as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, n as RichTextSchema, S as Schema, h as StringSchema, U as UnionSchema, V as VAL_EXTENSION, g as derefPatch, o as deserializeSchema, i as initVal, m as modules } from './index-fee3aa6d.esm.js';
1
+ export { A as ArraySchema, B as BooleanSchema, e as DEFAULT_APP_HOST, D as DEFAULT_CONTENT_HOST, f as DEFAULT_VAL_REMOTE_HOST, o as DateSchema, F as FATAL_ERROR_TYPES, g as FILE_REF_PROP, h as FILE_REF_SUBTYPE_TAG, n as FileSchema, G as GenericSelector, l as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, p as RichTextSchema, S as Schema, k as StringSchema, U as UnionSchema, V as VAL_EXTENSION, j as derefPatch, q as deserializeSchema, i as initVal, m as modules } from './index-1c1fec05.esm.js';
2
2
  import './result-daff1cae.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/core",
3
- "version": "0.74.0",
3
+ "version": "0.75.1",
4
4
  "private": false,
5
5
  "description": "Val - supercharged hard-coded content",
6
6
  "scripts": {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('../../dist/index-f6fd3df3.cjs.dev.js');
5
+ var dist_valbuildCore = require('../../dist/index-b1932ca0.cjs.dev.js');
6
6
  var result = require('../../dist/result-bb1f436e.cjs.dev.js');
7
7
  var util = require('../../dist/util-b213092b.cjs.dev.js');
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var dist_valbuildCore = require('../../dist/index-da9933cf.cjs.prod.js');
5
+ var dist_valbuildCore = require('../../dist/index-b141017e.cjs.prod.js');
6
6
  var result = require('../../dist/result-787e35f6.cjs.prod.js');
7
7
  var util = require('../../dist/util-030d8a1f.cjs.prod.js');
8
8
 
@@ -1,5 +1,5 @@
1
- import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-fee3aa6d.esm.js';
2
- export { P as PatchError } from '../../dist/index-fee3aa6d.esm.js';
1
+ import { _ as _typeof, a as _slicedToArray, P as PatchError, s as splitModuleFilePathAndModulePath, b as _createClass, c as _classCallCheck, d as _toConsumableArray } from '../../dist/index-1c1fec05.esm.js';
2
+ export { P as PatchError } from '../../dist/index-1c1fec05.esm.js';
3
3
  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-daff1cae.esm.js';
4
4
  import { p as pipe } from '../../dist/util-18613e99.esm.js';
5
5