@valbuild/core 0.13.3 → 0.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/declarations/src/index.d.ts +7 -4
- package/dist/declarations/src/initSchema.d.ts +1 -1
- package/dist/declarations/src/initVal.d.ts +2 -0
- package/dist/declarations/src/module.d.ts +3 -2
- package/dist/declarations/src/schema/richtext.d.ts +4 -64
- package/dist/declarations/src/selector/index.d.ts +3 -2
- package/dist/declarations/src/source/index.d.ts +3 -2
- package/dist/declarations/src/source/remote.d.ts +2 -2
- package/dist/declarations/src/source/richtext.d.ts +63 -0
- package/dist/declarations/src/val/index.d.ts +1 -0
- package/dist/{index-2f1631cf.cjs.prod.js → index-104b3b67.cjs.prod.js} +5 -1
- package/dist/{index-b49a2c60.cjs.dev.js → index-2f65eaa1.cjs.dev.js} +5 -1
- package/dist/{index-55916dcd.esm.js → index-b861a6d2.esm.js} +5 -2
- package/dist/valbuild-core.cjs.dev.js +24 -262
- package/dist/valbuild-core.cjs.prod.js +24 -262
- package/dist/valbuild-core.esm.js +26 -263
- package/expr/dist/valbuild-core-expr.cjs.dev.js +1 -1
- package/expr/dist/valbuild-core-expr.cjs.prod.js +1 -1
- package/expr/dist/valbuild-core-expr.esm.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +15 -12
- package/src/initVal.ts +5 -1
- package/src/module.ts +2 -5
- package/src/schema/richtext.ts +6 -384
- package/src/selector/SelectorProxy.ts +2 -1
- package/src/selector/index.ts +4 -0
- package/src/source/index.ts +3 -1
- package/src/source/remote.ts +2 -2
- package/src/source/richtext.ts +116 -0
- package/src/val/index.ts +10 -0
- package/README.md +0 -525
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var expr_dist_valbuildCoreExpr = require('./index-
|
5
|
+
var expr_dist_valbuildCoreExpr = require('./index-2f65eaa1.cjs.dev.js');
|
6
6
|
var createClass = require('./createClass-a436dbfe.cjs.dev.js');
|
7
7
|
var result = require('./result-48320acd.cjs.dev.js');
|
8
8
|
var ops = require('./ops-87cdbafc.cjs.dev.js');
|
@@ -297,264 +297,9 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
297
297
|
}]);
|
298
298
|
return RichTextSchema;
|
299
299
|
}(expr_dist_valbuildCoreExpr.Schema);
|
300
|
-
var richtext = function richtext() {
|
300
|
+
var richtext$1 = function richtext() {
|
301
301
|
return new RichTextSchema();
|
302
302
|
};
|
303
|
-
{
|
304
|
-
content("/test/richtext1", richtext(), {
|
305
|
-
children: [{
|
306
|
-
children: [{
|
307
|
-
detail: 0,
|
308
|
-
format: 0,
|
309
|
-
mode: "normal",
|
310
|
-
style: "",
|
311
|
-
text: "Heading 1",
|
312
|
-
type: "text",
|
313
|
-
version: 1
|
314
|
-
}],
|
315
|
-
direction: "ltr",
|
316
|
-
format: "",
|
317
|
-
indent: 0,
|
318
|
-
type: "heading",
|
319
|
-
version: 1,
|
320
|
-
tag: "h1"
|
321
|
-
}, {
|
322
|
-
children: [{
|
323
|
-
detail: 0,
|
324
|
-
format: 0,
|
325
|
-
mode: "normal",
|
326
|
-
style: "",
|
327
|
-
text: "Heading 2",
|
328
|
-
type: "text",
|
329
|
-
version: 1
|
330
|
-
}],
|
331
|
-
direction: "ltr",
|
332
|
-
format: "",
|
333
|
-
indent: 0,
|
334
|
-
type: "heading",
|
335
|
-
version: 1,
|
336
|
-
tag: "h2"
|
337
|
-
}, {
|
338
|
-
children: [],
|
339
|
-
direction: "ltr",
|
340
|
-
format: "",
|
341
|
-
indent: 0,
|
342
|
-
type: "paragraph",
|
343
|
-
version: 1
|
344
|
-
}, {
|
345
|
-
children: [{
|
346
|
-
detail: 0,
|
347
|
-
format: 0,
|
348
|
-
mode: "normal",
|
349
|
-
style: "",
|
350
|
-
text: "Normal",
|
351
|
-
type: "text",
|
352
|
-
version: 1
|
353
|
-
}],
|
354
|
-
direction: "ltr",
|
355
|
-
format: "",
|
356
|
-
indent: 0,
|
357
|
-
type: "paragraph",
|
358
|
-
version: 1
|
359
|
-
}, {
|
360
|
-
children: [{
|
361
|
-
detail: 0,
|
362
|
-
format: 0,
|
363
|
-
mode: "normal",
|
364
|
-
style: "font-size: 20px;",
|
365
|
-
text: "Normal Font size 20",
|
366
|
-
type: "text",
|
367
|
-
version: 1
|
368
|
-
}],
|
369
|
-
direction: "ltr",
|
370
|
-
format: "",
|
371
|
-
indent: 0,
|
372
|
-
type: "paragraph",
|
373
|
-
version: 1
|
374
|
-
}, {
|
375
|
-
children: [{
|
376
|
-
detail: 0,
|
377
|
-
format: 0,
|
378
|
-
mode: "normal",
|
379
|
-
style: "font-family: serif;",
|
380
|
-
text: "Normal font type serif",
|
381
|
-
type: "text",
|
382
|
-
version: 1
|
383
|
-
}],
|
384
|
-
direction: "ltr",
|
385
|
-
format: "",
|
386
|
-
indent: 0,
|
387
|
-
type: "paragraph",
|
388
|
-
version: 1
|
389
|
-
}, {
|
390
|
-
children: [{
|
391
|
-
detail: 0,
|
392
|
-
format: 1,
|
393
|
-
mode: "normal",
|
394
|
-
style: "font-family: serif;",
|
395
|
-
text: "Serif and bold",
|
396
|
-
type: "text",
|
397
|
-
version: 1
|
398
|
-
}],
|
399
|
-
direction: "ltr",
|
400
|
-
format: "",
|
401
|
-
indent: 0,
|
402
|
-
type: "paragraph",
|
403
|
-
version: 1
|
404
|
-
}, {
|
405
|
-
children: [{
|
406
|
-
detail: 0,
|
407
|
-
format: 2,
|
408
|
-
mode: "normal",
|
409
|
-
style: "",
|
410
|
-
text: "Arial and italic",
|
411
|
-
type: "text",
|
412
|
-
version: 1
|
413
|
-
}],
|
414
|
-
direction: "ltr",
|
415
|
-
format: "",
|
416
|
-
indent: 0,
|
417
|
-
type: "paragraph",
|
418
|
-
version: 1
|
419
|
-
}, {
|
420
|
-
children: [],
|
421
|
-
direction: null,
|
422
|
-
format: "",
|
423
|
-
indent: 0,
|
424
|
-
type: "paragraph",
|
425
|
-
version: 1
|
426
|
-
}, {
|
427
|
-
children: [{
|
428
|
-
children: [{
|
429
|
-
detail: 0,
|
430
|
-
format: 0,
|
431
|
-
mode: "normal",
|
432
|
-
style: "",
|
433
|
-
text: "Num list 1",
|
434
|
-
type: "text",
|
435
|
-
version: 1
|
436
|
-
}],
|
437
|
-
direction: "ltr",
|
438
|
-
format: "",
|
439
|
-
indent: 0,
|
440
|
-
type: "listitem",
|
441
|
-
version: 1,
|
442
|
-
value: 1
|
443
|
-
}, {
|
444
|
-
children: [{
|
445
|
-
detail: 0,
|
446
|
-
format: 0,
|
447
|
-
mode: "normal",
|
448
|
-
style: "",
|
449
|
-
text: "Num list 2",
|
450
|
-
type: "text",
|
451
|
-
version: 1
|
452
|
-
}
|
453
|
-
// TODO: image
|
454
|
-
// {
|
455
|
-
// altText: "",
|
456
|
-
// height: 0,
|
457
|
-
// maxWidth: 0,
|
458
|
-
// src: "https://picsum.photos/id/237/200/300",
|
459
|
-
// type: "image",
|
460
|
-
// version: 1,
|
461
|
-
// width: 0,
|
462
|
-
// },
|
463
|
-
],
|
464
|
-
|
465
|
-
direction: "ltr",
|
466
|
-
format: "",
|
467
|
-
indent: 0,
|
468
|
-
type: "listitem",
|
469
|
-
version: 1,
|
470
|
-
value: 2
|
471
|
-
}],
|
472
|
-
direction: "ltr",
|
473
|
-
format: "",
|
474
|
-
indent: 0,
|
475
|
-
type: "list",
|
476
|
-
version: 1,
|
477
|
-
listType: "number",
|
478
|
-
start: 1,
|
479
|
-
tag: "ol"
|
480
|
-
}, {
|
481
|
-
children: [],
|
482
|
-
direction: null,
|
483
|
-
format: "",
|
484
|
-
indent: 0,
|
485
|
-
type: "paragraph",
|
486
|
-
version: 1
|
487
|
-
}, {
|
488
|
-
children: [{
|
489
|
-
children: [{
|
490
|
-
detail: 0,
|
491
|
-
format: 0,
|
492
|
-
mode: "normal",
|
493
|
-
style: "",
|
494
|
-
text: "Bullet list 1",
|
495
|
-
type: "text",
|
496
|
-
version: 1
|
497
|
-
}],
|
498
|
-
direction: "ltr",
|
499
|
-
format: "",
|
500
|
-
indent: 0,
|
501
|
-
type: "listitem",
|
502
|
-
version: 1,
|
503
|
-
value: 1
|
504
|
-
}, {
|
505
|
-
children: [{
|
506
|
-
detail: 0,
|
507
|
-
format: 0,
|
508
|
-
mode: "normal",
|
509
|
-
style: "",
|
510
|
-
text: "Bullet list 2",
|
511
|
-
type: "text",
|
512
|
-
version: 1
|
513
|
-
}],
|
514
|
-
direction: "ltr",
|
515
|
-
format: "",
|
516
|
-
indent: 0,
|
517
|
-
type: "listitem",
|
518
|
-
version: 1,
|
519
|
-
value: 2
|
520
|
-
}],
|
521
|
-
direction: "ltr",
|
522
|
-
format: "",
|
523
|
-
indent: 0,
|
524
|
-
type: "list",
|
525
|
-
version: 1,
|
526
|
-
listType: "bullet",
|
527
|
-
start: 1,
|
528
|
-
tag: "ul"
|
529
|
-
}, {
|
530
|
-
children: [],
|
531
|
-
direction: null,
|
532
|
-
format: "",
|
533
|
-
indent: 0,
|
534
|
-
type: "paragraph",
|
535
|
-
version: 1
|
536
|
-
}, {
|
537
|
-
children: [],
|
538
|
-
direction: "ltr",
|
539
|
-
format: "",
|
540
|
-
indent: 0,
|
541
|
-
type: "paragraph",
|
542
|
-
version: 1
|
543
|
-
}, {
|
544
|
-
children: [],
|
545
|
-
direction: null,
|
546
|
-
format: "",
|
547
|
-
indent: 0,
|
548
|
-
type: "paragraph",
|
549
|
-
version: 1
|
550
|
-
}],
|
551
|
-
direction: "ltr",
|
552
|
-
format: "",
|
553
|
-
indent: 0,
|
554
|
-
type: "root",
|
555
|
-
version: 1
|
556
|
-
});
|
557
|
-
}
|
558
303
|
|
559
304
|
function content(
|
560
305
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
@@ -941,7 +686,7 @@ function initSchema(locales) {
|
|
941
686
|
number: number,
|
942
687
|
union: union,
|
943
688
|
oneOf: oneOf,
|
944
|
-
richtext: richtext,
|
689
|
+
richtext: richtext$1,
|
945
690
|
image: expr_dist_valbuildCoreExpr.image,
|
946
691
|
literal: literal,
|
947
692
|
i18n: i18n$1(locales)
|
@@ -1108,6 +853,20 @@ function isRemote(obj) {
|
|
1108
853
|
return createClass._typeof(obj) === "object" && obj !== null && expr_dist_valbuildCoreExpr.VAL_EXTENSION in obj && obj[expr_dist_valbuildCoreExpr.VAL_EXTENSION] === "remote" && REMOTE_REF_PROP in obj && typeof obj[REMOTE_REF_PROP] === "string";
|
1109
854
|
}
|
1110
855
|
|
856
|
+
function richtext(data) {
|
857
|
+
if (typeof data === "string") {
|
858
|
+
var _ref;
|
859
|
+
return _ref = {}, expr_dist_valbuildCoreExpr._defineProperty(_ref, expr_dist_valbuildCoreExpr.VAL_EXTENSION, "richtext"), expr_dist_valbuildCoreExpr._defineProperty(_ref, "type", "root"), expr_dist_valbuildCoreExpr._defineProperty(_ref, "children", [{
|
860
|
+
type: "paragraph",
|
861
|
+
children: [{
|
862
|
+
type: "text",
|
863
|
+
text: data
|
864
|
+
}]
|
865
|
+
}]), _ref;
|
866
|
+
}
|
867
|
+
return expr_dist_valbuildCoreExpr._objectSpread2(expr_dist_valbuildCoreExpr._objectSpread2({}, data), {}, expr_dist_valbuildCoreExpr._defineProperty({}, expr_dist_valbuildCoreExpr.VAL_EXTENSION, "richtext"));
|
868
|
+
}
|
869
|
+
|
1111
870
|
var initVal = function initVal(options) {
|
1112
871
|
var locales = options === null || options === void 0 ? void 0 : options.locales;
|
1113
872
|
var s = initSchema(locales === null || locales === void 0 ? void 0 : locales.required);
|
@@ -1120,7 +879,8 @@ var initVal = function initVal(options) {
|
|
1120
879
|
remote: remote,
|
1121
880
|
getPath: expr_dist_valbuildCoreExpr.getValPath,
|
1122
881
|
key: expr_dist_valbuildCoreExpr.getValPath,
|
1123
|
-
file: expr_dist_valbuildCoreExpr.file
|
882
|
+
file: expr_dist_valbuildCoreExpr.file,
|
883
|
+
richtext: richtext
|
1124
884
|
},
|
1125
885
|
fetchVal: fetchVal,
|
1126
886
|
s: s
|
@@ -1134,7 +894,8 @@ var initVal = function initVal(options) {
|
|
1134
894
|
remote: remote,
|
1135
895
|
getPath: expr_dist_valbuildCoreExpr.getValPath,
|
1136
896
|
key: expr_dist_valbuildCoreExpr.getValPath,
|
1137
|
-
file: expr_dist_valbuildCoreExpr.file
|
897
|
+
file: expr_dist_valbuildCoreExpr.file,
|
898
|
+
richtext: richtext
|
1138
899
|
},
|
1139
900
|
fetchVal: fetchVal,
|
1140
901
|
s: expr_dist_valbuildCoreExpr._objectSpread2(expr_dist_valbuildCoreExpr._objectSpread2({}, s), {}, {
|
@@ -1262,7 +1023,9 @@ var Internal = {
|
|
1262
1023
|
getVal: getVal,
|
1263
1024
|
getRawSource: getRawSource,
|
1264
1025
|
resolvePath: resolvePath,
|
1265
|
-
splitModuleIdAndModulePath: splitModuleIdAndModulePath
|
1026
|
+
splitModuleIdAndModulePath: splitModuleIdAndModulePath,
|
1027
|
+
fetchVal: fetchVal,
|
1028
|
+
isVal: expr_dist_valbuildCoreExpr.isVal
|
1266
1029
|
};
|
1267
1030
|
|
1268
1031
|
exports.FILE_REF_PROP = expr_dist_valbuildCoreExpr.FILE_REF_PROP;
|
@@ -1272,5 +1035,4 @@ exports.VAL_EXTENSION = expr_dist_valbuildCoreExpr.VAL_EXTENSION;
|
|
1272
1035
|
exports.expr = expr_dist_valbuildCoreExpr.index;
|
1273
1036
|
exports.Internal = Internal;
|
1274
1037
|
exports.derefPatch = derefPatch;
|
1275
|
-
exports.fetchVal = fetchVal;
|
1276
1038
|
exports.initVal = initVal;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
var expr_dist_valbuildCoreExpr = require('./index-
|
5
|
+
var expr_dist_valbuildCoreExpr = require('./index-104b3b67.cjs.prod.js');
|
6
6
|
var createClass = require('./createClass-de7426aa.cjs.prod.js');
|
7
7
|
var result = require('./result-26f67b40.cjs.prod.js');
|
8
8
|
var ops = require('./ops-ae4d1bc2.cjs.prod.js');
|
@@ -297,264 +297,9 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
|
|
297
297
|
}]);
|
298
298
|
return RichTextSchema;
|
299
299
|
}(expr_dist_valbuildCoreExpr.Schema);
|
300
|
-
var richtext = function richtext() {
|
300
|
+
var richtext$1 = function richtext() {
|
301
301
|
return new RichTextSchema();
|
302
302
|
};
|
303
|
-
{
|
304
|
-
content("/test/richtext1", richtext(), {
|
305
|
-
children: [{
|
306
|
-
children: [{
|
307
|
-
detail: 0,
|
308
|
-
format: 0,
|
309
|
-
mode: "normal",
|
310
|
-
style: "",
|
311
|
-
text: "Heading 1",
|
312
|
-
type: "text",
|
313
|
-
version: 1
|
314
|
-
}],
|
315
|
-
direction: "ltr",
|
316
|
-
format: "",
|
317
|
-
indent: 0,
|
318
|
-
type: "heading",
|
319
|
-
version: 1,
|
320
|
-
tag: "h1"
|
321
|
-
}, {
|
322
|
-
children: [{
|
323
|
-
detail: 0,
|
324
|
-
format: 0,
|
325
|
-
mode: "normal",
|
326
|
-
style: "",
|
327
|
-
text: "Heading 2",
|
328
|
-
type: "text",
|
329
|
-
version: 1
|
330
|
-
}],
|
331
|
-
direction: "ltr",
|
332
|
-
format: "",
|
333
|
-
indent: 0,
|
334
|
-
type: "heading",
|
335
|
-
version: 1,
|
336
|
-
tag: "h2"
|
337
|
-
}, {
|
338
|
-
children: [],
|
339
|
-
direction: "ltr",
|
340
|
-
format: "",
|
341
|
-
indent: 0,
|
342
|
-
type: "paragraph",
|
343
|
-
version: 1
|
344
|
-
}, {
|
345
|
-
children: [{
|
346
|
-
detail: 0,
|
347
|
-
format: 0,
|
348
|
-
mode: "normal",
|
349
|
-
style: "",
|
350
|
-
text: "Normal",
|
351
|
-
type: "text",
|
352
|
-
version: 1
|
353
|
-
}],
|
354
|
-
direction: "ltr",
|
355
|
-
format: "",
|
356
|
-
indent: 0,
|
357
|
-
type: "paragraph",
|
358
|
-
version: 1
|
359
|
-
}, {
|
360
|
-
children: [{
|
361
|
-
detail: 0,
|
362
|
-
format: 0,
|
363
|
-
mode: "normal",
|
364
|
-
style: "font-size: 20px;",
|
365
|
-
text: "Normal Font size 20",
|
366
|
-
type: "text",
|
367
|
-
version: 1
|
368
|
-
}],
|
369
|
-
direction: "ltr",
|
370
|
-
format: "",
|
371
|
-
indent: 0,
|
372
|
-
type: "paragraph",
|
373
|
-
version: 1
|
374
|
-
}, {
|
375
|
-
children: [{
|
376
|
-
detail: 0,
|
377
|
-
format: 0,
|
378
|
-
mode: "normal",
|
379
|
-
style: "font-family: serif;",
|
380
|
-
text: "Normal font type serif",
|
381
|
-
type: "text",
|
382
|
-
version: 1
|
383
|
-
}],
|
384
|
-
direction: "ltr",
|
385
|
-
format: "",
|
386
|
-
indent: 0,
|
387
|
-
type: "paragraph",
|
388
|
-
version: 1
|
389
|
-
}, {
|
390
|
-
children: [{
|
391
|
-
detail: 0,
|
392
|
-
format: 1,
|
393
|
-
mode: "normal",
|
394
|
-
style: "font-family: serif;",
|
395
|
-
text: "Serif and bold",
|
396
|
-
type: "text",
|
397
|
-
version: 1
|
398
|
-
}],
|
399
|
-
direction: "ltr",
|
400
|
-
format: "",
|
401
|
-
indent: 0,
|
402
|
-
type: "paragraph",
|
403
|
-
version: 1
|
404
|
-
}, {
|
405
|
-
children: [{
|
406
|
-
detail: 0,
|
407
|
-
format: 2,
|
408
|
-
mode: "normal",
|
409
|
-
style: "",
|
410
|
-
text: "Arial and italic",
|
411
|
-
type: "text",
|
412
|
-
version: 1
|
413
|
-
}],
|
414
|
-
direction: "ltr",
|
415
|
-
format: "",
|
416
|
-
indent: 0,
|
417
|
-
type: "paragraph",
|
418
|
-
version: 1
|
419
|
-
}, {
|
420
|
-
children: [],
|
421
|
-
direction: null,
|
422
|
-
format: "",
|
423
|
-
indent: 0,
|
424
|
-
type: "paragraph",
|
425
|
-
version: 1
|
426
|
-
}, {
|
427
|
-
children: [{
|
428
|
-
children: [{
|
429
|
-
detail: 0,
|
430
|
-
format: 0,
|
431
|
-
mode: "normal",
|
432
|
-
style: "",
|
433
|
-
text: "Num list 1",
|
434
|
-
type: "text",
|
435
|
-
version: 1
|
436
|
-
}],
|
437
|
-
direction: "ltr",
|
438
|
-
format: "",
|
439
|
-
indent: 0,
|
440
|
-
type: "listitem",
|
441
|
-
version: 1,
|
442
|
-
value: 1
|
443
|
-
}, {
|
444
|
-
children: [{
|
445
|
-
detail: 0,
|
446
|
-
format: 0,
|
447
|
-
mode: "normal",
|
448
|
-
style: "",
|
449
|
-
text: "Num list 2",
|
450
|
-
type: "text",
|
451
|
-
version: 1
|
452
|
-
}
|
453
|
-
// TODO: image
|
454
|
-
// {
|
455
|
-
// altText: "",
|
456
|
-
// height: 0,
|
457
|
-
// maxWidth: 0,
|
458
|
-
// src: "https://picsum.photos/id/237/200/300",
|
459
|
-
// type: "image",
|
460
|
-
// version: 1,
|
461
|
-
// width: 0,
|
462
|
-
// },
|
463
|
-
],
|
464
|
-
|
465
|
-
direction: "ltr",
|
466
|
-
format: "",
|
467
|
-
indent: 0,
|
468
|
-
type: "listitem",
|
469
|
-
version: 1,
|
470
|
-
value: 2
|
471
|
-
}],
|
472
|
-
direction: "ltr",
|
473
|
-
format: "",
|
474
|
-
indent: 0,
|
475
|
-
type: "list",
|
476
|
-
version: 1,
|
477
|
-
listType: "number",
|
478
|
-
start: 1,
|
479
|
-
tag: "ol"
|
480
|
-
}, {
|
481
|
-
children: [],
|
482
|
-
direction: null,
|
483
|
-
format: "",
|
484
|
-
indent: 0,
|
485
|
-
type: "paragraph",
|
486
|
-
version: 1
|
487
|
-
}, {
|
488
|
-
children: [{
|
489
|
-
children: [{
|
490
|
-
detail: 0,
|
491
|
-
format: 0,
|
492
|
-
mode: "normal",
|
493
|
-
style: "",
|
494
|
-
text: "Bullet list 1",
|
495
|
-
type: "text",
|
496
|
-
version: 1
|
497
|
-
}],
|
498
|
-
direction: "ltr",
|
499
|
-
format: "",
|
500
|
-
indent: 0,
|
501
|
-
type: "listitem",
|
502
|
-
version: 1,
|
503
|
-
value: 1
|
504
|
-
}, {
|
505
|
-
children: [{
|
506
|
-
detail: 0,
|
507
|
-
format: 0,
|
508
|
-
mode: "normal",
|
509
|
-
style: "",
|
510
|
-
text: "Bullet list 2",
|
511
|
-
type: "text",
|
512
|
-
version: 1
|
513
|
-
}],
|
514
|
-
direction: "ltr",
|
515
|
-
format: "",
|
516
|
-
indent: 0,
|
517
|
-
type: "listitem",
|
518
|
-
version: 1,
|
519
|
-
value: 2
|
520
|
-
}],
|
521
|
-
direction: "ltr",
|
522
|
-
format: "",
|
523
|
-
indent: 0,
|
524
|
-
type: "list",
|
525
|
-
version: 1,
|
526
|
-
listType: "bullet",
|
527
|
-
start: 1,
|
528
|
-
tag: "ul"
|
529
|
-
}, {
|
530
|
-
children: [],
|
531
|
-
direction: null,
|
532
|
-
format: "",
|
533
|
-
indent: 0,
|
534
|
-
type: "paragraph",
|
535
|
-
version: 1
|
536
|
-
}, {
|
537
|
-
children: [],
|
538
|
-
direction: "ltr",
|
539
|
-
format: "",
|
540
|
-
indent: 0,
|
541
|
-
type: "paragraph",
|
542
|
-
version: 1
|
543
|
-
}, {
|
544
|
-
children: [],
|
545
|
-
direction: null,
|
546
|
-
format: "",
|
547
|
-
indent: 0,
|
548
|
-
type: "paragraph",
|
549
|
-
version: 1
|
550
|
-
}],
|
551
|
-
direction: "ltr",
|
552
|
-
format: "",
|
553
|
-
indent: 0,
|
554
|
-
type: "root",
|
555
|
-
version: 1
|
556
|
-
});
|
557
|
-
}
|
558
303
|
|
559
304
|
function content(
|
560
305
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
@@ -941,7 +686,7 @@ function initSchema(locales) {
|
|
941
686
|
number: number,
|
942
687
|
union: union,
|
943
688
|
oneOf: oneOf,
|
944
|
-
richtext: richtext,
|
689
|
+
richtext: richtext$1,
|
945
690
|
image: expr_dist_valbuildCoreExpr.image,
|
946
691
|
literal: literal,
|
947
692
|
i18n: i18n$1(locales)
|
@@ -1108,6 +853,20 @@ function isRemote(obj) {
|
|
1108
853
|
return createClass._typeof(obj) === "object" && obj !== null && expr_dist_valbuildCoreExpr.VAL_EXTENSION in obj && obj[expr_dist_valbuildCoreExpr.VAL_EXTENSION] === "remote" && REMOTE_REF_PROP in obj && typeof obj[REMOTE_REF_PROP] === "string";
|
1109
854
|
}
|
1110
855
|
|
856
|
+
function richtext(data) {
|
857
|
+
if (typeof data === "string") {
|
858
|
+
var _ref;
|
859
|
+
return _ref = {}, expr_dist_valbuildCoreExpr._defineProperty(_ref, expr_dist_valbuildCoreExpr.VAL_EXTENSION, "richtext"), expr_dist_valbuildCoreExpr._defineProperty(_ref, "type", "root"), expr_dist_valbuildCoreExpr._defineProperty(_ref, "children", [{
|
860
|
+
type: "paragraph",
|
861
|
+
children: [{
|
862
|
+
type: "text",
|
863
|
+
text: data
|
864
|
+
}]
|
865
|
+
}]), _ref;
|
866
|
+
}
|
867
|
+
return expr_dist_valbuildCoreExpr._objectSpread2(expr_dist_valbuildCoreExpr._objectSpread2({}, data), {}, expr_dist_valbuildCoreExpr._defineProperty({}, expr_dist_valbuildCoreExpr.VAL_EXTENSION, "richtext"));
|
868
|
+
}
|
869
|
+
|
1111
870
|
var initVal = function initVal(options) {
|
1112
871
|
var locales = options === null || options === void 0 ? void 0 : options.locales;
|
1113
872
|
var s = initSchema(locales === null || locales === void 0 ? void 0 : locales.required);
|
@@ -1120,7 +879,8 @@ var initVal = function initVal(options) {
|
|
1120
879
|
remote: remote,
|
1121
880
|
getPath: expr_dist_valbuildCoreExpr.getValPath,
|
1122
881
|
key: expr_dist_valbuildCoreExpr.getValPath,
|
1123
|
-
file: expr_dist_valbuildCoreExpr.file
|
882
|
+
file: expr_dist_valbuildCoreExpr.file,
|
883
|
+
richtext: richtext
|
1124
884
|
},
|
1125
885
|
fetchVal: fetchVal,
|
1126
886
|
s: s
|
@@ -1134,7 +894,8 @@ var initVal = function initVal(options) {
|
|
1134
894
|
remote: remote,
|
1135
895
|
getPath: expr_dist_valbuildCoreExpr.getValPath,
|
1136
896
|
key: expr_dist_valbuildCoreExpr.getValPath,
|
1137
|
-
file: expr_dist_valbuildCoreExpr.file
|
897
|
+
file: expr_dist_valbuildCoreExpr.file,
|
898
|
+
richtext: richtext
|
1138
899
|
},
|
1139
900
|
fetchVal: fetchVal,
|
1140
901
|
s: expr_dist_valbuildCoreExpr._objectSpread2(expr_dist_valbuildCoreExpr._objectSpread2({}, s), {}, {
|
@@ -1262,7 +1023,9 @@ var Internal = {
|
|
1262
1023
|
getVal: getVal,
|
1263
1024
|
getRawSource: getRawSource,
|
1264
1025
|
resolvePath: resolvePath,
|
1265
|
-
splitModuleIdAndModulePath: splitModuleIdAndModulePath
|
1026
|
+
splitModuleIdAndModulePath: splitModuleIdAndModulePath,
|
1027
|
+
fetchVal: fetchVal,
|
1028
|
+
isVal: expr_dist_valbuildCoreExpr.isVal
|
1266
1029
|
};
|
1267
1030
|
|
1268
1031
|
exports.FILE_REF_PROP = expr_dist_valbuildCoreExpr.FILE_REF_PROP;
|
@@ -1272,5 +1035,4 @@ exports.VAL_EXTENSION = expr_dist_valbuildCoreExpr.VAL_EXTENSION;
|
|
1272
1035
|
exports.expr = expr_dist_valbuildCoreExpr.index;
|
1273
1036
|
exports.Internal = Internal;
|
1274
1037
|
exports.derefPatch = derefPatch;
|
1275
|
-
exports.fetchVal = fetchVal;
|
1276
1038
|
exports.initVal = initVal;
|