@remoteoss/json-schema-form 0.11.1-beta.0 → 0.11.1-dev.20240726080523

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/CHANGELOG.md CHANGED
@@ -1,9 +1,3 @@
1
- #### 0.11.1-beta.0 (2024-07-26)
2
-
3
- ##### Chores
4
-
5
- * **modify:** Add missing Typescript declarations ([#84](https://github.com/remoteoss/json-schema-form/pull/84)) ([86b3af2a](https://github.com/remoteoss/json-schema-form/commit/86b3af2a31981718ad349ac8d08fbdce3aa86acf))
6
-
7
1
  #### 0.11.0-beta.0 (2024-07-25)
8
2
 
9
3
  ##### Breaking changes
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.11.1-beta.0
5
- Generated: Fri, 26 Jul 2024 12:33:47 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.1-dev.20240726080523
5
+ Generated: Fri, 26 Jul 2024 08:05:36 GMT
6
6
 
7
7
  MIT License
8
8
 
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.11.1-beta.0
5
- Generated: Fri, 26 Jul 2024 12:33:47 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.1-dev.20240726080523
5
+ Generated: Fri, 26 Jul 2024 08:05:36 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -1,8 +1,8 @@
1
1
 
2
2
  /*!
3
3
  Copyright (c) 2024 Remote Technology, Inc.
4
- NPM Package: @remoteoss/json-schema-form@0.11.1-beta.0
5
- Generated: Fri, 26 Jul 2024 12:33:47 GMT
4
+ NPM Package: @remoteoss/json-schema-form@0.11.1-dev.20240726080523
5
+ Generated: Fri, 26 Jul 2024 08:05:36 GMT
6
6
 
7
7
  MIT License
8
8
 
@@ -1,3 +1,5 @@
1
+ import { WARNING_TYPES } from './src/modify';
2
+
1
3
  /**
2
4
  * Shorthand to lookup for keys with `x-jsf-*` preffix.
3
5
  */
@@ -135,23 +137,15 @@ type ModifyConfig = {
135
137
  muteLogging?: boolean;
136
138
  };
137
139
 
138
- type WarningType =
139
- | 'FIELD_TO_CHANGE_NOT_FOUND'
140
- | 'ORDER_MISSING_FIELDS'
141
- | 'FIELD_TO_CREATE_EXISTS'
142
- | 'PICK_MISSED_FIELD';
140
+ const warningTypes = WARNING_TYPES satisfies Record<string, string>;
141
+
142
+ type WARNING_TYPES = keyof typeof warningTypes;
143
143
 
144
- type Warning = {
144
+ type Warnings = {
145
145
  message: string;
146
- type: WarningType;
146
+ type: WARNING_TYPES;
147
147
  meta?: Record<string, unknown>;
148
- };
149
-
150
- type ModifyOutput = {
151
- schema: JSONSchemaObjectType;
152
- warnings: Warning[];
153
- };
154
-
148
+ }[];
155
149
  /**
156
150
  * Generates the Headless form based on the provided JSON schema
157
151
  */
@@ -162,16 +156,18 @@ export function createHeadlessForm(
162
156
  ): HeadlessFormOutput;
163
157
 
164
158
  /**
165
- * Returns a new JSON Schema modified based a given configuration.
166
- * This does not mutate the original JSON Schema.
159
+ * Modifies the JSON schema based on the provided configuration.
167
160
  */
168
161
  export function modify(
169
162
  /**
170
- * The original JSON schema as base to the modifications.
163
+ * The original JSON schema to be modified.
171
164
  */
172
165
  originalSchema: JSONSchemaObjectType,
173
166
  /**
174
- * The configuration object to create a new JSON Schema based on the originalSchema.
167
+ * The configuration object containing the fields and allFields properties.
175
168
  */
176
169
  config?: ModifyConfig
177
- ): ModifyOutput;
170
+ ): {
171
+ schema: JSONSchemaObjectType;
172
+ warnings: Warnings;
173
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remoteoss/json-schema-form",
3
- "version": "0.11.1-beta.0",
3
+ "version": "0.11.1-dev.20240726080523",
4
4
  "description": "Headless UI form powered by JSON Schemas",
5
5
  "author": "Remote.com <engineering@remote.com> (https://remote.com/)",
6
6
  "license": "MIT",