@valbuild/core 0.53.0 → 0.54.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.
@@ -1,5 +1,5 @@
1
1
  export { initVal } from "./initVal.js";
2
- export type { InitVal, ValConfig, ValConstructor } from "./initVal.js";
2
+ export type { InitVal, ValConfig, ValConstructor, ContentConstructor, } from "./initVal.js";
3
3
  export { Schema, type SerializedSchema, type SelectorOfSchema } from "./schema/index.js";
4
4
  export type { ImageMetadata } from "./schema/image.js";
5
5
  export type { FileMetadata } from "./schema/file.js";
@@ -9,6 +9,7 @@ export type { SourceObject, SourcePrimitive, Source } from "./source/index.js";
9
9
  export type { FileSource } from "./source/file.js";
10
10
  export type { RawString } from "./schema/string.js";
11
11
  export type { ImageSource } from "./source/image.js";
12
+ export { RT_IMAGE_TAG } from "./source/richtext.js";
12
13
  export type { AnyRichTextOptions, Bold, Classes, HeadingNode, ImageNode, Italic, LineThrough, ListItemNode, LinkNode, OrderedListNode, ParagraphNode, BrNode, RichText, RichTextNode, RichTextOptions, RichTextSource, RootNode, SpanNode, UnorderedListNode, } from "./source/richtext.js";
13
14
  export { type Val, type SerializedVal, type ModuleId, type ModulePath, type SourcePath, type JsonOfSource, } from "./val/index.js";
14
15
  export type { Json, JsonPrimitive, JsonArray, JsonObject } from "./Json.js";
@@ -16,7 +17,7 @@ export type { ValidationError, ValidationErrors, } from "./schema/validation/Val
16
17
  import type { ValidationErrors } from "./schema/validation/ValidationError.js";
17
18
  export type { ValidationFix } from "./schema/validation/ValidationFix.js";
18
19
  export * as expr from "./expr/index.js";
19
- export { FILE_REF_PROP } from "./source/file.js";
20
+ export { FILE_REF_PROP, FILE_REF_SUBTYPE_TAG } from "./source/file.js";
20
21
  export { VAL_EXTENSION, type SourceArray } from "./source/index.js";
21
22
  export { derefPatch } from "./patch/deref.js";
22
23
  export { type SelectorSource, type SelectorOf, GenericSelector, } from "./selector/index.js";
@@ -1,16 +1,21 @@
1
- import { content } from "./module.js";
1
+ import { define } from "./module.js";
2
2
  import { InitSchema } from "./initSchema.js";
3
3
  import { getValPath as getPath } from "./val/index.js";
4
4
  import { file } from "./source/file.js";
5
5
  import { richtext } from "./source/richtext.js";
6
6
  import { link } from "./source/link.js";
7
- export type ValConstructor = {
8
- content: typeof content;
9
- getPath: typeof getPath;
7
+ export type ContentConstructor = {
8
+ define: typeof define;
10
9
  file: typeof file;
11
- link: typeof link;
10
+ rt: {
11
+ image: typeof file;
12
+ link: typeof link;
13
+ };
12
14
  richtext: typeof richtext;
13
15
  };
16
+ export type ValConstructor = {
17
+ getPath: typeof getPath;
18
+ };
14
19
  export type ValConfig = {
15
20
  valCloud?: string;
16
21
  gitCommit?: string;
@@ -18,6 +23,7 @@ export type ValConfig = {
18
23
  valConfigPath?: string;
19
24
  };
20
25
  export type InitVal = {
26
+ c: ContentConstructor;
21
27
  val: ValConstructor;
22
28
  s: InitSchema;
23
29
  config: ValConfig;
@@ -17,7 +17,8 @@ type ReplaceRawStringWithString<T extends SelectorSource> = SelectorSource exten
17
17
  } ? {
18
18
  [key in keyof T]: ReplaceRawStringWithString<T[key]>;
19
19
  } : T extends SelectorSource[] ? ReplaceRawStringWithString<T[number]>[] : T;
20
- export declare function content<T extends Schema<SelectorSource>>(id: string, schema: T, source: ReplaceRawStringWithString<SelectorOfSchema<T>>): ValModule<SelectorOfSchema<T>>;
20
+ export declare function define<T extends Schema<SelectorSource>>(id: string, // TODO: `/${string}`
21
+ schema: T, source: ReplaceRawStringWithString<SelectorOfSchema<T>>): ValModule<SelectorOfSchema<T>>;
21
22
  export declare function getSource(valModule: ValModule<SelectorSource>): Source;
22
23
  export declare function splitModuleIdAndModulePath(path: SourcePath): [moduleId: ModuleId, path: ModulePath];
23
24
  export declare function getSourceAtPath(modulePath: ModulePath, valModule: ValModule<SelectorSource> | Source): any;
@@ -1,6 +1,7 @@
1
1
  import { VAL_EXTENSION } from "./index.js";
2
2
  import { Json } from "../Json.js";
3
3
  export declare const FILE_REF_PROP: "_ref";
4
+ export declare const FILE_REF_SUBTYPE_TAG: "_tag";
4
5
  export type FileMetadata = {
5
6
  readonly [key: string]: Json;
6
7
  };
@@ -13,6 +14,7 @@ export type FileMetadata = {
13
14
  export type FileSource<Metadata extends FileMetadata | undefined = FileMetadata | undefined> = {
14
15
  readonly [FILE_REF_PROP]: string;
15
16
  readonly [VAL_EXTENSION]: "file";
17
+ readonly [FILE_REF_SUBTYPE_TAG]?: string;
16
18
  readonly metadata?: Metadata;
17
19
  };
18
20
  export declare function file<Metadata extends {
@@ -1,6 +1,8 @@
1
1
  import { VAL_EXTENSION } from "./index.js";
2
2
  import { LinkSource } from "./link.js";
3
3
  import { ImageSource } from "./image.js";
4
+ import { ImageMetadata } from "../schema/image.js";
5
+ import { FileSource } from "./file.js";
4
6
  export type RichTextOptions = {
5
7
  headings?: ("h1" | "h2" | "h3" | "h4" | "h5" | "h6")[];
6
8
  img?: boolean;
@@ -90,4 +92,7 @@ export type RichText<O extends RichTextOptions> = {
90
92
  children: RootNode<O>[];
91
93
  };
92
94
  export declare function richtext<O extends RichTextOptions>(templateStrings: TemplateStringsArray, ...nodes: (ImageSource | LinkSource)[]): RichTextSource<O>;
95
+ export declare const RT_IMAGE_TAG = "rt_image";
96
+ export type RTImageMetadata = ImageMetadata;
97
+ export declare function image(ref: `/public/${string}`, metadata?: RTImageMetadata): FileSource<RTImageMetadata>;
93
98
  export {};
@@ -397,6 +397,7 @@ var VAL_EXTENSION = "_type";
397
397
  **/
398
398
 
399
399
  var FILE_REF_PROP = "_ref";
400
+ var FILE_REF_SUBTYPE_TAG = "_tag";
400
401
 
401
402
  /**
402
403
  * A file source represents the path to a (local) file.
@@ -540,6 +541,7 @@ function getValPath(valOrSelector) {
540
541
  exports.Call = Call;
541
542
  exports.Expr = Expr;
542
543
  exports.FILE_REF_PROP = FILE_REF_PROP;
544
+ exports.FILE_REF_SUBTYPE_TAG = FILE_REF_SUBTYPE_TAG;
543
545
  exports.FileSchema = FileSchema;
544
546
  exports.GenericSelector = GenericSelector;
545
547
  exports.GetSchema = GetSchema;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$1 = require('./index-0391a11a.cjs.prod.js');
3
+ var index$1 = require('./index-0c2d9420.cjs.prod.js');
4
4
  var result = require('./result-26f67b40.cjs.prod.js');
5
5
 
6
6
  var WHITE_SPACE = ["\n", "\r", "\t", " "];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index$1 = require('./index-b14b0d9c.cjs.dev.js');
3
+ var index$1 = require('./index-ae994fd0.cjs.dev.js');
4
4
  var result = require('./result-48320acd.cjs.dev.js');
5
5
 
6
6
  var WHITE_SPACE = ["\n", "\r", "\t", " "];
@@ -397,6 +397,7 @@ var VAL_EXTENSION = "_type";
397
397
  **/
398
398
 
399
399
  var FILE_REF_PROP = "_ref";
400
+ var FILE_REF_SUBTYPE_TAG = "_tag";
400
401
 
401
402
  /**
402
403
  * A file source represents the path to a (local) file.
@@ -540,6 +541,7 @@ function getValPath(valOrSelector) {
540
541
  exports.Call = Call;
541
542
  exports.Expr = Expr;
542
543
  exports.FILE_REF_PROP = FILE_REF_PROP;
544
+ exports.FILE_REF_SUBTYPE_TAG = FILE_REF_SUBTYPE_TAG;
543
545
  exports.FileSchema = FileSchema;
544
546
  exports.GenericSelector = GenericSelector;
545
547
  exports.GetSchema = GetSchema;
@@ -395,6 +395,7 @@ var VAL_EXTENSION = "_type";
395
395
  **/
396
396
 
397
397
  var FILE_REF_PROP = "_ref";
398
+ var FILE_REF_SUBTYPE_TAG = "_tag";
398
399
 
399
400
  /**
400
401
  * A file source represents the path to a (local) file.
@@ -535,4 +536,4 @@ function getValPath(valOrSelector) {
535
536
  return valOrSelector[Path];
536
537
  }
537
538
 
538
- export { Call as C, Expr as E, FILE_REF_PROP as F, GetSchema as G, NilSym as N, Path as P, Schema as S, VAL_EXTENSION as V, _inherits as _, _classCallCheck as a, _callSuper as b, _createClass as c, _defineProperty as d, _typeof as e, file as f, getValPath as g, file$1 as h, _slicedToArray as i, isFile as j, GetSource as k, isSerializedVal as l, convertFileSource as m, getSchema as n, isVal as o, GenericSelector as p, FileSchema as q, _objectSpread2 as r, Sym as s, StringLiteral as t, StringTemplate as u, _toConsumableArray as v };
539
+ export { Call as C, Expr as E, FILE_REF_PROP as F, GetSchema as G, NilSym as N, Path as P, Schema as S, VAL_EXTENSION as V, _inherits as _, _classCallCheck as a, _callSuper as b, _createClass as c, _defineProperty as d, _typeof as e, file as f, getValPath as g, FILE_REF_SUBTYPE_TAG as h, file$1 as i, _slicedToArray as j, isFile as k, GetSource as l, isSerializedVal as m, convertFileSource as n, getSchema as o, isVal as p, GenericSelector as q, FileSchema as r, _objectSpread2 as s, Sym as t, StringLiteral as u, StringTemplate as v, _toConsumableArray as w };
@@ -1,4 +1,4 @@
1
- import { r as _objectSpread2, i as _slicedToArray, c as _createClass, a as _classCallCheck, s as Sym, C as Call, t as StringLiteral, u as StringTemplate, e as _typeof, l as isSerializedVal, F as FILE_REF_PROP, V as VAL_EXTENSION, m as convertFileSource, d as _defineProperty, E as Expr, S as Schema, v as _toConsumableArray, N as NilSym } from './index-a038a0f3.esm.js';
1
+ import { s as _objectSpread2, j as _slicedToArray, c as _createClass, a as _classCallCheck, t as Sym, C as Call, u as StringLiteral, v as StringTemplate, e as _typeof, m as isSerializedVal, F as FILE_REF_PROP, V as VAL_EXTENSION, n as convertFileSource, d as _defineProperty, E as Expr, S as Schema, w as _toConsumableArray, N as NilSym } from './index-b88673ad.esm.js';
2
2
  import { i as isErr, e as err, o as ok, a as isOk } from './result-b96df128.esm.js';
3
3
 
4
4
  var WHITE_SPACE = ["\n", "\r", "\t", " "];
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-b14b0d9c.cjs.dev.js');
3
+ var index = require('./index-ae994fd0.cjs.dev.js');
4
4
  var result = require('./result-48320acd.cjs.dev.js');
5
5
 
6
6
  function hasOwn(obj, prop) {
@@ -790,9 +790,10 @@ var record = function record(schema) {
790
790
  return new RecordSchema(schema);
791
791
  };
792
792
 
793
- function content(
793
+ function define(
794
794
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
795
795
  id,
796
+ // TODO: `/${string}`
796
797
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
797
798
  schema,
798
799
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1050,8 +1051,8 @@ exports.RecordSchema = RecordSchema;
1050
1051
  exports.RichTextSchema = RichTextSchema;
1051
1052
  exports.UnionSchema = UnionSchema;
1052
1053
  exports.array = array;
1053
- exports.content = content;
1054
1054
  exports.createValPathOfItem = createValPathOfItem;
1055
+ exports.define = define;
1055
1056
  exports.getSource = getSource;
1056
1057
  exports.image = image;
1057
1058
  exports.isSelector = isSelector;
@@ -1,4 +1,4 @@
1
- import { e as _typeof, l as isSerializedVal, F as FILE_REF_PROP, V as VAL_EXTENSION, m as convertFileSource, d as _defineProperty, G as GetSchema, k as GetSource, E as Expr, P as Path, S as Schema, _ as _inherits, a as _classCallCheck, b as _callSuper, c as _createClass, i as _slicedToArray, r as _objectSpread2, v as _toConsumableArray } from './index-a038a0f3.esm.js';
1
+ import { e as _typeof, m as isSerializedVal, F as FILE_REF_PROP, V as VAL_EXTENSION, n as convertFileSource, d as _defineProperty, G as GetSchema, l as GetSource, E as Expr, P as Path, S as Schema, _ as _inherits, a as _classCallCheck, b as _callSuper, c as _createClass, j as _slicedToArray, s as _objectSpread2, w as _toConsumableArray } from './index-b88673ad.esm.js';
2
2
  import { _ as _createForOfIteratorHelper } from './result-b96df128.esm.js';
3
3
 
4
4
  function hasOwn(obj, prop) {
@@ -788,9 +788,10 @@ var record = function record(schema) {
788
788
  return new RecordSchema(schema);
789
789
  };
790
790
 
791
- function content(
791
+ function define(
792
792
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
793
793
  id,
794
+ // TODO: `/${string}`
794
795
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
795
796
  schema,
796
797
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1039,4 +1040,4 @@ var PatchError = /*#__PURE__*/_createClass(function PatchError(message) {
1039
1040
  * NOTE: MAY mutate the input document.
1040
1041
  */
1041
1042
 
1042
- export { ArraySchema as A, ImageSchema as I, LiteralSchema as L, ObjectSchema as O, PatchError as P, RecordSchema as R, UnionSchema as U, array as a, record as b, content as c, createValPathOfItem as d, isSelector as e, resolvePath as f, getSource as g, RichTextSchema as h, image as i, literal as l, newSelectorProxy as n, object as o, richtext as r, splitModuleIdAndModulePath as s, union as u };
1043
+ export { ArraySchema as A, ImageSchema as I, LiteralSchema as L, ObjectSchema as O, PatchError as P, RecordSchema as R, UnionSchema as U, array as a, record as b, createValPathOfItem as c, define as d, isSelector as e, resolvePath as f, getSource as g, RichTextSchema as h, image as i, literal as l, newSelectorProxy as n, object as o, richtext as r, splitModuleIdAndModulePath as s, union as u };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-0391a11a.cjs.prod.js');
3
+ var index = require('./index-0c2d9420.cjs.prod.js');
4
4
  var result = require('./result-26f67b40.cjs.prod.js');
5
5
 
6
6
  function hasOwn(obj, prop) {
@@ -790,9 +790,10 @@ var record = function record(schema) {
790
790
  return new RecordSchema(schema);
791
791
  };
792
792
 
793
- function content(
793
+ function define(
794
794
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
795
795
  id,
796
+ // TODO: `/${string}`
796
797
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
797
798
  schema,
798
799
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -1050,8 +1051,8 @@ exports.RecordSchema = RecordSchema;
1050
1051
  exports.RichTextSchema = RichTextSchema;
1051
1052
  exports.UnionSchema = UnionSchema;
1052
1053
  exports.array = array;
1053
- exports.content = content;
1054
1054
  exports.createValPathOfItem = createValPathOfItem;
1055
+ exports.define = define;
1055
1056
  exports.getSource = getSource;
1056
1057
  exports.image = image;
1057
1058
  exports.isSelector = isSelector;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ops = require('./ops-2b3f01fb.cjs.dev.js');
6
- var index = require('./index-b14b0d9c.cjs.dev.js');
7
- var expr_dist_valbuildCoreExpr = require('./index-f66c449e.cjs.dev.js');
5
+ var ops = require('./ops-36bf1f3c.cjs.dev.js');
6
+ var index = require('./index-ae994fd0.cjs.dev.js');
7
+ var expr_dist_valbuildCoreExpr = require('./index-99afbd0b.cjs.dev.js');
8
8
  var result = require('./result-48320acd.cjs.dev.js');
9
9
 
10
10
  var NumberSchema = /*#__PURE__*/function (_Schema) {
@@ -396,6 +396,10 @@ function richtext(templateStrings) {
396
396
  }
397
397
  return index._defineProperty(index._defineProperty(index._defineProperty({}, index.VAL_EXTENSION, "richtext"), "templateStrings", templateStrings), "exprs", nodes);
398
398
  }
399
+ var RT_IMAGE_TAG = "rt_image";
400
+ function image(ref, metadata) {
401
+ return index._defineProperty(index._defineProperty(index._defineProperty(index._defineProperty({}, index.FILE_REF_PROP, ref), index.FILE_REF_SUBTYPE_TAG, RT_IMAGE_TAG), index.VAL_EXTENSION, "file"), "metadata", metadata);
402
+ }
399
403
 
400
404
  function link(text, _ref) {
401
405
  var href = _ref.href;
@@ -435,12 +439,17 @@ var initVal = function initVal() {
435
439
  // }
436
440
  return {
437
441
  val: {
438
- content: ops.content,
442
+ getPath: index.getValPath
443
+ },
444
+ c: {
445
+ define: ops.define,
439
446
  // remote,
440
- getPath: index.getValPath,
441
447
  file: index.file$1,
442
448
  richtext: richtext,
443
- link: link
449
+ rt: {
450
+ image: image,
451
+ link: link
452
+ }
444
453
  },
445
454
  s: s,
446
455
  config: {}
@@ -1588,6 +1597,7 @@ exports.RecordSchema = ops.RecordSchema;
1588
1597
  exports.RichTextSchema = ops.RichTextSchema;
1589
1598
  exports.UnionSchema = ops.UnionSchema;
1590
1599
  exports.FILE_REF_PROP = index.FILE_REF_PROP;
1600
+ exports.FILE_REF_SUBTYPE_TAG = index.FILE_REF_SUBTYPE_TAG;
1591
1601
  exports.FileSchema = index.FileSchema;
1592
1602
  exports.GenericSelector = index.GenericSelector;
1593
1603
  exports.Schema = index.Schema;
@@ -1596,6 +1606,7 @@ exports.expr = expr_dist_valbuildCoreExpr.index;
1596
1606
  exports.BooleanSchema = BooleanSchema;
1597
1607
  exports.Internal = Internal;
1598
1608
  exports.NumberSchema = NumberSchema;
1609
+ exports.RT_IMAGE_TAG = RT_IMAGE_TAG;
1599
1610
  exports.StringSchema = StringSchema;
1600
1611
  exports.ValApi = ValApi;
1601
1612
  exports.derefPatch = derefPatch;
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ops = require('./ops-cff2b7c2.cjs.prod.js');
6
- var index = require('./index-0391a11a.cjs.prod.js');
7
- var expr_dist_valbuildCoreExpr = require('./index-df01e42d.cjs.prod.js');
5
+ var ops = require('./ops-cdc83cb6.cjs.prod.js');
6
+ var index = require('./index-0c2d9420.cjs.prod.js');
7
+ var expr_dist_valbuildCoreExpr = require('./index-5afcc749.cjs.prod.js');
8
8
  var result = require('./result-26f67b40.cjs.prod.js');
9
9
 
10
10
  var NumberSchema = /*#__PURE__*/function (_Schema) {
@@ -396,6 +396,10 @@ function richtext(templateStrings) {
396
396
  }
397
397
  return index._defineProperty(index._defineProperty(index._defineProperty({}, index.VAL_EXTENSION, "richtext"), "templateStrings", templateStrings), "exprs", nodes);
398
398
  }
399
+ var RT_IMAGE_TAG = "rt_image";
400
+ function image(ref, metadata) {
401
+ return index._defineProperty(index._defineProperty(index._defineProperty(index._defineProperty({}, index.FILE_REF_PROP, ref), index.FILE_REF_SUBTYPE_TAG, RT_IMAGE_TAG), index.VAL_EXTENSION, "file"), "metadata", metadata);
402
+ }
399
403
 
400
404
  function link(text, _ref) {
401
405
  var href = _ref.href;
@@ -435,12 +439,17 @@ var initVal = function initVal() {
435
439
  // }
436
440
  return {
437
441
  val: {
438
- content: ops.content,
442
+ getPath: index.getValPath
443
+ },
444
+ c: {
445
+ define: ops.define,
439
446
  // remote,
440
- getPath: index.getValPath,
441
447
  file: index.file$1,
442
448
  richtext: richtext,
443
- link: link
449
+ rt: {
450
+ image: image,
451
+ link: link
452
+ }
444
453
  },
445
454
  s: s,
446
455
  config: {}
@@ -1588,6 +1597,7 @@ exports.RecordSchema = ops.RecordSchema;
1588
1597
  exports.RichTextSchema = ops.RichTextSchema;
1589
1598
  exports.UnionSchema = ops.UnionSchema;
1590
1599
  exports.FILE_REF_PROP = index.FILE_REF_PROP;
1600
+ exports.FILE_REF_SUBTYPE_TAG = index.FILE_REF_SUBTYPE_TAG;
1591
1601
  exports.FileSchema = index.FileSchema;
1592
1602
  exports.GenericSelector = index.GenericSelector;
1593
1603
  exports.Schema = index.Schema;
@@ -1596,6 +1606,7 @@ exports.expr = expr_dist_valbuildCoreExpr.index;
1596
1606
  exports.BooleanSchema = BooleanSchema;
1597
1607
  exports.Internal = Internal;
1598
1608
  exports.NumberSchema = NumberSchema;
1609
+ exports.RT_IMAGE_TAG = RT_IMAGE_TAG;
1599
1610
  exports.StringSchema = StringSchema;
1600
1611
  exports.ValApi = ValApi;
1601
1612
  exports.derefPatch = derefPatch;
@@ -1,8 +1,8 @@
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';
1
+ import { a as array, o as object, u as union, r as richtext$1, i as image$1, l as literal, b as record, d as define, P as PatchError, n as newSelectorProxy, c as createValPathOfItem, e as isSelector, g as getSource, f as resolvePath, s as splitModuleIdAndModulePath } from './ops-a042c33f.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-a042c33f.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, F as FILE_REF_PROP, h as FILE_REF_SUBTYPE_TAG, i as file$1, j as _slicedToArray, k as isFile, P as Path, l as GetSource, m as isSerializedVal, n as convertFileSource, o as getSchema, p as isVal } from './index-b88673ad.esm.js';
4
+ export { F as FILE_REF_PROP, h as FILE_REF_SUBTYPE_TAG, r as FileSchema, q as GenericSelector, S as Schema, V as VAL_EXTENSION } from './index-b88673ad.esm.js';
5
+ export { i as expr } from './index-cdc3515c.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) {
@@ -350,7 +350,7 @@ function initSchema() {
350
350
  union: union,
351
351
  // oneOf,
352
352
  richtext: richtext$1,
353
- image: image,
353
+ image: image$1,
354
354
  literal: literal,
355
355
  keyOf: keyOf,
356
356
  record: record,
@@ -394,6 +394,10 @@ function richtext(templateStrings) {
394
394
  }
395
395
  return _defineProperty(_defineProperty(_defineProperty({}, VAL_EXTENSION, "richtext"), "templateStrings", templateStrings), "exprs", nodes);
396
396
  }
397
+ var RT_IMAGE_TAG = "rt_image";
398
+ function image(ref, metadata) {
399
+ return _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, FILE_REF_PROP, ref), FILE_REF_SUBTYPE_TAG, RT_IMAGE_TAG), VAL_EXTENSION, "file"), "metadata", metadata);
400
+ }
397
401
 
398
402
  function link(text, _ref) {
399
403
  var href = _ref.href;
@@ -433,12 +437,17 @@ var initVal = function initVal() {
433
437
  // }
434
438
  return {
435
439
  val: {
436
- content: content,
440
+ getPath: getValPath
441
+ },
442
+ c: {
443
+ define: define,
437
444
  // remote,
438
- getPath: getValPath,
439
445
  file: file$1,
440
446
  richtext: richtext,
441
- link: link
447
+ rt: {
448
+ image: image,
449
+ link: link
450
+ }
442
451
  },
443
452
  s: s,
444
453
  config: {}
@@ -1578,4 +1587,4 @@ function tryJsonParse(str) {
1578
1587
  }
1579
1588
  }
1580
1589
 
1581
- export { BooleanSchema, Internal, NumberSchema, StringSchema, ValApi, derefPatch, initVal };
1590
+ export { BooleanSchema, Internal, NumberSchema, RT_IMAGE_TAG, StringSchema, ValApi, derefPatch, initVal };
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var expr_dist_valbuildCoreExpr = require('../../dist/index-f66c449e.cjs.dev.js');
6
- var index = require('../../dist/index-b14b0d9c.cjs.dev.js');
5
+ var expr_dist_valbuildCoreExpr = require('../../dist/index-99afbd0b.cjs.dev.js');
6
+ var index = require('../../dist/index-ae994fd0.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-df01e42d.cjs.prod.js');
6
- var index = require('../../dist/index-0391a11a.cjs.prod.js');
5
+ var expr_dist_valbuildCoreExpr = require('../../dist/index-5afcc749.cjs.prod.js');
6
+ var index = require('../../dist/index-0c2d9420.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-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';
1
+ export { e as evaluate, p as parse } from '../../dist/index-cdc3515c.esm.js';
2
+ export { C as Call, E as Expr, N as NilSym, u as StringLiteral, v as StringTemplate, t as Sym } from '../../dist/index-b88673ad.esm.js';
3
3
  import '../../dist/result-b96df128.esm.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valbuild/core",
3
- "version": "0.53.0",
3
+ "version": "0.54.0",
4
4
  "private": false,
5
5
  "description": "Val - supercharged hard-coded content",
6
6
  "scripts": {
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var index = require('../../dist/index-b14b0d9c.cjs.dev.js');
5
+ var index = require('../../dist/index-ae994fd0.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-2b3f01fb.cjs.dev.js');
8
+ var ops = require('../../dist/ops-36bf1f3c.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-0391a11a.cjs.prod.js');
5
+ var index = require('../../dist/index-0c2d9420.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-cff2b7c2.cjs.prod.js');
8
+ var ops = require('../../dist/ops-cdc83cb6.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, i as _slicedToArray, c as _createClass, a as _classCallCheck, v as _toConsumableArray } from '../../dist/index-a038a0f3.esm.js';
1
+ import { e as _typeof, j as _slicedToArray, c as _createClass, a as _classCallCheck, w as _toConsumableArray } from '../../dist/index-b88673ad.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-2029f7c3.esm.js';
5
- export { P as PatchError } from '../../dist/ops-2029f7c3.esm.js';
4
+ import { P as PatchError, s as splitModuleIdAndModulePath } from '../../dist/ops-a042c33f.esm.js';
5
+ export { P as PatchError } from '../../dist/ops-a042c33f.esm.js';
6
6
 
7
7
  function isNotRoot(path) {
8
8
  return isNonEmpty(path);