@valbuild/core 0.117.0 → 0.120.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/CHANGELOG.md +41 -0
- package/dist/declarations/src/schema/richtext.d.ts +1 -1
- package/dist/declarations/src/source/richtext.d.ts +57 -67
- package/dist/{index-0ba5047e.cjs.dev.js → index-01f673d2.cjs.dev.js} +47 -52
- package/dist/{index-b8004eea.esm.js → index-2f65e194.esm.js} +47 -52
- package/dist/{index-941877c6.cjs.prod.js → index-861944d8.cjs.prod.js} +47 -52
- package/dist/valbuild-core.cjs.dev.js +1 -1
- package/dist/valbuild-core.cjs.prod.js +1 -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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @valbuild/core
|
|
2
2
|
|
|
3
|
+
## 0.120.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#589](https://github.com/valbuild/val/pull/589) [`c2d3c0e`](https://github.com/valbuild/val/commit/c2d3c0e6c2010c0a94c725d9dbaa618998773e8a) Thanks [@freekh](https://github.com/freekh)! - **Breaking:** `s.richtext()` options are flat.
|
|
8
|
+
|
|
9
|
+
The `style`, `block` and `inline` groups are gone — every option is a key of its
|
|
10
|
+
own. The names are unchanged, so updating a schema is only a matter of removing
|
|
11
|
+
the wrappers:
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
// before
|
|
15
|
+
s.richtext({
|
|
16
|
+
style: { bold: true, italic: true },
|
|
17
|
+
block: { h1: true, ul: true },
|
|
18
|
+
inline: { a: true, img: s.image() },
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
// after
|
|
22
|
+
s.richtext({
|
|
23
|
+
bold: true,
|
|
24
|
+
italic: true,
|
|
25
|
+
h1: true,
|
|
26
|
+
ul: true,
|
|
27
|
+
a: true,
|
|
28
|
+
img: s.image(),
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The groups never carried any meaning the option names did not already have, and
|
|
33
|
+
they cost something real: an option name and its `ValRichText` theme key were
|
|
34
|
+
spelled differently (`block.h1` vs `theme.h1`), so the type that keeps a theme
|
|
35
|
+
exhaustive had to restate all thirteen options by hand. It is now a mapped type
|
|
36
|
+
over the options themselves — which also fixes an inconsistency in it: enabling
|
|
37
|
+
links with a schema (`a: s.route()`) rather than `a: true` now requires an `a`
|
|
38
|
+
key in the theme, the way `img` always has.
|
|
39
|
+
|
|
40
|
+
`ValRichText` themes were already flat and are unchanged. The serialized schema
|
|
41
|
+
that the server sends the Studio is flat too, so a project must not mix
|
|
42
|
+
`@valbuild/*` versions across this release.
|
|
43
|
+
|
|
3
44
|
## 0.117.0
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
|
@@ -15,7 +15,7 @@ export type SerializedRichTextSchema = {
|
|
|
15
15
|
/** Set when this schema declares a `preview`. The closure itself cannot serialize. */
|
|
16
16
|
preview?: true;
|
|
17
17
|
opt: boolean;
|
|
18
|
-
options?: SerializedRichTextOptions
|
|
18
|
+
options?: SerializedRichTextOptions;
|
|
19
19
|
customValidate?: boolean;
|
|
20
20
|
readonly?: boolean;
|
|
21
21
|
hidden?: boolean;
|
|
@@ -3,71 +3,60 @@ import { RouteSchema, SerializedRouteSchema } from "../schema/route.js";
|
|
|
3
3
|
import { StringSchema, SerializedStringSchema } from "../schema/string.js";
|
|
4
4
|
import { ImageSource } from "./media.js";
|
|
5
5
|
export type RichTextOptions = Partial<{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
ol: boolean;
|
|
20
|
-
}>;
|
|
21
|
-
inline: Partial<{
|
|
22
|
-
a: boolean | RouteSchema<string> | StringSchema<string>;
|
|
23
|
-
img: boolean | ImageSchema<ImageSource>;
|
|
24
|
-
}>;
|
|
6
|
+
bold: boolean;
|
|
7
|
+
italic: boolean;
|
|
8
|
+
lineThrough: boolean;
|
|
9
|
+
h1: boolean;
|
|
10
|
+
h2: boolean;
|
|
11
|
+
h3: boolean;
|
|
12
|
+
h4: boolean;
|
|
13
|
+
h5: boolean;
|
|
14
|
+
h6: boolean;
|
|
15
|
+
ul: boolean;
|
|
16
|
+
ol: boolean;
|
|
17
|
+
a: boolean | RouteSchema<string> | StringSchema<string>;
|
|
18
|
+
img: boolean | ImageSchema<ImageSource>;
|
|
25
19
|
}>;
|
|
26
20
|
export type SerializedRichTextOptions = Partial<{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
21
|
+
/**
|
|
22
|
+
* `.maxLength()` / `.minLength()` are not authored in the options argument,
|
|
23
|
+
* but they serialize into the same object - so the wire type has to name
|
|
24
|
+
* them, or a parser that strips unknown keys drops them in transit.
|
|
25
|
+
*/
|
|
26
|
+
maxLength: number;
|
|
27
|
+
minLength: number;
|
|
28
|
+
bold: boolean;
|
|
29
|
+
italic: boolean;
|
|
30
|
+
lineThrough: boolean;
|
|
31
|
+
h1: boolean;
|
|
32
|
+
h2: boolean;
|
|
33
|
+
h3: boolean;
|
|
34
|
+
h4: boolean;
|
|
35
|
+
h5: boolean;
|
|
36
|
+
h6: boolean;
|
|
37
|
+
ul: boolean;
|
|
38
|
+
ol: boolean;
|
|
39
|
+
a: boolean | SerializedRouteSchema | SerializedStringSchema;
|
|
40
|
+
img: boolean | SerializedImageSchema;
|
|
46
41
|
}>;
|
|
47
42
|
export type AllRichTextOptions = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ol: true;
|
|
62
|
-
};
|
|
63
|
-
inline: {
|
|
64
|
-
a: true;
|
|
65
|
-
img: true;
|
|
66
|
-
};
|
|
43
|
+
bold: true;
|
|
44
|
+
italic: true;
|
|
45
|
+
lineThrough: true;
|
|
46
|
+
h1: true;
|
|
47
|
+
h2: true;
|
|
48
|
+
h3: true;
|
|
49
|
+
h4: true;
|
|
50
|
+
h5: true;
|
|
51
|
+
h6: true;
|
|
52
|
+
ul: true;
|
|
53
|
+
ol: true;
|
|
54
|
+
a: true;
|
|
55
|
+
img: true;
|
|
67
56
|
};
|
|
68
|
-
export type LineThrough<O extends RichTextOptions> =
|
|
69
|
-
export type Italic<O extends RichTextOptions> =
|
|
70
|
-
export type Bold<O extends RichTextOptions> =
|
|
57
|
+
export type LineThrough<O extends RichTextOptions> = O["lineThrough"] extends true ? "line-through" : never;
|
|
58
|
+
export type Italic<O extends RichTextOptions> = O["italic"] extends true ? "italic" : never;
|
|
59
|
+
export type Bold<O extends RichTextOptions> = O["bold"] extends true ? "bold" : never;
|
|
71
60
|
export type Styles<O extends RichTextOptions> = LineThrough<O> | Italic<O> | Bold<O>;
|
|
72
61
|
export type GenericRichTextSourceNode = {
|
|
73
62
|
tag: string;
|
|
@@ -88,10 +77,10 @@ export type SpanNode<O extends RichTextOptions> = {
|
|
|
88
77
|
styles: Styles<O>[];
|
|
89
78
|
children: [string];
|
|
90
79
|
};
|
|
91
|
-
export type ImageNode<O extends RichTextOptions> =
|
|
80
|
+
export type ImageNode<O extends RichTextOptions> = O["img"] extends true ? {
|
|
92
81
|
tag: "img";
|
|
93
82
|
src: ImageSource;
|
|
94
|
-
} :
|
|
83
|
+
} : O["img"] extends ImageSchema<infer Src> ? Src extends ImageSource ? {
|
|
95
84
|
tag: "img";
|
|
96
85
|
src: Src;
|
|
97
86
|
} : never : never;
|
|
@@ -100,21 +89,22 @@ type LinkTagNode<O extends RichTextOptions> = {
|
|
|
100
89
|
href: string;
|
|
101
90
|
children: (string | SpanNode<O> | ImageNode<O> | CustomInlineNode<O>)[];
|
|
102
91
|
};
|
|
103
|
-
export type LinkNode<O extends RichTextOptions> =
|
|
92
|
+
export type LinkNode<O extends RichTextOptions> = O["a"] extends true ? LinkTagNode<O> : O["a"] extends RouteSchema<string> | StringSchema<string> ? LinkTagNode<O> : never;
|
|
104
93
|
type ListItemTagNode<O extends RichTextOptions> = {
|
|
105
94
|
tag: "li";
|
|
106
95
|
children: (ParagraphNode<O> | UnorderedListNode<O> | OrderedListNode<O>)[];
|
|
107
96
|
};
|
|
108
|
-
export type ListItemNode<O extends RichTextOptions> =
|
|
109
|
-
export type UnorderedListNode<O extends RichTextOptions> =
|
|
97
|
+
export type ListItemNode<O extends RichTextOptions> = O["ul"] extends true ? ListItemTagNode<O> : O["ol"] extends true ? ListItemTagNode<O> : never;
|
|
98
|
+
export type UnorderedListNode<O extends RichTextOptions> = O["ul"] extends true ? {
|
|
110
99
|
tag: "ul";
|
|
111
100
|
children: ListItemNode<O>[];
|
|
112
101
|
} : never;
|
|
113
|
-
export type OrderedListNode<O extends RichTextOptions> =
|
|
102
|
+
export type OrderedListNode<O extends RichTextOptions> = O["ol"] extends true ? {
|
|
114
103
|
tag: "ol";
|
|
115
104
|
children: ListItemNode<O>[];
|
|
116
105
|
} : never;
|
|
117
|
-
export type
|
|
106
|
+
export type HeadingTag = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
107
|
+
export type HeadingTagOf<S extends HeadingTag, O extends RichTextOptions> = O[S] extends true ? {
|
|
118
108
|
tag: S;
|
|
119
109
|
children: (string | SpanNode<O> | CustomInlineNode<O> | LinkNode<O> | BrNode | ImageNode<O>)[];
|
|
120
110
|
} : never;
|
|
@@ -3553,7 +3553,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3553
3553
|
_step;
|
|
3554
3554
|
try {
|
|
3555
3555
|
var _loop = function _loop() {
|
|
3556
|
-
var _this2$options$block, _this2$options$block2, _this2$options$block3, _this2$options$block4, _this2$options$block5, _this2$options$block6, _this2$options$block7, _this2$options$block8, _this2$options$block9, _this2$options$block0;
|
|
3557
3556
|
var node = _step.value;
|
|
3558
3557
|
var path = unsafeCreateSourcePath(rootPath, nodes.indexOf(node));
|
|
3559
3558
|
if (typeof node === "string") {
|
|
@@ -3596,39 +3595,37 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3596
3595
|
if (!supportedTags.includes(node.tag)) {
|
|
3597
3596
|
addError(path, "Tag '".concat(node.tag, "' is not supported. Supported tags: ").concat(supportedTags.join(", ")), true);
|
|
3598
3597
|
}
|
|
3599
|
-
if (node.tag === "h1" && !
|
|
3600
|
-
addError(path, "'
|
|
3598
|
+
if (node.tag === "h1" && !_this2.options.h1) {
|
|
3599
|
+
addError(path, "'h1' block is not valid", false);
|
|
3601
3600
|
}
|
|
3602
|
-
if (node.tag === "h2" && !
|
|
3601
|
+
if (node.tag === "h2" && !_this2.options.h2) {
|
|
3603
3602
|
addError(path, "'h2' block is not valid", false);
|
|
3604
3603
|
}
|
|
3605
|
-
if (node.tag === "h3" && !
|
|
3604
|
+
if (node.tag === "h3" && !_this2.options.h3) {
|
|
3606
3605
|
addError(path, "'h3' block is not valid", false);
|
|
3607
3606
|
}
|
|
3608
|
-
if (node.tag === "h4" && !
|
|
3607
|
+
if (node.tag === "h4" && !_this2.options.h4) {
|
|
3609
3608
|
addError(path, "'h4' block is not valid", false);
|
|
3610
3609
|
}
|
|
3611
|
-
if (node.tag === "h5" && !
|
|
3610
|
+
if (node.tag === "h5" && !_this2.options.h5) {
|
|
3612
3611
|
addError(path, "'h5' block is not valid", false);
|
|
3613
3612
|
}
|
|
3614
|
-
if (node.tag === "h6" && !
|
|
3613
|
+
if (node.tag === "h6" && !_this2.options.h6) {
|
|
3615
3614
|
addError(path, "'h6' block is not valid", false);
|
|
3616
3615
|
}
|
|
3617
|
-
if (node.tag === "ol" && !
|
|
3616
|
+
if (node.tag === "ol" && !_this2.options.ol) {
|
|
3618
3617
|
addError(path, "'ol' block is not valid", false);
|
|
3619
3618
|
}
|
|
3620
|
-
if (node.tag === "ul" && !
|
|
3619
|
+
if (node.tag === "ul" && !_this2.options.ul) {
|
|
3621
3620
|
addError(path, "'ul' block is not valid", false);
|
|
3622
3621
|
}
|
|
3623
|
-
if (node.tag === "li" && !
|
|
3624
|
-
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is
|
|
3622
|
+
if (node.tag === "li" && !_this2.options.ul && !_this2.options.ol) {
|
|
3623
|
+
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is valid", false);
|
|
3625
3624
|
}
|
|
3626
3625
|
if (node.tag === "a") {
|
|
3627
|
-
|
|
3628
|
-
if (!((_this2$options$inline = _this2.options.inline) !== null && _this2$options$inline !== void 0 && _this2$options$inline.a)) {
|
|
3626
|
+
if (!_this2.options.a) {
|
|
3629
3627
|
addError(path, "'a' inline is not valid", false);
|
|
3630
|
-
} else if (
|
|
3631
|
-
var _this2$options$inline3;
|
|
3628
|
+
} else if (_this2.options.a) {
|
|
3632
3629
|
if (!("href" in node)) {
|
|
3633
3630
|
return {
|
|
3634
3631
|
v: _defineProperty({}, path, [{
|
|
@@ -3638,7 +3635,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3638
3635
|
};
|
|
3639
3636
|
}
|
|
3640
3637
|
var hrefPath = unsafeCreateSourcePath(path, "href");
|
|
3641
|
-
var hrefSchema = typeof
|
|
3638
|
+
var hrefSchema = typeof _this2.options.a === "boolean" ? new RouteSchema() : _this2.options.a;
|
|
3642
3639
|
var executeValidate = function executeValidate() {
|
|
3643
3640
|
if (hrefSchema instanceof RouteSchema) {
|
|
3644
3641
|
return hrefSchema["executeValidate"](hrefPath, node.href);
|
|
@@ -3664,11 +3661,9 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3664
3661
|
}
|
|
3665
3662
|
}
|
|
3666
3663
|
if (node.tag === "img") {
|
|
3667
|
-
|
|
3668
|
-
if (!((_this2$options$inline4 = _this2.options.inline) !== null && _this2$options$inline4 !== void 0 && _this2$options$inline4.img)) {
|
|
3664
|
+
if (!_this2.options.img) {
|
|
3669
3665
|
addError(path, "'img' inline is not valid", false);
|
|
3670
|
-
} else if (
|
|
3671
|
-
var _this2$options$inline6;
|
|
3666
|
+
} else if (_this2.options.img) {
|
|
3672
3667
|
if (!("src" in node)) {
|
|
3673
3668
|
return {
|
|
3674
3669
|
v: _defineProperty({}, path, [{
|
|
@@ -3678,7 +3673,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3678
3673
|
};
|
|
3679
3674
|
}
|
|
3680
3675
|
var srcPath = unsafeCreateSourcePath(path, "src");
|
|
3681
|
-
var imgSchema =
|
|
3676
|
+
var imgSchema = _this2.options.img;
|
|
3682
3677
|
var imageValidationErrors = _typeof(imgSchema) === "object" ? imgSchema["executeValidate"](srcPath, node.src) : new ImageSchema({}, false, false)["executeValidate"](srcPath, node.src);
|
|
3683
3678
|
if (imageValidationErrors) {
|
|
3684
3679
|
for (var _validationErrorPathS in imageValidationErrors) {
|
|
@@ -3711,7 +3706,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3711
3706
|
}
|
|
3712
3707
|
var stylesPath = unsafeCreateSourcePath(path, "styles");
|
|
3713
3708
|
for (var i = 0; i < node.styles.length; i++) {
|
|
3714
|
-
var _this2$options$style, _this2$options$style2, _this2$options$style3;
|
|
3715
3709
|
var style = node.styles[i];
|
|
3716
3710
|
var currentStylePath = unsafeCreateSourcePath(stylesPath, i);
|
|
3717
3711
|
if (typeof style !== "string") {
|
|
@@ -3722,13 +3716,13 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3722
3716
|
}])
|
|
3723
3717
|
};
|
|
3724
3718
|
}
|
|
3725
|
-
if (style === "bold" && !
|
|
3719
|
+
if (style === "bold" && !_this2.options.bold) {
|
|
3726
3720
|
addError(currentStylePath, "Style 'bold' is not valid", false);
|
|
3727
3721
|
}
|
|
3728
|
-
if (style === "italic" && !
|
|
3722
|
+
if (style === "italic" && !_this2.options.italic) {
|
|
3729
3723
|
addError(currentStylePath, "Style 'italic' is not valid", false);
|
|
3730
3724
|
}
|
|
3731
|
-
if (style === "lineThrough" && !
|
|
3725
|
+
if (style === "lineThrough" && !_this2.options.lineThrough) {
|
|
3732
3726
|
addError(currentStylePath, "Style 'lineThrough' is not valid", false);
|
|
3733
3727
|
}
|
|
3734
3728
|
}
|
|
@@ -4014,27 +4008,30 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
4014
4008
|
_this$renderInput,
|
|
4015
4009
|
_this$customValidateF;
|
|
4016
4010
|
var serializeAnchorSchema = function serializeAnchorSchema() {
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
return
|
|
4021
|
-
} else if (((_this3$options$inline3 = _this3.options.inline) === null || _this3$options$inline3 === void 0 ? void 0 : _this3$options$inline3.a) instanceof StringSchema) {
|
|
4022
|
-
var _this3$options$inline4;
|
|
4023
|
-
return (_this3$options$inline4 = _this3.options.inline) === null || _this3$options$inline4 === void 0 ? void 0 : _this3$options$inline4.a["executeSerialize"]();
|
|
4011
|
+
if (_this3.options.a instanceof RouteSchema) {
|
|
4012
|
+
return _this3.options.a["executeSerialize"]();
|
|
4013
|
+
} else if (_this3.options.a instanceof StringSchema) {
|
|
4014
|
+
return _this3.options.a["executeSerialize"]();
|
|
4024
4015
|
} else {
|
|
4025
|
-
|
|
4026
|
-
return (_this3$options$inline5 = _this3.options.inline) === null || _this3$options$inline5 === void 0 ? void 0 : _this3$options$inline5.a;
|
|
4016
|
+
return _this3.options.a;
|
|
4027
4017
|
}
|
|
4028
4018
|
};
|
|
4029
4019
|
var serializedOptions = {
|
|
4030
4020
|
maxLength: this.options.maxLength,
|
|
4031
4021
|
minLength: this.options.minLength,
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4022
|
+
bold: this.options.bold,
|
|
4023
|
+
italic: this.options.italic,
|
|
4024
|
+
lineThrough: this.options.lineThrough,
|
|
4025
|
+
h1: this.options.h1,
|
|
4026
|
+
h2: this.options.h2,
|
|
4027
|
+
h3: this.options.h3,
|
|
4028
|
+
h4: this.options.h4,
|
|
4029
|
+
h5: this.options.h5,
|
|
4030
|
+
h6: this.options.h6,
|
|
4031
|
+
ul: this.options.ul,
|
|
4032
|
+
ol: this.options.ol,
|
|
4033
|
+
a: serializeAnchorSchema(),
|
|
4034
|
+
img: this.options.img && _typeof(this.options.img) === "object" ? this.options.img["executeSerialize"]() : this.options.img
|
|
4038
4035
|
};
|
|
4039
4036
|
return {
|
|
4040
4037
|
type: "richtext",
|
|
@@ -5241,11 +5238,11 @@ function resolvePath(path, valModule, schema) {
|
|
|
5241
5238
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5242
5239
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5243
5240
|
var _resolvedSchema$optio, _resolvedSchema$optio2;
|
|
5244
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 &&
|
|
5241
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 && _resolvedSchema$optio.img && typeof ((_resolvedSchema$optio2 = resolvedSchema["options"]) === null || _resolvedSchema$optio2 === void 0 ? void 0 : _resolvedSchema$optio2.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5245
5242
|
}
|
|
5246
5243
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5247
5244
|
var _resolvedSchema$optio3, _resolvedSchema$optio4;
|
|
5248
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 &&
|
|
5245
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 && _resolvedSchema$optio3.a && typeof ((_resolvedSchema$optio4 = resolvedSchema["options"]) === null || _resolvedSchema$optio4 === void 0 ? void 0 : _resolvedSchema$optio4.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5249
5246
|
}
|
|
5250
5247
|
resolvedSource = resolvedSource[part];
|
|
5251
5248
|
} else {
|
|
@@ -5487,11 +5484,11 @@ function safeResolvePath(path, valModule, schema) {
|
|
|
5487
5484
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5488
5485
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5489
5486
|
var _resolvedSchema$optio5, _resolvedSchema$optio6;
|
|
5490
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 &&
|
|
5487
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 && _resolvedSchema$optio5.img && typeof ((_resolvedSchema$optio6 = resolvedSchema["options"]) === null || _resolvedSchema$optio6 === void 0 ? void 0 : _resolvedSchema$optio6.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5491
5488
|
}
|
|
5492
5489
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5493
5490
|
var _resolvedSchema$optio7, _resolvedSchema$optio8;
|
|
5494
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 &&
|
|
5491
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 && _resolvedSchema$optio7.a && typeof ((_resolvedSchema$optio8 = resolvedSchema["options"]) === null || _resolvedSchema$optio8 === void 0 ? void 0 : _resolvedSchema$optio8.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5495
5492
|
}
|
|
5496
5493
|
resolvedSource = resolvedSource[part];
|
|
5497
5494
|
} else {
|
|
@@ -8792,8 +8789,8 @@ function hasRemoteFileSchema(schema) {
|
|
|
8792
8789
|
return !!schema.remote;
|
|
8793
8790
|
} else if (schema.type === "richtext") {
|
|
8794
8791
|
var _schema$options;
|
|
8795
|
-
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0
|
|
8796
|
-
return hasRemoteFileSchema(schema.options.
|
|
8792
|
+
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0 ? void 0 : _schema$options.img) === "object") {
|
|
8793
|
+
return hasRemoteFileSchema(schema.options.img);
|
|
8797
8794
|
}
|
|
8798
8795
|
return false;
|
|
8799
8796
|
} else if (schema.type === "array") {
|
|
@@ -9095,12 +9092,10 @@ function deserializeSchemaImpl(serialized) {
|
|
|
9095
9092
|
serialized.opt, [], false, false, serialized.description, (_serialized$render7 = serialized.render) !== null && _serialized$render7 !== void 0 ? _serialized$render7 : null);
|
|
9096
9093
|
case "richtext":
|
|
9097
9094
|
{
|
|
9098
|
-
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$
|
|
9095
|
+
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$render8;
|
|
9099
9096
|
var deserializedOptions = _objectSpread2(_objectSpread2({}, serialized.options || {}), {}, {
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
img: _typeof((_serialized$options7 = serialized.options) === null || _serialized$options7 === void 0 || (_serialized$options7 = _serialized$options7.inline) === null || _serialized$options7 === void 0 ? void 0 : _serialized$options7.img) === "object" ? deserializeSchema(serialized.options.inline.img) : (_serialized$options8 = serialized.options) === null || _serialized$options8 === void 0 || (_serialized$options8 = _serialized$options8.inline) === null || _serialized$options8 === void 0 ? void 0 : _serialized$options8.img
|
|
9103
|
-
} : (_serialized$options9 = serialized.options) === null || _serialized$options9 === void 0 ? void 0 : _serialized$options9.inline
|
|
9097
|
+
a: _typeof((_serialized$options3 = serialized.options) === null || _serialized$options3 === void 0 ? void 0 : _serialized$options3.a) === "object" ? deserializeSchema(serialized.options.a) : (_serialized$options4 = serialized.options) === null || _serialized$options4 === void 0 ? void 0 : _serialized$options4.a,
|
|
9098
|
+
img: _typeof((_serialized$options5 = serialized.options) === null || _serialized$options5 === void 0 ? void 0 : _serialized$options5.img) === "object" ? deserializeSchema(serialized.options.img) : (_serialized$options6 = serialized.options) === null || _serialized$options6 === void 0 ? void 0 : _serialized$options6.img
|
|
9104
9099
|
});
|
|
9105
9100
|
return new RichTextSchema(deserializedOptions, serialized.opt, [], false, false, serialized.description, (_serialized$render8 = serialized.render) !== null && _serialized$render8 !== void 0 ? _serialized$render8 : null);
|
|
9106
9101
|
}
|
|
@@ -3551,7 +3551,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3551
3551
|
_step;
|
|
3552
3552
|
try {
|
|
3553
3553
|
var _loop = function _loop() {
|
|
3554
|
-
var _this2$options$block, _this2$options$block2, _this2$options$block3, _this2$options$block4, _this2$options$block5, _this2$options$block6, _this2$options$block7, _this2$options$block8, _this2$options$block9, _this2$options$block0;
|
|
3555
3554
|
var node = _step.value;
|
|
3556
3555
|
var path = unsafeCreateSourcePath(rootPath, nodes.indexOf(node));
|
|
3557
3556
|
if (typeof node === "string") {
|
|
@@ -3594,39 +3593,37 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3594
3593
|
if (!supportedTags.includes(node.tag)) {
|
|
3595
3594
|
addError(path, "Tag '".concat(node.tag, "' is not supported. Supported tags: ").concat(supportedTags.join(", ")), true);
|
|
3596
3595
|
}
|
|
3597
|
-
if (node.tag === "h1" && !
|
|
3598
|
-
addError(path, "'
|
|
3596
|
+
if (node.tag === "h1" && !_this2.options.h1) {
|
|
3597
|
+
addError(path, "'h1' block is not valid", false);
|
|
3599
3598
|
}
|
|
3600
|
-
if (node.tag === "h2" && !
|
|
3599
|
+
if (node.tag === "h2" && !_this2.options.h2) {
|
|
3601
3600
|
addError(path, "'h2' block is not valid", false);
|
|
3602
3601
|
}
|
|
3603
|
-
if (node.tag === "h3" && !
|
|
3602
|
+
if (node.tag === "h3" && !_this2.options.h3) {
|
|
3604
3603
|
addError(path, "'h3' block is not valid", false);
|
|
3605
3604
|
}
|
|
3606
|
-
if (node.tag === "h4" && !
|
|
3605
|
+
if (node.tag === "h4" && !_this2.options.h4) {
|
|
3607
3606
|
addError(path, "'h4' block is not valid", false);
|
|
3608
3607
|
}
|
|
3609
|
-
if (node.tag === "h5" && !
|
|
3608
|
+
if (node.tag === "h5" && !_this2.options.h5) {
|
|
3610
3609
|
addError(path, "'h5' block is not valid", false);
|
|
3611
3610
|
}
|
|
3612
|
-
if (node.tag === "h6" && !
|
|
3611
|
+
if (node.tag === "h6" && !_this2.options.h6) {
|
|
3613
3612
|
addError(path, "'h6' block is not valid", false);
|
|
3614
3613
|
}
|
|
3615
|
-
if (node.tag === "ol" && !
|
|
3614
|
+
if (node.tag === "ol" && !_this2.options.ol) {
|
|
3616
3615
|
addError(path, "'ol' block is not valid", false);
|
|
3617
3616
|
}
|
|
3618
|
-
if (node.tag === "ul" && !
|
|
3617
|
+
if (node.tag === "ul" && !_this2.options.ul) {
|
|
3619
3618
|
addError(path, "'ul' block is not valid", false);
|
|
3620
3619
|
}
|
|
3621
|
-
if (node.tag === "li" && !
|
|
3622
|
-
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is
|
|
3620
|
+
if (node.tag === "li" && !_this2.options.ul && !_this2.options.ol) {
|
|
3621
|
+
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is valid", false);
|
|
3623
3622
|
}
|
|
3624
3623
|
if (node.tag === "a") {
|
|
3625
|
-
|
|
3626
|
-
if (!((_this2$options$inline = _this2.options.inline) !== null && _this2$options$inline !== void 0 && _this2$options$inline.a)) {
|
|
3624
|
+
if (!_this2.options.a) {
|
|
3627
3625
|
addError(path, "'a' inline is not valid", false);
|
|
3628
|
-
} else if (
|
|
3629
|
-
var _this2$options$inline3;
|
|
3626
|
+
} else if (_this2.options.a) {
|
|
3630
3627
|
if (!("href" in node)) {
|
|
3631
3628
|
return {
|
|
3632
3629
|
v: _defineProperty({}, path, [{
|
|
@@ -3636,7 +3633,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3636
3633
|
};
|
|
3637
3634
|
}
|
|
3638
3635
|
var hrefPath = unsafeCreateSourcePath(path, "href");
|
|
3639
|
-
var hrefSchema = typeof
|
|
3636
|
+
var hrefSchema = typeof _this2.options.a === "boolean" ? new RouteSchema() : _this2.options.a;
|
|
3640
3637
|
var executeValidate = function executeValidate() {
|
|
3641
3638
|
if (hrefSchema instanceof RouteSchema) {
|
|
3642
3639
|
return hrefSchema["executeValidate"](hrefPath, node.href);
|
|
@@ -3662,11 +3659,9 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3662
3659
|
}
|
|
3663
3660
|
}
|
|
3664
3661
|
if (node.tag === "img") {
|
|
3665
|
-
|
|
3666
|
-
if (!((_this2$options$inline4 = _this2.options.inline) !== null && _this2$options$inline4 !== void 0 && _this2$options$inline4.img)) {
|
|
3662
|
+
if (!_this2.options.img) {
|
|
3667
3663
|
addError(path, "'img' inline is not valid", false);
|
|
3668
|
-
} else if (
|
|
3669
|
-
var _this2$options$inline6;
|
|
3664
|
+
} else if (_this2.options.img) {
|
|
3670
3665
|
if (!("src" in node)) {
|
|
3671
3666
|
return {
|
|
3672
3667
|
v: _defineProperty({}, path, [{
|
|
@@ -3676,7 +3671,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3676
3671
|
};
|
|
3677
3672
|
}
|
|
3678
3673
|
var srcPath = unsafeCreateSourcePath(path, "src");
|
|
3679
|
-
var imgSchema =
|
|
3674
|
+
var imgSchema = _this2.options.img;
|
|
3680
3675
|
var imageValidationErrors = _typeof(imgSchema) === "object" ? imgSchema["executeValidate"](srcPath, node.src) : new ImageSchema({}, false, false)["executeValidate"](srcPath, node.src);
|
|
3681
3676
|
if (imageValidationErrors) {
|
|
3682
3677
|
for (var _validationErrorPathS in imageValidationErrors) {
|
|
@@ -3709,7 +3704,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3709
3704
|
}
|
|
3710
3705
|
var stylesPath = unsafeCreateSourcePath(path, "styles");
|
|
3711
3706
|
for (var i = 0; i < node.styles.length; i++) {
|
|
3712
|
-
var _this2$options$style, _this2$options$style2, _this2$options$style3;
|
|
3713
3707
|
var style = node.styles[i];
|
|
3714
3708
|
var currentStylePath = unsafeCreateSourcePath(stylesPath, i);
|
|
3715
3709
|
if (typeof style !== "string") {
|
|
@@ -3720,13 +3714,13 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3720
3714
|
}])
|
|
3721
3715
|
};
|
|
3722
3716
|
}
|
|
3723
|
-
if (style === "bold" && !
|
|
3717
|
+
if (style === "bold" && !_this2.options.bold) {
|
|
3724
3718
|
addError(currentStylePath, "Style 'bold' is not valid", false);
|
|
3725
3719
|
}
|
|
3726
|
-
if (style === "italic" && !
|
|
3720
|
+
if (style === "italic" && !_this2.options.italic) {
|
|
3727
3721
|
addError(currentStylePath, "Style 'italic' is not valid", false);
|
|
3728
3722
|
}
|
|
3729
|
-
if (style === "lineThrough" && !
|
|
3723
|
+
if (style === "lineThrough" && !_this2.options.lineThrough) {
|
|
3730
3724
|
addError(currentStylePath, "Style 'lineThrough' is not valid", false);
|
|
3731
3725
|
}
|
|
3732
3726
|
}
|
|
@@ -4012,27 +4006,30 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
4012
4006
|
_this$renderInput,
|
|
4013
4007
|
_this$customValidateF;
|
|
4014
4008
|
var serializeAnchorSchema = function serializeAnchorSchema() {
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
return
|
|
4019
|
-
} else if (((_this3$options$inline3 = _this3.options.inline) === null || _this3$options$inline3 === void 0 ? void 0 : _this3$options$inline3.a) instanceof StringSchema) {
|
|
4020
|
-
var _this3$options$inline4;
|
|
4021
|
-
return (_this3$options$inline4 = _this3.options.inline) === null || _this3$options$inline4 === void 0 ? void 0 : _this3$options$inline4.a["executeSerialize"]();
|
|
4009
|
+
if (_this3.options.a instanceof RouteSchema) {
|
|
4010
|
+
return _this3.options.a["executeSerialize"]();
|
|
4011
|
+
} else if (_this3.options.a instanceof StringSchema) {
|
|
4012
|
+
return _this3.options.a["executeSerialize"]();
|
|
4022
4013
|
} else {
|
|
4023
|
-
|
|
4024
|
-
return (_this3$options$inline5 = _this3.options.inline) === null || _this3$options$inline5 === void 0 ? void 0 : _this3$options$inline5.a;
|
|
4014
|
+
return _this3.options.a;
|
|
4025
4015
|
}
|
|
4026
4016
|
};
|
|
4027
4017
|
var serializedOptions = {
|
|
4028
4018
|
maxLength: this.options.maxLength,
|
|
4029
4019
|
minLength: this.options.minLength,
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4020
|
+
bold: this.options.bold,
|
|
4021
|
+
italic: this.options.italic,
|
|
4022
|
+
lineThrough: this.options.lineThrough,
|
|
4023
|
+
h1: this.options.h1,
|
|
4024
|
+
h2: this.options.h2,
|
|
4025
|
+
h3: this.options.h3,
|
|
4026
|
+
h4: this.options.h4,
|
|
4027
|
+
h5: this.options.h5,
|
|
4028
|
+
h6: this.options.h6,
|
|
4029
|
+
ul: this.options.ul,
|
|
4030
|
+
ol: this.options.ol,
|
|
4031
|
+
a: serializeAnchorSchema(),
|
|
4032
|
+
img: this.options.img && _typeof(this.options.img) === "object" ? this.options.img["executeSerialize"]() : this.options.img
|
|
4036
4033
|
};
|
|
4037
4034
|
return {
|
|
4038
4035
|
type: "richtext",
|
|
@@ -5239,11 +5236,11 @@ function resolvePath(path, valModule, schema) {
|
|
|
5239
5236
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5240
5237
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5241
5238
|
var _resolvedSchema$optio, _resolvedSchema$optio2;
|
|
5242
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 &&
|
|
5239
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 && _resolvedSchema$optio.img && typeof ((_resolvedSchema$optio2 = resolvedSchema["options"]) === null || _resolvedSchema$optio2 === void 0 ? void 0 : _resolvedSchema$optio2.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5243
5240
|
}
|
|
5244
5241
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5245
5242
|
var _resolvedSchema$optio3, _resolvedSchema$optio4;
|
|
5246
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 &&
|
|
5243
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 && _resolvedSchema$optio3.a && typeof ((_resolvedSchema$optio4 = resolvedSchema["options"]) === null || _resolvedSchema$optio4 === void 0 ? void 0 : _resolvedSchema$optio4.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5247
5244
|
}
|
|
5248
5245
|
resolvedSource = resolvedSource[part];
|
|
5249
5246
|
} else {
|
|
@@ -5485,11 +5482,11 @@ function safeResolvePath(path, valModule, schema) {
|
|
|
5485
5482
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5486
5483
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5487
5484
|
var _resolvedSchema$optio5, _resolvedSchema$optio6;
|
|
5488
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 &&
|
|
5485
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 && _resolvedSchema$optio5.img && typeof ((_resolvedSchema$optio6 = resolvedSchema["options"]) === null || _resolvedSchema$optio6 === void 0 ? void 0 : _resolvedSchema$optio6.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5489
5486
|
}
|
|
5490
5487
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5491
5488
|
var _resolvedSchema$optio7, _resolvedSchema$optio8;
|
|
5492
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 &&
|
|
5489
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 && _resolvedSchema$optio7.a && typeof ((_resolvedSchema$optio8 = resolvedSchema["options"]) === null || _resolvedSchema$optio8 === void 0 ? void 0 : _resolvedSchema$optio8.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5493
5490
|
}
|
|
5494
5491
|
resolvedSource = resolvedSource[part];
|
|
5495
5492
|
} else {
|
|
@@ -8790,8 +8787,8 @@ function hasRemoteFileSchema(schema) {
|
|
|
8790
8787
|
return !!schema.remote;
|
|
8791
8788
|
} else if (schema.type === "richtext") {
|
|
8792
8789
|
var _schema$options;
|
|
8793
|
-
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0
|
|
8794
|
-
return hasRemoteFileSchema(schema.options.
|
|
8790
|
+
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0 ? void 0 : _schema$options.img) === "object") {
|
|
8791
|
+
return hasRemoteFileSchema(schema.options.img);
|
|
8795
8792
|
}
|
|
8796
8793
|
return false;
|
|
8797
8794
|
} else if (schema.type === "array") {
|
|
@@ -9093,12 +9090,10 @@ function deserializeSchemaImpl(serialized) {
|
|
|
9093
9090
|
serialized.opt, [], false, false, serialized.description, (_serialized$render7 = serialized.render) !== null && _serialized$render7 !== void 0 ? _serialized$render7 : null);
|
|
9094
9091
|
case "richtext":
|
|
9095
9092
|
{
|
|
9096
|
-
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$
|
|
9093
|
+
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$render8;
|
|
9097
9094
|
var deserializedOptions = _objectSpread2(_objectSpread2({}, serialized.options || {}), {}, {
|
|
9098
|
-
|
|
9099
|
-
|
|
9100
|
-
img: _typeof((_serialized$options7 = serialized.options) === null || _serialized$options7 === void 0 || (_serialized$options7 = _serialized$options7.inline) === null || _serialized$options7 === void 0 ? void 0 : _serialized$options7.img) === "object" ? deserializeSchema(serialized.options.inline.img) : (_serialized$options8 = serialized.options) === null || _serialized$options8 === void 0 || (_serialized$options8 = _serialized$options8.inline) === null || _serialized$options8 === void 0 ? void 0 : _serialized$options8.img
|
|
9101
|
-
} : (_serialized$options9 = serialized.options) === null || _serialized$options9 === void 0 ? void 0 : _serialized$options9.inline
|
|
9095
|
+
a: _typeof((_serialized$options3 = serialized.options) === null || _serialized$options3 === void 0 ? void 0 : _serialized$options3.a) === "object" ? deserializeSchema(serialized.options.a) : (_serialized$options4 = serialized.options) === null || _serialized$options4 === void 0 ? void 0 : _serialized$options4.a,
|
|
9096
|
+
img: _typeof((_serialized$options5 = serialized.options) === null || _serialized$options5 === void 0 ? void 0 : _serialized$options5.img) === "object" ? deserializeSchema(serialized.options.img) : (_serialized$options6 = serialized.options) === null || _serialized$options6 === void 0 ? void 0 : _serialized$options6.img
|
|
9102
9097
|
});
|
|
9103
9098
|
return new RichTextSchema(deserializedOptions, serialized.opt, [], false, false, serialized.description, (_serialized$render8 = serialized.render) !== null && _serialized$render8 !== void 0 ? _serialized$render8 : null);
|
|
9104
9099
|
}
|
|
@@ -3553,7 +3553,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3553
3553
|
_step;
|
|
3554
3554
|
try {
|
|
3555
3555
|
var _loop = function _loop() {
|
|
3556
|
-
var _this2$options$block, _this2$options$block2, _this2$options$block3, _this2$options$block4, _this2$options$block5, _this2$options$block6, _this2$options$block7, _this2$options$block8, _this2$options$block9, _this2$options$block0;
|
|
3557
3556
|
var node = _step.value;
|
|
3558
3557
|
var path = unsafeCreateSourcePath(rootPath, nodes.indexOf(node));
|
|
3559
3558
|
if (typeof node === "string") {
|
|
@@ -3596,39 +3595,37 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3596
3595
|
if (!supportedTags.includes(node.tag)) {
|
|
3597
3596
|
addError(path, "Tag '".concat(node.tag, "' is not supported. Supported tags: ").concat(supportedTags.join(", ")), true);
|
|
3598
3597
|
}
|
|
3599
|
-
if (node.tag === "h1" && !
|
|
3600
|
-
addError(path, "'
|
|
3598
|
+
if (node.tag === "h1" && !_this2.options.h1) {
|
|
3599
|
+
addError(path, "'h1' block is not valid", false);
|
|
3601
3600
|
}
|
|
3602
|
-
if (node.tag === "h2" && !
|
|
3601
|
+
if (node.tag === "h2" && !_this2.options.h2) {
|
|
3603
3602
|
addError(path, "'h2' block is not valid", false);
|
|
3604
3603
|
}
|
|
3605
|
-
if (node.tag === "h3" && !
|
|
3604
|
+
if (node.tag === "h3" && !_this2.options.h3) {
|
|
3606
3605
|
addError(path, "'h3' block is not valid", false);
|
|
3607
3606
|
}
|
|
3608
|
-
if (node.tag === "h4" && !
|
|
3607
|
+
if (node.tag === "h4" && !_this2.options.h4) {
|
|
3609
3608
|
addError(path, "'h4' block is not valid", false);
|
|
3610
3609
|
}
|
|
3611
|
-
if (node.tag === "h5" && !
|
|
3610
|
+
if (node.tag === "h5" && !_this2.options.h5) {
|
|
3612
3611
|
addError(path, "'h5' block is not valid", false);
|
|
3613
3612
|
}
|
|
3614
|
-
if (node.tag === "h6" && !
|
|
3613
|
+
if (node.tag === "h6" && !_this2.options.h6) {
|
|
3615
3614
|
addError(path, "'h6' block is not valid", false);
|
|
3616
3615
|
}
|
|
3617
|
-
if (node.tag === "ol" && !
|
|
3616
|
+
if (node.tag === "ol" && !_this2.options.ol) {
|
|
3618
3617
|
addError(path, "'ol' block is not valid", false);
|
|
3619
3618
|
}
|
|
3620
|
-
if (node.tag === "ul" && !
|
|
3619
|
+
if (node.tag === "ul" && !_this2.options.ul) {
|
|
3621
3620
|
addError(path, "'ul' block is not valid", false);
|
|
3622
3621
|
}
|
|
3623
|
-
if (node.tag === "li" && !
|
|
3624
|
-
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is
|
|
3622
|
+
if (node.tag === "li" && !_this2.options.ul && !_this2.options.ol) {
|
|
3623
|
+
addError(path, "'li' tag is invalid since neither 'ul' nor 'ol' block is valid", false);
|
|
3625
3624
|
}
|
|
3626
3625
|
if (node.tag === "a") {
|
|
3627
|
-
|
|
3628
|
-
if (!((_this2$options$inline = _this2.options.inline) !== null && _this2$options$inline !== void 0 && _this2$options$inline.a)) {
|
|
3626
|
+
if (!_this2.options.a) {
|
|
3629
3627
|
addError(path, "'a' inline is not valid", false);
|
|
3630
|
-
} else if (
|
|
3631
|
-
var _this2$options$inline3;
|
|
3628
|
+
} else if (_this2.options.a) {
|
|
3632
3629
|
if (!("href" in node)) {
|
|
3633
3630
|
return {
|
|
3634
3631
|
v: _defineProperty({}, path, [{
|
|
@@ -3638,7 +3635,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3638
3635
|
};
|
|
3639
3636
|
}
|
|
3640
3637
|
var hrefPath = unsafeCreateSourcePath(path, "href");
|
|
3641
|
-
var hrefSchema = typeof
|
|
3638
|
+
var hrefSchema = typeof _this2.options.a === "boolean" ? new RouteSchema() : _this2.options.a;
|
|
3642
3639
|
var executeValidate = function executeValidate() {
|
|
3643
3640
|
if (hrefSchema instanceof RouteSchema) {
|
|
3644
3641
|
return hrefSchema["executeValidate"](hrefPath, node.href);
|
|
@@ -3664,11 +3661,9 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3664
3661
|
}
|
|
3665
3662
|
}
|
|
3666
3663
|
if (node.tag === "img") {
|
|
3667
|
-
|
|
3668
|
-
if (!((_this2$options$inline4 = _this2.options.inline) !== null && _this2$options$inline4 !== void 0 && _this2$options$inline4.img)) {
|
|
3664
|
+
if (!_this2.options.img) {
|
|
3669
3665
|
addError(path, "'img' inline is not valid", false);
|
|
3670
|
-
} else if (
|
|
3671
|
-
var _this2$options$inline6;
|
|
3666
|
+
} else if (_this2.options.img) {
|
|
3672
3667
|
if (!("src" in node)) {
|
|
3673
3668
|
return {
|
|
3674
3669
|
v: _defineProperty({}, path, [{
|
|
@@ -3678,7 +3673,7 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3678
3673
|
};
|
|
3679
3674
|
}
|
|
3680
3675
|
var srcPath = unsafeCreateSourcePath(path, "src");
|
|
3681
|
-
var imgSchema =
|
|
3676
|
+
var imgSchema = _this2.options.img;
|
|
3682
3677
|
var imageValidationErrors = _typeof(imgSchema) === "object" ? imgSchema["executeValidate"](srcPath, node.src) : new ImageSchema({}, false, false)["executeValidate"](srcPath, node.src);
|
|
3683
3678
|
if (imageValidationErrors) {
|
|
3684
3679
|
for (var _validationErrorPathS in imageValidationErrors) {
|
|
@@ -3711,7 +3706,6 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3711
3706
|
}
|
|
3712
3707
|
var stylesPath = unsafeCreateSourcePath(path, "styles");
|
|
3713
3708
|
for (var i = 0; i < node.styles.length; i++) {
|
|
3714
|
-
var _this2$options$style, _this2$options$style2, _this2$options$style3;
|
|
3715
3709
|
var style = node.styles[i];
|
|
3716
3710
|
var currentStylePath = unsafeCreateSourcePath(stylesPath, i);
|
|
3717
3711
|
if (typeof style !== "string") {
|
|
@@ -3722,13 +3716,13 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
3722
3716
|
}])
|
|
3723
3717
|
};
|
|
3724
3718
|
}
|
|
3725
|
-
if (style === "bold" && !
|
|
3719
|
+
if (style === "bold" && !_this2.options.bold) {
|
|
3726
3720
|
addError(currentStylePath, "Style 'bold' is not valid", false);
|
|
3727
3721
|
}
|
|
3728
|
-
if (style === "italic" && !
|
|
3722
|
+
if (style === "italic" && !_this2.options.italic) {
|
|
3729
3723
|
addError(currentStylePath, "Style 'italic' is not valid", false);
|
|
3730
3724
|
}
|
|
3731
|
-
if (style === "lineThrough" && !
|
|
3725
|
+
if (style === "lineThrough" && !_this2.options.lineThrough) {
|
|
3732
3726
|
addError(currentStylePath, "Style 'lineThrough' is not valid", false);
|
|
3733
3727
|
}
|
|
3734
3728
|
}
|
|
@@ -4014,27 +4008,30 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
|
4014
4008
|
_this$renderInput,
|
|
4015
4009
|
_this$customValidateF;
|
|
4016
4010
|
var serializeAnchorSchema = function serializeAnchorSchema() {
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
return
|
|
4021
|
-
} else if (((_this3$options$inline3 = _this3.options.inline) === null || _this3$options$inline3 === void 0 ? void 0 : _this3$options$inline3.a) instanceof StringSchema) {
|
|
4022
|
-
var _this3$options$inline4;
|
|
4023
|
-
return (_this3$options$inline4 = _this3.options.inline) === null || _this3$options$inline4 === void 0 ? void 0 : _this3$options$inline4.a["executeSerialize"]();
|
|
4011
|
+
if (_this3.options.a instanceof RouteSchema) {
|
|
4012
|
+
return _this3.options.a["executeSerialize"]();
|
|
4013
|
+
} else if (_this3.options.a instanceof StringSchema) {
|
|
4014
|
+
return _this3.options.a["executeSerialize"]();
|
|
4024
4015
|
} else {
|
|
4025
|
-
|
|
4026
|
-
return (_this3$options$inline5 = _this3.options.inline) === null || _this3$options$inline5 === void 0 ? void 0 : _this3$options$inline5.a;
|
|
4016
|
+
return _this3.options.a;
|
|
4027
4017
|
}
|
|
4028
4018
|
};
|
|
4029
4019
|
var serializedOptions = {
|
|
4030
4020
|
maxLength: this.options.maxLength,
|
|
4031
4021
|
minLength: this.options.minLength,
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4022
|
+
bold: this.options.bold,
|
|
4023
|
+
italic: this.options.italic,
|
|
4024
|
+
lineThrough: this.options.lineThrough,
|
|
4025
|
+
h1: this.options.h1,
|
|
4026
|
+
h2: this.options.h2,
|
|
4027
|
+
h3: this.options.h3,
|
|
4028
|
+
h4: this.options.h4,
|
|
4029
|
+
h5: this.options.h5,
|
|
4030
|
+
h6: this.options.h6,
|
|
4031
|
+
ul: this.options.ul,
|
|
4032
|
+
ol: this.options.ol,
|
|
4033
|
+
a: serializeAnchorSchema(),
|
|
4034
|
+
img: this.options.img && _typeof(this.options.img) === "object" ? this.options.img["executeSerialize"]() : this.options.img
|
|
4038
4035
|
};
|
|
4039
4036
|
return {
|
|
4040
4037
|
type: "richtext",
|
|
@@ -5241,11 +5238,11 @@ function resolvePath(path, valModule, schema) {
|
|
|
5241
5238
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5242
5239
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5243
5240
|
var _resolvedSchema$optio, _resolvedSchema$optio2;
|
|
5244
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 &&
|
|
5241
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio = resolvedSchema["options"]) !== null && _resolvedSchema$optio !== void 0 && _resolvedSchema$optio.img && typeof ((_resolvedSchema$optio2 = resolvedSchema["options"]) === null || _resolvedSchema$optio2 === void 0 ? void 0 : _resolvedSchema$optio2.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5245
5242
|
}
|
|
5246
5243
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5247
5244
|
var _resolvedSchema$optio3, _resolvedSchema$optio4;
|
|
5248
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 &&
|
|
5245
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio3 = resolvedSchema["options"]) !== null && _resolvedSchema$optio3 !== void 0 && _resolvedSchema$optio3.a && typeof ((_resolvedSchema$optio4 = resolvedSchema["options"]) === null || _resolvedSchema$optio4 === void 0 ? void 0 : _resolvedSchema$optio4.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5249
5246
|
}
|
|
5250
5247
|
resolvedSource = resolvedSource[part];
|
|
5251
5248
|
} else {
|
|
@@ -5487,11 +5484,11 @@ function safeResolvePath(path, valModule, schema) {
|
|
|
5487
5484
|
} else if (isRichTextSchema(resolvedSchema)) {
|
|
5488
5485
|
if ("src" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "img" && parts.length === 0) {
|
|
5489
5486
|
var _resolvedSchema$optio5, _resolvedSchema$optio6;
|
|
5490
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 &&
|
|
5487
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio5 = resolvedSchema["options"]) !== null && _resolvedSchema$optio5 !== void 0 && _resolvedSchema$optio5.img && typeof ((_resolvedSchema$optio6 = resolvedSchema["options"]) === null || _resolvedSchema$optio6 === void 0 ? void 0 : _resolvedSchema$optio6.img) !== "boolean" ? resolvedSchema["options"].img : resolvedSchema : resolvedSchema;
|
|
5491
5488
|
}
|
|
5492
5489
|
if ("href" in resolvedSource && "tag" in resolvedSource && resolvedSource.tag === "a" && parts.length === 0) {
|
|
5493
5490
|
var _resolvedSchema$optio7, _resolvedSchema$optio8;
|
|
5494
|
-
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 &&
|
|
5491
|
+
resolvedSchema = resolvedSchema instanceof RichTextSchema ? (_resolvedSchema$optio7 = resolvedSchema["options"]) !== null && _resolvedSchema$optio7 !== void 0 && _resolvedSchema$optio7.a && typeof ((_resolvedSchema$optio8 = resolvedSchema["options"]) === null || _resolvedSchema$optio8 === void 0 ? void 0 : _resolvedSchema$optio8.a) !== "boolean" ? resolvedSchema["options"].a : resolvedSchema : resolvedSchema;
|
|
5495
5492
|
}
|
|
5496
5493
|
resolvedSource = resolvedSource[part];
|
|
5497
5494
|
} else {
|
|
@@ -8792,8 +8789,8 @@ function hasRemoteFileSchema(schema) {
|
|
|
8792
8789
|
return !!schema.remote;
|
|
8793
8790
|
} else if (schema.type === "richtext") {
|
|
8794
8791
|
var _schema$options;
|
|
8795
|
-
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0
|
|
8796
|
-
return hasRemoteFileSchema(schema.options.
|
|
8792
|
+
if (_typeof((_schema$options = schema.options) === null || _schema$options === void 0 ? void 0 : _schema$options.img) === "object") {
|
|
8793
|
+
return hasRemoteFileSchema(schema.options.img);
|
|
8797
8794
|
}
|
|
8798
8795
|
return false;
|
|
8799
8796
|
} else if (schema.type === "array") {
|
|
@@ -9095,12 +9092,10 @@ function deserializeSchemaImpl(serialized) {
|
|
|
9095
9092
|
serialized.opt, [], false, false, serialized.description, (_serialized$render7 = serialized.render) !== null && _serialized$render7 !== void 0 ? _serialized$render7 : null);
|
|
9096
9093
|
case "richtext":
|
|
9097
9094
|
{
|
|
9098
|
-
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$
|
|
9095
|
+
var _serialized$options3, _serialized$options4, _serialized$options5, _serialized$options6, _serialized$render8;
|
|
9099
9096
|
var deserializedOptions = _objectSpread2(_objectSpread2({}, serialized.options || {}), {}, {
|
|
9100
|
-
|
|
9101
|
-
|
|
9102
|
-
img: _typeof((_serialized$options7 = serialized.options) === null || _serialized$options7 === void 0 || (_serialized$options7 = _serialized$options7.inline) === null || _serialized$options7 === void 0 ? void 0 : _serialized$options7.img) === "object" ? deserializeSchema(serialized.options.inline.img) : (_serialized$options8 = serialized.options) === null || _serialized$options8 === void 0 || (_serialized$options8 = _serialized$options8.inline) === null || _serialized$options8 === void 0 ? void 0 : _serialized$options8.img
|
|
9103
|
-
} : (_serialized$options9 = serialized.options) === null || _serialized$options9 === void 0 ? void 0 : _serialized$options9.inline
|
|
9097
|
+
a: _typeof((_serialized$options3 = serialized.options) === null || _serialized$options3 === void 0 ? void 0 : _serialized$options3.a) === "object" ? deserializeSchema(serialized.options.a) : (_serialized$options4 = serialized.options) === null || _serialized$options4 === void 0 ? void 0 : _serialized$options4.a,
|
|
9098
|
+
img: _typeof((_serialized$options5 = serialized.options) === null || _serialized$options5 === void 0 ? void 0 : _serialized$options5.img) === "object" ? deserializeSchema(serialized.options.img) : (_serialized$options6 = serialized.options) === null || _serialized$options6 === void 0 ? void 0 : _serialized$options6.img
|
|
9104
9099
|
});
|
|
9105
9100
|
return new RichTextSchema(deserializedOptions, serialized.opt, [], false, false, serialized.description, (_serialized$render8 = serialized.render) !== null && _serialized$render8 !== void 0 ? _serialized$render8 : null);
|
|
9106
9101
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { A as ArraySchema, B as BooleanSchema, r as CODE_LANGUAGES, t as COLOR_FORMATS, q as CodeSchema, C as ColorSchema, e as DEFAULT_APP_HOST, u as DEFAULT_COLOR_FORMAT, D as DEFAULT_CONTENT_HOST, j as DEFAULT_VAL_REMOTE_HOST, p as DateSchema, v as DateTimeSchema, F as FATAL_ERROR_TYPES, o as FileSchema, G as GenericSelector, n as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, x as RichTextSchema, w as RouteSchema, S as Schema, l as StringSchema, U as UnionSchema, V as VAL_EXTENSION, g as computeValModuleShas, k as derefPatch, y as deserializeSchema, f as extractValModules, H as getSourcePathFromRoute, h as hasRemoteFileSchema, i as initVal, E as isInlineRender, m as modules, z as previewScope } from './index-
|
|
1
|
+
export { A as ArraySchema, B as BooleanSchema, r as CODE_LANGUAGES, t as COLOR_FORMATS, q as CodeSchema, C as ColorSchema, e as DEFAULT_APP_HOST, u as DEFAULT_COLOR_FORMAT, D as DEFAULT_CONTENT_HOST, j as DEFAULT_VAL_REMOTE_HOST, p as DateSchema, v as DateTimeSchema, F as FATAL_ERROR_TYPES, o as FileSchema, G as GenericSelector, n as ImageSchema, I as Internal, K as KeyOfSchema, L as LiteralSchema, M as ModuleFilePathSep, N as NumberSchema, O as ObjectSchema, R as RecordSchema, x as RichTextSchema, w as RouteSchema, S as Schema, l as StringSchema, U as UnionSchema, V as VAL_EXTENSION, g as computeValModuleShas, k as derefPatch, y as deserializeSchema, f as extractValModules, H as getSourcePathFromRoute, h as hasRemoteFileSchema, i as initVal, E as isInlineRender, m as modules, z as previewScope } from './index-2f65e194.esm.js';
|
|
2
2
|
import './result-daff1cae.esm.js';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var dist_valbuildCore = require('../../dist/index-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-01f673d2.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-
|
|
5
|
+
var dist_valbuildCore = require('../../dist/index-861944d8.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-
|
|
2
|
-
export { P as PatchError } from '../../dist/index-
|
|
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-2f65e194.esm.js';
|
|
2
|
+
export { P as PatchError } from '../../dist/index-2f65e194.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
|
|