@jsonforms/core 3.0.0-beta.5 → 3.0.0-rc.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.
Files changed (71) hide show
  1. package/docs/assets/js/search.json +1 -1
  2. package/docs/globals.html +206 -101
  3. package/docs/index.html +21 -3
  4. package/docs/interfaces/arraycontrolprops.html +21 -21
  5. package/docs/interfaces/arraylayoutprops.html +21 -21
  6. package/docs/interfaces/categorization.html +1 -1
  7. package/docs/interfaces/category.html +1 -1
  8. package/docs/interfaces/cellprops.html +12 -12
  9. package/docs/interfaces/combinatorrendererprops.html +18 -18
  10. package/docs/interfaces/controlelement.html +2 -2
  11. package/docs/interfaces/controlprops.html +16 -16
  12. package/docs/interfaces/controlstate.html +2 -2
  13. package/docs/interfaces/controlwithdetailprops.html +17 -17
  14. package/docs/interfaces/dispatchcellprops.html +10 -10
  15. package/docs/interfaces/dispatchcellstateprops.html +10 -10
  16. package/docs/interfaces/dispatchpropsofarraycontrol.html +4 -4
  17. package/docs/interfaces/dispatchpropsofcontrol.html +1 -1
  18. package/docs/interfaces/dispatchpropsofmultienumcontrol.html +2 -2
  19. package/docs/interfaces/enumcellprops.html +13 -13
  20. package/docs/interfaces/enumoption.html +2 -2
  21. package/docs/interfaces/grouplayout.html +2 -2
  22. package/docs/interfaces/internationalizable.html +3 -0
  23. package/docs/interfaces/jsonformsprops.html +24 -9
  24. package/docs/interfaces/{lableable.html → labelable.html} +7 -7
  25. package/docs/interfaces/labeled.html +2 -2
  26. package/docs/interfaces/labelelement.html +18 -0
  27. package/docs/interfaces/labelprops.html +339 -0
  28. package/docs/interfaces/layoutprops.html +25 -10
  29. package/docs/interfaces/ownpropsofcell.html +9 -9
  30. package/docs/interfaces/ownpropsofcontrol.html +9 -9
  31. package/docs/interfaces/ownpropsofenum.html +1 -1
  32. package/docs/interfaces/ownpropsofenumcell.html +10 -10
  33. package/docs/interfaces/ownpropsofjsonformsrenderer.html +8 -8
  34. package/docs/interfaces/ownpropsoflabel.html +286 -0
  35. package/docs/interfaces/ownpropsoflayout.html +9 -9
  36. package/docs/interfaces/ownpropsofmasterlistitem.html +6 -6
  37. package/docs/interfaces/ownpropsofrenderer.html +11 -8
  38. package/docs/interfaces/rendererprops.html +9 -9
  39. package/docs/interfaces/statepropsofarraycontrol.html +17 -17
  40. package/docs/interfaces/statepropsofarraylayout.html +17 -17
  41. package/docs/interfaces/statepropsofcell.html +11 -11
  42. package/docs/interfaces/statepropsofcombinator.html +17 -17
  43. package/docs/interfaces/statepropsofcontrol.html +15 -15
  44. package/docs/interfaces/statepropsofcontrolwithdetail.html +16 -16
  45. package/docs/interfaces/statepropsofenumcell.html +12 -12
  46. package/docs/interfaces/statepropsofjsonformsrenderer.html +23 -9
  47. package/docs/interfaces/statepropsoflabel.html +343 -0
  48. package/docs/interfaces/statepropsoflayout.html +24 -10
  49. package/docs/interfaces/statepropsofmasteritem.html +7 -7
  50. package/docs/interfaces/statepropsofrenderer.html +12 -9
  51. package/docs/interfaces/statepropsofscopedrenderer.html +12 -12
  52. package/docs/interfaces/testercontext.html +184 -0
  53. package/docs/interfaces/withclassname.html +1 -1
  54. package/lib/i18n/i18nUtil.d.ts +9 -4
  55. package/lib/jsonforms-core.cjs.js +61 -32
  56. package/lib/jsonforms-core.cjs.js.map +1 -1
  57. package/lib/jsonforms-core.esm.js +59 -33
  58. package/lib/jsonforms-core.esm.js.map +1 -1
  59. package/lib/models/uischema.d.ts +7 -7
  60. package/lib/reducers/i18n.d.ts +1 -1
  61. package/lib/testers/testers.d.ts +15 -6
  62. package/lib/util/renderer.d.ts +18 -1
  63. package/package.json +2 -2
  64. package/src/i18n/i18nUtil.ts +24 -7
  65. package/src/models/uischema.ts +8 -8
  66. package/src/reducers/i18n.ts +1 -1
  67. package/src/testers/testers.ts +33 -23
  68. package/src/util/renderer.ts +52 -25
  69. package/stats.html +1 -1
  70. package/test/testers.test.ts +40 -23
  71. package/test/util/renderer.test.ts +105 -7
@@ -298,7 +298,7 @@ const isLayout = (uischema) => uischema.elements !== undefined;
298
298
  const isScopable = (obj) => obj && typeof obj === 'object';
299
299
  const isScoped = (obj) => isScopable(obj) && typeof obj.scope === 'string';
300
300
  const isLabelable = (obj) => obj && typeof obj === 'object';
301
- const isLabeled = (obj) => isLabelable(obj) && ['string', 'object'].includes(typeof obj.label);
301
+ const isLabeled = (obj) => isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);
302
302
 
303
303
  const move = (array, index, delta) => {
304
304
  const newIndex = index + delta;
@@ -688,6 +688,18 @@ const getCombinedErrorMessage = (errors, et, t, schema, uischema, path) => {
688
688
  }
689
689
  return formatErrorMessage(errors.map(error => et(error, t, uischema)));
690
690
  };
691
+ const deriveLabelForUISchemaElement = (uischema, t) => {
692
+ if (uischema.label === false) {
693
+ return undefined;
694
+ }
695
+ if ((uischema.label === undefined || uischema.label === null || uischema.label === true) && !isInternationalized(uischema)) {
696
+ return undefined;
697
+ }
698
+ const stringifiedLabel = typeof uischema.label === 'string' ? uischema.label : JSON.stringify(uischema.label);
699
+ const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);
700
+ const i18nKey = typeof i18nKeyPrefix === 'string' ? `${i18nKeyPrefix}.label` : stringifiedLabel;
701
+ return t(i18nKey, stringifiedLabel, { uischema: uischema });
702
+ };
691
703
 
692
704
  const defaultJsonFormsI18nState = {
693
705
  locale: 'en',
@@ -761,7 +773,7 @@ const rendererReducer = (state = [], action) => {
761
773
 
762
774
  const NOT_APPLICABLE = -1;
763
775
  const isControl = (uischema) => !isEmpty(uischema) && uischema.scope !== undefined;
764
- const schemaMatches = (predicate) => (uischema, schema, rootSchema) => {
776
+ const schemaMatches = (predicate) => (uischema, schema, context) => {
765
777
  if (isEmpty(uischema) || !isControl(uischema)) {
766
778
  return false;
767
779
  }
@@ -774,27 +786,27 @@ const schemaMatches = (predicate) => (uischema, schema, rootSchema) => {
774
786
  }
775
787
  let currentDataSchema = schema;
776
788
  if (hasType(schema, 'object')) {
777
- currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
789
+ currentDataSchema = resolveSchema(schema, schemaPath, context?.rootSchema);
778
790
  }
779
791
  if (currentDataSchema === undefined) {
780
792
  return false;
781
793
  }
782
- return predicate(currentDataSchema, rootSchema);
794
+ return predicate(currentDataSchema, context?.rootSchema);
783
795
  };
784
- const schemaSubPathMatches = (subPath, predicate) => (uischema, schema, rootSchema) => {
796
+ const schemaSubPathMatches = (subPath, predicate) => (uischema, schema, context) => {
785
797
  if (isEmpty(uischema) || !isControl(uischema)) {
786
798
  return false;
787
799
  }
788
800
  const schemaPath = uischema.scope;
789
801
  let currentDataSchema = schema;
790
802
  if (hasType(schema, 'object')) {
791
- currentDataSchema = resolveSchema(schema, schemaPath, rootSchema);
803
+ currentDataSchema = resolveSchema(schema, schemaPath, context?.rootSchema);
792
804
  }
793
805
  currentDataSchema = get(currentDataSchema, subPath);
794
806
  if (currentDataSchema === undefined) {
795
807
  return false;
796
808
  }
797
- return predicate(currentDataSchema, rootSchema);
809
+ return predicate(currentDataSchema, context?.rootSchema);
798
810
  };
799
811
  const schemaTypeIs = (expectedType) => schemaMatches(schema => !isEmpty(schema) && hasType(schema, expectedType));
800
812
  const formatIs = (expectedFormat) => schemaMatches(schema => !isEmpty(schema) &&
@@ -821,16 +833,16 @@ const scopeEndIs = (expected) => (uischema) => {
821
833
  const schemaPath = uischema.scope;
822
834
  return !isEmpty(schemaPath) && last(schemaPath.split('/')) === expected;
823
835
  };
824
- const and = (...testers) => (uischema, schema, rootSchema) => testers.reduce((acc, tester) => acc && tester(uischema, schema, rootSchema), true);
825
- const or = (...testers) => (uischema, schema, rootSchema) => testers.reduce((acc, tester) => acc || tester(uischema, schema, rootSchema), false);
826
- const rankWith = (rank, tester) => (uischema, schema, rootSchema) => {
827
- if (tester(uischema, schema, rootSchema)) {
836
+ const and = (...testers) => (uischema, schema, context) => testers.reduce((acc, tester) => acc && tester(uischema, schema, context), true);
837
+ const or = (...testers) => (uischema, schema, context) => testers.reduce((acc, tester) => acc || tester(uischema, schema, context), false);
838
+ const rankWith = (rank, tester) => (uischema, schema, context) => {
839
+ if (tester(uischema, schema, context)) {
828
840
  return rank;
829
841
  }
830
842
  return NOT_APPLICABLE;
831
843
  };
832
- const withIncreasedRank = (by, rankedTester) => (uischema, schema, rootSchema) => {
833
- const rank = rankedTester(uischema, schema, rootSchema);
844
+ const withIncreasedRank = (by, rankedTester) => (uischema, schema, context) => {
845
+ const rank = rankedTester(uischema, schema, context);
834
846
  if (rank === NOT_APPLICABLE) {
835
847
  return NOT_APPLICABLE;
836
848
  }
@@ -878,12 +890,12 @@ const traverse = (any, pred, rootSchema) => {
878
890
  }
879
891
  return false;
880
892
  };
881
- const isObjectArrayWithNesting = (uischema, schema, rootSchema) => {
882
- if (!uiTypeIs('Control')(uischema, schema, rootSchema)) {
893
+ const isObjectArrayWithNesting = (uischema, schema, context) => {
894
+ if (!uiTypeIs('Control')(uischema, schema, context)) {
883
895
  return false;
884
896
  }
885
897
  const schemaPath = uischema.scope;
886
- const resolvedSchema = resolveSchema(schema, schemaPath, rootSchema ?? schema);
898
+ const resolvedSchema = resolveSchema(schema, schemaPath, context?.rootSchema ?? schema);
887
899
  let objectDepth = 0;
888
900
  if (resolvedSchema !== undefined && resolvedSchema.items !== undefined) {
889
901
  if (traverse(resolvedSchema.items, val => {
@@ -903,7 +915,7 @@ const isObjectArrayWithNesting = (uischema, schema, rootSchema) => {
903
915
  return true;
904
916
  }
905
917
  return false;
906
- }, rootSchema)) {
918
+ }, context?.rootSchema)) {
907
919
  return true;
908
920
  }
909
921
  if (uischema.options && uischema.options.detail) {
@@ -942,7 +954,7 @@ const hasCategory = (categorization) => {
942
954
  .reduce((prev, curr) => prev && curr, true);
943
955
  };
944
956
  const categorizationHasCategory = (uischema) => hasCategory(uischema);
945
- const not = (tester) => (uischema, schema, rootSchema) => !tester(uischema, schema, rootSchema);
957
+ const not = (tester) => (uischema, schema, context) => !tester(uischema, schema, context);
946
958
 
947
959
  var index$1 = /*#__PURE__*/Object.freeze({
948
960
  __proto__: null,
@@ -1653,6 +1665,8 @@ const mapStateToLayoutProps = (state, ownProps) => {
1653
1665
  const config = getConfig(state);
1654
1666
  const enabled = isInherentlyEnabled(state, ownProps, uischema, undefined,
1655
1667
  rootData, config);
1668
+ const t = getTranslator()(state);
1669
+ const label = isLabelable(uischema) ? deriveLabelForUISchemaElement(uischema, t) : undefined;
1656
1670
  return {
1657
1671
  ...layoutDefaultProps,
1658
1672
  renderers: ownProps.renderers || getRenderers(state),
@@ -1664,26 +1678,20 @@ const mapStateToLayoutProps = (state, ownProps) => {
1664
1678
  uischema: ownProps.uischema,
1665
1679
  schema: ownProps.schema,
1666
1680
  direction: ownProps.direction ?? getDirection(uischema),
1667
- config
1681
+ config,
1682
+ label
1668
1683
  };
1669
1684
  };
1670
1685
  const mapStateToJsonFormsRendererProps = (state, ownProps) => {
1671
- let uischema = ownProps.uischema;
1672
- if (uischema === undefined) {
1673
- if (ownProps.schema) {
1674
- uischema = findUISchema(state.jsonforms.uischemas, ownProps.schema, undefined, ownProps.path, undefined, undefined, state.jsonforms.core.schema);
1675
- }
1676
- else {
1677
- uischema = getUiSchema(state);
1678
- }
1679
- }
1680
1686
  return {
1681
- renderers: ownProps.renderers || get(state.jsonforms, 'renderers') || [],
1682
- cells: ownProps.cells || get(state.jsonforms, 'cells') || [],
1687
+ renderers: ownProps.renderers || get(state.jsonforms, 'renderers'),
1688
+ cells: ownProps.cells || get(state.jsonforms, 'cells'),
1683
1689
  schema: ownProps.schema || getSchema(state),
1684
1690
  rootSchema: getSchema(state),
1685
- uischema: uischema,
1686
- path: ownProps.path
1691
+ uischema: ownProps.uischema || getUiSchema(state),
1692
+ path: ownProps.path,
1693
+ enabled: ownProps.enabled,
1694
+ config: getConfig(state)
1687
1695
  };
1688
1696
  };
1689
1697
  const controlDefaultProps = {
@@ -1751,6 +1759,24 @@ const mapStateToArrayLayoutProps = (state, ownProps) => {
1751
1759
  minItems: schema.minItems
1752
1760
  };
1753
1761
  };
1762
+ const mapStateToLabelProps = (state, props) => {
1763
+ const { uischema } = props;
1764
+ const visible = props.visible === undefined || hasShowRule(uischema)
1765
+ ? isVisible(props.uischema, getData(state), props.path, getAjv(state))
1766
+ : props.visible;
1767
+ const text = uischema.text;
1768
+ const t = getTranslator()(state);
1769
+ const i18nKeyPrefix = getI18nKeyPrefixBySchema(undefined, uischema);
1770
+ const i18nKey = i18nKeyPrefix ? `${i18nKeyPrefix}.text` : text ?? '';
1771
+ const i18nText = t(i18nKey, text, { uischema });
1772
+ return {
1773
+ text: i18nText,
1774
+ visible,
1775
+ config: getConfig(state),
1776
+ renderers: props.renderers || getRenderers(state),
1777
+ cells: props.cells || getCells(state),
1778
+ };
1779
+ };
1754
1780
 
1755
1781
  const mapStateToCellProps = (state, ownProps) => {
1756
1782
  const { id, schema, path, uischema, renderers, cells } = ownProps;
@@ -2179,5 +2205,5 @@ const Helpers = {
2179
2205
  convertToValidClassName
2180
2206
  };
2181
2207
 
2182
- export { ADD_CELL, ADD_DEFAULT_DATA, ADD_RENDERER, ADD_UI_SCHEMA, index as Actions, Draft4, Generate, Helpers, INIT, NOT_APPLICABLE, Paths, REMOVE_CELL, REMOVE_DEFAULT_DATA, REMOVE_RENDERER, REMOVE_UI_SCHEMA, Resolve, RuleEffect, Runtime, SET_AJV, SET_CONFIG, SET_LOCALE, SET_SCHEMA, SET_TRANSLATOR, SET_UISCHEMA, SET_VALIDATION_MODE, index$1 as Test, UPDATE_CORE, UPDATE_DATA, UPDATE_ERRORS, UPDATE_I18N, VALIDATE, and, categorizationHasCategory, cellReducer, clearAllIds, compose, compose as composePaths, composeWithUi, computeLabel, configReducer, controlDefaultProps, convertToValidClassName, coreReducer, createAjv, createCleanLabel, createCombinatorRenderInfos, createControlElement, createDefaultValue, createId, createLabelDescriptionFrom, decode, defaultDataReducer, defaultErrorTranslator, defaultJsonFormsI18nState, defaultMapDispatchToControlProps, defaultMapStateToEnumCellProps, defaultTranslator, deriveTypes, encode, enumToEnumOptionMapper, errorAt, errorsAt, evalEnablement, evalVisibility, extractAjv, extractData, extractDefaultData, extractSchema, extractUiSchema, fetchErrorTranslator, fetchLocale, fetchTranslator, findAllRefs, findMatchingUISchema, findUISchema, formatErrorMessage, formatIs, generateDefaultUISchema, generateJsonSchema, getAjv, getCells, getCombinedErrorMessage, getConfig, getControlPath, getData, getDefaultData, getErrorAt, getErrorTranslator, getFirstPrimitiveProp, getI18nKey, getI18nKeyPrefix, getI18nKeyPrefixBySchema, getLocale, getRenderers, getSchema, getSubErrorsAt, getTranslator, getUISchemas, getUiSchema, hasCategory, hasEnableRule, hasShowRule, hasType, i18nReducer, init, isAllOfControl, isAnyOfControl, isArrayObjectControl, isBooleanControl, isCategorization, isCategory, isControl, isDateControl, isDateTimeControl, isDescriptionHidden, isEnabled, isEnumControl, isGroup, isInherentlyEnabled, isIntegerControl, isInternationalized, isLabelable, isLabeled, isLayout, isMultiLineControl, isNumberControl, isNumberFormatControl, isObjectArray, isObjectArrayControl, isObjectArrayWithNesting, isObjectControl, isOneOfControl, isOneOfEnumControl, isPrimitiveArrayControl, isRangeControl, isScopable, isScoped, isStringControl, isTimeControl, isVisible, iterateSchema, jsonFormsReducerConfig, layoutDefaultProps, mapDispatchToArrayControlProps, mapDispatchToCellProps, mapDispatchToControlProps, mapDispatchToMultiEnumProps, mapStateToAllOfProps, mapStateToAnyOfProps, mapStateToArrayControlProps, mapStateToArrayLayoutProps, mapStateToCellProps, mapStateToCombinatorRendererProps, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToDispatchCellProps, mapStateToEnumControlProps, mapStateToJsonFormsRendererProps, mapStateToLayoutProps, mapStateToMasterListItemProps, mapStateToMultiEnumControlProps, mapStateToOneOfEnumCellProps, mapStateToOneOfEnumControlProps, mapStateToOneOfProps, moveDown, moveUp, not, oneOfToEnumOptionMapper, optionIs, or, rankWith, registerCell, registerDefaultData, registerRenderer, registerUISchema, removeId, rendererReducer, resolveData, resolveSchema, schemaMatches, schemaSubPathMatches, schemaTypeIs, scopeEndIs, scopeEndsWith, setAjv, setConfig, setLocale, setReadonly, setSchema, setTranslator, setUISchema, setValidationMode, showAsRequired, subErrorsAt, toDataPath, toDataPathSegments, transformPathToI18nPrefix, uiTypeIs, uischemaRegistryReducer, unregisterCell, unregisterDefaultData, unregisterRenderer, unregisterUISchema, unsetReadonly, update, updateCore, updateErrors, updateI18n, validate, withIncreasedRank };
2208
+ export { ADD_CELL, ADD_DEFAULT_DATA, ADD_RENDERER, ADD_UI_SCHEMA, index as Actions, Draft4, Generate, Helpers, INIT, NOT_APPLICABLE, Paths, REMOVE_CELL, REMOVE_DEFAULT_DATA, REMOVE_RENDERER, REMOVE_UI_SCHEMA, Resolve, RuleEffect, Runtime, SET_AJV, SET_CONFIG, SET_LOCALE, SET_SCHEMA, SET_TRANSLATOR, SET_UISCHEMA, SET_VALIDATION_MODE, index$1 as Test, UPDATE_CORE, UPDATE_DATA, UPDATE_ERRORS, UPDATE_I18N, VALIDATE, and, categorizationHasCategory, cellReducer, clearAllIds, compose, compose as composePaths, composeWithUi, computeLabel, configReducer, controlDefaultProps, convertToValidClassName, coreReducer, createAjv, createCleanLabel, createCombinatorRenderInfos, createControlElement, createDefaultValue, createId, createLabelDescriptionFrom, decode, defaultDataReducer, defaultErrorTranslator, defaultJsonFormsI18nState, defaultMapDispatchToControlProps, defaultMapStateToEnumCellProps, defaultTranslator, deriveLabelForUISchemaElement, deriveTypes, encode, enumToEnumOptionMapper, errorAt, errorsAt, evalEnablement, evalVisibility, extractAjv, extractData, extractDefaultData, extractSchema, extractUiSchema, fetchErrorTranslator, fetchLocale, fetchTranslator, findAllRefs, findMatchingUISchema, findUISchema, formatErrorMessage, formatIs, generateDefaultUISchema, generateJsonSchema, getAjv, getCells, getCombinedErrorMessage, getConfig, getControlPath, getData, getDefaultData, getErrorAt, getErrorTranslator, getFirstPrimitiveProp, getI18nKey, getI18nKeyPrefix, getI18nKeyPrefixBySchema, getLocale, getRenderers, getSchema, getSubErrorsAt, getTranslator, getUISchemas, getUiSchema, hasCategory, hasEnableRule, hasShowRule, hasType, i18nReducer, init, isAllOfControl, isAnyOfControl, isArrayObjectControl, isBooleanControl, isCategorization, isCategory, isControl, isDateControl, isDateTimeControl, isDescriptionHidden, isEnabled, isEnumControl, isGroup, isInherentlyEnabled, isIntegerControl, isInternationalized, isLabelable, isLabeled, isLayout, isMultiLineControl, isNumberControl, isNumberFormatControl, isObjectArray, isObjectArrayControl, isObjectArrayWithNesting, isObjectControl, isOneOfControl, isOneOfEnumControl, isPrimitiveArrayControl, isRangeControl, isScopable, isScoped, isStringControl, isTimeControl, isVisible, iterateSchema, jsonFormsReducerConfig, layoutDefaultProps, mapDispatchToArrayControlProps, mapDispatchToCellProps, mapDispatchToControlProps, mapDispatchToMultiEnumProps, mapStateToAllOfProps, mapStateToAnyOfProps, mapStateToArrayControlProps, mapStateToArrayLayoutProps, mapStateToCellProps, mapStateToCombinatorRendererProps, mapStateToControlProps, mapStateToControlWithDetailProps, mapStateToDispatchCellProps, mapStateToEnumControlProps, mapStateToJsonFormsRendererProps, mapStateToLabelProps, mapStateToLayoutProps, mapStateToMasterListItemProps, mapStateToMultiEnumControlProps, mapStateToOneOfEnumCellProps, mapStateToOneOfEnumControlProps, mapStateToOneOfProps, moveDown, moveUp, not, oneOfToEnumOptionMapper, optionIs, or, rankWith, registerCell, registerDefaultData, registerRenderer, registerUISchema, removeId, rendererReducer, resolveData, resolveSchema, schemaMatches, schemaSubPathMatches, schemaTypeIs, scopeEndIs, scopeEndsWith, setAjv, setConfig, setLocale, setReadonly, setSchema, setTranslator, setUISchema, setValidationMode, showAsRequired, subErrorsAt, toDataPath, toDataPathSegments, transformPathToI18nPrefix, uiTypeIs, uischemaRegistryReducer, unregisterCell, unregisterDefaultData, unregisterRenderer, unregisterUISchema, unsetReadonly, update, updateCore, updateErrors, updateI18n, validate, withIncreasedRank };
2183
2209
  //# sourceMappingURL=jsonforms-core.esm.js.map