@stoplight/elements-core 7.7.13 → 7.7.14

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.
@@ -28,6 +28,6 @@ export declare function mapSchemaPropertiesToParameters(properties: {
28
28
  schema: import("json-schema").JSONSchema7 | undefined;
29
29
  examples: {
30
30
  key: string;
31
- value: string | number | true | import("json-schema").JSONSchema7Object | import("json-schema").JSONSchema7Array;
31
+ value: any;
32
32
  }[] | undefined;
33
33
  }[];
package/index.esm.js CHANGED
@@ -1121,7 +1121,9 @@ const initialParameterValues = params => {
1121
1121
  return mapValues(paramsByName, param => getInitialValueForParameter(param));
1122
1122
  };
1123
1123
  function mapSchemaPropertiesToParameters(properties, required) {
1124
- return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples ? [{ key: 'example', value: schema.examples }] : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1124
+ return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
1125
+ ? [{ key: 'example', value: schema.examples[0] }]
1126
+ : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1125
1127
  }
1126
1128
 
1127
1129
  const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
package/index.js CHANGED
@@ -1174,7 +1174,9 @@ const initialParameterValues = params => {
1174
1174
  return mapValues__default["default"](paramsByName, param => getInitialValueForParameter(param));
1175
1175
  };
1176
1176
  function mapSchemaPropertiesToParameters(properties, required) {
1177
- return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples ? [{ key: 'example', value: schema.examples }] : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1177
+ return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
1178
+ ? [{ key: 'example', value: schema.examples[0] }]
1179
+ : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1178
1180
  }
1179
1181
 
1180
1182
  const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
package/index.mjs CHANGED
@@ -1121,7 +1121,9 @@ const initialParameterValues = params => {
1121
1121
  return mapValues(paramsByName, param => getInitialValueForParameter(param));
1122
1122
  };
1123
1123
  function mapSchemaPropertiesToParameters(properties, required) {
1124
- return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples ? [{ key: 'example', value: schema.examples }] : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1124
+ return Object.entries(properties).map(([name, schema]) => (Object.assign({ name, schema: typeof schema !== 'boolean' ? schema : undefined, examples: typeof schema !== 'boolean' && schema.examples && schema.examples[0]
1125
+ ? [{ key: 'example', value: schema.examples[0] }]
1126
+ : undefined }, ((required === null || required === void 0 ? void 0 : required.includes(name)) && { required: true }))));
1125
1127
  }
1126
1128
 
1127
1129
  const ParameterEditor = ({ parameter, value, onChange, isOptional, onChangeOptional, canChangeOptional, validate, }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoplight/elements-core",
3
- "version": "7.7.13",
3
+ "version": "7.7.14",
4
4
  "main": "./index.js",
5
5
  "sideEffects": [
6
6
  "web-components.min.js",