@overmap-ai/core 1.0.35-fix-token-refresh-loop.1 → 1.0.35-fix-token-refresh-loop.2

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.
@@ -19,6 +19,8 @@ interface PatchFormProviderProps {
19
19
  * ``` */
20
20
  onError: (error: FormikErrors<Form | NewForm>) => void;
21
21
  className?: string;
22
+ /** If true, the form will only submit if there are changes. */
23
+ requiresDiff?: boolean;
22
24
  }
23
25
  /** Use PatchForms to create patch edits to existing forms rather than editing the entire form. */
24
26
  export declare const PatchFormProvider: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<PatchFormProviderProps & import("react").RefAttributes<HTMLFormElement>>>;
@@ -10229,7 +10229,7 @@ const PatchField = memo((props) => {
10229
10229
  PatchField.displayName = "PatchField";
10230
10230
  const PatchFormProvider = memo(
10231
10231
  forwardRef((props, ref) => {
10232
- const { children, schema, values, onPatch, onError, ...rest } = props;
10232
+ const { children, schema, values, onPatch, onError, requiresDiff = true, ...rest } = props;
10233
10233
  const initialValues2 = useMemo(() => initialFormValues(schema.fields, values), [schema.fields, values]);
10234
10234
  const handlePatch = useCallback(
10235
10235
  (values2) => {
@@ -10240,11 +10240,11 @@ const PatchFormProvider = memo(
10240
10240
  diff[key] = value;
10241
10241
  }
10242
10242
  }
10243
- if (!hasKeys(diff))
10243
+ if (requiresDiff && !hasKeys(diff))
10244
10244
  return;
10245
10245
  onPatch(diff);
10246
10246
  },
10247
- [initialValues2, onPatch]
10247
+ [initialValues2, onPatch, requiresDiff]
10248
10248
  );
10249
10249
  const validate = useCallback(
10250
10250
  (form) => {