@abgov/jsonforms-components 1.30.0 → 1.31.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 (2) hide show
  1. package/index.esm.js +12 -11
  2. package/package.json +2 -1
package/index.esm.js CHANGED
@@ -10,8 +10,8 @@ import merge from 'lodash/merge';
10
10
  import isEmpty$1 from 'lodash/isEmpty';
11
11
  import range from 'lodash/range';
12
12
  import Ajv from 'ajv';
13
+ import addErrors from 'ajv-errors';
13
14
  import addFormats from 'ajv-formats';
14
- import _$8 from 'lodash';
15
15
 
16
16
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
17
17
 
@@ -6991,6 +6991,7 @@ const createDefaultAjv = (...schemas) => {
6991
6991
  strict: 'log'
6992
6992
  });
6993
6993
  ajv.addSchema(schemas);
6994
+ addErrors(ajv);
6994
6995
  ajv.addFormat('file-urn', /^urn:ads:platform:file-service:v[0-9]:\/files\/[a-zA-Z0-9.-]*$/);
6995
6996
  addFormats(ajv);
6996
6997
  return ajv;
@@ -8140,6 +8141,13 @@ $({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
8140
8141
  }
8141
8142
  });
8142
8143
 
8144
+ function addSchemaWithHttpUrlId(schemas, schema) {
8145
+ const id = schema.$id || schema.id;
8146
+ if (id && /^https?:\/\//.test(id)) {
8147
+ schemas[id] = schema;
8148
+ }
8149
+ return schemas;
8150
+ }
8143
8151
  let dereference;
8144
8152
  function resolveRefs(schema, ...refSchemas) {
8145
8153
  return __awaiter(this, void 0, void 0, function* () {
@@ -8150,17 +8158,10 @@ function resolveRefs(schema, ...refSchemas) {
8150
8158
  throw new Error('@apidevtools/json-schema-ref-parser is required for use of resolveRefs().');
8151
8159
  }
8152
8160
  }
8153
- const available = refSchemas.reduce((schemas, refSchema) => {
8154
- const id = refSchema.$id || refSchema.id;
8155
- if (id) {
8156
- schemas[id] = refSchema;
8157
- }
8158
- return schemas;
8159
- }, {});
8160
- // Clone since dereference will in place modify the input schema.
8161
- const source = _$8.cloneDeep(schema);
8162
- const result = yield dereference(source, {
8161
+ const available = refSchemas.reduce(addSchemaWithHttpUrlId, {});
8162
+ const result = yield dereference(schema, {
8163
8163
  continueOnError: false,
8164
+ mutateInputSchema: false,
8164
8165
  resolve: {
8165
8166
  http: false,
8166
8167
  file: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/jsonforms-components",
3
- "version": "1.30.0",
3
+ "version": "1.31.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Government of Alberta - React renderers for JSON Forms based on the design system.",
6
6
  "repository": "https://github.com/GovAlta/adsp-monorepo",
@@ -10,6 +10,7 @@
10
10
  "@jsonforms/react": "^3.1.0",
11
11
  "react": "^18.0.0",
12
12
  "ajv": "^8.6.1",
13
+ "ajv-errors": "^3.0.0",
13
14
  "ajv-formats": "^3.0.1"
14
15
  },
15
16
  "dependencies": {