@valbuild/core 0.103.0 → 0.105.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/declarations/src/extractValModules.d.ts +54 -0
  2. package/dist/declarations/src/index.d.ts +3 -2
  3. package/dist/declarations/src/preview.d.ts +98 -0
  4. package/dist/declarations/src/render.d.ts +29 -91
  5. package/dist/declarations/src/schema/array.d.ts +22 -23
  6. package/dist/declarations/src/schema/boolean.d.ts +2 -2
  7. package/dist/declarations/src/schema/color.d.ts +2 -2
  8. package/dist/declarations/src/schema/date.d.ts +2 -2
  9. package/dist/declarations/src/schema/datetime.d.ts +2 -2
  10. package/dist/declarations/src/schema/file.d.ts +2 -2
  11. package/dist/declarations/src/schema/image.d.ts +2 -2
  12. package/dist/declarations/src/schema/index.d.ts +6 -6
  13. package/dist/declarations/src/schema/keyOf.d.ts +2 -2
  14. package/dist/declarations/src/schema/literal.d.ts +2 -2
  15. package/dist/declarations/src/schema/number.d.ts +2 -2
  16. package/dist/declarations/src/schema/object.d.ts +2 -2
  17. package/dist/declarations/src/schema/record.d.ts +19 -29
  18. package/dist/declarations/src/schema/richtext.d.ts +2 -2
  19. package/dist/declarations/src/schema/route.d.ts +2 -2
  20. package/dist/declarations/src/schema/string.d.ts +28 -17
  21. package/dist/declarations/src/schema/union.d.ts +2 -2
  22. package/dist/{index-267a8e9c.esm.js → index-005f51a5.esm.js} +277 -177
  23. package/dist/{index-3572060f.cjs.prod.js → index-4013c9f8.cjs.prod.js} +279 -177
  24. package/dist/{index-2e40f2ae.cjs.dev.js → index-baa3109b.cjs.dev.js} +279 -177
  25. package/dist/valbuild-core.cjs.dev.js +4 -2
  26. package/dist/valbuild-core.cjs.prod.js +4 -2
  27. package/dist/valbuild-core.esm.js +1 -1
  28. package/package.json +1 -1
  29. package/patch/dist/valbuild-core-patch.cjs.dev.js +1 -1
  30. package/patch/dist/valbuild-core-patch.cjs.prod.js +1 -1
  31. package/patch/dist/valbuild-core-patch.esm.js +2 -2
@@ -583,10 +583,10 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
583
583
  }, {
584
584
  key: "executeSerialize",
585
585
  value: function executeSerialize() {
586
- var _this$options4, _this$options5, _this$options6, _this$customValidateF, _this$customValidateF2;
586
+ var _this$renderInput, _this$options4, _this$options5, _this$options6, _this$customValidateF, _this$customValidateF2;
587
587
  return {
588
588
  type: "string",
589
- render: this.renderInput ? true : undefined,
589
+ render: (_this$renderInput = this.renderInput) !== null && _this$renderInput !== void 0 ? _this$renderInput : undefined,
590
590
  options: {
591
591
  maxLength: (_this$options4 = this.options) === null || _this$options4 === void 0 ? void 0 : _this$options4.maxLength,
592
592
  minLength: (_this$options5 = this.options) === null || _this$options5 === void 0 ? void 0 : _this$options5.minLength,
@@ -605,36 +605,28 @@ var StringSchema = /*#__PURE__*/function (_Schema) {
605
605
  description: this.description
606
606
  };
607
607
  }
608
+
609
+ /**
610
+ * How this field is laid out in the editor: a textarea, or a code editor for
611
+ * the given language.
612
+ *
613
+ * Static configuration, not a callback — see `render.ts`. What a CONTAINER
614
+ * shows for its items is a `preview`, which is a different thing entirely.
615
+ */
608
616
  }, {
609
617
  key: "render",
610
618
  value: function render(input) {
611
619
  return new StringSchema(this.options, this.opt, this.isRaw, this.customValidateFunctions, input, this.isReadonly, this.isHidden, this.description);
612
620
  }
621
+
622
+ /**
623
+ * Nothing: a string has no items, so there is nothing to preview. Its layout
624
+ * is a `render`, which travels in the serialized schema instead of through
625
+ * this pipeline.
626
+ */
613
627
  }, {
614
- key: "executeRender",
615
- value: function executeRender(sourcePath, src,
616
- // Accepted and unused: a string's render is a static layout hint
617
- // (`{as:"textarea"}` / `{as:"code",language}`) with no closure behind it, so
618
- // there is nothing a scope could prune. Declared so the signature is uniform
619
- // across every schema rather than something a reader has to check.
620
- _scope) {
621
- if (this.renderInput) {
622
- if (this.renderInput.as === "code") {
623
- return _defineProperty({}, sourcePath, {
624
- status: "success",
625
- data: {
626
- layout: this.renderInput.as,
627
- language: this.renderInput.language
628
- }
629
- });
630
- }
631
- return _defineProperty({}, sourcePath, {
632
- status: "success",
633
- data: {
634
- layout: this.renderInput.as
635
- }
636
- });
637
- }
628
+ key: "executePreview",
629
+ value: function executePreview() {
638
630
  return {};
639
631
  }
640
632
  }]);
@@ -829,8 +821,8 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
829
821
  };
830
822
  }
831
823
  }, {
832
- key: "executeRender",
833
- value: function executeRender(sourcePath, src, scope) {
824
+ key: "executePreview",
825
+ value: function executePreview(sourcePath, src, scope) {
834
826
  var res = {};
835
827
  if (src === null) {
836
828
  return res;
@@ -841,13 +833,13 @@ var ObjectSchema = /*#__PURE__*/function (_Schema) {
841
833
  continue;
842
834
  }
843
835
  var subPath = unsafeCreateSourcePath(sourcePath, _key3);
844
- // An object produces no render of its own, so it is pure recursion — and
836
+ // An object produces no preview of its own, so it is pure recursion — and
845
837
  // pruning it is the whole contribution: a field deep in one branch stops
846
- // paying for every sibling branch's renders.
838
+ // paying for every sibling branch's previews.
847
839
  if (scope !== undefined && !scope.wantsUnder(subPath)) {
848
840
  continue;
849
841
  }
850
- var itemResult = this.items[_key3]["executeRender"](subPath, itemSrc, scope);
842
+ var itemResult = this.items[_key3]["executePreview"](subPath, itemSrc, scope);
851
843
  for (var keyS in itemResult) {
852
844
  var _key4 = keyS;
853
845
  res[_key4] = itemResult[_key4];
@@ -874,7 +866,7 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
874
866
  var isReadonly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
875
867
  var isHidden = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
876
868
  var description = arguments.length > 5 ? arguments[5] : undefined;
877
- var renderInput = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
869
+ var previewInput = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : null;
878
870
  _classCallCheck(this, ArraySchema);
879
871
  _this = _callSuper(this, ArraySchema);
880
872
  _this.item = item;
@@ -883,19 +875,19 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
883
875
  _this.isReadonly = isReadonly;
884
876
  _this.isHidden = isHidden;
885
877
  _this.description = description;
886
- _this.renderInput = renderInput;
878
+ _this.previewInput = previewInput;
887
879
  return _this;
888
880
  }
889
881
  _inherits(ArraySchema, _Schema);
890
882
  return _createClass(ArraySchema, [{
891
883
  key: "describe",
892
884
  value: function describe(description) {
893
- return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined, this.renderInput);
885
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined, this.previewInput);
894
886
  }
895
887
  }, {
896
888
  key: "validate",
897
889
  value: function validate(validationFunction) {
898
- return new ArraySchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description, this.renderInput);
890
+ return new ArraySchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.isReadonly, this.isHidden, this.description, this.previewInput);
899
891
  }
900
892
  }, {
901
893
  key: "executeValidate",
@@ -962,17 +954,17 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
962
954
  }, {
963
955
  key: "nullable",
964
956
  value: function nullable() {
965
- return new ArraySchema(this.item, true, [], this.isReadonly, this.isHidden, this.description, this.renderInput);
957
+ return new ArraySchema(this.item, true, [], this.isReadonly, this.isHidden, this.description, this.previewInput);
966
958
  }
967
959
  }, {
968
960
  key: "readonly",
969
961
  value: function readonly() {
970
- return new ArraySchema(this.item, this.opt, this.customValidateFunctions, true, this.isHidden, this.description, this.renderInput);
962
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, true, this.isHidden, this.description, this.previewInput);
971
963
  }
972
964
  }, {
973
965
  key: "hidden",
974
966
  value: function hidden() {
975
- return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description, this.renderInput);
967
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, true, this.description, this.previewInput);
976
968
  }
977
969
  }, {
978
970
  key: "executeCustomValidateAt",
@@ -989,7 +981,7 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
989
981
  type: "array",
990
982
  item: this.item["executeSerialize"](),
991
983
  opt: this.opt,
992
- render: this.renderInput ? true : undefined,
984
+ preview: this.previewInput ? true : undefined,
993
985
  customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
994
986
  readonly: this.isReadonly,
995
987
  hidden: this.isHidden,
@@ -997,8 +989,8 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
997
989
  };
998
990
  }
999
991
  }, {
1000
- key: "executeRender",
1001
- value: function executeRender(sourcePath, src, scope) {
992
+ key: "executePreview",
993
+ value: function executePreview(sourcePath, src, scope) {
1002
994
  var res = {};
1003
995
  if (src === null) {
1004
996
  return res;
@@ -1013,26 +1005,18 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1013
1005
  if (scope !== undefined && !scope.wantsUnder(subPath)) {
1014
1006
  continue;
1015
1007
  }
1016
- var itemResult = this.item["executeRender"](subPath, itemSrc, scope);
1008
+ var itemResult = this.item["executePreview"](subPath, itemSrc, scope);
1017
1009
  for (var keyS in itemResult) {
1018
1010
  var _key = keyS;
1019
1011
  res[_key] = itemResult[_key];
1020
1012
  }
1021
1013
  }
1022
- if (this.renderInput) {
1023
- var _this$renderInput = this.renderInput,
1024
- select = _this$renderInput.select,
1025
- layout = _this$renderInput.as;
1026
- if (layout !== "list") {
1027
- res[sourcePath] = {
1028
- status: "error",
1029
- message: "Unknown layout type: " + layout
1030
- };
1031
- }
1014
+ if (this.previewInput) {
1015
+ var select = this.previewInput;
1032
1016
  // The whole list when the LIST is what is being shown; only the wanted
1033
- // rows when it is not. `select` is the user's closure and the real expense
1034
- // — a list view asks for the container and gets every row, a single field
1035
- // asks for its own path and costs one call.
1017
+ // rows when it is not. The user's closure is the real expense — a list
1018
+ // view asks for the container and gets every row, a single field asks for
1019
+ // its own path and costs one call.
1036
1020
  // Non-null once, as a value, rather than a boolean the compiler cannot
1037
1021
  // tie back to `scope`: no scope and a scope that wants this exact path
1038
1022
  // both mean the whole list, and anything else is a window.
@@ -1042,10 +1026,10 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1042
1026
  if (window !== null && !window.wantsUnder(unsafeCreateSourcePath(sourcePath, index))) {
1043
1027
  continue;
1044
1028
  }
1045
- // Per ITEM, not per list, matching what `record` already does: `select`
1046
- // is user code, and one row whose data trips it up must not take out the
1047
- // whole list. Before scoping, one throwing row produced an error at the
1048
- // container and no items at all.
1029
+ // Per ITEM, not per list, matching what `record` already does: the
1030
+ // closure is user code, and one row whose data trips it up must not take
1031
+ // out the whole list. Before scoping, one throwing row produced an error
1032
+ // at the container and no items at all.
1049
1033
  try {
1050
1034
  // NB NB: display is actually defined by the user
1051
1035
  var _select = select({
@@ -1069,7 +1053,6 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1069
1053
  res[sourcePath] = {
1070
1054
  status: "success",
1071
1055
  data: {
1072
- layout: "list",
1073
1056
  parent: "array",
1074
1057
  items: items
1075
1058
  }
@@ -1077,10 +1060,18 @@ var ArraySchema = /*#__PURE__*/function (_Schema) {
1077
1060
  }
1078
1061
  return res;
1079
1062
  }
1063
+
1064
+ /**
1065
+ * What the editor shows for each ITEM of this array: a title, and optionally a
1066
+ * subtitle and an image.
1067
+ *
1068
+ * `select` is your own code over the item's source, so it is run on demand for
1069
+ * the rows that are actually being looked at — see `PreviewScope`.
1070
+ */
1080
1071
  }, {
1081
- key: "render",
1082
- value: function render(input) {
1083
- return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description, input);
1072
+ key: "preview",
1073
+ value: function preview(select) {
1074
+ return new ArraySchema(this.item, this.opt, this.customValidateFunctions, this.isReadonly, this.isHidden, this.description, select);
1084
1075
  }
1085
1076
  }]);
1086
1077
  }(Schema);
@@ -1212,8 +1203,8 @@ var LiteralSchema = /*#__PURE__*/function (_Schema) {
1212
1203
  };
1213
1204
  }
1214
1205
  }, {
1215
- key: "executeRender",
1216
- value: function executeRender() {
1206
+ key: "executePreview",
1207
+ value: function executePreview() {
1217
1208
  return {};
1218
1209
  }
1219
1210
  }]);
@@ -1646,8 +1637,8 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1646
1637
  };
1647
1638
  }
1648
1639
  }, {
1649
- key: "executeRender",
1650
- value: function executeRender(sourcePath, src, scope) {
1640
+ key: "executePreview",
1641
+ value: function executePreview(sourcePath, src, scope) {
1651
1642
  var res = {};
1652
1643
  if (src === null) {
1653
1644
  return res;
@@ -1669,7 +1660,7 @@ var UnionSchema = /*#__PURE__*/function (_Schema) {
1669
1660
  return false;
1670
1661
  });
1671
1662
  if (thisSchema) {
1672
- var itemResult = thisSchema["executeRender"](sourcePath, src, scope);
1663
+ var itemResult = thisSchema["executePreview"](sourcePath, src, scope);
1673
1664
  for (var keyS in itemResult) {
1674
1665
  var _key3 = keyS;
1675
1666
  res[_key3] = itemResult[_key3];
@@ -2132,8 +2123,8 @@ var ImageSchema = /*#__PURE__*/function (_Schema) {
2132
2123
  };
2133
2124
  }
2134
2125
  }, {
2135
- key: "executeRender",
2136
- value: function executeRender() {
2126
+ key: "executePreview",
2127
+ value: function executePreview() {
2137
2128
  return {};
2138
2129
  }
2139
2130
  }]);
@@ -2329,8 +2320,8 @@ var RouteSchema = /*#__PURE__*/function (_Schema) {
2329
2320
  };
2330
2321
  }
2331
2322
  }, {
2332
- key: "executeRender",
2333
- value: function executeRender() {
2323
+ key: "executePreview",
2324
+ value: function executePreview() {
2334
2325
  return {};
2335
2326
  }
2336
2327
  }]);
@@ -2888,8 +2879,8 @@ var RichTextSchema = /*#__PURE__*/function (_Schema) {
2888
2879
  };
2889
2880
  }
2890
2881
  }, {
2891
- key: "executeRender",
2892
- value: function executeRender() {
2882
+ key: "executePreview",
2883
+ value: function executePreview() {
2893
2884
  return {};
2894
2885
  }
2895
2886
  }]);
@@ -3222,7 +3213,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3222
3213
  var isHidden = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
3223
3214
  var description = arguments.length > 8 ? arguments[8] : undefined;
3224
3215
  var isJsonValues = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
3225
- var renderInput = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : null;
3216
+ var previewInput = arguments.length > 10 && arguments[10] !== undefined ? arguments[10] : null;
3226
3217
  _classCallCheck(this, RecordSchema);
3227
3218
  _this = _callSuper(this, RecordSchema);
3228
3219
  _this.item = item;
@@ -3235,19 +3226,19 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3235
3226
  _this.isHidden = isHidden;
3236
3227
  _this.description = description;
3237
3228
  _this.isJsonValues = isJsonValues;
3238
- _this.renderInput = renderInput;
3229
+ _this.previewInput = previewInput;
3239
3230
  return _this;
3240
3231
  }
3241
3232
  _inherits(RecordSchema, _Schema);
3242
3233
  return _createClass(RecordSchema, [{
3243
3234
  key: "describe",
3244
3235
  value: function describe(description) {
3245
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined, this.isJsonValues, this.renderInput);
3236
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, description !== null && description !== void 0 ? description : undefined, this.isJsonValues, this.previewInput);
3246
3237
  }
3247
3238
  }, {
3248
3239
  key: "validate",
3249
3240
  value: function validate(validationFunction) {
3250
- return new RecordSchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.renderInput);
3241
+ return new RecordSchema(this.item, this.opt, [].concat(_toConsumableArray(this.customValidateFunctions), [validationFunction]), this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.previewInput);
3251
3242
  }
3252
3243
  }, {
3253
3244
  key: "executeValidate",
@@ -3606,29 +3597,29 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3606
3597
  }, {
3607
3598
  key: "nullable",
3608
3599
  value: function nullable() {
3609
- return new RecordSchema(this.item, true, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.renderInput);
3600
+ return new RecordSchema(this.item, true, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.previewInput);
3610
3601
  }
3611
3602
  }, {
3612
3603
  key: "readonly",
3613
3604
  value: function readonly() {
3614
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, true, this.isHidden, this.description, this.isJsonValues, this.renderInput);
3605
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, true, this.isHidden, this.description, this.isJsonValues, this.previewInput);
3615
3606
  }
3616
3607
  }, {
3617
3608
  key: "hidden",
3618
3609
  value: function hidden() {
3619
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, true, this.description, this.isJsonValues, this.renderInput);
3610
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, true, this.description, this.isJsonValues, this.previewInput);
3620
3611
  }
3621
3612
  }, {
3622
3613
  key: "router",
3623
3614
  value: function router(_router) {
3624
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, _router, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.renderInput);
3615
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, _router, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.previewInput);
3625
3616
  }
3626
3617
  }, {
3627
3618
  key: "remote",
3628
3619
  value: function remote() {
3629
3620
  return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions ? _objectSpread2(_objectSpread2({}, this.mediaOptions), {}, {
3630
3621
  remote: true
3631
- }) : undefined, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.renderInput);
3622
+ }) : undefined, this.isReadonly, this.isHidden, this.description, this.isJsonValues, this.previewInput);
3632
3623
  }
3633
3624
 
3634
3625
  /**
@@ -3660,7 +3651,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3660
3651
  }
3661
3652
  return new RecordSchema(this.item, this.opt,
3662
3653
  // Empty by construction: the guard above rejects any that were registered.
3663
- [], this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, true, this.renderInput);
3654
+ [], this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, true, this.previewInput);
3664
3655
  }
3665
3656
  }, {
3666
3657
  key: "getRouterValidations",
@@ -3720,7 +3711,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3720
3711
  item: this.item["executeSerialize"](),
3721
3712
  key: (_this$keySchema = this.keySchema) === null || _this$keySchema === void 0 ? void 0 : _this$keySchema["executeSerialize"](),
3722
3713
  opt: this.opt,
3723
- render: this.renderInput ? true : undefined,
3714
+ preview: this.previewInput ? true : undefined,
3724
3715
  router: (_this$currentRouter = this.currentRouter) === null || _this$currentRouter === void 0 ? void 0 : _this$currentRouter.getRouterId(),
3725
3716
  customValidate: this.customValidateFunctions && ((_this$customValidateF = this.customValidateFunctions) === null || _this$customValidateF === void 0 ? void 0 : _this$customValidateF.length) > 0,
3726
3717
  jsonValues: this.isJsonValues ? true : undefined,
@@ -3752,8 +3743,8 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3752
3743
  return this.item["executeValidate"](path, content);
3753
3744
  }
3754
3745
  }, {
3755
- key: "executeRender",
3756
- value: function executeRender(sourcePath, src, scope) {
3746
+ key: "executePreview",
3747
+ value: function executePreview(sourcePath, src, scope) {
3757
3748
  var res = {};
3758
3749
  if (src === null) {
3759
3750
  return res;
@@ -3765,31 +3756,23 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3765
3756
  }
3766
3757
  if (isJson(itemSrc)) {
3767
3758
  // An un-loaded `.jsonValues()` entry: an opaque marker, not the item this
3768
- // schema describes. Skipping it is what makes rendering a partially
3759
+ // schema describes. Skipping it is what makes previewing a partially
3769
3760
  // loaded record work — the result comes out covering exactly the loaded
3770
- // keys, and the caller renders a placeholder for the rest.
3761
+ // keys, and the caller shows a placeholder for the rest.
3771
3762
  continue;
3772
3763
  }
3773
3764
  var subPath = unsafeCreateSourcePath(sourcePath, _key);
3774
3765
  if (scope !== undefined && !scope.wantsUnder(subPath)) {
3775
3766
  continue;
3776
3767
  }
3777
- var itemResult = this.item["executeRender"](subPath, itemSrc, scope);
3768
+ var itemResult = this.item["executePreview"](subPath, itemSrc, scope);
3778
3769
  for (var keyS in itemResult) {
3779
3770
  var _key2 = keyS;
3780
3771
  res[_key2] = itemResult[_key2];
3781
3772
  }
3782
3773
  }
3783
- if (this.renderInput) {
3784
- var _this$renderInput = this.renderInput,
3785
- prepare = _this$renderInput.select,
3786
- layout = _this$renderInput.layout;
3787
- if (layout !== "list") {
3788
- res[sourcePath] = {
3789
- status: "error",
3790
- message: "Unknown layout type: " + layout
3791
- };
3792
- }
3774
+ if (this.previewInput) {
3775
+ var prepare = this.previewInput;
3793
3776
  // See the same block in `array`: the whole record when the record is what
3794
3777
  // is being shown, only the wanted entries when it is not.
3795
3778
  var window = scope !== undefined && !scope.wants(sourcePath) ? scope : null;
@@ -3804,7 +3787,7 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3804
3787
  if (window !== null && !window.wantsUnder(unsafeCreateSourcePath(sourcePath, _key3))) {
3805
3788
  continue;
3806
3789
  }
3807
- // Per KEY, not per record: `select` is user code, and one entry whose
3790
+ // Per KEY, not per record: the closure is user code, and one entry whose
3808
3791
  // data trips it up must not take out the whole list.
3809
3792
  try {
3810
3793
  // NB NB: display is actually defined by the user
@@ -3830,7 +3813,6 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3830
3813
  res[sourcePath] = {
3831
3814
  status: "success",
3832
3815
  data: {
3833
- layout: "list",
3834
3816
  parent: "record",
3835
3817
  items: items
3836
3818
  }
@@ -3838,13 +3820,19 @@ var RecordSchema = /*#__PURE__*/function (_Schema) {
3838
3820
  }
3839
3821
  return res;
3840
3822
  }
3823
+
3824
+ /**
3825
+ * What the editor shows for each ENTRY of this record: a title, and optionally
3826
+ * a subtitle and an image.
3827
+ *
3828
+ * `select` is your own code over the entry's key and source, so it is run on
3829
+ * demand for the entries that are actually being looked at — see
3830
+ * `PreviewScope`.
3831
+ */
3841
3832
  }, {
3842
- key: "render",
3843
- value: function render(input) {
3844
- return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, {
3845
- layout: input.as,
3846
- select: input.select
3847
- });
3833
+ key: "preview",
3834
+ value: function preview(select) {
3835
+ return new RecordSchema(this.item, this.opt, this.customValidateFunctions, this.currentRouter, this.keySchema, this.mediaOptions, this.isReadonly, this.isHidden, this.description, this.isJsonValues, select);
3848
3836
  }
3849
3837
  }]);
3850
3838
  }(Schema);
@@ -4537,8 +4525,8 @@ var NumberSchema = /*#__PURE__*/function (_Schema) {
4537
4525
  };
4538
4526
  }
4539
4527
  }, {
4540
- key: "executeRender",
4541
- value: function executeRender() {
4528
+ key: "executePreview",
4529
+ value: function executePreview() {
4542
4530
  return {};
4543
4531
  }
4544
4532
  }]);
@@ -4657,8 +4645,8 @@ var BooleanSchema = /*#__PURE__*/function (_Schema) {
4657
4645
  };
4658
4646
  }
4659
4647
  }, {
4660
- key: "executeRender",
4661
- value: function executeRender() {
4648
+ key: "executePreview",
4649
+ value: function executePreview() {
4662
4650
  return {};
4663
4651
  }
4664
4652
  }]);
@@ -4881,8 +4869,8 @@ var KeyOfSchema = /*#__PURE__*/function (_Schema) {
4881
4869
  };
4882
4870
  }
4883
4871
  }, {
4884
- key: "executeRender",
4885
- value: function executeRender() {
4872
+ key: "executePreview",
4873
+ value: function executePreview() {
4886
4874
  return {};
4887
4875
  }
4888
4876
  }]);
@@ -5165,8 +5153,8 @@ var FileSchema = /*#__PURE__*/function (_Schema) {
5165
5153
  };
5166
5154
  }
5167
5155
  }, {
5168
- key: "executeRender",
5169
- value: function executeRender() {
5156
+ key: "executePreview",
5157
+ value: function executePreview() {
5170
5158
  return {};
5171
5159
  }
5172
5160
  }]);
@@ -5396,8 +5384,8 @@ var DateSchema = /*#__PURE__*/function (_Schema) {
5396
5384
  };
5397
5385
  }
5398
5386
  }, {
5399
- key: "executeRender",
5400
- value: function executeRender() {
5387
+ key: "executePreview",
5388
+ value: function executePreview() {
5401
5389
  return {};
5402
5390
  }
5403
5391
  }]);
@@ -5600,8 +5588,8 @@ var DateTimeSchema = /*#__PURE__*/function (_Schema) {
5600
5588
  };
5601
5589
  }
5602
5590
  }, {
5603
- key: "executeRender",
5604
- value: function executeRender() {
5591
+ key: "executePreview",
5592
+ value: function executePreview() {
5605
5593
  return {};
5606
5594
  }
5607
5595
  }]);
@@ -6241,8 +6229,8 @@ var ColorSchema = /*#__PURE__*/function (_Schema) {
6241
6229
  };
6242
6230
  }
6243
6231
  }, {
6244
- key: "executeRender",
6245
- value: function executeRender() {
6232
+ key: "executePreview",
6233
+ value: function executePreview() {
6246
6234
  return {};
6247
6235
  }
6248
6236
  }]);
@@ -6822,6 +6810,84 @@ function collectObjectRecursive(item, collector) {
6822
6810
  }
6823
6811
  }
6824
6812
 
6813
+ /**
6814
+ * One module's contribution to the SHAs, in fold order.
6815
+ *
6816
+ * The SHAs are a FOLD, not a hash of a set: each module is mixed into the
6817
+ * running value in `val.modules` order, so reproducing one means replaying the
6818
+ * same modules with the same inputs in the same order. That is what this type
6819
+ * is for — see {@link computeValModuleShas}.
6820
+ */
6821
+
6822
+ /**
6823
+ * The SHAs, from the entries they are a fold over.
6824
+ *
6825
+ * Split out from {@link extractValModules} because there are two ways to arrive
6826
+ * at a set of sources. Extraction evaluates the modules; the server also
6827
+ * PROMOTES the sources it has just written to disk, because re-evaluating gets
6828
+ * it nothing — a module `def` is the app's own `import()`, which resolves from
6829
+ * the module registry rather than from the file that was just rewritten. Both
6830
+ * have to produce SHAs the other side can compare, so the fold has one
6831
+ * implementation and both call it.
6832
+ *
6833
+ * Feeding back the entries a previous fold used, unchanged, reproduces its SHAs
6834
+ * exactly. That is the property the promotion relies on: only the modules whose
6835
+ * source actually moved change anything.
6836
+ */
6837
+ function computeValModuleShas(config, entries, moduleErrors) {
6838
+ var configSha = hash(JSON.stringify(config));
6839
+ var sourcesSha = "";
6840
+ var baseSha = configSha;
6841
+ // NOTE: schemaSha is deliberately NOT seeded with configSha. It is compared
6842
+ // across bundles (the server extracts from the Node bundle, the editor SPA
6843
+ // from the browser bundle) to detect that a new version has been deployed.
6844
+ // The config contains values that are not part of the schema and that differ
6845
+ // between those two bundles - most notably the documented
6846
+ // `gitCommit: process.env.VERCEL_GIT_COMMIT_SHA` / `gitBranch`, which are
6847
+ // server-only env vars and therefore `undefined` in the browser. Seeding with
6848
+ // them made the two sides disagree on every production load.
6849
+ var schemaSha = "";
6850
+ var _iterator = result._createForOfIteratorHelper(entries),
6851
+ _step;
6852
+ try {
6853
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
6854
+ var entry = _step.value;
6855
+ var path = entry.path,
6856
+ source = entry.source,
6857
+ serializedSchema = entry.serializedSchema;
6858
+ sourcesSha = hash(sourcesSha + JSON.stringify({
6859
+ path: path,
6860
+ source: source
6861
+ }));
6862
+ baseSha = hash(baseSha + JSON.stringify({
6863
+ path: path,
6864
+ schema: serializedSchema,
6865
+ source: source,
6866
+ modulesErrors: moduleErrors.slice(0, entry.moduleErrorsAt)
6867
+ }));
6868
+ // The PATH is part of the schema set, not just the schema: renaming a
6869
+ // module while leaving its schema byte-identical still changes which paths
6870
+ // exist, and an open client keyed its schema cache by the old path. Hashing
6871
+ // the schema alone left this SHA unchanged, so with no commitSha to fall
6872
+ // back on the client never refetched /schema.
6873
+ schemaSha = hash(schemaSha + JSON.stringify({
6874
+ path: path,
6875
+ schema: serializedSchema
6876
+ }));
6877
+ }
6878
+ } catch (err) {
6879
+ _iterator.e(err);
6880
+ } finally {
6881
+ _iterator.f();
6882
+ }
6883
+ return {
6884
+ baseSha: baseSha,
6885
+ schemaSha: schemaSha,
6886
+ sourcesSha: sourcesSha,
6887
+ configSha: configSha
6888
+ };
6889
+ }
6890
+
6825
6891
  /**
6826
6892
  * Extracts schemas and sources from a ValModules registry and computes the
6827
6893
  * deterministic SHAs that the server and client both use to detect changes.
@@ -6834,7 +6900,7 @@ function extractValModules(_x) {
6834
6900
  }
6835
6901
  function _extractValModules() {
6836
6902
  _extractValModules = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(valModules) {
6837
- var moduleErrors, addModuleError, sources, schemas, serializedSchemas, configSha, sourcesSha, baseSha, schemaSha, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM, _t, _t2;
6903
+ var moduleErrors, addModuleError, sources, schemas, serializedSchemas, shaEntries, moduleIdx, module, at, value, path, schema, source, serializedSchema, pathM, _t, _t2;
6838
6904
  return _regenerator().w(function (_context) {
6839
6905
  while (1) switch (_context.p = _context.n) {
6840
6906
  case 0:
@@ -6849,17 +6915,15 @@ function _extractValModules() {
6849
6915
  sources = {};
6850
6916
  schemas = {};
6851
6917
  serializedSchemas = {};
6852
- configSha = hash(JSON.stringify(valModules.config));
6853
- sourcesSha = "";
6854
- baseSha = configSha; // NOTE: schemaSha is deliberately NOT seeded with configSha. It is compared
6855
- // across bundles (the server extracts from the Node bundle, the editor SPA
6856
- // from the browser bundle) to detect that a new version has been deployed.
6857
- // The config contains values that are not part of the schema and that differ
6858
- // between those two bundles - most notably the documented
6859
- // `gitCommit: process.env.VERCEL_GIT_COMMIT_SHA` / `gitBranch`, which are
6860
- // server-only env vars and therefore `undefined` in the browser. Seeding with
6861
- // them made the two sides disagree on every production load.
6862
- schemaSha = "";
6918
+ /**
6919
+ * What the fold below runs over, collected here rather than hashed inline.
6920
+ *
6921
+ * The hashing itself moved to `computeValModuleShas`, so the server can
6922
+ * recompute these SHAs for sources it did not get by evaluating the modules.
6923
+ * Collected in loop order, which is `val.modules` order, which is the order
6924
+ * the fold is defined by.
6925
+ */
6926
+ shaEntries = [];
6863
6927
  moduleIdx = 0;
6864
6928
  case 1:
6865
6929
  if (!(moduleIdx < valModules.modules.length)) {
@@ -6962,40 +7026,27 @@ function _extractValModules() {
6962
7026
  sources[pathM] = source;
6963
7027
  schemas[pathM] = schema;
6964
7028
  serializedSchemas[pathM] = serializedSchema;
6965
- sourcesSha = hash(sourcesSha + JSON.stringify({
6966
- path: path,
6967
- source: source
6968
- }));
6969
- baseSha = hash(baseSha + JSON.stringify({
6970
- path: path,
6971
- schema: serializedSchema,
7029
+ shaEntries.push({
7030
+ path: pathM,
6972
7031
  source: source,
6973
- modulesErrors: moduleErrors
6974
- }));
6975
- // The PATH is part of the schema set, not just the schema: renaming a
6976
- // module while leaving its schema byte-identical still changes which paths
6977
- // exist, and an open client keyed its schema cache by the old path. Hashing
6978
- // the schema alone left this SHA unchanged, so with no commitSha to fall
6979
- // back on the client never refetched /schema.
6980
- schemaSha = hash(schemaSha + JSON.stringify({
6981
- path: path,
6982
- schema: serializedSchema
6983
- }));
7032
+ serializedSchema: serializedSchema,
7033
+ // The errors so far, which is what the base SHA used to mix in by hashing
7034
+ // the live array at this point in the loop. See `moduleErrorsAt`.
7035
+ moduleErrorsAt: moduleErrors.length
7036
+ });
6984
7037
  case 17:
6985
7038
  moduleIdx++;
6986
7039
  _context.n = 1;
6987
7040
  break;
6988
7041
  case 18:
6989
- return _context.a(2, {
7042
+ return _context.a(2, _objectSpread2(_objectSpread2({
6990
7043
  sources: sources,
6991
7044
  schemas: schemas,
6992
- serializedSchemas: serializedSchemas,
6993
- baseSha: baseSha,
6994
- schemaSha: schemaSha,
6995
- sourcesSha: sourcesSha,
6996
- configSha: configSha,
6997
- moduleErrors: moduleErrors
6998
- });
7045
+ serializedSchemas: serializedSchemas
7046
+ }, computeValModuleShas(valModules.config, shaEntries, moduleErrors)), {}, {
7047
+ moduleErrors: moduleErrors,
7048
+ shaEntries: shaEntries
7049
+ }));
6999
7050
  }
7000
7051
  }, _callee, null, [[14, 15], [4, 6]]);
7001
7052
  }));
@@ -8021,13 +8072,16 @@ function deserializeSchema(serialized) {
8021
8072
  return schema;
8022
8073
  }
8023
8074
  function deserializeSchemaImpl(serialized) {
8024
- var _serialized$options, _serialized$options2, _serialized$accept, _serialized$directory, _serialized$remote, _serialized$jsonValue;
8075
+ var _serialized$options, _serialized$options2, _serialized$render, _serialized$accept, _serialized$directory, _serialized$remote, _serialized$jsonValue;
8025
8076
  switch (serialized.type) {
8026
8077
  case "string":
8027
8078
  return new StringSchema(_objectSpread2(_objectSpread2({}, serialized.options), {}, {
8028
8079
  regexp: ((_serialized$options = serialized.options) === null || _serialized$options === void 0 ? void 0 : _serialized$options.regexp) && new RegExp(serialized.options.regexp.source, serialized.options.regexp.flags),
8029
8080
  regExpMessage: (_serialized$options2 = serialized.options) === null || _serialized$options2 === void 0 || (_serialized$options2 = _serialized$options2.regexp) === null || _serialized$options2 === void 0 ? void 0 : _serialized$options2.message
8030
- }), serialized.opt, serialized.raw, [], null, false, false, serialized.description);
8081
+ }), serialized.opt, serialized.raw, [], // A render is static data, so it survives serialization and must be
8082
+ // carried back: it is the schema's own configuration now, not something
8083
+ // recomputed from an instance.
8084
+ (_serialized$render = serialized.render) !== null && _serialized$render !== void 0 ? _serialized$render : null, false, false, serialized.description);
8031
8085
  case "literal":
8032
8086
  return new LiteralSchema(serialized.value, serialized.opt, [], false, false, serialized.description);
8033
8087
  case "boolean":
@@ -8104,31 +8158,46 @@ function deserializeSchemaImpl(serialized) {
8104
8158
  }
8105
8159
  }
8106
8160
 
8107
- // TODO: we want to change layout -> as to be more consistent across the board
8108
-
8109
- // Main render type:
8161
+ /**
8162
+ * What a container shows for ONE of its items: the user's `preview` callback
8163
+ * returns this, and the Studio draws a row from it.
8164
+ *
8165
+ * NB: {@link ArrayPreview} / {@link RecordPreview} name the DATA a container
8166
+ * previews with. The Studio also has React components called `ArrayPreview` /
8167
+ * `RecordPreview` (the fallback rendering of an array / record field, part of
8168
+ * the `<Type>Preview` convention in `components/Preview.tsx`). They do not
8169
+ * collide today because no file needs both - if one ever does, alias this type
8170
+ * at the import rather than renaming that convention.
8171
+ */
8110
8172
 
8111
- //
8173
+ /**
8174
+ * Main preview type.
8175
+ *
8176
+ * Deliberately not exported: `parent` is the discriminant, and every consumer
8177
+ * narrows on it rather than on the union as a whole. There is no `layout` here
8178
+ * on purpose - how a preview is laid out is the editor's business, not the
8179
+ * schema's.
8180
+ */
8112
8181
 
8113
8182
  /**
8114
- * Which paths a render is being computed FOR.
8183
+ * Which paths a preview is being computed FOR.
8115
8184
  *
8116
- * `executeRender` takes a whole module, so one request has always walked every
8117
- * node in it and run every `select` closure — for `handboka`, with `select` at
8185
+ * `executePreview` takes a whole module, so one request has always walked every
8186
+ * node in it and run every `preview` closure - for `handboka`, with `preview` at
8118
8187
  * two nested array levels, that is every chapter and every section to serve one
8119
8188
  * visible row. A scope is what makes the walk proportional to what is being
8120
8189
  * looked at instead of to the project.
8121
8190
  *
8122
8191
  * Two questions, because a container and its items need different answers:
8123
8192
  *
8124
- * - {@link RenderScope.wants} — is a render AT this exact path wanted? A
8193
+ * - {@link PreviewScope.wants} - is a preview AT this exact path wanted? A
8125
8194
  * container answers `true` here when the whole of it is being shown, and its
8126
- * list render is then computed in full.
8127
- * - {@link RenderScope.wantsUnder} — could anything at or below this path be
8195
+ * preview is then computed in full.
8196
+ * - {@link PreviewScope.wantsUnder} - could anything at or below this path be
8128
8197
  * wanted? Recursion is pruned where this is `false`, and a container whose own
8129
- * path is not wanted but which has wanted descendants renders a WINDOW: only
8198
+ * path is not wanted but which has wanted descendants previews a WINDOW: only
8130
8199
  * the items that were asked for. That is the case a single visible row is, and
8131
- * it is why {@link ListArrayRender} carries indices.
8200
+ * it is why {@link ArrayPreview} carries indices.
8132
8201
  *
8133
8202
  * Absent scope means the whole module, which is what every existing caller
8134
8203
  * passes and what every existing caller got.
@@ -8140,10 +8209,10 @@ function deserializeSchemaImpl(serialized) {
8140
8209
  * Compares SEGMENTS rather than string prefixes. A source path's module path is
8141
8210
  * a quoted, dot-joined encoding (`?p="a".1."b"`), so `startsWith` gets the
8142
8211
  * ancestor test wrong wherever a key is a prefix of a sibling key or contains a
8143
- * dot or a quote — `"title"` against `"titles"` being the cheapest example.
8212
+ * dot or a quote - `"title"` against `"titles"` being the cheapest example.
8144
8213
  * Segments are parsed once here, not per comparison.
8145
8214
  */
8146
- function renderScope(paths) {
8215
+ function previewScope(paths) {
8147
8216
  var wanted = paths.map(function (path) {
8148
8217
  var _splitModuleFilePathA = splitModuleFilePathAndModulePath(path),
8149
8218
  _splitModuleFilePathA2 = _slicedToArray(_splitModuleFilePathA, 2),
@@ -8192,6 +8261,37 @@ function renderScope(paths) {
8192
8261
 
8193
8262
  // TODO: improve this so that we do not get RawString and string, only string. Are there other things?
8194
8263
 
8264
+ /**
8265
+ * A RENDER is how one field is laid out in the editor: `s.string().render({ as:
8266
+ * "textarea" })`, `.render({ as: "code", language })`.
8267
+ *
8268
+ * It is static configuration - plain data, with no closure behind it and no
8269
+ * dependency on source - which is why it lives in the SERIALIZED schema
8270
+ * (`SerializedStringSchema.render`) and is read straight off it where the field
8271
+ * is drawn. There is no render pipeline, no store and no host round-trip.
8272
+ *
8273
+ * That "static" is an ASSUMPTION we are taking deliberately, for simplicity,
8274
+ * not a law. A future render could plausibly want to depend on source - a
8275
+ * layout that varies with the value, a callback of its own. If that day comes,
8276
+ * the shape it needs back is `executePreview`'s, and the honest move is to give
8277
+ * `render` its own execute/store pair again. It is NOT to re-merge the two:
8278
+ * conflating them is what this file was split up to undo.
8279
+ *
8280
+ * The dynamic, source-dependent, demand-scoped thing - what a container shows
8281
+ * for its items - is a PREVIEW. See `preview.ts`.
8282
+ */
8283
+ /**
8284
+ * The list is the declaration and {@link CodeLanguage} is derived from it, so
8285
+ * that a validator elsewhere (`shared`'s zod schema) can enumerate the same
8286
+ * languages without a second copy that drifts. Same shape as `COLOR_FORMATS`.
8287
+ */
8288
+ var CODE_LANGUAGES = ["typescript", "javascript", "javascriptreact", "typescriptreact", "json", "java", "html", "css", "xml", "markdown", "sql", "python", "rust", "php", "go", "cpp", "sass", "vue", "angular"];
8289
+
8290
+ /**
8291
+ * What `s.string().render(...)` takes, and what the serialized schema carries
8292
+ * verbatim.
8293
+ */
8294
+
8195
8295
  var externalPageRouter = {
8196
8296
  getRouterId: function getRouterId() {
8197
8297
  return "external-url-router";
@@ -8557,6 +8657,7 @@ function tryJsonParse(str) {
8557
8657
 
8558
8658
  exports.ArraySchema = ArraySchema;
8559
8659
  exports.BooleanSchema = BooleanSchema;
8660
+ exports.CODE_LANGUAGES = CODE_LANGUAGES;
8560
8661
  exports.COLOR_FORMATS = COLOR_FORMATS;
8561
8662
  exports.ColorSchema = ColorSchema;
8562
8663
  exports.DEFAULT_APP_HOST = DEFAULT_APP_HOST;
@@ -8588,6 +8689,7 @@ exports._createClass = _createClass;
8588
8689
  exports._slicedToArray = _slicedToArray;
8589
8690
  exports._toConsumableArray = _toConsumableArray;
8590
8691
  exports._typeof = _typeof;
8692
+ exports.computeValModuleShas = computeValModuleShas;
8591
8693
  exports.derefPatch = derefPatch;
8592
8694
  exports.deserializeSchema = deserializeSchema;
8593
8695
  exports.extractValModules = extractValModules;
@@ -8595,5 +8697,5 @@ exports.getSourcePathFromRoute = getSourcePathFromRoute;
8595
8697
  exports.hasRemoteFileSchema = hasRemoteFileSchema;
8596
8698
  exports.initVal = initVal;
8597
8699
  exports.modules = modules;
8598
- exports.renderScope = renderScope;
8700
+ exports.previewScope = previewScope;
8599
8701
  exports.splitModuleFilePathAndModulePath = splitModuleFilePathAndModulePath;